com.bbn.openmap.omGraphics
Class GraphicAttributes

java.lang.Object
  extended by com.bbn.openmap.omGraphics.DrawingAttributes
      extended by com.bbn.openmap.omGraphics.GraphicAttributes
All Implemented Interfaces:
ShapeRenderer, OMGraphicConstants, PropertyConsumer, java.awt.event.ActionListener, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class GraphicAttributes
extends DrawingAttributes
implements java.awt.event.ActionListener, java.io.Serializable, OMGraphicConstants

The GraphicAttributes provides an extension to DrawingAttributes by provideing a mechanism for loading and managing different graphic attributes that may be used, such as line type (LINETYPE_STRAIGHT, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, or LINETYPE_UNKNOWN), or render type (RENDERTYPE_XY, RENDERTYPE_LATLON, RENDERTYPE_OFFSET, or RENDERTYPE_UNKNOWN). The DrawingAttributes class fishes out the applicable properties for you, creates the objects needed, and then lets you get those objects when needed.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bbn.openmap.omGraphics.DrawingAttributes
DrawingAttributes.Builder, DrawingAttributes.DrawingAttributesGUIButton
 
Field Summary
static GraphicAttributes DEFAULT
           
protected  boolean enableLineTypeChoice
          Flag to disable choice of line type, from an external source.
protected  int lineType
          The line type of a graphic, defaults to LINETYPE_STRAIGHT.
static java.lang.String lineTypeProperty
          The name of the property that holds the line type of the graphic.
protected  int renderType
          The rendertype of a graphic.
static java.lang.String renderTypeProperty
          The name of the property that holds the render type of the graphic.
 
Fields inherited from class com.bbn.openmap.omGraphics.DrawingAttributes
alwaysSetTextToBlack, baseScale, baseScaleProperty, bse, capProperty, dashPatternProperty, dashPhaseProperty, defaultDashLength, defaultDashPhase, defaultFillPaintString, defaultLinePaintString, defaultLineWidth, defaultMattingPaintString, defaultSelectPaintString, enableFillPaintChoice, FillColorCommand, fillColorItem, fillPaint, fillPaintProperty, fillPattern, fillPatternProperty, fPattern, icon_height, icon_width, joinProperty, LineColorCommand, lineColorItem, lineMenuAdditions, linePaint, linePaintProperty, lineWidthProperty, logger, matted, MattedCommand, mattedEnabledItem, mattedProperty, MattingColorCommand, mattingColorItem, mattingPaint, mattingPaintProperty, miterLimitProperty, NONE, orientation, pointOval, PointOvalProperty, pointRadius, PointRadiusProperty, propertyChangeSupport, propertyPrefix, SelectColorCommand, selectColorItem, selectPaint, selectPaintProperty, stroke
 
Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants
ADD_GRAPHIC_MASK, APP_OBJECT, BASIC_STROKE, CHANGE_APPEARANCE, clear, DECIMAL_DEGREES, DECLUTTERTYPE_LINE, DECLUTTERTYPE_MOVE, DECLUTTERTYPE_NONE, DECLUTTERTYPE_SPACE, DEFAULT_ROTATIONANGLE, DELETE_GRAPHIC_MASK, DESELECT_GRAPHIC_MASK, DESELECTALL_GRAPHIC_MASK, GRAPHICTYPE_ARC, GRAPHICTYPE_BITMAP, GRAPHICTYPE_CIRCLE, GRAPHICTYPE_ELLIPSE, GRAPHICTYPE_GRAPHIC, GRAPHICTYPE_GRID, GRAPHICTYPE_LINE, GRAPHICTYPE_POINT, GRAPHICTYPE_POLY, GRAPHICTYPE_RASTER, GRAPHICTYPE_RECTANGLE, GRAPHICTYPE_TEXT, INDEX, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, NO_ROTATE, OMGRAPHIC_ELT, OMGRAPHIC_TYPE_ATTR, RADIANS, RAISE_GRAPHIC_MASK, RAISE_TO_TOP_GRAPHIC_MASK, REMOVABLE, RENDERTYPE_LATLON, RENDERTYPE_OFFSET, RENDERTYPE_UNKNOWN, RENDERTYPE_XY, SELECT_GRAPHIC_MASK, SORT_GRAPHICS_MASK, TOOLTIP, UPDATE_GRAPHIC_MASK, UPDATED
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
GraphicAttributes()
          Create a GraphicAttributes with the default settings - clear fill paint and pattern, sold black edge line of width 1.
