public abstract class IlvFilterSDMRenderer extends IlvSDMRenderer
IlvFilterSDMRenderer
is a superclass for "filtering" SDM renderers.
Filtering renderers implement the "Decorator" design pattern. A filtering renderer relies on another renderer (called the "filtered" renderer) to do most of the rendering work, but it can slightly modify the objects created by the filtered renderer to add a particular functionality.
Filtering renderers can be cascaded at an arbitrary level: a filtering renderer can filter another filtering renderer, and so on.
Each method of IlvFilterSDMRenderer
simply
calls the same method on the filtered renderer. Subclasses
will override one or several methods to add a particular
functionality. Note that, in most cases, the overridden
methods must call their superclass to ensure that the
rendering chain is not broken.
This class is marked as "abstract" because it is of no use in itself. It is only useful as a superclass for other filtering renderers.
Modifier and Type | Field and Description |
---|---|
protected IlvSDMRenderer |
_renderer
The filtered renderer that this filtering
renderer delegates to.
|
PSEUDOCLASS_PREFIX
Constructor and Description |
---|
IlvFilterSDMRenderer()
Creates a filtering renderer with a
null
filtered renderer. |
IlvFilterSDMRenderer(IlvSDMRenderer renderer)
Creates a filtering renderer with a specified filtered
renderer.
|
Modifier and Type | Method and Description |
---|---|
void |
addLinkGraphic(IlvSDMEngine engine,
Object link,
IlvGraphic graphic,
boolean redraw)
This method simply calls the
addLinkGraphic method
of the filtered renderer. |
void |
addNodeGraphic(IlvSDMEngine engine,
Object node,
IlvGraphic graphic,
boolean redraw)
This method simply calls the
addNodeGraphic method
of the filtered renderer. |
IlvRect |
computeBBox(IlvSDMEngine engine,
IlvManagerView view,
IlvTransformer t)
This method calls the filtered renderer's
computeBBox method. |
IlvGraphic |
createLinkGraphic(IlvSDMEngine engine,
Object link,
IlvGraphic from,
IlvGraphic to)
This method simply calls the
createLinkGraphic method
of the filtered renderer. |
IlvGraphic |
createNodeGraphic(IlvSDMEngine engine,
Object node)
This method simply calls the
createNodeGraphic method
of the filtered renderer. |
void |
customize(IlvSDMEngine engine,
Object object,
IlvGraphic g,
String[] pseudoClasses)
This method simply calls the
customize method
of the filtered renderer. |
IlvGraphic |
getEncapsulatedGraphic(IlvGraphic graphic)
This method calls the filtered renderer's
getEncapsulatedGraphic
method. |
IlvSDMRenderer |
getFilteredRenderer()
Returns the filtered renderer to which this filtering
renderer delegates.
|
Object |
getGraphicProperty(IlvSDMEngine engine,
Object object,
String property,
String[] pseudoClasses,
Class<?> targetClass)
This method simply calls the
getGraphicProperty method
of the filtered renderer. |
IlvRect |
getLinkConnectionRectangle(IlvSDMEngine engine,
IlvGraphic graphic,
IlvTransformer t,
IlvLinkConnector lc)
This method simply calls the
getLinkConnectionRectangle method
of the filtered renderer. |
void |
linkGraphicAdded(IlvSDMEngine engine,
Object object,
IlvGraphic graphic,
boolean redraw)
Simply calls the
linkGraphicAdded method
of the filtered renderer. |
protected void |
moveResizeNodeGraphic(IlvSDMEngine engine,
Object node,
IlvGraphic graphic,
IlvRect newBBox,
int anchor)
Move the graphic to its final position
|
void |
nodeGraphicAdded(IlvSDMEngine engine,
Object object,
IlvGraphic graphic,
boolean redraw)
Simply calls the
nodeGraphicAdded method
of the filtered renderer. |
void |
nodeGraphicBBoxChanged(IlvSDMEngine engine,
Object node,
IlvGraphic graphic,
IlvRect oldBBox,
IlvRect newBBox,
String[] pseudoClasses)
This method calls the filtered renderer's
nodeGraphicBBoxChanged
method. |
void |
prepareRendering(IlvSDMEngine engine)
This implementation calls the filtered renderer's
prepareRendering method. |
boolean |
processServerAction(int x,
int y,
IlvManagerView view)
Calls the filtered renderer's
processServerAction method. |
void |
propertiesChanged(IlvSDMEngine engine,
Object object,
Collection<String> propertyNames,
IlvGraphic graphic)
This method simply calls the
propertiesChanged method
of the filtered renderer. |
void |
removeAll(IlvSDMEngine engine)
This implementation calls the filtered renderer's
removeAll method. |
void |
removeLinkGraphic(IlvSDMEngine engine,
Object link,
IlvGraphic graphic,
boolean redraw)
Simply calls the
removeLinkGraphic method
of the filtered renderer. |
void |
removeNodeGraphic(IlvSDMEngine engine,
Object node,
IlvGraphic graphic,
boolean redraw)
Simply calls the
removeNodeGraphic method
of the filtered renderer. |
void |
renderingDone(IlvSDMEngine engine)
This implementation calls the filtered renderer's
renderingDone method. |
void |
setFilteredRenderer(IlvSDMRenderer renderer)
Sets the filtered renderer called by this filtering
renderer.
|
void |
updateObjectProperties(IlvSDMEngine engine,
Object object,
String property,
Object value,
String[] pseudoClasses)
This method simply calls the
updateObjectProperties method
of the filtered renderer. |
addViewListeners, callMoveResizeNodeGraphic, convert, convert, getAlias, getAuxiliaryBean, getAuxiliaryBeans, getEngine, getLinkConnectionRectangle, getLocation, getParameter, needsViewListeners, propertyChanged, removeViewListeners, setAlias, setEngine, setLayerName, setParameter
protected IlvSDMRenderer _renderer
public IlvFilterSDMRenderer(IlvSDMRenderer renderer)
renderer
- The filtered renderer.public IlvFilterSDMRenderer()
null
filtered renderer. The filtered renderer must be set
using setFilteredRenderer(ilog.views.sdm.renderer.IlvSDMRenderer)
.public void setFilteredRenderer(IlvSDMRenderer renderer)
renderer
- The new filtered renderer.public IlvSDMRenderer getFilteredRenderer()
public IlvGraphic createLinkGraphic(IlvSDMEngine engine, Object link, IlvGraphic from, IlvGraphic to)
createLinkGraphic
method
of the filtered renderer.createLinkGraphic
in class IlvSDMRenderer
engine
- The SDM engine associated with the grapher in
which the graphic object will be added.link
- The data link to translate into an IlvGraphic
.from
- The graphic object associated with the source node of the link.to
- The graphic object associated with the destination node of the link.public IlvGraphic createNodeGraphic(IlvSDMEngine engine, Object node)
createNodeGraphic
method
of the filtered renderer.createNodeGraphic
in class IlvSDMRenderer
engine
- The SDM engine associated with the grapher in
which the graphic object will be added.node
- The data node to translate into an IlvGraphic
.public void addNodeGraphic(IlvSDMEngine engine, Object node, IlvGraphic graphic, boolean redraw)
addNodeGraphic
method
of the filtered renderer.addNodeGraphic
in class IlvSDMRenderer
engine
- The SDM engine associated with the grapher in which
the graphic object will be added.node
- The node that is being translated into an IlvGraphic
.graphic
- The graphic object returned by createNodeGraphic
.redraw
- If true
, the region covered
by the new graphic object must be redrawn.public void addLinkGraphic(IlvSDMEngine engine, Object link, IlvGraphic graphic, boolean redraw)
addLinkGraphic
method
of the filtered renderer.addLinkGraphic
in class IlvSDMRenderer
engine
- The SDM engine associated with the grapher in which
the graphic object will be added.link
- The link that is being translated into an IlvGraphic
.graphic
- The graphic object returned by createLinkGraphic
.redraw
- If true
, the region covered by the new
graphic object must be redrawn.public void nodeGraphicAdded(IlvSDMEngine engine, Object object, IlvGraphic graphic, boolean redraw)
nodeGraphicAdded
method
of the filtered renderer.nodeGraphicAdded
in class IlvSDMRenderer
engine
- The SDM engine associated with the grapher in which
the graphic object has been added.object
- The object that is being translated into an IlvGraphic
.graphic
- The graphic object that has just been added to the grapher.redraw
- If true
, the region covered by the new
graphic object must be redrawn.IlvSDMRenderer.addNodeGraphic(ilog.views.sdm.IlvSDMEngine, java.lang.Object, ilog.views.IlvGraphic, boolean)
public void linkGraphicAdded(IlvSDMEngine engine, Object object, IlvGraphic graphic, boolean redraw)
linkGraphicAdded
method
of the filtered renderer.linkGraphicAdded
in class IlvSDMRenderer
engine
- The SDM engine associated with the grapher in which
the graphic object has been added.object
- The object that is being translated into an IlvGraphic
.graphic
- The graphic object that has just been added to the grapher.redraw
- If true
, the region covered by the new
graphic object must be redrawn.IlvSDMRenderer.addLinkGraphic(ilog.views.sdm.IlvSDMEngine, java.lang.Object, ilog.views.IlvGraphic, boolean)
public void removeNodeGraphic(IlvSDMEngine engine, Object node, IlvGraphic graphic, boolean redraw)
removeNodeGraphic
method
of the filtered renderer.removeNodeGraphic
in class IlvSDMRenderer
engine
- The SDM engine associated with the grapher from which
the graphic object will be removed.node
- The node that has been removed or modified in the data model.graphic
- The graphic object that must be removed from the grapher.redraw
- If true
, the region covered by the
graphic object must be redrawn.public void removeLinkGraphic(IlvSDMEngine engine, Object link, IlvGraphic graphic, boolean redraw)
removeLinkGraphic
method
of the filtered renderer.removeLinkGraphic
in class IlvSDMRenderer
engine
- The SDM engine associated with the grapher from which
the graphic object will be removed.link
- The link that has been removed or modified in the data model.graphic
- The graphic object that must be removed from the grapher.redraw
- If true
, the region covered by the
graphic object must be redrawn.public void removeAll(IlvSDMEngine engine)
removeAll
method.removeAll
in class IlvSDMRenderer
engine
- The SDM engine.public void prepareRendering(IlvSDMEngine engine)
prepareRendering
method.prepareRendering
in class IlvSDMRenderer
engine
- The SDM engine.public void renderingDone(IlvSDMEngine engine)
renderingDone
method.renderingDone
in class IlvSDMRenderer
engine
- The SDM engine.public void propertiesChanged(IlvSDMEngine engine, Object object, Collection<String> propertyNames, IlvGraphic graphic)
propertiesChanged
method
of the filtered renderer.propertiesChanged
in class IlvSDMRenderer
engine
- The SDM engine associated with the grapher in
which the graphic object is displayed.object
- The data object whose property has changed.propertyNames
- The names of the properties that have been modified.graphic
- The graphic object associated with object
.public Object getGraphicProperty(IlvSDMEngine engine, Object object, String property, String[] pseudoClasses, Class<?> targetClass)
getGraphicProperty
method
of the filtered renderer.getGraphicProperty
in class IlvSDMRenderer
engine
- The SDM engine.object
- The data object that is being rendered.property
- The name of the graphic property.pseudoClasses
- The pseudo-classes of the object. This parameter can be null
.targetClass
- The class of the object on which the property will be
set. The method can introspect the class to determine the type
of the property, and convert the value if necessary. If this argument
is null
, the property should be returned without conversion.public void updateObjectProperties(IlvSDMEngine engine, Object object, String property, Object value, String[] pseudoClasses)
updateObjectProperties
method
of the filtered renderer.updateObjectProperties
in class IlvSDMRenderer
engine
- The SDM engine.object
- The data object.property
- The name of the graphic property.value
- The new value of the property.pseudoClasses
- The pseudo-classes of the objects.
This parameter can be null
.public void customize(IlvSDMEngine engine, Object object, IlvGraphic g, String[] pseudoClasses)
customize
method
of the filtered renderer.customize
in class IlvSDMRenderer
engine
- The SDM engine.object
- The data object that the graphic object represents.g
- The graphic object to customize.pseudoClasses
- The pseudo-classes of the object. This parameter
can be null
.public IlvRect getLinkConnectionRectangle(IlvSDMEngine engine, IlvGraphic graphic, IlvTransformer t, IlvLinkConnector lc)
getLinkConnectionRectangle
method
of the filtered renderer.getLinkConnectionRectangle
in class IlvSDMRenderer
engine
- The SDM engine.graphic
- The graphic object returned by createNodeGraphic
.t
- The transformer of the view.lc
- The link connector from which this is called.
This can be null
.public IlvGraphic getEncapsulatedGraphic(IlvGraphic graphic)
getEncapsulatedGraphic
method.getEncapsulatedGraphic
in class IlvSDMRenderer
graphic
- A graphic object returned by createNodeGraphic
.public void nodeGraphicBBoxChanged(IlvSDMEngine engine, Object node, IlvGraphic graphic, IlvRect oldBBox, IlvRect newBBox, String[] pseudoClasses)
nodeGraphicBBoxChanged
method.nodeGraphicBBoxChanged
in class IlvSDMRenderer
engine
- The SDM engine.node
- The data node that the graphic object represents.graphic
- The graphic object that has been moved and/or resized.oldBBox
- The bounding box of the graphic object before
the change.newBBox
- The bounding box of the graphic object after
the change.pseudoClasses
- The pseudo-classes of the object.
This parameter can be null
.public IlvRect computeBBox(IlvSDMEngine engine, IlvManagerView view, IlvTransformer t)
computeBBox
method.computeBBox
in class IlvSDMRenderer
engine
- The SDM engine.view
- The manager view for which the bounding rectangle is computed.t
- The transformer used to compute the bbox
.
A null
value is equivalent to an identity transformer.protected void moveResizeNodeGraphic(IlvSDMEngine engine, Object node, IlvGraphic graphic, IlvRect newBBox, int anchor)
moveResizeNodeGraphic
in class IlvSDMRenderer
engine
- The SDM engine.node
- The data node that the graphic object represents.graphic
- The graphic object that to be moved and/or resized.newBBox
- An IlvRectangle
initialized with the "x"
, "y"
,
"width"
and "height"
graphic properties.
If the width or height of the rectangle are non-zero, the graphic object
is moved and resized, otherwise the graphic object is only moved.
The final position must be stored in this parameter.anchor
- see IlvDirection
for the possible valuespublic boolean processServerAction(int x, int y, IlvManagerView view)
processServerAction
method.processServerAction
in class IlvSDMRenderer
x
- The X coordinate of the point where the user clicked on the client-side,
in view coordinates.y
- The y coordinate of the point where the user clicked on the client-side,
in view coordinates.view
- The view used to render the graph image.true
if the action was processed,
false
if the action was not processed.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.