Package picasso.view

Class ButtonPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ButtonPanel extends JPanel
The collection of commands represented as buttons that apply to the active image.
Author:
Robert C Duvall
See Also:
  • Field Details

    • myView

      private Canvas myView
  • Constructor Details

    • ButtonPanel

      public ButtonPanel(Canvas view)
      Create panel that will update the given picasso.view.
      Parameters:
      view - the Canvas that the panel's buttons update
  • Method Details

    • add

      public void add(String buttonText, Command<Pixmap> action)
      Add the given Command as a button with the given button text. When the button is clicked, the command is executed and the associated canvas is updated.
      Parameters:
      buttonText - the text for the button
      action - the action associated with the new button
    • add

      public void add(NamedCommand<Pixmap> action)
      Add the given Command as a button. The button's text will be the given command's name.
      Parameters:
      action - the command associated with the new button