|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--java.applet.Applet | +--edu.davidson.tools.SApplet | +--dataTable.DataTable
This applet shows a row-column table of double values. Each data column is refered to as a series. A series is identified by a series number and has a unique color and style. Whenever data are added using a data connection, the appropriate series number must be specified.
The following embedding parameters are defined:
Parameter | Value | Type | Description |
---|---|---|---|
NumRows | 10 | int | The number of rows. |
NumCols | 2 | int | The number of columns. |
CellWidth | 40 | int | The size of a cell in pixels. |
ShowRowHeader | true | booelan | Show the top header row. |
ShowRowHeader | true | boolean | Show the left most header column. |
LastOnTop | false | boolean | Add data to the top of the table rather than the bottom. |
ShowScrollBars | true | boolean | Create a scrollable table. Useful for large data set. |
SizeToFit | false | boolean | Make the data table fit the embedding size. |
ShowControls | true | boolean | Show the user interface. |
DataTable is designed to be used as a data listener with other Physlets. The object identifier for the data listener is passed to a data connection. This value is is obtained using the following method.
getTableID().
Fields inherited from class edu.davidson.tools.SApplet |
clock,
dataConnections,
dataListeners,
dataSources,
lock |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
DataTable()
|
Method Summary | |
void |
addDatum(int sid,
double x)
Add a data point to the series. |
void |
clearAllSeries()
Clear the data from all series. |
void |
clearSeries(int s)
Clear the data from a series. |
int |
getActiveCellCol()
Read the row of the active cell. |
int |
getActiveCellRow()
Read the row of the active cell. |
double |
getActiveCellValue()
Read the value of the active cell. |
java.lang.String |
getAppletInfo()
|
java.lang.String |
getParameter(java.lang.String key,
java.lang.String def)
|
java.lang.String[][] |
getParameterInfo()
|
int |
getSeriesID(int sid)
Get the object identifier for the series from the series number. |
int |
getSeriesWidth(int sid)
Get the width of the cells in a column. |
int |
getTableID()
Get the object identifier for the table. |
void |
init()
|
void |
loadDataFile(int sid,
java.lang.String fileName)
Read a data file of data values into a series. |
boolean |
setActiveCell(int row,
int col)
Set the active cell. |
boolean |
setActiveCellValue(double val)
Set the value of the active cell. |
void |
setAutoRefresh(boolean autoRefresh)
Repaint every time data are added. |
void |
setDataStride(int sid,
int stride)
Do not register all data as entries in the table. |
void |
setDefault()
Clears the data from the grid and sets the stride to 1 for all series. |
boolean |
setFormat(int id,
java.lang.String str)
Set the numeric format for the display of numbers using the object identifier. |
void |
setNumericFormat(int sid,
java.lang.String str)
Set the numeric format for the display of numbers using the series identifier. |
boolean |
setSeriesLabel(int sid,
java.lang.String str)
Set the column header for the series. |
void |
setSeriesWidth(int id,
int width)
Set the width of the cells in a column. |
void |
setShowActiveCell(boolean show)
Highlight a cell when it is clicked to show that it is active. |
void |
sizeToFit(boolean stf)
Attempts to fit the size of the grid to the window. |
void |
start()
|
Methods inherited from class java.applet.Applet |
getAccessibleContext,
getAppletContext,
getAudioClip,
getAudioClip,
getCodeBase,
getDocumentBase,
getImage,
getImage,
getLocale,
getParameter,
isActive,
newAudioClip,
play,
play,
resize,
resize,
setStub,
showStatus,
stop |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
getListeners,
getMaximumSize,
getMinimumSize,
getPreferredSize,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paint,
paintComponents,
preferredSize,
print,
printComponents,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setCursor,
setFont,
setLayout,
update,
validate |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addHierarchyBoundsListener,
addHierarchyListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
contains,
contains,
createImage,
createImage,
disable,
dispatchEvent,
enable,
enable,
enableInputMethods,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getGraphicsConfiguration,
getHeight,
getInputContext,
getInputMethodRequests,
getLocation,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getSize,
getToolkit,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
remove,
removeComponentListener,
removeFocusListener,
removeHierarchyBoundsListener,
removeHierarchyListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setEnabled,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public DataTable()
Method Detail |
public java.lang.String getParameter(java.lang.String key, java.lang.String def)
public void init()
public void start()
public final java.lang.String getAppletInfo()
public java.lang.String[][] getParameterInfo()
public void loadDataFile(int sid, java.lang.String fileName)
sid
- The series id.fileName
- The file namepublic void clearSeries(int s)
Series
- IDpublic void clearAllSeries()
Series
- IDpublic void addDatum(int sid, double x)
id
- series IDx
- x valuepublic int getTableID()
public void setAutoRefresh(boolean autoRefresh)
autoRefresh
- Automatic repaint?public void sizeToFit(boolean stf)
public void setDefault()
public void setDataStride(int sid, int stride)
sid
- the series numberstride
- The number of data points to skip before
registering.public int getSeriesID(int sid)
sid
- the series numberpublic int getSeriesWidth(int sid)
sid
- the series numberpublic void setSeriesWidth(int id, int width)
id
- the series numberwidth
- The width of the cells.public boolean setSeriesLabel(int sid, java.lang.String str)
sid
- the series numberstr
- the header.public void setNumericFormat(int sid, java.lang.String str)
sid
- the series numberstr
- the format string For example: %-+6.2fpublic boolean setFormat(int id, java.lang.String str)
id
- the object identifierstr
- the format string For example: %-+6.2fpublic void setShowActiveCell(boolean show)
show
- true if cell should highlight on clickpublic double getActiveCellValue()
public int getActiveCellRow()
public int getActiveCellCol()
public boolean setActiveCellValue(double val)
public boolean setActiveCell(int row, int col)
row
- the rowcol
- the column
|
Copyright Wolfgang Christian | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |