java类javafx.beans.property.SimpleDoubleProperty的实例源码

ItemDragHelper.java 文件源码 项目:H-Uppaal 阅读 36 收藏 0 点赞 0 评论 0
public DragBounds(final List<DragBounds> dragBoundses) {
     minX = new SimpleDoubleProperty(Double.MIN_VALUE);
     maxX = new SimpleDoubleProperty(Double.MAX_VALUE);
     minY = new SimpleDoubleProperty(Double.MIN_VALUE);
     maxY = new SimpleDoubleProperty(Double.MAX_VALUE);

    for (final DragBounds dragBounds : dragBoundses) {
        if (dragBounds.minX.get() > minX.get()) {
            minX = dragBounds.minX;
        }

        if (dragBounds.maxX.get() < maxX.get()) {
            maxX = dragBounds.maxX;
        }

        if (dragBounds.minY.get() > minY.get()) {
            minY = dragBounds.minY;
        }

        if (dragBounds.maxY.get() < maxY.get()) {
            maxY = dragBounds.maxY;
        }
    }

}
TransitionView.java 文件源码 项目:DiaEd 阅读 35 收藏 0 点赞 0 评论 0
@Override
public void create() {
    arrow = new Arrow(model.getPositionX(), model.getPositionY(), model.getDestinationX(), model.getDestinationY());
    arrow.getStyleClass().add("transition");

    startPoint = new DragPoint(model.positionXProperty(), model.positionYProperty());
    endPoint = new DragPoint(model.destinationXProperty(), model.destinationYProperty());

    textX = new SimpleDoubleProperty((model.getPositionX() + model.getDestinationX()) / 2);
    textY = new SimpleDoubleProperty((model.getPositionY() + model.getDestinationY()) / 2 - 15);
    text = new EditableText(textX, textY);
    text.setText(model.getName());
    text.setWidth(150);


    this.getChildren().add(arrow);
    this.getChildren().add(startPoint);
    this.getChildren().add(endPoint);
    this.getChildren().add(text);
}
WorkflowResult.java 文件源码 项目:jedai-ui 阅读 47 收藏 0 点赞 0 评论 0
public WorkflowResult(SimpleIntegerProperty runNumber, SimpleDoubleProperty recall, SimpleDoubleProperty precision,
                      SimpleDoubleProperty f1Measure, SimpleDoubleProperty totalTime,
                      SimpleIntegerProperty inputInstances, SimpleIntegerProperty numOfClusters,
                      SimpleIntegerProperty detailsId) {
    this.runNumber = runNumber;
    this.recall = recall;
    this.precision = precision;
    this.f1Measure = f1Measure;
    this.totalTime = totalTime;
    this.inputInstances = inputInstances;
    this.numOfClusters = numOfClusters;
    this.detailsId = detailsId;
}
SubComponentController.java 文件源码 项目:H-Uppaal 阅读 36 收藏 0 点赞 0 评论 0
@Override
public ItemDragHelper.DragBounds getDragBounds() {
    final ObservableDoubleValue minX = new SimpleDoubleProperty(CanvasPresentation.GRID_SIZE);
    final ObservableDoubleValue maxX = getParentComponent().widthProperty().subtract(getSubComponent().widthProperty().add(CanvasPresentation.GRID_SIZE));
    final ObservableDoubleValue minY = new SimpleDoubleProperty(ComponentPresentation.TOOL_BAR_HEIGHT + CanvasPresentation.GRID_SIZE);
    final ObservableDoubleValue maxY = getParentComponent().heightProperty().subtract(getSubComponent().heightProperty().add(CanvasPresentation.GRID_SIZE));
    return new ItemDragHelper.DragBounds(minX, maxX, minY, maxY);
}
PlotDataTableModel.java 文件源码 项目:javafx-dataviewer 阅读 30 收藏 0 点赞 0 评论 0
public PlotDataTableModel(double xData, double yData, double zData) {
    this.xdata = new SimpleDoubleProperty();
    this.ydata = new SimpleDoubleProperty();
    this.zdata = new SimpleDoubleProperty();
    setXdata(xData);
    setYdata(yData);
    setZdata(zData);
}
DragBox.java 文件源码 项目:PhotoScript 阅读 37 收藏 0 点赞 0 评论 0
public DragBox(double x, double y, double w, double h, SHAPE.TYPE type, double rotate, double strokenWidth,
               double a, double r, double g, double b, double fa, double fr, double fg, double fb) {
    Width.set(w);
    Height.set(h);
    X = new SimpleDoubleProperty(x);
    Y = new SimpleDoubleProperty(y);
    this.rotate = rotate;
    this.strokeWidth = strokenWidth;
    this.type = type;
    paintFill = Color.color(fr, fg, fb, fa);
    paintStroke = Color.color(r, g, b, a);
    isLoadFromfile = true;
    isCopy = false;
    init();
}
CatalogueInfoPane.java 文件源码 项目:ReqMan 阅读 30 收藏 0 点赞 0 评论 0
public CatalogueInfoPane() {
    super();
    catName = new SimpleStringProperty();
    catLecture = new SimpleStringProperty();
    catSemester = new SimpleStringProperty();
    maxPoints = new SimpleDoubleProperty();
    EditorView.LOGGER_UI.trace("<init> CatalogueInfoPane");


    initComponents();
    layoutComponents();
}
PropertyUtilsTest.java 文件源码 项目:shuffleboard 阅读 38 收藏 0 点赞 0 评论 0
@Test
public void testBindBidirectionalWithConverterNullFirstInitialValue() {
  // given
  Property<String> str = new SimpleStringProperty(null);
  Property<Number> num = new SimpleDoubleProperty(0.0);

  // when
  PropertyUtils.bindBidirectionalWithConverter(str, num, Double::parseDouble, Object::toString);

  // then
  assertAll(
      () -> assertEquals("0.0", str.getValue(), "String was not set correctly"),
      () -> assertEquals(0.0, num.getValue().doubleValue(), "Number should not have changed")
  );
}
PreferencesUtilsTest.java 文件源码 项目:shuffleboard 阅读 31 收藏 0 点赞 0 评论 0
@Test
public void testReadDouble() {
  // given
  String name = "double";
  double value = Double.MIN_VALUE;
  DoubleProperty property = new SimpleDoubleProperty(null, name, -value);

  // when
  preferences.putDouble(name, value);

  // then
  PreferencesUtils.read(property, preferences);
  assertEquals(property.getValue().doubleValue(), value);
}
PreferencesUtilsTest.java 文件源码 项目:shuffleboard 阅读 38 收藏 0 点赞 0 评论 0
@Test
public void testReadWhenNoValuePresent() {
  // given
  double initialValue = 123.456;
  DoubleProperty property = new SimpleDoubleProperty(null, "foo", initialValue);

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

  // then
  assertEquals(initialValue, property.getValue().doubleValue());
}
JorkController.java 文件源码 项目:H-Uppaal 阅读 43 收藏 0 点赞 0 评论 0
@Override
public ItemDragHelper.DragBounds getDragBounds() {
    final ObservableDoubleValue minX = new SimpleDoubleProperty(CanvasPresentation.GRID_SIZE);
    final ObservableDoubleValue maxX = getComponent().widthProperty().subtract(JorkPresentation.JORK_WIDTH + CanvasPresentation.GRID_SIZE);
    final ObservableDoubleValue minY = new SimpleDoubleProperty(ComponentPresentation.TOOL_BAR_HEIGHT + CanvasPresentation.GRID_SIZE);
    final ObservableDoubleValue maxY = getComponent().heightProperty().subtract(JorkPresentation.JORK_HEIGHT + CanvasPresentation.GRID_SIZE);
    return new ItemDragHelper.DragBounds(minX, maxX, minY, maxY);
}
MultiAxisLineChart.java 文件源码 项目:MultiAxisCharts 阅读 29 收藏 0 点赞 0 评论 0
@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()]));
}
NailController.java 文件源码 项目:H-Uppaal 阅读 38 收藏 0 点赞 0 评论 0
@Override
public ItemDragHelper.DragBounds getDragBounds() {
    final ObservableDoubleValue minX = new SimpleDoubleProperty(CanvasPresentation.GRID_SIZE);
    final ObservableDoubleValue maxX = getComponent().widthProperty().subtract(CanvasPresentation.GRID_SIZE);
    final ObservableDoubleValue minY = new SimpleDoubleProperty(ComponentPresentation.TOOL_BAR_HEIGHT + CanvasPresentation.GRID_SIZE);
    final ObservableDoubleValue maxY = getComponent().heightProperty().subtract(CanvasPresentation.GRID_SIZE);

    return new ItemDragHelper.DragBounds(minX, maxX, minY, maxY);
}
NestedBarChartBuilder.java 文件源码 项目:charts 阅读 31 收藏 0 点赞 0 评论 0
public final B maxHeight(final double MAX_HEIGHT) {
    properties.put("maxHeight", new SimpleDoubleProperty(MAX_HEIGHT));
    return (B)this;
}
GraphDimensionsCalculator.java 文件源码 项目:hygene 阅读 34 收藏 0 点赞 0 评论 0
/**
 * Create a new instance of {@link GraphDimensionsCalculator}.
 *
 * @param graphStore the {@link GraphStore} who's {@link org.dnacronym.hygene.parser.GfaFile} is observed
 */
