List of usage examples for javafx.scene.paint Color RED
Color RED
To view the source code for javafx.scene.paint Color RED.
Click Source Link
From source file:ExcelFx.InitalDataController.java
@FXML protected void okButton(ActionEvent event) throws IOException { DropShadow ds = new DropShadow(); ds.setColor(Color.RED); String err = ""; if (initalField.getText().length() == 0) { err += " "; initalField.setEffect(ds);/*from w w w .j ava 2 s .c o m*/ } if (initalPage.getText().length() == 0) { err += " ? excel "; initalPage.setEffect(ds); } if (yStart.getText().length() == 0) { err += " ? "; yStart.setEffect(ds); } if (yEnd.getText().length() == 0) { err += " ? "; yEnd.setEffect(ds); } if (err.length() != 0) { Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle(""); alert.setHeaderText("? ?"); alert.setContentText(err); alert.showAndWait(); } else { Stage stage = (Stage) gridPane.getScene().getWindow(); stage.close(); this.codes.setPatch(this.initalField.getText()); this.codes.setPage((this.initalPage.getText()).trim().toLowerCase()); this.codes.setYStart(this.yStart.getText().trim().toLowerCase()); this.codes.setYEnd(this.yEnd.getText().trim().toLowerCase()); this.codes.jsonCreate("inital.json"); } this.gridPane.setUserData(this.codes); }
From source file:Main.java
static Node distantLight() { Light.Distant light = new Light.Distant(); light.setAzimuth(-135.0f);/* ww w . ja v a 2 s . c o m*/ light.setElevation(30.0f); Lighting l = new Lighting(); l.setLight(light); l.setSurfaceScale(5.0f); final Text t = new Text(); t.setText("Distant Light"); t.setFill(Color.RED); t.setFont(Font.font("null", FontWeight.BOLD, 70)); t.setX(10.0f); t.setY(50.0f); t.setTextOrigin(VPos.TOP); t.setEffect(l); final Rectangle r = new Rectangle(); r.setFill(Color.BLACK); Group g = new Group(); g.getChildren().add(r); g.getChildren().add(t); g.setTranslateY(460); return g; }
From source file:com.shootoff.session.io.JSONSessionReader.java
public Map<String, List<Event>> load() { Map<String, List<Event>> events = new HashMap<String, List<Event>>(); try {//from w w w . j a v a2s.c o m JSONObject session = (JSONObject) new JSONParser() .parse(new InputStreamReader(new FileInputStream(sessionFile), "UTF-8")); JSONArray cameras = (JSONArray) session.get("cameras"); @SuppressWarnings("unchecked") Iterator<JSONObject> itCameras = cameras.iterator(); while (itCameras.hasNext()) { JSONObject camera = itCameras.next(); String cameraName = (String) camera.get("name"); events.put(cameraName, new ArrayList<Event>()); JSONArray cameraEvents = (JSONArray) camera.get("events"); @SuppressWarnings("unchecked") Iterator<JSONObject> itEvents = cameraEvents.iterator(); while (itEvents.hasNext()) { JSONObject event = itEvents.next(); String eventType = (String) event.get("type"); switch (eventType) { case "shot": Color c; if (event.get("color").equals("0xff0000ff")) { c = Color.RED; } else { c = Color.GREEN; } Shot shot = new Shot(c, (double) event.get("x"), (double) event.get("y"), (Long) event.get("shotTimestamp"), ((Long) event.get("markerRadius")).intValue()); boolean isMalfunction = (boolean) event.get("isMalfunction"); boolean isReload = (boolean) event.get("isReload"); Optional<Integer> targetIndex; int index = ((Long) event.get("targetIndex")).intValue(); if (index == -1) { targetIndex = Optional.empty(); } else { targetIndex = Optional.of(index); } Optional<Integer> hitRegionIndex; index = ((Long) event.get("hitRegionIndex")).intValue(); if (index == -1) { hitRegionIndex = Optional.empty(); } else { hitRegionIndex = Optional.of(index); } Optional<String> videoString = Optional.ofNullable((String) event.get("videos")); events.get(cameraName).add(new ShotEvent(cameraName, (Long) event.get("timestamp"), shot, isMalfunction, isReload, targetIndex, hitRegionIndex, videoString)); break; case "targetAdded": events.get(cameraName).add(new TargetAddedEvent(cameraName, (Long) event.get("timestamp"), (String) event.get("name"))); break; case "targetRemoved": events.get(cameraName).add(new TargetRemovedEvent(cameraName, (Long) event.get("timestamp"), ((Long) event.get("index")).intValue())); break; case "targetResized": events.get(cameraName) .add(new TargetResizedEvent(cameraName, (Long) event.get("timestamp"), ((Long) event.get("index")).intValue(), (Double) event.get("newWidth"), (Double) event.get("newHeight"))); break; case "targetMoved": events.get(cameraName).add(new TargetMovedEvent(cameraName, (Long) event.get("timestamp"), ((Long) event.get("index")).intValue(), ((Long) event.get("newX")).intValue(), ((Long) event.get("newY")).intValue())); break; case "exerciseFeedMessage": events.get(cameraName).add(new ExerciseFeedMessageEvent(cameraName, (Long) event.get("timestamp"), (String) event.get("message"))); break; } } } } catch (IOException | ParseException e) { logger.error("Error reading JSON session", e); } return events; }
From source file:ExcelFx.XLSSettingController.java
@FXML protected void okButton(ActionEvent event) throws IOException { DropShadow ds = new DropShadow(); ds.setColor(Color.RED); String err = ""; try {// ww w . java2s . c o m if (pageField.getText().length() == 0) { err += " "; pageField.setEffect(ds); } } catch (Exception ex) { err += " "; pageField.setEffect(ds); } try { if (eddWayField.getText().length() == 0) { err += "? "; eddWayField.setEffect(ds); } } catch (Exception e) { err += "? "; eddWayField.setEffect(ds); } try { if (proffField.getText().length() == 0) { err += "??? "; proffField.setEffect(ds); } } catch (Exception ex) { err += "??? "; proffField.setEffect(ds); } // try { // if (eddNameField.getText().length() == 0) { // err += "? ? "; // eddNameField.setEffect(ds); // } // } catch (Exception ex) { // err += "??? "; // eddNameField.setEffect(ds); // } if (err.length() != 0) { Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle(""); alert.setHeaderText("? ?"); alert.setContentText(err); alert.showAndWait(); } else { json.setPage(pageField.getText().trim().toLowerCase()); json.setEddWay(eddWayField.getText().trim().toLowerCase()); json.setProffName(proffField.getText().trim().toLowerCase()); // json.setEddName(this.eddNameField.getText().trim().toLowerCase()); gridPane.setUserData(json); Stage stage = (Stage) gridPane.getScene().getWindow(); stage.close(); } switch (type) { case "university": { json.jsonCreate("university.json"); break; } case "college": { json.jsonCreate("college.json"); break; } } }
From source file:Main.java
static Node perspective() { Group g = new Group(); PerspectiveTransform pt = new PerspectiveTransform(); pt.setUlx(10.0f);/*from ww w . j a v a 2 s.co m*/ pt.setUly(10.0f); pt.setUrx(210.0f); pt.setUry(40.0f); pt.setLrx(210.0f); pt.setLry(60.0f); pt.setLlx(10.0f); pt.setLly(90.0f); g.setEffect(pt); g.setCache(true); Rectangle r = new Rectangle(); r.setX(10.0f); r.setY(10.0f); r.setWidth(280.0f); r.setHeight(80.0f); r.setFill(Color.DARKBLUE); Text t = new Text(); t.setX(20.0f); t.setY(65.0f); t.setText("Perspective"); t.setFill(Color.RED); t.setFont(Font.font("null", FontWeight.BOLD, 36)); g.getChildren().add(r); g.getChildren().add(t); return g; }
From source file:org.nmrfx.processor.gui.spectra.PeakListAttributes.java
public ColorProperty offColorProperty() { if (offColor == null) { offColor = new ColorProperty(this, "-color", Color.RED); }/*from w ww . jav a 2s. c o m*/ return offColor; }
From source file:Main.java
static Node gaussianBlur() { Text t2 = new Text(); t2.setX(10.0f);/*from www . j a v a2s . co m*/ t2.setY(140.0f); t2.setCache(true); t2.setText("Gaussian Blur"); t2.setFill(Color.RED); t2.setFont(Font.font("null", FontWeight.BOLD, 36)); t2.setEffect(new GaussianBlur()); return t2; }
From source file:deincraftlauncher.InstallController.java
@Override public void initialize(URL url, ResourceBundle rb) { instance = this; System.out.println("Starting Installer UI..."); int saveX = 393; int cancelY = 165; int saveY = 200; int sizeX = 481; Rectangle separator = new Rectangle(); separator.setWidth(sizeX);// w ww.j a va 2s.c om separator.setHeight(separatorSizeY); separator.setLayoutY(separatorY); separator.setFill(blueColor); mainPanel.getChildren().add(separator); mainPanel.setBackground(Background.EMPTY); TextButton cancel = new TextButton(saveX, cancelY, "cancel", Color.RED, mainPanel); cancel.setOnClick((TextButton tile) -> { cancel(); }); save = new TextButton(saveX, saveY, "Weiter", Color.GRAY, mainPanel); save.setFocusable(false); save.setOnClick((TextButton tile) -> { Continue(); }); login = new TextButton(14, 151, "Login", Color.BLUE, mainPanel); login.setOnClick((TextButton tile) -> { doLogin(null); }); Label Title = new Label(); Title.setText("Installer"); Title.setPrefSize(sizeX, separatorY); Title.setTextFill(Color.WHITESMOKE); Title.setTextAlignment(TextAlignment.CENTER); Title.setFont(DesignHelpers.getFocusFont(42)); Title.setAlignment(Pos.CENTER); mainPanel.getChildren().add(Title); pathLabel.setBackground(new Background(new BackgroundFill(Color.rgb(170, 170, 170), radii, insets))); //ContinueButton.setBackground(new Background(new BackgroundFill(Color.rgb(100, 190, 100), radii, insets))); //Green Version setDefaultPath(); System.out.println("starting done"); }
From source file:Main.java
static Node reflection() { Text t = new Text(); t.setX(10.0f);// w ww.ja va 2 s . co m t.setY(50.0f); t.setCache(true); t.setText("Reflections on JavaFX..."); t.setFill(Color.RED); t.setFont(Font.font("null", FontWeight.BOLD, 30)); Reflection r = new Reflection(); r.setFraction(0.7f); t.setEffect(r); t.setTranslateY(400); return t; }
From source file:nars.rl.util.ThreeDView.java
private void buildAxes() { final PhongMaterial redMaterial = new PhongMaterial(); redMaterial.setDiffuseColor(Color.DARKRED); redMaterial.setSpecularColor(Color.RED); final PhongMaterial greenMaterial = new PhongMaterial(); greenMaterial.setDiffuseColor(Color.DARKGREEN); greenMaterial.setSpecularColor(Color.GREEN); final PhongMaterial blueMaterial = new PhongMaterial(); blueMaterial.setDiffuseColor(Color.DARKBLUE); blueMaterial.setSpecularColor(Color.BLUE); final Box xAxis = new Box(240.0, 1, 1); final Box yAxis = new Box(1, 240.0, 1); final Box zAxis = new Box(1, 1, 240.0); xAxis.setMaterial(redMaterial);/*from www . j a va2 s . c o m*/ yAxis.setMaterial(greenMaterial); zAxis.setMaterial(blueMaterial); axisGroup.getChildren().addAll(xAxis, yAxis, zAxis); world.getChildren().addAll(axisGroup); }