Java 类javafx.beans.property.DoubleProperty 实例源码

项目:marathonv5    文件:DataAppPreloader.java   
@Override public void start(Stage stage) throws Exception {
    preloaderStage = stage;
    preloaderStage.setScene(preloaderScene);
    preloaderStage.show();

    if (DEMO_MODE) {
        final DoubleProperty prog = new SimpleDoubleProperty(0){
            @Override protected void invalidated() {
                handleProgressNotification(new ProgressNotification(get()));
            }
        };
        Timeline t = new Timeline();
        t.getKeyFrames().add(new KeyFrame(Duration.seconds(20), new KeyValue(prog, 1)));
        t.play();
    }
}
项目:aem-epic-tool    文件:PackageOps.java   
public static PackageContents getPackageContents(PackageType pkg, AuthHandler handler, DoubleProperty progress) throws IOException {
    int retries = 3;
    if (app.getPackageContents(pkg) == null && retries > 0) {
        File targetFile = getPackageFile(pkg, handler, progress);
        Logger.getLogger(AppController.class.getName()).log(Level.INFO, "Package downloaded to {0}", targetFile.getPath());
        try {
            PackageContents contents = new PackageContents(targetFile, pkg);
            app.putPackageContents(pkg, contents);
            return contents;
        } catch (IOException ex) {
            Logger.getLogger(PackageOps.class.getName()).log(Level.SEVERE, null, ex);
            if (retries-- <= 0) {
                throw ex;
            } else {
                app.clearPackageContents(pkg);
            }
        }
    }
    return app.getPackageContents(pkg);
}
项目:VortexCompiler    文件:Library.java   
public void filesRead(DoubleProperty progress, double value) {
    double progressVal = value / (strFiles.size() + 1);
    clear();

    //Parser
    for (StringFile strFile : strFiles) {
        strFile.clearReadyData();
        Parser.parseTypedefs(strFile, strFile.getToken());
        typedefs.addAll(strFile.typedefs);
        nameSpaces.add(strFile.workspace.getNameSpace());

        progressAdd(progress, progressVal);
    }

    dataBaseInsert();
    progressAdd(progress, progressVal);
}
项目:VortexCompiler    文件:Library.java   
public void filesPreload(DoubleProperty progress, double value) {
    double progressVal = value / (strFiles.size() + typedefs.size() + 1);

    //Workspace Load ( remove usings errados )
    for (StringFile strFile : strFiles) {
        strFile.workspace.load();

        if (progress != null) progress.add(progressVal);
    }

    //Preload
    for (Typedef typedef : typedefs) {
        typedef.preload();
        progressAdd(progress, progressVal);
    }

    progressAdd(progress, progressVal);
}
项目:MultiAxisCharts    文件:MultiAxisLineChart.java   
@Override
protected void seriesAdded(Series<X, Y> series, int seriesIndex) {
    // create new path for series
    Path seriesLine = new Path();
    seriesLine.setStrokeLineJoin(StrokeLineJoin.BEVEL);
    series.setNode(seriesLine);
    // create series Y multiplier
    DoubleProperty seriesYAnimMultiplier = new SimpleDoubleProperty(this, "seriesYMultiplier");
    seriesYMultiplierMap.put(series, seriesYAnimMultiplier);
    // handle any data already in series
    if (shouldAnimate()) {
        seriesLine.setOpacity(0);
        seriesYAnimMultiplier.setValue(0d);
    } else {
        seriesYAnimMultiplier.setValue(1d);
    }
    getPlotChildren().add(seriesLine);

    List<KeyFrame> keyFrames = new ArrayList<KeyFrame>();
    if (shouldAnimate()) {
        // animate in new series
        keyFrames.add(new KeyFrame(Duration.ZERO, new KeyValue(seriesLine.opacityProperty(), 0),
                new KeyValue(seriesYAnimMultiplier, 0)));
        keyFrames.add(new KeyFrame(Duration.millis(200), new KeyValue(seriesLine.opacityProperty(), 1)));
        keyFrames.add(new KeyFrame(Duration.millis(500), new KeyValue(seriesYAnimMultiplier, 1)));
    }
    for (int j = 0; j < series.getData().size(); j++) {
        Data<X, Y> item = series.getData().get(j);
        final Node symbol = createSymbol(series, seriesIndex, item, j);
        if (symbol != null) {
            if (shouldAnimate())
                symbol.setOpacity(0);
            getPlotChildren().add(symbol);
            if (shouldAnimate()) {
                // fade in new symbol
                keyFrames.add(new KeyFrame(Duration.ZERO, new KeyValue(symbol.opacityProperty(), 0)));
                keyFrames.add(new KeyFrame(Duration.millis(200), new KeyValue(symbol.opacityProperty(), 1)));
            }
        }
    }
    if (shouldAnimate())
        animate(keyFrames.toArray(new KeyFrame[keyFrames.size()]));
}
项目:marathonv5    文件:SimplePropertySheet.java   
public static Object get(ObservableValue valueModel) {
    if (valueModel instanceof DoubleProperty) {
        return ((DoubleProperty)valueModel).get();
    } else if (valueModel instanceof ObjectProperty) {
        return ((ObjectProperty)valueModel).get();
    }

    return null;
}
项目:marathonv5    文件:SimplePropertySheet.java   
public static void set(ObservableValue valueModel, Object value) {
    if (valueModel instanceof DoubleProperty) {
        ((DoubleProperty)valueModel).set((Double)value);
    } else if (valueModel instanceof ObjectProperty) {
        ((ObjectProperty)valueModel).set(value);
    }
}
项目:fx-animation-editor    文件:PlayerHandler.java   
private KeyValue createKeyValue(NodeModel nodeModel, KeyValueModel keyValueModel) {
    Optional<DoubleProperty> doubleProperty = ModelFunctions.getDoubleProperty(nodeModel.getNode(), keyValueModel.getField());
    if (doubleProperty.isPresent()) {
        return new KeyValue(doubleProperty.get(), (double) keyValueModel.getValue(), keyValueModel.getInterpolator().toFxInterpolator());
    }
    Optional<ObjectProperty<Paint>> paintProperty = ModelFunctions.getPaintProperty(nodeModel.getNode(), keyValueModel.getField());
    if (paintProperty.isPresent()) {
        return new KeyValue(paintProperty.get(), (Paint) keyValueModel.getValue(), keyValueModel.getInterpolator().toFxInterpolator());
    }
    throw new UnsupportedOperationException();
}
项目:xbrowser    文件:View.java   
public DoubleProperty xProperty() throws InterruptedException, ExecutionException {

        if (Platform.isFxApplicationThread()) {
            return getNode().layoutXProperty();
        }
        final FutureTask<DoubleProperty> task = new FutureTask<>(() -> getNode().layoutXProperty());
        Platform.runLater(task);
        return task.get();


    }
