jsynoptic.base
Class Template

java.lang.Object
  extended by jsynoptic.base.Template
Direct Known Subclasses:
GridShapesTemplate, Template.EmptySheetTemplate

public abstract class Template
extends java.lang.Object

A template class is a JSynoptic sheets factory. A template is able to create a unique kind of shape containers. Note: When creating a new sheet, user can be asked to select a template for sheet creation. A template can provide a option panel to customize template parameters.

Author:
zxpletran007

Nested Class Summary
static class Template.EmptySheetTemplate
           
protected  class Template.TemplatePanel
          The optional panel related to the current template.
 
Field Summary
protected static Template currentTemplate
          The current used Template
protected static Template defaultTemplate
          The default template
protected static java.util.List templates
          The list of all known templates.
 
Constructor Summary
Template()
           
 
Method Summary
 ShapesContainer createShapeContainer(java.lang.String name)
          The Template is asked to create a new sheet Note: the newly created sheet will be inserted in the desktopCard panel.
static Template getCurrentTemplate()
           
 javax.swing.Icon getIcon()
          It is possible to attach an icon to the template
abstract  java.lang.String getName()
          Get template name
 Template.TemplatePanel getOptionPanelForTemplate()
          Enables a template to show an option panel to customize template parameters.
static Template getTemplateFromId(java.lang.String id)
           
abstract  java.lang.String getTemplateInformation()
          Provides information about the template utilization
static java.util.List getTemplates()
           
static void setCurrentTemplate(Template currentTemplate)
           
 void setShapeContainer(ShapesContainer sc)
          Set the shape container.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

templates

protected static java.util.List templates
The list of all known templates.


currentTemplate

protected static Template currentTemplate
The current used Template


defaultTemplate

protected static Template defaultTemplate
The default template

Constructor Detail

Template

public Template()
Method Detail

getTemplateFromId

public static Template getTemplateFromId(java.lang.String id)

createShapeContainer

public ShapesContainer createShapeContainer(java.lang.String name)
The Template is asked to create a new sheet Note: the newly created sheet will be inserted in the desktopCard panel.

Parameters:
name, - the sheet name
Returns:
The created sheet

setShapeContainer

public void setShapeContainer(ShapesContainer sc)
Set the shape container. Shall be overloaded

Parameters:
sc -

getOptionPanelForTemplate

public Template.TemplatePanel getOptionPanelForTemplate()
Enables a template to show an option panel to customize template parameters.

Returns:
a component to display

getName

public abstract java.lang.String getName()
Get template name

Returns:
template name

getIcon

public javax.swing.Icon getIcon()
It is possible to attach an icon to the template

Returns:

getTemplateInformation

public abstract java.lang.String getTemplateInformation()
Provides information about the template utilization

Returns:

getTemplates

public static java.util.List getTemplates()
Returns:
- the list of templates

getCurrentTemplate

public static Template getCurrentTemplate()
Returns:
- the current used template if null, set the current template with the default empty template.

setCurrentTemplate

public static void setCurrentTemplate(Template currentTemplate)
Parameters:
currentTemplate -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object