eu.webtoolkit.jwt
Class WPen

java.lang.Object
  extended by eu.webtoolkit.jwt.WPen

public class WPen
extends java.lang.Object

A value class that defines the style for pen strokes.

A pen defines the properties of how lines (that may surround shapes) are rendered.

A pen with width 0 is a cosmetic pen, and is always rendered as 1 pixel width, regardless of transformations. Otherwized, the pen width is modified by the transformation set on the painter.

See Also:
WPainter.setPen(WPen p), WBrush

Constructor Summary
WPen()
          Creates a black cosmetic pen.
WPen(PenStyle style)
          Creates a black pen with a particular style.
WPen(WColor color)
          Creates a solid pen of a particular color.
 
Method Summary
 WPen clone()
          Clone method.
 boolean equals(WPen other)
          Indicates whether some other object is "equal to" this one.
 PenCapStyle getCapStyle()
          Returns the style for rendering line ends.
 WColor getColor()
          Returns the pen color.
 PenJoinStyle getJoinStyle()
          Returns the style for rendering line joins.
 PenStyle getStyle()
          Returns the pen style.
 WLength getWidth()
          Returns the pen width.
 void setCapStyle(PenCapStyle style)
          Sets the style for rendering line ends.
 void setColor(WColor color)
          Sets the pen color.
 void setJoinStyle(PenJoinStyle style)
          Sets the style for rendering line joins.
 void setStyle(PenStyle style)
          Sets the pen style.
 void setWidth(WLength width)
          Sets the pen width.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WPen

public WPen()
Creates a black cosmetic pen.

Constructs a black solid pen of 0 width (i.e. cosmetic single pixel width), with SquareCap line ends and BevelJoin line join style.


WPen

public WPen(PenStyle style)
Creates a black pen with a particular style.

Constructs a black pen of 0 width (i.e. cosmetic single pixel width), with SquareCap line ends and BevelJoin line join style.

The line style is set to style.


WPen

public WPen(WColor color)
Creates a solid pen of a particular color.

Constructs a solid pen of 0 width (i.e. cosmetic single pixel width), with SquareCap line ends and BevelJoin line join style.

The pen color is set to color.

Method Detail

clone

public WPen clone()
Clone method.

Clones this pen.

Overrides:
clone in class java.lang.Object

equals

public boolean equals(WPen other)
Indicates whether some other object is "equal to" this one.

Returns true if the pens are exactly the same.


setStyle

public void setStyle(PenStyle style)
Sets the pen style.

See Also:
getStyle()

getStyle

public PenStyle getStyle()
Returns the pen style.

See Also:
setStyle(PenStyle style)

setCapStyle

public void setCapStyle(PenCapStyle style)
Sets the style for rendering line ends.

See Also:
getCapStyle()

getCapStyle

public PenCapStyle getCapStyle()
Returns the style for rendering line ends.

See Also:
setCapStyle(PenCapStyle style)

setJoinStyle

public void setJoinStyle(PenJoinStyle style)
Sets the style for rendering line joins.

See Also:
getJoinStyle()

getJoinStyle

public PenJoinStyle getJoinStyle()
Returns the style for rendering line joins.

See Also:
setJoinStyle(PenJoinStyle style)

setWidth

public void setWidth(WLength width)
Sets the pen width.

A pen width must be specified using WLength.Unit.Pixel units.

See Also:
getWidth()

getWidth

public WLength getWidth()
Returns the pen width.

See Also:
setWidth(WLength width)

setColor

public void setColor(WColor color)
Sets the pen color.

See Also:
getColor()

getColor

public WColor getColor()
Returns the pen color.

See Also:
getColor()