LabeledOMSpline (OpenMap API)
Date: 2016-12-09

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.omGraphics.labeled
Class LabeledOMSpline

    java.lang.Object
      com.bbn.openmap.omGraphics.geom.BasicGeometry
          com.bbn.openmap.omGraphics.OMGraphicAdapter
              com.bbn.openmap.omGraphics.OMAbstractLine
                  com.bbn.openmap.omGraphics.OMPoly
                      com.bbn.openmap.omGraphics.OMSpline
                          com.bbn.openmap.omGraphics.labeled.LabeledOMSpline

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

    public class LabeledOMSpline

extends OMSpline
implements LabeledOMGraphic

LabeledOMSpline Copied from LabeledOMPoly, because both OMSpline and LabeledOMPoly inherits from OMPoly

Version:
  15 juil. 2002
Author:
  Eric LEPICIER
See Also:
  Serialized Form

Field Summary
`protected int` | `index`
`protected OMText` | `label`
`protected boolean` | `locateAtCenter`
`protected java.awt.Point` | `offset`

Fields inherited from class com.bbn.openmap.omGraphics.OMPoly
`coordMode, COORDMODE_ORIGIN, COORDMODE_PREVIOUS, doShapes, geometryClosed, isPolygon, lat, lon, rawllpts, units, xs, ys`

Fields inherited from class com.bbn.openmap.omGraphics.OMAbstractLine
`arrowhead, nsegs, xpoints, ypoints`

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

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

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`

Constructor Summary
`LabeledOMSpline()` Default constructor.
`LabeledOMSpline(double[] llPoints, int units, int lType)` Create an LabeledOMSpline from a list of float lat/lon pairs.
`LabeledOMSpline(double[] llPoints, int units, int lType, int nsegs)` Create an LabeledOMSpline from a list of float lat/lon pairs.
`LabeledOMSpline(float latPoint, float lonPoint, int[] xypoints, int cMode)` Create an x/y LabeledOMSpline at an offset from lat/lon.
`LabeledOMSpline(float latPoint, float lonPoint, int[] xPoints, int[] yPoints, int cMode)` Create an x/y LabeledOMSpline at an offset from lat/lon.
`LabeledOMSpline(int[] xypoints)` Create an LabeledOMSpline from a list of xy pairs.
`LabeledOMSpline(int[] xPoints, int[] yPoints)` Create an x/y LabeledOMSpline.

Method Summary
`boolean` | `generate(Projection proj)` Prepare the spline for rendering.
`java.awt.Point` | `getCenter()` Get the calculated center where the label string is drawn.
`java.awt.Font` | `getFont()` Get the Font for the label.
`int` | `getIndex()` Get the index of the OMGraphic where the String will be rendered.
`int` | `getJustify()` Get the justification setting for the label.
`protected OMText` | `getLabel()`
`java.awt.Point` | `getOffset()` Get the x, y pixel offsets set for the rendering of the point.
`double` | `getRotationAngle()` Get the current rotation of the text.
`java.lang.String` | `getText()` Get the String for the label.
`protected java.awt.Point` | `getTextPoint(Projection proj)`
`boolean` | `isLocateAtCenter()` Get whether the LabeledOMGraphic is placing the label String in the center of the OMGraphic.
`void` | `render(java.awt.Graphics g)` Paint the poly.
`void` | `setFont(java.awt.Font f)` Set the Font for the label.
`void` | `setIndex(int index)` Set the index of the OMGraphic coordinates where the drawing point of the label should be attached.
`void` | `setJustify(int just)` Set the justification setting for the label.
`void` | `setLinePaint(java.awt.Paint paint)` Set the line paint for the polygon.
`void` | `setLocateAtCenter(boolean set)` Tell the LabeledOMGraphic to calculate the location of the String that would put it in the middle of the OMGraphic.
`void` | `setOffset(java.awt.Point p)` Set the x, y pixel offsets where the String should be rendered, from the location determined from the index point, or from the calculated center point.
`void` | `setRotationAngle(double angle)` Set the angle by which the text is to rotated.
`void` | `setText(java.lang.String label)` Set the String for the label.
`void` | `setTextPaint(java.awt.Paint paint)` If not set to null, the text will be painted in a different color.

Methods inherited from class com.bbn.openmap.omGraphics.OMPoly
`checkPoints, createShape, distance, getCoordMode, getDoShapes, getIndexOfFirstNodeOfSegIntersect, getLat, getLatLonArray, getLatLonArrayCopy, getLon, getNumSegs, getRawllpts, getShape, getUnits, getXs, getYs, insertRadians, isGeometryClosed, isPolygon, main, restore, setCoordMode, setDoShapes, setFillPaint, setIsPolygon, setLat, setLocation, setLocation, setLocation, setLocation, setLocation, setLon, setNumSegs, setXs, setYs, shouldRenderFill`

Methods inherited from class com.bbn.openmap.omGraphics.OMAbstractLine
`addArrowHead, addArrowHead, addArrowHead, addArrowHead, createArrowHeads, getArrowDirectionType, getArrowHead, getArrowLocation, getWingLength, getWingTip, hasArrowHead, restore, setArrowHead`

Methods inherited from class com.bbn.openmap.omGraphics.OMGraphicAdapter
`clone, deselect, getDeclutterType, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, readStroke, readTextureMask, regenerate, renderLabel, renderShape, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, writeStroke, writeTextureMask`

Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
`_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, isRenderable, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, 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.OMGraphic
`clone, deselect, getDeclutterType, getDisplayColor, getDisplayPaint, getFillColor, getFillPaint, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, select, setDeclutterType, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setLabelLocation, setLabelLocation, setLabelLocation, setMatted, setMattingPaint, setRenderType, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge`

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

