ilog.views.sdm.renderer
Class IlvFilterSDMRenderer

java.lang.Object
  extended by ilog.views.sdm.renderer.IlvSDMRenderer
      extended by ilog.views.sdm.renderer.IlvFilterSDMRenderer
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IlvAnimationRenderer, IlvBlinkingRenderer, IlvColoringRenderer, IlvDecorationRenderer, IlvDrillDownRenderer, IlvGrapherPinRenderer, IlvGraphLayoutRenderer, IlvHalfZoomingRenderer, IlvInteractorRenderer, IlvLabelLayoutRenderer, IlvMapRenderer, IlvSwimLanesRenderer

public abstract class IlvFilterSDMRenderer
extends IlvSDMRenderer

The class 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.

Since:
JViews 4.0
See Also:
Serialized Form

Field Summary
protected  IlvSDMRenderer _renderer
          The filtered renderer that this filtering renderer delegates to.
 
Constructor Summary
IlvFilterSDMRenderer()
          Creates a filtering renderer with a null filtered renderer.
IlvFilterSDMRenderer(IlvSDMRenderer renderer)
          Creates a filtering renderer with a specified filtered renderer.
 
Method Summary
 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)
          This method calls the filtered renderer's getLinkConnectionRectangle method.
 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 propertyChanged(IlvSDMEngine engine, Object object, String propertyName, Object oldValue, Object newValue, IlvGraphic graphic)
          This method simply calls the propertyChanged 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.
 
Methods inherited from class ilog.views.sdm.renderer.IlvSDMRenderer
addViewListeners, callMoveResizeNodeGraphic, convert, convert, getAlias, getAuxiliaryBean, getAuxiliaryBeans, getEngine, getLocation, getParameter, needsViewListeners, removeViewListeners, setAlias, setEngine, setLayerName, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_renderer

protected IlvSDMRenderer _renderer
The filtered renderer that this filtering renderer delegates to.

Constructor Detail

IlvFilterSDMRenderer

public IlvFilterSDMRenderer(IlvSDMRenderer renderer)
Creates a filtering renderer with a specified filtered renderer.

Parameters:
renderer - The filtered renderer.

IlvFilterSDMRenderer

public IlvFilterSDMRenderer()
Creates a filtering renderer with a null filtered renderer. The filtered renderer must be set using setFilteredRenderer(ilog.views.sdm.renderer.IlvSDMRenderer).

Method Detail

setFilteredRenderer

public void setFilteredRenderer(IlvSDMRenderer renderer)
Sets the filtered renderer called by this filtering renderer.

Parameters:
renderer - The new filtered renderer.

getFilteredRenderer

public IlvSDMRenderer getFilteredRenderer()
Returns the filtered renderer to which this filtering renderer delegates.


createLinkGraphic

public IlvGraphic createLinkGraphic(IlvSDMEngine engine,
                                    Object link,
                                    IlvGraphic from,
                                    IlvGraphic to)
This method simply calls the createLinkGraphic method of the filtered renderer.

Specified by:
createLinkGraphic in class IlvSDMRenderer
Parameters:
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.

createNodeGraphic

public IlvGraphic createNodeGraphic(IlvSDMEngine engine,
                                    Object node)
This method simply calls the createNodeGraphic method of the filtered renderer.

Specified by:
createNodeGraphic in class IlvSDMRenderer
Parameters:
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.

addNodeGraphic

public void addNodeGraphic(IlvSDMEngine engine,
                           Object node,
                           IlvGraphic graphic,
                           boolean redraw)
This method simply calls the addNodeGraphic method of the filtered renderer.

Overrides:
addNodeGraphic in class IlvSDMRenderer
Parameters:
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.

addLinkGraphic

public void addLinkGraphic(IlvSDMEngine engine,
                           Object link,
                           IlvGraphic graphic,
                           boolean redraw)
This method simply calls the addLinkGraphic method of the filtered renderer.

Overrides:
addLinkGraphic in class IlvSDMRenderer
Parameters:
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.

nodeGraphicAdded

public void nodeGraphicAdded(IlvSDMEngine engine,
                             Object object,
                             IlvGraphic graphic,
                             boolean redraw)
Simply calls the nodeGraphicAdded method of the filtered renderer.

Overrides:
nodeGraphicAdded in class IlvSDMRenderer
Parameters:
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.
Since:
JViews 5.0
See Also:
IlvSDMRenderer.addNodeGraphic(ilog.views.sdm.IlvSDMEngine, java.lang.Object, ilog.views.IlvGraphic, boolean)

linkGraphicAdded

public void linkGraphicAdded(IlvSDMEngine engine,
                             Object object,
                             IlvGraphic graphic,
                             boolean redraw)
Simply calls the linkGraphicAdded method of the filtered renderer.

Overrides:
linkGraphicAdded in class IlvSDMRenderer
Parameters:
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.
Since:
JViews 5.0
See Also:
IlvSDMRenderer.addLinkGraphic(ilog.views.sdm.IlvSDMEngine, java.lang.Object, ilog.views.IlvGraphic, boolean)

removeNodeGraphic

