edu.bonn.xulu.plugin.io.grid.awt
Class SingleGridFactory

java.lang.Object
  extended by edu.bonn.xulu.io.AbstractFactory
      extended by edu.bonn.xulu.plugin.io.grid.awt.SingleGridFactory
All Implemented Interfaces:
Factory, InstantiationFactory
Direct Known Subclasses:
SingleGridFactory, SingleGridFactory, SingleGridFactory, SingleGridFactory, SingleGridFactory

public class SingleGridFactory
extends AbstractFactory
implements InstantiationFactory

Diese Factory erzeugt Standard-Instanzen von SingleGrid mit einem durch die Factory WritableGridRasterFactory erzeugten (auf Standard-AWT basierenden) WritableGrid.

Version:
1.0
Author:
Martin Schmitz (University of Bonn/Germany)

Field Summary
 
Fields inherited from class edu.bonn.xulu.io.AbstractFactory
name
 
Constructor Summary
SingleGridFactory()
           
 
Method Summary
 Class getInstanceType()
          Liefert den Datentyp, der von der Factory erzeugt wird.
protected  InstantiationFactory getWritableGridFactory()
          Liefert eine InstantiationFactory, die Instanzen von WritableGrid erzeugt.
 SingleGrid newInstance(boolean dialog)
          Erzeugt eine neue Instanz von SingleGrid.
 SingleGrid newInstance(boolean dialog, Object sample)
          Erzeugt eine neue Instanz von SingleGrid.
 
Methods inherited from class edu.bonn.xulu.io.AbstractFactory
checkExportDestinationObject, checkImportSourceObject, equals, equals, getInstantiationFactoryFromRegistry, getName, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.bonn.xulu.io.Factory
equals
 

Constructor Detail

SingleGridFactory

public SingleGridFactory()
Method Detail

getInstanceType

public Class getInstanceType()
Liefert den Datentyp, der von der Factory erzeugt wird.

Specified by:
getInstanceType in interface InstantiationFactory
Returns:
immer SingleGrid.class
See Also:
InstantiationFactory.newInstance(boolean)

newInstance

public SingleGrid newInstance(boolean dialog,
                              Object sample)
                       throws Exception
Erzeugt eine neue Instanz von SingleGrid. Hierzu wird die Factory WritableGridRasterFactory herangezogen.

Specified by:
newInstance in interface InstantiationFactory
Parameters:
dialog - gibt an, ob die Factory einen Dialog mit dem Anwender fuehren darf, um die Instanz zu initialisieren (bei false wird die Vorlage ohne Dialog kopiert)
sample - Vorlage
Throws:
IllegalArgumentException - falls es sich bei der Vorlage nicht um ein SingleGrid oder um ein WritableGrid handelt
Exception

newInstance

public SingleGrid newInstance(boolean dialog)
                       throws Exception
Erzeugt eine neue Instanz von SingleGrid. Fuer den Inhalt des Grids wird die von der Methode getWritableGridFactory() gelieferte Factory herangezogen.

Specified by:
newInstance in interface InstantiationFactory
Parameters:
dialog - gibt an, ob die Factory einen Dialog mit dem Anwender fuehren darf, um die Instanz zu initialisieren (bei false wird eine Standard-Instanz erzeugt)
Throws:
Exception

getWritableGridFactory

protected InstantiationFactory getWritableGridFactory()
Liefert eine InstantiationFactory, die Instanzen von WritableGrid erzeugt. Mit diesen Instanzen wird das SingleGrid gefuellt.
Standardmaessig wird eine Instanz von WritableGridRasterFactory zurueckgegeben. Sub-Klassen koennen diese Methode ueberschreiben, um andere Arten von WritableGrid zu erzeugen.