de.cul8r.synapse
Class Controller

java.lang.Object
  |
  +--de.cul8r.synapse.Controller
All Implemented Interfaces:
java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.util.EventListener, javax.swing.event.TableModelListener

public class Controller
extends java.lang.Object
implements java.awt.event.ActionListener, javax.swing.event.TableModelListener, javax.swing.event.ChangeListener

The controller does all the controlling stuff. It references All the panels, and the network files.

Author:
eNtro

Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          The actionPerformed method. catches events from the following objects: the learn button the save-cnfig button the patternIO buttons the weightsIO buttons
 void exit()
          This method is called when the programm closes.
 ConfigPanel getCp()
          Gets the reference to the ConfigPanel
 FileIOPanel getFp()
          Gets the reference to the FileIOPanel
static Controller getInstance()
          Gets an instance of the controller itself.
 InputPanel getIp()
          Gets the reference to the InputPanel
 Network getNetwork()
          Gets the reference to the Network
 SnnsNetworkLoader getNetworkLoader()
          Gets the networkLoader attribute of the Controller object
 NeuronalNetwork getNN()
          Gets the NeuronalNetwork
 OutputPanel getOp()
          Gets the reference to the OutputPanel
 PatternContainer getPatternContainer()
          Gets the reference to the PatternContainer
 int getResolution()
          Gets the resolution attribute of the Controller object
 SynInterface getSif()
          Gets the the SynInterface
 boolean isLearn()
          Asks if the Network is in lern or recall mode
 void loadSnnsNet(java.lang.String path, java.lang.String filename)
          Loads an SNNS .net file and sets the resolution fitting to the net.
 void setContainers(PatternContainer patternContainer)
          Sets the containers attribute of the Controller object
 void setLearn(boolean value)
          Specifies whether the Network should recall the paintet pattern or store the pattern in the PatternContainer.
 void setPanels(InputPanel ip, ConfigPanel cp, OutputPanel op, FileIOPanel fp)
          Sets all the panelreferences.
 void setResolution(int resolution)
          Sets the resolution attribute of the Controller object
 void stateChanged(javax.swing.event.ChangeEvent e)
          Wathces the state of the ResolutionSlider and the UseActivationFunction button.
 void tableChanged(javax.swing.event.TableModelEvent e)
          If the ConfigTable is changed the propertyfile is updated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setContainers

public void setContainers(PatternContainer patternContainer)
Sets the containers attribute of the Controller object
Parameters:
patternContainer - the container which stores the drawn patterns.

setLearn

public void setLearn(boolean value)
Specifies whether the Network should recall the paintet pattern or store the pattern in the PatternContainer.
Parameters:
value - boolean

setPanels

public void setPanels(InputPanel ip,
                      ConfigPanel cp,
                      OutputPanel op,
                      FileIOPanel fp)
Sets all the panelreferences.
Parameters:
ip - The new InputPanel
cp - The new ConfigPanel
op - The new OutputPanel
fp - The new FileIOPanel

setResolution

public void setResolution(int resolution)
Sets the resolution attribute of the Controller object
Parameters:
resolution - this attribute determines to how many points the painted pattern is interpolated. A value of 20 seems to produce the best results.

getResolution

public int getResolution()
Gets the resolution attribute of the Controller object
Returns:
resolution which determines to how many points the painted pattern is interpolated. A value of 20 seems to produce the best results.

getSif

public SynInterface getSif()
Gets the the SynInterface
Returns:
the SynInterface

getCp

public ConfigPanel getCp()
Gets the reference to the ConfigPanel
Returns:
The ConfigPanel

getIp

public InputPanel getIp()
Gets the reference to the InputPanel
Returns:
The InputPanel

getFp

public FileIOPanel getFp()
Gets the reference to the FileIOPanel
Returns:
The FileIOPanel

getOp

public OutputPanel getOp()
Gets the reference to the OutputPanel
Returns:
The OutputPanel

getPatternContainer

public PatternContainer getPatternContainer()
Gets the reference to the PatternContainer
Returns:
The PatternContainer

isLearn

public boolean isLearn()
Asks if the Network is in lern or recall mode
Returns:
true means the network is learning

getNetwork

public Network getNetwork()
Gets the reference to the Network
Returns:
The network

getNetworkLoader

public SnnsNetworkLoader getNetworkLoader()
Gets the networkLoader attribute of the Controller object
Returns:
The networkLoader

getNN

public NeuronalNetwork getNN()
Gets the NeuronalNetwork
Returns:
The NeuronalNetwork

loadSnnsNet

public void loadSnnsNet(java.lang.String path,
                        java.lang.String filename)
Loads an SNNS .net file and sets the resolution fitting to the net.
Parameters:
path - path to the file
filename - the filename

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
The actionPerformed method. catches events from the following objects: the learn button the save-cnfig button the patternIO buttons the weightsIO buttons
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the ActionEvent

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent e)
If the ConfigTable is changed the propertyfile is updated
Specified by:
tableChanged in interface javax.swing.event.TableModelListener
Parameters:
e - the TableModelEvent

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Wathces the state of the ResolutionSlider and the UseActivationFunction button.
Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Parameters:
e - the ChangeEvent

exit

public void exit()
This method is called when the programm closes. It unloads the WinTab32.dll and stops the thread that gets the packets from the Tablet. Also it saves the propertyfile.

getInstance

public static Controller getInstance()
Gets an instance of the controller itself. Because of the private constuctor all Objects reference the same static controller.
Returns:
The instance value


Copyright © 2001 Daniel Flemming and Christian Hermsdorf. All Rights Reserved.