edu.ucla.stat.SOCR.util
Class ModelerHistogram

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by edu.ucla.stat.SOCR.util.Graph
                      extended by edu.ucla.stat.SOCR.util.varHistogram
                          extended by edu.ucla.stat.SOCR.util.ModelerHistogram
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
NormalCurve

public class ModelerHistogram
extends varHistogram
implements java.awt.event.MouseListener

This class models an interactive histogram. The user can click on the horizontal axes to add points to the data set.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
 
Field Summary
protected  boolean drawUserClicks
           
protected  double graphLeft
           
protected  double graphRight
           
 double maxY
           
protected  int modelCount
           
 double[] modelX
           
 double[] modelX1
           
 double[] modelX2
           
 double[] modelY
           
 double[] modelY1
           
 double[] modelY2
           
protected static int MULTIPLE_DEFAULT_VALUE
           
 java.util.Vector<java.lang.Double> rawDat
           
 
Fields inherited from class edu.ucla.stat.SOCR.util.varHistogram
axisType, BOX, currentXLowerBound, currentXUpperBound, DENSITY, domain, FREQ, intervals, listOfTicks, MAD, MMM, modelType, MSD, NONE, REL_FREQ, summaryStats, type
 
Fields inherited from class edu.ucla.stat.SOCR.util.Graph
ABOVE, BELOW, bottomMargin, BOUNDS, HORIZONTAL, LEFT, leftMargin, MIDPOINTS, pointSize, RIGHT, rightMargin, showModelDistribution, topMargin, VERTICAL, xMax, xMin, yMax, yMin
 
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
ModelerHistogram()
           
ModelerHistogram(double a, double b, double w)
          This general constructor creates a new interactive histogram corresponding to a specified domain.
 
Method Summary
 void addDataPoint()
           
 void clear()
          This method resets the interactive histogram.
 int getdataCursor()
           
 double getMaxInputX()
           
 int getMaxInputY()
           
 int getMaxRawY()
           
 double getMaxX()
           
 double getMaxY()
           
 double getMinInputX()
           
 double getMinX()
           
 double getMinY()
           
 java.awt.Color getOutlineColor()
           
 java.awt.Color getOutlineColor1()
           
 java.awt.Color getOutlineColor2()
           
 double getValue()
          This method returns the last value.
 double getValue(int i)
          This method returns the values from the data set.
 float[] getXData()
           
 float[] getYData()
           
 double maxV(java.util.Vector<java.lang.Double> vals)
           
 double minV(java.util.Vector<java.lang.Double> vals)
           
 void mouseClicked(java.awt.event.MouseEvent event)
          This method handles the events corresponding to mouse clicks.
 void mouseEntered(java.awt.event.MouseEvent event)
           
 void mouseExited(java.awt.event.MouseEvent event)
           
 void mousePressed(java.awt.event.MouseEvent event)
           
 void mouseReleased(java.awt.event.MouseEvent event)
           
 void paintComponent(java.awt.Graphics g)
          This method paints the graph of the getDensity function, empirical getDensity function, moment bar, and empirical moment bar
 void panLeft()
           
 void panRight()
           
 void resetGraphLimits()
           
 void setBarWidth(double input)
           
 void setBins(int n)
           
 void setDrawUserClicks(boolean flag)
           
 void setGraphLeft(double input)
           
 void setGraphRight(double input)
           
 void setHistogramLeft(double input)
           
 void setHistogramRight(double input)
           
 void setIntervalData()
           
 void setLeft(double input)
           
 void setModel(int cnt, double[] xMod, double[] yMod)
           
 void setModelCount(int ct)
           
 void setModelType(int modelType)
           
 void setModelX(double[] input)
           
 void setModelY(double[] input)
           
 void setOutlineColor(java.awt.Color color)
           
 void setOutlineColor1(java.awt.Color color)
           
 void setOutlineColor2(java.awt.Color color)
           
 void setRight(double input)
           
 void setTwoModel(int cnt, double[] xMod1, double[] yMod1, double[] xMod2, double[] yMod2)
           
 void setTwoModel(int cnt, double[] xMod1, double[] yMod1, double[] xMod2, double[] yMod2, java.awt.Color color1, java.awt.Color color2)
           
 void setWidth(double width)
          This method sets the width of the domain.
 void setXExtrema(float a, float b)
           
 void setxy(float[] raw)
           
 void setYExtrema(float a, float b)
           
 void setZoomInIntervalData()
           
 void setZoomOutIntervalData()
           
 int zoomIn()
           
 int zoomOut()
           
 
Methods inherited from class edu.ucla.stat.SOCR.util.varHistogram
getIntervalData, getListOfTicks, setAxisType, setIntervalData, setListOfTicks, setPlotXMax, setPlotXMin, setPlotYMax, setPlotYMin, setType, setxMax, setxMin, setyMax, showSummaryStats
 
