Class MapMarker
- All Implemented Interfaces:
IContentData<MapMarkerProp>
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 Summary
Method Summary
Modifier and TypeMethodDescriptionvoid
addMappings
(VSMappings mappings, String uiRef, MapMarkerProp item) Adds the mappings of a VirtualSpace to the panel components.Returns the property that was used to update this data content.char
getLabel()
Gets the marker label character.Gets the marker label character text.double
Gets the latitude of the marker.double
Gets the longitude of the marker.Gets the map markers container.Gets the marker tooltip text.getVSRow()
Gets the associated VSRow for this item.void
initialize
(MapMarkerProp item) Initializes the item property from the content data.boolean
Gets the enabled state.boolean
Gets the read-only state.boolean
Gets the selection state of the item.boolean
Gets the visibility state.void
refreshFromVS
(int[] columns) Refreshes contents from VirtualSpace.boolean
setEnabled
(boolean newState) Sets the enabled state.boolean
setLabel
(char ch) Sets the marker label character.boolean
setLabelChar
(PlainKString text) Sets the marker label character.boolean
setLatitude
(double latitude) Sets the latitude of the marker.boolean
setLongitude
(double longitude) Sets the longitude of the marker.boolean
setReadOnly
(boolean newState) Sets the read-only state.setSelection
(boolean on) Sets the selection state of an item.setSelectionInternal
(boolean on) Internal method to sets the selection state of an item.boolean
setTooltipText
(PlainKString text) Sets the marker tooltip text.boolean
setVisible
(boolean newState) Sets the visibility state.void
Toggle the selected state of the map marker.toString()
Returns a String representation of the marker.
Constructor Details
MapMarker
public MapMarker()Constructor for API.MapMarker
Constructor for VS-connected content provider.
Method Details
refreshFromVS
public void refreshFromVS(int[] columns) Refreshes contents from VirtualSpace.- Specified by:
refreshFromVS
in interfaceIContentData<MapMarkerProp>
- Parameters:
columns
- The connected table columns.
getVSRow
Gets the associated VSRow for this item.- Specified by:
getVSRow
in interfaceIContentData<MapMarkerProp>
- Returns:
- The row, or null if not associated with VirtualSpace.
getItemProp
Returns the property that was used to update this data content.- Specified by:
getItemProp
in interfaceIContentData<MapMarkerProp>
- Returns:
- The property, or null if none is assigned.
getMarkers
Gets the map markers container.- Returns:
- The container, or null if not yet associated.
initialize
Initializes the item property from the content data.- Specified by:
initialize
in interfaceIContentData<MapMarkerProp>
- Parameters:
item
- The item.
toString
Returns a String representation of the marker.getTooltipText
Gets the marker tooltip text.- Returns:
- The tooltip text as a plain KString, null if not set.
setTooltipText
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
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
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 interfaceIContentData<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
Sets the selection state of an item.- Specified by:
setSelection
in interfaceIContentData<MapMarkerProp>
- Parameters:
on
- The new selection state.- Returns:
- null for success.
setSelectionInternal
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 interfaceIContentData<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
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 interfaceIContentData<MapMarkerProp>
- Parameters:
mappings
- The mappings instance to fill in.uiRef
- The reference.item
- The item property.