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

java.lang.Object
  |
  +--net.openai.ai.nn.gui.data.AbstractDrawable
        |
        +--net.openai.ai.nn.gui.data.GUIConnection
All Implemented Interfaces:
Drawable, WeightChangeEventListener

public class GUIConnection
extends AbstractDrawable
implements WeightChangeEventListener

Implements the visual apearance of interconnected neurons. This class encapsulates a neuralnet-connection and extends it with properties and methods needed by the GUI.

Version:
$Id: GUIConnection.java,v 1.5 2002/03/02 16:34:48 tweber Exp $ History:
$Log: GUIConnection.java,v $
Revision 1.5 2002/03/02 16:34:48 tweber
- randomizeWeight() removed (deprecated)

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

Revision 1.3 2002/02/19 23:13:33 tweber
added changes for PF's AIDesktop

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

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

Revision 1.1 2002/01/15 23:31:41 gleo
adding files to conform to naming conventions and some new updates

Revision 1.2 2002/01/12 17:44:50 gleo
update from Thomas Weber
Author:
Thomas Weber

Field Summary
 
Fields inherited from class net.openai.ai.nn.gui.data.AbstractDrawable
bSelected, shape
 
Constructor Summary
GUIConnection(Connection mConnection, GUINeuron fromNeuron, GUINeuron toNeuron)
          Build up a new connection between two GUINerons.
 
Method Summary
 GUINeuron getFromNeuron()
          Returns the 'fromNeuron' of this connection
 GUINeuron getToNeuron()
          Returns the 'toNeuron' of this connection
 double getWeight()
          Returns the weight-value of the encapsulatet neuralnet-connection
 void handleWeightChangeEvent(WeightChangeEvent event)
          Method declaration
 void paint(java.awt.Graphics g, double zoom)
          Draw the connection into the panel.
 void reconnect()
          This method can rebuild a broken connection, as long as the fromNeuron is ok.
 void setWeight(double val)
          Sets the weight of the encapsulated neuralnet-connection to a new value
 
Methods inherited from class net.openai.ai.nn.gui.data.AbstractDrawable
contains, getSelected, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GUIConnection

public GUIConnection(Connection mConnection,
                     GUINeuron fromNeuron,
                     GUINeuron toNeuron)
Build up a new connection between two GUINerons.

Parameters:
mConnection - Real connection from the neuralnet
fromNeuron - Ref to the first GUINeuron Object
toNeuron - Ref to the second GUINeuron Object
See Also:
connection
Method Detail

reconnect

public void reconnect()
This method can rebuild a broken connection, as long as the fromNeuron is ok.


getToNeuron

public GUINeuron getToNeuron()
Returns the 'toNeuron' of this connection


getFromNeuron

public GUINeuron getFromNeuron()
Returns the 'fromNeuron' of this connection


getWeight

public double getWeight()
Returns the weight-value of the encapsulatet neuralnet-connection


setWeight

public void setWeight(double val)
Sets the weight of the encapsulated neuralnet-connection to a new value


paint

public void paint(java.awt.Graphics g,
                  double zoom)
Draw the connection into the panel. This method defines the visual appearence of a connection/weight

Specified by:
paint in interface Drawable

handleWeightChangeEvent

public void handleWeightChangeEvent(WeightChangeEvent event)
Method declaration

Specified by:
handleWeightChangeEvent in interface WeightChangeEventListener
Parameters:
event -
See Also:


Copyright - 2001 OpenAI Labs. All Rights Reserved.