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; } } }
@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); }
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; }
@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); }
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); }
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(); }
public CatalogueInfoPane() { super(); catName = new SimpleStringProperty(); catLecture = new SimpleStringProperty(); catSemester = new SimpleStringProperty(); maxPoints = new SimpleDoubleProperty(); EditorView.LOGGER_UI.trace("<init> CatalogueInfoPane"); initComponents(); layoutComponents(); }
@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") ); }
@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); }
@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()); }
@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); }
@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()])); }
@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); }
public final B maxHeight(final double MAX_HEIGHT) { properties.put("maxHeight", new SimpleDoubleProperty(MAX_HEIGHT)); return (B)this; }
/** * 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); }
public final B layoutY(final double LAYOUT_Y) { properties.put("layoutY", new SimpleDoubleProperty(LAYOUT_Y)); return (B)this; }
public final B heatMapOpacity(final double HEAT_MAP_OPACITY) { properties.put("heatMapOpacity", new SimpleDoubleProperty(HEAT_MAP_OPACITY)); return (B) this; }
public final B width(final double WIDTH) { properties.put("width", new SimpleDoubleProperty(WIDTH)); return (B) this; }
public final B prefHeight(final double PREF_HEIGHT) { properties.put("prefHeight", new SimpleDoubleProperty(PREF_HEIGHT)); return (B)this; }
public final B scaleX(final double SCALE_X) { properties.put("scaleX", new SimpleDoubleProperty(SCALE_X)); return (B)this; }
public final B minHeight(final double MIN_HEIGHT) { properties.put("minHeight", new SimpleDoubleProperty(MIN_HEIGHT)); return (B) this; }
public final B maxWidth(final double MAX_WIDTH) { properties.put("maxWidth", new SimpleDoubleProperty(MAX_WIDTH)); return (B)this; }
public final B minWidth(final double MIN_WIDTH) { properties.put("minWidth", new SimpleDoubleProperty(MIN_WIDTH)); return (B)this; }
public final B scaleY(final double SCALE_Y) { properties.put("scaleY", new SimpleDoubleProperty(SCALE_Y)); return (B)this; }
public final B layoutX(final double LAYOUT_X) { properties.put("layoutX", new SimpleDoubleProperty(LAYOUT_X)); return (B)this; }
public final B translateY(final double TRANSLATE_Y) { properties.put("translateY", new SimpleDoubleProperty(TRANSLATE_Y)); return (B)this; }
public final B value(final double VALUE) { properties.put("value", new SimpleDoubleProperty(VALUE)); return (B)this; }
public final B strokeWidth(final double WIDTH) { properties.put("strokeWidth", new SimpleDoubleProperty(WIDTH)); return (B)this; }
public final B connectionOpacity(final double OPACITY) { properties.put("connectionOpacity", new SimpleDoubleProperty(OPACITY)); return (B)this; }
public final B prefWidth(final double PREF_WIDTH) { properties.put("prefWidth", new SimpleDoubleProperty(PREF_WIDTH)); return (B)this; }
public final B minHeight(final double MIN_HEIGHT) { properties.put("minHeight", new SimpleDoubleProperty(MIN_HEIGHT)); return (B)this; }
public final B eventRadius(final double EVENT_RADIUS) { properties.put("eventRadius", new SimpleDoubleProperty(EVENT_RADIUS)); return (B) this; }
public static DragBounds generateLooseDragBounds() { return new ItemDragHelper.DragBounds(new SimpleDoubleProperty(Double.MIN_VALUE), new SimpleDoubleProperty(Double.MAX_VALUE),new SimpleDoubleProperty(Double.MIN_VALUE), new SimpleDoubleProperty(Double.MAX_VALUE)); }
public SimpleDoubleProperty voltageProperty(){ return voltageprop; }