当前位置: 首页>>代码示例>>Java>>正文


Java SimpleDoubleProperty类代码示例

本文整理汇总了Java中javafx.beans.property.SimpleDoubleProperty的典型用法代码示例。如果您正苦于以下问题:Java SimpleDoubleProperty类的具体用法?Java SimpleDoubleProperty怎么用?Java SimpleDoubleProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SimpleDoubleProperty类属于javafx.beans.property包,在下文中一共展示了SimpleDoubleProperty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DragBounds

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
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;
        }
    }

}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:26,代码来源:ItemDragHelper.java

示例2: create

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
@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);
}
 
开发者ID:ucfan,项目名称:DiaEd,代码行数:21,代码来源:TransitionView.java

示例3: WorkflowResult

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
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;
}
 
开发者ID:scify,项目名称:jedai-ui,代码行数:14,代码来源:WorkflowResult.java

示例4: getDragBounds

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
@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);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:9,代码来源:SubComponentController.java

示例5: PlotDataTableModel

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
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);
}
 
开发者ID:jasrodis,项目名称:javafx-dataviewer,代码行数:9,代码来源:PlotDataTableModel.java

示例6: DragBox

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
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();
}
 
开发者ID:xfangfang,项目名称:PhotoScript,代码行数:16,代码来源:DragBox.java

示例7: CatalogueInfoPane

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
public CatalogueInfoPane() {
    super();
    catName = new SimpleStringProperty();
    catLecture = new SimpleStringProperty();
    catSemester = new SimpleStringProperty();
    maxPoints = new SimpleDoubleProperty();
    EditorView.LOGGER_UI.trace("<init> CatalogueInfoPane");


    initComponents();
    layoutComponents();
}
 
开发者ID:dbisUnibas,项目名称:ReqMan,代码行数:13,代码来源:CatalogueInfoPane.java

示例8: testBindBidirectionalWithConverterNullFirstInitialValue

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
@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")
  );
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:16,代码来源:PropertyUtilsTest.java

示例9: testReadDouble

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
@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);
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:15,代码来源:PreferencesUtilsTest.java

示例10: testReadWhenNoValuePresent

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
@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());
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:13,代码来源:PreferencesUtilsTest.java

示例11: getDragBounds

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
@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);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:9,代码来源:JorkController.java

示例12: seriesAdded

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
@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()]));
}
 
开发者ID:JKostikiadis,项目名称:MultiAxisCharts,代码行数:44,代码来源:MultiAxisLineChart.java

示例13: getDragBounds

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
@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);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:10,代码来源:NailController.java

示例14: maxHeight

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
public final B maxHeight(final double MAX_HEIGHT) {
    properties.put("maxHeight", new SimpleDoubleProperty(MAX_HEIGHT));
    return (B)this;
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:5,代码来源:NestedBarChartBuilder.java

示例15: GraphDimensionsCalculator

import javafx.beans.property.SimpleDoubleProperty; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:ProgrammingLife2017,项目名称:hygene,代码行数:68,代码来源:GraphDimensionsCalculator.java


注:本文中的javafx.beans.property.SimpleDoubleProperty类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。