cz.cuni.jagrlib.reg
Class InfoGroup

java.lang.Object
  extended by cz.cuni.jagrlib.reg.InfoModule
      extended by cz.cuni.jagrlib.reg.InfoGroup

public class InfoGroup
extends InfoModule

Information about concrete group instance (stored in XML file).

Since:
0.25
See Also:
InfoGroup.java

Field Summary
static boolean autoConnect
          Are new modules connected to the rest of composition automatically?
 boolean editRegisty
          Change of this group modifies registry as well?
 java.lang.String fileName
          File-name of the composition.
 HashMapChannels channels
          Set of all information about channels in the group.
 InfoCompositionGUI infoCompositionGUI
          Information about composition's GUI.
 HashMapModules modules
          Set of all information about modules and groups in group.
 boolean registry
          Do the group resides in the registry?
static java.lang.String TI_COMPOSITION
           
static java.lang.String TI_GROUP
           
 
Fields inherited from class cz.cuni.jagrlib.reg.InfoModule
infoGUI, instancePiece, key, nextInfo, owner, params, plugs, reg, TI_MODULE
 
Constructor Summary
InfoGroup()
          Default constructor.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Adds the specified action listener to receive action events from this object.
static InfoGroup createNewGroup(InfoGroup superGroup)
          Creation of a new group.
 boolean findPlugInChannels(InfoPlug ip)
          Looking for plug in group's channels.
 int getState()
          State check - checks connection status..
 java.awt.Dimension getTopLeftPoint()
          Gets upper-left corner of group.
 void changePerformed(int id, java.lang.Object _obj)
          Group change - add/delete module/channel.
 void init()
          Group initialization.
 void initVisibility()
          Sets initial visibility of plugs.
 boolean isOwner(java.lang.Integer _key)
          Determine if this group has the key or has module with the key.
static void moveChannelsToGroup(HashMapChannels superChannels, InfoGroup newGroup)
          Moves channels (with both plugs in group) to new group.
 void moveToTopLeft()
          Moves all modules to top left corner (relative to their positions).
 InfoChannel newLink(InfoPlug ipmodule, InfoPlug ipgroup)
          Connecting module's and group's plug.
protected  void processActionEvent(java.awt.event.ActionEvent e)
          Processes action events occurring on this object by dispatching them to any registered ActionListener objects.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes the specified action listener so that it no longer receives action events from this object.
 void setParams(InfoModule im)
          Setting parameters from it's module.
 void setPlugs(InfoModule im)
          Copies all plugs from the given module.
 
Methods inherited from class cz.cuni.jagrlib.reg.InfoModule
getTopLevelOwner, getVisibleParamLines
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileName

public java.lang.String fileName
File-name of the composition.


infoCompositionGUI

public InfoCompositionGUI infoCompositionGUI
Information about composition's GUI.


registry

public boolean registry
Do the group resides in the registry?


editRegisty

public boolean editRegisty
Change of this group modifies registry as well?


modules

public HashMapModules modules
Set of all information about modules and groups in group. Contains only objects of InfoModule or it's descendants (like InfoGroup).


channels

public HashMapChannels channels
Set of all information about channels in the group. Contains only objects of InfoChannel.


autoConnect

public static boolean autoConnect
Are new modules connected to the rest of composition automatically?


TI_GROUP

public static final java.lang.String TI_GROUP
See Also:
Constant Field Values

TI_COMPOSITION

public static final java.lang.String TI_COMPOSITION
See Also:
Constant Field Values
Constructor Detail

InfoGroup

public InfoGroup()
Default constructor.

Method Detail

isOwner

public boolean isOwner(java.lang.Integer _key)
Determine if this group has the key or has module with the key.

Overrides:
isOwner in class InfoModule
Parameters:
_key - In demand key.
Returns:
true if group has the key.

getState

public int getState()
State check - checks connection status..

Overrides:
getState in class InfoModule
Returns:
One of InfoState.* constants.

init

public void init()
Group initialization. Sets plugs and parameters from original modules.


setPlugs

public void setPlugs(InfoModule im)
Copies all plugs from the given module.

Parameters:
im - Source module.

setParams

public void setParams(InfoModule im)
Setting parameters from it's module.

Parameters:
im - Information about module.

newLink

public InfoChannel newLink(InfoPlug ipmodule,
                           InfoPlug ipgroup)
Connecting module's and group's plug.

Parameters:
ipmodule - plug from module.
ipgroup - plug from group.
Returns:
new channel - link.

findPlugInChannels

public boolean findPlugInChannels(InfoPlug ip)
Looking for plug in group's channels.

Parameters:
ip - Information about plug.
Returns:
true if group has channel with this plug or false otherwise.

getTopLeftPoint

public java.awt.Dimension getTopLeftPoint()
Gets upper-left corner of group.


createNewGroup

public static InfoGroup createNewGroup(InfoGroup superGroup)
Creation of a new group.

Parameters:
superGroup - superGroup with selected modules.
Returns:
New group or null.

moveChannelsToGroup

public static void moveChannelsToGroup(HashMapChannels superChannels,
                                       InfoGroup newGroup)
Moves channels (with both plugs in group) to new group.

Parameters:
superChannels - channels from parent group.
newGroup - new group.

moveToTopLeft

public void moveToTopLeft()
Moves all modules to top left corner (relative to their positions).


initVisibility

public void initVisibility()
Sets initial visibility of plugs.


changePerformed

public void changePerformed(int id,
                            java.lang.Object _obj)
Group change - add/delete module/channel.

Parameters:
id - Identification of action.
_obj - Module or channel.

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Adds the specified action listener to receive action events from this object. Action events occur when any action is performed. If l is null, no exception is thrown and no action is performed.

Parameters:
l - the action listener
See Also:
removeActionListener(java.awt.event.ActionListener), ActionListener

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes the specified action listener so that it no longer receives action events from this object. If l is null, no exception is thrown and no action is performed.

Parameters:
l - the action listener
See Also:
addActionListener(java.awt.event.ActionListener), ActionListener

processActionEvent

protected void processActionEvent(java.awt.event.ActionEvent e)
Processes action events occurring on this object by dispatching them to any registered ActionListener objects.

This method is not called unless action events are enabled for this object. Action events are enabled when one of the following occurs:

Note that if the event parameter is null the behavior is unspecified and may result in an exception.

Parameters:
e - the action event
See Also:
ActionListener, Component.enableEvents(long)