cz.cuni.jagrlib.xml
Class RegTablesXML

java.lang.Object
  extended by cz.cuni.jagrlib.xml.RegTablesXML
All Implemented Interfaces:
RegTables

public class RegTablesXML
extends java.lang.Object
implements RegTables

Class for registry data stored in XML file.

See Also:
RegTablesXML.java

Field Summary
protected static java.lang.String CLASS
           
protected static java.lang.String CLASS_CLASSNAME
           
protected static java.lang.String CLASS_MOVED_TO
           
protected static java.lang.String GROUP
           
protected static java.lang.String CHANNEL
           
protected static java.lang.String CHANNEL_MODULE_FROM
           
protected static java.lang.String CHANNEL_MODULE_TO
           
protected static java.lang.String CHANNEL_NAME
           
protected static java.lang.String CHANNEL_PLUG_FROM
           
protected static java.lang.String CHANNEL_PLUG_TO
           
protected static java.lang.String MODULE
           
protected static java.lang.String MODULE_CLASSNAME
           
protected static java.lang.String MODULE_KEY
           
protected static java.lang.String MODULE_NAME
           
protected static java.lang.String MODULE_PACKAGENAME
           
protected static java.lang.String MODULE_PARAMS
           
protected static java.lang.String MODULE_PLUGS
           
protected static java.lang.String MODULE_SHAPE
           
protected static java.lang.String MODULE_TEMPLATE
           
protected static java.lang.String PARAM
           
protected static java.lang.String PARAM_DEFAULT
           
protected static java.lang.String PARAM_DESCRIPTION
           
protected static java.lang.String PARAM_MANIPULATOR
           
protected static java.lang.String PARAM_NAME
           
protected static java.lang.String PARAM_TYPE
           
protected static java.lang.String PARAM_VISIBLE
           
protected static java.lang.String PLUG
           
protected static java.lang.String PLUG_DESCRIPTION
           
protected static java.lang.String PLUG_ID
           
protected static java.lang.String PLUG_IFACE
           
protected static java.lang.String PLUG_INPUT
           
protected static java.lang.String PLUG_IO
           
protected static java.lang.String PLUG_MANDATORY
           
protected static java.lang.String PLUG_MULTI
           
protected static java.lang.String PLUG_NAME
           
protected static java.lang.String PLUG_TYPE
           
protected static java.lang.String PLUG_VISIBLE
           
protected static java.lang.String SHAPE_HEIGHT
           
protected static java.lang.String SHAPE_MODE
           
protected static java.lang.String SHAPE_WIDTH
           
protected static java.lang.String SHAPE_X
           
protected static java.lang.String SHAPE_Y
           
protected static java.lang.String TEMPLATE
           
protected static java.lang.String TEMPLATE_CATEGORY
           
protected static java.lang.String TEMPLATE_DESCRIPTION
           
protected static java.lang.String TEMPLATE_NAME
           
protected static java.lang.String TEMPLATE_TEMPLATE_NAME
           
protected static java.lang.String VALUES
           
protected static java.lang.String VALUES_ITEM
           
 
Fields inherited from interface cz.cuni.jagrlib.reg.RegTables
MULTI_TEMPLATE
 
Constructor Summary
RegTablesXML()
          Default constructor.
 