项目:marathonv5    文件:SimplePropertySheet.java   
public static Object get(ObservableValue valueModel) {
    if (valueModel instanceof DoubleProperty) {
        return ((DoubleProperty)valueModel).get();
    } else if (valueModel instanceof ObjectProperty) {
        return ((ObjectProperty)valueModel).get();
    }

    return null;
}
项目:charts    文件:MatrixItemSeriesBuilder.java   
public final MatrixItemSeries build() {
    final MatrixItemSeries SERIES = new MatrixItemSeries();

    if (properties.keySet().contains("itemsArray")) {
        SERIES.setItems(((ObjectProperty<MatrixItem[]>) properties.get("itemsArray")).get());
    }
    if(properties.keySet().contains("itemsList")) {
        SERIES.setItems(((ObjectProperty<List<MatrixItem>>) properties.get("itemsList")).get());
    }

    for (String key : properties.keySet()) {
        if ("name".equals(key)) {
            SERIES.setName(((StringProperty) properties.get(key)).get());
        } else if ("fill".equals(key)) {
            SERIES.setFill(((ObjectProperty<Paint>) properties.get(key)).get());
        } else if ("stroke".equals(key)) {
            SERIES.setStroke(((ObjectProperty<Paint>) properties.get(key)).get());
        } else if ("symbolFill".equals(key)) {
            SERIES.setSymbolFill(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("symbolStroke".equals(key)) {
            SERIES.setSymbolStroke(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("symbol".equals(key)) {
            SERIES.setSymbol(((ObjectProperty<Symbol>) properties.get(key)).get());
        } else if ("chartType".equals(key)) {
            SERIES.setChartType(((ObjectProperty<ChartType>) properties.get(key)).get());
        } else if ("symbolsVisible".equals(key)) {
            SERIES.setSymbolsVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("symbolSize".equals(key)) {
            SERIES.setSymbolSize(((DoubleProperty) properties.get(key)).get());
        } else if ("strokeWidth".equals(key)) {
            SERIES.setStrokeWidth(((DoubleProperty) properties.get(key)).get());
        }
    }
    return SERIES;
}
项目:xbrowser    文件:View.java   
public DoubleProperty yProperty() throws InterruptedException, ExecutionException {

        if (Platform.isFxApplicationThread()) {
            return getNode().layoutYProperty();
        }
        final FutureTask<DoubleProperty> task = new FutureTask<>(() -> getNode().layoutYProperty());
        Platform.runLater(task);
        return task.get();


    }
项目:ServerBrowser    文件:FileUtility.java   
/**
 * Downloads a file and saves it at the given location.
 *
 * @param url
 *            the url to download from
 * @param outputPath
 *            the path where to save the downloaded file
 * @param progressProperty
 *            a property that will contain the current download process from 0.0 to 1.0
 * @param fileLength
 *            length of the file
 * @return the downloaded file
 * @throws IOException
 *             if an errors occurs while writing the file or opening the stream
 */
public static File downloadFile(final URL url, final String outputPath, final DoubleProperty progressProperty, final double fileLength) throws IOException {
    try (final InputStream input = url.openStream(); final FileOutputStream fileOutputStream = new FileOutputStream(outputPath);) {
        final double currentProgress = (int) progressProperty.get();
        final byte[] buffer = new byte[10000];
        while (true) {
            final double length = input.read(buffer);

            if (length <= 0) {
                break;
            }

            /*
             * Setting the progress property inside of a run later in order to avoid a crash,
             * since this function is usually used inside of a different thread than the ui
             * thread.
             */
            Platform.runLater(() -> {
                final double additional = length / fileLength * (1.0 - currentProgress);
                progressProperty.set(progressProperty.get() + additional);
            });

            fileOutputStream.write(buffer, 0, (int) length);
        }

        return new File(outputPath);
    }
}
项目:worldheatmap    文件:HeatMapBuilder.java   
public final HeatMap build() {
    double              width               = 400;
    double              height              = 400;
    ColorMapping        colorMapping        = ColorMapping.LIME_YELLOW_RED;
    double              eventRadius         = 15.5;
    boolean             fadeColors          = false;
    double              heatMapOpacity      = 0.5;
    OpacityDistribution opacityDistribution = OpacityDistribution.CUSTOM;

    for (String key : properties.keySet()) {
        if ("prefSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            width  = dim.getWidth();
            height = dim.getHeight();
        } else if ("width".equals(key)) {
            width = ((DoubleProperty) properties.get(key)).get();
        } else if ("height".equals(key)) {
            height = ((DoubleProperty) properties.get(key)).get();
        } else if ("colorMapping".equals(key)) {
            colorMapping = ((ObjectProperty<ColorMapping>) properties.get(key)).get();
        } else if ("eventRadius".equals(key)) {
            eventRadius = ((DoubleProperty) properties.get(key)).get();
        } else if ("fadeColors".equals(key)) {
            fadeColors = ((BooleanProperty) properties.get(key)).get();
        } else if ("heatMapOpacity".equals(key)) {
            heatMapOpacity = ((DoubleProperty) properties.get(key)).get();
        } else if ("opacityDistribution".equals(key)) {
            opacityDistribution = ((ObjectProperty<OpacityDistribution>) properties.get(key)).get();
        }
    }

    return new HeatMap(width,  height, colorMapping, eventRadius, fadeColors, heatMapOpacity, opacityDistribution);
}
项目:GameAuthoringEnvironment    文件:ImageEntryView.java   
public ImageEntryView (String label,
                       DoubleProperty width,
                       DoubleProperty height,
                       String cssClass) {
    this(label, cssClass);
    initImageView(width, height);
    init();

}
项目:xbrowser    文件:Canvas.java   
public DoubleProperty heightProperty()throws InterruptedException,ExecutionException{
    if (Platform.isFxApplicationThread()) {
        return body.heightProperty();
    }

    counter++;
    if(counter>maxCounter){
        throw new ExecutionException(new Exception(hint));
    }

    final FutureTask<DoubleProperty> task = new FutureTask<>(() -> body.heightProperty());
    Platform.runLater(task);
    return task.get();
}
项目:JavaFX-EX    文件:ResizeSupport.java   
public BaseResize(Node node, DoubleProperty width, DoubleProperty height) {
  super(node);
  this.width = width;
  this.height = height;
  enable.addListener((ob, o, n) -> {
    if (n == false) {
      setCursor(Corner.CENTER);
    }
  });
}
项目:LIRE-Lab    文件:CollectionGridPageFactory.java   
public CollectionGridPageFactory(List<Image> images,
                                 int pageSize,
                                 ImageClickHandler clickHandler,
                                 DoubleProperty gridGap,
                                 DoubleProperty imageHeight) {

    this.images = images;
    this.pageSize = pageSize;
    this.clickHandler = clickHandler;
    this.gridGap = gridGap;
    this.imageHeight = imageHeight;
}
项目:LivroJavaComoProgramar10Edicao    文件:VideoPlayerController.java   
public void initialize() 
{
   // get URL of the video file
   URL url = VideoPlayerController.class.getResource("sts117.mp4");

   // create a Media object for the specified URL
   Media media = new Media(url.toExternalForm());

   // create a MediaPlayer to control Media playback
   mediaPlayer = new MediaPlayer(media);

   // specify which MediaPlayer to display in the MediaView
   mediaView.setMediaPlayer(mediaPlayer); 

   // set handler to be called when the video completes playing
   mediaPlayer.setOnEndOfMedia(() -> {
      playing = false;
      playPauseButton.setText("Play");
   });

   // set handler that displays an ExceptionDialog if an error occurs
   mediaPlayer.setOnError(() -> {
      ExceptionDialog dialog = 
         new ExceptionDialog(mediaPlayer.getError());
       dialog.showAndWait();
   });

   // bind the MediaView's width/height to the scene's width/height
   DoubleProperty width = mediaView.fitWidthProperty();
   DoubleProperty height = mediaView.fitHeightProperty();
   width.bind(Bindings.selectDouble(
      mediaView.sceneProperty(), "width"));
   height.bind(Bindings.selectDouble(
      mediaView.sceneProperty(), "height")); 
}
项目:shuffleboard    文件:PreferencesUtilsTest.java   
@Test
public void testSaveDouble() {
  // given
  String name = "double";
  double value = Double.MAX_VALUE;
  DoubleProperty property = new SimpleDoubleProperty(null, name, value);

  // when
  PreferencesUtils.save(property, preferences);

  // then
  double saved = preferences.getDouble(name, -1);
  assertEquals(value, saved);
}
项目:xbrowser    文件:Canvas.java   
public DoubleProperty widthProperty()throws InterruptedException,ExecutionException{
    if (Platform.isFxApplicationThread()) {
        return body.widthProperty();
    }

    counter++;
    if(counter>maxCounter){
        throw new ExecutionException(new Exception(hint));
    }

    final FutureTask<DoubleProperty> task = new FutureTask<>(() -> body.widthProperty());
    Platform.runLater(task);
    return task.get();

}
项目:charts    文件:AreaHeatMapBuilder.java   
public final AreaHeatMap build() {
    final AreaHeatMap CONTROL = new AreaHeatMap();
    for (String key : properties.keySet()) {
        if ("prefSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("colorMapping".equals(key)) {
            CONTROL.setColorMapping(((ObjectProperty<ColorMapping>) properties.get(key)).get());
        } else if("useColorMapping".equals(key)) {
            CONTROL.setUseColorMapping(((BooleanProperty) properties.get(key)).get());
        } else if ("quality".equals(key)) {
            CONTROL.setQuality(((IntegerProperty) properties.get(key)).get());
        } else if ("heatMapOpacity".equals(key)) {
            CONTROL.setHeatMapOpacity(((DoubleProperty) properties.get(key)).get());
        } else if ("dataPointsVisible".equals(key)) {
            CONTROL.setDataPointsVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("smoothedHull".equals(key)) {
            CONTROL.setSmoothedHull(((BooleanProperty) properties.get(key)).get());
        } else if ("discreteColors".equals(key)) {
            CONTROL.setDiscreteColors(((BooleanProperty) properties.get(key)).get());
        } else if ("noOfCloserInfluentPoints".equals(key)) {
            CONTROL.setNoOfCloserInfluentPoints(((IntegerProperty) properties.get(key)).get());
        }
    }
    if (properties.keySet().contains("dataPointsArray")) {
        CONTROL.setDataPoints(((ObjectProperty<DataPoint[]>) properties.get("dataPointsArray")).get());
    }
    if(properties.keySet().contains("dataPointsList")) {
        CONTROL.setDataPoints(((ObjectProperty<List<DataPoint>>) properties.get("dataPointsList")).get());
    }
    return CONTROL;
}
项目:VortexCompiler    文件:Library.java   
public void filesCrossLoad(DoubleProperty progress, double value) {
    double progressVal = value / (typedefs.size() + 1);

    //Crossload
    for (Typedef typedef : typedefs) {
        typedef.crossLoad();
        progressAdd(progress, progressVal);
    }

    progressAdd(progress, progressVal);
}
项目:charts    文件:ChartItemBuilder.java   
public final ChartItem build() {
    final ChartItem ITEM = new ChartItem();
    for (String key : properties.keySet()) {
        if ("name".equals(key)) {
            ITEM.setName(((StringProperty) properties.get(key)).get());
        } else if ("value".equals(key)) {
            ITEM.setValue(((DoubleProperty) properties.get(key)).get());
        } else if("fill".equals(key)) {
            ITEM.setFill(((ObjectProperty<Color>) properties.get(key)).get());
        } else if("stroke".equals(key)) {
            ITEM.setStroke(((ObjectProperty<Color>) properties.get(key)).get());
        } else if("textColor".equals(key)) {
            ITEM.setTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if("timestamp".equals(key)) {
            ITEM.setTimestamp(((ObjectProperty<Instant>) properties.get(key)).get());
        } else if ("timestampDateTime".equals(key)) {
            ITEM.setTimestamp(((ObjectProperty<ZonedDateTime>) properties.get(key)).get());
        } else if("symbol".equals(key)) {
            ITEM.setSymbol(((ObjectProperty<Symbol>) properties.get(key)).get());
        } else if("animated".equals(key)) {
            ITEM.setAnimated(((BooleanProperty) properties.get(key)).get());
        } else if("animationDuration".equals(key)) {
            ITEM.setAnimationDuration(((LongProperty) properties.get(key)).get());
        }
    }
    return ITEM;
}
项目:VortexCompiler    文件:VolatileLibrary.java   
@Override
public void projectReload(boolean makeFile, DoubleProperty progress) {
    synchronized (compileLock) {
        syncToFiles();
        super.projectReload(makeFile, progress);
        syncToInner();
    }
}
项目:VortexCompiler    文件:VolatileLibrary.java   
@Override
public String[] projectExport(DoubleProperty progress, boolean asLib) {
    synchronized (compileLock) {
        syncToFiles();
        String[] textFiles;
        textFiles = super.projectExport(progress, asLib);

        syncToInner();
        return textFiles;
    }
}
项目:CORNETTO    文件:AnalysisData.java   
public static DoubleProperty posCorrelationUpperFilterProperty() {
    return posCorrelationUpperFilter;
}
项目:KNOBS    文件:Knob.java   
public DoubleProperty maxValueProperty() {
    return maxValue;
}
项目:H-Uppaal    文件:MouseTracker.java   
public DoubleProperty yProperty() {
    return yProperty;
}
项目:xbrowser    文件:Control.java   
public DoubleProperty xProperty() throws InterruptedException,ExecutionException{
    if(Platform.isFxApplicationThread()) return body.layoutXProperty();
    final FutureTask<DoubleProperty> task = new FutureTask<>(()->body.layoutXProperty());
    Platform.runLater(task);
    return task.get();
}
项目:H-Uppaal    文件:Nail.java   
public DoubleProperty propertyYProperty() {
    return propertyY;
}
项目:marathonv5    文件:TimeRangeSelector.java   
public DoubleProperty getRightValue() {
    return endValue;
}
项目:shuffleboard    文件:LinearIndicator.java   
public DoubleProperty centerProperty() {
  return center;
}
项目:KNOBS    文件:Knob.java   
protected DoubleProperty angleStepProperty() {
    return angleStep;
}
项目:CORNETTO    文件:AnalysisData.java   
public static DoubleProperty minFrequencyProperty() {
    return minFrequencyFilter;
}
项目:xbrowser    文件:Group.java   
public DoubleProperty widthProperty(){
    return background.widthProperty();
}
项目:boomer-tuner    文件:Player.java   
public DoubleProperty volumeProperty() {
    return volume;
}
项目:GameAuthoringEnvironment    文件:TextGraphic.java   
@Override
public DoubleProperty getHeight () {
    return new SimpleDoubleProperty(0);
}
项目:GameAuthoringEnvironment    文件:SizeableGraphic.java   
@Override
public DoubleProperty getWidth () {
    return myWidth;
}
项目:GameAuthoringEnvironment    文件:Attribute.java   
@Override
public DoubleProperty getValueProperty () {
    return myValue;
}