本文整理了Java中javafx.collections.ObservableList.contains()
方法的一些代码示例,展示了ObservableList.contains()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObservableList.contains()
方法的具体详情如下:
包路径:javafx.collections.ObservableList
类名称:ObservableList
方法名:contains
暂无
代码示例来源: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
/**
* @return true if the column is grouped else false
*/
public boolean isGrouped() {
return getTreeTableView() instanceof JFXTreeTableView && ((JFXTreeTableView<?>) getTreeTableView()).getGroupOrder()
.contains(
this);
}
代码示例来源:origin: jfoenixadmin/JFoenix
if (groupOrder.contains(treeTableColumn)) {
continue;
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
protected void layoutChildren() {
super.layoutChildren();
if (!getChildren().contains(selectedPane)) {
getChildren().add(0, cellRippler);
cellRippler.rippler.clear();
getChildren().add(0, selectedPane);
}
cellRippler.resizeRelocate(0, 0, getWidth(), getHeight());
cellRippler.releaseRipple();
selectedPane.resizeRelocate(0, 0, selectedPane.prefWidth(-1), getHeight());
selectedPane.setVisible(isSelected() ? true : false);
}
代码示例来源:origin: speedment/speedment
@Override
protected Node createUndecoratedEditor() {
final ChoiceBox<T> box = new ChoiceBox<>(alternatives);
final T val = currentValue.getValue();
if (alternatives.contains(val)) {
box.setValue(val);
} else {
box.setValue(alternatives.get(0));
}
currentValue.bindBidirectional(box.valueProperty());
return box;
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
/**
* validates the value of the tree item,
* this method also hides the column value for the grouped nodes
*
* @param param tree item
* @return true if the value is valid else false
*/
public final boolean validateValue(CellDataFeatures<S, T> param) {
Object rowObject = param.getValue().getValue();
return !((rowObject instanceof RecursiveTreeObject && rowObject.getClass() == RecursiveTreeObject.class)
|| (param.getTreeTableView() instanceof JFXTreeTableView
&& ((JFXTreeTableView<?>) param.getTreeTableView()).getGroupOrder().contains(this)
// make sure the node is a direct child to a group node
&& param.getValue().getParent() != null
&& param.getValue().getParent().getValue() != null
&& param.getValue().getParent().getValue().getClass() == RecursiveTreeObject.class
));
}
代码示例来源:origin: jfoenixadmin/JFoenix
/**
* this method will update the source control after evaluating the validation condition
*/
protected void onEval() {
Node control = getSrcControl();
if (hasErrors.get()) {
control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, true);
if (control instanceof Control) {
Tooltip controlTooltip = ((Control) control).getTooltip();
if (controlTooltip != null && !controlTooltip.getStyleClass().contains("error-tooltip")) {
tooltip = ((Control) control).getTooltip();
}
errorTooltip.setText(getMessage());
((Control) control).setTooltip(errorTooltip);
}
} else {
if (control instanceof Control) {
Tooltip controlTooltip = ((Control) control).getTooltip();
if ((controlTooltip != null && controlTooltip.getStyleClass().contains("error-tooltip"))
|| (controlTooltip == null && tooltip != null)) {
((Control) control).setTooltip(tooltip);
}
tooltip = null;
}
control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, false);
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
OverLayRipple() {
super();
setOverLayBounds(this);
this.getStyleClass().add("jfx-rippler-overlay");
// update initial position
if(JFXRippler.this.getChildrenUnmodifiable().contains(control)) {
double diffMinX = Math.abs(control.getBoundsInLocal().getMinX() - control.getLayoutBounds().getMinX());
double diffMinY = Math.abs(control.getBoundsInLocal().getMinY() - control.getLayoutBounds().getMinY());
Bounds bounds = control.getBoundsInParent();
this.setX(bounds.getMinX() + diffMinX - snappedLeftInset());
this.setY(bounds.getMinY() + diffMinY - snappedTopInset());
}
// set initial attributes
setOpacity(0);
setCache(true);
setCacheHint(CacheHint.SPEED);
setCacheShape(true);
setManaged(false);
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
protected void initControlListeners() {
// if the control got resized the overlay rect must be rest
control.layoutBoundsProperty().addListener(observable -> resetRippler());
if (getChildren().contains(control)) {
control.boundsInParentProperty().addListener(observable -> resetRippler());
}
control.addEventHandler(MouseEvent.MOUSE_PRESSED,
(event) -> createRipple(event.getX() + padding, event.getY() + padding));
// create fade out transition for the ripple
control.addEventHandler(MouseEvent.MOUSE_RELEASED, e -> releaseRipple());
}
代码示例来源:origin: jfoenixadmin/JFoenix
/**
* init mouse listeners on the control
*/
protected void initControlListeners() {
// if the control got resized the overlay rect must be rest
control.layoutBoundsProperty().addListener(observable -> resetRippler());
if(getChildren().contains(control))
control.boundsInParentProperty().addListener(observable -> resetRippler());
control.addEventHandler(MouseEvent.MOUSE_PRESSED,
(event) -> createRipple(event.getX(), event.getY()));
// create fade out transition for the ripple
control.addEventHandler(MouseEvent.MOUSE_RELEASED, e -> releaseRipple());
}
代码示例来源:origin: jfoenixadmin/JFoenix
if (!dayCell.getStyleClass().contains("selected")) {
dayCell.setBackground(new Background(new BackgroundFill(Color.valueOf("#EDEDED"),
new CornerRadii(40),
if (!dayCell.getStyleClass().contains("selected")) {
dayCell.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT,
CornerRadii.EMPTY,
代码示例来源:origin: jfoenixadmin/JFoenix
clip.setWidth(getWidth());
if (!getChildren().contains(cellRippler)) {
makeChildrenTransparent();
getChildren().add(0, cellRippler);
if (this.getGraphic() != null && this.getGraphic().getStyleClass().contains("sublist-container")) {
this.getStyleClass().add("sublist-item");
} else {
代码示例来源:origin: torakiki/pdfsam
void hasUnseenErrors(boolean value) {
if (value) {
if (!(anim.getStatus() == Status.RUNNING)) {
anim.play();
}
if (!getStyleClass().contains(HAS_ERRORS_CSS_CLASS)) {
getStyleClass().add(HAS_ERRORS_CSS_CLASS);
}
} else {
getStyleClass().remove(HAS_ERRORS_CSS_CLASS);
anim.stop();
setRotate(0);
setScaleY(1);
}
}
}
代码示例来源:origin: org.drombler.commons/drombler-commons-docking-fx
private void updateStyleClass(Tab tab, boolean modified) {
if (modified) {
if (!tab.getStyleClass().contains(DOCKABLE_MODIFIED_STYLE_CLASS)) {
tab.getStyleClass().add(DOCKABLE_MODIFIED_STYLE_CLASS);
}
} else {
if (tab.getStyleClass().contains(DOCKABLE_MODIFIED_STYLE_CLASS)) {
tab.getStyleClass().remove(DOCKABLE_MODIFIED_STYLE_CLASS);
}
}
}
}
代码示例来源:origin: org.controlsfx/controlsfx
/**
* Create the expanded content node that should represent the current table row.
*
* If the expanded content node is not currently in the children list of the TableRow it is automatically added.
*
* @return The expanded content Node
*/
private Node getContent() {
Node node = expander.getOrCreateExpandedNode(tableRow);
if (!getChildren().contains(node)) getChildren().add(node);
return node;
}
代码示例来源:origin: com.jfoenix/jfoenix
/**
* @return true if the column is grouped else false
*/
public boolean isGrouped() {
return getTreeTableView() instanceof JFXTreeTableView && ((JFXTreeTableView<?>) getTreeTableView()).getGroupOrder()
.contains(
this);
}
代码示例来源:origin: com.jfoenix/jfoenix
@Override
protected void updateChildren() {
super.updateChildren();
getChildren().removeIf(node -> node.getStyleClass().contains("box"));
if (rippler != null) {
getChildren().add(rippler);
}
}
代码示例来源:origin: org.jrebirth.af/component
public void doAddPart(final ModelObject<PartConfig<?, ?>> model, final Wave wave) {
if (!object().panes().contains(model.object())) {
doInsertPart(-1, model, wave);
}
view().addItem(-1, model.node());
}
代码示例来源:origin: com.github.almasb/fxgl-ui
public void setLabelVisible(boolean b) {
if (!b) {
getChildren().remove(label);
barGroup.translateXProperty().unbind();
barGroup.translateYProperty().unbind();
barGroup.setTranslateX(0);
barGroup.setTranslateY(0);
} else if (!getChildren().contains(label)) {
getChildren().add(label);
setLabelPosition(labelPosition);
}
}
代码示例来源:origin: com.github.almasb/fxgl-base
public void setLabelVisible(boolean b) {
if (!b) {
getChildren().remove(label);
barGroup.translateXProperty().unbind();
barGroup.translateYProperty().unbind();
barGroup.setTranslateX(0);
barGroup.setTranslateY(0);
} else if (!getChildren().contains(label)) {
getChildren().add(label);
setLabelPosition(labelPosition);
}
}
内容来源于网络,如有侵权,请联系作者删除!