public class IlvDashboardSymbol extends Object implements Iterable<IlvDashboardSymbol.Parameter>, Serializable
IlvDashboardSymbol
is used to control symbols inside a
dashboard diagram.
IlvPaletteSymbol
object stored in an IlvPalette
instance. Once created, symbols are imported into dashboard diagrams by
Dashboard Editor applications using The IlvDashboardSymbol
class.
IlvDashboardSymbol
controls the following aspect of a dashboard
symbol:
An IlvDashboardSymbol
contains a standard
IlvPaletteSymbol
object; this symbol is rendered using a SDM
Model object.
A IlvDashboardSymbol
instance takes two forms, standard symbols
and links. A link is a specialized symbol used to connect two different
symbols. Symbol links are linked to and from standard symbols and can
optionally have intermediate points.
IlvDashboardSymbol
instance gives you access to symbol parameters.
You can retrieve, read and set all parameters for a symbol. A parameter can be
mapped to an object property in the SDM Model object.
IlvDashboardSymbolPalette
into an
IlvDashboardDiagram
instance.
public class SymbolPaletteDropTargetDemo extends JFrame { IlvDashboardContext context; IlvDashboardDiagram dashboard; ... public void drop(DropTargetDropEvent dtde) { Transferable transferable = dtde.getTransferable(); try { IlvPaletteDragAndDropData data = (IlvPaletteDragAndDropData) transferable.getTransferData(IlvPaletteObjectTransferable.PALETTE_OBJECT_FLAVOR); if (data != null && data.getPaletteObject() instanceof IlvPaletteSymbol) { IlvPaletteSymbol pSymb = (IlvPaletteSymbol) data.getPaletteObject(); Point dropPoint = dtde.getLocation(); IlvDashboardSymbol symbol = new IlvDashboardSymbol(dashboard, pSymb); dashboard.setAdjusting(true); try { dashboard.addSymbol(symbol); IlvTransformer transfo = dashboard.getView().getTransformer(); IlvPoint point = new IlvPoint(dropPoint.x, dropPoint.y); if (transfo != null) { transfo.inverse(point); } Object modelObject = symbol.getModelObject(); dashboard.setObjectProperty(modelObject, "x", new Double(point.x)); dashboard.setObjectProperty(modelObject, "y", new Double(point.y)); } finally { dashboard.setAdjusting(false); } } } catch (Exception e) { e.printStackTrace(); } } ... }
IlvDashboardDiagram
,
IlvDashboardEditorFrame
,
IlvSDMEngine
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
IlvDashboardSymbol.Parameter
The
IlvDashboardSymbol.Parameter class handles a single
parameter for a IlvDashboardSymbol instance. |
static interface |
IlvDashboardSymbol.ParameterIterator
Implement this interface to create an iterator for a collection of
IlvDashboardSymbol parameters/ |
Constructor and Description |
---|
IlvDashboardSymbol(IlvDashboardDiagram diagram,
IlvPaletteSymbol paletteSymbol)
Creates an instance of
IlvDashboardSymbol defined by
a specified palette symbol. |
IlvDashboardSymbol(IlvDashboardDiagram diagram,
IlvPaletteSymbol paletteSymbol,
Object modelObject,
String id,
boolean defaultMapping)
Creates an instance of
IlvDashboardSymbol for a SDM model
object. |
IlvDashboardSymbol(IlvDashboardDiagram diagram,
IlvPaletteSymbol paletteSymbol,
String id)
Creates an instance of
IlvDashboardSymbol defined by
a specified palette symbol, with a specific ID. |
IlvDashboardSymbol(IlvDashboardDiagram diagram,
IlvPaletteSymbol paletteSymbol,
String id,
boolean defaultMapping)
Creates an instance of
IlvDashboardSymbol defined by
a specified palette symbol, with a specific ID, and with or without
default parameter mappings. |
Modifier and Type | Method and Description |
---|---|
PropertyEditor |
createPropertyEditor(IlvDashboardSymbol.Parameter param)
Returns a freshly created
PropertyEditor for
param . |
IlvDashboardDiagram |
getDiagram()
Returns the
IlvDashboardDiagram instance containing this
symbol. |
IlvGraphic |
getGraphicObject()
Returns the graphic object representing the symbol.
|
double |
getHeight()
Returns the height of this symbol.
|
String |
getID()
Returns the ID of this symbol.
|
IlvPoint[] |
getIntermediateLinkPoints()
Returns the intermediate points of a polyline link symbol.
|
IlvDashboardSymbol |
getLinkFrom()
Returns the source node symbol for a link symbol.
|
IlvDashboardSymbol |
getLinkTo()
Returns the target node symbol for a link symbol.
|
IlvSDMModel |
getModel()
Returns the SDM Model corresponding to the dashboard diagram of
this symbol.
|
Object |
getModelObject()
Returns the SDM Model object.
|
IlvPaletteSymbol |
getPaletteSymbol()
Returns the palette symbol defining this dashboard symbol.
|
IlvPaletteSymbolParameter |
getPaletteSymbolParameter(IlvDashboardSymbol.Parameter parameter)
Returns the base
IlvPaletteSymbolParameter parameter
object defining parameter . |
IlvDashboardSymbol.Parameter |
getParameter(int index)
Returns the symbol parameter at
index in the list of
parameters. |
IlvDashboardSymbol.Parameter |
getParameter(String id)
Returns the parameter identified by
id in the parameter list. |
int |
getParameterCount()
Returns the number of the parameters in this symbol.
|
String |
getParameterID(IlvDashboardSymbol.Parameter parameter)
Returns the ID of
parameter . |
String |
getParameterMapping(IlvDashboardSymbol.Parameter parameter)
Returns the SDM object property mapping for
parameter . |
IlvDashboardSymbol.ParameterIterator |
getParameters()
Deprecated.
You should use
iterator() instead. |
String |
getParameterTextValue(IlvDashboardSymbol.Parameter param)
Returns a string containing the value of
param . |
Object |
getParameterValue(IlvDashboardSymbol.Parameter param)
Returns the value of
param . |
Object |
getParameterValue(int ndx)
Returns the value of the parameter at
ndx in the parameter
collection. |
Object |
getParameterValue(String paramID)
Returns the value of the parameter specified by
paramID |
PropertyEditor |
getPropertyEditor(IlvDashboardSymbol.Parameter param)
Returns the
PropertyEditor for param . |
IlvRect |
getSymbolBoundingBox()
Returns the bounding box of this symbol.
|
String |
getTargetDashboardURL()
Returns the target dashboard URL associated to this symbol.
|
double |
getWidth()
Returns the width of this symbol.
|
double |
getX()
Returns the x coordinate of this symbol.
|
double |
getY()
Returns the y coordinate of this symbol.
|
boolean |
isLink()
Tests if the symbol is a link.
|
boolean |
isSelected()
Tests if this symbol is selected in a dashboard diagram.
|
Iterator<IlvDashboardSymbol.Parameter> |
iterator()
Returns an iterator that you use to run over the collection of parameters
contained in this dashboard symbol.
|
void |
setHeight(double height)
Sets the height for this symbol.
|
void |
setID(String newID)
Sets the ID of the symbol.
|
void |
setIntermediateLinkPoints(IlvPoint[] points)
Sets the intermediate points of a polyline link.
|
void |
setLinkFrom(IlvDashboardSymbol fromSymbol)
Sets the source node symbol for a link symbol.
|
void |
setLinkTo(IlvDashboardSymbol toSymbol)
Sets the target node symbol for a link symbol.
|
void |
setParameterMapping(IlvDashboardSymbol.Parameter parameter,
String mapping)
Maps
parameter to the mapping
object property in the SDM model. |
void |
setParameterValue(IlvDashboardSymbol.Parameter parameter,
Object value)
Sets the value of
parameter . |
void |
setParameterValue(String paramID,
Object value)
Sets the value of the parameter specified by
paramID . |
void |
setSymbolBoundingBox(IlvRect rect)
Move and resize this symbol.
|
void |
setTargetDashboardURL(String target)
Sets the target dashboard URL of this symbol.
|
void |
setWidth(double width)
Sets the width for this symbol.
|
void |
setX(double x)
Sets the x coordinate for this symbol.
|
void |
setY(double y)
Sets the y coordinate of this symbol.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public IlvDashboardSymbol(IlvDashboardDiagram diagram, IlvPaletteSymbol paletteSymbol)
IlvDashboardSymbol
defined by
a specified palette symbol.public IlvDashboardSymbol(IlvDashboardDiagram diagram, IlvPaletteSymbol paletteSymbol, String id)
IlvDashboardSymbol
defined by
a specified palette symbol, with a specific ID.public IlvDashboardSymbol(IlvDashboardDiagram diagram, IlvPaletteSymbol paletteSymbol, String id, boolean defaultMapping)
IlvDashboardSymbol
defined by
a specified palette symbol, with a specific ID, and with or without
default parameter mappings. When a dashboard symbol is created,
the values of its parameters can be automatically mapped to object
properties of the SDM model with the same name. For example, a palette
parameter value
is mapped to a SDM
property value
.diagram
- The dashboard diagram for which this symbol is created.paletteSymbol
- The palette symbol which defines
this new dashboard symbol.id
- The ID for this new symbol.defaultMapping
- Set to true
so the parameters of
this new symbol are mapped to the SDM model object properties
with the same name.public IlvDashboardSymbol(IlvDashboardDiagram diagram, IlvPaletteSymbol paletteSymbol, Object modelObject, String id, boolean defaultMapping)
IlvDashboardSymbol
for a SDM model
object. The created symbol is defined by
a specified palette symbol, with a specific ID, and with or without
default parameter mappings.
If paletteSymbol
is a link, modelObject
must be
a SDM link; if paletteSymbol
is a node,
modelObject
must be an SDM node.
Note: modelObject
must not be used by
another dashboard symbol or directly added in your SDM model.
The modelObject
is added to the SDM model automatically when
this dashboard symbol is added to diagram
.
diagram
- The dashboard diagram for which this symbol is created.paletteSymbol
- The palette symbol which defines
this new dashboard symbol.modelObject
- The SDM model object encapsulated by this dashboard symbol.id
- The ID for this new symbol.defaultMapping
- Set to true
so the parameters of
this new symbol are mapped to the SDM model object properties
with the same name.
public IlvSDMModel getModel()
public Object getModelObject()
getModel()
,
Overviewpublic IlvGraphic getGraphicObject()
IlvGraphic
object representing
the symbol.public IlvPaletteSymbol getPaletteSymbol()
IlvDashboardSymbol(IlvDashboardDiagram, IlvPaletteSymbol)
,
Overview,
Example@Deprecated public IlvDashboardSymbol.ParameterIterator getParameters()
iterator()
instead.public Iterator<IlvDashboardSymbol.Parameter> iterator()
iterator
in interface Iterable<IlvDashboardSymbol.Parameter>
public int getParameterCount()
public IlvDashboardSymbol.Parameter getParameter(int index)
index
in the list of
parameters.index
- The index of the parameter to be retrieved.index
.public IlvDashboardSymbol.Parameter getParameter(String id)
id
in the parameter list.id
- The ID of the queried symbol parameter.id
or
null
if this symbol does not contain a parameter
with id
.IlvDashboardSymbol(IlvDashboardDiagram, IlvPaletteSymbol, String)
,
IlvDashboardSymbol(IlvDashboardDiagram, IlvPaletteSymbol, String, boolean)
,
Overview,
Parameterspublic String getParameterMapping(IlvDashboardSymbol.Parameter parameter)
parameter
.
Parameters can have their value mapped to an object property of
the SDM Model object. If parameter
uses the default mapping,
the SDM property has the same name as the parameter.
parameter
- The parameter whose mapped SDM object property you need.parameter
. Returns null
if the parameter has
not been mapped.setParameterMapping(Parameter, String)
,
Overview,
Parameters,
IlvDashboardSymbol(IlvDashboardDiagram, IlvPaletteSymbol, String, boolean)
public void setParameterMapping(IlvDashboardSymbol.Parameter parameter, String mapping)
parameter
to the mapping
object property in the SDM model.parameter
- The parameter which is to mapped to
mapping
in the SDM model.mapping
- The object property in the SDM model to be mapped to
parameter
.getParameterMapping(Parameter)
,
Overview,
Parameters,
IlvDashboardSymbol(IlvDashboardDiagram, IlvPaletteSymbol, String, boolean)
public Object getParameterValue(int ndx)
ndx
in the parameter
collection.ndx
- The index of the symbol parameter in the parameter collection.getParameter(String)
,
Parameterspublic Object getParameterValue(IlvDashboardSymbol.Parameter param)
param
.param
- A symbol parameter.param
.public Object getParameterValue(String paramID) throws IlvDashboardException
paramID
paramID
- The ID of the parameter.IlvDashboardException
- if no parameter with the given ID is
defined in this symbol.getParameterValue(Parameter)
,
setParameterValue(String, Object)
public String getParameterTextValue(IlvDashboardSymbol.Parameter param)
param
.param
- A symbol parameter.param
.public void setParameterValue(IlvDashboardSymbol.Parameter parameter, Object value)
parameter
.parameter
- A symbol parameter.value
- The new value for parameter
.getParameter(int)
,
getParameter(String)
,
getParameterMapping(Parameter)
,
getParameterTextValue(Parameter)
public void setParameterValue(String paramID, Object value) throws IlvDashboardException
paramID
.paramID
- The ID of the parameter.value
- The new value of the parameter.IlvDashboardException
- if no parameter with the given ID is
defined in this symbol.setParameterValue(Parameter, Object)
,
getParameterValue(String)
public IlvPaletteSymbolParameter getPaletteSymbolParameter(IlvDashboardSymbol.Parameter parameter)
IlvPaletteSymbolParameter
parameter
object defining parameter
.parameter
- A symbol parameter.parameter
.getParameter(int)
,
getParameter(String)
,
getParameterMapping(Parameter)
,
getParameterTextValue(Parameter)
public String getParameterID(IlvDashboardSymbol.Parameter parameter)
parameter
.parameter
- A symbol parameter.getParameter(int)
,
getParameter(String)
,
getParameterMapping(Parameter)
,
getParameterTextValue(Parameter)
public boolean isLink()
True
if the symbol is a link.public IlvDashboardDiagram getDiagram()
IlvDashboardDiagram
instance containing this
symbol.public String getID()
The symbol ID is the same as the ID of the encapsulated SDM Model object.
setID(String)
public void setID(String newID) throws IlvDashboardException
newID
- The new symbol ID.IlvDashboardException
- if newID
is already used by
another symbol in the dashboard diagram.getID()
public PropertyEditor getPropertyEditor(IlvDashboardSymbol.Parameter param)
PropertyEditor
for param
.
This property editor is meant to be used for short periods of time.param
- A symbol parameter.PropertyEditor
for param
, or
null
.public PropertyEditor createPropertyEditor(IlvDashboardSymbol.Parameter param)
PropertyEditor
for
param
.
This method can be used when the custom editor for this property editor is
going to be displayed.param
- A symbol parameter.PropertyEditor
for param
, or
null
.getPropertyEditor(ilog.views.dashboard.IlvDashboardSymbol.Parameter)
public double getX()
setX(double)
,
Overviewpublic void setX(double x)
public double getY()
setY(double)
,
Overviewpublic void setY(double y)
public double getWidth()
getX()
,
getY()
,
setWidth(double)
,
Overviewpublic void setWidth(double width)
width
- The new width for the symbol.getWidth()
,
setX(double)
,
setY(double)
,
Overviewpublic double getHeight()
setHeight(double)
,
getWidth()
,
getX()
,
getY()
,
Overviewpublic void setHeight(double height)
height
- The new height for the symbol.getHeight()
,
Overviewpublic IlvRect getSymbolBoundingBox()
Note: This bounding may be different from the bounding
box of the graphic object returned by getGraphicObject
.
getGraphicObject()
,
getModel()
,
setSymbolBoundingBox(IlvRect)
,
Overviewpublic void setSymbolBoundingBox(IlvRect rect)
rect
- The rectangle that defines the new size and position of this
symbol.public String getTargetDashboardURL()
When a dashboard URL is associated to a dashboard symbol, that dashboard contents is opened automatically when the symbol is clicked by the user.
IlvDashboardInteractor.showDashboard(String)
,
setTargetDashboardURL(String)
public void setTargetDashboardURL(String target)
When a dashboard URL is associated to a dashboard symbol, that dashboard contents is opened automatically when the symbol is clicked by the user.
target
- The target dashboard URL to be attached to this symbol.IlvDashboardInteractor.showDashboard(String)
,
getTargetDashboardURL()
public void setIntermediateLinkPoints(IlvPoint[] points)
public IlvPoint[] getIntermediateLinkPoints()
isLink()
,
getLinkTo()
,
getLinkFrom()
,
setLinkTo(IlvDashboardSymbol)
,
setLinkFrom(IlvDashboardSymbol)
public IlvDashboardSymbol getLinkFrom()
null
if this symbol is not a link
or it has no origin.getLinkTo()
,
isLink()
,
setLinkFrom(IlvDashboardSymbol)
,
setLinkTo(IlvDashboardSymbol)
,
Linkspublic void setLinkFrom(IlvDashboardSymbol fromSymbol)
fromSymbol
- The source symbol to connect to.getLinkFrom()
,
isLink()
,
Overviewpublic IlvDashboardSymbol getLinkTo()
null
if this symbol is not a link
or it has no target node.getLinkFrom()
,
isLink()
,
setLinkFrom(IlvDashboardSymbol)
,
setLinkTo(IlvDashboardSymbol)
,
Linkspublic void setLinkTo(IlvDashboardSymbol toSymbol)
toSymbol
- The target symbol to connect to.getLinkTo()
,
getLinkFrom()
,
isLink()
,
Overviewpublic boolean isSelected()
True
if this symbol is selected.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.