jvx.gui
Class PuHistogram
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.gui.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
- Author:
- Konrad Polthier
- Version:
- 02.09.09, 2.00 moved (kp) Moved to jvx from dev.
27.05.07, 1.10 revised (kp) Increased functionality.
20.05.07, 1.00 created (kp)
-
-
Field Summary
Fields Modifier and Type Field and Description static intCOUNT_ABSOLUTEstatic intCOUNT_RELATIVEstatic java.awt.ColorDEFAULT_FILL_COLORstatic intNUMBINS_FDstatic intNUMBINS_SCOTTstatic intNUMBINS_STURGESstatic intNUMBINS_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
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.ColorgetBackground()Get color of background of info panel.intgetClassType()Get the class type which determines computation of number of bins.intgetCountType()Get the count type which determines counting of number of items per bin.intgetNumBins()Get the width of individual bins.PdVectorgetSampleBnd()Get user defined bounds of samples.voidinit()Assign default values, and may be used to reset instance.booleanisEnabled()Check whether slider is enabled or disabled.booleanisEnabledSampleBnd()Determines if manual limits of sample data are enabled.booleanisEnabledShowAxisLabels()Determines if showing of labels along both axis is enabled.booleanisEnabledShowAxisTicks()Determines if showing of ticks and labels along both axis is enabled.booleanisEnabledShowCounts()Determines if showing of total number of items per bin over each column is enabled.booleanisEnabledShowTitle()Determines if title is shown on top of histogram.voidreset()Reset the progress bar.voidsetBackground(java.awt.Color color)Set color of background of info panel.voidsetClassType(int classType)Set the class type which determines computation of number of bins.voidsetCountType(int countType)Set the count type which determines counting of number of items per bin.voidsetEnabled(boolean flag)Enable or disable the slider for interactive use.voidsetEnabledSampleBnd(boolean flag)Enable use of manual limits of sample data.voidsetEnabledShowAxisLabels(boolean flag)Enable showing of labels along axis.voidsetEnabledShowAxisTicks(boolean flag)Enable showing of ticks and labels along axis.voidsetEnabledShowCounts(boolean flag)Enable showing of total number of items per bin over each column is enabled.voidsetEnabledShowTitle(boolean flag)Enable showing of title on top f histogram.voidsetNumBins(int numBins)Set the width of individual bins.voidsetSampleBnd(double sampleMin, double sampleMax)Set user defined bounds of samples.voidsetSamples(PdVector data)Assign set of samples.voidsetTitle(java.lang.String label)Set title of histogram.voidsetXAxisLabel(java.lang.String xLabel)Set label of horizontal and vertical axis.voidsetYAxisLabel(java.lang.String yLabel)Set label of horizontal and vertical axis.booleanupdate(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
-
-
-
-
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 java.awt.Color DEFAULT_FILL_COLOR
-
-
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 usingparent.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.
-
reset
public void reset()
Reset the progress bar.
-
update
public boolean update(java.lang.Object event)
Description copied from class:PsObjectUpdate 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:
updatein interfacePsUpdateIf- Overrides:
updatein classPsObject- 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 callssetValue(double), and the slider is always updated.- Version:
- 06.01.02, 1.10 revised (kp) Update all panels instead of directly enabling the info panel only.
-
getBackground
public java.awt.Color getBackground()
Get color of background of info panel.- Since:
- JavaView 3.50.003
- Version:
- 01.08.04, 1.00 created (kp)
-
setBackground
public void setBackground(java.awt.Color color)
Set color of background of info panel.- Since:
- JavaView 3.50.003
- Version:
- 01.08.04, 1.00 created (kp)
-
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 likePuHistogram#NUMBINS_SCOTTetc.- Returns:
- the classType
-
setClassType
public void setClassType(int classType)
Set the class type which determines computation of number of bins. Possible types are likePuHistogram#NUMBINS_SCOTTetc.- 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 likePuHistogram#COUNT_RELATIVEetc.- 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 likePuHistogram#COUNT_RELATIVEetc.- 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 usingsetEnabledShowAxisLabels(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 usingsetEnabledShowAxisLabels(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 usingsetEnabledShowTitle(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 usingsetEnabledSampleBnd(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
-
-
"