|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bbn.openmap.omGraphics.geom.BasicGeometry
com.bbn.openmap.omGraphics.OMGraphicAdapter
com.bbn.openmap.omGraphics.OMAbstractLine
com.bbn.openmap.omGraphics.OMPoly
com.bbn.openmap.omGraphics.labeled.LabeledOMPoly
public class LabeledOMPoly
This is an OMPoly that has been extended to manage a text label.
| 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 |
| Constructor Summary | |
|---|---|
LabeledOMPoly()
|
|
LabeledOMPoly(double[] llPoints,
int units,
int lType)
Create an LabeledOMPoly from a list of float lat/lon pairs. |
|
LabeledOMPoly(double[] llPoints,
int units,
int lType,
int nsegs)
Create an LabeledOMPoly from a list of float lat/lon pairs. |
|
LabeledOMPoly(double latPoint,
double lonPoint,
int[] xypoints,
int cMode)
Create an x/y LabeledOMPoly at an offset from lat/lon. |
|
LabeledOMPoly(double latPoint,
double lonPoint,
int[] xPoints,
int[] yPoints,
int cMode)
Create an x/y LabeledOMPoly at an offset from lat/lon. |
|
LabeledOMPoly(int[] xypoints)
Create an LabeledOMPoly from a list of xy pairs. |
|
LabeledOMPoly(int[] xPoints,
int[] yPoints)
Create an x/y LabeledOMPoly. |
|
| Method Summary | |
|---|---|
protected double |
calculateProjectedArea()
Calculate the projected area of the poly. |
boolean |
generate(Projection proj)
Prepare the poly 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)
Calculate where the text point ought to go. |
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.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 |
|---|
protected OMText label
protected java.awt.Point offset
protected boolean locateAtCenter
protected int index
| Constructor Detail |
|---|
public LabeledOMPoly()
public LabeledOMPoly(double[] llPoints,
int units,
int lType)
OMPoly.OMPoly(double[], int, int)
public LabeledOMPoly(double[] llPoints,
int units,
int lType,
int nsegs)
OMPoly.OMPoly(double[], int, int, int)public LabeledOMPoly(int[] xypoints)
OMPoly.OMPoly(int[])
public LabeledOMPoly(int[] xPoints,
int[] yPoints)
OMPoly.OMPoly(int[], int[])
public LabeledOMPoly(double latPoint,
double lonPoint,
int[] xypoints,
int cMode)
OMPoly.OMPoly(double, double, int[], int)
public LabeledOMPoly(double latPoint,
double lonPoint,
int[] xPoints,
int[] yPoints,
int cMode)
OMPoly.OMPoly(double, double, int[], int[], int)| Method Detail |
|---|
public void setText(java.lang.String label)
setText in interface LabeledOMGraphicpublic java.lang.String getText()
getText in interface LabeledOMGraphicprotected OMText getLabel()
public void setFont(java.awt.Font f)
setFont in interface LabeledOMGraphicpublic java.awt.Font getFont()
getFont in interface LabeledOMGraphicpublic void setJustify(int just)
setJustify in interface LabeledOMGraphicOMText.JUSTIFY_LEFT,
OMText.JUSTIFY_CENTER,
OMText.JUSTIFY_RIGHTpublic int getJustify()
getJustify in interface LabeledOMGraphicOMText.JUSTIFY_LEFT,
OMText.JUSTIFY_CENTER,
OMText.JUSTIFY_RIGHTpublic void setLocateAtCenter(boolean set)
setLocateAtCenter in interface LabeledOMGraphicpublic boolean isLocateAtCenter()
isLocateAtCenter in interface LabeledOMGraphicprotected double calculateProjectedArea()
public java.awt.Point getCenter()
getCenter in interface LabeledOMGraphicpublic void setIndex(int index)
setIndex in interface LabeledOMGraphicpublic int getIndex()
getIndex in interface LabeledOMGraphicpublic void setOffset(java.awt.Point p)
setOffset in interface LabeledOMGraphicpublic java.awt.Point getOffset()
getOffset in interface LabeledOMGraphicpublic void setRotationAngle(double angle)
setRotationAngle in interface LabeledOMGraphicangle - 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.public double getRotationAngle()
getRotationAngle in interface LabeledOMGraphicpublic void setLinePaint(java.awt.Paint paint)
setLinePaint in interface OMGraphicsetLinePaint in class OMGraphicAdapterpaint - the real line Paintpublic void setTextPaint(java.awt.Paint paint)
paint - the Paint object for the textprotected java.awt.Point getTextPoint(Projection proj)
public boolean generate(Projection proj)
OMPoly
generate in interface OMGeometrygenerate in class OMPolyproj - Projection
OMGraphicAdapter.regenerate(com.bbn.openmap.proj.Projection)public void render(java.awt.Graphics g)
OMPoly
render in interface OMGeometryrender in class OMPolyg - java.awt.Graphics to paint the poly onto.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||