org.norther.tammi.leaf.jfc
Interface JFCFactory

All Superinterfaces:
ObjectFactory
All Known Implementing Classes:
DefaultJFCFactory

public interface JFCFactory
extends ObjectFactory

JFCFactory is an interface to object factories creating JFC widgets. The factories configure JFC widgets with localized resources based on the factory settings and additional constructor parameters. Factory implementations should accept at least a widget name and a resource bundle as constructor parameters.

Author:
Ilkka Priha

Method Summary
 Border createEmptyBorder()
          Creates an empty border of the size of the current spacing.
 Border createEmptyBorder(int top, int left, int bottom, int right)
          Creates an empty border of the specified size.
 Component createFiller(Dimension min, Dimension pref, Dimension max)
          Creates a filler of the specified size.
 Component createGlue()
          Creates glue.
 Component createHorizontalArea(int height)
          Creates a horizontal area of the width of the current spacing.
 Component createHorizontalGlue()
          Creates horizontal glue.
 Component createHorizontalStrut()
          Creates a horizontal strut of the size of the current spacing.
 Component createRigidArea()
          Creates a rigid area of the size of the current spacing.
 Component createRigidArea(Dimension dim)
          Creates a rigid area with the specified dimensions.
 Component createRigidArea(int width, int height)
          Creates a rigid area of the specified size.
 Component createVerticalArea(int width)
          Creates a vertical area of the height of the current spacing.
 Component createVerticalGlue()
          Creates vertical glue.
 Component createVerticalStrut()
          Creates a vertical strut of the size of the current spacing.
 Component findComponent(Container parent, String path)
          Finds the named component under the specified parent.
 Component findComponent(Container parent, String path, String className)
          Finds the named component of the specified type under the specified parent.
 Component findComponent(String path)
          Finds the named component.
 Component findComponent(String path, String className)
          Finds the named component of the specified type.
 Object getInstance(String className, ObjectName loader, String name, Container parent)
          Gets a new JFC instance for a specified parent by applying the named class loader.
 Object getInstance(String className, ObjectName loader, String name, Container parent, Object[] params, String[] signature)
          Gets a new JFC instance for a specified parent by applying constructor parameters and the named class loader.
 Object getInstance(String className, ObjectName loader, String name, LookupResourceBundle bundle)
          Gets a new JFC instance with specified resources by applying the named class loader.
 Object getInstance(String className, ObjectName loader, String name, LookupResourceBundle bundle, Object[] params, String[] signature)
          Gets a new JFC instance with specified resources by applying constructor parameters and the named class loader.
 Object getInstance(String className, String name, Container parent)
          Gets a new JFC instance for a specified parent.
 Object getInstance(String className, String name, Container parent, Object[] params, String[] signature)
          Gets a new JFC instance for a specified parent by applying constructor parameters.
 Object getInstance(String className, String name, LookupResourceBundle bundle)
          Gets a new JFC instance with specified resources.
 Object getInstance(String className, String name, LookupResourceBundle bundle, Object[] params, String[] signature)
          Gets a new JFC instance with specified resources by applying constructor parameters.
 String getResource(String resource, Component component, Container parent)
          Gets the specified resource of the named component from the resource hierarchy.
 String getResource(String resource, Component component, LookupResourceBundle bundle)
          Gets the specified resource of the named component from the resource bundle.
 ObjectName getResourceFinderName()
          Gets the the resource finder of this factory.
 int getSpacing()
          Gets the current spacing between components.
 void resetSystemLookAndFeel()
          Resets the system specific look-and-feel.
 void setResourceFinderName(ObjectName finder)
          Sets the resource finder of this factory.
 void setSpacing(int space)
          Sets the current spacing between components.
 
Methods inherited from interface org.norther.tammi.core.base.ObjectFactory
getInstance, getInstance, getInstance, getInstance, isLoaderSupported
 

Method Detail

getResourceFinderName

ObjectName getResourceFinderName()
Gets the the resource finder of this factory.

Returns:
the object name of the resource finder or a query.

setResourceFinderName

void setResourceFinderName(ObjectName finder)
Sets the resource finder of this factory. If it is not set, the default one will be used.

Parameters:
finder - the object name of the resource finder or a query.

getResource

String getResource(String resource,
                   Component component,
                   LookupResourceBundle bundle)
Gets the specified resource of the named component from the resource bundle.

Parameters:
resource - the name of the resource.
component - the named component.
bundle - the resource bundle.
Returns:
the resource string or null.

getResource

String getResource(String resource,
                   Component component,
                   Container parent)
Gets the specified resource of the named component from the resource hierarchy.

Parameters:
resource - the name of the resource.
component - the named component.
parent - the parent of the component.
Returns:
the resource string or null.

getInstance

Object getInstance(String className,
                   String name,
                   Container parent)
                   throws ConstructionException
Gets a new JFC instance for a specified parent.

Parameters:
className - the class name of the component.
name - the name of the component.
parent - the parent of the component.
Returns:
the new instance.
Throws:
ConstructionException - if construction fails.

getInstance

Object getInstance(String className,
                   String name,
                   LookupResourceBundle bundle)
                   throws ConstructionException
Gets a new JFC instance with specified resources.

Parameters:
className - the class name of the component.
name - the name of the component.
bundle - the resource bundle.
Returns:
the new instance.
Throws:
ConstructionException - if construction fails.

getInstance

Object getInstance(String className,
                   String name,
                   Container parent,
                   Object[] params,
                   String[] signature)
                   throws ConstructionException
Gets a new JFC instance for a specified parent by applying constructor parameters.

