Java Code Examples for javafx.scene.paint.Color#LIME

The following examples show how to use javafx.scene.paint.Color#LIME . 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: GraphPanel.java    From charts with Apache License 2.0 4 votes vote down vote up
private void init() {
    width              = PREFERRED_WIDTH;
    height             = PREFERRED_HEIGHT;
    mouseHandler       = this::handleMouseEvents;
    lastTimerCall      = System.nanoTime();
    _physicsActive     = true;
    _forceInverted     = false;

    setInitialPosition((int)width, (int)height);

    timer              = new AnimationTimer() {
        @Override public void handle(final long now) {
            if (now > lastTimerCall + REFRESH_PERIOD) {
                fruchtermanReingold();
                lastTimerCall = now;
                redraw();
            }
        }
    };

    nodeChangeListener    = (o, ov, nv) -> redraw();
    temp                  = BASE_TEMPERATURE;
    area                  = width * height;
    k                     = Math.sqrt(area / nodeEdgeModel.getNodes().size());
    distanceScalingFactor = new SimpleDoubleProperty(DISTANCE_SCALING_FACTOR);
    _edgeColor            = Color.DARKGRAY;
    _edgeWidthFactor = 2;
    //_nodeBorderColor       = Color.WHITE;
    _nodeHighlightingColor = Color.RED;
    _nodeBorderWidth       = 3;
    _selectedNodeFillColor   = Color.BLACK;
    _selectedNodeBorderColor = Color.LIME;
    maxXPosition = 1;
    maxYPosition = 1;
    minXPosition = -1;
    minYPosition = -1;


    if(null != nodeEdgeModel.getCurrentGroupKey()){
        GROUPING_KEY = nodeEdgeModel.getCurrentGroupKey();
    } else{
        GROUPING_KEY = NodeEdgeModel.DEFAULT;
    }

    popup                    = new InfoPopup();


    initGraphics();
    registerListeners();
    timer.start();
}
 
