view
Class MyStroke

java.lang.Object
  extended by view.MyStroke
All Implemented Interfaces:
Stroke

public class MyStroke
extends Object
implements Stroke

A class that allows constructing of a stroke with a string. Only the most complicated constructor from the basic class is supported.


Field Summary
private  BasicStroke stroke
           
 
Constructor Summary
MyStroke(String arg)
          Constructs a basic stroke, where all parameteres are given in a semi-solon separated list.
 
Method Summary
 Shape createStrokedShape(Shape p)
           
private static String getCommaString(float[] array)
          Converts an array of floats to a comma-separated string
private static float[] getFloatArray(List<String> ofstrings)
          Converts a list of strings to an array of floats.
 String toString()
          Returns a string version of this basic stroke that is compatible with the constructor.
static String toString(BasicStroke base)
          Returns a string version of a basic stroke that is compatible with the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stroke

private BasicStroke stroke
Constructor Detail

MyStroke

public MyStroke(String arg)
Constructs a basic stroke, where all parameteres are given in a semi-solon separated list. The float array needed for generating the basic stroke object is a float list of comma-separted floats.

Method Detail

createStrokedShape

public Shape createStrokedShape(Shape p)
Specified by:
createStrokedShape in interface Stroke

toString

public String toString()
Returns a string version of this basic stroke that is compatible with the constructor.

Overrides:
toString in class Object

toString

public static String toString(BasicStroke base)
Returns a string version of a basic stroke that is compatible with the constructor.


getFloatArray

private static float[] getFloatArray(List<String> ofstrings)
Converts a list of strings to an array of floats.


getCommaString

private static String getCommaString(float[] array)
Converts an array of floats to a comma-separated string