Parameters:
className - the class name of the component.
name - the name of the component.
parent - the parent of the component.
params - the parameters.
signature - the signature.
Returns:
the new instance.
Throws:
ConstructionException - if construction fails.

getInstance

Object getInstance(String className,
                   String name,
                   LookupResourceBundle bundle,
                   Object[] params,
                   String[] signature)
                   throws ConstructionException
Gets a new JFC instance with specified resources by applying constructor parameters.

Parameters:
className - the class name of the component.
name - the name of the component.
bundle - the resource bundle.
params - the parameters.
signature - the signature.
Returns:
the new instance.
Throws:
ConstructionException - if construction fails.

getInstance

Object getInstance(String className,
                   ObjectName loader,
                   String name,
                   Container parent)
                   throws ConstructionException
Gets a new JFC instance for a specified parent by applying the named class loader.

Parameters:
className - the class name of the component.
loader - the class loader to apply.
name - the name of the component.
parent - the parent of the component.
Returns:
the new instance.
Throws:
ConstructionException - if construction fails.

getInstance

Object getInstance(String className,
                   ObjectName loader,
                   String name,
                   LookupResourceBundle bundle)
                   throws ConstructionException
Gets a new JFC instance with specified resources by applying the named class loader.

Parameters:
className - the class name of the component.
loader - the class loader to apply.
name - the name of the component.
bundle - the resource bundle.
Returns:
the new instance.
Throws:
ConstructionException - if construction fails.

getInstance

Object getInstance(String className,
                   ObjectName loader,
                   String name,
                   Container parent,
                   Object[] params,
                   String[] signature)
                   throws ConstructionException
Gets a new JFC instance for a specified parent by applying constructor parameters and the named class loader.

Parameters:
className - the class name of the component.
loader - the class loader to apply.
name - the name of the component.
parent - the parent of the component.
params - the parameters.
signature - the signature.
Returns:
the new instance.
Throws:
ConstructionException - if construction fails.

getInstance

Object getInstance(String className,
                   ObjectName loader,
                   String name,
                   LookupResourceBundle bundle,
                   Object[] params,
                   String[] signature)
                   throws ConstructionException
Gets a new JFC instance with specified resources by applying constructor parameters and the named class loader.

Parameters:
className - the class name of the component.
loader - the class loader to apply.
name - the name of the component.
bundle - the resource bundle.
params - the parameters.
signature - the signature.
Returns:
the new instance.
Throws:
ConstructionException - if construction fails.

getSpacing

int getSpacing()
Gets the current spacing between components.

Returns:
the spacing.

setSpacing

void setSpacing(int space)
Sets the current spacing between components.

Parameters:
space - the spacing.

createEmptyBorder

Border createEmptyBorder()
Creates an empty border of the size of the current spacing.

Returns:
an empty border.

createEmptyBorder

Border createEmptyBorder(int top,
                         int left,
                         int bottom,
                         int right)
Creates an empty border of the specified size.

Parameters:
top - the top width.
left - the left width.
bottom - the bottom width.
right - the right width.
Returns:
an empty border.

createHorizontalStrut

Component createHorizontalStrut()
Creates a horizontal strut of the size of the current spacing.

Returns:
the horizontal strut.

createVerticalStrut

Component createVerticalStrut()
Creates a vertical strut of the size of the current spacing.

Returns:
the vertical strut.

createRigidArea

Component createRigidArea()
Creates a rigid area of the size of the current spacing.

Returns:
the rigid area.

createRigidArea

Component createRigidArea(Dimension dim)
Creates a rigid area with the specified dimensions.

Parameters:
dim - the dimensions.
Returns:
the rigid area.

createRigidArea

Component createRigidArea(int width,
                          int height)
Creates a rigid area of the specified size.

Parameters:
width - the width.
height - the height.
Returns:
the rigid area.

createHorizontalArea

Component createHorizontalArea(int height)
Creates a horizontal area of the width of the current spacing.

Parameters:
height - the height of the area.
Returns:
the horizontal area.

createVerticalArea

Component createVerticalArea(int width)
Creates a vertical area of the height of the current spacing.

Parameters:
width - the width of the area.
Returns:
the vertical area.

createFiller

Component createFiller(Dimension min,
                       Dimension pref,
                       Dimension max)
Creates a filler of the specified size.

Parameters:
min - the minimum size.
pref - the preferred size.
max - the maximum size.
Returns:
the filler.

createGlue

Component createGlue()
Creates glue.

Returns:
the glue.

createHorizontalGlue

Component createHorizontalGlue()
Creates horizontal glue.

Returns:
the horizontal glue.

createVerticalGlue

Component createVerticalGlue()
Creates vertical glue.

Returns:
the vertical glue.

findComponent

Component findComponent(String path)
Finds the named component.

Parameters:
path - the name path of the component.
Returns:
the found component or null.

findComponent

Component findComponent(String path,
                        String className)
Finds the named component of the specified type.

Parameters:
path - the name path of the component.
className - the class name of the component.
Returns:
the found component or null.

findComponent

Component findComponent(Container parent,
                        String path)
Finds the named component under the specified parent.

Parameters:
parent - the parent of the component.
path - the name path of the component.
Returns:
the found component or null.

findComponent

Component findComponent(Container parent,
                        String path,
                        String className)
Finds the named component of the specified type under the specified parent.

Parameters:
parent - the parent of the component.
path - the name path of the component.
className - the class name of the component.
Returns:
the found component or null.

resetSystemLookAndFeel

void resetSystemLookAndFeel()
Resets the system specific look-and-feel.



Copyright © 2004 The Norther Organization. All rights reserved.