Method Summary
protected  void addClass(java.lang.String _package, java.lang.String _class, java.lang.String _template, org.w3c.dom.Node _nodeTemp)
          Add node with module into package node.
 org.w3c.dom.Node getClass(org.w3c.dom.Node _package, java.lang.String _class)
          Finds node with the given class.
 HashMapChannels getChannels(HashMapModules modules, org.w3c.dom.Node nodeClass)
          Gets information about channels in group.
 InfoModule getInfo(java.lang.String _package, java.lang.String _class, java.lang.String _template)
          Gets information about module or group.
 java.util.Set<java.lang.String> getInterfaces()
          Returns set of all used interfaces (Plug types).
 HashMapModules getModules(org.w3c.dom.Node nodeClass)
          Gets information about modules in group.
 org.w3c.dom.Node getPackage(java.lang.String _package)
          Finds node with the given package.
 java.util.LinkedHashMap<java.lang.String,InfoParam> getParams(org.w3c.dom.Node nodeTemp, InfoModule _owner)
          Gets information about parameters.
 java.util.Vector<java.util.Map<java.lang.String,java.lang.Object>> getParamValues(org.w3c.dom.Node _class)
          Gets values of parameter.
 java.util.Map<java.lang.String,InfoPlug> getPlugs(org.w3c.dom.Node nodeTemp, InfoModule _owner)
          Gets information about plugs.
 javax.swing.table.AbstractTableModel getTableModelModule(SelectFilter _filter)
          Gets TableModel for table of modules.
 javax.swing.table.AbstractTableModel getTableModelParam(java.lang.String _package, java.lang.String _class, java.lang.String _template)
          Gets TableModel for table of parameters.
 javax.swing.table.AbstractTableModel getTableModelPlug(java.lang.String _package, java.lang.String _class, java.lang.String _template)
          Gets TableModel for table of plugs.
 org.w3c.dom.Node getTemplate(org.w3c.dom.Node _class, java.lang.String _template)
          Finds node with the given template within the given class.
 void initGroupModuleShape(org.w3c.dom.Node nodeShape, InfoModule im)
          Read information about shape of module.
 void initGroupParams(org.w3c.dom.Node nodeParams, InfoModule im)
          Read information about parameters of group.
 void initGroupPlugs(org.w3c.dom.Node nodePlugs, InfoModule im)
          Read information about plugs of group.
 void moveModule(InfoModule _info, java.lang.String newPackageName)
          Move module to diferent package.
protected  org.w3c.dom.Element newElement(java.lang.String _name)
          Creates new Element.
protected  org.w3c.dom.Element newElement(java.lang.String _name, java.lang.String _value)
          Creates new Element with value.
 void registerGroup(InfoGroup _info)
          Registration of group into registry data.
 void registerModule(InfoModule _info)
          Registration of Piece into registry data.
 void save()
          Saves registry data into XML file.
 void unregister(InfoModule _info)
          Unregistration of Piece into registry data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULE

protected static final java.lang.String MODULE
See Also:
Constant Field Values

MODULE_PACKAGENAME

protected static final java.lang.String MODULE_PACKAGENAME
See Also:
Constant Field Values

MODULE_CLASSNAME

protected static final java.lang.String MODULE_CLASSNAME
See Also:
Constant Field Values

MODULE_NAME

protected static final java.lang.String MODULE_NAME
See Also:
Constant Field Values

MODULE_SHAPE

protected static final java.lang.String MODULE_SHAPE
See Also:
Constant Field Values

MODULE_TEMPLATE

protected static final java.lang.String MODULE_TEMPLATE
See Also:
Constant Field Values

MODULE_KEY

protected static final java.lang.String MODULE_KEY
See Also:
Constant Field Values

MODULE_PLUGS

protected static final java.lang.String MODULE_PLUGS
See Also:
Constant Field Values

MODULE_PARAMS

protected static final java.lang.String MODULE_PARAMS
See Also:
Constant Field Values

SHAPE_MODE

protected static final java.lang.String SHAPE_MODE
See Also:
Constant Field Values

SHAPE_X

protected static final java.lang.String SHAPE_X
See Also:
Constant Field Values

SHAPE_Y

protected static final java.lang.String SHAPE_Y
See Also:
Constant Field Values

SHAPE_WIDTH

protected static final java.lang.String SHAPE_WIDTH
See Also:
Constant Field Values

SHAPE_HEIGHT

protected static final java.lang.String SHAPE_HEIGHT
See Also:
Constant Field Values

CLASS

protected static final java.lang.String CLASS
See Also:
Constant Field Values

CLASS_MOVED_TO

protected static final java.lang.String CLASS_MOVED_TO
See Also:
Constant Field Values

CLASS_CLASSNAME

protected static final java.lang.String CLASS_CLASSNAME
See Also:
Constant Field Values

TEMPLATE

protected static final java.lang.String TEMPLATE
See Also:
Constant Field Values

TEMPLATE_TEMPLATE_NAME

protected static final java.lang.String TEMPLATE_TEMPLATE_NAME
See Also:
Constant Field Values

TEMPLATE_NAME

protected static final java.lang.String TEMPLATE_NAME
See Also:
Constant Field Values

TEMPLATE_CATEGORY

protected static final java.lang.String TEMPLATE_CATEGORY
See Also:
Constant Field Values

TEMPLATE_DESCRIPTION

