< prev index next >
modules/swing/src/main/java/javafx/embed/swing/SwingNode.java
Print this page
*** 133,142 ****
--- 133,158 ----
@Override
public void doUpdatePeer(Node node) {
((SwingNode) node).doUpdatePeer();
}
+
+ @Override
+ public BaseBounds doComputeGeomBounds(Node node,
+ BaseBounds bounds, BaseTransform tx) {
+ return ((SwingNode) node).doComputeGeomBounds(bounds, tx);
+ }
+
+ @Override
+ public boolean doComputeContains(Node node, double localX, double localY) {
+ return ((SwingNode) node).doComputeContains(localX, localY);
+ }
+
+ @Override
+ public Object doProcessMXNode(Node node, MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx) {
+ return ((SwingNode) node).doProcessMXNode(alg, ctx);
+ }
});
}
private double fxWidth;
private double fxHeight;
*** 397,407 ****
@Override public void resize(final double width, final double height) {
super.resize(width, height);
if (width != this.fxWidth || height != this.fxHeight) {
this.fxWidth = width;
this.fxHeight = height;
! impl_geomChanged();
NodeHelper.markDirty(this, DirtyBits.NODE_GEOMETRY);
SwingFXUtils.runOnEDT(() -> {
if (lwFrame != null) {
locateLwFrame();
}
--- 413,423 ----
@Override public void resize(final double width, final double height) {
super.resize(width, height);
if (width != this.fxWidth || height != this.fxHeight) {
this.fxWidth = width;
this.fxHeight = height;
! NodeHelper.geomChanged(this);
NodeHelper.markDirty(this, DirtyBits.NODE_GEOMETRY);
SwingFXUtils.runOnEDT(() -> {
if (lwFrame != null) {
locateLwFrame();
}
*** 469,485 ****
*/
@Override public double minHeight(double width) {
return swingMinHeight / getPlatformScaleY();
}
! /**
! * @treatAsPrivate implementation detail
! * @deprecated This is an internal API that is not intended for use and will be removed in the next version
*/
! @Deprecated
! @Override
! protected boolean impl_computeContains(double localX, double localY) {
return true;
}
private final InvalidationListener locationListener = observable -> {
locateLwFrame();
--- 485,498 ----
*/
@Override public double minHeight(double width) {
return swingMinHeight / getPlatformScaleY();
}
! /*
! * Note: This method MUST only be called via its accessor method.
*/
! private boolean doComputeContains(double localX, double localY) {
return true;
}
private final InvalidationListener locationListener = observable -> {
locateLwFrame();
*** 578,588 ****
}
addSceneListeners(newValue);
}
});
! impl_treeVisibleProperty().addListener((observable, oldValue, newValue) -> {
setLwFrameVisible(newValue);
});
return peer;
}
--- 591,601 ----
}
addSceneListeners(newValue);
}
});
! NodeHelper.treeVisibleProperty(this).addListener((observable, oldValue, newValue) -> {
setLwFrameVisible(newValue);
});
return peer;
}
*** 692,720 ****
}
}
});
}
! /**
! * @treatAsPrivate implementation detail
! * @deprecated This is an internal API that is not intended for use and will be removed in the next version
*/
! @Deprecated
! @Override
! public BaseBounds impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx) {
bounds.deriveWithNewBounds(0, 0, 0, (float)fxWidth, (float)fxHeight, 0);
tx.transform(bounds, bounds);
return bounds;
}
! /**
! * @treatAsPrivate implementation detail
! * @deprecated This is an internal API that is not intended for use and will be removed in the next version
*/
! @Deprecated
! @Override
! public Object impl_processMXNode(MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx) {
return alg.processLeafNode(this, ctx);
}
private class SwingNodeContent implements LightweightContent {
private JComponent comp;
--- 705,727 ----
}
}
});
}
! /*
! * Note: This method MUST only be called via its accessor method.
*/
! private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx) {
bounds.deriveWithNewBounds(0, 0, 0, (float)fxWidth, (float)fxHeight, 0);
tx.transform(bounds, bounds);
return bounds;
}
! /*
! * Note: This method MUST only be called via its accessor method.
*/
! private Object doProcessMXNode(MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx) {
return alg.processLeafNode(this, ctx);
}
private class SwingNodeContent implements LightweightContent {
private JComponent comp;
*** 778,804 ****
@Override
public void preferredSizeChanged(final int width, final int height) {
SwingFXUtils.runOnFxThread(() -> {
SwingNode.this.swingPrefWidth = width;
SwingNode.this.swingPrefHeight = height;
! SwingNode.this.impl_notifyLayoutBoundsChanged();
});
}
@Override
public void maximumSizeChanged(final int width, final int height) {
SwingFXUtils.runOnFxThread(() -> {
SwingNode.this.swingMaxWidth = width;
SwingNode.this.swingMaxHeight = height;
! SwingNode.this.impl_notifyLayoutBoundsChanged();
});
}
@Override
public void minimumSizeChanged(final int width, final int height) {
SwingFXUtils.runOnFxThread(() -> {
SwingNode.this.swingMinWidth = width;
SwingNode.this.swingMinHeight = height;
! SwingNode.this.impl_notifyLayoutBoundsChanged();
});
}
//@Override
public void setCursor(Cursor cursor) {
--- 785,811 ----
@Override
public void preferredSizeChanged(final int width, final int height) {
SwingFXUtils.runOnFxThread(() -> {
SwingNode.this.swingPrefWidth = width;
SwingNode.this.swingPrefHeight = height;
! NodeHelper.notifyLayoutBoundsChanged(SwingNode.this);
});
}
@Override
public void maximumSizeChanged(final int width, final int height) {
SwingFXUtils.runOnFxThread(() -> {
SwingNode.this.swingMaxWidth = width;
SwingNode.this.swingMaxHeight = height;
! NodeHelper.notifyLayoutBoundsChanged(SwingNode.this);
});
}
@Override
public void minimumSizeChanged(final int width, final int height) {
SwingFXUtils.runOnFxThread(() -> {
SwingNode.this.swingMinWidth = width;
SwingNode.this.swingMinHeight = height;
! NodeHelper.notifyLayoutBoundsChanged(SwingNode.this);
});
}
//@Override
public void setCursor(Cursor cursor) {
< prev index next >