net.openai.ai.nn.gui.topology
Class NetworkTools

java.lang.Object
  |
  +--net.openai.ai.nn.gui.topology.NetworkTools
All Implemented Interfaces:
AIPopupMenuListener, java.util.EventListener

public class NetworkTools
extends java.lang.Object
implements AIPopupMenuListener

Common menues and eventhandlers for Network-editing

Version:
$Id: NetworkTools.java,v 1.4 2002/03/18 21:27:27 tweber Exp $ History:
$Log: NetworkTools.java,v $
Revision 1.4 2002/03/18 21:27:27 tweber
Added 'createNewModel()'

Revision 1.3 2002/03/10 13:21:17 tweber
- removeNeuron and removeLayer is now working
- 'add sibbling to selected Neuron' implemented

Revision 1.2 2002/03/02 16:35:32 tweber
randomizeWeights(..) added

Revision 1.1 2002/02/28 17:09:36 tweber
moved to .topology package

Revision 1.6 2002/02/28 15:26:31 tweber
- extended menu
- addLayerWizzard gets now invoked with a new methode

Revision 1.5 2002/02/21 21:08:15 tweber
- changed to a better refresh-algorithm
- new methods to do simpler selects

Revision 1.4 2002/02/20 20:26:10 tweber
Can now add neurons with default connections.

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

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

Revision 1.1 2002/02/13 09:04:16 tweber
Initial release
Author:
Thomas Weber

Constructor Summary
NetworkTools(java.awt.Component component)
          Creates a new instance of NetworkToolbox
 
Method Summary
static void addNeuronToLayer(DataModel data, GUILayer gLayer, boolean bConnected)
          Creates and adds a neuron to a specific layer
static DataModel createNewModel()
           
static void deleteNeuronsFromLayer(java.util.Vector neurons)
          Deletes all neurons in the given Vector
static void doWeightChange(GUIConnection gconn)
          Shows a messagebox to change the weight of the first selected connection.
static void gridLayout(DataModel data)
          Starts the Grid AutoLayouter
 void Popup_Clicked(java.awt.event.ActionEvent e)
          Eventhandler for all Popupmenus.
static void randomizeWeights(DataModel datamodel)
           
static void removeLayer(GUILayer gLayer)
          Removes the selected Layer
static boolean selectLayer(DataModel data, Layer layer, boolean additive)
          Select a GUILayer based on a Layer's data
static boolean selectLayer(DataModel data, long lID, boolean additive)
          Select a GUILayer in the given datamodel
static boolean selectNeuron(DataModel data, long layerID, long neuronID, boolean additive)
          Select a GUINeuron in the given datamodel
static boolean selectNeuron(DataModel data, Neuron neuron, boolean additive)
          Select a GUINeuron based on a Neuron's data
 void show(java.lang.String menuname, int x, int y)
          Method declaration
static void showLayerWizzard(DataModel data)
          Show the LayerWizzard and add a Layer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkTools

public NetworkTools(java.awt.Component component)
Creates a new instance of NetworkToolbox

Method Detail

Popup_Clicked

public void Popup_Clicked(java.awt.event.ActionEvent e)
Eventhandler for all Popupmenus. This function implements the AIPopupMenu-Interface. The ActionCommand gets the name of the Menuitem that fired the event. with .getSource().equals(...) you can identifier the Source.

Specified by:
Popup_Clicked in interface AIPopupMenuListener

show

public void show(java.lang.String menuname,
                 int x,
                 int y)
Method declaration

Parameters:
menuname -
x -
y -
See Also:

doWeightChange

public static void doWeightChange(GUIConnection gconn)
Shows a messagebox to change the weight of the first selected connection.


createNewModel

public static DataModel createNewModel()

addNeuronToLayer

public static void addNeuronToLayer(DataModel data,
                                    GUILayer gLayer,
                                    boolean bConnected)
Creates and adds a neuron to a specific layer


gridLayout

public static void gridLayout(DataModel data)
Starts the Grid AutoLayouter


deleteNeuronsFromLayer

public static void deleteNeuronsFromLayer(java.util.Vector neurons)
Deletes all neurons in the given Vector


selectLayer

public static boolean selectLayer(DataModel data,
                                  Layer layer,
                                  boolean additive)
Select a GUILayer based on a Layer's data

Parameters:
data - Datamodel that contains the layer
layer - Layer for witch a GUILayer should be found
additive - true=add the layer to the current selected items, false=clear selection, then select the layer
Returns:
true=layer selected, false=layer not found

selectLayer

public static boolean selectLayer(DataModel data,
                                  long lID,
                                  boolean additive)
Select a GUILayer in the given datamodel

Parameters:
data - Datamodel that contains the layer
lID - ID of the layer
additive - true=add the layer to the current selected items, false=clear selection, then select the layer
Returns:
true=layer selected, false=layer not found

selectNeuron

public static boolean selectNeuron(DataModel data,
                                   Neuron neuron,
                                   boolean additive)
Select a GUINeuron based on a Neuron's data

Parameters:
data - Datamodel that contains the layer
neuron - Neuron for witch a GUILayer should be found
additive - true=add the neuron to the current selected items, false=clear selection, then select the neuron
Returns:
true=neuron selected, false=neuron not found

selectNeuron

public static boolean selectNeuron(DataModel data,
                                   long layerID,
                                   long neuronID,
                                   boolean additive)
Select a GUINeuron in the given datamodel

Parameters:
data - Datamodel that contains the layer
layerID - ID of the layer
additive - true=add the neuron to the current selected items, false=clear selection, then select the neuron
Returns:
true=neuron selected, false=neuron not found

showLayerWizzard

public static void showLayerWizzard(DataModel data)
Show the LayerWizzard and add a Layer


removeLayer

public static void removeLayer(GUILayer gLayer)
Removes the selected Layer


randomizeWeights

public static void randomizeWeights(DataModel datamodel)


Copyright - 2001 OpenAI Labs. All Rights Reserved.