protected static final java.lang.String TEMPLATE_DESCRIPTION
See Also:
Constant Field Values

PLUG

protected static final java.lang.String PLUG
See Also:
Constant Field Values

PLUG_NAME

protected static final java.lang.String PLUG_NAME
See Also:
Constant Field Values

PLUG_IFACE

protected static final java.lang.String PLUG_IFACE
See Also:
Constant Field Values

PLUG_TYPE

protected static final java.lang.String PLUG_TYPE
See Also:
Constant Field Values

PLUG_ID

protected static final java.lang.String PLUG_ID
See Also:
Constant Field Values

PLUG_DESCRIPTION

protected static final java.lang.String PLUG_DESCRIPTION
See Also:
Constant Field Values

PLUG_VISIBLE

protected static final java.lang.String PLUG_VISIBLE
See Also:
Constant Field Values

PLUG_IO

protected static final java.lang.String PLUG_IO
See Also:
Constant Field Values

PLUG_INPUT

protected static final java.lang.String PLUG_INPUT
See Also:
Constant Field Values

PLUG_MANDATORY

protected static final java.lang.String PLUG_MANDATORY
See Also:
Constant Field Values

PLUG_MULTI

protected static final java.lang.String PLUG_MULTI
See Also:
Constant Field Values

PARAM

protected static final java.lang.String PARAM
See Also:
Constant Field Values

PARAM_NAME

protected static final java.lang.String PARAM_NAME
See Also:
Constant Field Values

PARAM_TYPE

protected static final java.lang.String PARAM_TYPE
See Also:
Constant Field Values

PARAM_DESCRIPTION

protected static final java.lang.String PARAM_DESCRIPTION
See Also:
Constant Field Values

PARAM_VISIBLE

protected static final java.lang.String PARAM_VISIBLE
See Also:
Constant Field Values

PARAM_MANIPULATOR

protected static final java.lang.String PARAM_MANIPULATOR
See Also:
Constant Field Values

PARAM_DEFAULT

protected static final java.lang.String PARAM_DEFAULT
See Also:
Constant Field Values

VALUES

protected static final java.lang.String VALUES
See Also:
Constant Field Values

VALUES_ITEM

protected static final java.lang.String VALUES_ITEM
See Also:
Constant Field Values

CHANNEL

protected static final java.lang.String CHANNEL
See Also:
Constant Field Values

CHANNEL_NAME

protected static final java.lang.String CHANNEL_NAME
See Also:
Constant Field Values

CHANNEL_MODULE_FROM

protected static final java.lang.String CHANNEL_MODULE_FROM
See Also:
Constant Field Values

CHANNEL_MODULE_TO

protected static final java.lang.String CHANNEL_MODULE_TO
See Also:
Constant Field Values

CHANNEL_PLUG_FROM

protected static final java.lang.String CHANNEL_PLUG_FROM
See Also:
Constant Field Values

CHANNEL_PLUG_TO

protected static final java.lang.String CHANNEL_PLUG_TO
See Also:
Constant Field Values

GROUP

protected static final java.lang.String GROUP
See Also:
Constant Field Values
Constructor Detail

RegTablesXML

public RegTablesXML()
Default constructor.

Method Detail

getModules

public HashMapModules getModules(org.w3c.dom.Node nodeClass)
Gets information about modules in group.

Parameters:
nodeClass - Node with group.
Returns:
HashMapModules.

initGroupPlugs

public void initGroupPlugs(org.w3c.dom.Node nodePlugs,
                           InfoModule im)
Read information about plugs of group.

Parameters:
nodePlugs - Node with plugs.
im - Original owner of Plugs.

initGroupParams

public void initGroupParams(org.w3c.dom.Node nodeParams,
                            InfoModule im)
Read information about parameters of group.

Parameters:
nodeParams - Node with parameters.
im - Original owner of parameters.

initGroupModuleShape

public void initGroupModuleShape(org.w3c.dom.Node nodeShape,
                                 InfoModule im)
Read information about shape of module.

Parameters:
nodeShape - Node with shape.
im - Original module.

getChannels

public HashMapChannels getChannels(HashMapModules modules,
                                   org.w3c.dom.Node nodeClass)
Gets information about channels in group.

Parameters:
nodeClass - Node with group.
modules - Modules from group.
Returns:
HashMapChannels.

addClass

