Class MapMarkerProp

All Implemented Interfaces:
EventListener, IMessageBox, IComponent, IContentItem, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IPropEditorReadOnly, IUIComp, IUIBooleanSelectionComp, IUISelectionComp, IVSComponentListener, IVSComponentState, IVSFieldListener, Cloneable
Direct Known Subclasses:
EMapMarkerProp

public class MapMarkerProp extends UIComp implements IContentItem, IUIBooleanSelectionComp
The property container for map markers.
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • MapMarkerProp

      public MapMarkerProp()
      Constructor of the marker property without name.
    • MapMarkerProp

      public MapMarkerProp(Atom atom)
      Constructor of the marker property.
      Parameters:
      atom - The name of this property.
  • Method Details

    • setContentItem

      public void setContentItem(IContentData<?> itemData)
      Returns the content item that has initialized this property container.
      Specified by:
      setContentItem in interface IContentItem
      Parameters:
      itemData - Sets the content item that has updated this property container.
    • getItemsContainer

      public MapMarkers getItemsContainer()
      Returns the container for the items.
      Specified by:
      getItemsContainer in interface IContentItem
      Returns:
      The container, or null if not found.
    • getContentItem

      public MapMarker getContentItem(boolean createIfNotPresent)
      Returns the content item that has initialized this property container. If it has not been initialized, it will be initialized with this call if the flag createIfNotPresent is true.
      Specified by:
      getContentItem in interface IContentItem
      Parameters:
      createIfNotPresent - Creates the content data if it doesn't exist if true.
      Returns:
      The content item, null if not previously initialized if createIfNotPresent is false.
    • getDeviceType

      public final int getDeviceType()
      Gets the device type: -1=mobile, 0=both, 1=desktop.
      Specified by:
      getDeviceType in interface IUIComp
    • getApproximateSize

      public Size getApproximateSize()
      Returns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method. The size is calculated from the font of the component and default or defined values (such as character length or number of lines for text area).
      Specified by:
      getApproximateSize in class UIComp
      Returns:
      The size of the component.
      Throws:
      IllegalStateException - If called outside of the Designer, e.g. from the Server.
    • getMarkers

      public MapMarkers getMarkers()
      Gets the map markers container.
      Returns:
      The map markers container, or null if marker is orphaned.
    • getMap

      public UIMap getMap()
      Gets the map associated with the marker.
      Returns:
      The map, or null if marker or markers container is orphaned.
    • clone

      public MapMarkerProp clone()
      Clones the property.
      Overrides:
      clone in class UIComp
      Returns:
      The clone.
    • onRemoteEvent

      public void onRemoteEvent(RemoteEvent event)
      Called when a remote property event should be processed by this property.
      Specified by:
      onRemoteEvent in interface IGProp<GProp<?>[]>
      Overrides:
      onRemoteEvent in class UIComp
      Parameters:
      event - The remote event.
    • addMappings

      protected void addMappings(VSMappings mappings, VSComponent vsStateFocus)
      Gets 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.

      Overrides:
      addMappings in class UIComp
      Parameters:
      mappings - The mappings instance to fill in.
      vsStateFocus - Do not go past this component when going up in the parent tree, null for none.
    • triggerRemoteSelectionEvent

      protected void triggerRemoteSelectionEvent(boolean isSelected)
      Sends the selection property to the connected clients.
      Parameters:
      isSelected -
    • isSelected

      public boolean isSelected()
      Returns the selection state.
      Specified by:
      isSelected in interface IUIBooleanSelectionComp
      Specified by:
      isSelected in interface IUISelectionComp
      Returns:
      true if selected, false if unselected.
    • isUnselected

      public boolean isUnselected()
      Returns if the selection is not set.
      Specified by:
      isUnselected in interface IUIBooleanSelectionComp
      Returns:
      true if unselected, false if selected.
    • isON

      public boolean isON()
      Returns if the selection is "on".
      Specified by:
      isON in interface IUIBooleanSelectionComp
      Returns:
      true if on, false if off.
    • isOFF

      public boolean isOFF()
      Returns if the selection is "off".
      Specified by:
      isOFF in interface IUIBooleanSelectionComp
      Returns:
      true if off, false if on.
    • setSelection

      public boolean setSelection(boolean isSelected)
      Sets the selection.
      Specified by:
      setSelection in interface IUIBooleanSelectionComp
      Parameters:
      isSelected - The selected state.
      Returns:
      true if state is changed, false for no change.
    • getSelectionPropAtom

      public Atom getSelectionPropAtom()
      Returns the selection property atom for verification of selection changes.

      This method is used by the framework in UIComp to fire selection events when the property value changes.

      Specified by:
      getSelectionPropAtom in interface IUISelectionComp
      Returns:
      Atom.SELECTED.
    • getSelectionListenerHandler

      public GenericListener<IUISelectionListener> getSelectionListenerHandler(boolean doCreate)
      Returns the generic selection listener.
      Specified by:
      getSelectionListenerHandler in interface IUISelectionComp
      Parameters:
      doCreate - Create the listener handler if it doesn't exist, false not to.
      Returns:
      The selection listener handler, or null if not created.
    • getSelectionType

      public int getSelectionType()
      Gets the selection type of the component.

      This method forwards the selection type to the map markers.

      Specified by:
      getSelectionType in interface IUISelectionComp
      Returns:
      A value indicating the selection capability as the SELECTION_TYPE_* values.
    • isSelectionBooleanBased

      public boolean isSelectionBooleanBased()
      Returns if the selection component supports index-based selection.
      Specified by:
      isSelectionBooleanBased in interface IUIBooleanSelectionComp
      Specified by:
      isSelectionBooleanBased in interface IUISelectionComp
      Returns:
      true.
    • isSelectionTriStateBased

      public boolean isSelectionTriStateBased()
      Returns if the selection component supports index-based selection.
      Specified by:
      isSelectionTriStateBased in interface IUISelectionComp
      Returns:
      false.
    • isSelectionIndexBased

      public boolean isSelectionIndexBased()
      Returns if the selection component supports index-based selection.
      Specified by:
      isSelectionIndexBased in interface IUISelectionComp
      Returns:
      false.
    • isSelectionCellBased

      public boolean isSelectionCellBased()
      Returns if the selection component supports is cell based.
      Specified by:
      isSelectionCellBased in interface IUISelectionComp
      Returns:
      false.
    • getSelection

      public IUISelection getSelection()
      Gets the current selection of the component.
      Specified by:
      getSelection in interface IUISelectionComp
      Returns:
      The current selection of the component.
    • getOnUISelectionMethod

      public Method getOnUISelectionMethod()
      Returns the method to use for onUISelection notifications that is attached to this selection component. The method name is not important, but must have the annotation and signature:

      @OnUISelection(name = "some/property")
      public void onUISelection(UISelectionEvent event)

      Specified by:
      getOnUISelectionMethod in interface IUISelectionComp
      Returns:
      The method, or null if none is registered.
    • onSelectionChanged

      protected void onSelectionChanged(GEvent event)
      Method called when the selection of the component changed due to a property change (value changed, property added or removed).
      Overrides:
      onSelectionChanged in class UIComp
      Parameters:
      event - The event that causes the selection change.
    • onNotifySelectionChanged

      protected void onNotifySelectionChanged(GEvent event)
      Method called when the selection of the component has changed and has been verified to be different from a previous selection. Subclasses can override this method to inform potential listeners.
      Overrides:
      onNotifySelectionChanged in class UIComp
      Parameters:
      event - The event that causes the selection change, COULD BE NULL!
    • onPrepare

      protected void onPrepare(IAppOwner appOwner, IModuleOwner moduleOwner, boolean isPostCall, List<Throwable> errors) throws PropException
      Called when the application is being prepared. The order of onPrepare calls is always parent first, the children. The method is called twice, first time with isPostCall set to false, then a second time with true.
      Overrides:
      onPrepare in class UIComp
      Parameters:
      appOwner - The application owner.
      moduleOwner - The Module owner.
      isPostCall - Flag indicating this is a post-call.
      errors - A list of errors that occurred but did not cause an abort.
      Throws:
      PropException - For property errors during the application preparation to need to abort.