## com.bbn.openmap.omGraphics
Class OMAbstractLine

    java.lang.Object
      com.bbn.openmap.omGraphics.geom.BasicGeometry
          com.bbn.openmap.omGraphics.OMGraphic
              com.bbn.openmap.omGraphics.OMAbstractLine

All Implemented Interfaces:
  java.lang.Cloneable, OMGeometry, OMGraphicConstants, java.io.Serializable

Direct Known Subclasses:
  OMLine, OMPoly

public abstract class OMAbstractLine
extends OMGraphic

The abstract base class of OMPoly and OMLine.

Author:
  Sebastien Rosset
See Also:
  `OMLine`, `OMPoly`, Serialized Form

Field Summary
`protected int` `nsegs` Number of segments to draw (used only for LINETYPE_GREATCIRCLE or LINETYPE_RHUMB lines).
`protected int[][]` `xpoints` X coordinate arrays of the projected points.
`protected int[][]` `ypoints` Y coordinate arrays of the projected points.

Fields inherited from class com.bbn.openmap.omGraphics.OMGraphic
`declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask`

Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
`APP_OBJECT_KEY, appObject, ATT_MAP_KEY, lineType, needToRegenerate, shape, visible`

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`

Constructor Summary
`OMAbstractLine()` Construct a default OMAbstractLine.
`OMAbstractLine(int rType, int lType, int dcType)` Construct an OMAbstractLine.
`OMAbstractLine(int rType, int lType, int dcType, java.awt.Color lc, java.awt.Color fc, java.awt.Color sc)` Construct an OMAbstractLine.

Method Summary
`void` `addArrowHead(boolean value)` Turn the ArrowHead on/off.
`void` `addArrowHead(int directionType)` Turn the ArrowHead on.
`void` `addArrowHead(int directionType, int location)` Turn the ArrowHead on.
`void` `addArrowHead(int directionType, int location, int tipWidth, int arrowLength)` Turn the ArrowHead on.
`java.awt.geom.GeneralPath` `createArrowHeads()` Deprecated. Create an OMArrowHead and set it on the OMAbstractLine instead.
`int` `getArrowDirectionType()` Arrowhead function, to find out the arrowhead direction.
`OMArrowHead` `getArrowHead()`
`int` `getArrowLocation()` Arrowhead function, to find out the arrowhead location.
`int` `getWingLength()` Arrowhead function, to find out the arrowhead length.
`int` `getWingTip()` Arrowhead function, to find out the wing tip width.
`boolean` `hasArrowHead()`
`void` `setArrowHead(OMArrowHead omah)` Set the OMArrowHead object on the OMAbstractLine.

Methods inherited from class com.bbn.openmap.omGraphics.OMGraphic

`clone, deselect, distance, generate, getDeclutterType, getDescription, getDescription, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, render, renderLabel, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShape, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, shouldRenderFill`

Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry

`_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, checkAttributeMap, checkAttributeMap, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, draw, fill, getAppObject, getAppObject, getAttribute, getAttributeMap, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isVisible, putAttribute, removeAttribute, replaceAppObjectWithAttributeMap, setAppObject, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setVisible`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry
`clearAttributes, contains, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setVisible`

Field Detail

### xpoints

    protected int[][] xpoints

  X coordinate arrays of the projected points.

### ypoints

    protected int[][] ypoints

  Y coordinate arrays of the projected points.

### nsegs

    protected int nsegs

  Number of segments to draw (used only for LINETYPE_GREATCIRCLE or LINETYPE_RHUMB lines).

Constructor Detail

### OMAbstractLine

    public OMAbstractLine()

  Construct a default OMAbstractLine.

### OMAbstractLine

    public OMAbstractLine(int rType,
                          int lType,
                          int dcType)

  Construct an OMAbstractLine. Standard simple constructor that the child OMAbstractLine usually call. All of the other parameters get set to their default values.

Parameters:
  `rType` - render type
  `lType` - line type
  `dcType` - declutter type

### OMAbstractLine

    public OMAbstractLine(int rType,
                          int lType,
                          int dcType,
                          java.awt.Color lc,
                          java.awt.Color fc,
                          java.awt.Color sc)

  Construct an OMAbstractLine. More complex constructor that lets you set the rest of the parameters.

Parameters:
  `rType` - render type
  `lType` - line type
  `dcType` - declutter type
  `lc` - line color
  `fc` - fill color
  `sc` - select color

Method Detail

### addArrowHead

    public void addArrowHead(boolean value)

  Turn the ArrowHead on/off. The ArrowHead is placed on the finishing end.

  Parameters:
    `value` - on/off

### setArrowHead

    public void setArrowHead(OMArrowHead omah)

  Set the OMArrowHead object on the OMAbstractLine.

  Parameters:
    `omah` -

### getArrowHead

    public OMArrowHead getArrowHead()

### hasArrowHead

    public boolean hasArrowHead()

### addArrowHead

    public void addArrowHead(int directionType)

  Turn the ArrowHead on. The ArrowHead is placed on the finishing end (OMArrowHead.ARROWHEAD_DIRECTION_FORWARD), beginning end (OMArrowHead.ARROWHEAD_DIRECTION_BACKWARD), or both ends(OMArrowHead.ARROWHEAD_DIRECTION_BOTH).

  Parameters:
    `directionType` - which way to point the arrow head.

### addArrowHead

    public void addArrowHead(int directionType,
                             int location)

  Turn the ArrowHead on. The ArrowHead is placed on the finishing end (OMArrowHead.ARROWHEAD_DIRECTION_FORWARD), beginning end (OMArrowHead.ARROWHEAD_DIRECTION_BACKWARD), or both ends(OMArrowHead.ARROWHEAD_DIRECTION_BOTH).

  Parameters:
    `directionType` - which way to point the arrow head.
    `location` - where on the line to put the arrow head - 0 for the starting point, 100 for the end.

### addArrowHead

    public void addArrowHead(int directionType,
                             int location,
                             int tipWidth,
                             int arrowLength)

  Turn the ArrowHead on. The ArrowHead is placed on the finishing end (OMArrowHead.ARROWHEAD_DIRECTION_FORWARD), beginning end (OMArrowHead.ARROWHEAD_DIRECTION_BACKWARD), or both ends(OMArrowHead.ARROWHEAD_DIRECTION_BOTH).

  Parameters:
    `directionType` - which way to point the arrow head.
    `location` - where on the line to put the arrow head - 0 for the starting point, 100 for the end.
    `tipWidth` - the width factor for the base of the arrowhead, on one side of the line. (Default is 5)
    `arrowLength` - the length factor of the arrowhead, from the tip of the line to the base of the arrowhead. (Default is 20)

### getWingTip

    public int getWingTip()

  Arrowhead function, to find out the wing tip width.

### getWingLength

    public int getWingLength()

  Arrowhead function, to find out the arrowhead length.

### getArrowLocation

    public int getArrowLocation()

  Arrowhead function, to find out the arrowhead location.

### getArrowDirectionType

    public int getArrowDirectionType()

  Arrowhead function, to find out the arrowhead direction.

### createArrowHeads

    public java.awt.geom.GeneralPath createArrowHeads()

  Deprecated. Create an OMArrowHead and set it on the OMAbstractLine instead.

  This is a method that you can extend to create the GeneralPath for the arrowheads, if you want a different way of doing it. By default, it calls OMArrowHead.createArrowHeads(), using the different arrowhead variables set in the OMLine.

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