Package adams.data.mapobject
Class SimpleMapRectangle
- java.lang.Object
-
- adams.data.mapobject.AbstractMapObject
-
- adams.data.mapobject.SimpleMapRectangle
-
- All Implemented Interfaces:
adams.core.MetaDataSupporter
,HitIndicator
,MetaDataSupporter
,TimestampSupporter
,org.openstreetmap.gui.jmapviewer.interfaces.MapObject
,org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle
public class SimpleMapRectangle extends AbstractMapObject implements org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle, HitIndicator
AdaptedMapRectangleImpl
class.- Author:
- Vincent (original code:
MapRectangleImpl
), FracPete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description SimpleMapRectangle(String name, org.openstreetmap.gui.jmapviewer.Coordinate topLeft, org.openstreetmap.gui.jmapviewer.Coordinate bottomRight)
SimpleMapRectangle(org.openstreetmap.gui.jmapviewer.Coordinate topLeft, org.openstreetmap.gui.jmapviewer.Coordinate bottomRight)
SimpleMapRectangle(org.openstreetmap.gui.jmapviewer.Layer layer, String name, org.openstreetmap.gui.jmapviewer.Coordinate topLeft, org.openstreetmap.gui.jmapviewer.Coordinate bottomRight)
SimpleMapRectangle(org.openstreetmap.gui.jmapviewer.Layer layer, String name, org.openstreetmap.gui.jmapviewer.Coordinate topLeft, org.openstreetmap.gui.jmapviewer.Coordinate bottomRight, org.openstreetmap.gui.jmapviewer.Style style)
SimpleMapRectangle(org.openstreetmap.gui.jmapviewer.Layer layer, org.openstreetmap.gui.jmapviewer.Coordinate topLeft, org.openstreetmap.gui.jmapviewer.Coordinate bottomRight)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openstreetmap.gui.jmapviewer.Coordinate
getBottomRight()
static org.openstreetmap.gui.jmapviewer.Style
getDefaultStyle()
org.openstreetmap.gui.jmapviewer.Coordinate
getTopLeft()
boolean
isHit(org.openstreetmap.gui.jmapviewer.JMapViewer viewer, org.openstreetmap.gui.jmapviewer.Coordinate coord)
Checks whether the given coordinate is a hit for a specific mapobject.void
paint(Graphics g, Point topLeft, Point bottomRight)
String
toString()
-
Methods inherited from class adams.data.mapobject.AbstractMapObject
addMetaData, getBackColor, getColor, getDefaultFont, getFont, getLayer, getMetaData, getMetaData, getName, getStroke, getStyle, getStyleAssigned, getTimestamp, isVisible, metaDataKeys, paintText, removeMetaData, setBackColor, setColor, setFont, setLayer, setName, setStroke, setStyle, setTimestamp, setVisible
-
-
-
-
Constructor Detail
-
SimpleMapRectangle
public SimpleMapRectangle(org.openstreetmap.gui.jmapviewer.Coordinate topLeft, org.openstreetmap.gui.jmapviewer.Coordinate bottomRight)
-
SimpleMapRectangle
public SimpleMapRectangle(String name, org.openstreetmap.gui.jmapviewer.Coordinate topLeft, org.openstreetmap.gui.jmapviewer.Coordinate bottomRight)
-
SimpleMapRectangle
public SimpleMapRectangle(org.openstreetmap.gui.jmapviewer.Layer layer, org.openstreetmap.gui.jmapviewer.Coordinate topLeft, org.openstreetmap.gui.jmapviewer.Coordinate bottomRight)
-
SimpleMapRectangle
public SimpleMapRectangle(org.openstreetmap.gui.jmapviewer.Layer layer, String name, org.openstreetmap.gui.jmapviewer.Coordinate topLeft, org.openstreetmap.gui.jmapviewer.Coordinate bottomRight)
-
SimpleMapRectangle
public SimpleMapRectangle(org.openstreetmap.gui.jmapviewer.Layer layer, String name, org.openstreetmap.gui.jmapviewer.Coordinate topLeft, org.openstreetmap.gui.jmapviewer.Coordinate bottomRight, org.openstreetmap.gui.jmapviewer.Style style)
-
-
Method Detail
-
getTopLeft
public org.openstreetmap.gui.jmapviewer.Coordinate getTopLeft()
- Specified by:
getTopLeft
in interfaceorg.openstreetmap.gui.jmapviewer.interfaces.MapRectangle
-
getBottomRight
public org.openstreetmap.gui.jmapviewer.Coordinate getBottomRight()
- Specified by:
getBottomRight
in interfaceorg.openstreetmap.gui.jmapviewer.interfaces.MapRectangle
-
paint
public void paint(Graphics g, Point topLeft, Point bottomRight)
- Specified by:
paint
in interfaceorg.openstreetmap.gui.jmapviewer.interfaces.MapRectangle
-
getDefaultStyle
public static org.openstreetmap.gui.jmapviewer.Style getDefaultStyle()
-
isHit
public boolean isHit(org.openstreetmap.gui.jmapviewer.JMapViewer viewer, org.openstreetmap.gui.jmapviewer.Coordinate coord)
Checks whether the given coordinate is a hit for a specific mapobject.- Specified by:
isHit
in interfaceHitIndicator
- Parameters:
viewer
- the underlying viewer that triggered the callcoord
- the coordinate to check- Returns:
- true if the mapobject is "hit" by this coordinate
-
-