Search this API

y.option
Class RealizerCellRenderer.NodeRealizerIcon

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

public static class RealizerCellRenderer.NodeRealizerIcon
extends Object
implements Icon

This is a special icon that renders a realizer into an icon


Constructor Summary
RealizerCellRenderer.NodeRealizerIcon(NodeRealizer realizer, int width, int height)
          Creates an icon for the given realizer and size with the default inset.
 
Method Summary
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(Component c, Graphics g, int x, int y)
          Draws the icon at the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealizerCellRenderer.NodeRealizerIcon

public RealizerCellRenderer.NodeRealizerIcon(NodeRealizer realizer,
                                             int width,
                                             int height)
Creates an icon for the given realizer and size with the default inset.

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

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon
Returns:
the total height of this icon including the inset

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon
Returns:
the total width of this icon including the inset

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Draws the icon at the specified location. The actual painting is delegated to the realizer, so changing the visible attributes of the realizer will influence the drawing on subsequent runs of this method without the need to reinitialize this icon.

Before the control is given to the realizer for painting itself it is deselected, if it was selected and it is selected again after the drawing.

Specified by:
paintIcon in interface Icon
Parameters:
c - ignored
g - draw on this
x - x-coordinate
y - y-coordinate

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