net.openai.ai.nn.gui.data
Class GUINetwork

java.lang.Object
  |
  +--net.openai.ai.nn.gui.data.AbstractDataObject
        |
        +--net.openai.ai.nn.gui.data.DataContainer
              |
              +--net.openai.ai.nn.gui.data.GUINetwork
All Implemented Interfaces:
DataObject, LayerEventListener

public class GUINetwork
extends DataContainer
implements LayerEventListener

Visual representation of a neural-network structure. This class encapsulates a neuralnet and extends it with properties and methods needed by the GUI.

Version:
$Id: GUINetwork.java,v 1.6 2002/02/28 17:11:40 tweber Exp $ History:
$Log: GUINetwork.java,v $
Revision 1.6 2002/02/28 17:11:40 tweber
updated to work with the changed event-system

Revision 1.5 2002/02/28 15:34:20 tweber
A lot of changes to make 'addLayer' working

Revision 1.4 2002/02/20 20:22:28 tweber
- the network instance is now a constructor argument
this is needed to access 'architecture'

Revision 1.3 2002/02/19 22:09:38 tweber
Started to use events

Revision 1.2 2002/02/14 23:22:32 gleo
Jindent run through.

Revision 1.1 2002/02/13 09:15:22 tweber
Initial release of a new GUI-datamodel
Author:
Thomas Weber

Constructor Summary
GUINetwork()
          Creates a empty GUINetwork
GUINetwork(Network network)
          Creates a GUINetwork out of a Network-instance
 
Method Summary
 GUILayer addLayer(Network network, Layer layer)
          Adds a new layer to the datamodel and returns it
 GUIConnection checkConnectionPosition(int posX, int posY)
          Iterates through all connections of the network and returns the first connection at the specified position.
 GUINeuron checkNeuronPosition(int posX, int posY)
          Iterates through all neurons of the network and returns the first neuron at the specified position.
 void clearSelection()
          Resets the 'selected' flag of all neurons and connections
 java.util.Vector getAllConnections()
          Builds a vector with all connections of the network
 java.util.Vector getAllNeurons()
          Builds a vector with all neurons of the network
 GUILayer getLayer(long lID)
          Returns a specific layer
 Network getNetwork()
          Method declaration
 GUIConnection getSelectedConnection()
          Returns the first GUIConnection thats selected
 GUILayer getSelectedLayer()
          Returns the first GUILayer thats selected
 java.util.Vector getSelectedNeurons()
          Returns a vector all selected neurons within the network
 void handleLayerEvent(LayerEvent event)
          Method declaration
 void selectNeurons(java.awt.Rectangle r)
          Selects all Neurons within an Rectangle-area
 
Methods inherited from class net.openai.ai.nn.gui.data.DataContainer
get, iterator, put, remove, reorder, size
 
Methods inherited from class net.openai.ai.nn.gui.data.AbstractDataObject
getID, getParent, getSibbling, setID, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GUINetwork

public GUINetwork()
Creates a empty GUINetwork


GUINetwork

public GUINetwork(Network network)
Creates a GUINetwork out of a Network-instance

Method Detail

addLayer

public GUILayer addLayer(Network network,
                         Layer layer)
Adds a new layer to the datamodel and returns it


getLayer

public GUILayer getLayer(long lID)
Returns a specific layer

Parameters:
lID - ID of the layer to be found
Returns:
GUILayer with given ID or null

checkNeuronPosition

public GUINeuron checkNeuronPosition(int posX,
                                     int posY)
Iterates through all neurons of the network and returns the first neuron at the specified position.

Parameters:
posX - X-coordinate of the screenposition
posY - Y-coordinate of the screenposition
Returns:
Neuron at Position(x,y) or null

getSelectedNeurons

public java.util.Vector getSelectedNeurons()
Returns a vector all selected neurons within the network


checkConnectionPosition

public GUIConnection checkConnectionPosition(int posX,
                                             int posY)
Iterates through all connections of the network and returns the first connection at the specified position.

Parameters:
posX - X-coordinate of the screenposition
posY - Y-coordinate of the screenposition
Returns:
Connection at Position(x,y) or null

clearSelection

public void clearSelection()
Resets the 'selected' flag of all neurons and connections


getSelectedConnection

public GUIConnection getSelectedConnection()
Returns the first GUIConnection thats selected


getSelectedLayer

public GUILayer getSelectedLayer()
Returns the first GUILayer thats selected


getAllNeurons

public final java.util.Vector getAllNeurons()
Builds a vector with all neurons of the network

Returns:
A vector containing all neurons of the network

getAllConnections

public final java.util.Vector getAllConnections()
Builds a vector with all connections of the network

Returns:
A vector containing all connections of the network

selectNeurons

public void selectNeurons(java.awt.Rectangle r)
Selects all Neurons within an Rectangle-area


getNetwork

public Network getNetwork()
Method declaration

Returns:
See Also:

handleLayerEvent

public void handleLayerEvent(LayerEvent event)
Method declaration

Specified by:
handleLayerEvent in interface LayerEventListener
Parameters:
event -
See Also:


Copyright - 2001 OpenAI Labs. All Rights Reserved.