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

    • MapMarker

      public MapMarker()
      Constructor for API.
    • MapMarker

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

    • refreshFromVS

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

      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

      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

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

      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

      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

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

      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

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

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

      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

      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

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

      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

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

      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

      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

      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

      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

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

      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

      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

      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

      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

      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

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

      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.