Class AbstractActionPrototype

    • Constructor Detail

      • AbstractActionPrototype

        public AbstractActionPrototype()
        Default constructor.
      • AbstractActionPrototype

        public AbstractActionPrototype​(java.lang.String label)
        Label constructor.
        Parameters:
        label - The text of the label, or null if there should be no label.
      • AbstractActionPrototype

        public AbstractActionPrototype​(java.lang.String label,
                                       java.net.URI icon)
        Label and icon constructor.
        Parameters:
        label - The text of the label, or null if there should be no label.
        icon - The icon URI, which may be a resource URI, or null if there is no icon URI.
    • Method Detail

      • 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.
      • action

        protected abstract void action​(int force,
                                       int option)
        Performs whatever is necessary. This method is guaranteed to be called before any action event is fired to any listeners.
        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.
      • 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.