Methods inherited from class edu.ucla.stat.SOCR.util.Graph
drawAxis, drawAxis, drawAxis, drawAxis, drawAxis, drawAxis, drawAxisWithDomain, drawBox, drawBox, drawBoxPlot, drawBoxPlot, drawCircle, drawLabel, drawLine, drawPoint, drawTick, drawTick, fillBox, fillBox, fillBoxPlot, fillBoxPlot, fillCircle, format, getPointSize, getXMax, getXMin, getYMax, getYMin, isReal, main, setMargins, setPointSize, setScale, setShowModelDistribution, xGraph, xGraphDouble, xGraphInverse, xPixels, xScale, yGraph, yGraphDouble, yGraphInverse, yPixels, yScale
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, 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

rawDat

public java.util.Vector<java.lang.Double> rawDat

modelX

public double[] modelX

modelY

public double[] modelY

modelX1

public double[] modelX1

modelY1

public double[] modelY1

modelX2

public double[] modelX2

modelY2

public double[] modelY2

graphLeft

protected double graphLeft

graphRight

protected double graphRight

modelCount

protected int modelCount

maxY

public double maxY

MULTIPLE_DEFAULT_VALUE

protected static int MULTIPLE_DEFAULT_VALUE

drawUserClicks

protected boolean drawUserClicks
Constructor Detail

ModelerHistogram

public ModelerHistogram(double a,
                        double b,
                        double w)
This general constructor creates a new interactive histogram corresponding to a specified domain.


ModelerHistogram

public ModelerHistogram()
Method Detail

setDrawUserClicks

public void setDrawUserClicks(boolean flag)

setLeft

public void setLeft(double input)

setRight

public void setRight(double input)

setGraphLeft

public void setGraphLeft(double input)

setGraphRight

public void setGraphRight(double input)

setBarWidth

public void setBarWidth(double input)

setIntervalData

public void setIntervalData()

setZoomInIntervalData

public void setZoomInIntervalData()

setZoomOutIntervalData

public void setZoomOutIntervalData()

setBins

public void setBins(int n)

panRight

public void panRight()

panLeft

public void panLeft()

zoomIn

public int zoomIn()

zoomOut

public int zoomOut()

setModelType

public void setModelType(int modelType)
Overrides:
setModelType in class varHistogram

paintComponent

public void paintComponent(java.awt.Graphics g)
Description copied from class: varHistogram
This method paints the graph of the getDensity function, empirical getDensity function, moment bar, and empirical moment bar

Overrides:
paintComponent in class varHistogram

setWidth

public void setWidth(double width)
This method sets the width of the domain. A new interval data set is created, and the values are added to the data set.


clear

public void clear()
This method resets the interactive histogram.


resetGraphLimits

public void resetGraphLimits()

getValue

public double getValue(int i)
This method returns the values from the data set.


getValue

public double getValue()
This method returns the last value.


mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
This method handles the events corresponding to mouse clicks.

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

addDataPoint

public void addDataPoint()

setModel

public void setModel(int cnt,
                     double[] xMod,
                     double[] yMod)

setTwoModel

public void setTwoModel(int cnt,
                        double[] xMod1,
                        double[] yMod1,
                        double[] xMod2,
                        double[] yMod2)

setTwoModel

public void setTwoModel(int cnt,
                        double[] xMod1,
                        double[] yMod1,
                        double[] xMod2,
                        double[] yMod2,
                        java.awt.Color color1,
                        java.awt.Color color2)

getdataCursor

public int getdataCursor()

getXData

public float[] getXData()

getYData

public float[] getYData()

setxy

public void setxy(float[] raw)

setXExtrema

public void setXExtrema(float a,
                        float b)

setYExtrema

public void setYExtrema(float a,
                        float b)

getMinX

public double getMinX()

getMaxX

public double getMaxX()

getMinY

public double getMinY()

getMaxY

public double getMaxY()

minV

public double minV(java.util.Vector<java.lang.Double> vals)

maxV

public double maxV(java.util.Vector<java.lang.Double> vals)

setModelCount

public void setModelCount(int ct)

setModelX

public void setModelX(double[] input)

setModelY

public void setModelY(double[] input)

setOutlineColor

public void setOutlineColor(java.awt.Color color)

getOutlineColor

public java.awt.Color getOutlineColor()

setOutlineColor1

public void setOutlineColor1(java.awt.Color color)

getOutlineColor1

public java.awt.Color getOutlineColor1()

setOutlineColor2

public void setOutlineColor2(java.awt.Color color)

getOutlineColor2

public java.awt.Color getOutlineColor2()

setHistogramRight

public void setHistogramRight(double input)

setHistogramLeft

public void setHistogramLeft(double input)

getMaxInputX

public double getMaxInputX()

getMinInputX

public double getMinInputX()

getMaxInputY

public int getMaxInputY()

getMaxRawY

public int getMaxRawY()