本文整理了Java中javafx.scene.Node.parentProperty()
方法的一些代码示例,展示了Node.parentProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.parentProperty()
方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:parentProperty
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
scrollPane.getContent().getParent().addEventHandler(ScrollEvent.ANY, scrollHandler);
scrollPane.getContent().parentProperty().addListener((o,oldVal, newVal)->{
if (oldVal != null) {
oldVal.removeEventHandler(MouseEvent.DRAG_DETECTED, dragHandler);
代码示例来源:origin: stackoverflow.com
private void displayLabelForData(XYChart.Data<String, Number> data) {
final Node node = data.getNode();
final Text dataText = new Text(data.getYValue() + "");
node.parentProperty().addListener(new ChangeListener<Parent>() {
@Override public void changed(ObservableValue<? extends Parent> ov, Parent oldParent, Parent parent) {
Group parentGroup = (Group) parent;
parentGroup.getChildren().add(dataText);
}
});
node.boundsInParentProperty().addListener(new ChangeListener<Bounds>() {
@Override public void changed(ObservableValue<? extends Bounds> ov, Bounds oldBounds, Bounds bounds) {
dataText.setLayoutX(
Math.round(
bounds.getMinX() + bounds.getWidth() / 2 - dataText.prefWidth(-1) / 2
)
);
dataText.setLayoutY(
Math.round(
bounds.getMinY() - dataText.prefHeight(-1) * 0.5
)
);
}
});
}
代码示例来源:origin: org.jrebirth.af/core
@Override
public void changed(final ObservableValue<? extends Node> observable, final Node oldValue, final Node newValue) {
if (newValue != null) {
AbstractBaseModel.this.hasBeenAttached = true;
}
if (newValue == null && AbstractBaseModel.this.hasBeenAttached) {
AbstractBaseModel.this.hasBeenAttached = false;
release();
node().parentProperty().removeListener(this);
}
}
代码示例来源:origin: org.jrebirth.af/core
/**
* Attach a custom listener that will release the mode when the rootNode is removed from its parent.
*/
protected void attachParentListener() {
final AutoRelease ar = ClassUtility.getLastClassAnnotation(this.getClass(), AutoRelease.class);
// Only manage automatic release when the annotation exists with true value
if (ar != null && ar.value() && node() != null) { // TODO check rootnode null when using NullView
// Allow to release the model if the root business object doesn't exist anymore
node().parentProperty().addListener(new ChangeListener<Node>() {
@Override
public void changed(final ObservableValue<? extends Node> observable, final Node oldValue, final Node newValue) {
if (newValue != null) {
AbstractBaseModel.this.hasBeenAttached = true;
}
if (newValue == null && AbstractBaseModel.this.hasBeenAttached) {
AbstractBaseModel.this.hasBeenAttached = false;
release();
node().parentProperty().removeListener(this);
}
}
});
}
}
代码示例来源:origin: com.jfoenix/jfoenix
scrollPane.getContent().getParent().addEventHandler(ScrollEvent.ANY, scrollHandler);
scrollPane.getContent().parentProperty().addListener((o,oldVal, newVal)->{
if (oldVal != null) {
oldVal.removeEventHandler(MouseEvent.DRAG_DETECTED, dragHandler);
内容来源于网络,如有侵权,请联系作者删除!