javafx.beans.property.LongProperty Java Examples

The following examples show how to use javafx.beans.property.LongProperty. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FibTest.java    From ReactFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static void main(String[] args) {
    int n = 40;

    FibTest eagerTest = new FibTest(n);
    LongProperty eagerResult = new SimpleLongProperty();
    eagerTest.setupFor(eagerResult);

    FibTest lazyTest = new FibTest(n);
    SuspendableVar<Number> lazyResult = Var.suspendable(Var.newSimpleVar(0L));
    lazyTest.setupFor(lazyResult);

    long t1 = System.currentTimeMillis();
    eagerTest.run();
    long t2 = System.currentTimeMillis();
    double eagerTime = (t2-t1)/1000.0;

    t1 = System.currentTimeMillis();
    Guard g = lazyResult.suspend();
    lazyTest.run();
    g.close();
    t2 = System.currentTimeMillis();
    double lazyTime = (t2-t1)/1000.0;

    System.out.println("EAGER TEST:");
    System.out.println("    fib_" + n + " = " + eagerResult.get());
    System.out.println("    result invalidations: " + eagerTest.invalidationCount);
    System.out.println("    duration: " + eagerTime + " seconds");
    System.out.println();
    System.out.println("LAZY TEST:");
    System.out.println("    fib_" + n + " = " + lazyResult.getValue());
    System.out.println("    result invalidations: " + lazyTest.invalidationCount);
    System.out.println("    duration: " + lazyTime + " seconds");
}
 
Example #2
Source File: FXWrapper.java    From dolphin-platform with Apache License 2.0 5 votes vote down vote up
/**
 * Create a JavaFX {@link javafx.beans.property.LongProperty} as a wrapper for a dolphin platform property
 *
 * @param dolphinProperty the dolphin platform property
 * @return the JavaFX property
 */
public static LongProperty wrapLongProperty(final Property<Long> dolphinProperty) {
    Assert.requireNonNull(dolphinProperty, "dolphinProperty");
    final LongProperty property = new SimpleLongProperty();
    FXBinder.bind(property).bidirectionalToNumeric(dolphinProperty);
    return property;
}
 
