info.aduna.clustermap.render
Class DefaultIconFactory

java.lang.Object
  extended by info.aduna.clustermap.render.DefaultIconFactory
All Implemented Interfaces:
IconFactory
Direct Known Subclasses:
ItemIconFactory

public class DefaultIconFactory
extends Object
implements IconFactory

Implements IconFactory and additionally provides functionality to set the default icons.


Constructor Summary
DefaultIconFactory()
           
 
Method Summary
 Color getColorFor(Classification classification, float selectionLevel)
           
 Color getColorFor(Object object, float selectionLevel)
           
 Image getDefaultLabelImage(Classification classification, float selectionLevel)
           
 Image getGraphNodeImage(Classification classification, double diameter, float selectionLevel)
          Returns the Image used to render the graph node of a Classification.
 int getGraphNodeImageDiameter()
          Returns the diameter of the graph node images at normal magnification.
 Image getLabelImage(Classification classification, double diameter, float selectionLevel)
          Returns the Image used in the label of the Classification.
 int getLabelImageDiameter()
          Returns the diameter of the label images at normal magnification.
 Image getObjectImage(Object object, double diameter, float selectionLevel)
          Returns the Image used to render an Object contained in a Cluster.
 int getObjectImageDiameter()
          Returns the diameter of the object images at normal magnification.
 Image getScaledImage(Image image, double diameter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIconFactory

public DefaultIconFactory()
Method Detail

getObjectImageDiameter

public int getObjectImageDiameter()
Description copied from interface: IconFactory
Returns the diameter of the object images at normal magnification.

Specified by:
getObjectImageDiameter in interface IconFactory

getObjectImage

public Image getObjectImage(Object object,
                            double diameter,
                            float selectionLevel)
Description copied from interface: IconFactory
Returns the Image used to render an Object contained in a Cluster.

This method should respond fast, as retrieved Images will not be cached.

Specified by:
getObjectImage in interface IconFactory
Parameters:
object - The Object for which a representative Image should be returned.
diameter - The diameter the image should have. The image is assumed to depect a more-or-less round shape with transparent corners, hence 'diameter' instead of 'width. The diameter is encoded as a double to allow continuous scaling.
selectionLevel - A number indicating the level to which the Object is considered to be selected. This is a number between 0 and 1. Typically only these two values are used, future version of the software may also use intermediate values.
Returns:
A fully-loaded Image.

getColorFor

public Color getColorFor(Object object,
                         float selectionLevel)

getGraphNodeImageDiameter

public int getGraphNodeImageDiameter()
Description copied from interface: IconFactory
Returns the diameter of the graph node images at normal magnification.

Specified by:
getGraphNodeImageDiameter in interface IconFactory

getGraphNodeImage

public Image getGraphNodeImage(Classification classification,
                               double diameter,
                               float selectionLevel)
Description copied from interface: IconFactory
Returns the Image used to render the graph node of a Classification. Note that certain Cluster Map rendering schemes may not use these icons.

This Image may be null.

Specified by:
getGraphNodeImage in interface IconFactory
Parameters:
classification - The Classification for which a representative Image should be returned.
diameter - The diameter the image should have, encoded as a double to allow continuous scaling.
selectionLevel - A number indicating the level to which the Classification is considered to be selected. This is a number between 0 and 1.
Returns:
A fully-loaded Image.

getColorFor

public Color getColorFor(Classification classification,
                         float selectionLevel)

getLabelImageDiameter

public int getLabelImageDiameter()
Description copied from interface: IconFactory
Returns the diameter of the label images at normal magnification.

Specified by:
getLabelImageDiameter in interface IconFactory

getLabelImage

public Image getLabelImage(Classification classification,
                           double diameter,
                           float selectionLevel)
Description copied from interface: IconFactory
Returns the Image used in the label of the Classification. This icon will be shown in the graph to the left of the Classification name.

Unlike the graph node image, the label image is always displayed by the Cluster Map, as it may contain vital semantics of the Classification that is necessary to correctly interpret the graph.

This Image may be null.

Specified by:
getLabelImage in interface IconFactory
Parameters:
classification - The Classification for which a representative Image should be returned.
diameter - The diameter the image should have, encoded as a double to enable continuous scaling.
selectionLevel - A number indicating the level to which the Classification is considered to be selected. This is a number between 0 and 1.
Returns:
A fully-loaded Image.

getDefaultLabelImage

public Image getDefaultLabelImage(Classification classification,
                                  float selectionLevel)

getScaledImage

public Image getScaledImage(Image image,
                            double diameter)


Copyright © 1997-2008 Aduna. All Rights Reserved.