@Inject
@SuppressWarnings({"PMD.AvoidInstantiatingObjectsInLoops", "squid:S1188", "squid:S3776"})
public GraphDimensionsCalculator(final GraphStore graphStore) {
    observableQueryNodes = FXCollections.observableArrayList();
    readOnlyObservableNodes = new ReadOnlyListWrapper<>(observableQueryNodes);

    centerNodeIdProperty = new SimpleIntegerProperty(1);
    radiusProperty = new SimpleIntegerProperty(DEFAULT_RADIUS);

    nodeCountProperty = new SimpleIntegerProperty(1);

    centerNodeIdProperty.addListener((observable, oldValue, newValue) -> {
        if (newValue.intValue() < 1) {
            centerNodeIdProperty.set(1);
            return;
        }
        if (newValue.intValue() >= getNodeCountProperty().intValue() - 1) {
            centerNodeIdProperty.set(nodeCountProperty.intValue() - 2);
            return;
        }

        centerPointQuery.query(centerNodeIdProperty.get(), radiusProperty.get());
    });
    radiusProperty.addListener((observable, oldValue, newValue) -> {
        if (centerPointQuery == null) {
            return;
        }
        centerPointQuery.query(centerNodeIdProperty.get(), radiusProperty.get());
    });

    viewPointProperty = new SimpleLongProperty(2000);
    viewPointProperty.addListener((observable, oldValue, newValue) -> {
        if (newValue.longValue() < 0) {
            viewPointProperty.set(0);
            return;
        }
        final int sentinelId = getGraphProperty().get().getNodeArrays().length - 1;
        final long sentinelEndPosition = getGraphProperty().get().getRealEndXPosition(sentinelId);
        if (newValue.longValue() > sentinelEndPosition) {
            viewPointProperty.set(sentinelEndPosition);
            return;
        }

        centerNodeIdProperty.set(getGraphProperty().get().getNodeAtPosition(newValue.longValue()));
        calculate(subgraph);
    });
    viewRadiusProperty = new SimpleIntegerProperty(1);
    viewRadiusProperty.addListener((observable, oldValue, newValue) -> {
        calculate(subgraph);
        radiusProperty.set(((newValue.intValue() + FafospLayerer.LAYER_WIDTH - 1)
                / FafospLayerer.LAYER_WIDTH) / 2);
    });

    nodeHeightProperty = new SimpleDoubleProperty(1);
    laneHeightProperty = new SimpleDoubleProperty(1);
    laneCountProperty = new SimpleIntegerProperty(1);

    graphProperty = new SimpleObjectProperty<>();
    graphStore.getGfaFileProperty().addListener((observable, oldValue, newValue) -> setGraph(newValue.getGraph()));

    HygeneEventBus.getInstance().register(this);
}
SunburstChartBuilder.java 文件源码 项目:charts 阅读 37 收藏 0 点赞 0 评论 0
public final B layoutY(final double LAYOUT_Y) {
    properties.put("layoutY", new SimpleDoubleProperty(LAYOUT_Y));
    return (B)this;
}
WorldBuilder.java 文件源码 项目:worldheatmap 阅读 51 收藏 0 点赞 0 评论 0
public final B heatMapOpacity(final double HEAT_MAP_OPACITY) {
    properties.put("heatMapOpacity", new SimpleDoubleProperty(HEAT_MAP_OPACITY));
    return (B) this;
}
HeatMapBuilder.java 文件源码 项目:worldheatmap 阅读 42 收藏 0 点赞 0 评论 0
public final B width(final double WIDTH) {
    properties.put("width", new SimpleDoubleProperty(WIDTH));
    return (B) this;
}
SunburstChartBuilder.java 文件源码 项目:SunburstChart 阅读 39 收藏 0 点赞 0 评论 0
public final B prefHeight(final double PREF_HEIGHT) {
    properties.put("prefHeight", new SimpleDoubleProperty(PREF_HEIGHT));
    return (B)this;
}
SankeyPlotBuilder.java 文件源码 项目:charts 阅读 42 收藏 0 点赞 0 评论 0
public final B scaleX(final double SCALE_X) {
    properties.put("scaleX", new SimpleDoubleProperty(SCALE_X));
    return (B)this;
}
AxisBuilder.java 文件源码 项目:charts 阅读 37 收藏 0 点赞 0 评论 0
public final B minHeight(final double MIN_HEIGHT) {
    properties.put("minHeight", new SimpleDoubleProperty(MIN_HEIGHT));
    return (B) this;
}
SunburstChartBuilder.java 文件源码 项目:SunburstChart 阅读 37 收藏 0 点赞 0 评论 0
public final B maxWidth(final double MAX_WIDTH) {
    properties.put("maxWidth", new SimpleDoubleProperty(MAX_WIDTH));
    return (B)this;
}
SunburstChartBuilder.java 文件源码 项目:SunburstChart 阅读 46 收藏 0 点赞 0 评论 0
public final B maxHeight(final double MAX_HEIGHT) {
    properties.put("maxHeight", new SimpleDoubleProperty(MAX_HEIGHT));
    return (B)this;
}
WorldBuilder.java 文件源码 项目:charts 阅读 33 收藏 0 点赞 0 评论 0
public final B minWidth(final double MIN_WIDTH) {
    properties.put("minWidth", new SimpleDoubleProperty(MIN_WIDTH));
    return (B)this;
}
CoxcombChartBuilder.java 文件源码 项目:charts 阅读 33 收藏 0 点赞 0 评论 0
public final B scaleY(final double SCALE_Y) {
    properties.put("scaleY", new SimpleDoubleProperty(SCALE_Y));
    return (B)this;
}
SunburstChartBuilder.java 文件源码 项目:SunburstChart 阅读 30 收藏 0 点赞 0 评论 0
public final B layoutX(final double LAYOUT_X) {
    properties.put("layoutX", new SimpleDoubleProperty(LAYOUT_X));
    return (B)this;
}
SunburstChartBuilder.java 文件源码 项目:SunburstChart 阅读 34 收藏 0 点赞 0 评论 0
public final B layoutY(final double LAYOUT_Y) {
    properties.put("layoutY", new SimpleDoubleProperty(LAYOUT_Y));
    return (B)this;
}
SunburstChartBuilder.java 文件源码 项目:SunburstChart 阅读 51 收藏 0 点赞 0 评论 0
public final B translateY(final double TRANSLATE_Y) {
    properties.put("translateY", new SimpleDoubleProperty(TRANSLATE_Y));
    return (B)this;
}
ChartDataBuilder.java 文件源码 项目:SunburstChart 阅读 29 收藏 0 点赞 0 评论 0
public final B value(final double VALUE) {
    properties.put("value", new SimpleDoubleProperty(VALUE));
    return (B)this;
}
ChartItemSeriesBuilder.java 文件源码 项目:charts 阅读 35 收藏 0 点赞 0 评论 0
public final B strokeWidth(final double WIDTH) {
    properties.put("strokeWidth", new SimpleDoubleProperty(WIDTH));
    return (B)this;
}


问题


面经


文章

微信
公众号

扫码关注公众号