de.dante.extex.interpreter.context.tc
Class TypesettingContextFactory

java.lang.Object
  extended byde.dante.util.framework.AbstractFactory
      extended byde.dante.extex.interpreter.context.tc.TypesettingContextFactory
All Implemented Interfaces:
Configurable, LogEnabled, RegistrarObserver

public class TypesettingContextFactory
extends AbstractFactory

This class provides a factory for a TypesettingContext.

Version:
$Revision: 1.1 $
Author:
Gerd Neugebauer

Constructor Summary
TypesettingContextFactory()
          Creates a new object.
 
Method Summary
 void configure(Configuration configuration)
          Configure the factory according to a given Configuration.
 TypesettingContext initial()
          Getter for the initial instance.
protected  ModifiableTypesettingContext newInstance()
          Factory method to acquire an instance of the TypesettingContext.
 TypesettingContext newInstance(TypesettingContext tc)
          Create a new instance of a typesetting context.
 TypesettingContext newInstance(TypesettingContext context, Color color)
          Factory method to acquire an instance of the TypesettingContext.
 TypesettingContext newInstance(TypesettingContext context, Direction direction)
          Factory method to acquire an instance of the TypesettingContext.
 TypesettingContext newInstance(TypesettingContext context, Font font)
          Factory method to acquire an instance of the TypesettingContext.
 TypesettingContext newInstance(TypesettingContext context, Language language)
          Factory method to acquire an instance of the TypesettingContext with a new value for the language.
 TypesettingContext newInstance(TypesettingContext tc, java.lang.String language)
          Factory method to acquire an instance of the TypesettingContext with a new value for the language.
 void setLanguageManager(LanguageManager languageManager)
          Setter for the language manager.
 
Methods inherited from class de.dante.util.framework.AbstractFactory
configure, createInstance, createInstance, createInstance, createInstanceForConfiguration, createInstanceForConfiguration, createInstanceForConfiguration, enableLogging, enableLogging, getConfiguration, getLogger, reconnect, selectConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypesettingContextFactory

public TypesettingContextFactory()
Creates a new object.

Method Detail

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Configure the factory according to a given Configuration.

Specified by:
configure in interface Configurable
Overrides:
configure in class AbstractFactory
Parameters:
configuration - the configuration for this factory
Throws:
ConfigurationException - in case of an error
  • ConfigurationMissingAttributeException in case that the attribute CLASS_ATTRIBUTE is not set for the given configuration.
  • ConfigurationInstantiationException in case that the instantiation of the given class causes a SecurityException.
  • ConfigurationClassNotFoundException in case that the named class could not be loaded.
See Also:
Configurable.configure( de.dante.util.framework.configuration.Configuration)

newInstance

protected ModifiableTypesettingContext newInstance()
                                            throws ConfigurationInstantiationException
Factory method to acquire an instance of the TypesettingContext.

Returns:
an appropriate instance of the TypesettingContext.
Throws:
ConfigurationInstantiationException - in case that the instantiation of the class failed.

newInstance

public TypesettingContext newInstance(TypesettingContext context,
                                      Color color)
                               throws ConfigurationInstantiationException
Factory method to acquire an instance of the TypesettingContext.

Parameters:
context - the typesetting context to clone
color - the new value for the color
Returns:
an appropriate instance of the TypesettingContext.
Throws:
ConfigurationInstantiationException - in case that the instantiation of the class failed.

newInstance

public TypesettingContext newInstance(TypesettingContext context,
                                      Direction direction)
                               throws ConfigurationInstantiationException
Factory method to acquire an instance of the TypesettingContext.

Parameters:
context - the typesetting context to clone
direction - the new value for the direction
Returns:
an appropriate instance of the TypesettingContext.
Throws:
ConfigurationInstantiationException - in case that the instantiation of the class failed.

newInstance

public TypesettingContext newInstance(TypesettingContext context,
                                      Font font)
                               throws ConfigurationInstantiationException
Factory method to acquire an instance of the TypesettingContext.

Parameters:
context - the typesetting context to clone
font - the new value for the font
Returns:
an appropriate instance of the TypesettingContext.
Throws:
ConfigurationInstantiationException - in case that the instantiation of the class failed.

newInstance

public TypesettingContext newInstance(TypesettingContext context,
                                      Language language)
                               throws ConfigurationException
Factory method to acquire an instance of the TypesettingContext with a new value for the language.

Parameters:
context - the typesetting context to clone
language - the new value for the hyphenation table
Returns:
an appropriate instance of the TypesettingContext.
Throws:
ConfigurationException - in case of a configuration problem

newInstance

public TypesettingContext newInstance(TypesettingContext tc,
                                      java.lang.String language)
                               throws ConfigurationException
Factory method to acquire an instance of the TypesettingContext with a new value for the language. The language might be loaded if necessary.

Parameters:
tc - the typesetting context to clone
language - the new value for the hyphenation table
Returns:
an appropriate instance of the TypesettingContext.
Throws:
ConfigurationException - in case of a configuration problem

setLanguageManager

public void setLanguageManager(LanguageManager languageManager)
Setter for the language manager.

Parameters:
languageManager - the new language manager

initial

public TypesettingContext initial()
                           throws ConfigurationException
Getter for the initial instance.

Returns:
the initial instance
Throws:
ConfigurationException - in case of an error

newInstance

public TypesettingContext newInstance(TypesettingContext tc)
                               throws ConfigurationException
Create a new instance of a typesetting context. The typesetting context passed in as argument may not be under the control of this factory.

Parameters:
tc - the typesetting context to take over
Returns:
a typesetting context with the same attributes as the argument
Throws:
ConfigurationException - in case of an error