Search this API

y.option
Class RealizerCellRenderer.NodeRealizerIcon

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

public static class RealizerCellRenderer.NodeRealizerIcon
extends java.lang.Object
implements javax.swing.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()
          Returns the total height of this icon including insets.
 int getIconWidth()
          Returns the total width of this icon including insets.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Draws the icon at the specified location.
protected  void paintRealizer(NodeRealizer nr, java.awt.Graphics2D g2d)
          Paints the given node realizer.
 
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()
Returns the total height of this icon including insets.

Specified by:
getIconHeight in interface javax.swing.Icon
Returns:
the total height of this icon including insets.

getIconWidth

public int getIconWidth()
Returns the total width of this icon including insets.

Specified by:
getIconWidth in interface javax.swing.Icon
Returns:
the total width of this icon including insets.

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Draws the icon at the specified location. Calls paintRealizer(y.view.NodeRealizer, java.awt.Graphics2D).

Specified by:
paintIcon in interface javax.swing.Icon
Parameters:
c - ignored
g - the graphics context to draw upon.
x - x-coordinate of the icon's location.
y - y-coordinate of the icon's location.

paintRealizer

protected void paintRealizer(NodeRealizer nr,
                             java.awt.Graphics2D g2d)
Paints the given node realizer. 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.

Called from paintIcon(java.awt.Component, java.awt.Graphics, int, int). The calling method will dispose the graphics context afterwards.


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