com.tensegrity.gui.swing.repository
Class VisualGraphObjectIcon

java.lang.Object
  extended byjavax.swing.ImageIcon
      extended bycom.tensegrity.gui.swing.icon.Icon
          extended bycom.tensegrity.gui.swing.repository.VisualGraphObjectIcon
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.Icon, java.io.Serializable

public class VisualGraphObjectIcon
extends Icon

VisualGraphObjectIcon

Version:
$Id: VisualGraphObjectIcon.java,v 1.12 2006/02/15 10:11:46 BurkhardWick Exp $
Author:
GillesIachelini
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.ImageIcon
javax.swing.ImageIcon.AccessibleImageIcon
 
Field Summary
 
Fields inherited from class com.tensegrity.gui.swing.icon.Icon
EMPTYICON_16x15
 
Fields inherited from class javax.swing.ImageIcon
component, tracker
 
Constructor Summary
VisualGraphObjectIcon(VisualGraphObject vgo)
          Creates a new VisualGraphObjectIcon based on the given VisualGraphObject, using the scalefactor for the text, CoordinateSystem.
VisualGraphObjectIcon(VisualGraphObject vgo, double textscalefactor, CoordinateSystem coordSystem)
          Creates a new VisualGraphObjectIcon based on the given VisualGraphObject and CoordinateSystem.
VisualGraphObjectIcon(VisualGraphObject vgo, double textscalefactor, CoordinateSystem coordSystem, int width, int height)
          Creates a new VisualGraphObjectIcon based on the given VisualGraphObject, using the scalefactor for the text, CoordinateSystem.
VisualGraphObjectIcon(VisualGraphObject vgoIcon, int width, int height)
          Creates a new VisualGraphObjectIcon based on the given VisualGraphObject, using the scalefactor for the text, CoordinateSystem.
VisualGraphObjectIcon(VisualGraphObject vgoIcon, int width, int height, int spacing)
          Creates a new VisualGraphObjectIcon based on the given VisualGraphObject, using the scalefactor for the text, CoordinateSystem.
 
Method Summary
 Renderer getRenderer()
          Returns the renderer that is used to draw the icon
 void paintIcon(java.awt.Component c, java.awt.Graphics gfx, int x, int y)
           
 void setRenderer(Renderer renderer)
          Sets the renderer that should be used to draw the icon
 
Methods inherited from class com.tensegrity.gui.swing.icon.Icon
filter, getColor, getGraphics, getHeight, getImage, getSize, getWidth, paint, setColor, setImage
 
Methods inherited from class javax.swing.ImageIcon
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImageLoadStatus, getImageObserver, loadImage, setDescription, setImageObserver, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VisualGraphObjectIcon

public VisualGraphObjectIcon(VisualGraphObject vgo,
                             double textscalefactor,
                             CoordinateSystem coordSystem,
                             int width,
                             int height)
Creates a new VisualGraphObjectIcon based on the given VisualGraphObject, using the scalefactor for the text, CoordinateSystem. Use the width and height parameter to specify a proper size.

Parameters:
vgo - the target VisualGraphObject.
textscalefactor - a factor to scale the text (if there is any)
coordSystem - the underlying CoordinateSystem for this Icon.
width - width of the resulting icon.
height - height of the resulting icon.

VisualGraphObjectIcon

public VisualGraphObjectIcon(VisualGraphObject vgo,
                             double textscalefactor,
                             CoordinateSystem coordSystem)
Creates a new VisualGraphObjectIcon based on the given VisualGraphObject and CoordinateSystem.

Parameters:
vgo - the target VisualGraphObject.
textscalefactor - a factor to scale the text (if there is any)
coordSystem - the underlying CoordinateSystem for this Icon.

VisualGraphObjectIcon

public VisualGraphObjectIcon(VisualGraphObject vgo)
Creates a new VisualGraphObjectIcon based on the given VisualGraphObject, using the scalefactor for the text, CoordinateSystem. Use the width and height parameter to specify a proper size.

Parameters:
vgo - the target VisualGraphObject.

VisualGraphObjectIcon

public VisualGraphObjectIcon(VisualGraphObject vgoIcon,
                             int width,
                             int height)
Creates a new VisualGraphObjectIcon based on the given VisualGraphObject, using the scalefactor for the text, CoordinateSystem. Use the width and height parameter to specify a proper size.

Parameters:
vgoIcon - the target VisualGraphObject.
width - the width of the icon
height - the height of the icon

VisualGraphObjectIcon

public VisualGraphObjectIcon(VisualGraphObject vgoIcon,
                             int width,
                             int height,
                             int spacing)
Creates a new VisualGraphObjectIcon based on the given VisualGraphObject, using the scalefactor for the text, CoordinateSystem. Use the width and height parameter to specify a proper size.

Parameters:
vgoIcon - the target VisualGraphObject.
width - the width of the icon
height - the height of the icon
spacing - the spacing of the content to the border on all sides
Method Detail

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics gfx,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon
Overrides:
paintIcon in class Icon

getRenderer

public Renderer getRenderer()
Returns the renderer that is used to draw the icon

Returns:
the renderer that is used to draw the icon

setRenderer

public void setRenderer(Renderer renderer)
Sets the renderer that should be used to draw the icon

Parameters:
renderer - the renderer that should be used to draw the icon


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.