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

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

public class GUILayer
extends DataContainer
implements NeuronEventListener

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

Version:
$Id: GUILayer.java,v 1.6 2002/02/28 17:11:40 tweber Exp $ History:
$Log: GUILayer.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:29 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
GUILayer()
          Creates a new instance of GUILayer
GUILayer(Network network, Layer layer)
          Constructor declaration
 
Method Summary
 GUINeuron addNeuron(Network network, Neuron neuron)
          Adds a Neuron to this layer
 GUINeuron checkNeuronPosition(int posX, int posY)
          Iterates through all neurons of this layer and returns the first neuron at the specified position.
 long getID()
          Returns the ID of the object
 Layer getLayer()
          Method declaration
 java.lang.String getName()
          Returns the name of this layer
 GUINeuron getNeuron(long lID)
          Return a specific neuron
 boolean getSelected()
          Method declaration
 java.util.Vector getSelectedNeurons()
          Returns a vector all selected neurons within this layer
 void handleNeuronEvent(NeuronEvent event)
          Method declaration
 void reconnect()
          Rebuild all GUIConnections within this layer
 void setID(long lID)
          Sets the ID of the object
 void setSelected(boolean s)
          Sets the 'selected' flag of all neurons within this layer to a specific value
 
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
getParent, getSibbling, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GUILayer

public GUILayer()
Creates a new instance of GUILayer


GUILayer

public GUILayer(Network network,
                Layer layer)
Constructor declaration

Parameters:
layer -
Method Detail

getLayer

public Layer getLayer()
Method declaration

Returns:
See Also:

addNeuron

public GUINeuron addNeuron(Network network,
                           Neuron neuron)
Adds a Neuron to this layer


getNeuron

public GUINeuron getNeuron(long lID)
Return a specific neuron

Parameters:
lID - ID of the neuron to be found
Returns:
Neuron with given ID or null in case the neuron couldnt be found

checkNeuronPosition

public GUINeuron checkNeuronPosition(int posX,
                                     int posY)
Iterates through all neurons of this layer 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 this layer


setSelected

public void setSelected(boolean s)
Sets the 'selected' flag of all neurons within this layer to a specific value


getSelected

public boolean getSelected()
Method declaration

Returns:
See Also:

getName

public java.lang.String getName()
Returns the name of this layer


handleNeuronEvent

public void handleNeuronEvent(NeuronEvent event)
Method declaration

Specified by:
handleNeuronEvent in interface NeuronEventListener
Parameters:
event -
See Also:

setID

public void setID(long lID)
Sets the ID of the object

Specified by:
setID in interface DataObject
Overrides:
setID in class AbstractDataObject

getID

public long getID()
Returns the ID of the object

Specified by:
getID in interface DataObject
Overrides:
getID in class AbstractDataObject

reconnect

public void reconnect()
Rebuild all GUIConnections within this layer



Copyright - 2001 OpenAI Labs. All Rights Reserved.