當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。