org.hisee.graphics
Class GaugePanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--edu.umd.cs.piccolo.PCanvas
                          |
                          +--org.hisee.graphics.GaugePanel
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, edu.umd.cs.piccolo.PComponent, java.io.Serializable

public class GaugePanel
extends edu.umd.cs.piccolo.PCanvas
implements java.awt.event.ActionListener

GaugePanel is the main panel in which data are displayed. Menu and toolbar handling code are also provided here.

See Also:
Serialized Form

Field Summary
protected static java.io.File current_file
           
protected  javax.swing.JButton iterateBtn
           
protected  java.lang.String name
           
 java.util.ArrayList node_list
           
 javax.swing.JFrame theFrame
           
 
Fields inherited from class edu.umd.cs.piccolo.PCanvas
CURRENT_ZCANVAS
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GaugePanel(Gauge g, javax.swing.JFrame f)
          A gauge which represents a projection of some subset of the state and parameter space of a neural network.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addHi()
          Open saved low dimensional data
 void addNode(edu.umd.cs.piccolo.PNode theNode)
          Adds a PNode (datapoint) to the gauge panel
 void autoscale()
          Scale the data so that it fits on the screen Assumes 2-d data.
 void colorPoints()
          Color every seventh point a different color; allows tracking of order
 Gauge getGauge()
           
 int getHotPoint()
           
 double getMinimumPointSize()
           
 int getNumIterationsBetweenUpdate()
           
 javax.swing.JCheckBox getOnOffBox()
           
 double getScale()
           
 void initGaugePanel()
          Initialize the graphics component.
 boolean isAutoZoom()
          You can turn autozoom off if you want to zoom in on data.
 boolean isColorMode()
           
 boolean isShowError()
           
 boolean isShowStatus()
           
 boolean isUpdateCompleted()
          Used by the thread to be sure an iteration is complete before it iterates again
 void iterate()
          Forward command to gauge; iterate the gauge one time
 void openCombined()
          Opens a combined dataset, incorporating both high dimensional data and a previous projection of those data to two dimensions
 void openHi()
          Open saved hi dimensional data
 void openLow()
          Open saved low dimensional data
 void repaint()
           
 void resetGauge()
          Reset the gauge, removing all PNodes and references to datapoints
 void saveCombined()
          Save the high dimensional data and the low dimensional projectino in one dataset
 void saveHi()
          Save high dimensional data, for example, after data have been added to the dataset)
 void saveLow()
          Save low-dimensional data.
 void setAutoZoom(boolean b)
           
 void setColor(java.awt.Color c)
          Color all datapoints a specified color
 void setColorMode(boolean b)
           
 void setHotPoint(int i)
          Set a unique datapoint to "hot" mode, which just means it is shown in a different color, to indicate (e.g.) that it is the current point in a set of points.
 void setMinimumPointSize(double d)
           
 void setNumIterationsBetweenUpdate(int i)
           
 void setProjector(java.lang.String projector)
          Used to programatically set the projector
 void setScale(double d)
           
 void setShowError(boolean b)
           
 void setShowStatus(boolean b)
           
 void setSizes(double s)
          Reset the sizes of all datapoint PNodes
 void setUpdateCompleted(boolean b)
          Used by the thread to be sure an iteration is complete before it iterates again
 void updateGauge()
          Update the gauge.
 void updateProjectionMenu()
          Manually set the currently selected projection algorithm.
 
Methods inherited from class edu.umd.cs.piccolo.PCanvas
addInputEventListener, createTimer, getAnimating, getCamera, getInteracting, getLayer, getPanEventHandler, getRoot, getZoomEventHandler, installInputSources, paintComponent, paintImmediately, popCursor, pushCursor, removeInputEventListener, repaint, sendInputEventToInputManager, setAnimatingRenderQuality, setBounds, setCamera, setDefaultRenderQuality, setInteracting, setInteractingRenderQuality
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

current_file

protected static java.io.File current_file

iterateBtn

protected javax.swing.JButton iterateBtn

theFrame

public javax.swing.JFrame theFrame

node_list

public java.util.ArrayList node_list
Constructor Detail

GaugePanel

public GaugePanel(Gauge g,
                  javax.swing.JFrame f)
A gauge which represents a projection of some subset of the state and parameter space of a neural network.

Method Detail

initGaugePanel

public void initGaugePanel()
Initialize the graphics component. In particular, populate the list of "PNodes" (the graphics objects shown on screen).


updateGauge

