com.approximatrix.charting
Class SimpleStrokeDefs

java.lang.Object
  extended by com.approximatrix.charting.SimpleStrokeDefs

public class SimpleStrokeDefs
extends java.lang.Object

Defines basic strokes for line drawing in a convenient manner. Allows the user to reference strokes simply by name.

Version:
1.0
Author:
armstrong

Field Summary
private static float[][] dash
          Constants for line dash drawing
static java.awt.BasicStroke DASH_DOT
          Dash-Dot stroke
private static java.lang.String DASH_DOT_NAME
          Name for referencing dash-dot line
static java.awt.BasicStroke DOT
          Dot stroke
private static java.lang.String DOT_NAME
          Name for referencing dotted line
static java.awt.BasicStroke LARGE_DASH
          Large dash stroke
private static java.lang.String LARGE_DASH_NAME
          Name for referencing large dash line
private static int NUMBER_OF_STYLES
          Number of line styles
static java.awt.BasicStroke SMALL_DASH
          Small dash stroke
private static java.lang.String SMALL_DASH_NAME
          Name for referencing small dash line
static java.awt.BasicStroke SOLID
          Solid line stroke
private static java.lang.String SOLID_NAME
          Name for referencing solid line
 
Constructor Summary
SimpleStrokeDefs()
           
 
Method Summary
static java.lang.String[] getAvailableStyles()
          Returns an array containing the names of all the available strokes provided by this static class
static java.lang.String getDefaultStrokeDescription()
          Returns the name of the default stroke
static java.awt.BasicStroke getStroke(java.lang.String description)
          Returns a BasicStroke based on the name passed into this function
static java.lang.String getStrokeDescription(java.awt.BasicStroke value)
          Returns the string associated with the stroke passed in
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dash

private static final float[][] dash
Constants for line dash drawing


NUMBER_OF_STYLES

private static final int NUMBER_OF_STYLES
Number of line styles

See Also:
Constant Field Values

SOLID

public static final java.awt.BasicStroke SOLID
Solid line stroke


SOLID_NAME

private static final java.lang.String SOLID_NAME
Name for referencing solid line

See Also:
Constant Field Values

DOT

public static final java.awt.BasicStroke DOT
Dot stroke


DOT_NAME

private static final java.lang.String DOT_NAME
Name for referencing dotted line

See Also:
Constant Field Values

LARGE_DASH

public static final java.awt.BasicStroke LARGE_DASH
Large dash stroke


LARGE_DASH_NAME

private static final java.lang.String LARGE_DASH_NAME
Name for referencing large dash line

See Also:
Constant Field Values

SMALL_DASH

public static final java.awt.BasicStroke SMALL_DASH
Small dash stroke


SMALL_DASH_NAME

private static final java.lang.String SMALL_DASH_NAME
Name for referencing small dash line

See Also:
Constant Field Values

DASH_DOT

public static final java.awt.BasicStroke DASH_DOT
Dash-Dot stroke


DASH_DOT_NAME

private static final java.lang.String DASH_DOT_NAME
Name for referencing dash-dot line

See Also:
Constant Field Values
Constructor Detail

SimpleStrokeDefs

public SimpleStrokeDefs()
Method Detail

getStrokeDescription

public static java.lang.String getStrokeDescription(java.awt.BasicStroke value)
Returns the string associated with the stroke passed in

Parameters:
value - a valid BasicStroke
Returns:
the string naming this stroke, or "Unknown"

getStroke

public static java.awt.BasicStroke getStroke(java.lang.String description)
Returns a BasicStroke based on the name passed into this function

Parameters:
description - the name of the requested stroke
Returns:
the associated BasicStroke object, or a SOLID stroke if the name is not found

getDefaultStrokeDescription

public static java.lang.String getDefaultStrokeDescription()
Returns the name of the default stroke

Returns:
the name of the default stroke (which is solid)

getAvailableStyles

public static java.lang.String[] getAvailableStyles()
Returns an array containing the names of all the available strokes provided by this static class

Returns:
an array of the styles defined in this class