org.eu.sk.zero.acd
Class ACD

java.lang.Object
  |
  +--org.eu.sk.zero.acd.ACD

public class ACD
extends Object

Main ACD application class.

Version:
$Id: ACD.java,v 1.20 2003/05/14 20:33:42 robo Exp $

Constructor Summary
ACD()
          Constructs the application with the GUI
 
Method Summary
 boolean addArea(org.eu.sk.zero.acd.Area a)
          Add a new area.
 boolean addComponent(org.eu.sk.zero.acd.Component c)
          Add a new component.
 void addComponents(org.eu.sk.zero.acd.Components c)
          Add collection of components.
 boolean addEdge(org.eu.sk.zero.acd.Edge e)
          Add a new edge.
 boolean addNode(org.eu.sk.zero.acd.Node n)
          Add a new node.
static void debugPrint(Object s)
          Widely used to print debug messages
 org.eu.sk.zero.acd.Area findArea(int x, int y)
          Looks for an area on the given position.
 org.eu.sk.zero.acd.Edge findEdge(int x, int y)
          Looks for an edge on the given position.
 org.eu.sk.zero.acd.Node findNode(int x, int y)
          Looks for a node on the given position.
 void fireMethod(org.eu.sk.zero.acd.Component c, org.eu.sk.zero.acd.Method m)
          Launches the given method on the given component.
 void flushComponents()
          Removes all components.
 Iterator getAreasIterator()
          Allows to browse all areas in application.
 Iterator getAreaTypesIterator()
          Allows to browse all types of areas in application.
 org.eu.sk.zero.acd.Component getComponent(int id)
          Returns a component by given id.
 Iterator getComponentsIterator()
          Returned Iterator allows browsing all components in application.
 Iterator getComponentsIterator(org.eu.sk.zero.acd.ComponentType type)
          Returned Iterator allows browsing all components of given type.
 org.eu.sk.zero.acd.ComponentType getComponentType(int id)
          Returns component type by given id.
 Iterator getEdgesIterator()
          Allows to browse all egdes in application.
 Iterator getEdgeTypesIterator()
          Allows to browse all types of edges in application.
 Component getGuiComponent()
          Returns the top level gui component.
 Iterator getModulesIterator()
          Allows to browse all modules in application.
 Iterator getNodesIterator()
          Allows to browse all nodes in application.
 Iterator getNodeTypesIterator()
          Allows to browse all types of nodes in application.
 void loadModule(org.eu.sk.zero.acd.Module m)
          Loads a module into the application.
protected  boolean loadModule(String s)
          Loads a module from a file.
static void main(String[] s)
          Constructs an ACD object and loads all given modules.
 void redraw()
          Repacks the gui.
 void removeArea(org.eu.sk.zero.acd.Area a)
          Removes an area from application.
 void removeComponent(org.eu.sk.zero.acd.Component c)
          Remove a component.
 void removeEdge(org.eu.sk.zero.acd.Edge e)
          Removes an edge from application.
 void removeNode(org.eu.sk.zero.acd.Node n)
          Removes a node from application.
 void repaint()
          Repaints the gui.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ACD

public ACD()
Constructs the application with the GUI

Method Detail

loadModule

public void loadModule(org.eu.sk.zero.acd.Module m)
Loads a module into the application. The module must be already constructed.


loadModule

protected boolean loadModule(String s)
Loads a module from a file. Looks in the CLASSPATH for the given class-name or looks in the current directory if the filename ends with .jar

Parameters:
s - class or file name

addNode

public boolean addNode(org.eu.sk.zero.acd.Node n)
Add a new node. The node must be already constructed. This method fires the 'add' trigger and checks for its success.


addEdge

public boolean addEdge(org.eu.sk.zero.acd.Edge e)
Add a new edge. The edge must be already constructed.This method fires the 'add' trigger and checks for its success.


addArea

public boolean addArea(org.eu.sk.zero.acd.Area a)
Add a new area. The area must be already constructed.This method fires the 'add' trigger and checks for its success.


addComponent

public boolean addComponent(org.eu.sk.zero.acd.Component c)
Add a new component. The component must be already constructed.This method fires the 'add' trigger and checks for its success.


addComponents

public void addComponents(org.eu.sk.zero.acd.Components c)
Add collection of components.


removeNode

public void removeNode(org.eu.sk.zero.acd.Node n)
Removes a node from application. This method fires the 'remove' trigger and checks for its success.


removeEdge

public void removeEdge(org.eu.sk.zero.acd.Edge e)
Removes an edge from application. This method fires the 'remove' trigger and checks for its success.


removeArea

public void removeArea(org.eu.sk.zero.acd.Area a)
Removes an area from application. This method fires the 'remove' trigger and checks for its success.


removeComponent

public void removeComponent(org.eu.sk.zero.acd.Component c)
Remove a component. This method fires the 'remove' trigger and checks for its success.


getComponentsIterator

public Iterator getComponentsIterator()
Returned Iterator allows browsing all components in application.


getComponentsIterator

public Iterator getComponentsIterator(org.eu.sk.zero.acd.ComponentType type)
Returned Iterator allows browsing all components of given type.


getNodesIterator

public Iterator getNodesIterator()
Allows to browse all nodes in application.


getEdgesIterator

public Iterator getEdgesIterator()
Allows to browse all egdes in application.


getAreasIterator

public Iterator getAreasIterator()
Allows to browse all areas in application.


findNode

public org.eu.sk.zero.acd.Node findNode(int x,
                                        int y)
Looks for a node on the given position.


findEdge

public org.eu.sk.zero.acd.Edge findEdge(int x,
                                        int y)
Looks for an edge on the given position.


findArea

public org.eu.sk.zero.acd.Area findArea(int x,
                                        int y)
Looks for an area on the given position.


fireMethod

public void fireMethod(org.eu.sk.zero.acd.Component c,
                       org.eu.sk.zero.acd.Method m)
Launches the given method on the given component.

See Also:
Method

getComponentType

public org.eu.sk.zero.acd.ComponentType getComponentType(int id)
Returns component type by given id.


getComponent

public org.eu.sk.zero.acd.Component getComponent(int id)
Returns a component by given id.


getNodeTypesIterator

public Iterator getNodeTypesIterator()
Allows to browse all types of nodes in application.


getEdgeTypesIterator

public Iterator getEdgeTypesIterator()
Allows to browse all types of edges in application.


getAreaTypesIterator

public Iterator getAreaTypesIterator()
Allows to browse all types of areas in application.


getModulesIterator

public Iterator getModulesIterator()
Allows to browse all modules in application.


flushComponents

public void flushComponents()
Removes all components. Forever!


getGuiComponent

public Component getGuiComponent()
Returns the top level gui component. Usefull as parent widget for creating dialogs.


repaint

public void repaint()
Repaints the gui. Use this when messing with components - moving, adding etc.


redraw

public void redraw()
Repacks the gui. Use this only when adding node types, area types and so on.

See Also:
for a usual method for light-weigth repainting of the gui.

main

public static void main(String[] s)
Constructs an ACD object and loads all given modules.


debugPrint

public static void debugPrint(Object s)
Widely used to print debug messages