LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web.struts
Class LyStrutsMapLink

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.web.LyWebObject
          extended by leon.view.web.struts.LyStrutsMapObject
              extended by leon.view.web.struts.LyStrutsMapLink
All Implemented Interfaces:
LyGetIdInterface, LyGraphicalComponent, LyGraphicalMapLink, LyViewComponent, LyFreeInterface, LySetHiddenInterface, LySetLabelInterface, LySetSelectedInterface, LyWebComponent, leon.view.web.struts.map.LyStrutsMapElement

public class LyStrutsMapLink
extends LyStrutsMapObject
implements LyGraphicalMapLink, leon.view.web.struts.map.LyStrutsMapElement

This class implements the Map Link object (as described in the dtd) for Struts viewer.

MAP_LINK: Map Link
Map links allow to define segments between two nodes of the map. If one of the two nodes defining the link is moved, the link follows the moved node so that it always starts from its source node and that it always arrives to its destination node.

See Also:
LyMapLink

Field Summary
static java.lang.String __VERSION
           
static int SELECTION_OFFSET
          Offset between the link and the selection area.
 
Fields inherited from class leon.view.web.LyWebObject
WEB_COMPONENT_ID, WEB_CONTROLLER_ID, WEB_SESSION_ID
 
Fields inherited from interface leon.view.web.struts.map.LyStrutsMapElement
DRAW_MODE_NORMAL, DRAW_MODE_REDUCED
 
Constructor Summary
LyStrutsMapLink(LyMapLink mapLink)
          Class constructor of a Map Link object for the struts target.
 
Method Summary
 void addPoint(LyPoint point, int pos)
          This method does nothing.
 void draw(leon.view.web.struts.map.LyStrutsMapCanvas map, java.awt.Graphics g, int mode)
          (non-Javadoc).
 void drawHtml(leon.view.web.struts.map.LyStrutsMapCanvas map, LyWebPageWriter pw)
          (non-Javadoc).
 void drawInViewer(leon.view.web.struts.map.LyStrutsMapCanvas map, java.awt.Graphics g)
          (non-Javadoc).
 void drawLabels(leon.view.web.struts.map.LyStrutsMapCanvas map, java.awt.Graphics g, int mode)
          Draws the label of this link on the specified map.
 void drawLink(leon.view.web.struts.map.LyStrutsMapCanvas map, java.awt.Graphics g, int mode)
          Draws the link.
 void free()
          Free resources allocated to this component.
 Ly3DBox getBoundingBox(leon.view.web.struts.map.LyStrutsMapCanvas map)
          (non-Javadoc).
 java.awt.Rectangle getBoundingRectangle(leon.view.web.struts.map.LyStrutsMapCanvas map)
          (non-Javadoc).
 java.awt.Polygon getBoundingShape(leon.view.web.struts.map.LyStrutsMapCanvas map)
          Gets the bounding shape of the link.
 java.awt.Shape getClippingArea(leon.view.web.struts.map.LyStrutsMapCanvas map, java.awt.Image image)
          (non-Javadoc).
 java.awt.Color getColor()
          Gets the color of the middle part of the link.
 java.awt.Color getColorEnd()
          Gets the color of the end part of the link.
 java.awt.Color getColorStart()
          Gets the color of the start part of the link.
 java.lang.String getEndLabel()
          (non-Javadoc).
 java.awt.Dimension getEndLabelSize(java.awt.Graphics g)
          Returns the dimension of the label part of the link.
 java.awt.Color getFontColor()
          Gets the font color of the link.
 java.lang.String getId()
          (non-Javadoc).
 java.awt.Image[] getImages()
          Gets images used by this element and sets images class attributes with those new values.
 java.lang.String getLabel()
          (non-Javadoc).
 java.awt.Dimension getLabelSize(java.awt.Graphics g)
          Gets the dimension of the label part of the link.
 int getLayer()
          (non-Javadoc).
 java.awt.Color getOutlineColor()
          Gets the outline color of this map link.
 java.awt.Color getSelectedColor()
          Gets the color of a selected link.
 java.lang.String getStartLabel()
          (non-Javadoc).
 java.awt.Dimension getStartLabelSize(java.awt.Graphics g)
          Returns the dimension of the label part of the link.
 java.lang.String getTooltip()
          (non-Javadoc).
 boolean isAtPosition(leon.view.web.struts.map.LyStrutsMapCanvas map, java.awt.Graphics g, int x, int y)
          (non-Javadoc).
 boolean isDrawableInterface(leon.view.web.struts.map.LyStrutsMapCanvas map)
          Indicates is the component is drawable or not in web.
 boolean isHidden()
          (non-Javadoc).
 boolean isOverlay()
          (non-Javadoc).
 boolean isSelected()
          (non-Javadoc).
 boolean isSensitive()
          (non-Javadoc).
 void refresh()
          Refresh map containing this map link.
 void removePoint(LyPoint point)
          This method does nothing.
 void resetPosition()
          Generates the Javascript code that resets the position of the element.
 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(LyStrutsMapNode node)
          Sets the end node.
 void setFontColor(java.lang.String labelColor)
           
 void setHidden(boolean hidden)
          (non-Javadoc).
 void setLabel(java.lang.String label)
          (non-Javadoc).
 void setSelected(boolean selected)
          (non-Javadoc).
 void setStartLabel(java.lang.String rightLabel)
          Set the right label and clear the label cache.
 void setStartNode(LyStrutsMapNode node)
          Sets the start node.
 void translate(float dx, float dy, float dz)
          This method does nothing.
 void writeHtml(LyWebPageWriter pw)
          (non-Javadoc).
 
