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

Class OutlinedItem

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable
    Direct Known Subclasses:
    Arc, Bow, FilledItem, Line


    public abstract class OutlinedItem
    extends DrawingItem
    implements java.io.Externalizable
    Class OutlinedItem is the abstract base class for a DrawingItem that has an outline. Specify Outline.NONE for the outline to omit drawing a drawing item's outline.

    The static defaultOutline() method is provided to set the default outline. If the outline is not specified, the current default outline is used.

    See Also:
    Serialized Form
    • Field Detail

      • NORMAL_OUTLINE

        public static final Outline NORMAL_OUTLINE
        The normal outline: Solid, square corners, 1 point wide, black.
    • Constructor Detail

      • OutlinedItem

        public OutlinedItem()
        Construct a new outlined item with the default outline.
      • OutlinedItem

        public OutlinedItem(OutlinedItem theItem)
        Construct a new outlined item with the same outline as the given outlined item.
        Parameters:
        theItem - Outlined item.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theItem is null.
    • Method Detail

      • defaultOutline

        public static Outline defaultOutline()
        Returns the default outline.
        Returns:
        Default outline, or Outline.NONE.
      • defaultOutline

        public static void defaultOutline(Outline theOutline)
        Set the default outline. Before calling this method the first time, the default outline is solid, square corners, 1 point wide, black.
        Parameters:
        theOutline - Default outline, or Outline.NONE.
      • outline

        public Outline outline()
        Returns this outlined item's outline.
        Returns:
        Outline, or Outline.NONE.
      • outline

        public OutlinedItem outline(Outline theOutline)
        Set this outlined item's outline.
        Parameters:
        theOutline - Outline, or Outline.NONE.
        Returns:
        This outlined item.
      • add

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

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

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

        public OutlinedItem addFirst(Drawing theDrawing)
        Add this outlined item to the beginning of the given drawing's sequence of drawing items.
        Overrides:
        addFirst in class DrawingItem
        Parameters:
        theDrawing - Drawing.
        Returns:
        This outlined 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 outlined item to the given object output stream.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Overrides:
        writeExternal in class DrawingItem
        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 outlined item from the given object input stream.
        Specified by:
        readExternal in interface java.io.Externalizable
        Overrides:
        readExternal in class DrawingItem
        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 outlined item cannot be found.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.