com.bbn.openmap.tools.icon
Interface IconPart

All Known Implementing Classes:
BasicAppIconPart, BasicIconPart, IconPartList

public interface IconPart

An IconPart is an object that makes up a piece of what's rendered on an Icon. It has a java.awt.Shape object that specifies what gets rendered, and it has a clipping shape that specifies how much of the shape gets rendered. The rendering attributes specify how the shape is colored, drawn, etc. The coordinates of the Shape objects used for the clip area and geometry are in relative coordinates, and should be thought of as percentage coordinates, on a scale from 1 to 100. The size of the Graphics object provided in the render method will dictate how large the part will actually be on the screen. If coordinates of the IconPart are greater than 100 or less than zero, that part will not appear on the icon. That may help with defining certain shapes to appear on the icon, however.


Method Summary
 java.lang.Object clone()
           
 java.awt.Shape getClip()
          Get a clip area for the IconPart.
 java.awt.Shape getGeometry()
          Get the geometry for this IconPart.
 DrawingAttributes getRenderingAttributes()
          Get the rendering attributes for this IconPart.
 void render(java.awt.Graphics g, int width, int height)
          Have the IconPart render itself into the Graphic object for a given height and width.
 void render(java.awt.Graphics g, int width, int height, DrawingAttributes appDA)
          Have the IconPart render itself into the Graphic object for a given height and width.
 void setClip(java.awt.Shape clipArea)
          Set a clip area for the IconPart to draw only certain parts of the geometry.
 void setGeometry(java.awt.Shape shape)
          Set the geometry for this IconPart.
 void setRenderingAttributes(DrawingAttributes da)
          Set the rendering attributes for this IconPart.
 

Method Detail

render

void render(java.awt.Graphics g,
            int width,
            int height)
Have the IconPart render itself into the Graphic object for a given height and width.


render

void render(java.awt.Graphics g,
            int width,
            int height,
            DrawingAttributes appDA)
Have the IconPart render itself into the Graphic object for a given height and width. The DrawingAttributes will dictate how the geometries can be drawn, of the IconPart may react to a System setting or last-minute attributes. The IconPart may decide to ignore this provided DrawingAttributes and just use what it has. appDA may be null, in which case the internal DrawingAttributes will be used.


setClip

void setClip(java.awt.Shape clipArea)
Set a clip area for the IconPart to draw only certain parts of the geometry.


getClip

java.awt.Shape getClip()
Get a clip area for the IconPart.


setGeometry

void setGeometry(java.awt.Shape shape)
Set the geometry for this IconPart.


getGeometry

java.awt.Shape getGeometry()
Get the geometry for this IconPart.


setRenderingAttributes

void setRenderingAttributes(DrawingAttributes da)
Set the rendering attributes for this IconPart.


getRenderingAttributes

DrawingAttributes getRenderingAttributes()
Get the rendering attributes for this IconPart.


clone

java.lang.Object clone()
Returns:
copy of itself, IconParts need to be Cloneable


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details