public void updateGauge()
Update the gauge. Assumes the low-d datapoints (which are what the gauge shows) have been changed. This method is called by the gauge thread


resetGauge

public void resetGauge()
Reset the gauge, removing all PNodes and references to datapoints


addNode

public void addNode(edu.umd.cs.piccolo.PNode theNode)
Adds a PNode (datapoint) to the gauge panel

Parameters:
theNode - the node to add to the network

updateProjectionMenu

public void updateProjectionMenu()
Manually set the currently selected projection algorithm. Used when the projection method is changed independently of the user


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

iterate

public void iterate()
Forward command to gauge; iterate the gauge one time


autoscale

public void autoscale()
Scale the data so that it fits on the screen Assumes 2-d data.


colorPoints

public void colorPoints()
Color every seventh point a different color; allows tracking of order


setColor

public void setColor(java.awt.Color c)
Color all datapoints a specified color

Parameters:
c - new color

setHotPoint

public void setHotPoint(int i)
Set a unique datapoint to "hot" mode, which just means it is shown in a different color, to indicate (e.g.) that it is the current point in a set of points.

Parameters:
i - index of datapoint to designate as "hot"

getHotPoint

public int getHotPoint()
Returns:
"current" point in use by another component.

repaint

public void repaint()
Overrides:
repaint in class java.awt.Component

openHi

public void openHi()
Open saved hi dimensional data


openCombined

public void openCombined()
Opens a combined dataset, incorporating both high dimensional data and a previous projection of those data to two dimensions


openLow

public void openLow()
Open saved low dimensional data


addHi

public void addHi()
Open saved low dimensional data


saveHi

public void saveHi()
Save high dimensional data, for example, after data have been added to the dataset)


saveCombined

public void saveCombined()
Save the high dimensional data and the low dimensional projectino in one dataset


saveLow

public void saveLow()
Save low-dimensional data.


setSizes

public void setSizes(double s)
Reset the sizes of all datapoint PNodes

Parameters:
s - new size, in pixels, for datapoints

getGauge

public Gauge getGauge()
Returns:
a reference to the gauge

isUpdateCompleted

public boolean isUpdateCompleted()
Used by the thread to be sure an iteration is complete before it iterates again

Returns:
true if update is completed, false otherwise

setUpdateCompleted

public void setUpdateCompleted(boolean b)
Used by the thread to be sure an iteration is complete before it iterates again

Parameters:
b - true if update is completed, false otherwise

isColorMode

public boolean isColorMode()
Returns:
true if the gauge is in color mode (colors the datapoints), false otehrwise

setColorMode

public void setColorMode(boolean b)
Parameters:
b - true if the gauge is in color mode (colors the datapoints), false otehrwise

getNumIterationsBetweenUpdate

public int getNumIterationsBetweenUpdate()
Returns:
number of iterations the projection algorithm takes between graphics updates

setNumIterationsBetweenUpdate

public void setNumIterationsBetweenUpdate(int i)
Parameters:
i - number of iterations the projection algorithm takes between graphics updates

getScale

public double getScale()
Returns:
scale factor for shrinking the dataset so it fits on-screen

setScale

public void setScale(double d)
Parameters:
d - cale factor for shrinking the dataset so it fits on-screen

setProjector

public void setProjector(java.lang.String projector)
Used to programatically set the projector


isShowError

public boolean isShowError()
Returns:
true if error information should be shown, false otherwise

isShowStatus

public boolean isShowStatus()
Returns:
true if status information (dimensions and number of datapoints) should be shown, false otherwise

setShowStatus

public void setShowStatus(boolean b)
Parameters:
b - true if status information (dimensions and number of datapoints) should be shown, false otherwise

setShowError

public void setShowError(boolean b)
Parameters:
b - true if error information should be shown, false otherwise

getMinimumPointSize

public double getMinimumPointSize()
Returns:
the minimum size which all datapoints must be

setMinimumPointSize

public void setMinimumPointSize(double d)
Parameters:
d - the minimum size which all datapoints must be

isAutoZoom

public boolean isAutoZoom()
You can turn autozoom off if you want to zoom in on data.

Returns:
true if autozoom (which automatically scales the dataset to the screen) is on, false otherwise.

setAutoZoom

public void setAutoZoom(boolean b)
Parameters:
b - true if autozoom (which automatically scales the dataset to the screen) is on, false otherwise.

getOnOffBox

public javax.swing.JCheckBox getOnOffBox()


for more information see hisee.sourceforge.net