|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
com.jstatcom.table.BorderTable
com.jstatcom.table.JSCAbstractDataTable
public abstract class JSCAbstractDataTable
Abstract table to be subclassed by tables for data arrays, like
JSCSArray and JSCNArray. Subclasses must
provide implementations for setting the model according to the displayed data
type. They should also overwrite createDefaultDataModel for a
default model.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JTable |
|---|
javax.swing.JTable.DropLocation, javax.swing.JTable.PrintMode |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JTable |
|---|
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS |
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| 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 |
| Constructor Summary | |
|---|---|
JSCAbstractDataTable()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
addNotify()
Overwrites supermethod to retrieve symbol table from component hierarchy if this table is displayed. |
void |
createDefaultColumnsFromModel()
This method will create default columns for the table from the data model. |
javax.swing.table.TableCellRenderer |
getCellRenderer()
Gets the renderer for the cells. |
int[] |
getIntSelectionIndex()
Gets a vector with length getRowCount of zeros and ones
representing the selection status for each row. |
JSCData |
getJSCData()
Gets a reference (not a copy) to the data object displayed in this table. |
java.awt.event.MouseListener |
getMouseListener()
Gets the mouse listener. |
int |
getRowSelectionMode()
Gets the selection mode for table rows. |
java.lang.String |
getSymbolName()
Gets the name of the symbol to display. |
java.lang.String |
getSymbolNameSelRows()
Gets the symbol name for the data object with the index of selected rows. |
Scope |
getSymbolScope()
Gets the current scope, which defines which symbol table to use ( local,global or upper). |
SymbolTable |
getSymbolTable()
Gets the explicitely set symbol table used by this table to retrieve symbols by their name. |
javax.swing.JPopupMenu |
getTablePopup()
Gets the RIGHT mouse popup for the table. |
boolean |
isEditable()
Gets whether table is editable. |
void |
setCellRenderer(javax.swing.table.TableCellRenderer renderer)
Sets the renderer for all cells. |
void |
setColEditable(boolean editable,
int colIndex,
boolean clearPreviousBefore)
Sets a columns editable. |
void |
setEditable(boolean editable)
Sets whether table is editable. |
void |
setJSCData(JSCData data)
Sets the data object to be displayed in this table. |
void |
setModel(javax.swing.table.TableModel model)
Overwrites supermethod to fire a "model" property change event. |
abstract void |
setModelForJSCData(JSCData data)
Sets the table model for a data object. |
abstract void |
setModelForSymbolName(SymbolTable table,
java.lang.String name)
Sets the table model according to the symbol defined by table and name. |
void |
setMouseListener(java.awt.event.MouseListener listener)
Sets the mouse listener. |
void |
setRowEditable(boolean editable,
int rowIndex,
boolean clearPreviousBefore)
Sets a rows editable. |
void |
setRowSelectionMode(int newRowSelMode)
Sets the selection mode for rows. |
void |
setSymbolName(java.lang.String symbolName)
Sets the name of the symbol to display. |
void |
setSymbolNameSelRows(java.lang.String symbolNameSelRows)
Sets the name of the symbol with the index of selected table rows. |
void |
setSymbolScope(Scope scope)
Sets the symbol scope, which defines which symbol table to use ( local,global or upper). |
void |
setSymbolTable(SymbolTable table)
Sets the symbol table used by this table to retrieve symbols by their name and the corresponding type for the table. |
void |
setTablePopup(javax.swing.JPopupMenu menu)
Sets the RIGHT mouse popup for the table. |
void |
tableChanged(javax.swing.event.TableModelEvent e)
Overwrites supermethod to configure ecnclosing scrollpane and update selection data. |
void |
updateUI()
Notification from the UIManager that the L&F has changed. |
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
Invoked when the list selection changes. |
| Methods inherited from class com.jstatcom.table.BorderTable |
|---|
columnAtPoint, getCellRect, getColumnWidth, getMaximumColumnWidth, getMaximumSize, getMinimumColumnWidth, getMinimumSize, getPreferredSize, isDynamicColumnWidth, maxCellLength, rowAtPoint, setBorder, setColumnWidth, setDynamicColumnWidth, setIntercellSpacing, setMaximumColumnWidth, setMinimumColumnWidth, sizeColumnsToFit |
| Methods inherited from class javax.swing.JTable |
|---|
addColumn, addColumnSelectionInterval, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, prepareEditor, prepareRenderer, print, print, print, print, print, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sorterChanged |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JSCAbstractDataTable()
dynamicColumnWidth property is
set to true.
| Method Detail |
|---|
public void setColEditable(boolean editable,
int colIndex,
boolean clearPreviousBefore)
editable - colIndex - clearPreviousBefore - clear previous editable states
public void setRowEditable(boolean editable,
int rowIndex,
boolean clearPreviousBefore)
editable - rowIndex - clearPreviousBefore - clear previous editable statespublic boolean isEditable()
false.
true if editablepublic void setEditable(boolean editable)
false.
editable - true if editablepublic java.lang.String getSymbolName()
public void setSymbolName(java.lang.String symbolName)
symbolName - symbol name
java.lang.IllegalArgumentException - if symbolName is invalidpublic Scope getSymbolScope()
local,global or upper).
public void setSymbolScope(Scope scope)
local,global or upper).
This also sets a previously set symbol table to null.
scope - the symbol scope
java.lang.IllegalArgumentException - if (scope == null)public void updateUI()
UIManager that the L&F has changed.
Replaces the current UI object with the latest version from the
UIManager.
Reimplementation of superclass method.
updateUI in class javax.swing.JTableJComponent.updateUI()public java.awt.event.MouseListener getMouseListener()
null.
public void setMouseListener(java.awt.event.MouseListener listener)
null. An enumeration of mouse listeners
is given in JSCMouseListenerTypes.
listener - a mouse listenerpublic javax.swing.table.TableCellRenderer getCellRenderer()
JSCCellRendererTypes.DEFAULT.
public void setCellRenderer(javax.swing.table.TableCellRenderer renderer)
JSCCellRendererTypes.DEFAULT.
renderer - a cell rendererpublic javax.swing.JPopupMenu getTablePopup()
RIGHT mouse popup for the table.
public void setTablePopup(javax.swing.JPopupMenu menu)
RIGHT mouse popup for the table. An enumeration
of popups can be found in JSCPopupTypes.
menu - a popup menupublic JSCData getJSCData()
JSCAbstractTableModel,null is returned.
Usage note:
The returned data is a reference to the underlying JSCData
object only until a new data object has been set. It should be used read
only. Changes that should not affect this table must be made on a copy of
the returned object.
public void setJSCData(JSCData data)
null. If
data == null, then the table will be cleared and display
zero rows and zero columns.
data - to displaypublic void addNotify()
addNotify in class javax.swing.JTablepublic void setModel(javax.swing.table.TableModel model)
setModel in class javax.swing.JTablemodel - the new table modelpublic SymbolTable getSymbolTable()
null is
returned.
public abstract void setModelForJSCData(JSCData data)
IllegalArgumentException if data is not of
the correct type for the table. A null argument should be
allowed for to make it possible to clear the table model. The method is
called by setJSCData.
data - the new data for this table
public abstract void setModelForSymbolName(SymbolTable table,
java.lang.String name)
table and name. The type of the symbol to
retrieve must be set by the implementing table. The method is called by
setSymbolTable and setSymbolName.
The implementation should also handle null aguments. In
this case, an empty model should be set.
table - the data table to retrieve the symbol fromname - the name of the symbol to getpublic void setSymbolTable(SymbolTable table)
table == null then the symbol will be retrieved from the
symbol scope hierarchy.
table - a symbol tablepublic void createDefaultColumnsFromModel()
This method will clear any exsiting columns before creating the new columns based on information from the model.
createDefaultColumnsFromModel in class BorderTableJTable.getAutoCreateColumnsFromModel()public void setRowSelectionMode(int newRowSelMode)
newRowSelMode - one of ListSelectionModel.SINGLE_SELECTION,
ListSelectionModel.SINGLE_INTERVAL or
ListSelectionModel.MULTIPLE_INTERVAL_SELECTIONpublic int getRowSelectionMode()
ListSelectionModel.SINGLE_SELECTION,
ListSelectionModel.SINGLE_INTERVAL or
ListSelectionModel.MULTIPLE_INTERVAL_SELECTIONpublic java.lang.String getSymbolNameSelRows()
public void setSymbolNameSelRows(java.lang.String symbolNameSelRows)
getIntSelectionIndex. The symbol is updated everytime the
table selection changes. Changes in this symbol do not change the
selection in this table. The selection index will only be stored, if the
symbol name is set and the symbol table has been set as well or can be
retrieved for the symbol scope.
symbolNameSelRows - symbol name
java.lang.IllegalArgumentException - if symbolNameSelRows is invalidpublic void tableChanged(javax.swing.event.TableModelEvent e)
tableChanged in interface javax.swing.event.TableModelListenertableChanged in class BorderTablee - the table model eventpublic void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged in interface javax.swing.event.ListSelectionListenervalueChanged in class javax.swing.JTablee - the list selection eventpublic int[] getIntSelectionIndex()
getRowCount of zeros and ones
representing the selection status for each row. This is different from
getSelectedRows which returns the selected indizes. In
case of an empty selection, a zero vector with length
getRowCount is returned.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||