public final class PuHistogram extends PsObject
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 |
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 and Description |
---|
PuHistogram(java.lang.String name,
PsUpdateIf parent)
Create new instance with given name and parent.
|
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.
|
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
public static final int NUMBINS_USER
public static final int NUMBINS_STURGES
public static final int NUMBINS_SCOTT
public static final int NUMBINS_FD
public static final int COUNT_ABSOLUTE
public static final int COUNT_RELATIVE
public static final java.awt.Color DEFAULT_FILL_COLOR
public static final java.awt.Font DEFAULT_FONT_LABELS
public PuHistogram(java.lang.String name, PsUpdateIf parent)
parent.update(this)
.name
- Name of histogram to appear as label in histogram.parent
- Parent of histogram to receive update events.public void init()
public void reset()
public boolean update(java.lang.Object event)
PsObject
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.
update
in interface PsUpdateIf
update
in class PsObject
event
- carries a lot of informationPsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
public boolean isEnabled()
public void setEnabled(boolean flag)
setValue(double)
, and the slider
is always updated.public java.awt.Color getBackground()
public void setBackground(java.awt.Color color)
public void setSamples(PdVector data)
public PdVector getSampleBnd()
public void setSampleBnd(double sampleMin, double sampleMax)
public int getClassType()
PuHistogram#NUMBINS_SCOTT
etc.public void setClassType(int classType)
PuHistogram#NUMBINS_SCOTT
etc.classType
- the classType to setpublic int getCountType()
PuHistogram#COUNT_RELATIVE
etc.public void setCountType(int countType)
PuHistogram#COUNT_RELATIVE
etc.countType
- the countType to setpublic void setXAxisLabel(java.lang.String xLabel)
setEnabledShowAxisLabels(boolean)
.xLabel
- label of horizontal axissetEnabledShowTitle(boolean)
public void setYAxisLabel(java.lang.String yLabel)
setEnabledShowAxisLabels(boolean)
.yLabel
- label of vertical axissetEnabledShowTitle(boolean)
public void setTitle(java.lang.String label)
setEnabledShowTitle(boolean)
.label
- title of histogramsetEnabledShowTitle(boolean)
public int getNumBins()
public void setNumBins(int numBins)
setEnabledSampleBnd(boolean)
.numBins
- number of individual binssetEnabledSampleBnd(boolean)
public boolean isEnabledShowCounts()
public void setEnabledShowCounts(boolean flag)
flag
- true enables showing of numberspublic boolean isEnabledShowAxisTicks()
public void setEnabledShowAxisTicks(boolean flag)
flag
- true enables showing of ticks along both axispublic boolean isEnabledShowAxisLabels()
public void setEnabledShowAxisLabels(boolean flag)
flag
- true enables showing of labels along both axispublic boolean isEnabledSampleBnd()
public void setEnabledSampleBnd(boolean flag)
flag
- true enables use of manual limitspublic boolean isEnabledShowTitle()
public void setEnabledShowTitle(boolean flag)
flag
- true enables showing of title"