GraphicAttributes(java.util.Properties props)
          Create the GraphicAttributes and call init without a prefix for the properties.
GraphicAttributes(java.lang.String prefix, java.util.Properties props)
          Create the GraphicAttributes and call init with a prefix for the properties.
 
Method Summary
 java.lang.Object clone()
          Shallow clone.
 boolean getEnableLineTypeChoice()
           
static GraphicAttributes getGADefaultClone()
          If you want to get a DEFAULT DrawingAttributes object that you may modify, get your own copy.
 int getLineType()
          Get the lineType.
 javax.swing.JMenu getLineTypeMenu()
           
 int getRenderType()
          Get the renderType.
 void setEnableLineTypeChoice(boolean value)
          Method should be called on this GraphicAttributes object if the OMGraphic type doesn't support line types to disable the choice from the line menu.
 void setFrom(OMGraphic graphic)
          Set the GraphicAttributes parameters based on the current settings of an OMGraphic.
 void setFrom(OMGraphic graphic, boolean resetGUI)
          Set the GraphicAttributes parameters based on the current settings of an OMGraphic.
 void setLineType(int lt)
          Set the line type.
protected  void setPreStrokeMenuOptions(javax.swing.JPopupMenu popup)
           
 void setProperties(java.lang.String prefix, java.util.Properties props)
          PropertyConsumer method.
 void setRenderType(int rt)
          Set the render type.
 void setTo(GraphicAttributes clone)
           
 void setTo(OMGraphic graphic)
          Set all the attributes for the graphic that are contained within this GraphicAttributes class.
 void setTo(OMGraphic graphic, boolean resetGUI)
          Set all the attributes for the graphic that are contained within this GraphicAttributes class.
 
Methods inherited from class com.bbn.openmap.omGraphics.DrawingAttributes
actionPerformed, calculateTextColor, cloneBasicStroke, equals, getALineButton, getBaseScale, getBasicStrokeEditor, getColorAndLineMenu, getColorMenu, getDefaultClone, getDrawingAttributesIcon, getFillPaint, getFillPaintForScale, getFillPattern, getGradientPaintForShape, getGUI, getIconForPaint, getInitPropertiesOrder, getLineMenuAdditions, getLinePaint, getLock, getMattedIcon, getMattingIconForPaint, getMattingPaint, getNewPaint, getOrientation, getPaletteIcon, getPointRadius, getProperties, getPropertyChangeSupport, getPropertyInfo, getPropertyPrefix, getSelectPaint, getStroke, getStrokeForScale, hashCode, init, init, isClear, isEnableFillPaintChoice, isMatted, isPointOval, normalizeOn128, propertyChange, releaseLock, render, render, resetGUI, setBaseScale, setEnableFillPaintChoice, setFillPaint, setFillPattern, setLineMenuAdditions, setLinePaint, setMatted, setMattingPaint, setOMGraphicAttributesForScale, setOMGraphicEdgeAttributes, setOMGraphicEdgeAttributesForScale, setOrientation, setPointOval, setPointRadius, setPostStrokeMenuOptions, setPreStrokeMenuOptions, setProperties, setPropertyChangeSupport, setPropertyPrefix, setSelectPaint, setStroke, setStrokeMenuOptions, setTo, sTransfer, toString, transfer
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

lineTypeProperty