Methods inherited from class leon.view.web.struts.LyStrutsMapObject
getColor, getFont, getHexString, getImage
 
Methods inherited from class leon.view.web.LyWebObject
addFileScript, decodeUrl, displayUpPage, encodeUrl, encodeUrlXhtml, expandUrl, getDisabledImageUrl, getFontSize, getFontString, getFontString, getFontString, getHexColor, getHexColor, getHtmlEntitiesString, getHtmlString, getImageSize, getImageSize, getImageUrl, getJavascriptString, getLastFrameName, getLyFont, getMessage, getRootUrl, getRootURL, getScrollHeightForSplitter, getUrl, getWebViewManager, replaceUrl, replaceUrl, setUpdating, updateRefreshInfo, writeJson
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, getBounds, getChildrenBounds, getController, getEnv, getEnvironment, getIdCode, getIntResource, 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, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
getViewComponent
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

SELECTION_OFFSET

public static final int SELECTION_OFFSET
Offset between the link and the selection area.

See Also:
Constant Field Values
Constructor Detail

LyStrutsMapLink

public LyStrutsMapLink(LyMapLink mapLink)
Class constructor of a Map Link object for the struts target.

Parameters:
mapLink - the generic Map Link defined for every type of view targets
Method Detail

free

public void free()
Description copied from class: LyGraphicalObject
Free resources allocated to this component.

Specified by:
free in interface LyGraphicalComponent
Specified by:
free in interface LyFreeInterface
Overrides:
free in class LyWebObject
See Also:
LyFreeInterface.free()

drawHtml

public void drawHtml(leon.view.web.struts.map.LyStrutsMapCanvas map,
                     LyWebPageWriter pw)
(non-Javadoc).

Specified by:
drawHtml in interface leon.view.web.struts.map.LyStrutsMapElement
Parameters:
map - the map where the element must be drawn
pw - the page writer
See Also:
LyStrutsMapElement.drawHtml(leon.view.web.struts.map.LyStrutsMapCanvas, leon.view.web.LyWebPageWriter)

writeHtml

public void writeHtml(LyWebPageWriter pw)
(non-Javadoc).

Specified by:
writeHtml in interface LyWebComponent
Parameters:
pw - the page writer
See Also:
LyWebComponent.writeHtml(leon.view.web.LyWebPageWriter)

getImages

