Package snap.gfx

Class Border

All Implemented Interfaces:
Cloneable, PropChange.DoChange, XMLArchiver.Archivable
Direct Known Subclasses:
Borders.BevelBorder, Borders.EtchBorder, Borders.LineBorder

public abstract class Border extends PropObject implements Cloneable, XMLArchiver.Archivable
A class to represent a painted stroke.
  • Field Details

  • Constructor Details

    • Border

      public Border()
  • Method Details

    • getInsets

      public Insets getInsets()
      Returns the insets.
    • createInsets

      protected Insets createInsets()
      Creates the insets.
    • getColor

      public Color getColor()
      Returns the basic color of the border.
    • getWidth

      public double getWidth()
      Returns the basic width of the border.
    • getStroke

      public Stroke getStroke()
      Returns the stroke of the border (maybe not be entirely accurate for fancy strokes).
    • getName

      public String getName()
      Returns the name for border.
    • isPaintAbove

      public boolean isPaintAbove()
      Returns whether the border paints above view.
    • paint

      public void paint(Painter aPntr, Shape aShape)
      Paint border.
    • copyForColor

      public Border copyForColor(Color aColor)
      Copies border for given color.
    • copyForStroke

      public Border copyForStroke(Stroke aStroke)
      Copies border for given stroke.
    • copyForStrokeWidth

      public Border copyForStrokeWidth(double aWidth)
      Copies border for given stroke width.
    • copyForInsets

      public Border copyForInsets(Insets theIns)
      Copies border for given insets.
    • copyFor

      public Border copyFor(String aPropName, Object aValue)
      Returns a border with given insets.
    • initProps

      protected void initProps(PropSet aPropSet)
      Override to support props for this class.
      Overrides:
      initProps in class PropObject
    • getPropValue

      public Object getPropValue(String aPropName)
      Returns a value for a key.
      Overrides:
      getPropValue in class PropObject
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Sets a value for a key.
      Overrides:
      setPropValue in class PropObject
    • clone

      protected Border clone()
      Standard clone implementation - only used internally (by copyFor methods).
      Overrides:
      clone in class PropObject
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • toXML

      public XMLElement toXML(XMLArchiver anArchiver)
      XML Archival.
      Specified by:
      toXML in interface XMLArchiver.Archivable
    • fromXML

      public Border fromXML(XMLArchiver anArchiver, XMLElement anElement)
      XML Unarchival.
      Specified by:
      fromXML in interface XMLArchiver.Archivable
    • blackBorder

      public static Border blackBorder()
      Returns a simple black border.
    • emptyBorder

      public static Border emptyBorder()
      Returns a simple empty border.
    • createLineBorder

      public static Borders.LineBorder createLineBorder(Color aColor, double aWidth)
      Creates a line border for given color and width.
    • createLoweredBevelBorder

      public static Borders.BevelBorder createLoweredBevelBorder()
      Creates a beveled border.