public void removeNodeGraphic(IlvSDMEngine engine,
                              Object node,
                              IlvGraphic graphic,
                              boolean redraw)
Simply calls the removeNodeGraphic method of the filtered renderer.

Overrides:
removeNodeGraphic in class IlvSDMRenderer
Parameters:
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.

removeLinkGraphic

public void removeLinkGraphic(IlvSDMEngine engine,
                              Object link,
                              IlvGraphic graphic,
                              boolean redraw)
Simply calls the removeLinkGraphic method of the filtered renderer.

Overrides:
removeLinkGraphic in class IlvSDMRenderer
Parameters:
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.

removeAll

public void removeAll(IlvSDMEngine engine)
This implementation calls the filtered renderer's removeAll method.

Overrides:
removeAll in class IlvSDMRenderer
Parameters:
engine - The SDM engine.

prepareRendering

public void prepareRendering(IlvSDMEngine engine)
This implementation calls the filtered renderer's prepareRendering method.

Overrides:
prepareRendering in class IlvSDMRenderer
Parameters:
engine - The SDM engine.

renderingDone

public void renderingDone(IlvSDMEngine engine)
This implementation calls the filtered renderer's renderingDone method.

Overrides:
renderingDone in class IlvSDMRenderer
Parameters:
engine - The SDM engine.

propertyChanged

public void propertyChanged(IlvSDMEngine engine,
                            Object object,
                            String propertyName,
                            Object oldValue,
                            Object newValue,
                            IlvGraphic graphic)
This method simply calls the propertyChanged method of the filtered renderer.

Overrides:
propertyChanged in class IlvSDMRenderer
Parameters:
engine - The SDM engine associated with the grapher in which the graphic object is displayed.
object - The data object whose property has changed.
propertyName - The name of the property that has been modified.
oldValue - The old value of the property.
newValue - The new value of the property.
graphic - The graphic object associated with object.

getGraphicProperty

public Object getGraphicProperty(IlvSDMEngine engine,
                                 Object object,
                                 String property,
                                 String[] pseudoClasses,
                                 Class targetClass)
This method simply calls the getGraphicProperty method of the filtered renderer.

Overrides:
getGraphicProperty in class IlvSDMRenderer
Parameters:
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.

updateObjectProperties

public void updateObjectProperties(IlvSDMEngine engine,
                                   Object object,
                                   String property,
                                   Object value,
                                   String[] pseudoClasses)
This method simply calls the updateObjectProperties method of the filtered renderer.

Overrides:
updateObjectProperties in class IlvSDMRenderer
Parameters:
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.

customize

public void customize(IlvSDMEngine engine,
                      Object object,
                      IlvGraphic g,
                      String[] pseudoClasses)
This method simply calls the customize method of the filtered renderer.

Overrides:
customize in class IlvSDMRenderer
Parameters:
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.

getLinkConnectionRectangle

public IlvRect getLinkConnectionRectangle(IlvSDMEngine engine,
                                          IlvGraphic graphic,
                                          IlvTransformer t)
This method calls the filtered renderer's getLinkConnectionRectangle method.

Overrides:
getLinkConnectionRectangle in class IlvSDMRenderer
Parameters:
engine - The SDM engine.
graphic - The graphic object returned by createNodeGraphic.
t - The transformer of the view.
Returns:
A rectangle in view coordinates.

getEncapsulatedGraphic

public IlvGraphic getEncapsulatedGraphic(IlvGraphic graphic)
This method calls the filtered renderer's getEncapsulatedGraphic method.

Overrides:
getEncapsulatedGraphic in class IlvSDMRenderer
Parameters:
graphic - A graphic object returned by createNodeGraphic.

nodeGraphicBBoxChanged

public void nodeGraphicBBoxChanged(IlvSDMEngine engine,
                                   Object node,
                                   IlvGraphic graphic,
                                   IlvRect oldBBox,
                                   IlvRect newBBox,
                                   String[] pseudoClasses)
This method calls the filtered renderer's nodeGraphicBBoxChanged method.

Overrides:
nodeGraphicBBoxChanged in class IlvSDMRenderer
Parameters:
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.

computeBBox

public IlvRect computeBBox(IlvSDMEngine engine,
                           IlvManagerView view,
                           IlvTransformer t)
This method calls the filtered renderer's computeBBox method.

Overrides:
computeBBox in class IlvSDMRenderer
Parameters:
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.
Returns:
The resulting rectangle.
Since:
JViews 5.5

moveResizeNodeGraphic

protected void moveResizeNodeGraphic(IlvSDMEngine engine,
                                     Object node,
                                     IlvGraphic graphic,
                                     IlvRect newBBox,
                                     int anchor)
Move the graphic to its final position

Overrides:
moveResizeNodeGraphic in class IlvSDMRenderer
Parameters:
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 values
Since:
JViews 6.0

processServerAction

public boolean processServerAction(int x,
                                   int y,
                                   IlvManagerView view)
Calls the filtered renderer's processServerAction method.

Overrides:
processServerAction in class IlvSDMRenderer
Parameters:
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.
Returns:
true if the action was processed, false if the action was not processed.
Since:
JViews 6.5


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.