public java.awt.Image[] getImages()
Gets images used by this element and sets images class attributes with those new values.

Specified by:
getImages in interface leon.view.web.struts.map.LyStrutsMapElement
Returns:
the list of images
See Also:
LyStrutsMapElement.getImages()

getColorStart

public java.awt.Color getColorStart()
Gets the color of the start part of the link.

Returns:
the color of the start part of the link

getColor

public java.awt.Color getColor()
Gets the color of the middle part of the link.

Returns:
the color of the middle part of the link

getColorEnd

public java.awt.Color getColorEnd()
Gets the color of the end part of the link.

Returns:
the color of the end part of the link

getSelectedColor

public java.awt.Color getSelectedColor()
Gets the color of a selected link.

Returns:
the colorof a selected link

getFontColor

public java.awt.Color getFontColor()
Gets the font color of the link.

Returns:
the font color of the link

getOutlineColor

public java.awt.Color getOutlineColor()
Gets the outline color of this map link.

Returns:
the outline color of the link

getLabelSize

public java.awt.Dimension getLabelSize(java.awt.Graphics g)
Gets the dimension of the label part of the link.

Parameters:
g - the graphics context
Returns:
the dimension of the label part of the link

getStartLabelSize

public java.awt.Dimension getStartLabelSize(java.awt.Graphics g)
Returns the dimension of the label part of the link. If the _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.

Parameters:
g - the graphics context
Returns:
the label size of the current node

getEndLabelSize

public java.awt.Dimension getEndLabelSize(java.awt.Graphics g)
Returns the dimension of the label part of the link. If the _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.

Parameters:
g - the graphics context
Returns:
the label size of the current node

draw

public void draw(leon.view.web.struts.map.LyStrutsMapCanvas map,
                 java.awt.Graphics g,
                 int mode)
(non-Javadoc).

Specified by:
draw in interface leon.view.web.struts.map.LyStrutsMapElement
Parameters:
map - the map
g - the graphical context
mode - drawing mode
See Also:
LyStrutsMapElement.draw(leon.view.web.struts.map.LyStrutsMapCanvas, java.awt.Graphics, int)

drawInViewer

public void drawInViewer(leon.view.web.struts.map.LyStrutsMapCanvas map,
                         java.awt.Graphics g)
(non-Javadoc).

Specified by:
drawInViewer in interface leon.view.web.struts.map.LyStrutsMapElement
Parameters:
map - the map
g - the graphical context
See Also:
leon.view.web.struts.map.LyStrutsMapElement#drawInViewer(leon.view.web.struts.map.LyStrutsMapCanvas, java.awt.Graphics, int)

drawLabels

public void drawLabels(leon.view.web.struts.map.LyStrutsMapCanvas map,
                       java.awt.Graphics g,
                       int mode)
Draws the label of this link on the specified map.

Parameters:
map - the map containing the label to draw
g - the graphics context
mode - the mode of the drawing, not used in this implementation

drawLink

public void drawLink(leon.view.web.struts.map.LyStrutsMapCanvas map,
                     java.awt.Graphics g,
                     int mode)
Draws the link.

Parameters:
map - the map of the link
g - the graphics context
mode - the drawing mode (can be LyStrutsMapElement.DRAW_MODE_NORMAL or LyStrutsMapElement.DRAW_MODE_REDUCED)

getId

public java.lang.String getId()
(non-Javadoc).

Specified by:
getId in interface LyGetIdInterface
See Also:
LyGetIdInterface.getId()

getBoundingBox

public Ly3DBox getBoundingBox(leon.view.web.struts.map.LyStrutsMapCanvas map)
(non-Javadoc).

Specified by:
getBoundingBox in interface leon.view.web.struts.map.LyStrutsMapElement
Parameters:
map - the map
Returns:
the 3D bounding box
See Also:
LyStrutsMapElement.getBoundingBox(leon.view.web.struts.map.LyStrutsMapCanvas)

getBoundingRectangle

public java.awt.Rectangle getBoundingRectangle(leon.view.web.struts.map.LyStrutsMapCanvas map)
(non-Javadoc).

