|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.omGraphics.geom.BasicGeometry com.bbn.openmap.omGraphics.OMGraphicAdapter com.bbn.openmap.layer.location.Location com.bbn.openmap.layer.location.Link
public class 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 |
double |
lat2
The lat of point 2. |
double |
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, logger, lon, name, origXLabelOffset, origYLabelOffset, showLocation, showName, x, xOffset, y, yOffset |
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 | |
---|---|
Link()
A plain constructor if you are planning on setting everything yourself. |
|
Link(double lat1,
double lon1,
double lat2,
double lon2,
java.lang.String details)
Construct a Link with the given attributes |
|
Link(int x1,
int y1,
int x2,
int y2,
java.lang.String details)
Construct a Link with the given attribute |
Method Summary | |
---|---|
void |
setGraphicLocations(double latitude,
double longitude)
Does nothing - marker handled in setLocation methods. |
void |
setGraphicLocations(double latitude,
double 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 |
setLocation(double lat1,
double lon1,
double lat2,
double lon2)
Set the location for the link |
void |
setLocation(int x1,
int y1,
int x2,
int y2)
Set new coordinates for this link. |
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, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, 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.OMGeometry |
---|
clearAttributes, contains, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible |
Field Detail |
---|
public double lat2
public double 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(double lat1, double lon1, double lat2, double lon2, java.lang.String details)
lat1
- latitude of start-pointlon1
- longitude of start-pointlat2
- latitude of end-pointlon2
- longitude of endpointdetails
- A string that gives information about this linkpublic Link(int x1, int y1, int x2, int y2, java.lang.String details)
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 linkMethod Detail |
---|
public void setLocation(double lat1, double lon1, double lat2, double 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(double latitude, double longitude)
setGraphicLocations
in class Location
public void setGraphicLocations(int x, int y)
setGraphicLocations
in class Location
public void setGraphicLocations(double latitude, double longitude, int offsetX, int offsetY)
setGraphicLocations
in class Location
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |