Pane pane = new Pane(); pane.setId("my-pane"); stage.setScene(new Scene(pane, 300, 200));
AbstractStepRepresentationWithHeader(SetupUiJavaFXImplementation parent, Message<?> messageWaitingForResponse) { super(parent, messageWaitingForResponse); this.contentPane = new VBox(); this.contentPane.setId("panelForTopheader"); getParent().getRoot().setCenter(this.contentPane); }
/** * Create a default frame pane * * @param contentContainer * the content container * @param lightweight * <code>true</code> to make it lightweight */ public DefaultFramePane(@Nullable Pane contentContainer, boolean lightweight) { super(lightweight); if (lightweight) { setMinimizable(false); setMaximizable(false); } clientAreaProperty().addListener(this::updateClientArea); if (contentContainer != null) { contentContainer.setId("client-area"); //$NON-NLS-1$ setContent(contentContainer); } }
/** * Create a default frame pane * * @param contentContainer * the content container * @param lightweight * <code>true</code> to make it lightweight */ public DefaultFramePane(@Nullable Pane contentContainer, boolean lightweight) { super(lightweight); if (lightweight) { setMinimizable(false); setMaximizable(false); } clientAreaProperty().addListener(this::updateClientArea); if (contentContainer != null) { contentContainer.setId("client-area"); //$NON-NLS-1$ setContent(contentContainer); } }
pane.setId("Layer "+i); pane.setStyle(String.format("-fx-background-color: -fx-background; -fx-background: #%x%x%x;", rng.nextInt(16), rng.nextInt(16), rng.nextInt(16)));
Pane pane = new StackPane(); pane.setMinSize(50, 50); pane.setId("Pane "+id);
Pane pane = new StackPane(); pane.setMinSize(50, 50); pane.setId("Pane "+id);
/** * Create a default window pane with a default client area as * {@link #setContent(Node)} * * @param clientArea * a client area */ public DefaultTrimmedWindowPane(@Nullable Pane clientArea) { menuBarProperty().addListener(this::updateMenuBar); clientAreaProperty().addListener(this::updateClientArea); topTrimProperty().addListener(this::updateTopTrim); bottomTrimProperty().addListener(this::updateBottomTrim); rightTrimProperty().addListener(this::updateRightTrim); leftTrimProperty().addListener(this::updateLeftTrim); if (clientArea != null) { clientArea.setId("client-area"); //$NON-NLS-1$ setContent(clientArea); } }
/** * Draw the header at the top of the window */ private void drawHeader() { Pane header = new Pane(); header.setId("header"); header.setPrefSize(722, 65); header.setLayoutX(-1); header.setLayoutY(-1); header.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY))); ImageView topImage = new ImageView(this.createTopImage()); topImage.setLayoutX(626); header.getChildren().add(topImage); getParent().getRoot().setTop(header); }
/** * Create a default window pane * * @param lightweight * <code>true</code> to mark the window lightweight * @param clientArea * a client area * @since 2.4.0 */ public DefaultTrimmedWindowPane(boolean lightweight, @Nullable Pane clientArea) { super(lightweight); menuBarProperty().addListener(this::updateMenuBar); clientAreaProperty().addListener(this::updateClientArea); topTrimProperty().addListener(this::updateTopTrim); bottomTrimProperty().addListener(this::updateBottomTrim); rightTrimProperty().addListener(this::updateRightTrim); leftTrimProperty().addListener(this::updateLeftTrim); if (clientArea != null) { clientArea.setId("client-area"); //$NON-NLS-1$ setContent(clientArea); } }
@PostConstruct private void initializeDialog() { setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.ship.ShipInfoDialog.title", // TODO: andi 4/11/18 rename new Object[]{}, locale.getCurrentLocal())); ObjectProperty<IShip> shipProperty = new SimpleObjectProperty<>((IShip) proxy.getActiveShip()); ObjectBinding<IShip> shipBinding = shipBinding(); shipProperty.bind(shipBinding); GridPane shipInfo = dialogUtil.createShipInfoOnThreeLines(shipProperty); shipInfo.setId("shipInfo"); shipInfo.setLayoutY(100); shipInfo.setLayoutX(INSET); Pane weaponPane = dialogUtil.createShipWeaponDisplay(shipProperty.get()); weaponPane.setId("weaponPane"); weaponPane.setScaleX(0.5); weaponPane.setScaleY(0.5); weaponPane.setLayoutX(-270 + INSET); weaponPane.setLayoutY(100); shipBinding.addListener((observable, oldValue, newValue) -> { getContent().remove(getContent().size() - 1); Pane pane = dialogUtil.createShipWeaponDisplay(newValue); pane.setId("weaponPane"); pane.setScaleX(0.5); pane.setScaleY(0.5); pane.setLayoutX(-270 + INSET); pane.setLayoutY(100); getContent().add(pane); }); getContent().addAll(shipInfo, weaponPane); }
public SeamapImageView(Image mapImage, double width, double height, Point2D focus, double scale) { super(); imgView = new ImageView(); shipCanvas = new Pane(); shipCanvas.setId("shipCanvas"); clip = new Rectangle(0, 0, width, height); Color slideColor = new Color(1, 1, 1, 0.1); slaveClip = new Rectangle(0, 0, width, height); scrollLeft = new Rectangle(0, 0, 50, height); scrollLeft.setFill(slideColor); scrollRight = new Rectangle(width - 50, 0, 50, height); scrollRight.setFill(slideColor); slideLeftAnimation = new Timeline(); slideLeftAnimation.setCycleCount(Animation.INDEFINITE); KeyFrame kf1 = new KeyFrame(Duration.millis(50), event -> resetClipXPosition(clip.getX() - 5)); slideLeftAnimation.getKeyFrames().add(kf1); slideRightAnimation = new Timeline(); slideRightAnimation.setCycleCount(Animation.INDEFINITE); KeyFrame kf2 = new KeyFrame(Duration.millis(50), event -> resetClipXPosition(clip.getX() + 5)); slideRightAnimation.getKeyFrames().add(kf2); this.mapImage = mapImage; this.focus = focus; this.scale.set(scale); } @PostConstruct
List<IWeaponSlot> weaponSlots = ship.getWeaponSlots(); Pane pane = new Pane(); pane.setId("weaponDisplay"); ImageView deck = getShipDeck(ship.getShipType()); pane.getChildren().add(deck);
newColorRect.setId("new-color"); newColorRect.backgroundProperty().bind(new ObjectBinding<Background>() {