Class ImageActionControl

    • Constructor Detail

      • ImageActionControl

        public ImageActionControl()
        Default constructor.
      • ImageActionControl

        public ImageActionControl​(ImageModel imageModel)
        Image model constructor.
        Parameters:
        imageModel - The component image model.
      • ImageActionControl

        public ImageActionControl​(InfoModel infoModel,
                                  ImageModel imageModel,
                                  ActionModel actionModel,
                                  Enableable enableable)
        Info model, image model, action model, and enableable object constructor.
        Parameters:
        infoModel - The component info model.
        imageModel - The component image model.
        actionModel - The component action model.
        enableable - The enableable object in which to store enabled status.
        Throws:
        java.lang.NullPointerException - if the given info model, image model, action model, and/or enableable object is null.
      • ImageActionControl

        public ImageActionControl​(ActionPrototype actionPrototype)
        Prototype constructor.
        Parameters:
        actionPrototype - The prototype on which this component should be based.
        Throws:
        java.lang.NullPointerException - if the given prototype is null.
    • Method Detail

      • getActionModel

        protected ActionModel getActionModel()
        Returns:
        The action model used by this component.
      • getEnableable

        protected Enableable getEnableable()
        Returns:
        The enableable object decorated by this component.
      • isRollover

        public boolean isRollover()
        Specified by:
        isRollover in interface ActionControl
        Returns:
        Whether the component is in a rollover state.
      • setRollover

        public void setRollover​(boolean newRollover)
        Description copied from interface: ActionControl
        Sets whether the component is in a rollover state. This is a bound property of type Boolean.
        Specified by:
        setRollover in interface ActionControl
        Parameters:
        newRollover - true if the component should be in a rollover state, else false.
        See Also:
        ActionControl.ROLLOVER_PROPERTY
      • getStatus

        public Control.Status getStatus()
        Specified by:
        getStatus in interface Control
        Returns:
        The status of the current user input, or null if there is no status to report.
      • setStatus

        protected void setStatus​(Control.Status newStatus)
        Sets the status of the current user input. This is a bound property.
        Parameters:
        newStatus - The new status of the current user input, or null if there is no status to report.
        See Also:
        Control.STATUS_PROPERTY
      • updateStatus

        protected void updateStatus()
        Rechecks user input status of this component, and updates the status.
        See Also:
        setStatus(Control.Status)
      • updateValid

        protected void updateValid()
        Rechecks user input validity of this component and all child components, and updates the valid state. This implementation only updates the valid property if the property is already initialized or there is at least one listener to the Component.VALID_PROPERTY.

        This version also updates the status.

        Overrides:
        updateValid in class AbstractComponent
        See Also:
        updateStatus()
      • setNotification

        public void setNotification​(Notification newNotification)
        Description copied from interface: Component
        Sets the component notification. This is a bound property. The notification is also fired as a NotificationEvent on this component if a new notification is given. Parents are expected to refire the notification event up the hierarchy.
        Specified by:
        setNotification in interface Component
        Overrides:
        setNotification in class AbstractComponent
        Parameters:
        newNotification - The notification for the component, or null if no notification is associated with this component.
        See Also:
        Component.NOTIFICATION_PROPERTY
      • performAction

        public void performAction​(int force,
                                  int option)
        Description copied from interface: ActionModel
        Performs the action with the given force and option. An ActionEvent is fired to all registered ActionListeners.
        Specified by:
        performAction in interface ActionModel
        Parameters:
        force - The zero-based force, such as 0 for no force or 1 for an action initiated by from a mouse single click.
        option - The zero-based option, such as 0 for an event initiated by a mouse left button click or 1 for an event initiated by a mouse right button click.
      • fireActionPerformed

        protected void fireActionPerformed​(int force,
                                           int option)
        Fires an action event to all registered action listeners. This method delegates to fireActionPerformed(ActionEvent).
        Parameters:
        force - The zero-based force, such as 0 for no force or 1 for an action initiated by from a mouse single click.
        option - The zero-based option, such as 0 for an event initiated by a mouse left button click or 1 for an event initiaged by a mouse right button click.
        See Also:
        ActionListener, ActionEvent
      • fireActionPerformed

        protected void fireActionPerformed​(ActionEvent actionEvent)
        Fires a given action event to all registered action listeners.
        Parameters:
        actionEvent - The action event to fire.
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface Enableable
        Returns:
        Whether the object is enabled and can receive user input.
      • setEnabled

        public void setEnabled​(boolean newEnabled)
        Description copied from interface: Enableable
        Sets whether the object is enabled and can receive user input. This is a bound property of type Boolean.
        Specified by:
        setEnabled in interface Enableable
        Parameters:
        newEnabled - true if the object should indicate and accept user input.
        See Also:
        Enableable.ENABLED_PROPERTY