private void initialize() { this.getStyleClass().add(DEFAULT_STYLE_CLASS); if ("dalvik".equals(System.getProperty("java.vm.name").toLowerCase())) { this.setStyle("-fx-skin: \"com.jfoenix.android.skins.JFXTextFieldSkinAndroid\";"); } }
/** * creates empty dialog layout */ public JFXDialogLayout() { initialize(); heading.getStyleClass().addAll("jfx-layout-heading", "title"); body.getStyleClass().add("jfx-layout-body"); VBox.setVgrow(body, Priority.ALWAYS); actions.getStyleClass().add("jfx-layout-actions"); getChildren().setAll(heading, body, actions); }
@Override public <U> void setViewContext(ViewContext<U> context) { updatePlaceholder(context.getRootNode()); if (animation != null) { animation.stop(); } animation = new Timeline(); animation.getKeyFrames().addAll(animationProducer.apply(this)); animation.getKeyFrames().add(new KeyFrame(duration, (e) -> clearPlaceholder())); animation.play(); }
private ObservableList<Person> generateDummyData(final int numberOfEntries) { final ObservableList<Person> dummyData = FXCollections.observableArrayList(); for (int i = 0; i < numberOfEntries; i++) { dummyData.add(createNewRandomPerson()); } return dummyData; }
public JFXChip(JFXChipView<T> view, T item) { this.view = view; getStyleClass().add("jfx-chip"); setItem(item); }
private void addTab(Tab tab, int addToIndex, boolean visible) { TabHeaderContainer tabHeaderContainer = new TabHeaderContainer(tab); tabHeaderContainer.setVisible(visible); headersRegion.getChildren().add(addToIndex, tabHeaderContainer); }
/** * Creates empty nodes list. */ public JFXNodesList() { setPickOnBounds(false); getStyleClass().add("jfx-nodes-list"); setAlignment(Pos.TOP_CENTER); }
protected void initNode(Node node) { node.setScaleX(0); node.setScaleY(0); node.getStyleClass().add("sub-node"); } }
@Override public void start(final Stage stage) throws Exception { StackPane pane = new StackPane(); JFXSpinner root = new JFXSpinner(); pane.getChildren().add(root); final Scene scene = new Scene(pane, 300, 300); scene.getStylesheets().add(MainDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); stage.setScene(scene); stage.setTitle("JFX Spinner Demo"); stage.show(); }
@Deprecated void addSublist(JFXListView<?> subList, int index) { if (!sublistsProperty.get().contains(subList)) { sublistsProperty.get().add(subList); sublistsIndices.put(index, subList); subList.getSelectionModel().selectedIndexProperty().addListener((o, oldVal, newVal) -> { if (newVal.intValue() != -1) { updateOverAllSelectedIndex(); } }); } }
@Override protected void updateChildren() { super.updateChildren(); if (container != null) { getChildren().remove(1); getChildren().add(container); } }
@Override public void start(Stage primaryStage) throws Exception { JFXToolbar jfxToolbar = new JFXToolbar(); jfxToolbar.setLeftItems(new Label("Left")); jfxToolbar.setRightItems(new Label("Right")); StackPane main = new StackPane(); main.getChildren().add(jfxToolbar); Scene scene = new Scene(main, 600, 400); scene.getStylesheets().add(ToolBarDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); primaryStage.setScene(scene); primaryStage.show(); }
@Override public void init() { nextPage.setOpacity(0); wizard.getChildren().add(tempPage); wizard.getChildren().add(nextPage); newX = colorPane1.localToScene(colorPane1.getBoundsInLocal()).getMinX(); newY = colorPane1.localToScene(colorPane1.getBoundsInLocal()).getMinY(); tempPage.getChildren().add(colorPane1); colorPane1.setTranslateX(newX); colorPane1.setTranslateY(newY); }
private void initialize() { this.setAutoFix(false); this.setAutoHide(true); this.setHideOnEscape(true); this.setConsumeAutoHidingEvents(false); this.getStyleClass().add(DEFAULT_STYLE_CLASS); }
@Override public Node getDisplayNode() { if (displayNode == null) { displayNode = getEditableInputNode(); displayNode.getStyleClass().add("time-picker-display-node"); updateDisplayNode(); } displayNode.setEditable(jfxTimePicker.isEditable()); return displayNode; }
public JFXAutoCompletePopup() { super(); bridge = new CSSBridge(); getContent().setAll(bridge); setAutoFix(true); setAutoHide(true); setHideOnEscape(true); getStyleClass().add(DEFAULT_STYLE_CLASS); }
public void setContent(Node content) { if (contentContainer.getChildren().size() == 2) { contentContainer.getChildren().set(1, content); } else if (contentContainer.getChildren().size() == 1) { contentContainer.getChildren().add(content); } else { contentContainer.getChildren().setAll(headerSpace, content); } VBox.setVgrow(content, Priority.ALWAYS); }
protected BorderPane createCalendarMonthLabelPane() { monthYearLabel = new Label(); monthYearLabel.getStyleClass().add(SPINNER_LABEL); monthYearLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 13)); monthYearLabel.setTextFill(DEFAULT_COLOR); BorderPane monthContainer = new BorderPane(); monthContainer.setMinHeight(50); monthContainer.setCenter(monthYearLabel); monthContainer.setPadding(new Insets(2, 12, 2, 12)); return monthContainer; }