ch.aplu.turtle
Class Pen

java.lang.Object
  |
  +--ch.aplu.turtle.Pen

public class Pen
extends java.lang.Object

The Pen class provides anything used for drawing the lines, such as line width, pen color, end caps, dashed lines, etc.

See Also:
BasicStroke

Field Summary
static java.awt.Font DEFAULT_FONT
          The default font that is used when drawing Text.
 
Constructor Summary
Pen()
          Constructor with standard Color and standard Stroke.
Pen(java.awt.Color color)
          Constructor with Color color and standard Stroke.
 
Method Summary
static java.lang.String[] getAvailableFontFamilies()
          Provides information about the currently available font families (e.g.
 java.awt.Color getColor()
          Query the Pens color.
 float[] getDashArray()
          Query the Pens dash array.
 float getDashPhase()
          Query the Pens dash phase.
 int getEndCap()
          Query the Pens end cap style.
 java.awt.Color getFillColor()
          Query the Pens fill color.
 java.awt.Font getFont()
          Query the current font.
 int getFontSize()
          Query the size (in points, rounded to int) of the current font.
 int getLineJoin()
          Query the Pens line join style.
 float getLineWidth()
          Query the Pens line width
 float getMiterLimit()
          Query the Pens miter limit style.
 java.awt.Stroke getStroke()
          Get the Pens Stroke
 void setColor(java.awt.Color color)
          Set the Pens color.
 void setDash(float[] dashArray)
          Set the Pens dash array.
 void setDashPhase(float dashPhase)
          Set the Pens dash phase.
 void setEndCap(int endCap)
          Set the Pens end cap style.
 void setFillColor(java.awt.Color color)
          Set the Pens fill color.
 void setFont(java.awt.Font f)
          Change the font to the given one.
 void setFontSize(float size)
          Change the font size (in points).
 void setFontSize(int size)
          Change the font size (in points).
 void setFontStyle(int style)
          Change the font style.
 void setLineJoin(int join)
          Set the Pens line join style.
 void setLineWidth(float width)
          Set the Pens line width.
 void setMiterLimit(float miterlimit)
          Set the Pens miter limit.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FONT

public static java.awt.Font DEFAULT_FONT
The default font that is used when drawing Text. First argument must be one of "Serif", "SansSerif", "Monotyped", "Dialog" or "DialogInput" to guarantee that this font exists on all systems.

See Also:
for more information, e.g. on font styles.
Constructor Detail

Pen

public Pen()
Constructor with standard Color and standard Stroke.

See Also:
BasicStroke

Pen

public Pen(java.awt.Color color)
Constructor with Color color and standard Stroke.

See Also:
BasicStroke
Method Detail

getAvailableFontFamilies

public static java.lang.String[] getAvailableFontFamilies()
Provides information about the currently available font families (e.g. "Roman"). Each font name is a string packed into a array of strings.

See Also:
for more information about font attributes etc.

getColor

public java.awt.Color getColor()
Query the Pens color.


getDashArray

public float[] getDashArray()
Query the Pens dash array.

See Also:
BasicStroke

getDashPhase

public float getDashPhase()
Query the Pens dash phase.

See Also:
BasicStroke

getEndCap

public int getEndCap()
Query the Pens end cap style.

See Also:
BasicStroke

getFillColor

public java.awt.Color getFillColor()
Query the Pens fill color.


getFont

public java.awt.Font getFont()
Query the current font.


getFontSize

public int getFontSize()
Query the size (in points, rounded to int) of the current font.


getLineJoin

public int getLineJoin()
Query the Pens line join style.

See Also:
BasicStroke

getLineWidth

public float getLineWidth()
Query the Pens line width


getMiterLimit

public float getMiterLimit()
Query the Pens miter limit style.

See Also:
BasicStroke

getStroke

public java.awt.Stroke getStroke()
Get the Pens Stroke

See Also:
BasicStroke, Stroke

setColor

public void setColor(java.awt.Color color)
Set the Pens color.


setDash

public void setDash(float[] dashArray)
Set the Pens dash array.

See Also:
BasicStroke

setDashPhase

public void setDashPhase(float dashPhase)
Set the Pens dash phase.

See Also:
BasicStroke

setEndCap

public void setEndCap(int endCap)
Set the Pens end cap style.

See Also:
BasicStroke

setFillColor

public void setFillColor(java.awt.Color color)
Set the Pens fill color.


setFont

public void setFont(java.awt.Font f)
Change the font to the given one.


setFontSize

public void setFontSize(float size)
Change the font size (in points). You will probably only need the int version setFontSize(int).


setFontSize

public void setFontSize(int size)
Change the font size (in points).


setFontStyle

public void setFontStyle(int style)
Change the font style.

See Also:
for possible styles.

setLineJoin

public void setLineJoin(int join)
Set the Pens line join style.

See Also:
BasicStroke

setLineWidth

public void setLineWidth(float width)
Set the Pens line width.


setMiterLimit

public void setMiterLimit(float miterlimit)
Set the Pens miter limit.

See Also:
BasicStroke