jas2.hist
Class StatisticsBlock
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- jas2.plot.PlotComponent
-
- jas2.plot.MovableObject
-
- jas2.plot.TextBlock
-
- jas2.hist.StatisticsBlock
-
- All Implemented Interfaces:
- HasPopupItems, JASPlotMouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.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 jas2.util.ScientificFormat.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field and Description static intLEFTALIGNSPLITstatic intNOALIGNSPLITstatic intRIGHTALIGNSPLITstatic intSHOWTITLES_ALWAYSstatic intSHOWTITLES_AUTOMATICstatic intSHOWTITLES_NEVER-
Fields inherited from class jas2.plot.MovableObject
bgcolors, bgnames
-
Fields inherited from class jas2.plot.PlotComponent
BEVEL_IN, BEVEL_OUT, ETCHED, LINE, NONE, OTHER, SHADOW
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor and Description StatisticsBlock()StatisticsBlock(java.text.Format g)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(JASHistData data)Adds a Statistcs element to the Vector stats if not nullvoidclear()Clears the Vector stats and titles.java.text.FormatgetFormat()Returns the current formatting object;java.lang.StringgetLine(int j)Returns a line to be displayed in the statistics block as a String.intgetNLines()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.java.lang.String[]getSelectedEntries()Returns the statistics to be formatted and displayed in the block as a String of stat names.intgetShowTitles()Returns the (int) showtitles which has three values:SHOWTITLES_ALWAYS, SHOWTITLES_NEVER, SHOWTITLES_AUTOMATIC.intgetSplitStringAlign()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'.java.lang.String[]getStatNames()Returns an array of stat names corresponding to every different stat name in the Vector stats.voidmodifyPopupMenu(javax.swing.JPopupMenu menu, java.awt.Component source)Modify the given menu object.voidputFormat(java.lang.Class c, java.text.Format f)voidremove(JASHistData data)Removes a Statistcs element from the Vector stats and the corresponding data set title from the titles Vector.voidsetFormat(java.text.Format g)Sets the number formating object.voidsetSelectedEntries(java.lang.String[] s)Sets the statistics to be formatted and displayed in the block as a String of stat names.voidsetShowTitles(int settitles)Sets the (int) showtitles to one of three values:SHOWTITLES_ALWAYS, SHOWTITLES_NEVER, SHOWTITLES_AUTOMATIC.voidsetSplitStringAlign(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 jas2.plot.TextBlock
getPreferredSize, paintComponent, setFont
-
Methods inherited from class jas2.plot.MovableObject
getBorderType, getInsideBorder, hasBeenMoved, hasBeenResized, hasDefaultLayout, mouseEventNotify, moveMovableObject, print, resizeMovableObject, restoreDefaultLayout, setBorder, setMovableObjectBounds, setMovableObjectBounds
-
Methods inherited from class jas2.plot.PlotComponent
isPaintingBackground, setBackground, setBorderType
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, 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, 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, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
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
-
-
Constructor Detail
-
StatisticsBlock
public StatisticsBlock()
-
StatisticsBlock
public StatisticsBlock(java.text.Format g)
-
-
Method Detail
-
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.
-
getLine
public java.lang.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.
-
setSelectedEntries
public void setSelectedEntries(java.lang.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.jas2.hist.StatsWindow).
-
getSelectedEntries
public java.lang.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 java.lang.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.jas2.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(java.text.Format g)
Sets the number formating object. If a statistics window is user generated the format is set to base.jas2.util.ScientificFormat and this method is invoked by each click of the apply and ok buttons
-
getFormat
public java.text.Format getFormat()
Returns the current formatting object;
-
putFormat
public void putFormat(java.lang.Class c, java.text.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:
getSplitStringAlignin classTextBlock
-
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(javax.swing.JPopupMenu menu, java.awt.Component source)Description copied from interface:HasPopupItemsModify the given menu object.- Specified by:
modifyPopupMenuin interfaceHasPopupItems- Overrides:
modifyPopupMenuin classTextBlock
-
-
DataMelt 3.0 © DataMelt by jWork.ORG