org.newdawn.slick.font.effects
Class OutlineEffect

java.lang.Object
  extended by org.newdawn.slick.font.effects.OutlineEffect
All Implemented Interfaces:
ConfigurableEffect, Effect
Direct Known Subclasses:
OutlineWobbleEffect, OutlineZigzagEffect

public class OutlineEffect
extends java.lang.Object
implements ConfigurableEffect

Strokes glyphs with an outline.

Author:
Nathan Sweet

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.newdawn.slick.font.effects.ConfigurableEffect
ConfigurableEffect.Value
 
Constructor Summary
OutlineEffect()
          Default constructor for injection
OutlineEffect(int width, java.awt.Color color)
          Create a new effect to draw the outline of the text
 
Method Summary
 void draw(java.awt.image.BufferedImage image, java.awt.Graphics2D g, UnicodeFont unicodeFont, Glyph glyph)
          Called to draw the effect.
 java.awt.Color getColor()
          Get the colour of the outline being drawn
 int getJoin()
          Get the join type as indicated by @see BasicStroke
 java.awt.Stroke getStroke()
          Get the stroke being used to draw the outline
 java.util.List getValues()
          Returns the list of ConfigurableEffect.Values for this effect.
 float getWidth()
          Get the width of the outline being drawn
 void setColor(java.awt.Color color)
          Set the colour of the outline being drawn
 void setJoin(int join)
          Sets how the corners of the outline are drawn.
 void setStroke(java.awt.Stroke stroke)
          Sets the stroke to use for the outline.
 void setValues(java.util.List values)
          Sets the list of ConfigurableEffect.Values for this effect.
 void setWidth(int width)
          Sets the width of the outline.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OutlineEffect

public OutlineEffect()
Default constructor for injection


OutlineEffect

public OutlineEffect(int width,
                     java.awt.Color color)
Create a new effect to draw the outline of the text

Parameters:
width - The width of the outline
color - The colour of the outline
Method Detail

draw

public void draw(java.awt.image.BufferedImage image,
                 java.awt.Graphics2D g,
                 UnicodeFont unicodeFont,
                 Glyph glyph)
Description copied from interface: Effect
Called to draw the effect.

Specified by:
draw in interface Effect
Parameters:
image - The image to draw into
g - The graphics context to use for applying the effect
unicodeFont - The font being rendered
glyph - The particular glyph being rendered
See Also:
Effect.draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.newdawn.slick.UnicodeFont, org.newdawn.slick.font.Glyph)

getWidth

public float getWidth()
Get the width of the outline being drawn

Returns:
The width of the outline being drawn

setWidth

public void setWidth(int width)
Sets the width of the outline. The glyphs will need padding so the outline doesn't get clipped.

Parameters:
width - The width of the outline being drawn

getColor

public java.awt.Color getColor()
Get the colour of the outline being drawn

Returns:
The colour of the outline being drawn

setColor

public void setColor(java.awt.Color color)
Set the colour of the outline being drawn

Parameters:
color - The colour of the outline to draw

getJoin

public int getJoin()
Get the join type as indicated by @see BasicStroke

Returns:
The join type between segments in the outline

getStroke

public java.awt.Stroke getStroke()
Get the stroke being used to draw the outline

Returns:
The stroke being used to draw the outline

setStroke

public void setStroke(java.awt.Stroke stroke)
Sets the stroke to use for the outline. If this is set, the other outline settings are ignored.

Parameters:
stroke - The stroke to be used to draw the outline

setJoin

public void setJoin(int join)
Sets how the corners of the outline are drawn. This is usually only noticeable at large outline widths.

Parameters:
join - One of: BasicStroke.JOIN_BEVEL, BasicStroke.JOIN_MITER, BasicStroke.JOIN_ROUND

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getValues

public java.util.List getValues()
Description copied from interface: ConfigurableEffect
Returns the list of ConfigurableEffect.Values for this effect. This list is not typically backed by the effect, so changes to the values will not take affect until ConfigurableEffect.setValues(List) is called.

Specified by:
getValues in interface ConfigurableEffect
See Also:
ConfigurableEffect.getValues()

setValues

public void setValues(java.util.List values)
Description copied from interface: ConfigurableEffect
Sets the list of ConfigurableEffect.Values for this effect.

Specified by:
setValues in interface ConfigurableEffect
See Also:
ConfigurableEffect.setValues(java.util.List)


Copyright © 2006 New Dawn Software. All Rights Reserved.