jvx.number

## Class PuHistogram

- java.lang.Object
- - jv.object.PsObject
  - - jvx.number.PuHistogram

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf

      public final class PuHistogram
      extends PsObject

  General purpose histogram.
  Since:
    JavaView 3.99.045 moved to jvx from dev.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `COUNT_ABSOLUTE`
    `static int` | `COUNT_RELATIVE`
    `static java.awt.Color` | `DEFAULT_FILL_COLOR`
    `static java.awt.Font` | `DEFAULT_FONT_LABELS`
    `static int` | `NUMBINS_FD`
    `static int` | `NUMBINS_SCOTT`
    `static int` | `NUMBINS_STURGES`
    `static int` | `NUMBINS_USER`

    - ### Fields inherited from class jv.object.PsObject

      `HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PuHistogram(java.lang.String name, PsUpdateIf parent)` Create new instance with given name and parent.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.awt.Color` | `getBackground()` Get color of background of info panel.
    `int` | `getClassType()` Get the class type which determines computation of number of bins.
    `int` | `getCountType()` Get the count type which determines counting of number of items per bin.
    `int` | `getNumBins()` Get the width of individual bins.
    `PdVector` | `getSampleBnd()` Get user defined bounds of samples.
    `void` | `init()` Assign default values, and may be used to reset instance.
    `boolean` | `isEnabled()` Check whether slider is enabled or disabled.
    `boolean` | `isEnabledSampleBnd()` Determines if manual limits of sample data are enabled.
    `boolean` | `isEnabledShowAxisLabels()` Determines if showing of labels along both axis is enabled.
    `boolean` | `isEnabledShowAxisTicks()` Determines if showing of ticks and labels along both axis is enabled.
    `boolean` | `isEnabledShowCounts()` Determines if showing of total number of items per bin over each column is enabled.
    `boolean` | `isEnabledShowTitle()` Determines if title is shown on top of histogram.
    `void` | `reset()` Reset the progress bar.
    `void` | `setBackground(java.awt.Color color)` Set color of background of info panel.
    `void` | `setClassType(int classType)` Set the class type which determines computation of number of bins.
    `void` | `setCountType(int countType)` Set the count type which determines counting of number of items per bin.
    `void` | `setEnabled(boolean flag)` Enable or disable the slider for interactive use.
    `void` | `setEnabledSampleBnd(boolean flag)` Enable use of manual limits of sample data.
    `void` | `setEnabledShowAxisLabels(boolean flag)` Enable showing of labels along axis.
    `void` | `setEnabledShowAxisTicks(boolean flag)` Enable showing of ticks and labels along axis.
    `void` | `setEnabledShowCounts(boolean flag)` Enable showing of total number of items per bin over each column is enabled.
    `void` | `setEnabledShowTitle(boolean flag)` Enable showing of title on top f histogram.
    `void` | `setNumBins(int numBins)` Set the width of individual bins.
    `void` | `setSampleBnd(double sampleMin, double sampleMax)` Set user defined bounds of samples.
    `void` | `setSamples(PdVector data)` Assign set of samples.
    `void` | `setTitle(java.lang.String label)` Set title of histogram.
    `void` | `setXAxisLabel(java.lang.String xLabel)` Set label of horizontal and vertical axis.
    `void` | `setYAxisLabel(java.lang.String yLabel)` Set label of horizontal and vertical axis.
    `boolean` | `update(java.lang.Object event)` Update all inspector panels, send update to all registered update listeners and finally update parent.

    - ### Methods inherited from class jv.object.PsObject

      `addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### NUMBINS_USER

          public static final int NUMBINS_USER

      See Also:
        Constant Field Values

    - #### NUMBINS_STURGES

          public static final int NUMBINS_STURGES

      See Also:
        Constant Field Values

    - #### NUMBINS_SCOTT

          public static final int NUMBINS_SCOTT

      See Also:
        Constant Field Values

    - #### NUMBINS_FD

          public static final int NUMBINS_FD

      See Also:
        Constant Field Values

    - #### COUNT_ABSOLUTE

          public static final int COUNT_ABSOLUTE

      See Also:
        Constant Field Values

    - #### COUNT_RELATIVE

          public static final int COUNT_RELATIVE

      See Also:
        Constant Field Values

    - #### DEFAULT_FILL_COLOR

          public static final java.awt.Color DEFAULT_FILL_COLOR

    - #### DEFAULT_FONT_LABELS

          public static final java.awt.Font DEFAULT_FONT_LABELS

  - ### Constructor Detail

    - #### PuHistogram

          public PuHistogram(java.lang.String name,
                     PsUpdateIf parent)

      Create new instance with given name and parent. The name appears as label on the histogram, and the parent is informed whenever the histogram has changed using `parent.update(this)`.
      Parameters:
        `name` - Name of histogram to appear as label in histogram.
        `parent` - Parent of histogram to receive update events.

  - ### Method Detail

    - #### init

          public void init()

      Assign default values, and may be used to reset instance.
      Overrides:
        `init` in class `PsObject`

    - #### reset

          public void reset()

      Reset the progress bar.

    - #### update

          public boolean update(java.lang.Object event)

      Description copied from class: `PsObject`
      Update all inspector panels, send update to all registered update listeners and finally update parent. Each of those updates has this object as event independent of the argument of this method.

      Central update method of this object. Must be overwritten if this class receives unknown events, say, from new children. Any subclass must class invoke super.update(event) on all events it does handle itself.

      Specified by:
        `update` in interface `PsUpdateIf`
      Overrides:
        `update` in class `PsObject`
      Parameters:
        `event` - carries a lot of information
      Returns:
        true if event has been handled, otherwise false
      See Also:
        `PsObject.setParent(PsUpdateIf)`, `PsObject.getFather()`, `PsObject.addUpdateListener(PsUpdateIf)`

    - #### isEnabled

          public boolean isEnabled()

      Check whether slider is enabled or disabled.

    - #### setEnabled

          public void setEnabled(boolean flag)

      Enable or disable the slider for interactive use. If disabled, the double variable can still be modified by calls `setValue(double)`, and the slider is always updated.

    - #### getBackground

          public java.awt.Color getBackground()

      Get color of background of info panel.
      Since:
        JavaView 3.50.003

    - #### setBackground

          public void setBackground(java.awt.Color color)

      Set color of background of info panel.
      Since:
        JavaView 3.50.003

    - #### setSamples

          public void setSamples(PdVector data)

      Assign set of samples.

    - #### getSampleBnd

          public PdVector getSampleBnd()

      Get user defined bounds of samples.

    - #### setSampleBnd

          public void setSampleBnd(double sampleMin,
                          double sampleMax)

      Set user defined bounds of samples.

    - #### getClassType

          public int getClassType()

      Get the class type which determines computation of number of bins. Possible types are like `PuHistogram#NUMBINS_SCOTT` etc.
      Returns:
        the classType

    - #### setClassType

          public void setClassType(int classType)

      Set the class type which determines computation of number of bins. Possible types are like `PuHistogram#NUMBINS_SCOTT` etc.
      Parameters:
        `classType` - the classType to set

    - #### getCountType

          public int getCountType()

      Get the count type which determines counting of number of items per bin. Possible types are like `PuHistogram#COUNT_RELATIVE` etc.
      Returns:
        the countType

    - #### setCountType

          public void setCountType(int countType)

      Set the count type which determines counting of number of items per bin. Possible types are like `PuHistogram#COUNT_RELATIVE` etc.
      Parameters:
        `countType` - the countType to set

    - #### setXAxisLabel

          public void setXAxisLabel(java.lang.String xLabel)

      Set label of horizontal and vertical axis. Must enable showing of label using `setEnabledShowAxisLabels(boolean)`.
      Parameters:
        `xLabel` - label of horizontal axis
      See Also:
        `setEnabledShowTitle(boolean)`

    - #### setYAxisLabel

          public void setYAxisLabel(java.lang.String yLabel)

      Set label of horizontal and vertical axis. Must enable showing of label using `setEnabledShowAxisLabels(boolean)`.
      Parameters:
        `yLabel` - label of vertical axis
      See Also:
        `setEnabledShowTitle(boolean)`

    - #### setTitle

          public void setTitle(java.lang.String label)

      Set title of histogram. Must enable showing of title using `setEnabledShowTitle(boolean)`.
      Parameters:
        `label` - title of histogram
      See Also:
        `setEnabledShowTitle(boolean)`

    - #### getNumBins

          public int getNumBins()

      Get the width of individual bins.
      Returns:
        the width of an individual bin

    - #### setNumBins

          public void setNumBins(int numBins)

      Set the width of individual bins. Must enable use of manual bin setting using `setEnabledSampleBnd(boolean)`.
      Parameters:
        `numBins` - number of individual bins
      See Also:
        `setEnabledSampleBnd(boolean)`

    - #### isEnabledShowCounts

          public boolean isEnabledShowCounts()

      Determines if showing of total number of items per bin over each column is enabled.
      Returns:
        true if counts are shown

    - #### setEnabledShowCounts

          public void setEnabledShowCounts(boolean flag)

      Enable showing of total number of items per bin over each column is enabled.
      Parameters:
        `flag` - true enables showing of numbers

    - #### isEnabledShowAxisTicks

          public boolean isEnabledShowAxisTicks()

      Determines if showing of ticks and labels along both axis is enabled.
      Returns:
        true if counts are shown

    - #### setEnabledShowAxisTicks

          public void setEnabledShowAxisTicks(boolean flag)

      Enable showing of ticks and labels along axis.
      Parameters:
        `flag` - true enables showing of ticks along both axis

    - #### isEnabledShowAxisLabels

          public boolean isEnabledShowAxisLabels()

      Determines if showing of labels along both axis is enabled.
      Returns:
        true if counts are shown

    - #### setEnabledShowAxisLabels

          public void setEnabledShowAxisLabels(boolean flag)

      Enable showing of labels along axis.
      Parameters:
        `flag` - true enables showing of labels along both axis

    - #### isEnabledSampleBnd

          public boolean isEnabledSampleBnd()

      Determines if manual limits of sample data are enabled.
      Returns:
        true if manual limits are enabled

    - #### setEnabledSampleBnd

          public void setEnabledSampleBnd(boolean flag)

      Enable use of manual limits of sample data.
      Parameters:
        `flag` - true enables use of manual limits

    - #### isEnabledShowTitle

          public boolean isEnabledShowTitle()

      Determines if title is shown on top of histogram.
      Returns:
        true if title is shown

    - #### setEnabledShowTitle

          public void setEnabledShowTitle(boolean flag)

      Enable showing of title on top f histogram.
      Parameters:
        `flag` - true enables showing of title

"

The software JavaView? is copyright protected. All Rights Reserved.
"