Class UIImage

All Implemented Interfaces:
IBackReferenceProvider, EventListener, IFocusComp, ILockUI, IMessageBox, IUIPanelAnimation, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIAction, IUIActionHolder, IUIComp, IUIContextMenuOwner, IUIFocusComp, IVSActionListener, IVSComponentListener, IVSComponentState, IVSFieldListener, Cloneable
Direct Known Subclasses:
EUIImage

public class UIImage extends AbstractUIAction implements IUIFocusComp, IUIContextMenuOwner
Image UI component.
Author:
Christopher Mindus
  • Constructor Details

    • UIImage

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

      public UIImage(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.
    • UIImage

      public UIImage(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
    • isMobileContextMenuSupported

      public boolean isMobileContextMenuSupported()
      Returns if the component can show the context menu in mobile mode.
      Specified by:
      isMobileContextMenuSupported in interface IUIContextMenuOwner
      Returns:
      Image component supports context menus for mobile.
    • getPredefinedProps

      public void getPredefinedProps()
      Gets the references to predefined properties. If the Styles is created, make sure to get it.
      Overrides:
      getPredefinedProps in class UIComp
    • onEventSelf

      public void onEventSelf(GEvent event)
      Self events.
      Specified by:
      onEventSelf in interface IGProp<GProp<?>[]>
      Overrides:
      onEventSelf in class UIComp
      Parameters:
      event - The event.
    • 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 image and when no image is set 64x64.
    • getImageReference

      public ImageReference getImageReference()
      Gets the image reference property.
      Returns:
      An image reference, null for none.
    • getImage

      public IImageTarget getImage()
      Gets the image.
      Returns:
      An image, null for none.
    • setImage

      public boolean setImage(IImageTarget image)
      Sets the image.
      Parameters:
      image - The image, null for none.
      Returns:
      true for changed, false for no change.