TreeMap Java Library

treemap
Class TMPatternFactory

java.lang.Object
  extended by treemap.TMPatternFactory

public class TMPatternFactory
extends java.lang.Object

The TMPatternFactory is a utility to get filling patterns. It's a Singleton design pattern, and the only method of interest is get(), which take a String in parameter and return the (if existing) corresponding Paint pattern object.

The patterns are :

Launch "java treemap.TMPatternFactory" to see the differents patterns.

Version:
2.5
Author:
Christophe Bouthier [bouthier@loria.fr]

Constructor Summary
TMPatternFactory()
          Constructor.
 
Method Summary
 java.awt.Paint get(java.lang.String patternName)
          Returns the pattern whose name is given in parameter.
static TMPatternFactory getInstance()
          Returns the running instance of TMPatternFactory.
 java.util.Enumeration getPatternsNames()
          Returns an Enumeration of patterns names.
static void main(java.lang.String[] args)
          Display the differents patterns.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TMPatternFactory

public TMPatternFactory()
Constructor.

Method Detail

getInstance

public static TMPatternFactory getInstance()
Returns the running instance of TMPatternFactory.

Returns:
the running instance of TMPatternFactory

get

public java.awt.Paint get(java.lang.String patternName)
Returns the pattern whose name is given in parameter. If the name is not a recognized pattern name, prints an error on System.err, and returns null.

Parameters:
patternName - the name of the pattern to find
Returns:
the desired pattern; null if the pattern is not found

getPatternsNames

public java.util.Enumeration getPatternsNames()
Returns an Enumeration of patterns names.

Returns:
an Enumeration of patterns' names

main

public static void main(java.lang.String[] args)
Display the differents patterns.


TreeMap Java Library

TreeMap Java Library - www.bouthier.net - treemap.sf.net - 2001