Class AbstractMenu

    • Constructor Detail

      • AbstractMenu

        public AbstractMenu​(InfoModel infoModel,
                            ActionModel actionModel,
                            Enableable enableable,
                            MenuLayout layout)
        Info model, action model, enableable, and menu layout constructor.
        Parameters:
        infoModel - The component info model.
        actionModel - The component action model.
        enableable - The enableable object in which to store enabled status.
        layout - The layout definition for the container.
        Throws:
        java.lang.NullPointerException - if the given info model, action model, enableable, and/or layout is null.
    • Method Detail

      • getActionModel

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

        public boolean isOpen()
        Specified by:
        isOpen in interface Menu
        Returns:
        Whether the menu is open.
      • setOpen

        public void setOpen​(boolean newOpen)
        Description copied from interface: Menu
        Sets whether the menu is open. This is a bound property of type Boolean.
        Specified by:
        setOpen in interface Menu
        Parameters:
        newOpen - true if the menu should be open.
        See Also:
        Menu.OPEN_PROPERTY
      • 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
      • isRolloverOpenEnabled

        public boolean isRolloverOpenEnabled()
        Specified by:
        isRolloverOpenEnabled in interface Menu
        Returns:
        Whether the menu children will be shown during rollover.
      • setRolloverOpenEnabled

        public void setRolloverOpenEnabled​(boolean newRolloverOpenEnabled)
        Description copied from interface: Menu
        Sets whether the menu children will be shown during rollover. If rollover open is enabled, the open state will not actually be changed during rollover. This is a bound property of type Boolean.
        Specified by:
        setRolloverOpenEnabled in interface Menu
        Parameters:
        newRolloverOpenEnabled - true if the component should allow display during rollover, else false.
        See Also:
        Menu.ROLLOVER_OPEN_ENABLED_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.
      • addComponent

        protected void addComponent​(int index,
                                    Component childComponent)
        Description copied from class: AbstractListCompositeComponent
        Adds a child component at the specified index. This version adds the component to the component list. Any class that overrides this method must call this version.
        Overrides:
        addComponent in class AbstractLayoutComponent
        Parameters:
        index - The index at which the component should be added.
        childComponent - The component to add to this component.