Class UIMap

All Implemented Interfaces:
EventListener, IFocusComp, IMessageBox, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIComp, IUICompRelativeTarget, IUIContainer, IUIContextMenuOwner, IUIFocusComp, IUILabelForTarget, IVSComponentListener, IVSComponentState, IVSFieldListener, IVSGenericComponentListener, Cloneable
Direct Known Subclasses:
EUIMap

public class UIMap extends UIContainer implements IUILabelForTarget
Map UI component.
Author:
Christopher Mindus
  • Constructor Details

    • UIMap

      public UIMap()
      Creates the component without a name. The name must be set in all cases using the setPropertyAtom call.
    • UIMap

      public UIMap(Atom propertyAtom)
      Creates the component with the specified name. All system-reserved names for components begins with "$".
      Parameters:
      propertyAtom - the name of the component, unique within it's parent.
    • UIMap

      public UIMap(Atom propertyAtom, GProp<?>[] newValue) throws PropException
      Creates the component with the specified name, initialized to contain the GProp items. All system-reserved names for components begins with "$".
      Parameters:
      propertyAtom - The name of the component, unique within it's parent.
      newValue - The array of all properties the component should have.
      Throws:
      PropException - when at least one of the properties to initialize the component with is invalid.
  • Method Details

    • getDeviceType

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

      public boolean isMobileContextMenuSupported()
      Returns if the component can show the context menu in mobile mode.
      Specified by:
      isMobileContextMenuSupported in interface IUIContextMenuOwner
      Overrides:
      isMobileContextMenuSupported in class UIContainer
      Returns:
      Map does not support a mobile context menu.
    • isEmptyContainerAllowed

      public boolean isEmptyContainerAllowed()
      Returns whether the container should have children in a normal conditions, i.e. a warning message should be displayed in the Designer when it is empty. This is intended to be used to avoid use of empty containers.
      Overrides:
      isEmptyContainerAllowed in class UIContainer
      Returns:
      true as the map container can do just fine without children.
    • hasImplicitAlignFillX

      public boolean hasImplicitAlignFillX()
      Returns if the component has implicit component horizontal fill.
      Overrides:
      hasImplicitAlignFillX in class UIContainer
      Returns:
      Always true: true means component will always fill the space in X.
    • hasImplicitAlignFillY

      public boolean hasImplicitAlignFillY()
      Returns if the component has implicit component vertical fill.
      Overrides:
      hasImplicitAlignFillY in class UIContainer
      Returns:
      Always: true means component will always fill the space in Y.
    • canAlignX

      public boolean canAlignX()
      Returns if the component can be aligned left, right, center, or horizontal fill.
      Overrides:
      canAlignX in class UIComp
      Returns:
      false, swap container takes up entire width.
    • canAlignY

      public boolean canAlignY()
      Returns if the component can be aligned top, bottom, middle or vertical fill.
      Overrides:
      canAlignY in class UIComp
      Returns:
      false, swap container takes up entire height.
    • convertLoadedProp

      protected GProp<?> convertLoadedProp(GProp<?> childProp) throws PropException
      Enables conversion or omission of a property loaded from XML.

      This method is typically used to process changes of e.g. property types, e.g. from IntProp to NumberProp, in case of a change of property definitions.

      Overrides:
      convertLoadedProp in class PropCnr
      Parameters:
      childProp - The child property that is about to be added.
      Returns:
      The property to add, null to omit it. The default processing is to return the same property, i.e. childProp.
      Throws:
      PropException - for property errors.
    • onEventSelf

      public void onEventSelf(GEvent event)
      Updates a VirtualSpace Field when a component text changes.
      Specified by:
      onEventSelf in interface IGProp<GProp<?>[]>
      Overrides:
      onEventSelf in class UIComp
      Parameters:
      event - The property event.
    • getBestVSFieldValueType

      public Value.Type getBestVSFieldValueType(VSRelativeReference<?> reference)
      Requests the value type that would best suit the listener.
      Specified by:
      getBestVSFieldValueType in interface IVSFieldListener
      Overrides:
      getBestVSFieldValueType in class UIComp
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      Returns:
      null if none is available.
    • onResolved

      public void onResolved(VSRelativeReference<?> reference, VSField field)
      Called when the property reference has been resolved. UI components use this method to set its state according to the field, this is handled in by the UIComp class.

      Components must override to provide the implementation for e.g. value contents, styles, etc.

      Specified by:
      onResolved in interface IVSFieldListener
      Overrides:
      onResolved in class UIComp
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      field - The target reference.
    • onValueChanged

      public void onValueChanged(VSField field, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)
      Called when the field value is set.
      Specified by:
      onValueChanged in interface IVSFieldListener
      Overrides:
      onValueChanged in class UIComp
      Parameters:
      field - The VS field.
      value - The value, never null, but value.isNull() could be true.
      trigger - The trigger property that may be null.
      postProcessing - Post-processing instance.
    • setVSFieldToComponent

      public void setVSFieldToComponent(VSField field)
      Method called when a VirtualSpace Field is resolved or when reconnection is done. Override to provide additional processing. By default all states (enabled, read-only and visible), message and field contents are set from the field to the component.
      Specified by:
      setVSFieldToComponent in interface IUIComp
      Overrides:
      setVSFieldToComponent in class UIComp
      Parameters:
      field - The VS field.
    • 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).
      Overrides:
      getApproximateSize in class UIContainer
      Returns:
      The size of the component: 200x200.
    • getFirstMarkersNull

      public MapMarkers getFirstMarkersNull()
      Gets the first markers group.
      Returns:
      The markers group, or null if not found.
    • getFirstMarkers

      public MapMarkers getFirstMarkers() throws NotFoundException
      Gets the first markers group.
      Returns:
      The markers group (never null).
      Throws:
      NotFoundException - If no markers groups are present.
    • getMarkersNull

      public MapMarkers getMarkersNull(String name)
      Gets the markers group by name.
      Parameters:
      name - The name of the marker group.
      Returns:
      The markers group, or null if not found.
    • getMarkers

      public MapMarkers getMarkers(String name) throws NotFoundException
      Gets the markers group by name.
      Parameters:
      name - The name of the marker group.
      Returns:
      The markers group (never null).
      Throws:
      NotFoundException - If markers group is not found.