|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | 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 is 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().
Field Summary |
Fields inherited from class edu.davidson.tools.SApplet |
destroyed |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
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. |
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 |
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 is 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. |
Methods inherited from class java.applet.Applet |
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public void loadDataFile(int sid, java.lang.String fileName)
sid
- The series id.fileName
- The file namepublic void clearSeries(int s)
public void clearAllSeries()
public void addDatum(int sid, double x)
x
- x valuepublic int getTableID()
public void setAutoRefresh(boolean autoRefresh)
setAutoRefresh
in class SApplet
autoRefresh
- Automatic repaint?public void sizeToFit(boolean stf)
public void setDefault()
setDefault
in class SApplet
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 number
public int getSeriesWidth(int sid)
sid
- the series number
public 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.2f
public 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
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |