|
|||||||||||
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.OMGraphic
com.bbn.openmap.layer.location.Location
com.bbn.openmap.layer.location.Link
A Link is a relationship between Locations, represented as a line between them. If you want to draw the endpoints, use a LocationHandler for them.
Although this class extends from Location, it doesn't handle displaying a name for the link that well. The name will appear as the first node's marker name, although it should declutter if needed.
Field Summary | |
static java.awt.Color |
DEFAULT_COLOR
the default color is black |
static boolean |
DEFAULT_DASHED
the default dash style - not dashed |
static int |
DEFAULT_LINETYPE
the default line type - straight |
static float |
DEFAULT_THICKNESS
the default line thickness - 1 |
float |
lat2
The lat of point 2. |
float |
lon2
The lon of point 2. |
int |
x2
The x of point 2. |
int |
y2
The y of point 2. |
Fields inherited from class com.bbn.openmap.layer.location.Location |
allowDecluttering, currentFontDescent, DECLUTTER_ANYWHERE, DECLUTTER_LOCALLY, declutterLimit, DEFAULT_SPACING, details, handler, horizontalLabelBuffer, label, lat, location, lon, name, origXLabelOffset, origYLabelOffset, showLocation, showName, x, xOffset, y, yOffset |
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 |
Constructor Summary | |
Link()
A plain contructor if you are planning on setting everything yourself. |
|
Link(float lat1,
float lon1,
float lat2,
float lon2,
java.lang.String details,
java.awt.Paint paint,
boolean dashed,
float thickness,
int linetype)
Construct a Link with the given attributes |
|
Link(int x1,
int y1,
int x2,
int y2,
java.lang.String details,
java.awt.Paint paint,
boolean dashed,
float thickness)
Construct a Link with the given attribute |
Method Summary | |
OMLine |
getLink()
|
boolean |
isShowLink()
|
void |
setGraphicLocations(float latitude,
float longitude)
Does nothing - marker handled in setLocation methods. |
void |
setGraphicLocations(float latitude,
float longitude,
int offsetX,
int offsetY)
Does nothing - marker handled in setLocation methods. |
void |
setGraphicLocations(int x,
int y)
Does nothing - marker handled in setLocation methods. |
void |
setLinkColor(java.awt.Paint linkPaint)
|
void |
setLinkDrawingParameters(OMLine link,
java.awt.Paint paint,
float thickness,
boolean dashed)
Set the drawing attributes of the link |
void |
setLocation(float lat1,
float lon1,
float lat2,
float lon2)
Set the location for the link |
void |
setLocation(int x1,
int y1,
int x2,
int y2)
Set new coordinates for this link. |
void |
setShowLink(boolean showLinks)
|
Methods inherited from class com.bbn.openmap.layer.location.Location |
convertCoordinateString, declutterLabel, distance, generate, generate, getDeclutterLimit, getDetails, getHorizontalLabelBuffer, getLabel, getLocationHandler, getLocationMarker, getName, isAllowDecluttering, isShowLocation, isShowName, main, render, renderLocation, renderName, setAllowDecluttering, setDeclutterLimit, setDetails, setHorizontalLabelBuffer, setLabel, setLocation, setLocation, setLocation, setLocation, setLocationHandler, setLocationMarker, setLocationPaint, setName, setShowLocation, setShowName, shouldRenderLocation, shouldRenderName, showDetails |
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 |
public float lat2
public float lon2
public int x2
public int y2
public static java.awt.Color DEFAULT_COLOR
public static boolean DEFAULT_DASHED
public static int DEFAULT_LINETYPE
public static float DEFAULT_THICKNESS
Constructor Detail |
public Link()
public Link(float lat1, float lon1, float lat2, float lon2, java.lang.String details, java.awt.Paint paint, boolean dashed, float thickness, int linetype)
lat1
- latitude of start-pointlon1
- longitude of start-pointlat2
- latitude of end-pointlon2
- longitude of endpointdetails
- A string that gives information about this linkpaint
- the link's displayed edge java.awt.Paint (Color).dashed
- Is it a dashed line?thickness
- The line thickness.linetype
- LINETYPE_STRAIGHT, LINETYPE_GREATCIRCLE,
LINETYPE_RHUMBpublic Link(int x1, int y1, int x2, int y2, java.lang.String details, java.awt.Paint paint, boolean dashed, float thickness)
x1
- Starting x point of Linky1
- Starting y point of Linkx2
- End x point of Linky2
- End y point of Linkdetails
- A string that gives information about this linkpaint
- the link's displayed edge java.awt.Paint (Color).dashed
- Is it a dashed line?thickness
- The line thickness.Method Detail |
public void setLinkDrawingParameters(OMLine link, java.awt.Paint paint, float thickness, boolean dashed)
link
- the line used for the linkpaint
- the line colorthickness
- the thickness of the linedashed
- true if the line should be dashedpublic void setLocation(float lat1, float lon1, float lat2, float lon2)
lat1
- the latitude of the first locationlon1
- the longitude of the first locationlat2
- the latitude of the second locationlon2
- the longitude of the second locationpublic void setLocation(int x1, int y1, int x2, int y2)
x1
- the x coordinate of the first locationy1
- the y coordinate of the first locationx2
- the x coordinate of the second locationy2
- the y coordinate of the second locationpublic void setGraphicLocations(float latitude, float longitude)
setGraphicLocations
in class Location
public void setGraphicLocations(int x, int y)
setGraphicLocations
in class Location
public void setGraphicLocations(float latitude, float longitude, int offsetX, int offsetY)
setGraphicLocations
in class Location
public void setLinkColor(java.awt.Paint linkPaint)
public void setShowLink(boolean showLinks)
public boolean isShowLink()
public OMLine getLink()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |