public class ImageNodeStyle extends Object implements INodeStyle, Cloneable
This style can be used together with ImageNodeStyleRenderer instances.
| Constructor and Description |
|---|
ImageNodeStyle()
Creates a new instance with no image and
ImageNodeStyleRenderer as renderer. |
ImageNodeStyle(URL imageUrl)
Creates a new instance that uses the specified image and
ImageNodeStyleRenderer as renderer. |
ImageNodeStyle(URL imageUrl,
INodeStyleRenderer styleRenderer)
Create a new instance of this style with a custom renderer instance
|
| Modifier and Type | Method and Description |
|---|---|
ImageNodeStyle |
clone()
Creates a copy of this object and returns it.
|
Image |
getImage()
Gets the image that is used for the style instance.
|
GeneralPath |
getNormalizedOutline()
Gets the
Shape of the outline of the image that will be displayed. |
INodeStyleRenderer |
getRenderer()
Gets the renderer implementation that can be queried for implementations that provide details about the visual
appearance and visual behavior for a given node and this style instance.
|
URL |
getUrl()
Returns the string representing the URL to get the pixel data of the image.
|
void |
setNormalizedOutline(GeneralPath value)
Sets the normalized outline of the image that will be displayed.
|
void |
setUrl(URL url)
Sets the string representing the URL to get the pixel data of the image.
|
public ImageNodeStyle()
ImageNodeStyleRenderer as renderer.public ImageNodeStyle(URL imageUrl)
ImageNodeStyleRenderer as renderer.imageSource - The image to use.public ImageNodeStyle(URL imageUrl, INodeStyleRenderer styleRenderer)
imageUrl - The url to read the pixed data from.styleRenderer - The custom renderer for this instancepublic ImageNodeStyle clone()
ICloneableclone in interface ICloneableclone in class ObjectObject.clone()public Image getImage()
The default value is null.
#setImage(Image)public final GeneralPath getNormalizedOutline()
Shape of the outline of the image that will be displayed.
This shape will be used to satisfy requests to IMarqueeTestable.isInBox(com.yworks.yfiles.view.input.IInputModeContext, com.yworks.yfiles.geometry.RectD)
and IHitTestable.isHit(com.yworks.yfiles.view.input.IInputModeContext, com.yworks.yfiles.geometry.PointD)
and may be left null to indicate default (rectangular) behavior.
Note that this property won't be serialized properly except for its default which is null.
To manage serializing the Shape one can use
com.yworks.yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener(com.yworks.util.EventHandler) and
specify a reference id.
setNormalizedOutline(GeneralPath)public final INodeStyleRenderer getRenderer()
INodeStyle
The idiom for retrieving, e.g. an IVisualCreator implementation for a given style is:
getRenderer in interface INodeStylepublic URL getUrl()
public final void setNormalizedOutline(GeneralPath value)
This shape will be used to satisfy requests to IMarqueeTestable.isInBox(com.yworks.yfiles.view.input.IInputModeContext, com.yworks.yfiles.geometry.RectD)
and IHitTestable.isHit(com.yworks.yfiles.view.input.IInputModeContext, com.yworks.yfiles.geometry.PointD)
and may be left null to indicate default (rectangular) behavior.
Note that this property won't be serialized properly except for its default which is null.
To manage serializing the Shape one can use
com.yworks.yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener(com.yworks.util.EventHandler) and
specify a reference id.
value - The NormalizedOutline to set.getNormalizedOutline()public void setUrl(URL url)