protected void addClass(java.lang.String _package,
                        java.lang.String _class,
                        java.lang.String _template,
                        org.w3c.dom.Node _nodeTemp)
Add node with module into package node.

Parameters:
_package - Name of package.
_class - Name of class.
_template - Name of template.
_nodeTemp - node with template template.

newElement

protected org.w3c.dom.Element newElement(java.lang.String _name)
Creates new Element.

Parameters:
_name - Name of Element.
Returns:
New element.

newElement

protected org.w3c.dom.Element newElement(java.lang.String _name,
                                         java.lang.String _value)
Creates new Element with value.

Parameters:
_name - Name of Element.
_value - Value of element.
Returns:
New element.

getPackage

public org.w3c.dom.Node getPackage(java.lang.String _package)
Finds node with the given package.

Parameters:
_package - Name of package.
Returns:
Node package.

getClass

public org.w3c.dom.Node getClass(org.w3c.dom.Node _package,
                                 java.lang.String _class)
Finds node with the given class.

Parameters:
_package - Node with package.
_class - Name of class.

getTemplate

public org.w3c.dom.Node getTemplate(org.w3c.dom.Node _class,
                                    java.lang.String _template)
Finds node with the given template within the given class.

Parameters:
_class - Node with class.
_template - Name of template.

getParamValues

public java.util.Vector<java.util.Map<java.lang.String,java.lang.Object>> getParamValues(org.w3c.dom.Node _class)
Gets values of parameter.

Parameters:
_class - Node with template.
Returns:
values of parameter.

getParams

public java.util.LinkedHashMap<java.lang.String,InfoParam> getParams(org.w3c.dom.Node nodeTemp,
                                                                     InfoModule _owner)
Gets information about parameters.

Parameters:
nodeTemp - Node with template.
_owner - Owner of parameters.

getPlugs

public java.util.Map<java.lang.String,InfoPlug> getPlugs(org.w3c.dom.Node nodeTemp,
                                                         InfoModule _owner)
Gets information about plugs.

Parameters:
nodeTemp - Node with template.
_owner - Owner of plugs.

getInfo

public InfoModule getInfo(java.lang.String _package,
                          java.lang.String _class,
                          java.lang.String _template)
Gets information about module or group.

Specified by:
getInfo in interface RegTables
Parameters:
_package - Name of package.
_class - Name of class.
_template - Name of template.
Returns:
information about module or group.

moveModule

public void moveModule(InfoModule _info,
                       java.lang.String newPackageName)
Move module to diferent package.

Specified by:
moveModule in interface RegTables
Parameters:
_info - Information about module.
newPackageName - new package.

registerModule

public void registerModule(InfoModule _info)
Registration of Piece into registry data.

Specified by:
registerModule in interface RegTables
Parameters:
_info - Information about module.

registerGroup

public void registerGroup(InfoGroup _info)
Registration of group into registry data.

Specified by:
registerGroup in interface RegTables
Parameters:
_info - Information about group.

unregister

public void unregister(InfoModule _info)
Unregistration of Piece into registry data.

Specified by:
unregister in interface RegTables
Parameters:
_info - Information about module.

save

public void save()
Saves registry data into XML file.

Specified by:
save in interface RegTables

getTableModelModule

public javax.swing.table.AbstractTableModel getTableModelModule(SelectFilter _filter)
Gets TableModel for table of modules.

Specified by:
getTableModelModule in interface RegTables
Parameters:
_filter - Filter.
Returns:
table.

getTableModelPlug

public javax.swing.table.AbstractTableModel getTableModelPlug(java.lang.String _package,
                                                              java.lang.String _class,
                                                              java.lang.String _template)
Gets TableModel for table of plugs.

Specified by:
getTableModelPlug in interface RegTables
Parameters:
_package - Name of package.
_class - Name of class.
_template - Name of template.
Returns:
table.

getTableModelParam

public javax.swing.table.AbstractTableModel getTableModelParam(java.lang.String _package,
                                                               java.lang.String _class,
                                                               java.lang.String _template)
Gets TableModel for table of parameters.

Specified by:
getTableModelParam in interface RegTables
Parameters:
_package - Name of package.
_class - Name of class.
_template - Name of template.
Returns:
table.

getInterfaces

public java.util.Set<java.lang.String> getInterfaces()
Returns set of all used interfaces (Plug types).

Specified by:
getInterfaces in interface RegTables