## com.bbn.openmap.omGraphics
Class GraphicAttributes

    java.lang.Object
      com.bbn.openmap.omGraphics.DrawingAttributes
          com.bbn.openmap.omGraphics.GraphicAttributes

All Implemented Interfaces:
  java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, OMGraphicConstants, java.beans.PropertyChangeListener, PropertyConsumer, java.io.Serializable

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

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, dashPatternProperty, dashPhaseProperty, defaultDashLength, defaultDashPhase, defaultFillPaintString, defaultLinePaintString, defaultLineWidth, defaultMattingPaintString, defaultSelectPaintStringline, enableFillPaintChoice, FillColorCommand, fillColorItem, fillPaint, fillPaintProperty, fillPattern, fillPatternProperty, fPattern, icon_height, icon_width, lineButton, LineColorCommand, lineColorItem, lineMenuAdditions, linePaint, linePaintProperty, lineWidthProperty, matted, MattedCommand, mattedEnabledItem, mattedProperty, MattingColorCommand, mattingColorItem, mattingPaint, mattingPaintProperty, NONE, palette, pointOval, PointOvalProperty, pointRadius, PointRadiusProperty, propertyChangeSupport, propertyPrefix, SelectColorCommand, selectColorItem, selectPaint, selectPaintProperty, stroke, toolbar`

Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants

`ADD_GRAPHIC_MASK, 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, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, 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`

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)` Callout method to add stuff to popup menu before the stroke editor is consulted for additions.
`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, getBaseScale, getBasicStrokeEditor, getColorAndLineGUI, getColorMenu, getDefaultClone, getDrawingAttributesIcon, getFillPaint, getFillPaintForScale, getFillPattern, getGradientPaintForShape, getGUI, getIconForPaint, getInitPropertiesOrder, getLineButton, getLineMenuAdditions, getLinePaint, getLock, getMattedIcon, getMattingIconForPaint, getMattingPaint, getNewPaint, getPaletteIcon, getPointRadius, getProperties, getPropertyChangeSupport, getPropertyInfo, getPropertyPrefix, getSelectPaint, getStroke, getStrokeForScale, init, init, isEnableFillPaintChoice, isMatted, isPointOval, normalizeOn128, propertyChange, releaseLock, render, render, resetGUI, setBaseScale, setEnableFillPaintChoice, setFillPaint, setFillPattern, setLineMenuAdditions, setLinePaint, setMatted, setMattingPaint, setOMGraphicAttributesForScale, setOMGraphicEdgeAttributes, setOMGraphicEdgeAttributesForScale, setPointOval, setPointRadius, setPostStrokeMenuOptions, setProperties, setPropertyChangeSupport, setPropertyPrefix, setSelectPaint, setStroke, setStrokeMenuOptions, setTo, toString`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, 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)

  Description copied from class: `DrawingAttributes`
  Callout method to add stuff to popup menu before the stroke editor is consulted for additions. Adds colors and line menu additions (arrowhead controls for lines, for instance).

  Overrides:
    `setPreStrokeMenuOptions` in class `DrawingAttributes`
  Parameters:
    `popup` -

### getLineTypeMenu

    public javax.swing.JMenu getLineTypeMenu()

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