Specified by:
getBoundingRectangle in interface leon.view.web.struts.map.LyStrutsMapElement
Parameters:
map - the map
Returns:
the bounding rectangle
See Also:
LyStrutsMapElement.getBoundingRectangle(leon.view.web.struts.map.LyStrutsMapCanvas)

getBoundingShape

public java.awt.Polygon getBoundingShape(leon.view.web.struts.map.LyStrutsMapCanvas map)
Gets the bounding shape of the link.

Parameters:
map - the map of the link
Returns:
the bounding shape of the link

getClippingArea

public java.awt.Shape getClippingArea(leon.view.web.struts.map.LyStrutsMapCanvas map,
                                      java.awt.Image image)
(non-Javadoc).

Specified by:
getClippingArea in interface leon.view.web.struts.map.LyStrutsMapElement
Parameters:
map - the map
image - the image
Returns:
the clipping area
See Also:
LyStrutsMapElement.getClippingArea(leon.view.web.struts.map.LyStrutsMapCanvas, java.awt.Image)

getLayer

public int getLayer()
(non-Javadoc).

Specified by:
getLayer in interface leon.view.web.struts.map.LyStrutsMapElement
Returns:
the layer
See Also:
LyStrutsMapElement.getLayer()

getLabel

public java.lang.String getLabel()
(non-Javadoc).

Specified by:
getLabel in interface leon.view.web.struts.map.LyStrutsMapElement
Returns:
the label
See Also:
LyStrutsMapElement.getLabel()

getStartLabel

public java.lang.String getStartLabel()
(non-Javadoc).

See Also:
LyMapElement.getLabel()

getEndLabel

public java.lang.String getEndLabel()
(non-Javadoc).

See Also:
LyMapElement.getLabel()

setLabel

public void setLabel(java.lang.String label)
(non-Javadoc).

Specified by:
setLabel in interface LyGraphicalMapLink
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - New value of label.
See Also:
LySetLabelInterface.setLabel(java.lang.String)

getTooltip

public java.lang.String getTooltip()
(non-Javadoc).

Specified by:
getTooltip in interface leon.view.web.struts.map.LyStrutsMapElement
Returns:
the tooltip
See Also:
LyStrutsMapElement.getTooltip()

isAtPosition

public boolean isAtPosition(leon.view.web.struts.map.LyStrutsMapCanvas map,
                            java.awt.Graphics g,
                            int x,
                            int y)
(non-Javadoc).

Specified by:
isAtPosition in interface leon.view.web.struts.map.LyStrutsMapElement
Parameters:
map - the map
g - the graphical context
x - the x coordonate
y - the y coordonate
Returns:
true if the point is at the (x, y) position, false otherwise
See Also:
LyStrutsMapElement.isAtPosition(leon.view.web.struts.map.LyStrutsMapCanvas, java.awt.Graphics, int, int)

setSelected

public void setSelected(boolean selected)
(non-Javadoc).

Specified by:
setSelected in interface LyGraphicalMapLink
Specified by:
setSelected in interface LySetSelectedInterface
Specified by:
setSelected in interface leon.view.web.struts.map.LyStrutsMapElement
Parameters:
selected - Boolean indicating if attribute selected is set or unset.
See Also:
LySetSelectedInterface.setSelected(boolean)

isSelected

public boolean isSelected()
(non-Javadoc).

Specified by:
isSelected in interface leon.view.web.struts.map.LyStrutsMapElement
Returns:
true is the element is selected, false otherwise
See Also:
LyStrutsMapElement.isSelected()

setHidden

public void setHidden(boolean hidden)
(non-Javadoc).

Specified by:
setHidden in interface LyGraphicalMapLink
Specified by:
setHidden in interface LySetHiddenInterface
Parameters:
hidden - Boolean indicating if attribute hidden is set or unset.
See Also:
LySetHiddenInterface.setHidden(boolean)

translate

public void translate(float dx,
                      float dy,
                      float dz)
This method does nothing.

