Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.graph.impl
Class StrokeFactory  view StrokeFactory download StrokeFactory.java

java.lang.Object
  extended bycom.port80.graph.impl.StrokeFactory
All Implemented Interfaces:
com.port80.util.attr.IAttrFactory

public class StrokeFactory
extends java.lang.Object
implements com.port80.util.attr.IAttrFactory

Style attribute factory.


Field Summary
private static float DEF_BUSWIDTH
           
private static float DEF_LINEWIDTH
           
private static StrokeFactory instance
           
private static java.lang.String NAME
           
private static java.lang.String[] nameTable
           
static int STYLE_DASHED
           
static int STYLE_DOTTED
           
static int STYLE_FILLED
          FILLED is equivalent to SOLID.
static int STYLE_HIDE
           
static int STYLE_SOLID
           
private static java.util.Map table
           
 
Constructor Summary
private StrokeFactory()
           
 
Method Summary
static GraphStroke create(java.lang.String stringvalue)
           
 java.lang.Object createObject(java.lang.String stringvalue)
          Convert String representation of an attribute value to the appropriate object for storing in AttrTable.
static StrokeFactory getInstance()
           
 boolean isValid(java.lang.Object a)
          Check that given object is valid value for this factory.
 java.lang.Object promptUser(java.lang.String prompt)
          Prompt user and present a user interface to obtain an attribute value from user.
static GraphStroke stockBusStroke(java.lang.String name, float linewidth)
           
static GraphStroke stockDashedStroke(java.lang.String name, float linewidth)
           
static GraphStroke stockDottedStroke(java.lang.String name, float linewidth)
           
static GraphStroke stockSolidStroke(java.lang.String name, float linewidth)
           
 java.lang.String toString()
          The String representation of attribute type itself.
 java.lang.String toString(java.lang.Object attr)
          The String representation of an attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

private static final java.lang.String NAME
See Also:
Constant Field Values

instance

private static StrokeFactory instance

STYLE_SOLID

public static final int STYLE_SOLID
See Also:
Constant Field Values

STYLE_DASHED

public static final int STYLE_DASHED
See Also:
Constant Field Values

STYLE_DOTTED

public static final int STYLE_DOTTED
See Also:
Constant Field Values

STYLE_FILLED

public static final int STYLE_FILLED
FILLED is equivalent to SOLID. Fill is solely determined by fillcolor!=null and can be combined with other style eg. DOTTED with fill.

See Also:
Constant Field Values

STYLE_HIDE

public static final int STYLE_HIDE
See Also:
Constant Field Values

DEF_LINEWIDTH

private static final float DEF_LINEWIDTH
See Also:
Constant Field Values

DEF_BUSWIDTH

private static final float DEF_BUSWIDTH
See Also:
Constant Field Values

nameTable

private static java.lang.String[] nameTable

table

private static java.util.Map table
Constructor Detail

StrokeFactory

private StrokeFactory()
Method Detail

getInstance

public static StrokeFactory getInstance()

create

public static GraphStroke create(java.lang.String stringvalue)

createObject

public java.lang.Object createObject(java.lang.String stringvalue)
Convert String representation of an attribute value to the appropriate object for storing in AttrTable. Accepted format for Stroke: stylename[,linewidth_scale] where stylename=solid|dashed|dotted|hide and linewidth_scale is a float number.

Specified by:
createObject in interface com.port80.util.attr.IAttrFactory

isValid

public boolean isValid(java.lang.Object a)
Description copied from interface: com.port80.util.attr.IAttrFactory
Check that given object is valid value for this factory.

Specified by:
isValid in interface com.port80.util.attr.IAttrFactory

toString

public java.lang.String toString(java.lang.Object attr)
The String representation of an attribute value.

Specified by:
toString in interface com.port80.util.attr.IAttrFactory

toString

public java.lang.String toString()
The String representation of attribute type itself.

Specified by:
toString in interface com.port80.util.attr.IAttrFactory

promptUser

public java.lang.Object promptUser(java.lang.String prompt)
Prompt user and present a user interface to obtain an attribute value from user.

Specified by:
promptUser in interface com.port80.util.attr.IAttrFactory

stockSolidStroke

public static GraphStroke stockSolidStroke(java.lang.String name,
                                           float linewidth)

stockDashedStroke

public static GraphStroke stockDashedStroke(java.lang.String name,
                                            float linewidth)

stockDottedStroke

public static GraphStroke stockDottedStroke(java.lang.String name,
                                            float linewidth)

stockBusStroke

public static GraphStroke stockBusStroke(java.lang.String name,
                                         float linewidth)