## com.bbn.openmap.layer.location
Class Link

    java.lang.Object
      com.bbn.openmap.omGraphics.geom.BasicGeometry
          com.bbn.openmap.omGraphics.OMGraphic
              com.bbn.openmap.layer.location.Location
                  com.bbn.openmap.layer.location.Link

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

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
`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`

Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants

`ADD_GRAPHIC_MASK, 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, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, 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`

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.OMGraphic

`clone, deselect, getDeclutterType, getDescription, getDescription, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShape, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, shouldRenderFill`

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

### lat2

    public float lat2

  The lat of point 2.

### lon2

    public float 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 contructor if you are planning on setting everything yourself.

### 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)

  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
  `paint` - 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_RHUMB

### Link

    public 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

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
  `paint` - the link's displayed edge java.awt.Paint (Color).
  `dashed` - Is it a dashed line?
  `thickness` - The line thickness.

Method Detail

### setLinkDrawingParameters

    public void setLinkDrawingParameters(OMLine link,
                                         java.awt.Paint paint,
                                         float thickness,
                                         boolean dashed)

  Set the drawing attributes of the link

  Parameters:
    `link` - the line used for the link
    `paint` - the line color
    `thickness` - the thickness of the line
    `dashed` - true if the line should be dashed

### setLocation

    public void setLocation(float lat1,
                            float lon1,
                            float lat2,
                            float 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(float latitude,
                                    float 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(float latitude,
                                    float longitude,
                                    int offsetX,
                                    int offsetY)

  Does nothing - marker handled in setLocation methods.

  Specified by:
    `setGraphicLocations` in class `Location`

### setLinkColor

    public void setLinkColor(java.awt.Paint linkPaint)

### setShowLink

    public void setShowLink(boolean showLinks)

### isShowLink

    public boolean isShowLink()

### getLink

    public OMLine getLink()

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