|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.graphic.LyGraphicalObject
leon.view.win.swing.LySwingObject
leon.view.win.swing.LySwingMapObject
leon.view.win.swing.LySwingMapLink
public class LySwingMapLink
This class implements the Map link object (as described in the dtd) for win viewer.
LyMapContent
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
static int |
AUTO_LINK_ANGLE
Value of the angle drawn in an auto link |
static int |
DISPLACEMENT_VALUE
Value used to displace multiple links on same node |
static int |
SELECTION_OFFSET
Offset between the link and the selection area. |
Fields inherited from interface leon.view.win.swing.map.LyMapElement |
---|
NORMAL_MODE, REDUCED_MODE |
Constructor Summary | |
---|---|
LySwingMapLink(LyMapLink mapLink)
Class constructor of a Map link object for the Swing target. |
Method Summary | |
---|---|
void |
addNewPoint(LyPoint point,
int idx)
Adds a new point in the view at the given index position. |
void |
addPoint(LyPoint point,
int pos)
The specified point is added in the view layer. |
void |
draw(leon.view.win.swing.map.LyAbstractMapComponentManager map,
java.awt.Graphics g,
int mode)
Draws the link on the map, then prints its label at its center. |
void |
drawInViewer(leon.view.win.swing.map.LyAbstractMapComponentManager map,
java.awt.Graphics g)
(non-Javadoc). |
void |
drawLabels(leon.view.win.swing.map.LyAbstractMapComponentManager map,
java.awt.Graphics g,
int mode)
Draws the label of this link on the specified map. |
void |
drawLink(leon.view.win.swing.map.LyAbstractMapComponentManager map,
java.awt.Graphics g,
int mode)
Draws the link. |
Ly3DBox |
getBoundingBox(leon.view.win.swing.map.LyAbstractMapComponentManager map)
Gets the bounding box of this link in the 3D space. |
java.awt.Rectangle |
getBoundingRectangle(leon.view.win.swing.map.LyAbstractMapComponentManager map)
Returns the bounding rectangle of the elements. |
java.awt.Shape |
getClippingArea(leon.view.win.swing.map.LyAbstractMapComponentManager map,
java.awt.Image image)
Returns the clipping area of the image or the element. |
java.awt.Color |
getColor(LyEnvironment environment)
Gets the color of this map link. |
java.awt.Color |
getColorEnd(LyEnvironment environment)
Gets the end color of this map link. |
java.awt.Color |
getColorStart(LyEnvironment environment)
Gets the start color of this map link. |
java.lang.String |
getEndLabel()
(non-Javadoc). |
java.awt.Dimension |
getEndLabelSize(leon.view.win.swing.map.LyAbstractMapComponentManager map,
java.awt.Graphics g)
Returns the dimension of the label part of the link. |
java.awt.Point |
getEndLinkPoint(leon.view.win.swing.map.LyAbstractMapComponentManager map,
boolean onBoundingRectangle)
Finds the position of the ending arrow of the link. |
LySwingMapNode |
getEndNode()
Gets the end node of this link. |
java.awt.Color |
getFontColor(LyEnvironment environment)
Gets the font color of this map link. |
java.lang.String |
getId()
Return current component identification (LyGetIdInterface interface). |
java.awt.Image[] |
getImages()
Returns the images of the link. |
java.awt.Color |
getInactiveSelectedColor(LyEnvironment environment)
Gets the inactive selected color of this map link. |
java.lang.String |
getLabel()
Returns the label of this element. |
java.awt.Dimension |
getLabelSize(leon.view.win.swing.map.LyAbstractMapComponentManager map,
java.awt.Graphics g)
Returns the dimension of the label part of the link. |
int |
getLayer()
Returns the layer of this element. |
int |
getLinkWidth()
Return the width of the link. |
java.awt.Color |
getOutlineColor(LyEnvironment environment)
Gets the outline color of this map link. |
java.awt.Color |
getSelectedColor(LyEnvironment environment)
Gets the selected color of this map link. |
java.lang.String |
getStartLabel()
(non-Javadoc). |
java.awt.Dimension |
getStartLabelSize(leon.view.win.swing.map.LyAbstractMapComponentManager map,
java.awt.Graphics g)
Returns the dimension of the label part of the link. |
java.awt.Point |
getStartLinkPoint(leon.view.win.swing.map.LyAbstractMapComponentManager map,
boolean onBoundingRectangle)
Finds the position of the starting arrow of the link. |
LySwingMapNode |
getStartNode()
Gets the start node of this link. |
java.lang.String |
getTooltip()
Returns the tooltip of this element. |
void |
initialize()
Initializes the class fields with default values. |
boolean |
isAtPosition(leon.view.win.swing.map.LyAbstractMapComponentManager map,
java.awt.Graphics g,
int x,
int y)
Checks that this element draws itself at the specified (x,y) position. |
boolean |
isHidden()
Indicates whether this element is hidden or not. |
boolean |
isLabelZoomable()
Return true is displayed label should be zoom dependant. |
boolean |
isOverlay()
Indicates whether this element is overlay or not. |
boolean |
isSelected()
Indicates whether this element is selected or not. |
boolean |
isSensitive()
Indicates whether this element is sensitive or not. |
void |
removeAllPoints()
Clears all points in the view elements. |
void |
removePoint(LyPoint point)
The specified point is removed in the view layer. |
void |
setColor(java.lang.String color)
|
void |
setColorEnd(java.lang.String colorEnd)
Updates attribute colorEnd to the given value. |
void |
setColorStart(java.lang.String colorStart)
Updates attribute colorStart to the given value. |
void |
setEndLabel(java.lang.String leftLabel)
Set the left label and clear the label cache. |
void |
setEndNode(LySwingMapNode node)
Sets the end node of this link. |
void |
setFontColor(java.lang.String labelColor)
|
void |
setHidden(boolean hidden)
Updates attribute hidden to the given value. |
void |
setLabel(java.lang.String label)
Sets the label attribute to null in order to get rid of cache. |
void |
setSelected(boolean selected)
Updates attribute selected to the given value. |
void |
setStartLabel(java.lang.String rightLabel)
Set the right label and clear the label cache. |
void |
setStartNode(LySwingMapNode node)
Sets the start node of this link. |
java.lang.String |
toString()
|
void |
translate(float dx,
float dy,
float dz)
Don't move this object. |
Methods inherited from class leon.view.win.swing.LySwingObject |
---|
getBounds, getChildrenBounds, getComponent, getDefaultFrame |
Methods inherited from class leon.view.graphic.LyGraphicalObject |
---|
expand, free, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface leon.view.graphic.LyGraphicalComponent |
---|
free, getViewComponent |
Field Detail |
---|
public static final java.lang.String __VERSION
public static final int SELECTION_OFFSET
public static int DISPLACEMENT_VALUE
public static int AUTO_LINK_ANGLE
Constructor Detail |
---|
public LySwingMapLink(LyMapLink mapLink)
mapLink
- a MAP_LINK component defined for every type of view targets. This map link is
initialized for the swing view.Method Detail |
---|
public void initialize()
public java.awt.Image[] getImages()
getImages
in interface leon.view.win.swing.map.LyMapElement
LyMapElement.getImages()
public java.awt.Color getColorStart(LyEnvironment environment)
environment
- the environment
public java.awt.Color getColor(LyEnvironment environment)
environment
- the environment, not used in this implementation
public java.awt.Color getColorEnd(LyEnvironment environment)
environment
- the environment
public java.awt.Color getSelectedColor(LyEnvironment environment)
environment
- the environment, not used in this implementation
public java.awt.Color getInactiveSelectedColor(LyEnvironment environment)
environment
- the environment, not used in this implementation
public java.awt.Color getFontColor(LyEnvironment environment)
environment
- the environment, not used in this implementation
public java.awt.Color getOutlineColor(LyEnvironment environment)
environment
- the environment, not used in this implementation
public java.awt.Dimension getLabelSize(leon.view.win.swing.map.LyAbstractMapComponentManager map, java.awt.Graphics g)
_labelWidth
and _labelHeight
values of this link are not set (equal -1), the width and height are computed
to the correct values for the label to be displayed.
map
- the map containing the label to drawg
- the graphics context
public java.awt.Dimension getStartLabelSize(leon.view.win.swing.map.LyAbstractMapComponentManager map, java.awt.Graphics g)
_labelWidth
and _labelHeight
values of this link are not set (equal -1), the width and height are computed
to the correct values for the label to be displayed.
map
- the map containing the label to drawg
- the graphics context
public java.awt.Dimension getEndLabelSize(leon.view.win.swing.map.LyAbstractMapComponentManager map, java.awt.Graphics g)
_labelWidth
and _labelHeight
values of this link are not set (equal -1), the width and height are computed
to the correct values for the label to be displayed.
map
- the map containing the label to drawg
- the graphics context
public void draw(leon.view.win.swing.map.LyAbstractMapComponentManager map, java.awt.Graphics g, int mode)
draw
in interface leon.view.win.swing.map.LyMapElement
map
- the map to drawg
- the graphical contextmode
- the drawing modeLyMapElement.draw(leon.view.win.swing.map.LyAbstractMapComponentManager,
java.awt.Graphics, int)
public void drawLabels(leon.view.win.swing.map.LyAbstractMapComponentManager map, java.awt.Graphics g, int mode)
map
- the map containing the label to drawg
- the graphics contextmode
- the mode of the drawing, not used in this implementationpublic void drawLink(leon.view.win.swing.map.LyAbstractMapComponentManager map, java.awt.Graphics g, int mode)
map
- the link to drawg
- the graphics contextmode
- the mode of the drawingpublic void drawInViewer(leon.view.win.swing.map.LyAbstractMapComponentManager map, java.awt.Graphics g)
drawInViewer
in interface leon.view.win.swing.map.LyMapElement
map
- the mapg
- the graphical contextLyMapElement.drawInViewer(leon.view.win.swing.map.LyAbstractMapComponentManager,
java.awt.Graphics)
public void addPoint(LyPoint point, int pos)
addPoint
in interface LyGraphicalMapLink
point
- The points to add to points list.pos
- Position where the sub-component is inserted.LyGraphicalMapLink.addPoint(leon.view.LyPoint, int)
public void removePoint(LyPoint point)
removePoint
in interface LyGraphicalMapLink
point
- The points to remove to points list.LyGraphicalMapLink.removePoint(LyPoint)
public void addNewPoint(LyPoint point, int idx)
point
- new point insertedidx
- index of the pointpublic void removeAllPoints()
public java.lang.String getId()
LyGetIdInterface
getId
in interface LyGetIdInterface
public Ly3DBox getBoundingBox(leon.view.win.swing.map.LyAbstractMapComponentManager map)
getBoundingBox
in interface leon.view.win.swing.map.LyMapElement
map
- the map manager of this link. Unused in this method.
LyMapElement.getBoundingBox(leon.view.win.swing.map.LyAbstractMapComponentManager)
public java.awt.Rectangle getBoundingRectangle(leon.view.win.swing.map.LyAbstractMapComponentManager map)
leon.view.win.swing.map.LyMapElement
getBoundingRectangle
in interface leon.view.win.swing.map.LyMapElement
map
- the map component to retrieve its bounding rectangle
public java.awt.Shape getClippingArea(leon.view.win.swing.map.LyAbstractMapComponentManager map, java.awt.Image image)
leon.view.win.swing.map.LyMapElement
getClippingArea
in interface leon.view.win.swing.map.LyMapElement
map
- the map componentimage
- the image
null
public int getLayer()
leon.view.win.swing.map.LyMapElement
getLayer
in interface leon.view.win.swing.map.LyMapElement
public java.lang.String getLabel()
leon.view.win.swing.map.LyMapElement
getLabel
in interface leon.view.win.swing.map.LyMapElement
public java.lang.String getStartLabel()
LyMapElement.getLabel()
public java.lang.String getEndLabel()
LyMapElement.getLabel()
public void setLabel(java.lang.String label)
null
in order to get rid of cache.
setLabel
in interface LyGraphicalMapLink
setLabel
in interface LySetLabelInterface
label
- This attribute is not used in this implementation.getLabel()
public java.lang.String getTooltip()
leon.view.win.swing.map.LyMapElement
getTooltip
in interface leon.view.win.swing.map.LyMapElement
public boolean isAtPosition(leon.view.win.swing.map.LyAbstractMapComponentManager map, java.awt.Graphics g, int x, int y)
leon.view.win.swing.map.LyMapElement
isAtPosition
in interface leon.view.win.swing.map.LyMapElement
map
- the mapg
- the graphical contextx
- the x coordinatey
- the y coordinate
true
if this element is at the specified point in the map,
false
otherwisepublic void setSelected(boolean selected)
LyGraphicalMapLink
setSelected
in interface LyGraphicalMapLink
setSelected
in interface LySetSelectedInterface
setSelected
in interface leon.view.win.swing.map.LyMapElement
selected
- Boolean indicating if attribute selected is set or unset.public boolean isSelected()
leon.view.win.swing.map.LyMapElement
isSelected
in interface leon.view.win.swing.map.LyMapElement
true
if this element is selected, false
otherwisepublic void translate(float dx, float dy, float dz)
translate
in interface leon.view.win.swing.map.LyMapElement
dx
- the x delta, not used in this implementationdy
- the y delta, not used in this implementationdz
- the z delta, not used in this implementationLyMapElement.translate(float, float, float)
public boolean isOverlay()
leon.view.win.swing.map.LyMapElement
isOverlay
in interface leon.view.win.swing.map.LyMapElement
true
if this element is overlaid, false
otherwisepublic boolean isHidden()
leon.view.win.swing.map.LyMapElement
isHidden
in interface leon.view.win.swing.map.LyMapElement
true
if this element is hidden, false
otherwisepublic void setHidden(boolean hidden)
LyGraphicalMapLink
setHidden
in interface LyGraphicalMapLink
setHidden
in interface LySetHiddenInterface
hidden
- Boolean indicating if attribute hidden is set or unset.public boolean isSensitive()
leon.view.win.swing.map.LyMapElement
isSensitive
in interface leon.view.win.swing.map.LyMapElement
true
if this element is sensitive, false
otherwisepublic void setStartNode(LySwingMapNode node)
node
- value of the starting nodegetStartNode()
public void setEndNode(LySwingMapNode node)
node
- value of the ending nodegetEndNode()
public LySwingMapNode getStartNode()
setStartNode(LySwingMapNode)
public LySwingMapNode getEndNode()
setEndNode(LySwingMapNode)
public void setColorStart(java.lang.String colorStart)
LyGraphicalMapLink
setColorStart
in interface LyGraphicalMapLink
colorStart
- New value of colorStart.public void setColor(java.lang.String color)
public void setColorEnd(java.lang.String colorEnd)
LyGraphicalMapLink
setColorEnd
in interface LyGraphicalMapLink
colorEnd
- New value of colorEnd.public void setFontColor(java.lang.String labelColor)
public void setEndLabel(java.lang.String leftLabel)
setEndLabel
in interface LyGraphicalMapLink
leftLabel
- New value of endLabel.LyGraphicalMapLink.setEndLabel(java.lang.String)
public void setStartLabel(java.lang.String rightLabel)
setStartLabel
in interface LyGraphicalMapLink
rightLabel
- New value of startLabel.LyGraphicalMapLink.setStartLabel(java.lang.String)
public java.awt.Point getStartLinkPoint(leon.view.win.swing.map.LyAbstractMapComponentManager map, boolean onBoundingRectangle)
map
- the map that is drawnonBoundingRectangle
- if onBoundingRectangle
, the
starting point is the intersection of the (startNode, endNode) line and
the startNode boundingRectangle, otherwise it is the intersection of the
(startNode, endNode) line and the circle around the startNode.
null
if one of
the node is null
.public java.awt.Point getEndLinkPoint(leon.view.win.swing.map.LyAbstractMapComponentManager map, boolean onBoundingRectangle)
map
- the map that is drawn
null
if one of
the node is null
.public java.lang.String toString()
toString
in class java.lang.Object
public boolean isLabelZoomable()
public int getLinkWidth()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |