com.bbn.openmap.layer.location
Class Link

java.lang.Object
  extended by com.bbn.openmap.omGraphics.geom.BasicGeometry
      extended by com.bbn.openmap.omGraphics.OMGraphicAdapter
          extended by com.bbn.openmap.layer.location.Location
              extended by com.bbn.openmap.layer.location.Link
All Implemented Interfaces:
OMGeometry, OMGraphic, OMGraphicConstants, java.io.Serializable, java.lang.Cloneable

public class Link
extends Location

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.

See Also:
Serialized Form

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
 
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
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.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, restore, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, shouldRenderFill, 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, 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

lat2

public double lat2
The lat of point 2.


lon2

public double lon2
The lon of point 2.


x2

public int x2
The x of point 2.


y2

public int y2
The y of point 2.


DEFAULT_COLOR

public static java.awt.Color DEFAULT_COLOR
the default color is black


DEFAULT_DASHED

public static boolean DEFAULT_DASHED
the default dash style - not dashed


DEFAULT_LINETYPE

public static int DEFAULT_LINETYPE
the default line type - straight


DEFAULT_THICKNESS

public static float DEFAULT_THICKNESS
the default line thickness - 1

Constructor Detail

Link

public Link()
A plain constructor if you are planning on setting everything yourself.


Link

public Link(double lat1,
            double lon1,
            double lat2,
            double lon2,
            java.lang.String details)
Construct a Link with the given attributes

Parameters:
lat1 - latitude of start-point
lon1 - longitude of start-point
lat2 - latitude of end-point
lon2 - longitude of endpoint
details - A string that gives information about this link

Link

public Link(int x1,
            int y1,
            int x2,
            int y2,
            java.lang.String details)
Construct a Link with the given attribute

Parameters:
x1 - Starting x point of Link
y1 - Starting y point of Link
x2 - End x point of Link
y2 - End y point of Link
details - A string that gives information about this link
Method Detail

setLocation

public void setLocation(double lat1,
                        double lon1,
                        double lat2,
                        double lon2)
Set the location for the link

Parameters:
lat1 - the latitude of the first location
lon1 - the longitude of the first location
lat2 - the latitude of the second location
lon2 - the longitude of the second location

setLocation

public void setLocation(int x1,
                        int y1,
                        int x2,
                        int y2)
Set new coordinates for this link.

Parameters:
x1 - the x coordinate of the first location
y1 - the y coordinate of the first location
x2 - the x coordinate of the second location
y2 - the y coordinate of the second location

setGraphicLocations

public void setGraphicLocations(double latitude,
                                double longitude)
Does nothing - marker handled in setLocation methods.

Specified by:
setGraphicLocations in class Location

setGraphicLocations

public void setGraphicLocations(int x,
                                int y)
Does nothing - marker handled in setLocation methods.

Specified by:
setGraphicLocations in class Location

setGraphicLocations

public void setGraphicLocations(double latitude,
                                double longitude,
                                int offsetX,
                                int offsetY)
Does nothing - marker handled in setLocation methods.

Specified by:
setGraphicLocations in class Location


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