Field Detail

### label

    protected OMText label

### offset

    protected java.awt.Point offset

### locateAtCenter

    protected boolean locateAtCenter

### index

    protected int index

Constructor Detail

### LabeledOMSpline

    public LabeledOMSpline()

  Default constructor.

### LabeledOMSpline

    public LabeledOMSpline(double[] llPoints,
                           int units,
                           int lType)

  Create an LabeledOMSpline from a list of float lat/lon pairs.

### LabeledOMSpline

    public LabeledOMSpline(double[] llPoints,
                           int units,
                           int lType,
                           int nsegs)

  Create an LabeledOMSpline from a list of float lat/lon pairs.

### LabeledOMSpline

    public LabeledOMSpline(int[] xypoints)

  Create an LabeledOMSpline from a list of xy pairs.

### LabeledOMSpline

    public LabeledOMSpline(int[] xPoints,
                           int[] yPoints)

  Create an x/y LabeledOMSpline.

### LabeledOMSpline

    public LabeledOMSpline(float latPoint,
                           float lonPoint,
                           int[] xypoints,
                           int cMode)

  Create an x/y LabeledOMSpline at an offset from lat/lon.

### LabeledOMSpline

    public LabeledOMSpline(float latPoint,
                           float lonPoint,
                           int[] xPoints,
                           int[] yPoints,
                           int cMode)

  Create an x/y LabeledOMSpline at an offset from lat/lon.

Method Detail

### setText

    public void setText(java.lang.String label)

  Set the String for the label.

  Specified by:
    `setText` in interface `LabeledOMGraphic`

### getText

    public java.lang.String getText()

  Get the String for the label.

  Specified by:
    `getText` in interface `LabeledOMGraphic`

### getLabel

    protected OMText getLabel()

### setFont

    public void setFont(java.awt.Font f)

  Set the Font for the label.

  Specified by:
    `setFont` in interface `LabeledOMGraphic`

### getFont

    public java.awt.Font getFont()

  Get the Font for the label.

  Specified by:
    `getFont` in interface `LabeledOMGraphic`

### setJustify

    public void setJustify(int just)

  Set the justification setting for the label.

  Specified by:
    `setJustify` in interface `LabeledOMGraphic`
  See Also:
    `OMText.JUSTIFY_LEFT`, `OMText.JUSTIFY_CENTER`, `OMText.JUSTIFY_RIGHT`

