|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.AbstractCustomNodePainter y.view.ImageNodePainter
public class ImageNodePainter
This class is an implementation of GenericNodeRealizer.Painter
. The visual representation of the
painted node is essentially determined by its associated image content.
Field Summary | |
---|---|
protected java.lang.Object |
interpolationPolicy
|
Constructor Summary | |
---|---|
ImageNodePainter()
|
|
ImageNodePainter(java.awt.Image image)
|
|
ImageNodePainter(java.net.URL imageURL)
|
Method Summary | |
---|---|
boolean |
contains(NodeRealizer context,
double x,
double y)
Used as a callback for the GenericNodeRealizer.contains(double, double) method. |
java.awt.Image |
getImage()
Returns the image that is displayed by this realizer. |
java.net.URL |
getImageURL()
Returns the URL of the displayed image, or null if no URL is associated with this painter. |
java.lang.Object |
getInterpolationPolicy()
Returns the interpolation policy that is used when painting the node image. |
protected void |
paintNode(NodeRealizer context,
java.awt.Graphics2D graphics,
boolean sloppy)
Callback method to be overwritten by subclasses called by AbstractCustomNodePainter.paint(NodeRealizer, Graphics2D) . |
void |
setAlphaImageUsed(boolean use)
Determines whether the contains(NodeRealizer,double,double) method should use the alpha transparency of
the image to determine whether this realizer "contains" points. |
void |
setImage(java.awt.Image image)
Sets the image that will be displayed by this painter. |
void |
setImageURL(java.net.URL imageURL)
Sets the URL of the image that will be displayed by this painter. |
void |
setInterpolationPolicy(java.lang.Object interpolationPolicy)
Sets the interpolation policy that is used when painting the node image. |
Methods inherited from class y.view.AbstractCustomNodePainter |
---|
backupGraphics, createSelectionColor, getFillColor, getFillColor2, getFillPaint, getLineColor, getLinePaint, getLineStroke, initializeFill, initializeLine, paint, paintHotSpots, paintPorts, paintSloppy, paintText, restoreGraphics |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object interpolationPolicy
Constructor Detail |
---|
public ImageNodePainter()
public ImageNodePainter(java.net.URL imageURL)
public ImageNodePainter(java.awt.Image image)
Method Detail |
---|
protected void paintNode(NodeRealizer context, java.awt.Graphics2D graphics, boolean sloppy)
AbstractCustomNodePainter
AbstractCustomNodePainter.paint(NodeRealizer, Graphics2D)
.
This method is responsible for drawing the actual node only - neither
the hotspots, nor the labels, should be painted by this method.
paintNode
in class AbstractCustomNodePainter
context
- the context nodegraphics
- the graphics context to usesloppy
- whether to draw the node sloppilyAbstractCustomNodePainter.initializeLine(NodeRealizer, Graphics2D)
,
AbstractCustomNodePainter.initializeFill(NodeRealizer, Graphics2D)
public void setImageURL(java.net.URL imageURL)
imageURL
- the url fof the image that is to be set.public java.net.URL getImageURL()
null
if no URL is associated with this painter.
public void setImage(java.awt.Image image)
null
.
image
- the image that is to be set for this painter.public java.awt.Image getImage()
public java.lang.Object getInterpolationPolicy()
public void setInterpolationPolicy(java.lang.Object interpolationPolicy)
interpolationPolicy
- One of RenderingHints.VALUE_INTERPOLATION_BICUBIC
, RenderingHints.VALUE_INTERPOLATION_BILINEAR
, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
public boolean contains(NodeRealizer context, double x, double y)
GenericNodeRealizer.ContainsTest
GenericNodeRealizer.contains(double, double)
method.
contains
in interface GenericNodeRealizer.ContainsTest
public void setAlphaImageUsed(boolean use)
contains(NodeRealizer,double,double)
method should use the alpha transparency of
the image to determine whether this realizer "contains" points. This influences hit testing and edge intersection
calculation
use
- whether to use the Alpha Transparency of the image
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |