public final class Pen
This is a graphics pen. Pens are used to draw lines on graphics surfaces.
Fields
Name | Description |
---|---|
BLACK | Topic under construction. |
NULL | Topic under construction. |
STYLE_DASH | Creates a pen style that consists of a series of dashed lines: -------- |
STYLE_DASHDOT | Creates a pen style that consists of a dash, followed by a dot: _ . |
STYLE_DASHDOTDOT | Creates a pen style that consists of a dash, followed by two dots: _ . |
STYLE_DOT | Creates a pen style that consists of a dotted line: ........... |
STYLE_INSIDEFRAME | Allows a pen to be drawn within a bounding rectangle. |
STYLE_NULL | Creates a "null" pen, which is a pen that doesn't draw at all. |
STYLE_SOLID | Creates a pen style that consists of a solid line: ___________ |
WHITE | Topic under construction. |
Constructors
Name | Description |
---|---|
Pen(Color color) | Creates a new pen with the given color. |
Pen(Color color, int style) | Creates a new pen with the given color and style. |
Pen(Color color, int style, int width) | Creates a pen with the given style, color, and width. |
Pen(int handle) | Creates a pen based on an existing Win32 HPEN handle. |
Methods
Name | Description |
---|---|
equals(Object obj) | Checks equality of two pens. |
finalize() throws Throwable | Finalizer for the pen; cleans up Win32 resources. |
getColor() | Returns the color of this pen. |
getHandle() | Returns the Win32 handle for this pen. |
getStyle() | Returns the pen style. |
getWidth() | Returns the pen width. |
hashCode() | Computes the hash code for this object. |
Creates a new pen with the given color. The style of the pen will be solid [STYLE_SOLID]. The width of the pen is one [1] pixel.
Creates a new pen with the given color and style. The style should be one of the constants specified in the Pen class. The width of the pen is one [1] pixel.
Creates a pen with the given style, color, and width. The style should be one of the constants specified in the Pen class, and the width should be be greater than zero.
IllegalArgumentException thrown if there is an illegal argument.
Creates a pen based on an existing Win32 HPEN handle.
Returns true if the given object is equivalent to this object.
Checks equality of two pens.
Finalizer for the pen; cleans up Win32 resources.
Returns the pen color.
Returns the color of this pen.
Returns a Win32 HPEN.
Returns the Win32 handle for this pen.
Returns one of the Pen.STYLE_ constants.
Returns the pen style.
Returns the width of the pen.
Returns the pen width.
Returns an integer hash code value.
Computes the hash code for this object.