< prev index next >

modules/graphics/src/main/java/javafx/scene/image/ImageView.java

Print this page

        

*** 153,162 **** --- 153,177 ---- @Override public void doUpdatePeer(Node node) { ((ImageView) node).doUpdatePeer(); } + @Override + public BaseBounds doComputeGeomBounds(Node node, + BaseBounds bounds, BaseTransform tx) { + return ((ImageView) node).doComputeGeomBounds(bounds, tx); + } + + @Override + public boolean doComputeContains(Node node, double localX, double localY) { + return ((ImageView) node).doComputeContains(localX, localY); + } + + @Override + public Object doProcessMXNode(Node node, MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx) { + return ((ImageView) node).doProcessMXNode(alg, ctx); + } }); } { // To initialize the class helper at the begining each constructor of this class
*** 240,250 **** Toolkit.getImageAccessor().getImageProperty(_image). addListener(platformImageChangeListener.getWeakListener()); } if (dimensionChanged) { invalidateWidthHeight(); ! impl_geomChanged(); } NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_CONTENTS); } @Override --- 255,265 ---- Toolkit.getImageAccessor().getImageProperty(_image). addListener(platformImageChangeListener.getWeakListener()); } if (dimensionChanged) { invalidateWidthHeight(); ! NodeHelper.geomChanged(ImageView.this); } NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_CONTENTS); } @Override
*** 306,316 **** new AbstractNotifyListener() { @Override public void invalidated(Observable valueModel) { invalidateWidthHeight(); NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_CONTENTS); ! impl_geomChanged(); } }; /** * The current x coordinate of the {@code ImageView} origin. * --- 321,331 ---- new AbstractNotifyListener() { @Override public void invalidated(Observable valueModel) { invalidateWidthHeight(); NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_CONTENTS); ! NodeHelper.geomChanged(ImageView.this); } }; /** * The current x coordinate of the {@code ImageView} origin. *
*** 332,342 **** x = new DoublePropertyBase() { @Override protected void invalidated() { NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_GEOMETRY); ! impl_geomChanged(); } @Override public Object getBean() { return ImageView.this; --- 347,357 ---- x = new DoublePropertyBase() { @Override protected void invalidated() { NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_GEOMETRY); ! NodeHelper.geomChanged(ImageView.this); } @Override public Object getBean() { return ImageView.this;
*** 372,382 **** y = new DoublePropertyBase() { @Override protected void invalidated() { NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_GEOMETRY); ! impl_geomChanged(); } @Override public Object getBean() { return ImageView.this; --- 387,397 ---- y = new DoublePropertyBase() { @Override protected void invalidated() { NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_GEOMETRY); ! NodeHelper.geomChanged(ImageView.this); } @Override public Object getBean() { return ImageView.this;
*** 419,429 **** @Override protected void invalidated() { invalidateWidthHeight(); NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_VIEWPORT); ! impl_geomChanged(); } @Override public Object getBean() { return ImageView.this; --- 434,444 ---- @Override protected void invalidated() { invalidateWidthHeight(); NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_VIEWPORT); ! NodeHelper.geomChanged(ImageView.this); } @Override public Object getBean() { return ImageView.this;
*** 467,477 **** @Override protected void invalidated() { invalidateWidthHeight(); NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_VIEWPORT); ! impl_geomChanged(); } @Override public Object getBean() { return ImageView.this; --- 482,492 ---- @Override protected void invalidated() { invalidateWidthHeight(); NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_VIEWPORT); ! NodeHelper.geomChanged(ImageView.this); } @Override public Object getBean() { return ImageView.this;
*** 532,542 **** @Override protected void invalidated() { invalidateWidthHeight(); NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_VIEWPORT); ! impl_geomChanged(); } @Override public Object getBean() { return ImageView.this; --- 547,557 ---- @Override protected void invalidated() { invalidateWidthHeight(); NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_VIEWPORT); ! NodeHelper.geomChanged(ImageView.this); } @Override public Object getBean() { return ImageView.this;
*** 636,646 **** @Override protected void invalidated() { invalidateWidthHeight(); NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_VIEWPORT); ! impl_geomChanged(); } @Override public Object getBean() { return ImageView.this; --- 651,661 ---- @Override protected void invalidated() { invalidateWidthHeight(); NodeHelper.markDirty(ImageView.this, DirtyBits.NODE_VIEWPORT); ! NodeHelper.geomChanged(ImageView.this); } @Override public Object getBean() { return ImageView.this;
*** 656,670 **** } // Need to track changes to image width and image height and recompute // bounds when changed. // imageWidth = bind image.width on replace { ! // impl_geomChanged(); // } // // imageHeight = bind image.height on replace { ! // impl_geomChanged(); // } private double destWidth, destHeight; /* --- 671,685 ---- } // Need to track changes to image width and image height and recompute // bounds when changed. // imageWidth = bind image.width on replace { ! // NodeHelper.geomChanged(ImageView.this); // } // // imageHeight = bind image.height on replace { ! // NodeHelper.geomChanged(ImageView.this); // } private double destWidth, destHeight; /*
*** 672,687 **** */ private NGNode doCreatePeer() { return new NGImageView(); } ! /** ! * @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) { recomputeWidthHeight(); bounds = bounds.deriveWithNewBounds((float)getX(), (float)getY(), 0.0f, (float)(getX() + destWidth), (float)(getY() + destHeight), 0.0f); bounds = tx.transform(bounds, bounds); --- 687,700 ---- */ private NGNode doCreatePeer() { return new NGImageView(); } ! /* ! * Note: This method MUST only be called via its accessor method. */ ! private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx) { recomputeWidthHeight(); bounds = bounds.deriveWithNewBounds((float)getX(), (float)getY(), 0.0f, (float)(getX() + destWidth), (float)(getY() + destHeight), 0.0f); bounds = tx.transform(bounds, bounds);
*** 729,752 **** if (localFitHeight > 0f) { h = localFitHeight; } } ! // Store these values for use later in impl_computeContains() to support // Node.contains(). destWidth = w; destHeight = h; validWH = true; } ! /** ! * @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) { if (getImage() == null) { return false; } recomputeWidthHeight(); --- 742,763 ---- if (localFitHeight > 0f) { h = localFitHeight; } } ! // Store these values for use later in doComputeContains() to support // Node.contains(). destWidth = w; destHeight = h; validWH = true; } ! /* ! * Note: This method MUST only be called via its accessor method. */ ! private boolean doComputeContains(double localX, double localY) { if (getImage() == null) { return false; } recomputeWidthHeight();
*** 776,788 **** if (vw > 0 && vh > 0) { viewWidth = vw; viewHeight = vh; } ! // desWidth Note and destHeight are computed by impl_computeGeomBounds() // via a call from Node.contains() before calling ! // impl_computeContains(). // Transform into image's coordinate system. dx = vminx + dx * viewWidth / destWidth; dy = vminy + dy * viewHeight / destHeight; // test whether it's inside the original image AND inside of viewport // (viewport may stick out from the image bounds) --- 787,799 ---- if (vw > 0 && vh > 0) { viewWidth = vw; viewHeight = vh; } ! // desWidth Note and destHeight are computed by NodeHelper.computeGeomBounds() // via a call from Node.contains() before calling ! // doComputeContains(). // Transform into image's coordinate system. dx = vminx + dx * viewWidth / destWidth; dy = vminy + dy * viewHeight / destHeight; // test whether it's inside the original image AND inside of viewport // (viewport may stick out from the image bounds)
*** 891,904 **** if (NodeHelper.isDirty(this, DirtyBits.NODE_VIEWPORT) || NodeHelper.isDirty(this, DirtyBits.NODE_CONTENTS)) { updateViewport(); } } ! /** ! * @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); } } --- 902,913 ---- if (NodeHelper.isDirty(this, DirtyBits.NODE_VIEWPORT) || NodeHelper.isDirty(this, DirtyBits.NODE_CONTENTS)) { updateViewport(); } } ! /* ! * Note: This method MUST only be called via its accessor method. */ ! private Object doProcessMXNode(MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx) { return alg.processLeafNode(this, ctx); } }
< prev index next >