Search this API

y.option
Class RealizerCellRenderer.EdgeRealizerIcon

java.lang.Object
  extended by y.option.RealizerCellRenderer.EdgeRealizerIcon
All Implemented Interfaces:
Icon
Enclosing class:
RealizerCellRenderer

public static class RealizerCellRenderer.EdgeRealizerIcon
extends Object
implements Icon

A special icon that renders an edge realizer


Constructor Summary
RealizerCellRenderer.EdgeRealizerIcon(EdgeRealizer realizer, int width, int height)
          Creates an icon for the given realizer.
 
Method Summary
protected  YPoint calculateSourceBend(EdgeRealizer realizer, int iconWidth, int iconHeight)
          Calculates the location of the first control point in the displayed edge visualization.
protected  YPoint calculateTargetBend(EdgeRealizer realizer, int iconWidth, int iconHeight)
          Calculates the location of the second control point in the displayed edge visualization.
 int getIconHeight()
           
 int getIconWidth()
           
 boolean isDrawingBends()
          Returns true if the bends of the realizer are drawn.
 void paintIcon(Component c, Graphics g, int x, int y)
           
protected  void paintRealizer(EdgeRealizer realizer, Graphics2D gfx)
          Paints the realizer.
 void setDrawingBends(boolean drawingBends)
          Sets whether the bends of the realizer are drawn.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealizerCellRenderer.EdgeRealizerIcon

public RealizerCellRenderer.EdgeRealizerIcon(EdgeRealizer realizer,
                                             int width,
                                             int height)
Creates an icon for the given realizer.

Parameters:
realizer - the realizer to create an icon for
width - the width of the icon
height - the height of the icon
Method Detail

isDrawingBends

public boolean isDrawingBends()
Returns true if the bends of the realizer are drawn.

Returns:
true if the bends are drawn
See Also:
setDrawingBends(boolean)

setDrawingBends

public void setDrawingBends(boolean drawingBends)
Sets whether the bends of the realizer are drawn.

Parameters:
drawingBends - if true the bends are drawn
See Also:
isDrawingBends()

calculateSourceBend

protected YPoint calculateSourceBend(EdgeRealizer realizer,
                                     int iconWidth,
                                     int iconHeight)
Calculates the location of the first control point in the displayed edge visualization. The calculated point must be within [0, iconWidth]x[0, iconHeight].

Parameters:
realizer - the displayed edge visualization.
iconWidth - the width of the icon.
iconHeight - the height of the icon.
Returns:
the location of the first control point in the displayed edge.

calculateTargetBend

protected YPoint calculateTargetBend(EdgeRealizer realizer,
                                     int iconWidth,
                                     int iconHeight)
Calculates the location of the second control point in the displayed edge visualization. The calculated point must be within [0, iconWidth]x[0, iconHeight].

Parameters:
realizer - the displayed edge visualization.
iconWidth - the width of the icon.
iconHeight - the height of the icon.
Returns:
the location of the last control point in the displayed edge.

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface Icon

paintRealizer

protected void paintRealizer(EdgeRealizer realizer,
                             Graphics2D gfx)
Paints the realizer. The calling methode will dispose the graphics context afterwards.


© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.