jas.hist
Class StatisticsBlock
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
jas.plot.PlotComponent
jas.plot.MovableObject
jas.plot.TextBlock
jas.hist.StatisticsBlock
- All Implemented Interfaces:
- HasPopupItems, JASPlotMouseListener, ImageObserver, MenuContainer, Serializable
public class StatisticsBlock
- extends TextBlock
The main class used to display and format statistics.
When a user selects showStatistics from the plots popupmenu, a statistics text block
is displayed showing each displayed plots' statistics (Vector stats) and name. The statistics block
requires a number formatting method to be set (setFormat), the default method is
implemented by jas.util.ScientificFormat.
- See Also:
- Serialized Form
Method Summary |
void |
add(JASHistData data)
Adds a Statistcs element to the Vector stats if not null |
void |
clear()
Clears the Vector stats and titles. |
Format |
getFormat()
Returns the current formatting object; |
String |
getLine(int j)
Returns a line to be displayed in the statistics block as a String. |
int |
getNLines()
Calculates and returns the total number of lines to be displayed in the statistics block,
including a draw line seperator, plot title (if available) and formatted
statistics for each data set displayed in the plot area. |
String[] |
getSelectedEntries()
Returns the statistics to be formatted and displayed in the block as a String of
stat names. |
int |
getShowTitles()
Returns the (int) showtitles which has three values:SHOWTITLES_ALWAYS,
SHOWTITLES_NEVER, SHOWTITLES_AUTOMATIC. |
int |
getSplitStringAlign()
When implemented, getSplitStringAlignment() should return an integer between 1 and 3
corresponding to the chosen alignment for the second half of strings split by '\t'. |
String[] |
getStatNames()
Returns an array of stat names corresponding to every different stat name in the
Vector stats. |
void |
modifyPopupMenu(JPopupMenu menu,
Component source)
Modify the given menu object. |
void |
putFormat(Class c,
Format f)
|
void |
remove(JASHistData data)
Removes a Statistcs element from the Vector stats and the corresponding data set
title from the titles Vector. |
void |
setFormat(Format g)
Sets the number formating object. |
void |
setSelectedEntries(String[] s)
Sets the statistics to be formatted and displayed in the block as a String of
stat names. |
void |
setShowTitles(int settitles)
Sets the (int) showtitles to one of three values:SHOWTITLES_ALWAYS,
SHOWTITLES_NEVER, SHOWTITLES_AUTOMATIC. |
void |
setSplitStringAlign(int a)
When implemented, setSplitStringAlignment() should set an integer between 1 and 3
corresponding to the chosen alignment for the second half of strings split by '\t'. |
Methods inherited from class jas.plot.MovableObject |
getBorderType, getInsideBorder, getPrefix, hasBeenMoved, hasBeenResized, hasDefaultLayout, mouseEventNotify, moveMovableObject, print, resizeMovableObject, restoreDefaultLayout, setBorder, setMovableObjectBounds, setMovableObjectBounds |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, 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, 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 |
SHOWTITLES_ALWAYS
public static final int SHOWTITLES_ALWAYS
- See Also:
- Constant Field Values
SHOWTITLES_NEVER
public static final int SHOWTITLES_NEVER
- See Also:
- Constant Field Values
SHOWTITLES_AUTOMATIC
public static final int SHOWTITLES_AUTOMATIC
- See Also:
- Constant Field Values
LEFTALIGNSPLIT
public static final int LEFTALIGNSPLIT
- See Also:
- Constant Field Values
RIGHTALIGNSPLIT
public static final int RIGHTALIGNSPLIT
- See Also:
- Constant Field Values
NOALIGNSPLIT
public static final int NOALIGNSPLIT
- See Also:
- Constant Field Values
StatisticsBlock
public StatisticsBlock()
StatisticsBlock
public StatisticsBlock(Format g)
getNLines
public int getNLines()
- Calculates and returns the total number of lines to be displayed in the statistics block,
including a draw line seperator, plot title (if available) and formatted
statistics for each data set displayed in the plot area.
- Specified by:
getNLines
in class TextBlock
getLine
public String getLine(int j)
- Returns a line to be displayed in the statistics block as a String. If the line
corresponding to index j is a statisic, the stat (double) is formated by the set
formatting method and returned with the stat name to be displayed. Also returned
are Strings that generate a line Seperator ("\n") in the statistics block and the
data set title.
- Specified by:
getLine
in class TextBlock
setSelectedEntries
public void setSelectedEntries(String[] s)
- Sets the statistics to be formatted and displayed in the block as a String of
stat names. If called, only the stats corresponding to these names are
formatted and displayed. This method is invoked when "Statistics Properties.."
popup is invoked (base.jas.hist.StatsWindow).
getSelectedEntries
public String[] getSelectedEntries()
- Returns the statistics to be formatted and displayed in the block as a String of
stat names. If selectedentries != null, only the stats corresponding to
these names are formatted and displayed.
getStatNames
public String[] getStatNames()
- Returns an array of stat names corresponding to every different stat name in the
Vector stats. These are the stat names listed in the popup window base.jas.util.StatsWindow
add
public void add(JASHistData data)
- Adds a Statistcs element to the Vector stats if not null
remove
public void remove(JASHistData data)
- Removes a Statistcs element from the Vector stats and the corresponding data set
title from the titles Vector.
clear
public void clear()
- Clears the Vector stats and titles. No statistics are available
setFormat
public void setFormat(Format g)
- Sets the number formating object. If a statistics window is user generated the format
is set to base.jas.util.ScientificFormat and this method is invoked by
each click of the apply and ok buttons
getFormat
public Format getFormat()
- Returns the current formatting object;
putFormat
public void putFormat(Class c,
Format f)
getSplitStringAlign
public int getSplitStringAlign()
- When implemented, getSplitStringAlignment() should return an integer between 1 and 3
corresponding to the chosen alignment for the second half of strings split by '\t'.
For leftalignment: return 1. For rightaignment: return 2. For noalignment: return 3.
- Specified by:
getSplitStringAlign
in class TextBlock
setSplitStringAlign
public void setSplitStringAlign(int a)
- When implemented, setSplitStringAlignment() should set an integer between 1 and 3
corresponding to the chosen alignment for the second half of strings split by '\t'.
For leftalignment: return 1. For rightalignment: return 2. For noalignment: return 3.
setShowTitles
public void setShowTitles(int settitles)
- Sets the (int) showtitles to one of three values:SHOWTITLES_ALWAYS,
SHOWTITLES_NEVER, SHOWTITLES_AUTOMATIC. The value controls when a plot title is
displayed in the stat block. If showtitles = SHOWTITLES_AUTOMATIC then titles will
be displayed if there is more than one plot displayed.
getShowTitles
public int getShowTitles()
- Returns the (int) showtitles which has three values:SHOWTITLES_ALWAYS,
SHOWTITLES_NEVER, SHOWTITLES_AUTOMATIC. The value controls when a plot title is
displayed in the stat block. If showtitles = SHOWTITLES_AUTOMATIC then titles will
be displayed if there is more than one plot displayed.
modifyPopupMenu
public void modifyPopupMenu(JPopupMenu menu,
Component source)
- Description copied from interface:
HasPopupItems
- Modify the given menu object.
- Specified by:
modifyPopupMenu
in interface HasPopupItems
- Overrides:
modifyPopupMenu
in class TextBlock
Copyright © 2000-2009 FreeHEP. All Rights Reserved.