Class UIProgress

All Implemented Interfaces:
EventListener, IMessageBox, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIComp, IUIContextMenuOwner, IUIDoubleRangeValueComponent, IUIDoubleValueComponent, IUIValueComponent, IVSComponentListener, IVSComponentState, IVSFieldListener, Cloneable
Direct Known Subclasses:
EUIProgress

public class UIProgress extends UIComp implements IUIDoubleRangeValueComponent, IUIContextMenuOwner
Progress UI component.
Author:
Christopher Mindus
  • Constructor Details

    • UIProgress

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

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

      public UIProgress(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
      Returns:
      0=both.
    • isMobileContextMenuSupported

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

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

      public boolean canFillY()
      Returns if the component can fill in Y or not.
      Overrides:
      canFillY in class UIComp
      Returns:
      Always false, progress cannot be filled 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.
    • setComponentToVSField

      public int setComponentToVSField()
      Sets the text or value from this text or value component to its VirtualSpace Field, if any.
      Specified by:
      setComponentToVSField in interface IUIComp
      Overrides:
      setComponentToVSField in class UIComp
      Returns:
      1 for update completed, 0 for nothing done and -1 for error occurred.
    • 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.
    • canRequestFocus

      public String canRequestFocus()
      Returns if this component can receive focus. Focus capable components may override to return null for success, or other error message.
      Specified by:
      canRequestFocus in interface IPropCnr
      Overrides:
      canRequestFocus in class UIComp
      Returns:
      "Progress not focusable" always.
    • couldRequestFocusIfVirtualized

      public String couldRequestFocusIfVirtualized(boolean ignoreStates)
      Returns if this component could receive focus if it would be virtualized. Focus capable components may override to return null for success, or other error message.
      Specified by:
      couldRequestFocusIfVirtualized in interface IPropCnr
      Parameters:
      ignoreStates - Flag indicating that states should be ignored, such as visible or enabled. If false, hidden or disabled components return an error message.
      Returns:
      "Progress not focusable" always.
    • setRange

      public boolean setRange(double minValue, double maxValue) throws IllegalArgumentException
      Sets the value range without affecting the value. The current value may therefore be outside the range due to this call.
      Specified by:
      setRange in interface IUIDoubleRangeValueComponent
      Parameters:
      minValue - The minimum value (cannot be (re-)set to other than zero).
      maxValue - The minimum value.
      Returns:
      true if any of the values changed, false for no changes.
      Throws:
      IllegalArgumentException - If the minimum is larger than maximum or the value range is outside.
    • setValueAndRange

      public boolean setValueAndRange(double value, double minValue, double maxValue) throws IllegalArgumentException
      Sets the value and range at once.
      Specified by:
      setValueAndRange in interface IUIDoubleRangeValueComponent
      Parameters:
      value - The value.
      minValue - The minimum value (cannot be (re-)set to other than to zero).
      maxValue - The minimum value.
      Returns:
      true if any of the values changed, false for no changes.
      Throws:
      IllegalArgumentException - If the minimum is larger than maximum or the value range is outside.
    • getMinimumDefault

      public double getMinimumDefault()
      Gets the default minimum value.
      Specified by:
      getMinimumDefault in interface IUIDoubleRangeValueComponent
      Returns:
      Zero, the default minimum value.
    • getMinimum

      public double getMinimum()
      Gets the minimum value.
      Specified by:
      getMinimum in interface IUIDoubleRangeValueComponent
      Returns:
      Zero, the minimum value.
    • setMinimum

      public boolean setMinimum(double minValue) throws IllegalArgumentException
      Sets the minimum value without changing the current value. The current value may therefore be outside the range due to this call.
      Specified by:
      setMinimum in interface IUIDoubleRangeValueComponent
      Parameters:
      minValue - The minimum value (cannot be (re-)set to other than to zero).
      Returns:
      true if the value was changed, false for no change.
      Throws:
      IllegalArgumentException - If the minimum is larger than maximum.
    • getMaximumDefault

      public double getMaximumDefault()
      Gets the default maximum value.
      Specified by:
      getMaximumDefault in interface IUIDoubleRangeValueComponent
      Returns:
      100, the default maximum value.
    • getDefaultValue

      public double getDefaultValue()
      Gets the default value of the component as a double.
      Specified by:
      getDefaultValue in interface IUIDoubleValueComponent
      Returns:
      Zero, the default double value of the component.
    • 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: 0x0 (none).