@Override public Node build() { leftButton = new JFXButton("Alert"); leftButton.setLayoutX(50); leftButton.setLayoutY(50); return new Group(leftButton); }
/*************************************************************************** * * Setters / Getters * * **************************************************************************/ public void setControl(Node control) { if (control != null) { this.control = control; this.badge = new Group(); this.getChildren().add(control); this.getChildren().add(badge); // if the control got resized the badge must be rest if (control instanceof Region) { ((Region) control).widthProperty().addListener((o, oldVal, newVal) -> refreshBadge()); ((Region) control).heightProperty().addListener((o, oldVal, newVal) -> refreshBadge()); } text.addListener((o, oldVal, newVal) -> refreshBadge()); } }
@Override public void start(Stage stage) { JFXSlider horLeftSlider = new JFXSlider(); horLeftSlider.setMinWidth(500); JFXSlider horRightSlider = new JFXSlider(); horRightSlider.setMinWidth(500); horRightSlider.setIndicatorPosition(IndicatorPosition.RIGHT); JFXSlider verLeftSlider = new JFXSlider(); verLeftSlider.setMinHeight(500); verLeftSlider.setOrientation(Orientation.VERTICAL); JFXSlider verRightSlider = new JFXSlider(); verRightSlider.setMinHeight(500); verRightSlider.setOrientation(Orientation.VERTICAL); verRightSlider.setIndicatorPosition(IndicatorPosition.RIGHT); HBox hbox = new HBox(); hbox.setSpacing(450); hbox.getChildren().addAll(verRightSlider, verLeftSlider); VBox vbox = new VBox(); vbox.getChildren().addAll(horRightSlider, horLeftSlider, hbox); vbox.setSpacing(100); vbox.setPadding(new Insets(100, 50, 50, 150)); Scene scene = new Scene(new Group()); ((Group) scene.getRoot()).getChildren().add(vbox); scene.getStylesheets().add(SliderDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); stage.setScene(scene); stage.setWidth(900); stage.setHeight(900); stage.show(); stage.setTitle("JFX Slider Demo"); }
hbox.setStyle("-fx-padding:20"); Group root = new Group(); Scene scene = new Scene(root, 700, 250); root.getChildren().addAll(hbox);
Group pointerGroup = new Group(); pointerGroup.getChildren().add(minsPointer); pointerGroup.setTranslateX((-contentCircleRadius + shift) / 2);
StackPane.setAlignment(selectionCircle, Pos.CENTER_LEFT); Group pointerGroup = new Group(); pointerGroup.getChildren().add(hoursPointer); pointerGroup.setTranslateX((-contentCircleRadius + shift) / 2); StackPane.setAlignment(_24HourSelectionCircle, Pos.CENTER_LEFT); Group pointer24HourGroup = new Group(); pointer24HourGroup.getChildren().add(_24HoursPointer); pointer24HourGroup.setTranslateX(((-contentCircleRadius + shift) / 2) + (_24HourShift / 2));
suggestionList.setCellFactory(control.getSuggestionsCellFactory()); pane.getChildren().add(new Group(suggestionList)); pane.getStyleClass().add("autocomplete-container"); suggestionList.prefWidthProperty().bind(control.prefWidthProperty());
text = new Text(); text.getStyleClass().setAll("text", "percentage"); final Group group = new Group(fillRect, track, arc, text); group.setManaged(false); arcPane = new StackPane(group);
Group sizingRoot = new Group(sizeCalculator); new Scene(sizingRoot); sizingRoot.applyCss();
public Node stack(Node other) { Objects.requireNonNull(other); other.setBlendMode(BlendMode.SRC_ATOP); return new Group(this, other); }
/** Constructor. * * @param model the source of the elements. */ public GisScrollPane(GISElementContainer<? extends MapPolyline> model) { final Group canvas = new Group(); final GisPane<?> gisLayer = new GisPane<>(model); canvas.getChildren().add(gisLayer); initializePane(canvas); }
public EventMediaPlayerSkin(EventMediaPlayer control, ReadOnlyDoubleProperty parentWidth) { super(control); this.control = control; Group g = new Group(); g.setManaged(false); initializeControl(g, parentWidth); getChildren().add(g); }
public Dialog() { setManaged(false); getStylesheets().add(Dialog.class.getResource("Dialog.css").toExternalForm()); InputStream is = Dialog.class.getResourceAsStream("fringe.jpg"); Image img = new Image(is); ImageView imgView = new ImageView(img); content = new Group(); getChildren().addAll(imgView, content); }
@Override public void start(Stage stage) { stage.setTitle("CheckBoxCell Samples"); final Scene scene = new Scene(new Group(), 875, 700); scene.setFill(Color.LIGHTGRAY); Group root = (Group) scene.getRoot(); root.getChildren().add(getContent(scene)); AquaFx.style(); stage.setScene(scene); stage.show(); }
private Group createSubTitle() { Group g = new Group(); g.setManaged(false); String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.CityProductionConsumptionDialog.weekly", new Object[]{}, locale.getCurrentLocal()); DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>()); StackPane titlePane = new StackPane(); titlePane.getChildren().addAll(new PlaceHolder(WIDTH, 1), text); g.getChildren().add(titlePane); return g; }
@Override protected void doScaleInstruction(Graphics3DScaleInstruction graphics3DScale) { Vector3D scale = graphics3DScale.getScaleFactor(); Scale outputScale = new Scale(scale.getX(), scale.getY(), scale.getZ()); Group scaleGroup = new Group(); scaleGroup.getTransforms().add(outputScale); currentGroup.getChildren().add(scaleGroup); currentGroup = scaleGroup; }
@Override protected void doTranslateInstruction(Graphics3DTranslateInstruction graphics3DTranslate) { Vector3D t = graphics3DTranslate.getTranslation(); Translate outputTranslation = new Translate(t.getX(), t.getY(), t.getZ()); Group translationGroup = new Group(); translationGroup.getTransforms().add(outputTranslation); currentGroup.getChildren().add(translationGroup); currentGroup = translationGroup; }
@Override public void run() { rootGroup = new Group(); canvas = new Canvas(); graphicsContext = canvas.getGraphicsContext2D(); rootGroup.getChildren().add(canvas); scene = new Scene(rootGroup); javaFXPanel.setScene(scene); parallelCamera = new ParallelCamera(); scene.setCamera(parallelCamera); } });
@Override protected void doRotateInstruction(Graphics3DRotateInstruction rot) { RotationMatrix mat = rot.getRotationMatrix(); Affine outputRotation = new Affine(new double[] {mat.getM00(), mat.getM01(), mat.getM02(), 0, mat.getM10(), mat.getM11(), mat.getM12(), 0, mat.getM20(), mat.getM21(), mat.getM22(), 0, 0, 0, 0, 1}, MatrixType.MT_3D_4x4, 0); Group rotationGroup = new Group(); rotationGroup.getTransforms().add(outputRotation); currentGroup.getChildren().add(rotationGroup); currentGroup = rotationGroup; }
public PlaceHolderSkin(PlaceHolder control) { super(control); Rectangle area = new Rectangle(control.getX(), control.getY(), control.getLocalWidth(), control.getLocalHeight()); area.setFill(Color.TRANSPARENT); area.xProperty().bind(control.xProperty()); area.yProperty().bind(control.yProperty()); area.widthProperty().bind(control.widthLocalProperty()); area.heightProperty().bind(control.heightLocalProperty()); Group g = new Group(area); getChildren().add(g); }