All Superinterfaces:
Action, ActionListener, EventListener
All Known Subinterfaces:
Controls, ToggleControl

public interface Control extends Action
A beefed up Action.
  • Field Details

  • Method Details

    • setDescription

      void setDescription(String description)
      Parameters:
      description - the description string
    • getDescription

      String getDescription()
      Returns:
      the description
    • getName

      String getName()
      Returns:
      the name
    • setName

      void setName(String name)
      Parameters:
      name - the name of this Control
    • enabled

      StateObserver enabled()
      Returns:
      a StateObsrver indicating whether this Control is enabled
    • setMnemonic

      void setMnemonic(int mnemonic)
      Parameters:
      mnemonic - the mnemonic to associate with this Control
    • getMnemonic

      int getMnemonic()
      Returns:
      the mnemonic, 0 if none is specified
    • setKeyStroke

      void setKeyStroke(KeyStroke keyStroke)
      Parameters:
      keyStroke - the KeyStroke to associate with this Control
    • getKeyStroke

      KeyStroke getKeyStroke()
      Returns:
      the KeyStroke associated with this Control, if any
    • setSmallIcon

      void setSmallIcon(Icon smallIcon)
      Parameters:
      smallIcon - the small icon to associate with this Control
    • getSmallIcon

      Icon getSmallIcon()
      Returns:
      the icon
    • setLargeIcon

      void setLargeIcon(Icon largeIcon)
      Parameters:
      largeIcon - the large icon to associate with this Control
    • getLargeIcon

      Icon getLargeIcon()
      Returns:
      the icon
    • setBackground

      void setBackground(Color background)
      Parameters:
      background - the background color
    • getBackground

      Color getBackground()
      Returns:
      the background color
    • setForeground

      void setForeground(Color foreground)
      Parameters:
      foreground - the foreground color
    • getForeground

      Color getForeground()
      Returns:
      the foreground color
    • setFont

      void setFont(Font font)
      Parameters:
      font - the font
    • getFont

      Font getFont()
      Returns:
      the font
    • setEnabled

      void setEnabled(boolean enabled)
      Unsupported, the enabled state of Controls is based on their enabled state observer
      Specified by:
      setEnabled in interface Action
      Parameters:
      enabled - the enabled status
      Throws:
      UnsupportedOperationException - always
      See Also:
    • copy

      Returns a Control.Builder instance, based on a copy of this control, using the given command.
      Type Parameters:
      B - the builder type
      Parameters:
      command - the command for the resulting control
      Returns:
      a new builder
    • copy

      <B extends Control.Builder<Control, B>> Control.Builder<Control,B> copy(Control.ActionCommand actionCommand)
      Returns a Control.Builder instance, based on a copy of this control, using the given command.
      Type Parameters:
      B - the builder type
      Parameters:
      actionCommand - the command for the resulting control
      Returns:
      a new builder
    • copy

      Returns a Control.Builder instance, based on a copy of this control, using the given command.
      Type Parameters:
      B - the builder type
      Parameters:
      event - the event for the resulting control to trigger
      Returns:
      a new builder
    • control

      static Control control(Control.Command command)
      Creates a control based on a Control.Command
      Parameters:
      command - the Control.Command on which to base the control
      Returns:
      a Control for calling the given Control.Command
    • actionControl

      static Control actionControl(Control.ActionCommand actionCommand)
      Creates a control based on a Control.ActionCommand
      Parameters:
      actionCommand - the Control.ActionCommand on which to base the control
      Returns:
      a Control for calling the given Control.Command
    • eventControl

      static Control eventControl(Event<ActionEvent> event)
      Creates a Control which triggers the given event on action performed
      Parameters:
      event - the event
      Returns:
      a control which triggers the given event
    • builder

      static <B extends Control.Builder<Control, B>> Control.Builder<Control,B> builder(Control.Command command)
      Creates a new Builder.
      Type Parameters:
      B - the builder type
      Parameters:
      command - the command to base the control on
      Returns:
      a new Control.Builder
    • actionControlBuilder

      static <B extends Control.Builder<Control, B>> Control.Builder<Control,B> actionControlBuilder(Control.ActionCommand actionCommand)
      Creates a new Builder.
      Type Parameters:
      B - the builder type
      Parameters:
      actionCommand - the action command to base the control on
      Returns:
      a new Control.Builder
    • eventControlBuilder

      static <B extends Control.Builder<Control, B>> Control.Builder<Control,B> eventControlBuilder(Event<ActionEvent> event)
      Creates a Builder for a control which triggers the given event on action performed
      Type Parameters:
      B - the builder type
      Parameters:
      event - the event
      Returns:
      a new Control.Builder