Class MapMarker

java.lang.Object
com.iizix.prop.ui.map.MapMarker
All Implemented Interfaces:
IContentData<MapMarkerProp>

public class MapMarker extends Object implements IContentData<MapMarkerProp>
The marker for the map consists of a location, text and attributes.

Markers can be placed on a map by means of either API directory against the map component or in the VirtualSpace by means of connections to the map.

A marker that is enabled and not read-only can be dragged on a map if the markers settings allows draggable markers.

Author:
Christopher Mindus
  • Constructor Details Link icon

    • MapMarker Link icon

      public MapMarker()
      Constructor for API.
    • MapMarker Link icon

      protected MapMarker(VSRow row)
      Constructor for VS-connected content provider.
  • Method Details Link icon

    • refreshFromVS Link icon

      public void refreshFromVS(int[] columns)
      Refreshes contents from VirtualSpace.
      Specified by:
      refreshFromVS in interface IContentData<MapMarkerProp>
      Parameters:
      columns - The connected table columns.
    • getVSRow Link icon

      public VSRow getVSRow()
      Gets the associated VSRow for this item.
      Specified by:
      getVSRow in interface IContentData<MapMarkerProp>
      Returns:
      The row, or null if not associated with VirtualSpace.
    • getItemProp Link icon

      public MapMarkerProp getItemProp()
      Returns the property that was used to update this data content.
      Specified by:
      getItemProp in interface IContentData<MapMarkerProp>
      Returns:
      The property, or null if none is assigned.
    • getMarkers Link icon

      public MapMarkers getMarkers()
      Gets the map markers container.
      Returns:
      The container, or null if not yet associated.
    • initialize Link icon

      public void initialize(MapMarkerProp item)
      Initializes the item property from the content data.
      Specified by:
      initialize in interface IContentData<MapMarkerProp>
      Parameters:
      item - The item.
    • toString Link icon

      public String toString()
      Returns a String representation of the marker.
      Overrides:
      toString in class Object
      Returns:
      String as "latitude=nn,longitude=nn,label=xxx,tooltip=yyy".
    • getTooltipText Link icon

      public PlainKString getTooltipText()
      Gets the marker tooltip text.
      Returns:
      The tooltip text as a plain KString, null if not set.
    • setTooltipText Link icon

      public boolean setTooltipText(PlainKString text)
      Sets the marker tooltip text.
      Parameters:
      text - The text, or null for none.
      Returns:
      true for changed, false for no change.
    • getLabel Link icon

      public char getLabel()
      Gets the marker label character.
      Returns:
      The label character, '\0' if not set.
    • getLabelChar Link icon

      public PlainKString getLabelChar()
      Gets the marker label character text.
      Returns:
      The label character, null if not set.
    • setLabel Link icon

      public boolean setLabel(char ch)
      Sets the marker label character.
      Parameters:
      ch - The character, or '\0' for none.
      Returns:
      true for changed, false for no change.
    • setLabelChar Link icon

      public boolean setLabelChar(PlainKString text)
      Sets the marker label character.
      Parameters:
      text - The text, or null for none. Only the first character is used.
      Returns:
      true for changed, false for no change.
    • getLatitude Link icon

      public double getLatitude()
      Gets the latitude of the marker.
      Returns:
      The latitude -90 to 90, initialized by default to zero.
    • setLatitude Link icon

      public boolean setLatitude(double latitude)
      Sets the latitude of the marker.

      For reference, the Equator has a latitude of 0°, the North pole has a latitude of 90° north (written 90° N or +90°), and the South pole has a latitude of -90°. Prime Meridian has a longitude of 0° that goes through Greenwich, England.

      Parameters:
      latitude - The latitude.
      Returns:
      true if changed, false for no change.
      Throws:
      IllegalArgumentException - If the latitude is not -90 to 90 degrees.
    • getLongitude Link icon

      public double getLongitude()
      Gets the longitude of the marker.
      Returns:
      The longitude -180 to 180, initialized by default to zero.
    • setLongitude Link icon

      public boolean setLongitude(double longitude)
      Sets the longitude of the marker.

      Longitude is in the range -180 and +180 specifying the east-west position. For reference, the Equator has a latitude of 0°, the North pole has a latitude of 90° north (written 90° N or +90°), and the South pole has a latitude of -90°. Prime Meridian has a longitude of 0° that goes through Greenwich, England.

      Parameters:
      longitude - The longitude.
      Returns:
      true if changed, false for no change.
      Throws:
      IllegalArgumentException - If the longitude is not -180 to 180 degrees.
    • isVisible Link icon

      public boolean isVisible()
      Gets the visibility state.

      This is the items individual state and does not take parent states into account.

      Returns:
      true for visible, false for hidden.
    • isEnabled Link icon

      public boolean isEnabled()
      Gets the enabled state.

      This is the items individual state and does not take parent states into account.

      Returns:
      true for enabled, false for disabled.
    • isReadOnly Link icon

      public boolean isReadOnly()
      Gets the read-only state.

      This is the items individual state and does not take parent states into account.

      Returns:
      true for read-only, false otherwise.
    • isSelected Link icon

      public boolean isSelected()
      Gets the selection state of the item.
      Specified by:
      isSelected in interface IContentData<MapMarkerProp>
      Returns:
      The selected state.
    • setVisible Link icon

      public boolean setVisible(boolean newState)
      Sets the visibility state.

      This is the items individual state and does not take parent states into account.

      Parameters:
      newState - the new state: true for visible, false for hidden.
      Returns:
      true for changed state, false for no change.
    • setEnabled Link icon

      public boolean setEnabled(boolean newState)
      Sets the enabled state.

      This is the items individual state and does not take parent states into account.

      Parameters:
      newState - The new state: true for enabled, false for disabled.
    • setReadOnly Link icon

      public boolean setReadOnly(boolean newState)
      Sets the read-only state.

      This is the items individual state and does not take parent states into account.

      Parameters:
      newState - The new state: true for read-only, false otherwise.
    • setSelection Link icon

      public String setSelection(boolean on)
      Sets the selection state of an item.
      Specified by:
      setSelection in interface IContentData<MapMarkerProp>
      Parameters:
      on - The new selection state.
      Returns:
      null for success.
    • setSelectionInternal Link icon

      public String setSelectionInternal(boolean on)
      Internal method to sets the selection state of an item. This method is not intended to be called as it is used by the framework and will not cause a callback or event notification of selection changes.
      Specified by:
      setSelectionInternal in interface IContentData<MapMarkerProp>
      Parameters:
      on - The new selection state.
      Returns:
      null for success, empty string for no change.
    • toggleSelection Link icon

      public void toggleSelection()
      Toggle the selected state of the map marker.
    • addMappings Link icon

      public void addMappings(VSMappings mappings, String uiRef, MapMarkerProp item)
      Adds the mappings of a VirtualSpace to the panel components.

      The default is to find the relative references to VS and add those references. Override to provide other functionality.

      Specified by:
      addMappings in interface IContentData<MapMarkerProp>
      Parameters:
      mappings - The mappings instance to fill in.
      uiRef - The reference.
      item - The item property.