### getJustify

    public int getJustify()

  Get the justification setting for the label.

  Specified by:
    `getJustify` in interface `LabeledOMGraphic`
  See Also:
    `OMText.JUSTIFY_LEFT`, `OMText.JUSTIFY_CENTER`, `OMText.JUSTIFY_RIGHT`

### setLocateAtCenter

    public void setLocateAtCenter(boolean set)

  Tell the LabeledOMGraphic to calculate the location of the String that would put it in the middle of the OMGraphic.

  Specified by:
    `setLocateAtCenter` in interface `LabeledOMGraphic`

### isLocateAtCenter

    public boolean isLocateAtCenter()

  Get whether the LabeledOMGraphic is placing the label String in the center of the OMGraphic.

  Specified by:
    `isLocateAtCenter` in interface `LabeledOMGraphic`

### getCenter

    public java.awt.Point getCenter()

  Get the calculated center where the label string is drawn.

  Specified by:
    `getCenter` in interface `LabeledOMGraphic`

### setIndex

    public void setIndex(int index)

  Set the index of the OMGraphic coordinates where the drawing point of the label should be attached. The meaning of the point differs between OMGraphic types.

  Specified by:
    `setIndex` in interface `LabeledOMGraphic`

### getIndex

    public int getIndex()

  Get the index of the OMGraphic where the String will be rendered. The meaning of the index differs from OMGraphic type to OMGraphic type.

  Specified by:
    `getIndex` in interface `LabeledOMGraphic`

### setOffset

    public void setOffset(java.awt.Point p)

  Set the x, y pixel offsets where the String should be rendered, from the location determined from the index point, or from the calculated center point. Point.x is the horizontal offset, Point.y is the vertical offset.

  Specified by:
    `setOffset` in interface `LabeledOMGraphic`

### getOffset

    public java.awt.Point getOffset()

  Get the x, y pixel offsets set for the rendering of the point.

  Specified by:
    `getOffset` in interface `LabeledOMGraphic`

### setRotationAngle

    public void setRotationAngle(double angle)

  Set the angle by which the text is to rotated.

  Specified by:
    `setRotationAngle` in interface `LabeledOMGraphic`
  Parameters:
    `angle` - the number of radians the text is to be rotated. Measured clockwise from horizontal. Positive numbers move the positive x axis toward the positive y axis.

### getRotationAngle

    public double getRotationAngle()

  Get the current rotation of the text.

  Specified by:
    `getRotationAngle` in interface `LabeledOMGraphic`
  Returns:
    the text rotation.

### setLinePaint

    public void setLinePaint(java.awt.Paint paint)

  Set the line paint for the polygon. If the text paint hasn't been explicitly set, then the text paint will be set to this paint, too.

  Specified by:
    `setLinePaint` in interface `OMGraphic`
  Overrides:
    `setLinePaint` in class `OMGraphicAdapter`
  Parameters:
    `paint` - the real line Paint

### setTextPaint

    public void setTextPaint(java.awt.Paint paint)

  If not set to null, the text will be painted in a different color. If set to null, the text paint will match the poly edge paint.

  Parameters:
    `paint` - the Paint object for the text

### getTextPoint

    protected java.awt.Point getTextPoint(Projection proj)

### generate

    public boolean generate(Projection proj)

  Description copied from class: `OMSpline`
  Prepare the spline for rendering.

  Specified by:
    `generate` in interface `OMGeometry`
  Overrides:
    `generate` in class `OMSpline`
  Parameters:
    `proj` - Projection
  Returns:
    true if generate was successful
  See Also:
    `OMGeometry.generate(Projection)`

### render

    public void render(java.awt.Graphics g)

  Description copied from class: `OMPoly`
  Paint the poly. This works if generate() has been successful.

  Specified by:
    `render` in interface `OMGeometry`
  Overrides:
    `render` in class `OMPoly`
  Parameters:
    `g` - java.awt.Graphics to paint the poly onto.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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