Documentation of 'jas2.hist.StatisticsBlock' Java class
StatisticsBlock
jas2.hist

Class 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

      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.BaselineResizeBehavior
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(JASHistData data)
      Adds a Statistcs element to the Vector stats if not null
      void clear()
      Clears the Vector stats and titles.
      java.text.Format getFormat()
      Returns the current formatting object;
      java.lang.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.
      java.lang.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'.
      java.lang.String[] getStatNames()
      Returns an array of stat names corresponding to every different stat name in the Vector stats.
      void modifyPopupMenu(javax.swing.JPopupMenu menu, java.awt.Component source)
      Modify the given menu object.
      void putFormat(java.lang.Class c, java.text.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(java.text.Format g)
      Sets the number formating object.
      void setSelectedEntries(java.lang.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 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
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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.
        Specified by:
        getNLines in class TextBlock
      • 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.
        Specified by:
        getLine in class TextBlock
      • 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:
        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.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.