IlvManager
for more details). A new SDM renderer class,
IlvSubGraphRenderer
, has been added to
represent sub-graphs of the data model as IlvGrapher
objects
added as graphic objects in the parent IlvGrapher
. The
ExpandCollapse
renderer name used in an SDM style sheet now
activates this new IlvSubGraphRenderer
, instead of the
IlvExpandCollapseRenderer
. You can also use the
name SubGraph
, which is an alias for the same renderer.
Most applications will work seamlessly with the new IlvSubGraphRenderer
,
so in general you do not need to change anything (code or style sheets).
It may happen, though, that an application relies on the details of the implementation
of IlvExpandCollapseRenderer
. For this reason, it is still possible
to use the Perforce JViews 4.0 IlvExpandCollapseRenderer
by specifying the renderer name ExpandCollapse40
.@Deprecated public class IlvExpandCollapseRenderer extends IlvInteractorRenderer
IlvExpandCollapseRenderer
is a
filtering renderer that displays sub-graphs as special
nodes that can be expanded and collapsed.
This renderer is useful when the data model is hierarchical, that is, when some of its nodes contain sub-graphs.
Each sub-graph is initially displayed with a frame around it. The frame can be collapsed: it is then replaced with a single node, and the nodes and links of the sub-graph become invisible. The collapsed node can be expanded to show the sub-graph again.
To expand or collapse a sub-graph node in a view with no view interactor, you simply click it. You can also expand and collapse nodes when an interactor is attached to the view: for this, you can click the "+" or "-" icon display in the upper-left corner of the sub-graph node, or click using the right mouse button.
The expand-collapse renderer can be customized using the following rendering properties:
Expandable : "true"|"false";
- Controls which nodes are
expandable and collapsible. By default, all nodes that have children
are expandable.
InitiallyExpanded : "true"|"false";
- Controls whether the sub-graph
is initially expanded or collapsed.
FrameMargin : "<double>";
- Controls the spacing between the
sub-graph's bounding rectangle and the border of the expanded node's frame.
FrameGraphic : "@#<graphic>"
- Allows you to specify a custom
graphic object for the frame. By default, an IlvExpandedFrame
is used.
PlusGraphic : "@#<graphic>"
- Allows you to specify a custom
graphic object for the "+" icon. By default, a graphic handle
is used.
MinusGraphic : "@#<graphic>"
- Allows you to specify a custom
graphic object for the "-" icon. By default, a graphic handle
is used.
Examples:
The following rule states that only those nodes whose type
property is equal to "compound"
are expandable.
node[type!="compound"] { Expandable : "false"; }
The following rules say the sub-graphs should initially appear collapsed, and define a custom look for the expandable nodes: a different margin, a red rectangle for the frame, and icons instead of labels for the "+" and "-" graphics.
node[type="compound"] { InitiallyExpanded : "false"; FrameMargin : "10"; FrameGraphic : "@#rectangle"; PlusGraphic : "@#plus"; MinusGraphic : "@#minus"; } Subobject#rectangle { class : "ilog.views.sdm.graphic.IlvGraphicFactories$Rectangle"; foreground : "green"; } Subobject#plus { class : "ilog.views.sdm.graphic.IlvGraphicFactories$Icon"; imageLocation : "plus.gif"; } Subobject#minus { class : "ilog.views.sdm.graphic.IlvGraphicFactories$Icon"; imageLocation : "minus.gif"; }
You can also customize the expandable nodes differently depending
on whether they are expanded or collapsed. To do this, you must use
the pseudo-classes "expanded"
and "collapsed"
.
For example, the following rules put different tooltips on the nodes depending on whether they are expanded or collapsed:
node:expanded { ToolTipText : "Click on '-' to collapse"; } node:collapsed { ToolTipText : "Click on '+' to expand"; }
Modifier and Type | Class and Description |
---|---|
static class |
IlvExpandCollapseRenderer.ExpandableNode
Deprecated.
The class
ExpandableNode implements the special
graphic object used to display sub-graph nodes. |
static class |
IlvExpandCollapseRenderer.ExpandCollapseIcon
Deprecated.
This graphic object is used to draw the "expand" and "collapse"
icons used by the
IlvExpandCollapseRenderer . |
static class |
IlvExpandCollapseRenderer.ExpandCollapseInteractor
Deprecated.
ExpandCollapseInteractor is the object interactor
that is set on expandable nodes by the IlvExpandCollapseRenderer . |
static class |
IlvExpandCollapseRenderer.SubGraphNode
Deprecated.
The class
SubGraphNode implements the special
graphic object used to encapsulate the children of an expandable
node. |
_interactor
_renderer
PSEUDOCLASS_PREFIX
Constructor and Description |
---|
IlvExpandCollapseRenderer()
Deprecated.
Creates a new expand-collapse renderer with a
null
filtered renderer. |
IlvExpandCollapseRenderer(IlvSDMRenderer renderer)
Deprecated.
Creates a new expand-collapse renderer with a specified
filtered renderer.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptInteractor(IlvSDMEngine engine,
Object object,
IlvGraphic graphic)
Deprecated.
Returns
true only if the graphic object
is an expandable node, so that the expand/collapse
interactor is installed only on expandable nodes. |
protected boolean |
acceptShortcut(IlvSDMEngine engine,
IlvManagerView view,
InputEvent event)
Deprecated.
This method returns
true for all mouse clicks
that occur inside the "+" or "-" graphics of the expandable
node. |
IlvGraphic |
createLinkGraphic(IlvSDMEngine engine,
Object link,
IlvGraphic from,
IlvGraphic to)
Deprecated.
If the link is contained in an expandable sub-graph,
this method adds it in the group controlled by the expandable node.
|
IlvGraphic |
createNodeGraphic(IlvSDMEngine engine,
Object node)
Deprecated.
If the node is the parent of an expandable sub-graph,
this method creates an expandable node.
|
void |
customize(IlvSDMEngine engine,
Object object,
IlvGraphic g,
String[] pseudoClass)
Deprecated.
If the object is an expandable node, this method
customizes either the frame graphic, or the collapsed
graphic, depending on whether the node is expanded
or collapsed.
|
IlvGraphic |
getEncapsulatedGraphic(IlvGraphic graphic)
Deprecated.
Returns either the frame graphic or the collapsed
graphic, depending on whether the node is expanded
or collapsed.
|
Object |
getGraphicProperty(IlvSDMEngine engine,
Object object,
String property,
String[] pseudoClass,
Class<?> targetClass)
Deprecated.
Modifies the
Layer rendering property so that
sub-graphs are displayed on top of their frames. |
IlvRect |
getLinkConnectionRectangle(IlvSDMEngine engine,
IlvGraphic graphic,
IlvTransformer t,
IlvLinkConnector lc)
Deprecated.
This method is overridden to take into account
the special expandable nodes.
|
boolean |
isExpanded(IlvSDMEngine engine,
Object object)
Deprecated.
Tests whether a data node is expanded or collapsed.
|
boolean |
isSubObjectsSelectionAllowed()
Deprecated.
Returns
true if the user is allowed to select
and edit the sub-objects contained in an expanded node, or
false otherwise. |
void |
linkGraphicAdded(IlvSDMEngine engine,
Object link,
IlvGraphic graphic,
boolean redraw)
Deprecated.
Makes the graphic object unselectable if
setSubObjectsSelectionAllowed(false) was called. |
void |
nodeGraphicAdded(IlvSDMEngine engine,
Object node,
IlvGraphic graphic,
boolean redraw)
Deprecated.
Makes the graphic object unselectable if
setSubObjectsSelectionAllowed(false) was called. |
void |
nodeGraphicBBoxChanged(IlvSDMEngine engine,
Object node,
IlvGraphic graphic,
IlvRect oldBBox,
IlvRect newBBox,
String[] pseudoClasses)
Deprecated.
Updates the location of a node only if the node is not
being expanded or collapsed.
|
void |
prepareRendering(IlvSDMEngine engine)
Deprecated.
Initializes the internal state of the renderer.
|
void |
propertiesChanged(IlvSDMEngine engine,
Object object,
Collection<String> propertyNames,
IlvGraphic graphic)
Deprecated.
Updates the graphic representation of a data object.
|
void |
removeAll(IlvSDMEngine engine)
Deprecated.
Cleans up the internal state of the renderer.
|
void |
removeLinkGraphic(IlvSDMEngine engine,
Object link,
IlvGraphic graphic,
boolean redraw)
Deprecated.
Removes sub-graph elements from their expandable nodes.
|
void |
removeNodeGraphic(IlvSDMEngine engine,
Object node,
IlvGraphic graphic,
boolean redraw)
Deprecated.
Removes sub-graph elements from their expandable nodes.
|
void |
renderingDone(IlvSDMEngine engine)
Deprecated.
Updates the internal state of the renderer.
|
void |
setExpanded(IlvSDMEngine engine,
Object object,
boolean expand,
boolean redraw)
Deprecated.
Expands or collapses a node.
|
void |
setSubObjectsSelectionAllowed(boolean allowed)
Deprecated.
Allows or forbids the selection of sub-objects
contained in an expanded node.
|
addViewListeners, getInteractor, getParameter, isProcessMouseMoveEvents, isShorcutEnabled, isShortcutEnabled, needsViewListeners, removeViewListeners, setInteractor, setParameter, setProcessMouseMoveEvents, setShorcutEnabled, setShortcutEnabled
addLinkGraphic, addNodeGraphic, computeBBox, getFilteredRenderer, moveResizeNodeGraphic, processServerAction, setFilteredRenderer, updateObjectProperties
callMoveResizeNodeGraphic, convert, convert, getAlias, getAuxiliaryBean, getAuxiliaryBeans, getEngine, getLinkConnectionRectangle, getLocation, propertyChanged, setAlias, setEngine, setLayerName
public IlvExpandCollapseRenderer(IlvSDMRenderer renderer)
renderer
- The filtered renderer.public IlvExpandCollapseRenderer()
null
filtered renderer.public void setSubObjectsSelectionAllowed(boolean allowed)
allowed
- If true
,
the user will be able to select and edit the sub-objects
contained in an expanded node. Otherwise, the sub-objects
will not be selectable.public boolean isSubObjectsSelectionAllowed()
true
if the user is allowed to select
and edit the sub-objects contained in an expanded node, or
false
otherwise.public IlvGraphic createNodeGraphic(IlvSDMEngine engine, Object node)
createNodeGraphic
in class IlvFilterSDMRenderer
engine
- The SDM engine.node
- The node.public IlvGraphic createLinkGraphic(IlvSDMEngine engine, Object link, IlvGraphic from, IlvGraphic to)
createLinkGraphic
in class IlvFilterSDMRenderer
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 void nodeGraphicAdded(IlvSDMEngine engine, Object node, IlvGraphic graphic, boolean redraw)
setSubObjectsSelectionAllowed(false)
was called.nodeGraphicAdded
in class IlvInteractorRenderer
engine
- The SDM engine associated with the grapher in which
the graphic object has been 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.setSubObjectsSelectionAllowed(boolean)
public void linkGraphicAdded(IlvSDMEngine engine, Object link, IlvGraphic graphic, boolean redraw)
setSubObjectsSelectionAllowed(false)
was called.linkGraphicAdded
in class IlvInteractorRenderer
engine
- The SDM engine associated with the grapher in which
the graphic object has been 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.setSubObjectsSelectionAllowed(boolean)
protected boolean acceptInteractor(IlvSDMEngine engine, Object object, IlvGraphic graphic)
true
only if the graphic object
is an expandable node, so that the expand/collapse
interactor is installed only on expandable nodes.acceptInteractor
in class IlvInteractorRenderer
engine
- The SDM engine.object
- The data object.graphic
- The graphic object.public void removeNodeGraphic(IlvSDMEngine engine, Object node, IlvGraphic graphic, boolean redraw)
removeNodeGraphic
in class IlvFilterSDMRenderer
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
in class IlvFilterSDMRenderer
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 customize(IlvSDMEngine engine, Object object, IlvGraphic g, String[] pseudoClass)
customize
in class IlvFilterSDMRenderer
engine
- The SDM engine.object
- The data object that the graphic object represents.g
- The graphic object to customize.pseudoClass
- The pseudo-class of the object. This parameter
can be null
.public void propertiesChanged(IlvSDMEngine engine, Object object, Collection<String> propertyNames, IlvGraphic graphic)
propertiesChanged
in class IlvInteractorRenderer
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 IlvGraphic getEncapsulatedGraphic(IlvGraphic graphic)
getEncapsulatedGraphic
in class IlvFilterSDMRenderer
graphic
- A graphic object returned by createNodeGraphic
.public void setExpanded(IlvSDMEngine engine, Object object, boolean expand, boolean redraw)
engine
- The SDM engine.object
- The data node to expand or collapse.expand
- If true
, the
node will be expanded; otherwise the node will be collapsed.redraw
- If true
, the area covered by the
expanded or collapsed node will be redrawn.public boolean isExpanded(IlvSDMEngine engine, Object object)
engine
- The SDM engine.object
- The data node to expand or collapse.true
if object
is a
compound node and if it is expanded, or false
otherwise.public void prepareRendering(IlvSDMEngine engine)
prepareRendering
in class IlvFilterSDMRenderer
engine
- The SDM engine.public void removeAll(IlvSDMEngine engine)
removeAll
in class IlvFilterSDMRenderer
engine
- The SDM engine.public void renderingDone(IlvSDMEngine engine)
renderingDone
in class IlvFilterSDMRenderer
engine
- The SDM engine.public void nodeGraphicBBoxChanged(IlvSDMEngine engine, Object node, IlvGraphic graphic, IlvRect oldBBox, IlvRect newBBox, String[] pseudoClasses)
nodeGraphicBBoxChanged
in class IlvFilterSDMRenderer
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 Object getGraphicProperty(IlvSDMEngine engine, Object object, String property, String[] pseudoClass, Class<?> targetClass)
Layer
rendering property so that
sub-graphs are displayed on top of their frames.getGraphicProperty
in class IlvFilterSDMRenderer
engine
- The SDM engine.object
- The data object that is being rendered.property
- The name of the graphic property.pseudoClass
- The pseudo class 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.protected boolean acceptShortcut(IlvSDMEngine engine, IlvManagerView view, InputEvent event)
true
for all mouse clicks
that occur inside the "+" or "-" graphics of the expandable
node. This makes it possible to expand or collapse sub-graphs
even when a view interactor is active.acceptShortcut
in class IlvInteractorRenderer
engine
- The SDM engine attached to the reference view
in which the event occurred.view
- The reference view.event
- The event received by the manager view while
a view interactor was active.public IlvRect getLinkConnectionRectangle(IlvSDMEngine engine, IlvGraphic graphic, IlvTransformer t, IlvLinkConnector lc)
getLinkConnectionRectangle
in class IlvFilterSDMRenderer
engine
- The SDM engine.graphic
- The graphic object.t
- The transformer.lc
- The link connector from which this is called.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.