Class 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
    Adapted MapRectangleImpl class.
    Author:
    Vincent (original code: MapRectangleImpl), FracPete (fracpete at waikato dot ac dot nz)
    • 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 interface org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle
      • getBottomRight

        public org.openstreetmap.gui.jmapviewer.Coordinate getBottomRight()
        Specified by:
        getBottomRight in interface org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle
      • paint

        public void paint​(Graphics g,
                          Point topLeft,
                          Point bottomRight)
        Specified by:
        paint in interface org.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 interface HitIndicator
        Parameters:
        viewer - the underlying viewer that triggered the call
        coord - the coordinate to check
        Returns:
        true if the mapobject is "hit" by this coordinate