nodeNet
Class ControlPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.Box
                    |
                    +--nodeNet.ControlPanel

public class ControlPanel
extends javax.swing.Box

A ControlPanel object is a graphical display of available Nodes for use with a SimulationPanel.

Copyright (c) 1998 Massachusetts Institute of Technology

See Also:
Serialized Form

Inner classes inherited from class javax.swing.Box
javax.swing.Box.AccessibleBox, javax.swing.Box.Filler
 
Fields inherited from class javax.swing.Box
accessibleContext
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ControlPanel()
          Constructs a new ControlPanel with three node types: a generator node, a terminator node, and a default connecting node.
 
Method Summary
 Node getNewInstance()
          Get a new Node of the currently selected type.
 void newNodeType(java.lang.String type)
          Adds a new NodeBehavior to the list of available types.
 void newNodeType(java.lang.String nodeBehavior, java.lang.String label)
          Adds a new NodeBehavior to the list of available types.
 
Methods inherited from class javax.swing.Box
createGlue, createHorizontalBox, createHorizontalGlue, createHorizontalStrut, createRigidArea, createVerticalBox, createVerticalGlue, createVerticalStrut, getAccessibleContext, setLayout
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControlPanel

public ControlPanel()
Constructs a new ControlPanel with three node types: a generator node, a terminator node, and a default connecting node.
Method Detail

getNewInstance

public Node getNewInstance()
Get a new Node of the currently selected type.

newNodeType

public void newNodeType(java.lang.String type)
                 throws java.lang.ClassNotFoundException,
                        java.lang.IllegalArgumentException
Adds a new NodeBehavior to the list of available types.
Parameters:
type - a new NodeBehavior to add
Throws:
java.lang.ClassNotFoundException - if type cannot be found
java.lang.IllegalArgumentException - if type is not a valid NodeBehavior

newNodeType

public void newNodeType(java.lang.String nodeBehavior,
                        java.lang.String label)
                 throws java.lang.ClassNotFoundException,
                        java.lang.IllegalArgumentException
Adds a new NodeBehavior to the list of available types.
Parameters:
type - a new NodeBehavior to add
label - the text label to use in the GUI
Throws:
java.lang.ClassNotFoundException - if type cannot be found
java.lang.IllegalArgumentException - if type is not a valid NodeBehavior