Java Code Examples for javafx.scene.paint.Color#YELLOW
The following examples show how to use
javafx.scene.paint.Color#YELLOW .
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: CenterArc.java From CrazyAlpha with GNU General Public License v2.0 | 6 votes |
public CenterArc() { fillColor = Color.color(Math.random(), Math.random(), Math.random()); strokeColor = Color.YELLOW; width = 120; height = 120; x = (Game.getInstance().getRender().getWidth() - width) / 2; y = (Game.getInstance().getRender().getHeight() - height) / 2; for (int i = 0; i < 4; i++) { Arc arc = new Arc(x, y, width, height, i * 90, 30); arc.setType(ArcType.ROUND); shapes.add(arc); } effect = new GaussianBlur(); start(); }
Example 2
Source File: RadialGradientSample.java From marathonv5 with Apache License 2.0 | 6 votes |
public RadialGradientSample() { //create simple radial gradient RadialGradient gradient1 = new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, new Stop[] { new Stop(0, Color.DODGERBLUE), new Stop(1, Color.BLACK) }); Circle circle1 = new Circle(45, 45, 40, gradient1); //create complex radial gradient RadialGradient gradient2 = new RadialGradient(20, 1, 0.5, 0.5, 0.6, true, CycleMethod.NO_CYCLE, new Stop[] { new Stop(0, Color.TRANSPARENT), new Stop(0.5, Color.DARKGRAY), new Stop(0.64, Color.WHITESMOKE), new Stop(0.65, Color.YELLOW), new Stop(1, Color.GOLD) }); Circle circle2 = new Circle(145, 45, 40, gradient2); HBox hb = new HBox(10); hb.getChildren().addAll(circle1, circle2); // show the circles getChildren().addAll(hb); }
Example 3
Source File: RadialGradientSample.java From marathonv5 with Apache License 2.0 | 6 votes |
public RadialGradientSample() { //create simple radial gradient RadialGradient gradient1 = new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, new Stop[] { new Stop(0, Color.DODGERBLUE), new Stop(1, Color.BLACK) }); Circle circle1 = new Circle(45, 45, 40, gradient1); //create complex radial gradient RadialGradient gradient2 = new RadialGradient(20, 1, 0.5, 0.5, 0.6, true, CycleMethod.NO_CYCLE, new Stop[] { new Stop(0, Color.TRANSPARENT), new Stop(0.5, Color.DARKGRAY), new Stop(0.64, Color.WHITESMOKE), new Stop(0.65, Color.YELLOW), new Stop(1, Color.GOLD) }); Circle circle2 = new Circle(145, 45, 40, gradient2); HBox hb = new HBox(10); hb.getChildren().addAll(circle1, circle2); // show the circles getChildren().addAll(hb); }
Example 4
Source File: Vertex.java From constellation with Apache License 2.0 | 5 votes |
private void updateSelectedVisualIndication() { if (isSelected) { Color highlightColor = selectedWithTransaction ? Color.RED : Color.YELLOW; triangle.setEffect(new DropShadow(BlurType.GAUSSIAN, highlightColor, 15.0, 0.45, 0.0, 0.0)); } else { // Remove the selection effect: triangle.setEffect(null); } }
Example 5
Source File: ScatterChartPane.java From constellation with Apache License 2.0 | 5 votes |
/** * Update the current selection on the ScatterChart within this * ScatterChartPane. This allows a primary selection (which will highlight * in red) as well as a secondary selection (which will highlight in * yellow). * * @param primarySelection the set of data objects representing the primary * selection. * @param secondarySelection the set of data objects representing the * secondary selection. */ protected void selectElementsOnChart(final Set<ScatterData> primarySelection, final Set<ScatterData> secondarySelection) { final DropShadow primarySelectionShadow = new DropShadow(BlurType.THREE_PASS_BOX, Color.RED, 20.0, 0.85, 0.0, 0.0); final DropShadow secondarySelectionShadow = new DropShadow(BlurType.THREE_PASS_BOX, Color.YELLOW, 20.0, 0.85, 0.0, 0.0); Platform.runLater(() -> { synchronized (currentData) { for (final ScatterData data : currentData) { if (secondarySelection != null && secondarySelection.contains(data)) { data.getData().getNode().setEffect(secondarySelectionShadow); continue; } if (primarySelection != null && primarySelection.contains(data)) { data.getData().getNode().setEffect(primarySelectionShadow); continue; } @SuppressWarnings("unchecked") // getData will return data of type number and number Data<Number, Number> data2 = (Data<Number, Number>) data.getData(); Node dataNode = data2.getNode(); dataNode.setEffect(null); } } }); if (primarySelection != null && !currentSelectedData.equals(primarySelection)) { currentSelectedData.clear(); currentSelectedData.addAll(primarySelection); } }
Example 6
Source File: Connect4App.java From FXTutorials with MIT License | 5 votes |
public Disc(boolean red) { super(TILE_SIZE / 2, red ? Color.RED : Color.YELLOW); this.red = red; setCenterX(TILE_SIZE / 2); setCenterY(TILE_SIZE / 2); }
Example 7
Source File: Main.java From FXTutorials with MIT License | 5 votes |
private Parent createContent() { Pane root = new Pane(); root.setPrefSize(1280, 720); info.setTranslateX(50); info.setTranslateY(50); player = new Entity(400, 400, 30, 60, Color.GREEN); enemy = new Entity(300, 300, 40, 40, Color.RED); coin = new Entity(300, 400, 20, 20, Color.YELLOW); player.setUserData("Player"); enemy.setUserData("Enemy"); coin.setUserData("Coin"); objects.addAll(Arrays.asList(player, enemy, coin)); registeredCollisions.add(new CollisionPair("Player", "Enemy", () -> { info.setText("Got hit by enemy"); })); registeredCollisions.add(new CollisionPair("Player", "Coin", () -> { info.setText("Picked up a coin"); })); root.getChildren().addAll(info, player, enemy, coin); return root; }
Example 8
Source File: InfluenceAnalysisUI.java From SONDY with GNU General Public License v3.0 | 5 votes |
public final void updateRankDistributionChart(){ Stop[] stops = new Stop[] { new Stop(0, Color.STEELBLUE), new Stop(0.5, Color.YELLOW), new Stop(1, Color.RED)}; rankDistributionChart.getData().clear(); int[] rankDistribution = selectedMethod.rankedUsers.extractRankDistribution(); XYChart.Series series = new XYChart.Series(); for(int i = 0; i < rankDistribution.length; i++){ series.getData().add(new XYChart.Data(i+"",rankDistribution[i])); } rankDistributionChart.getData().add(series); }
Example 9
Source File: IconBrightness.java From helloiot with GNU General Public License v3.0 | 4 votes |
public IconBrightness(IconFont icon) { this.icon = icon; this.color = Color.YELLOW; }
Example 10
Source File: ColorRegulator.java From regulators with Apache License 2.0 | 4 votes |
public ColorRegulator() { scaleFactor = 1.0; baseColor = Color.YELLOW; targetValue = new DoublePropertyBase(0) { @Override protected void invalidated() { setOn(Double.compare(get(), 0) != 0); } @Override public void set(final double VALUE) { super.set(clamp(MIN_VALUE, MAX_VALUE, VALUE)); } @Override public Object getBean() { return ColorRegulator.this; } @Override public String getName() { return "targetValue"; } }; targetColor = new ObjectPropertyBase<Color>(baseColor) { @Override protected void invalidated() { super.set(null == get() ? Color.BLACK : get()); currentColorCircle.setFill(get()); indicatorRotate.setAngle(((gradientLookup.getValueFrom(baseColor) * 100.0) - MIN_VALUE) * angleStep - ANGLE_RANGE * 0.5); } @Override public Object getBean() { return ColorRegulator.this; } @Override public String getName() { return "targetColor"; } }; textColor = new ObjectPropertyBase<Color>(Color.WHITE) { @Override protected void invalidated() { super.set(null == get() ? Color.WHITE: get()); redraw(); } @Override public Object getBean() { return ColorRegulator.this; } @Override public String getName() { return "textColor"; } }; color = new ObjectPropertyBase<Color>(DEFAULT_COLOR) { @Override protected void invalidated() { super.set(null == get() ? DEFAULT_COLOR : get()); redraw(); } @Override public Object getBean() { return ColorRegulator.this; } @Override public String getName() { return "color"; } }; indicatorColor = new ObjectPropertyBase<Color>(Color.WHITE) { @Override protected void invalidated() { indicatorGlow.setColor(get()); } @Override public Object getBean() { return ColorRegulator.this; } @Override public String getName() { return "indicatorColor"; } }; selected = new BooleanPropertyBase(false) { @Override protected void invalidated() { if (get()) { indicator.setFill(getIndicatorColor()); indicator.setStroke(getIndicatorColor().darker().darker()); indicator.setEffect(indicatorGlow); } else { indicator.setFill(getColor().darker()); indicator.setStroke(getColor().darker().darker()); indicator.setEffect(null); } } @Override public Object getBean() { return ColorRegulator.this; } @Override public String getName() { return "selected"; } }; on = new BooleanPropertyBase(false) { @Override protected void invalidated() { currentColorCircle.setVisible(get()); } @Override public Object getBean() { return ColorRegulator.this; } @Override public String getName() { return "on"; } }; brightness = new DoublePropertyBase(1.0) { @Override protected void invalidated() { set(clamp(0.0, 1.0, get())); targetColor.set(baseColor.deriveColor(0, 1, get(), 1)); } @Override public Object getBean() { return ColorRegulator.this; } @Override public String getName() { return "brightness"; } }; angleStep = ANGLE_RANGE / (MAX_VALUE - MIN_VALUE); init(); initGraphics(); registerListeners(); }
Example 11
Source File: TButton.java From Enzo with Apache License 2.0 | 4 votes |
public TButton(final String TEXT) { getStyleClass().add("tbutton"); selected = new SimpleBooleanProperty(this, "selected", false); text = new SimpleStringProperty(this, "text", TEXT); ledColor = new SimpleObjectProperty<>(Color.YELLOW); }