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

The following examples show how to use javafx.scene.paint.Color#LIGHTGREEN . 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: ClientSession.java    From Open-Lowcode with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * sets the title on the active tab (corresponding to the active client display)
 * 
 * @param newtitle  the text title to show
 * @param otpstatus status of OTP connection
 */
public void setTitle(String newtitle, String otpstatus) {
	logger.warning("   --- ---- Starting setting title ");
	Tab tab = this.tabpane.getTabs().get(activedisplayindex);
	if (otpstatus.equals("NONE")) {
		tab.setText((newtitle.length() > 20 ? newtitle.substring(0, 20) + "..." : newtitle));
		tab.setTooltip(new Tooltip(newtitle));
		return;
	}
	// ---------------------- Process otp status that is not null ---------------
	BorderPane borderpane = new BorderPane();
	borderpane.setCenter(new Label(newtitle));
	Color dotcolor = Color.LIGHTGREEN;
	if (otpstatus.equals("INVALID"))
		dotcolor = Color.INDIANRED;
	Circle dot = new Circle(0, 0, 4);
	dot.setFill(dotcolor);
	dot.setStroke(Color.LIGHTGRAY);
	borderpane.setRight(dot);
	BorderPane.setAlignment(dot, Pos.CENTER);
	tab.setText("");
	tab.setGraphic(borderpane);
}
 
Example 2
Source File: ModalDialog.java    From oim-fx with MIT License 6 votes vote down vote up
public ModalDialog(Stage owner) {
	Button button = new Button();

    stage.initModality(Modality.APPLICATION_MODAL);
    stage.initOwner(owner);//Set the owner of the Stage 
    stage.setTitle("Top Stage With Modality");
    Group root = new Group();
    Scene scene = new Scene(root, 300, 250, Color.LIGHTGREEN);

    button.setOnAction(new EventHandler<ActionEvent>() {

        public void handle(ActionEvent event) {
            stage.hide();
        }
    });

    button.setLayoutX(100);
    button.setLayoutY(80);
    button.setText("OK");
    root.getChildren().add(button);
    stage.setScene(scene);
}
 
Example 3
Source File: NodePropertiesSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public NodePropertiesSample() {
    super(300,100);
    //X position of node = X + LayoutX + TranslateX
    rectA = new Rectangle(50, 50, Color.LIGHTSALMON);
    //set position of node temporary (can be changed after)
    rectA.setTranslateX(10);

    rectB = new Rectangle(50, 50, Color.LIGHTGREEN);
    //set position of node when addinf to some layout
    rectB.setLayoutX(20);
    rectB.setLayoutY(10);

    rectC = new Rectangle(50, 50, Color.DODGERBLUE);
    //last posibility of setting X position of node
    rectC.setX(30);
    rectC.setY(20);

    //opacity of node can be set
    rectC.setOpacity(0.8);

    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("Rectangle A translate X", rectA.translateXProperty(), 0d, 50d),
            new SimplePropertySheet.PropDesc("Rectangle B translate X", rectB.translateXProperty(), 0d, 50d),
            new SimplePropertySheet.PropDesc("Rectangle C translate X", rectC.translateXProperty(), 0d, 50d),
            new SimplePropertySheet.PropDesc("Rectangle A Opacity", rectA.opacityProperty(), 0d, 1d),
            new SimplePropertySheet.PropDesc("Rectangle B Opacity", rectB.opacityProperty(), 0d, 1d),
            new SimplePropertySheet.PropDesc("Rectangle C Opacity", rectC.opacityProperty(), 0d, 1d)
            );

    getChildren().add(createRadioButtons());
    // END REMOVE ME

    Group g = new Group(rectA, rectB, rectC);
    g.setLayoutX(160 + 35);
    getChildren().addAll(g);
}
 
Example 4
Source File: NodePropertiesSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public NodePropertiesSample() {
    super(300,100);
    //X position of node = X + LayoutX + TranslateX
    rectA = new Rectangle(50, 50, Color.LIGHTSALMON);
    //set position of node temporary (can be changed after)
    rectA.setTranslateX(10);

    rectB = new Rectangle(50, 50, Color.LIGHTGREEN);
    //set position of node when addinf to some layout
    rectB.setLayoutX(20);
    rectB.setLayoutY(10);

    rectC = new Rectangle(50, 50, Color.DODGERBLUE);
    //last posibility of setting X position of node
    rectC.setX(30);
    rectC.setY(20);

    //opacity of node can be set
    rectC.setOpacity(0.8);

    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("Rectangle A translate X", rectA.translateXProperty(), 0d, 50d),
            new SimplePropertySheet.PropDesc("Rectangle B translate X", rectB.translateXProperty(), 0d, 50d),
            new SimplePropertySheet.PropDesc("Rectangle C translate X", rectC.translateXProperty(), 0d, 50d),
            new SimplePropertySheet.PropDesc("Rectangle A Opacity", rectA.opacityProperty(), 0d, 1d),
            new SimplePropertySheet.PropDesc("Rectangle B Opacity", rectB.opacityProperty(), 0d, 1d),
            new SimplePropertySheet.PropDesc("Rectangle C Opacity", rectC.opacityProperty(), 0d, 1d)
            );

    getChildren().add(createRadioButtons());
    // END REMOVE ME

    Group g = new Group(rectA, rectB, rectC);
    g.setLayoutX(160 + 35);
    getChildren().addAll(g);
}
 
Example 5
Source File: TodaysDateWiget.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Hello World");
    Group root = new Group();
    Scene scene = new Scene(root, 300, 250, Color.LIGHTGREEN);
    Button btn = new Button();
    btn.setLayoutX(100);
    btn.setLayoutY(80);
    btn.setText("Hello World");
    btn.setOnAction(new EventHandler<ActionEvent>() {
        public void handle(ActionEvent event) {
            Stage st = new Stage(StageStyle.UNDECORATED);
            Group group = new Group();
            Scene s = new Scene(group ,WIDTH+3,HEIGHT+5);
            s.setFill(null);
            group.getChildren().addAll(getToDayControl());
            st.setScene(s);
            st.show();
 
        }
    });
    btn.fire();
    root.getChildren().add(btn);
    primaryStage.setScene(scene);
    //primaryStage.setVisible(false);
    primaryStage.close();
}