edu.uah.math.devices
Class CriticalGraph

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.uah.math.devices.Graph
                      extended by edu.uah.math.devices.DistributionGraph
                          extended by edu.uah.math.devices.CriticalGraph
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class CriticalGraph
extends DistributionGraph
implements java.io.Serializable

This class defines a graph used in interval estimation and hypothesis testing experiments. The graph shows the density of specified random varaiable and an interval along the x-axis. The random critical value is shown as a red vertical line. The event of interest is whether the critical value falls in the the specified interval.

Version:
August, 2003
Author:
Kyle Siegrist, Dawn Duehring
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
 
Fields inherited from class edu.uah.math.devices.DistributionGraph
CDF, MAD, MSD, NONE, PDF
 
Fields inherited from class edu.uah.math.devices.Graph
ABOVE, BELOW, HORIZONTAL, LEFT, RIGHT, showModelDistribution, VERTICAL
 
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
CriticalGraph()
          This default constructor creates a new critical graph with a normally distributed random variable.
CriticalGraph(Distribution d)
          This general constructor creates a new critical graph with a specified distribution.
 
Method Summary
 java.awt.Color getIntervalColor()
          This method returns the interval color.
 double getLowerCritical()
          This method returns the lower critical value.
 double getUpperCritical()
          This method gets the upper critical value.
 double getValue()
          This method returns the value of the test statistic.
 java.awt.Color getValueColor()
          This method returns the value color.
 boolean isSuccess()
          This method returns the boolean value of the success event.
 boolean isValueDrawn()
          This method returns the boolean condition for drawing the empirical value.
 void paintComponent(java.awt.Graphics g)
          This method paints the graph.
 void setCriticalValues(double lc, double uc)
          This method sets the critical values.
 void setIntervalColor(java.awt.Color c)
          This method sets the color for the interval.
 void setLowerCritical(double lc)
          This method sets the lower critical value.
 void setUpperCritical(double uc)
          This method sets the upper critical value.
 void setValue()
          This emthod sets the value of the test statistic to a value simulated from the distribution.
 void setValue(double x)
          This method sets the value of the test statistic.
 void setValueColor(java.awt.Color c)
          This method sets the color for the value.
 void setValueDrawn(boolean b)
          This method sets the boolean condition for drawing the empirical value.
 
Methods inherited from class edu.uah.math.devices.DistributionGraph
drawCDF, drawDistributionMSD, drawDistributionPDF, getDistribution, getDistributionColor, getDomain, getFunctionType, getMomentType, reset, setDistribution, setDistributionColor, setDomain, setFunctionType, setMomentType, setYMax
 
Methods inherited from class edu.uah.math.devices.Graph
drawAxis, drawAxis, drawAxis, drawBox, drawBox, drawBoxPlot, drawBoxPlot, drawCircle, drawLabel, drawLine, drawPoint, drawTick, drawTick, fillBox, fillBox, fillBoxPlot, fillBoxPlot, fillCircle, format, getBottomMargin, getLeftMargin, getPointSize, getRightMargin, getTopMargin, getXGraph, getXMax, getXMin, getXPixels, getXScale, getYGraph, getYMax, getYMin, getYPixels, getYScale, setMargins, setPointSize, setScale, setShowModelDistribution
 
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
 

Constructor Detail

CriticalGraph

public CriticalGraph(Distribution d)
This general constructor creates a new critical graph with a specified distribution.

Parameters:
d - the distribution that governs the test statistic

CriticalGraph

public CriticalGraph()
This default constructor creates a new critical graph with a normally distributed random variable.

Method Detail

setCriticalValues

public void setCriticalValues(double lc,
                              double uc)
This method sets the critical values. These are used to define the interval that is shown as a horizontal bar.

Parameters:
lc - the lower critical value
uc - the upper critical value

setLowerCritical

public void setLowerCritical(double lc)
This method sets the lower critical value.

Parameters:
lc - the lower critical value

getLowerCritical

public double getLowerCritical()
This method returns the lower critical value.

Returns:
the lower critical value

setUpperCritical

public void setUpperCritical(double uc)
This method sets the upper critical value.

Parameters:
uc - the upper critical value

getUpperCritical

public double getUpperCritical()
This method gets the upper critical value.

Returns:
the upper critical value

setValue

public void setValue(double x)
This method sets the value of the test statistic.

Parameters:
x - the value

getValue

public double getValue()
This method returns the value of the test statistic.

Returns:
the value

setValue

public void setValue()
This emthod sets the value of the test statistic to a value simulated from the distribution.


paintComponent

public void paintComponent(java.awt.Graphics g)
This method paints the graph.

Overrides:
paintComponent in class DistributionGraph
Parameters:
g - the graphcis context

setIntervalColor

public void setIntervalColor(java.awt.Color c)
This method sets the color for the interval.

Parameters:
c - the interval color

getIntervalColor

public java.awt.Color getIntervalColor()
This method returns the interval color.

Returns:
the interval color

setValueColor

public void setValueColor(java.awt.Color c)
This method sets the color for the value.

Parameters:
c - the value color

getValueColor

public java.awt.Color getValueColor()
This method returns the value color.

Returns:
the value color

isSuccess

public boolean isSuccess()
This method returns the boolean value of the success event. This event occurs if the test value is in the critical interval.

Returns:
true if the test value is in the critical interval

setValueDrawn

public void setValueDrawn(boolean b)
This method sets the boolean condition for drawing the empirical value.

Parameters:
b - true if the value is drawn.

isValueDrawn

public boolean isValueDrawn()
This method returns the boolean condition for drawing the empirical value.

Returns:
true if the value is drawn