本文整理了Java中javafx.collections.ObservableList.add()
方法的一些代码示例,展示了ObservableList.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObservableList.add()
方法的具体详情如下:
包路径:javafx.collections.ObservableList
类名称:ObservableList
方法名:add
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
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\";");
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
/**
* 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);
}
代码示例来源:origin: jfoenixadmin/JFoenix
protected void positionControl(Node control) {
if(this.position.get() == RipplerPos.BACK){
getChildren().add(control);
}else{
getChildren().add(0, control);
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
@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();
}
代码示例来源:origin: jfoenixadmin/JFoenix
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;
}
代码示例来源:origin: jfoenixadmin/JFoenix
public JFXChip(JFXChipView<T> view, T item) {
this.view = view;
getStyleClass().add("jfx-chip");
setItem(item);
}
代码示例来源:origin: jfoenixadmin/JFoenix
protected final void createRippleUI() {
// create rippler panels
rippler = new RippleGenerator();
ripplerPane = new StackPane();
ripplerPane.setMouseTransparent(true);
ripplerPane.getChildren().add(rippler);
getChildren().add(ripplerPane);
}
代码示例来源:origin: jfoenixadmin/JFoenix
private void addTab(Tab tab, int addToIndex, boolean visible) {
TabHeaderContainer tabHeaderContainer = new TabHeaderContainer(tab);
tabHeaderContainer.setVisible(visible);
headersRegion.getChildren().add(addToIndex, tabHeaderContainer);
}
代码示例来源:origin: jfoenixadmin/JFoenix
/**
* Creates empty nodes list.
*/
public JFXNodesList() {
setPickOnBounds(false);
getStyleClass().add("jfx-nodes-list");
setAlignment(Pos.TOP_CENTER);
}
代码示例来源:origin: jfoenixadmin/JFoenix
protected void initNode(Node node) {
node.setScaleX(0);
node.setScaleY(0);
node.getStyleClass().add("sub-node");
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
@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();
}
代码示例来源:origin: jfoenixadmin/JFoenix
@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();
}
});
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
protected void updateChildren() {
super.updateChildren();
if (container != null) {
getChildren().remove(1);
getChildren().add(container);
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
@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();
}
代码示例来源:origin: jfoenixadmin/JFoenix
@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);
}
代码示例来源:origin: jfoenixadmin/JFoenix
private void initialize() {
this.setAutoFix(false);
this.setAutoHide(true);
this.setHideOnEscape(true);
this.setConsumeAutoHidingEvents(false);
this.getStyleClass().add(DEFAULT_STYLE_CLASS);
}
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
public Node getDisplayNode() {
if (displayNode == null) {
displayNode = getEditableInputNode();
displayNode.getStyleClass().add("time-picker-display-node");
updateDisplayNode();
}
displayNode.setEditable(jfxTimePicker.isEditable());
return displayNode;
}
代码示例来源:origin: jfoenixadmin/JFoenix
public JFXAutoCompletePopup() {
super();
bridge = new CSSBridge();
getContent().setAll(bridge);
setAutoFix(true);
setAutoHide(true);
setHideOnEscape(true);
getStyleClass().add(DEFAULT_STYLE_CLASS);
}
代码示例来源:origin: jfoenixadmin/JFoenix
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);
}
代码示例来源:origin: jfoenixadmin/JFoenix
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;
}
内容来源于网络,如有侵权,请联系作者删除!