Documentation of 'edu.rit.swing.DisplayableList' Java class
DisplayableList
edu.rit.swing

Class DisplayableList

  • All Implemented Interfaces:
    Displayable, Drawable


    public class DisplayableList
    extends java.lang.Object
    implements Displayable
    Class DisplayableList provides an object that combines a list of separate Displayable objects into a single displayable object.

    Note: Class DisplayableList is multiple thread safe.

    • Constructor Summary

      Constructors 
      Constructor and Description
      DisplayableList()
      Construct a new, empty displayable list.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(Displayable theDisplayable)
      Add the given displayable object to the end of this displayable list.
      void clear()
      Clear this displayable list.
      void draw(java.awt.Graphics2D g2d)
      Draw this drawable object in the given graphics context.
      java.awt.Paint getBackgroundPaint()
      Returns this displayable object's background paint.
      java.awt.geom.Rectangle2D getBoundingBox()
      Returns this displayable object's bounding box.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DisplayableList

        public DisplayableList()
        Construct a new, empty displayable list.
    • Method Detail

      • clear

        public void clear()
        Clear this displayable list.
      • add

        public void add(Displayable theDisplayable)
        Add the given displayable object to the end of this displayable list.
        Parameters:
        theDisplayable - Displayable object.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theDisplayable is null.
      • draw

        public void draw(java.awt.Graphics2D g2d)
        Draw this drawable object in the given graphics context. Upon return from this method, the given graphics context's state (color, font, transform, clip, and so on) is the same as it was upon entry to this method.

        The displayable objects in this displayable list are drawn in the order they were added.

        Specified by:
        draw in interface Drawable
        Parameters:
        g2d - 2-D graphics context.
      • getBoundingBox

        public java.awt.geom.Rectangle2D getBoundingBox()
        Returns this displayable object's bounding box. This is the smallest rectangle that encloses all of this displayable object.

        This method returns the union of the bounding boxes of the displayable objects in this displayable list. If this displayable list is empty, an empty rectangle is returned.

        Specified by:
        getBoundingBox in interface Displayable
      • getBackgroundPaint

        public java.awt.Paint getBackgroundPaint()
        Returns this displayable object's background paint.

        This method returns the background paint of the first displayable object in this displayable list. If this displayable list is empty, the color white is returned.

        Specified by:
        getBackgroundPaint in interface Displayable

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.