org.ascape.util.vis
Class DrawImageFeature

java.lang.Object
  extended by org.ascape.util.vis.DrawFeature
      extended by org.ascape.util.vis.DrawImageFeature
All Implemented Interfaces:
java.io.Serializable, HasName, ImageFeature, PlatformDrawFeature

public class DrawImageFeature
extends DrawFeature
implements ImageFeature

A class using a image feature to determine the image to use to draw a feature.

Since:
1.0
Version:
1.2
Author:
Miles Parker
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.ascape.util.vis.DrawFeature
name, nestedFeature
 
Constructor Summary
DrawImageFeature()
          Constructs a DrawImageFeature.
DrawImageFeature(DrawFeature nestedFeature)
          Constructs a DrawImageFeature with a nested feature.
DrawImageFeature(java.lang.String name)
          Constructs the feature with the supplied name.
DrawImageFeature(java.lang.String name, DrawFeature nestedFeature)
          Constructs the feature with a name and nested feature.
DrawImageFeature(java.lang.String name, ImageFeature imageFeature)
          Constructs the feature with a name and image feature.
 
Method Summary
 void draw(java.awt.Graphics g, java.lang.Object object, int width, int height)
          Draws a graphic interpreation of the object into the supplied graphics port, (typically) within the supplied dimensions.
 java.awt.Image getImage(java.lang.Object object)
          Returns the image feature's image interpretation of the object.
 ImageFeature getImageFeature()
          Returns the image feature this object is using to interpret the object's image.
 java.lang.String getName()
          Returns the user relevant name of this feature.
 void setImageFeature(ImageFeature imageFeature)
          Sets the image feature this object uses to interpret the object's image.
 
Methods inherited from class org.ascape.util.vis.DrawFeature
getNestedFeature, setName, setNestedFeature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawImageFeature

public DrawImageFeature()
Constructs a DrawImageFeature.


DrawImageFeature

public DrawImageFeature(java.lang.String name)
Constructs the feature with the supplied name.

Parameters:
name - the name of this draw feature

DrawImageFeature

public DrawImageFeature(java.lang.String name,
                        ImageFeature imageFeature)
Constructs the feature with a name and image feature.

Parameters:
name - the name of this draw feature
imageFeature - the feature to nest within this feature

DrawImageFeature

public DrawImageFeature(java.lang.String name,
                        DrawFeature nestedFeature)
Constructs the feature with a name and nested feature.

Parameters:
name - the name of this draw feature
nestedFeature - the feature to nest within this feature

DrawImageFeature

public DrawImageFeature(DrawFeature nestedFeature)
Constructs a DrawImageFeature with a nested feature.

Parameters:
nestedFeature - the feature to nest
Method Detail

draw

public void draw(java.awt.Graphics g,
                 java.lang.Object object,
                 int width,
                 int height)
Draws a graphic interpreation of the object into the supplied graphics port, (typically) within the supplied dimensions. Views which use this class are responsible for translating the graphics so that the object is drawn at the approriate location. Please let us know if you think you need a directly addressed alternative.

Specified by:
draw in class DrawFeature
Parameters:
g - the Graphics context to draw into
object - the object to interpret for drawing
width - the width of the space that should be drawn into
height - the height of the space that should be drawn into

getImage

public final java.awt.Image getImage(java.lang.Object object)
Returns the image feature's image interpretation of the object.

Specified by:
getImage in interface ImageFeature
Parameters:
object - the object to interpret image for

getImageFeature

public ImageFeature getImageFeature()
Returns the image feature this object is using to interpret the object's image.


setImageFeature

public void setImageFeature(ImageFeature imageFeature)
Sets the image feature this object uses to interpret the object's image.

Parameters:
imageFeature - the feature to use for imageing

getName

public java.lang.String getName()
Returns the user relevant name of this feature. "Unnamed", the name of the nested feature, or the name of the image feature, by default. Override or set name to provide a name.

Specified by:
getName in interface HasName
Overrides:
getName in class DrawFeature


Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.