Package picasso.view

Class ButtonPanel

    • Constructor Detail

      • 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 Detail

      • addToHistory

        public void addToHistory​(String expr)
        Saves an evaluation after evaluate succeeds
        Parameters:
        expr - the expression to add
      • getStatusLabel

        public JLabel getStatusLabel()
        Getter for testing the status label Jlabel object
      • getErrorText

        public String getErrorText()
        Getter for testing the status label text
      • getExpressionText

        public String getExpressionText()
        Getter for the text input of the expression field
      • setExpressionText

        public void setExpressionText​(String text)
        Sets the text in the input.
        Parameters:
        text - the text to enter into the input field.
      • 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
      • displayError

        public void displayError​(String msg)
      • displayStatus

        public void displayStatus​(String msg)
      • displayDebug

        public void displayDebug​(Point clickPoint,
                                 Pixmap pixmap)