Documentation of 'edu.rit.draw.item.FilledItem' Java class
FilledItem
edu.rit.draw.item

Class FilledItem

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable
    Direct Known Subclasses:
    ShapeItem


    public abstract class FilledItem
    extends OutlinedItem
    implements java.io.Externalizable
    Class FilledItem is the abstract base class for a DrawingItem that has an outline and is filled with a paint. Specify Fill.NONE for the fill paint to omit filling a drawing item's interior.

    The static defaultFill() method is provided to set the default fill paint. If the fill paint is not specified, the current default fill paint is used.

    See Also:
    Serialized Form
    • Field Detail

      • NORMAL_FILL

        public static final Fill NORMAL_FILL
        The normal fill paint: White.
    • Constructor Detail

      • FilledItem

        public FilledItem()
        Construct a new filled item with the default fill paint.
      • FilledItem

        public FilledItem(FilledItem theItem)
        Construct a new filled item with the same outline and fill paint as the given filled item.
        Parameters:
        theItem - Filled item.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theItem is null.
    • Method Detail

      • defaultFill

        public static Fill defaultFill()
        Returns the default fill paint.
        Returns:
        Default fill paint, or Fill.NONE.
      • defaultFill

        public static void defaultFill(Fill theFill)
        Set the default fill paint. Before calling this method the first time, the default fill paint is white.
        Parameters:
        theFill - Default fill paint, or Fill.NONE.
      • outline

        public FilledItem outline(Outline theOutline)
        Set this filled item's outline.
        Overrides:
        outline in class OutlinedItem
        Parameters:
        theOutline - Outline, or Outline.NONE.
        Returns:
        This filled item.
      • fill

        public Fill fill()
        Returns this filled item's fill paint.
        Returns:
        Fill paint, or Fill.NONE.
      • fill

        public FilledItem fill(Fill theFill)
        Set this filled item's fill paint.
        Parameters:
        theFill - Fill paint, or Fill.NONE.
        Returns:
        This filled item.
      • add

        public FilledItem add()
        Add this filled item to the end of the default drawing's sequence of drawing items.
        Overrides:
        add in class OutlinedItem
        Returns:
        This filled item.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if there is no default drawing.
        See Also:
        Drawing.defaultDrawing()
      • add

        public FilledItem add(Drawing theDrawing)
        Add this filled item to the end of the given drawing's sequence of drawing items.
        Overrides:
        add in class OutlinedItem
        Parameters:
        theDrawing - Drawing.
        Returns:
        This filled item.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theDrawing is null.
      • addFirst

        public FilledItem addFirst()
        Add this filled item to the beginning of the default drawing's sequence of drawing items.
        Overrides:
        addFirst in class OutlinedItem
        Returns:
        This filled item.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if there is no default drawing.
        See Also:
        Drawing.defaultDrawing()
      • addFirst

        public FilledItem addFirst(Drawing theDrawing)
        Add this filled item to the beginning of the given drawing's sequence of drawing items.
        Overrides:
        addFirst in class OutlinedItem
        Parameters:
        theDrawing - Drawing.
        Returns:
        This filled item.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theDrawing is null.
      • writeExternal

        public void writeExternal(java.io.ObjectOutput out)
                           throws java.io.IOException
        Write this filled item to the given object output stream.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Overrides:
        writeExternal in class OutlinedItem
        Parameters:
        out - Object output stream.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.
      • readExternal

        public void readExternal(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Read this filled item from the given object input stream.
        Specified by:
        readExternal in interface java.io.Externalizable
        Overrides:
        readExternal in class OutlinedItem
        Parameters:
        in - Object input stream.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.
        java.lang.ClassNotFoundException - Thrown if any class needed to deserialize this filled item cannot be found.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.