Class PointsLayer

java.lang.Object
com.codename1.maps.layers.AbstractLayer
com.codename1.maps.layers.PointsLayer
All Implemented Interfaces:
Layer, ActionSource

public class PointsLayer extends AbstractLayer implements ActionSource
This is a Points Layer
  • Field Summary

    Fields inherited from class AbstractLayer

    name, projection
    Modifier and Type
    Field
    Description
    protected final String
     
    protected Projection
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor with default projection Mercator.
    Constructor with custom projection and layer name.
    Constructor with default projection Mercator.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a listener to the Points Layer which will cause an event to dispatch on click the ActionEvent will contain the pressed PointLayer unprojected
    void
    Adds a point to the PointsLayer
    The bounding box of this Layer
    void
    Trigger an event for the points that in contained in the BoundingBox
    void
    paint(Graphics g, Tile tile)
    Paints the Layer on the given Graphics
    void
    Removes the given action listener Points Layer
    void
    Removes a point from the PointsLayer
    void
    Sets the Points icon

    Methods inherited from class AbstractLayer

    getName, getProjection
    Modifier and Type
    Method
    Description
    Gets the name of this Layer
    The projection of this Layer

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
     
    boolean
    Indicates whether some other object is "equal to" this one.
    final Class
    Returns the runtime class of an object.
    int
    Returns a hash code value for the object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    Returns a string representation of the object.
    final void
    Causes current thread to wait until another thread invokes the method or the method for this object.
    final void
    wait(long timeout)
    Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
    final void
    wait(long timeout, int nanos)
    Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
  • Constructor Details

    • PointsLayer

      public PointsLayer()
      Constructor with default projection Mercator.
    • PointsLayer

      public PointsLayer(String name)
      Constructor with default projection Mercator.
    • PointsLayer

      public PointsLayer(Projection p, String name)
      Constructor with custom projection and layer name.
  • Method Details

    • setPointIcon

      public void setPointIcon(Image icon)

      Sets the Points icon

      Parameters
      • icon
    • paint

      public void paint(Graphics g, Tile tile)

      Paints the Layer on the given Graphics

      Parameters
      • g: a Graphics Object to paint on

      • screenTile: the screen tile

      Specified by:
      paint in interface Layer
    • addPoint

      public void addPoint(PointLayer point)

      Adds a point to the PointsLayer

      Parameters
      • point: a point to add
    • removePoint

      public void removePoint(PointLayer point)

      Removes a point from the PointsLayer

      Parameters
      • point: to remove from the PointsLayer
    • boundingBox

      public BoundingBox boundingBox()

      The bounding box of this Layer

      Returns

      the Layer bounding box

      Specified by:
      boundingBox in interface Layer
      Specified by:
      boundingBox in class AbstractLayer
    • addActionListener

      public void addActionListener(ActionListener l)

      Adds a listener to the Points Layer which will cause an event to dispatch on click the ActionEvent will contain the pressed PointLayer unprojected

      Parameters
      • l: implementation of the action listener interface
      Specified by:
      addActionListener in interface ActionSource
    • removeActionListener

      public void removeActionListener(ActionListener l)

      Removes the given action listener Points Layer

      Parameters
      • l: implementation of the action listener interface
      Specified by:
      removeActionListener in interface ActionSource
    • fireActionEvent

      public void fireActionEvent(BoundingBox box)

      Trigger an event for the points that in contained in the BoundingBox

      Parameters
      • box: the BoundingBox to trigger event.