public class IlvInfoBalloonRenderer extends IlvFilterSDMRenderer
IlvInfoBalloonRenderer
displays selected properties of a data object
in an "information balloon" when the user clicks
the object.
The contents of the info balloon can be customized in two ways:
nodeBalloonLines
and/or
linkBalloonLines
.
InfoBalloonLines
.
"line1,First property: ,prop1;line2,Second property: ,prop2"
Each line is described by a sequence of 3 fields separated by commas: the name of a property of the info balloon, the title to display, and the name of the object property whose value is to be displayed. The line descriptions are separated by semi-colons.
Example
SDM { InfoBalloon : "true"; } InfoBalloon { nodeBalloonLines : "line1,Town: ,town;line2,Population: ,population"; linkBalloonLines : "line1,Distance: ,distance"; } node[capitalState] { InfoBalloonLines : "line1,Town: ,town;line2,Population: ,population;Capital of: ,capitalState"; }
The info balloon is represented using a JViews prototype (a BGO).
The info balloon properties (line1
, line2
, and so on)
may depend on the prototype that is used.
By default, a built-in prototype that can display up to 5 lines is used.
You can specify a custom info balloon prototype using setPrototype(java.lang.String)
.
_renderer
PSEUDOCLASS_PREFIX
Constructor and Description |
---|
IlvInfoBalloonRenderer()
Creates a new info balloon renderer with a
null
filtered renderer. |
IlvInfoBalloonRenderer(IlvSDMRenderer renderer)
Creates a new info balloon renderer for a specified
filtered renderer.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addViewListeners(IlvManagerView view)
This method can be overridden to add view listeners on any view attached to an SDM engine.
|
static IlvInfoBalloonRenderer |
getInstance(IlvSDMEngine engine)
Returns the IlvInfoBalloonRenderer instance which belongs to the specified SDM engine.
|
String |
getLinkBalloonLines()
Returns the descriptions of the lines to be displayed in the information balloon
when the user clicks a link.
|
String |
getNodeBalloonLines()
Returns the descriptions of the lines to be displayed in the information balloon
when the user clicks a node.
|
String |
getPrototype()
Returns the URL and name of the prototype used by this renderer to
represent the info balloons.
|
boolean |
isEnabled()
Returns true if the renderer is enabled (default).
|
protected boolean |
needsViewListeners()
This method can be overridden to specify that this renderer
needs to add listeners on all the views attached to the
grapher of the SDM engine.
|
void |
prepareRendering(IlvSDMEngine engine)
Loads the info balloon prototypes.
|
protected void |
removeViewListeners(IlvManagerView view)
This method can be overridden to remove view listeners from any view attached to an SDM engine.
|
void |
setEnabled(boolean value)
Enable or disable this renderer.
|
void |
setLinkBalloonLines(String lines)
Sets the descriptions of the lines to be displayed in the information balloon
when the user clicks a link.
|
void |
setNodeBalloonLines(String lines)
Sets the descriptions of the lines to be displayed in the information balloon
when the user clicks a node.
|
void |
setPrototype(String prototypeURL)
Sets the prototype (BGO) used by this renderer to
represent the info balloons.
|
addLinkGraphic, addNodeGraphic, computeBBox, createLinkGraphic, createNodeGraphic, customize, getEncapsulatedGraphic, getFilteredRenderer, getGraphicProperty, getLinkConnectionRectangle, linkGraphicAdded, moveResizeNodeGraphic, nodeGraphicAdded, nodeGraphicBBoxChanged, processServerAction, propertiesChanged, removeAll, removeLinkGraphic, removeNodeGraphic, renderingDone, setFilteredRenderer, updateObjectProperties
callMoveResizeNodeGraphic, convert, convert, getAlias, getAuxiliaryBean, getAuxiliaryBeans, getEngine, getLinkConnectionRectangle, getLocation, getParameter, propertyChanged, setAlias, setEngine, setLayerName, setParameter
public IlvInfoBalloonRenderer(IlvSDMRenderer renderer)
renderer
- The filtered renderer.public IlvInfoBalloonRenderer()
null
filtered renderer.public void setPrototype(String prototypeURL) throws IlvSDMException
You can supply several variants of the prototype to fit different locations of the object in the view (near a corner, near the top, and so on). The variants of the prototype should be suffixed by an integer (starting with 0). The renderer will try all the variants of the prototype until it finds one that is fully visible in the view. If none is fully visible, it will choose the most visible variant.
For example, if you supply the prototype URL
myprotos.ivl#myballoon
, the renderer will try
the prototypes myballoon0
, myballoon1
,
myballoon2
, and so on until no prototype is found.
You must supply at least one variant (with the suffix 0).
prototypeURL
- A string containing the URL of the library file
containing the prototype, followed by a #
character, followed by the prototype name.IlvSDMException
- if problem with the provided prototypepublic String getPrototype()
#
character, followed by the prototype name.setPrototype(java.lang.String)
public void setEnabled(boolean value)
value
- true
if enabled.public boolean isEnabled()
public static IlvInfoBalloonRenderer getInstance(IlvSDMEngine engine)
engine
- the SDM enginepublic void prepareRendering(IlvSDMEngine engine)
prepareRendering
in class IlvFilterSDMRenderer
engine
- The SDM engine.public void setNodeBalloonLines(String lines)
lines
argument contains a list of strings
separated by semi-colon (';'
) characters.
Each string has three parts, separated by commas (','
):
The first part is the name of the balloon prototype's property
to set. The second part is a label that will form the beginning of
the line. The third part is the name of the data object
property whose value will be appended to the line.
See the class description for examples.
lines
- The descriptions of the balloon lines, in the form:
"line1,label1,property1;line2,label2,property2;..."
.public String getNodeBalloonLines()
setNodeBalloonLines(java.lang.String)
public void setLinkBalloonLines(String lines)
setNodeBalloonLines(java.lang.String)
for a description of the syntax.lines
- The descriptions of the balloon lines.public String getLinkBalloonLines()
setLinkBalloonLines(java.lang.String)
protected void addViewListeners(IlvManagerView view)
IlvSDMRenderer
This method is called only if IlvSDMRenderer.needsViewListeners()
returns true
.
The default implementation does nothing.
addViewListeners
in class IlvSDMRenderer
view
- The manager view.IlvSDMRenderer.needsViewListeners()
protected boolean needsViewListeners()
IlvSDMRenderer
If this method returns true
, then the SDM renderer
will make sure that the methods IlvSDMRenderer.addViewListeners(ilog.views.IlvManagerView)
and
IlvSDMRenderer.removeViewListeners(ilog.views.IlvManagerView)
are called as appropriate for each view
attached to the SDM engine.
For example, if your renderer needs to install a transformer listener
on all views (for example to adjust the graphic objects when the view
is zoomed or unzoomed), you would override the needsViewListeners
method to return true
and the add/removeViewListener
methods to add/remove your transformer listener.
If this method returns false
, then the methods
IlvSDMRenderer.addViewListeners(ilog.views.IlvManagerView)
and
IlvSDMRenderer.removeViewListeners(ilog.views.IlvManagerView)
are never called.
The default implementation returns false
to indicate
that the basic SDM renderer does not install any listeners on views.
protected void removeViewListeners(IlvManagerView view)
IlvSDMRenderer
This method is called only if IlvSDMRenderer.needsViewListeners()
returns true
.
The default implementation does nothing.
removeViewListeners
in class IlvSDMRenderer
view
- The manager view.IlvSDMRenderer.needsViewListeners()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.