com.tensegrity.gui.swing.customattribute
Class FormatAttributeGenerator

java.lang.Object
  extended bycom.tensegrity.gui.swing.customattribute.FormatAttributeGenerator
All Implemented Interfaces:
CustomAttributeGenerator

public class FormatAttributeGenerator
extends java.lang.Object
implements CustomAttributeGenerator

The FormatAttributeGenerator is capable of creating an instance of a Format by parsing a String. Such a string usually is generated by the format itself.

Version:
$Id: FormatAttributeGenerator.java,v 1.7 2006/03/02 11:40:58 BurkhardWick Exp $
Author:
GillesIachelini

Constructor Summary
FormatAttributeGenerator(int type)
          Creates a new FormatAttributeGenerator for a given Format type.
 
Method Summary
 CustomAttribute generateCustomAttribute(java.lang.String name, java.lang.String stringRepresentation)
          Creates a new CustomAttribute by generating the value from the parameter string representation and using the given name.
 Format parseFormat(java.lang.String description)
          Parses the given string and returns an instance of type Format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatAttributeGenerator

public FormatAttributeGenerator(int type)
Creates a new FormatAttributeGenerator for a given Format type.

Parameters:
type - the Type of this Generator.
See Also:
FormatAttribute.FONT, FormatAttribute.PAINT, FormatAttribute.STROKE, FormatAttribute.MARKER
Method Detail

generateCustomAttribute

public CustomAttribute generateCustomAttribute(java.lang.String name,
                                               java.lang.String stringRepresentation)
Description copied from interface: CustomAttributeGenerator
Creates a new CustomAttribute by generating the value from the parameter string representation and using the given name.

Specified by:
generateCustomAttribute in interface CustomAttributeGenerator
Parameters:
name - the name for the resulting custom attribute.
stringRepresentation - the string representation which will be used to create the CustomAttribute -instance.
Returns:
the newly created CustomAttribute.

parseFormat

public final Format parseFormat(java.lang.String description)
                         throws FormatParseException,
                                FontFormatParseException,
                                StrokeFormatParseException,
                                PaintFormatParseException,
                                MarkerFormatParseException
Parses the given string and returns an instance of type Format. This method chooses the approbriate method to parse the string by checking the internal type identifier.

Parameters:
description - the description string to parse the format from.
Returns:
an instance of class Format.
Throws:
FormatParseException - thrown if the internal type is not understood.
FontFormatParseException - thrown by the FormatPool.parseFontFormat(int, int, String, int, boolean, boolean, boolean)
StrokeFormatParseException - thrown by the FormatPool.parseStrokeFormat(String)
PaintFormatParseException - thrown by the FormatPool.parsePaintFormat(String)
MarkerFormatParseException - thrown by the FormatPool.parseMarkerFormat(String)


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.