DataSetListener
, DataTableListener
public class DisplayTable extends Display implements DataTableListener
Modifier and Type | Field | Description |
---|---|---|
protected boolean |
autoRowLabels |
|
protected int |
c0 |
|
protected java.lang.String[] |
columnHeaders |
|
protected DataSinkTable |
dataTable |
|
protected int |
digits |
|
protected java.util.Formatter |
formatter |
|
protected double |
maxFloat |
|
protected double |
minFloat |
|
protected int |
nColumns |
|
protected javax.swing.JPanel |
panel |
|
protected java.lang.String |
rowLabelColumnHeader |
|
protected java.lang.String[] |
rowLabels |
|
protected boolean |
showingColumnHeaders |
|
protected boolean |
showingRowLabels |
|
protected boolean |
showingUnits |
|
protected java.lang.StringBuilder |
stringBuilder |
|
protected boolean |
transposed |
|
protected Unit[] |
units |
Constructor | Description |
---|---|
DisplayTable() |
|
DisplayTable(DataSinkTable dataTable) |
Modifier and Type | Method | Description |
---|---|---|
void |
dataChanged(DataSet dummyTable) |
Causes the display of the plot to be updated.
|
void |
dataCountChanged(DataSet dummyTable) |
Updates the units array for any new or deleted columns,
using the default units for new columns.
|
DataSinkTable |
getDataTable() |
|
int |
getNumDigitColumns() |
|
int |
getPrecision() |
Accessor method of the precision, which specifies the number of
significant figures to be displayed.
|
java.lang.String |
getRowLabelColumnHeader() |
Returns the header of the row-label column.
|
java.lang.String[] |
getRowLabels() |
Descriptive text for each row.
|
Unit |
getUnit(int i) |
Returns the unit assign to the i-th column (as defined before any
transpose).
|
java.awt.Component |
graphic() |
Method of Simulation.GraphicElement interface.
|
boolean |
isFitToWindow() |
Accessor method for flag determining if table is squeezed to fit in
window.
|
boolean |
isShowingColumnHeaders() |
|
boolean |
isShowingRowLabels() |
Accessor method for flag indicating if table should include a column of
"x" values.
|
boolean |
isShowingUnits() |
|
boolean |
isTransposed() |
If true, each data set fills a row; if false, data are arranged to fill
columns.
|
static void |
main(java.lang.String[] args) |
Demonstrates how this class is implemented.
|
protected void |
recomputeColumnHeaders() |
Reconstruct the column headers array.
|
protected void |
recomputeUnits() |
Reconstruct the units array.
|
void |
setAllUnits(Unit newUnit) |
Sets the units of all columns to the given unit.
|
void |
setColumnHeader(DataTag[] tags,
java.lang.String newHeader) |
|
void |
setFitToWindow(boolean b) |
If true, columns will be squeezed so table fits to window; if false,
table will exceed window size, and to view full width must be placed in a
scroll pane.
|
void |
setNumDigitColumns(int n) |
|
void |
setPrecision(int n) |
Accessor method of the precision, which specifies the number of
significant figures to be displayed.
|
void |
setRowLabelColumnHeader(java.lang.String rowLabelColumnHeader) |
Sets the header of the row-label column.
|
void |
setRowLabels(java.lang.String[] newRowLabels) |
Sets values for descriptive text for each row (as defined before
transpose).
|
void |
setShowingColumnHeaders(boolean showingColumnHeaders) |
|
void |
setShowingRowLabels(boolean b) |
Mutator method for whether table should include a column of "x" values.
|
void |
setShowingUnits(boolean showingUnits) |
Flag indicating whether a units suffix applied to the column headers (or
row labels, if transposing).
|
void |
setTransposed(boolean transposed) |
If fillHorizontal is true, each data set fills a row; if false, data are
arranged to fill columns.
|
void |
setUnit(DataTag[] dataTags,
Unit newUnit) |
|
javax.swing.table.AbstractTableModel |
tableModel() |
|
void |
tableRowCountChanged(DataSinkTable dummyTable) |
Part of the DataTableListener interface.
|
void |
tableRowHeadersChanged(DataSinkTable dummyTable) |
Method called to indicate that the row headers in the table have
changed.
|
addPropertyChangeListener, getLabel, removePropertyChangeListener, setLabel, toString
protected final DataSinkTable dataTable
protected final javax.swing.JPanel panel
protected boolean showingRowLabels
protected boolean showingColumnHeaders
protected boolean showingUnits
protected boolean transposed
protected int c0
protected java.lang.String[] rowLabels
protected boolean autoRowLabels
protected java.lang.String rowLabelColumnHeader
protected java.lang.String[] columnHeaders
protected Unit[] units
protected int digits
protected int nColumns
protected double maxFloat
protected double minFloat
protected final java.util.Formatter formatter
protected final java.lang.StringBuilder stringBuilder
public DisplayTable()
public DisplayTable(DataSinkTable dataTable)
public DataSinkTable getDataTable()
public void dataChanged(DataSet dummyTable)
dataChanged
in interface DataSetListener
public void dataCountChanged(DataSet dummyTable)
dataCountChanged
in interface DataSetListener
dummyTable
- the Data object that has been addedpublic void tableRowHeadersChanged(DataSinkTable dummyTable)
DataTableListener
tableRowHeadersChanged
in interface DataTableListener
public void tableRowCountChanged(DataSinkTable dummyTable)
tableRowCountChanged
in interface DataTableListener
public boolean isTransposed()
public void setTransposed(boolean transposed)
public void setFitToWindow(boolean b)
public boolean isFitToWindow()
public void setShowingRowLabels(boolean b)
public boolean isShowingRowLabels()
public int getPrecision()
public void setPrecision(int n)
public int getNumDigitColumns()
public void setNumDigitColumns(int n)
public java.awt.Component graphic()
Display
public javax.swing.table.AbstractTableModel tableModel()
public java.lang.String[] getRowLabels()
public void setRowLabels(java.lang.String[] newRowLabels)
protected void recomputeUnits()
protected void recomputeColumnHeaders()
public void setAllUnits(Unit newUnit)
public Unit getUnit(int i)
i
- column index, numbered from zero, not including the row-label
columnpublic boolean isShowingColumnHeaders()
public void setShowingColumnHeaders(boolean showingColumnHeaders)
showingColumnHeaders
- The showingColumnHeaders flag to set.public boolean isShowingUnits()
public void setShowingUnits(boolean showingUnits)
showingUnits
- The showingUnits flag to set.public java.lang.String getRowLabelColumnHeader()
public void setRowLabelColumnHeader(java.lang.String rowLabelColumnHeader)
public void setColumnHeader(DataTag[] tags, java.lang.String newHeader)
public static void main(java.lang.String[] args)