Specified by:
translate in interface leon.view.web.struts.map.LyStrutsMapElement
Parameters:
dx - x translation.
dy - y translation.
dz - z translation.
See Also:
LyStrutsMapElement.translate(float, float, float)

isOverlay

public boolean isOverlay()
(non-Javadoc).

Specified by:
isOverlay in interface leon.view.web.struts.map.LyStrutsMapElement
Returns:
true is the element is overlay, false otherwise
See Also:
LyStrutsMapElement.isOverlay()

isHidden

public boolean isHidden()
(non-Javadoc).

Specified by:
isHidden in interface leon.view.web.struts.map.LyStrutsMapElement
Returns:
true is the element is hidden, false otherwise
See Also:
LyStrutsMapElement.isHidden()

isSensitive

public boolean isSensitive()
(non-Javadoc).

Specified by:
isSensitive in interface leon.view.web.struts.map.LyStrutsMapElement
Returns:
true is the element is sensitive, false otherwise
See Also:
LyStrutsMapElement.isSensitive()

setStartNode

public void setStartNode(LyStrutsMapNode node)
Sets the start node.

Parameters:
node - the new start node

setEndNode

public void setEndNode(LyStrutsMapNode node)
Sets the end node.

Parameters:
node - the new end node

addPoint

public void addPoint(LyPoint point,
                     int pos)
This method does nothing.

Specified by:
addPoint in interface LyGraphicalMapLink
Parameters:
point - The points to add to points list.
pos - Position where the sub-component is inserted.
See Also:
LyGraphicalMapLink.addPoint(leon.view.LyPoint, int)

removePoint

public void removePoint(LyPoint point)
This method does nothing.

Specified by:
removePoint in interface LyGraphicalMapLink
Parameters:
point - The points to remove to points list.
See Also:
LyGraphicalMapLink.removePoint(leon.view.LyPoint)

setColorStart

public void setColorStart(java.lang.String colorStart)
Description copied from interface: LyGraphicalMapLink
Updates attribute colorStart to the given value.

Specified by:
setColorStart in interface LyGraphicalMapLink
Parameters:
colorStart - New value of colorStart.

setColor

public void setColor(java.lang.String color)

setColorEnd

public void setColorEnd(java.lang.String colorEnd)
Description copied from interface: LyGraphicalMapLink
Updates attribute colorEnd to the given value.

Specified by:
setColorEnd in interface LyGraphicalMapLink
Parameters:
colorEnd - New value of colorEnd.

setFontColor

public void setFontColor(java.lang.String labelColor)

refresh

public void refresh()
Refresh map containing this map link.
Call the refreshMapImage() on the LyStrutsMapLink instance.

Overrides:
refresh in class LyWebObject

isDrawableInterface

public boolean isDrawableInterface(leon.view.web.struts.map.LyStrutsMapCanvas map)
Indicates is the component is drawable or not in web.

Specified by:
isDrawableInterface in interface leon.view.web.struts.map.LyStrutsMapElement
Parameters:
map - the map
Returns:
always false
See Also:
LyStrutsMapElement.isDrawableInterface(leon.view.web.struts.map.LyStrutsMapCanvas)

setEndLabel

public void setEndLabel(java.lang.String leftLabel)
Set the left label and clear the label cache.

Specified by:
setEndLabel in interface LyGraphicalMapLink
Parameters:
leftLabel - New value of endLabel.
See Also:
leon.view.graphic.LyGraphicalMapLink#setLeftLabel(java.lang.String)

setStartLabel

public void setStartLabel(java.lang.String rightLabel)
Set the right label and clear the label cache.

Specified by:
setStartLabel in interface LyGraphicalMapLink
Parameters:
rightLabel - New value of startLabel.
See Also:
leon.view.graphic.LyGraphicalMapLink#setRightLabel(java.lang.String)

resetPosition

public void resetPosition()
Generates the Javascript code that resets the position of the element.

Specified by:
resetPosition in interface leon.view.web.struts.map.LyStrutsMapElement

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com