Example 2
Source File: SingleChartTest.java    From charts with Apache License 2.0 4 votes vote down vote up
@Override public void init() {
    List<XYChartItem> xyItem1 = new ArrayList<>(NO_OF_X_VALUES);
    List<XYChartItem> xyItem2 = new ArrayList<>(NO_OF_X_VALUES);
    List<XYChartItem> xyItem3 = new ArrayList<>(NO_OF_X_VALUES);
    List<XYChartItem> xyItem4 = new ArrayList<>(NO_OF_X_VALUES);

    for (int i = 0 ; i < NO_OF_X_VALUES ; i++) {
        xyItem1.add(new XYChartItem(i, RND.nextDouble() * 12 + RND.nextDouble() * 6, "P" + i, COLORS[RND.nextInt(3)]));
        xyItem2.add(new XYChartItem(i, RND.nextDouble() * 7 + RND.nextDouble() * 3, "P" + i, COLORS[RND.nextInt(3)]));
        xyItem3.add(new XYChartItem(i, RND.nextDouble() * 3 + RND.nextDouble() * 4, "P" + i, COLORS[RND.nextInt(3)]));
        xyItem4.add(new XYChartItem(i, RND.nextDouble() * 4, "P" + i, COLORS[RND.nextInt(3)]));
    }

    xySeries1 = new XYSeries(xyItem1, ChartType.LINE, Color.rgb(255, 0, 0, 0.5), Color.RED);
    xySeries2 = new XYSeries(xyItem2, ChartType.LINE, Color.rgb(0, 255, 0, 0.5), Color.LIME);
    xySeries3 = new XYSeries(xyItem3, ChartType.LINE, Color.rgb(0, 0, 255, 0.5), Color.BLUE);
    xySeries4 = new XYSeries(xyItem4, ChartType.LINE, Color.rgb(255, 0, 255, 0.5), Color.MAGENTA);

    xySeries1.setSymbolsVisible(false);
    xySeries2.setSymbolsVisible(false);
    xySeries3.setSymbolsVisible(false);
    xySeries4.setSymbolsVisible(false);

    // XYChart
    Converter tempConverter     = new Converter(TEMPERATURE, CELSIUS); // Type Temperature with BaseUnit Celsius
    double    tempFahrenheitMin = tempConverter.convert(0, FAHRENHEIT);
    double    tempFahrenheitMax = tempConverter.convert(20, FAHRENHEIT);

    lineChartXAxisBottom = createBottomXAxis(0, NO_OF_X_VALUES, true);
    lineChartYAxisLeft   = createLeftYAxis(0, 20, true);
    lineChartYAxisRight  = createRightYAxis(tempFahrenheitMin, tempFahrenheitMax, false);
    xyChart = new XYChart<>(new XYPane(xySeries1, xySeries2, xySeries3, xySeries4),
                            lineChartYAxisLeft, lineChartYAxisRight, lineChartXAxisBottom);

    // YChart
    List<YChartItem> yItem1 = new ArrayList<>(20);
    List<YChartItem> yItem2 = new ArrayList<>(20);
    List<YChartItem> yItem3 = new ArrayList<>(20);
    for (int i = 0 ; i < 20 ; i++) {
        yItem1.add(new YChartItem(RND.nextDouble() * 100, "P" + i, COLORS[RND.nextInt(3)]));
        yItem2.add(new YChartItem(RND.nextDouble() * 100, "P" + i, COLORS[RND.nextInt(3)]));
        yItem3.add(new YChartItem(RND.nextDouble() * 100, "P" + i, COLORS[RND.nextInt(3)]));
    }

    ySeries1 = new YSeries(yItem1, ChartType.RADAR_SECTOR, new RadialGradient(0, 0, 0, 0, 1, true, CycleMethod.NO_CYCLE, new Stop(0.0, Color.rgb(255, 0, 0, 0.5)), new Stop(0.5, Color.rgb(255, 255, 0, 0.5)), new Stop(1.0, Color.rgb(0, 200, 0, 0.8))), Color.TRANSPARENT);
    ySeries2 = new YSeries(yItem2, ChartType.SMOOTH_RADAR_POLYGON, new RadialGradient(0, 0, 0, 0, 1, true, CycleMethod.NO_CYCLE, new Stop(0.0, Color.rgb(0, 255, 255, 0.5)), new Stop(1.0, Color.rgb(0, 0, 255, 0.5))), Color.TRANSPARENT);
    ySeries3 = new YSeries(yItem3, ChartType.SMOOTH_RADAR_POLYGON, new RadialGradient(0, 0, 0, 0, 1, true, CycleMethod.NO_CYCLE, new Stop(0.0, Color.rgb(255, 255, 0, 0.5)), new Stop(1.0, Color.rgb(255, 0, 255, 0.5))), Color.TRANSPARENT);
    yChart   = new YChart(new YPane(ySeries1, ySeries2, ySeries3));

    lastTimerCall = System.nanoTime();
    timer = new AnimationTimer() {
        @Override public void handle(final long now) {
            if (now > lastTimerCall + UPDATE_INTERVAL) {
                ObservableList<XYChartItem> xyItems = xySeries1.getItems();
                xyItems.forEach(item -> item.setY(RND.nextDouble() * 8 + RND.nextDouble() * 10));

                xyItems = xySeries2.getItems();
                xyItems.forEach(item -> item.setY(RND.nextDouble() * 4 + RND.nextDouble() * 10));

                xyItems = xySeries3.getItems();
                xyItems.forEach(item -> item.setY(RND.nextDouble() * 3 + RND.nextDouble() * 4));

                xyItems = xySeries4.getItems();
                xyItems.forEach(item -> item.setY(RND.nextDouble() * 4));

                ObservableList<YChartItem> yItems = ySeries1.getItems();
                yItems.forEach(item -> item.setY(RND.nextDouble() * 100));

                yItems = ySeries2.getItems();
                yItems.forEach(item -> item.setY(RND.nextDouble() * 100));

                yItems = ySeries3.getItems();
                yItems.forEach(item -> item.setY(RND.nextDouble() * 100));

                // Can be used to update charts but if more than one series is in one xyPane
                // it's easier to use the refresh() method of XYChart
                //xySeries1.refresh();
                //xySeries2.refresh();
                //xySeries3.refresh();
                //xySeries4.refresh();

                // Useful to refresh the chart if it contains more than one series to avoid
                // multiple redraws
                xyChart.refresh();

                //ySeries1.refresh();
                //ySeries2.refresh();

                yChart.refresh();

                lastTimerCall = now;
            }
        }
    };
}
 
Example 3
Source File: Power.java    From helloiot with GNU General Public License v3.0 4 votes vote down vote up
public Power(IconFont icon) {
    this(icon, Color.LIME);
}
 
Example 4
Source File: Power.java    From helloiot with GNU General Public License v3.0 4 votes vote down vote up
public Power() {
    this(IconFontGlyph.FA_SOLID_POWER_OFF, Color.LIME);
}