edu.ucla.stat.SOCR.modeler.gui
Class ModelerGui
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
edu.ucla.stat.SOCR.modeler.gui.ModelerGui
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, java.util.Observer, javax.accessibility.Accessible, javax.swing.RootPaneContainer
public class ModelerGui
- extends javax.swing.JApplet
- implements java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.Observer
This class defines a basic modeler object. Typically, the user generates some data by drawing with the mouse or reading URL/files. Then a model for the data is developed to fit the data. Usually the model has analytical (in terms of standard math functions), digital (discrete form of the analytical model) and graphical (visualization) components/representations.
This class must be sub-classed by any SOCR Modeler Object to add the appropriate functionality.
This class needs to be implemented fully. It's not complete as of Aug. 2003.
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class javax.swing.JApplet |
javax.swing.JApplet.AccessibleJApplet |
Nested classes/interfaces inherited from class java.applet.Applet |
java.applet.Applet.AccessibleApplet |
Nested classes/interfaces inherited from class java.awt.Panel |
java.awt.Panel.AccessibleAWTPanel |
Nested classes/interfaces inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Fields inherited from class javax.swing.JApplet |
accessibleContext, rootPane, rootPaneCheckingEnabled |
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 |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent event)
This method handles the events for the About button and the Reset button. |
void |
addTabbedPane(java.lang.String name,
javax.swing.JComponent c)
|
void |
clearData()
|
void |
clearDataTable()
|
void |
dataTableUpdated()
|
double |
findMaxInput(float[] inputArray)
|
double |
findMinInput(float[] inputArray)
|
void |
fitC()
|
void |
fitC(boolean status)
|
void |
fitC(boolean rescaleClicked,
boolean status,
boolean reinitMixtureModel)
|
void |
focusGained(java.awt.event.FocusEvent e)
|
void |
focusLost(java.awt.event.FocusEvent e)
|
java.lang.String |
getAppletInfo()
This method returns basic copyright information |
static Modeler |
getInstance(java.lang.String classname)
|
java.lang.String |
getOnlineDescription()
This method returns an online description of this Model. |
int |
getXScaleMax()
|
int |
getYScaleMax()
|
float[] |
histBins(float[] xdata,
float minx,
float maxx)
|
void |
histToRaw()
|
void |
init()
|
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
void |
mouseClicked(java.awt.event.MouseEvent event)
|
void |
mouseDragged(java.awt.event.MouseEvent event)
|
void |
mouseEntered(java.awt.event.MouseEvent event)
|
void |
mouseExited(java.awt.event.MouseEvent event)
|
void |
mouseMoved(java.awt.event.MouseEvent event)
|
void |
mousePressed(java.awt.event.MouseEvent event)
|
void |
mouseReleased(java.awt.event.MouseEvent event)
|
void |
panLeft()
|
void |
panRight()
|
void |
rawToHist()
|
void |
reset()
This is the method for resetting the Model and should be overridden. |
void |
setBins(int bins)
|
void |
setCodeBase(java.net.URL codebase)
|
void |
setDataFromFile(float[] xData,
float[] yData)
|
void |
setDebug(boolean s)
|
void |
setGuiLink(SOCRModeler l)
|
void |
setRawData(boolean isRaw)
|
void |
setxMax(double input)
|
void |
setxMin(double input)
|
void |
setXScale(double XSize,
boolean positiveOnly)
|
void |
setXScaleMax(double XSize)
|
void |
setXScaleMin(double XSize)
|
void |
setYScale(double YSize)
|
void |
setYScaleMax(double YSize)
|
void |
start()
This method sets up the About dialog box |
void |
syncData()
|
void |
syncMouseData()
|
void |
toggleParams(boolean isTrue)
|
void |
update(java.util.Observable arg0,
java.lang.Object arg1)
|
void |
updateScale(double xMin,
double xMax,
double yMin,
double yMax,
int bins)
|
boolean |
useInitButton()
|
int |
zoomIn(int bins,
boolean positiveOnly)
|
void |
zoomInY(double maxY,
boolean positiveOnly)
|
int |
zoomOut(int bins,
boolean positiveOnly)
|
Methods inherited from class javax.swing.JApplet |
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.applet.Applet |
destroy, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, stop |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
clipboard
public java.awt.datatransfer.Clipboard clipboard
xhist
public float[] xhist
yhist
public float[] yhist
rawDat
public float[] rawDat
histBinNos
public int histBinNos
scale
public int scale
modelXData
public double[] modelXData
modelYData
public double[] modelYData
model
public JSci.awt.DefaultGraph2DModel model
scaleUp
public boolean scaleUp
modelType
public int modelType
modelObject
public Modeler modelObject
dataPanel
protected javax.swing.JPanel dataPanel
resultPanel
protected javax.swing.JPanel resultPanel
graphPanel
protected javax.swing.JPanel graphPanel
datGenPanel
protected javax.swing.JPanel datGenPanel
infoPanel
protected javax.swing.JPanel infoPanel
tabbedPanelContainer
public javax.swing.JTabbedPane tabbedPanelContainer
resultPanelTextArea
public javax.swing.JTextArea resultPanelTextArea
infoPanelTextArea
public javax.swing.JTextArea infoPanelTextArea
dataTable
public SOCRJTable dataTable
headerTable
public javax.swing.JTable headerTable
DataPts
public javax.swing.JTextField DataPts
lDataPts
public javax.swing.JLabel lDataPts
tModel
public javax.swing.table.DefaultTableModel tModel
dataObject
public java.lang.Object[][] dataObject
dataText
protected java.lang.String dataText
columnNumber
public int columnNumber
rowNumber
public int rowNumber
columnNames
public java.lang.String[] columnNames
GUI_UPPER_LIMIT
public static final double GUI_UPPER_LIMIT
- See Also:
- Constant Field Values
GUI_LOWER_LIMIT
public static final double GUI_LOWER_LIMIT
- See Also:
- Constant Field Values
defaultXMax
public double defaultXMax
defaultXMin
public double defaultXMin
defaultYMin
public double defaultYMin
defaultYMax
public double defaultYMax
graph
public ModelerHistogramGraph graph
samplePanel
public sampler samplePanel
pLoader
public PluginLoader pLoader
VALUE_COLUMN_NAME
public static final java.lang.String VALUE_COLUMN_NAME
- This method initializes the experiment
- See Also:
- Constant Field Values
FREQUENCY_COLUMN_NAME
public static final java.lang.String FREQUENCY_COLUMN_NAME
- See Also:
- Constant Field Values
DEFAULT_MAX_X
public static final double DEFAULT_MAX_X
- See Also:
- Constant Field Values
DEFAULT_MAX_Y
public static final double DEFAULT_MAX_Y
- See Also:
- Constant Field Values
DEFAULT_MIN_X
public static final double DEFAULT_MIN_X
- See Also:
- Constant Field Values
ModelerGui
public ModelerGui()
setDebug
public void setDebug(boolean s)
setCodeBase
public void setCodeBase(java.net.URL codebase)
setGuiLink
public void setGuiLink(SOCRModeler l)
init
public void init()
- Overrides:
init
in class java.applet.Applet
getInstance
public static Modeler getInstance(java.lang.String classname)
throws java.lang.Exception
- Throws:
java.lang.Exception
fitC
public void fitC(boolean rescaleClicked,
boolean status,
boolean reinitMixtureModel)
fitC
public void fitC(boolean status)
fitC
public void fitC()
syncMouseData
public void syncMouseData()
syncData
public void syncData()
getAppletInfo
public java.lang.String getAppletInfo()
- This method returns basic copyright information
- Overrides:
getAppletInfo
in class java.applet.Applet
start
public void start()
- This method sets up the About dialog box
- Overrides:
start
in class java.applet.Applet
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
- This method handles the events for the About button and the Reset button.
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent event)
- Specified by:
mouseClicked
in interface java.awt.event.MouseListener
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent event)
- Specified by:
mouseEntered
in interface java.awt.event.MouseListener
mouseExited
public void mouseExited(java.awt.event.MouseEvent event)
- Specified by:
mouseExited
in interface java.awt.event.MouseListener
mousePressed
public void mousePressed(java.awt.event.MouseEvent event)
- Specified by:
mousePressed
in interface java.awt.event.MouseListener
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent event)
- Specified by:
mouseReleased
in interface java.awt.event.MouseListener
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent event)
- Specified by:
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent event)
- Specified by:
mouseDragged
in interface java.awt.event.MouseMotionListener
reset
public void reset()
- This is the method for resetting the Model and should be overridden.
getOnlineDescription
public java.lang.String getOnlineDescription()
- This method returns an online description of this Model.
It should be overwritten by each specific Modeler.
addTabbedPane
public void addTabbedPane(java.lang.String name,
javax.swing.JComponent c)
clearDataTable
public void clearDataTable()
clearData
public void clearData()
toggleParams
public void toggleParams(boolean isTrue)
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
- Specified by:
keyPressed
in interface java.awt.event.KeyListener
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
- Specified by:
keyReleased
in interface java.awt.event.KeyListener
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
- Specified by:
keyTyped
in interface java.awt.event.KeyListener
focusGained
public void focusGained(java.awt.event.FocusEvent e)
- Specified by:
focusGained
in interface java.awt.event.FocusListener
focusLost
public void focusLost(java.awt.event.FocusEvent e)
- Specified by:
focusLost
in interface java.awt.event.FocusListener
rawToHist
public void rawToHist()
histBins
public float[] histBins(float[] xdata,
float minx,
float maxx)
histToRaw
public void histToRaw()
setBins
public void setBins(int bins)
setXScale
public void setXScale(double XSize,
boolean positiveOnly)
setXScaleMax
public void setXScaleMax(double XSize)
setXScaleMin
public void setXScaleMin(double XSize)
setYScaleMax
public void setYScaleMax(double YSize)
getYScaleMax
public int getYScaleMax()
getXScaleMax
public int getXScaleMax()
setYScale
public void setYScale(double YSize)
panLeft
public void panLeft()
panRight
public void panRight()
zoomIn
public int zoomIn(int bins,
boolean positiveOnly)
zoomOut
public int zoomOut(int bins,
boolean positiveOnly)
zoomInY
public void zoomInY(double maxY,
boolean positiveOnly)
setxMax
public void setxMax(double input)
setxMin
public void setxMin(double input)
updateScale
public void updateScale(double xMin,
double xMax,
double yMin,
double yMax,
int bins)
useInitButton
public boolean useInitButton()
findMaxInput
public double findMaxInput(float[] inputArray)
findMinInput
public double findMinInput(float[] inputArray)
setDataFromFile
public void setDataFromFile(float[] xData,
float[] yData)
setRawData
public void setRawData(boolean isRaw)
dataTableUpdated
public void dataTableUpdated()
update
public void update(java.util.Observable arg0,
java.lang.Object arg1)
- Specified by:
update
in interface java.util.Observer