Example #3
Source File: ChartItemSeriesBuilder.java    From charts with Apache License 2.0 5 votes vote down vote up
public final ChartItemSeries build() {
    final ChartItemSeries SERIES = new ChartItemSeries();

    if (properties.keySet().contains("itemsArray")) {
        SERIES.setItems(((ObjectProperty<ChartItem[]>) properties.get("itemsArray")).get());
    }
    if(properties.keySet().contains("itemsList")) {
        SERIES.setItems(((ObjectProperty<List<ChartItem>>) 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 ("textFill".equals(key)) {
            SERIES.setTextFill(((ObjectProperty<Color>) 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 ("symbolSize".equals(key)) {
            SERIES.setSymbolSize(((DoubleProperty) properties.get(key)).get());
        } else if ("strokeWidth".equals(key)) {
            SERIES.setStrokeWidth(((DoubleProperty) properties.get(key)).get());
        } else if("animated".equals(key)) {
            SERIES.setAnimated(((BooleanProperty) properties.get(key)).get());
        } else if("animationDuration".equals(key)) {
            SERIES.setAnimationDuration(((LongProperty) properties.get(key)).get());
        }
    }
    return SERIES;
}
 
Example #4
Source File: ChartItemBuilder.java    From charts with Apache License 2.0 5 votes vote down vote up
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 ("unit".equals(key)) {
            ITEM.setUnit(((StringProperty) 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("textFill".equals(key)) {
            ITEM.setTextFill(((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());
        } else if ("x".equals(key)) {
            ITEM.setX(((DoubleProperty) properties.get(key)).get());
        } else if ("y".equals(key)) {
            ITEM.setY(((DoubleProperty) properties.get(key)).get());
        }
    }
    return ITEM;
}
 
Example #5
Source File: PainteraAlerts.java    From paintera with GNU General Public License v2.0 5 votes vote down vote up
private static void findMaxId(
		final DataSource<? extends IntegerType<?>, ?> source,
		final int level,
		final LongConsumer maxIdTracker,
		final AtomicBoolean cancel,
		final DoubleConsumer progressTracker) {
	final RandomAccessibleInterval<? extends IntegerType<?>> rai = source.getDataSource(0, level);
	final ReadOnlyLongWrapper totalNumVoxels = new ReadOnlyLongWrapper(Intervals.numElements(rai));
	maxIdTracker.accept(org.janelia.saalfeldlab.labels.Label.getINVALID());
	final LongProperty numProcessedVoxels = new SimpleLongProperty(0);
	numProcessedVoxels.addListener((obs, oldv, newv) -> progressTracker.accept(numProcessedVoxels.doubleValue() / totalNumVoxels.doubleValue()));

	final int[] blockSize = blockSizeFromRai(rai);
	final List<Interval> intervals = Grids.collectAllContainedIntervals(Intervals.minAsLongArray(rai), Intervals.maxAsLongArray(rai), blockSize);

	final ExecutorService es = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
	final List<Future<?>> futures = new ArrayList<>();
	for (final Interval interval : intervals) {
		futures.add(es.submit(() -> {
			synchronized (cancel) {
				if (cancel.get())
					return;
			}
			final RandomAccessibleInterval<? extends IntegerType<?>> slice = Views.interval(rai, interval);
			final long maxId = findMaxId(slice);
			synchronized (cancel) {
				if (!cancel.get()) {
					numProcessedVoxels.set(numProcessedVoxels.get() + Intervals.numElements(slice));
					maxIdTracker.accept(maxId);
				}
			}
		}));
	}
	futures.forEach(ThrowingConsumer.unchecked(Future::get));
	es.shutdown();
}
 
Example #6
Source File: Statistic.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
public LongProperty receivedBytesProperty() {
    return receivedBytes;
}
 
Example #7
Source File: LedBuilder.java    From JFX8CustomControls with Apache License 2.0 4 votes vote down vote up
public final jfx8controls.ledcss.Led build() {
    final jfx8controls.ledcss.Led CONTROL = new jfx8controls.ledcss.Led();
    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("prefWidth".equals(key)) {
            CONTROL.setPrefWidth(((DoubleProperty) properties.get(key)).get());
        } else if("prefHeight".equals(key)) {
            CONTROL.setPrefHeight(((DoubleProperty) properties.get(key)).get());
        } else if("minWidth".equals(key)) {
            CONTROL.setMinWidth(((DoubleProperty) properties.get(key)).get());
        } else if("minHeight".equals(key)) {
            CONTROL.setMinHeight(((DoubleProperty) properties.get(key)).get());
        } else if("maxWidth".equals(key)) {
            CONTROL.setMaxWidth(((DoubleProperty) properties.get(key)).get());
        } else if("maxHeight".equals(key)) {
            CONTROL.setMaxHeight(((DoubleProperty) properties.get(key)).get());
        } else if("scaleX".equals(key)) {
            CONTROL.setScaleX(((DoubleProperty) properties.get(key)).get());
        } else if("scaleY".equals(key)) {
            CONTROL.setScaleY(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutX".equals(key)) {
            CONTROL.setLayoutX(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutY".equals(key)) {
            CONTROL.setLayoutY(((DoubleProperty) properties.get(key)).get());
        } else if ("translateX".equals(key)) {
            CONTROL.setTranslateX(((DoubleProperty) properties.get(key)).get());
        } else if ("translateY".equals(key)) {
            CONTROL.setTranslateY(((DoubleProperty) properties.get(key)).get());
        } else if("styleClass".equals(key)) {
            CONTROL.getStyleClass().setAll("led", ((StringProperty) properties.get(key)).get());
        } else if ("ledColor".equals(key)) {
            CONTROL.setLedColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("on".equals(key)) {
            CONTROL.setOn(((BooleanProperty) properties.get(key)).get());
        } else if ("blink".equals(key)) {
            CONTROL.setBlinking(((BooleanProperty) properties.get(key)).get());
        } else if ("interval".equals(key)) {
            CONTROL.setInterval(((LongProperty) properties.get(key)).get());
        } else if ("frameVisible".equals(key)) {
            CONTROL.setFrameVisible(((BooleanProperty) properties.get(key)).get());
        }
    }
    return CONTROL;
}
 
Example #8
Source File: Statistic.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
public LongProperty sentBytesProperty() {
    return sentBytes;
}
 
Example #9
Source File: Statistic.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
public static LongProperty totalReceivedBytesProperty() {
    return totalReceivedBytes;
}
 
Example #10
Source File: Statistic.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
public static LongProperty totalSentBytesProperty() {
    return totalSentBytes;
}
 
Example #11
Source File: LedBuilder.java    From JFX8CustomControls with Apache License 2.0 4 votes vote down vote up
public final Led build() {
    final Led CONTROL = new Led();
    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("prefWidth".equals(key)) {
            CONTROL.setPrefWidth(((DoubleProperty) properties.get(key)).get());
        } else if("prefHeight".equals(key)) {
            CONTROL.setPrefHeight(((DoubleProperty) properties.get(key)).get());
        } else if("minWidth".equals(key)) {
            CONTROL.setMinWidth(((DoubleProperty) properties.get(key)).get());
        } else if("minHeight".equals(key)) {
            CONTROL.setMinHeight(((DoubleProperty) properties.get(key)).get());
        } else if("maxWidth".equals(key)) {
            CONTROL.setMaxWidth(((DoubleProperty) properties.get(key)).get());
        } else if("maxHeight".equals(key)) {
            CONTROL.setMaxHeight(((DoubleProperty) properties.get(key)).get());
        } else if("scaleX".equals(key)) {
            CONTROL.setScaleX(((DoubleProperty) properties.get(key)).get());
        } else if("scaleY".equals(key)) {
            CONTROL.setScaleY(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutX".equals(key)) {
            CONTROL.setLayoutX(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutY".equals(key)) {
            CONTROL.setLayoutY(((DoubleProperty) properties.get(key)).get());
        } else if ("translateX".equals(key)) {
            CONTROL.setTranslateX(((DoubleProperty) properties.get(key)).get());
        } else if ("translateY".equals(key)) {
            CONTROL.setTranslateY(((DoubleProperty) properties.get(key)).get());
        } else if("styleClass".equals(key)) {
            CONTROL.getStyleClass().setAll("led", ((StringProperty) properties.get(key)).get());
        } else if ("ledColor".equals(key)) {
            CONTROL.setLedColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("on".equals(key)) {
            CONTROL.setOn(((BooleanProperty) properties.get(key)).get());
        } else if ("blink".equals(key)) {
            CONTROL.setBlinking(((BooleanProperty) properties.get(key)).get());
        } else if ("interval".equals(key)) {
            CONTROL.setInterval(((LongProperty) properties.get(key)).get());
        } else if ("frameVisible".equals(key)) {
            CONTROL.setFrameVisible(((BooleanProperty) properties.get(key)).get());
        }
    }
    return CONTROL;
}
 
Example #12
Source File: RunnerResult.java    From curly with Apache License 2.0 4 votes vote down vote up
public LongProperty endTime() {
    return endTime;
}
 
Example #13
Source File: FibTest.java    From ReactFX with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void run() {
    ((LongProperty) fib[1]).set(1);
}
 
Example #14
Source File: RunnerResult.java    From curly with Apache License 2.0 4 votes vote down vote up
public LongProperty startTime() {
    return startTime;
}
 
Example #15
Source File: BatchRunnerResult.java    From curly with Apache License 2.0 4 votes vote down vote up
public LongProperty timeRemainingProperty() {
    return timeRemaining;
}
 
Example #16
Source File: BatchRunnerResult.java    From curly with Apache License 2.0 4 votes vote down vote up
public LongProperty timeEllapsedProperty() {
    return timeEllapsed;
}
 
Example #17
Source File: LongJavaFXBidirectionalBinder.java    From dolphin-platform with Apache License 2.0 4 votes vote down vote up
public LongJavaFXBidirectionalBinder(final LongProperty javaFxProperty) {
    super(javaFxProperty);
}
 
Example #18
Source File: TableItemTask.java    From megan-ce with GNU General Public License v3.0 4 votes vote down vote up
private ListChangeListener<IMatchBlock> createChangeListener(final TableItem tableItem, final LongProperty previousSelectionTime) {
    final ReadLayoutPane pane = tableItem.getPane();
    return c -> {
        if (c.next()) {

            if (!pane.getMatchSelection().isEmpty())
                tableView.getSelectionModel().select(tableItem);
        }
        if (System.currentTimeMillis() - 200 > previousSelectionTime.get()) { // only if sufficient time has passed since last scroll...
            try {
                final double focusCoordinate;
                int focusIndex = pane.getMatchSelection().getFocusIndex();
                if (focusIndex >= 0 && pane.getMatchSelection().getItems()[focusIndex] != null) {
                    final IMatchBlock focusMatch = pane.getMatchSelection().getItems()[focusIndex];
                    focusCoordinate = 0.5 * (focusMatch.getAlignedQueryStart() + focusMatch.getAlignedQueryEnd());
                    double leadingWidth = 0;
                    double lastWidth = 0;
                    double totalWidth = 0;
                    {
                        int numberOfColumns = tableView.getColumns().size();
                        int columns = 0;
                        for (TableColumn col : tableView.getColumns()) {
                            if (col.isVisible()) {
                                if (columns < numberOfColumns - 1)
                                    leadingWidth += col.getWidth();
                                else
                                    lastWidth = col.getWidth();
                                totalWidth += col.getWidth();
                            }
                            columns++;
                        }
                    }

                    final double coordinateToShow = leadingWidth + lastWidth * (focusCoordinate / maxReadLength.get());
                    final ScrollBar hScrollBar = FXUtilities.findScrollBar(tableView, Orientation.HORIZONTAL);

                    if (hScrollBar != null) { // should never be null, but best to check...
                        final double newPos = (hScrollBar.getMax() - hScrollBar.getMin()) * ((coordinateToShow) / totalWidth);

                        Platform.runLater(() -> {
                            tableView.scrollTo(tableItem);
                            hScrollBar.setValue(newPos);
                        });
                    }
                }
            } catch (Exception ignored) {
            }
        }
        previousSelectionTime.set(System.currentTimeMillis());
    };
}
 
Example #19
Source File: FXTimer.java    From TweetwallFX with MIT License 4 votes vote down vote up
public LongProperty updateDelayProperty() {
    return updateDelay;
}
 
Example #20
Source File: Preferences.java    From bisq-core with GNU Affero General Public License v3.0 4 votes vote down vote up
public LongProperty withdrawalTxFeeInBytesProperty() {
    return withdrawalTxFeeInBytesProperty;
}
 
Example #21
Source File: XYSeriesBuilder.java    From charts with Apache License 2.0 4 votes vote down vote up
public final XYSeries build() {
    final XYSeries SERIES = new XYSeries();

    if (properties.keySet().contains("itemsArray")) {
        SERIES.setItems(((ObjectProperty<XYItem[]>) properties.get("itemsArray")).get());
    }
    if(properties.keySet().contains("itemsList")) {
        SERIES.setItems(((ObjectProperty<List<XYItem>>) 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 ("textFill".equals(key)) {
            SERIES.setTextFill(((ObjectProperty<Color>) 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());
        } else if("animated".equals(key)) {
            SERIES.setAnimated(((BooleanProperty) properties.get(key)).get());
        } else if("animationDuration".equals(key)) {
            SERIES.setAnimationDuration(((LongProperty) properties.get(key)).get());
        }
    }
    return SERIES;
}
 
Example #22
Source File: Patient.java    From WorkbenchFX with Apache License 2.0 4 votes vote down vote up
public LongProperty idProperty() {
  return id;
}
 
Example #23
Source File: HighlightingStreamConverter.java    From paintera with GNU General Public License v2.0 4 votes vote down vote up
@Override
public LongProperty seedProperty()
{
	return this.seed;
}
 
Example #24
Source File: Viewer3DFX.java    From paintera with GNU General Public License v2.0 4 votes vote down vote up
public LongProperty frameDelayMsecProperty()
{
	return this.frameDelayMsec;
}
 
Example #25
Source File: Viewer3DFX.java    From paintera with GNU General Public License v2.0 4 votes vote down vote up
public LongProperty sceneUpdateDelayMsecProperty()
{
	return this.sceneUpdateDelayMsec;
}
 
Example #26
Source File: Viewer3DConfig.java    From paintera with GNU General Public License v2.0 4 votes vote down vote up
public LongProperty frameDelayMsecProperty()
{
	return this.frameDelayMsec;
}
 
Example #27
Source File: Viewer3DConfig.java    From paintera with GNU General Public License v2.0 4 votes vote down vote up
public LongProperty sceneUpdateDelayMsecProperty()
{
	return this.sceneUpdateDelayMsec;
}
 
Example #28
Source File: ChartDataItem.java    From mokka7 with Eclipse Public License 1.0 4 votes vote down vote up
public LongProperty valueProperty(){
    return value;
}
 
Example #29
Source File: XYZSeriesBuilder.java    From charts with Apache License 2.0 4 votes vote down vote up
public final XYZSeries build() {
    final XYZSeries SERIES = new XYZSeries();

    if (properties.keySet().contains("itemsArray")) {
        SERIES.setItems(((ObjectProperty<XYZItem[]>) properties.get("itemsArray")).get());
    }
    if(properties.keySet().contains("itemsList")) {
        SERIES.setItems(((ObjectProperty<List<XYZItem>>) 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 ("textFill".equals(key)) {
            SERIES.setTextFill(((ObjectProperty<Color>) 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 ("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());
        } else if("animated".equals(key)) {
            SERIES.setAnimated(((BooleanProperty) properties.get(key)).get());
        } else if("animationDuration".equals(key)) {
            SERIES.setAnimationDuration(((LongProperty) properties.get(key)).get());
        }
    }
    return SERIES;
}
 
Example #30
Source File: YSeriesBuilder.java    From charts with Apache License 2.0 4 votes vote down vote up
public final YSeries build() {
    final YSeries SERIES = new YSeries();

    if (properties.keySet().contains("itemsArray")) {
        SERIES.setItems(((ObjectProperty<YItem[]>) properties.get("itemsArray")).get());
    }
    if(properties.keySet().contains("itemsList")) {
        SERIES.setItems(((ObjectProperty<List<YItem>>) 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 ("textFill".equals(key)) {
            SERIES.setTextFill(((ObjectProperty<Color>) 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());
        } else if("animated".equals(key)) {
            SERIES.setAnimated(((BooleanProperty) properties.get(key)).get());
        } else if("animationDuration".equals(key)) {
            SERIES.setAnimationDuration(((LongProperty) properties.get(key)).get());
        }
    }
    return SERIES;
}