Class Display

java.lang.Object
pt.tecnico.uilib.Display

public class Display extends Object
Display lines of text.
  • Constructor Details

    • Display

      public Display()
      Build a Display without a title and use the static IO
    • Display

      public Display(String title)
      Parameters:
      title - the title
    • Display

      public Display(Dialog ui, String title)
      Parameters:
      ui - the dialog driver
      title - the title
  • Method Details

    • add

      public Display add(Object toAdd)
      Parameters:
      text - text to be added
      Returns:
      the display
    • addAll

      public Display addAll(Collection<?> items)
    • addLine

      public Display addLine(Object toAdd)
      Add a line of text in a new-line. No new-line is added if there is no previous text.
      Parameters:
      text - text to be added
      Returns:
      the display
    • addNewLine

      public Display addNewLine(Object toAdd, boolean force)
      Add a line of text in a new-line. A new line is previously added if force is true or if there is already some text.
      Parameters:
      force - add a new-line even if no text is already present.
      text - text to be added
      Returns:
      the display
    • display

      public final void display()
      Display the text held by this display, even if the text to show is the empty string. Clear the text after the text was shown to the user.
    • displayText

      public final void displayText()
      Display the text held by this display only if there is something to show (text is not the empty string). Otherwise, it does nothing. In the textual interaction this method and the display() method are similar. With a visual interaction, the behabior of both methods is distinct when the text to show is the empty string. Clear the text after the text was shown to the user.
    • popup

      public void popup(Object toPop)
      Easy display method.
      Parameters:
      toPop -
    • popup

      public void popup(Collection<?> toPop)
      Easy display method.
      Parameters:
      toPop -
    • clear

      public void clear()
      Clear display. Empties the text to show.