org.jscience.awt.util
Class EtchedRectangle

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Rectangle2D
          extended by java.awt.Rectangle
              extended by org.jscience.awt.util.DrawnRectangle
                  extended by org.jscience.awt.util.EtchedRectangle
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, java.lang.Cloneable

public class EtchedRectangle
extends DrawnRectangle

A DrawnRectangle that draws an etched border.

Drawn etched in by default, drawing style used by paint() is controlled by etchedIn() and etchedOut(). Note that etchedIn() and etchedOut() do not result in anything being painted, but only set the state for the next call to paint(). To set the state and paint in one operation, use paintEtchedIn() and paintEtchedOut().

Although it is permissible to set the thickness of EtchedRectangles, they tend to loose the etching effect if thickness is greater than 4.

The current state of the rectangle may be obtained by calling isEtchedIn().

See Also:
DrawnRectangle, ThreeDRectangle, gjt.test.DrawnRectangleTest, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
 
Field Summary
protected static Etching _defaultEtching
           
 
Fields inherited from class org.jscience.awt.util.DrawnRectangle
_defaultThickness, drawInto
 
Fields inherited from class java.awt.Rectangle
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Constructor Summary
EtchedRectangle(java.awt.Component drawInto)
           
EtchedRectangle(java.awt.Component drawInto, Etching etching, int thickness, int x, int y, int w, int h)
           
EtchedRectangle(java.awt.Component drawInto, int thickness)
           
EtchedRectangle(java.awt.Component drawInto, int x, int y, int w, int h)
           
EtchedRectangle(java.awt.Component drawInto, int thickness, int x, int y, int w, int h)
           
 
Method Summary
 void etchedIn()
           
 void etchedOut()
           
 boolean isEtchedIn()
           
 void paint()
           
 void paintEtchedIn()
           
 void paintEtchedOut()
           
 java.lang.String paramString()
           
 
Methods inherited from class org.jscience.awt.util.DrawnRectangle
brighter, clear, clearExterior, clearInterior, component, fill, fill, getFillColor, getInnerBounds, getLineColor, getThickness, setFillColor, setLineColor, setThickness, toString
 
Methods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, translate, union
 
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
 

Field Detail

_defaultEtching

protected static Etching _defaultEtching
Constructor Detail

EtchedRectangle

public EtchedRectangle(java.awt.Component drawInto)

EtchedRectangle

public EtchedRectangle(java.awt.Component drawInto,
                       int thickness)

EtchedRectangle

public EtchedRectangle(java.awt.Component drawInto,
                       int x,
                       int y,
                       int w,
                       int h)

EtchedRectangle

public EtchedRectangle(java.awt.Component drawInto,
                       int thickness,
                       int x,
                       int y,
                       int w,
                       int h)

EtchedRectangle

public EtchedRectangle(java.awt.Component drawInto,
                       Etching etching,
                       int thickness,
                       int x,
                       int y,
                       int w,
                       int h)
Method Detail

etchedIn

public void etchedIn()

etchedOut

public void etchedOut()

isEtchedIn

public boolean isEtchedIn()

paint

public void paint()
Overrides:
paint in class DrawnRectangle

paintEtchedIn

public void paintEtchedIn()

paintEtchedOut

public void paintEtchedOut()

paramString

public java.lang.String paramString()
Overrides:
paramString in class DrawnRectangle