public static final java.lang.String lineTypeProperty
The name of the property that holds the line type of the graphic.

See Also:
Constant Field Values

renderTypeProperty

public static final java.lang.String renderTypeProperty
The name of the property that holds the render type of the graphic.

See Also:
Constant Field Values

lineType

protected int lineType
The line type of a graphic, defaults to LINETYPE_STRAIGHT.


renderType

protected int renderType
The rendertype of a graphic. Default is RENDERTYPE_XY.


enableLineTypeChoice

protected boolean enableLineTypeChoice
Flag to disable choice of line type, from an external source.


DEFAULT

public static final GraphicAttributes DEFAULT
Constructor Detail

GraphicAttributes

public GraphicAttributes()
Create a GraphicAttributes with the default settings - clear fill paint and pattern, sold black edge line of width 1.


GraphicAttributes

public GraphicAttributes(java.util.Properties props)
Create the GraphicAttributes and call init without a prefix for the properties. Call init without a prefix for the properties.

Parameters:
props - the Properties to look in.

GraphicAttributes

public GraphicAttributes(java.lang.String prefix,
                         java.util.Properties props)
Create the GraphicAttributes and call init with a prefix for the properties.

Parameters:
prefix - the prefix marker to use for a property, like prefix.propertyName. The period is added in this function.
props - the Properties to look in.
Method Detail

getGADefaultClone

public static GraphicAttributes getGADefaultClone()
If you want to get a DEFAULT DrawingAttributes object that you may modify, get your own copy.


setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties props)
PropertyConsumer method.

Specified by:
setProperties in interface PropertyConsumer
Overrides:
setProperties in class DrawingAttributes
Parameters:
prefix - the token to prefix the property names
props - the Properties object

clone

public java.lang.Object clone()
Description copied from class: DrawingAttributes
Shallow clone.

Overrides:
clone in class DrawingAttributes

setTo

public void setTo(GraphicAttributes clone)

getLineType

public int getLineType()
Get the lineType.


setLineType

public void setLineType(int lt)
Set the line type. If it isn't straight, great circle or rhumb, it's set to unknown.


getRenderType

public int getRenderType()
Get the renderType.


setRenderType

public void setRenderType(int rt)
Set the render type. If it isn't xy, lat/lon, or lat/lon with offset, it's set to unknown.


setFrom

public void setFrom(OMGraphic graphic)
Set the GraphicAttributes parameters based on the current settings of an OMGraphic.

Overrides:
setFrom in class DrawingAttributes

setFrom

public void setFrom(OMGraphic graphic,
                    boolean resetGUI)
Set the GraphicAttributes parameters based on the current settings of an OMGraphic.

Overrides:
setFrom in class DrawingAttributes
Parameters:
graphic - OMGraphic to gather settings from.
resetGUI - flag to cause GraphicAttribute GUI reset.

setTo

public void setTo(OMGraphic graphic)
Set all the attributes for the graphic that are contained within this GraphicAttributes class.

Overrides:
setTo in class DrawingAttributes
Parameters:
graphic - OMGraphic.

setTo

public void setTo(OMGraphic graphic,
                  boolean resetGUI)
Set all the attributes for the graphic that are contained within this GraphicAttributes class.

Overrides:
setTo in class DrawingAttributes
Parameters:
graphic - OMGraphic.
resetGUI - reset the GraphicAttributes GUI if desired.

setEnableLineTypeChoice

public void setEnableLineTypeChoice(boolean value)
Method should be called on this GraphicAttributes object if the OMGraphic type doesn't support line types to disable the choice from the line menu. Circles, range rings, points, etc. are all examples of shapes that disable linetype choice.


getEnableLineTypeChoice

public boolean getEnableLineTypeChoice()

setPreStrokeMenuOptions

protected void setPreStrokeMenuOptions(javax.swing.JPopupMenu popup)

getLineTypeMenu

public javax.swing.JMenu getLineTypeMenu()


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