|
|||||||||
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 | +--javax.swing.JComponent | +--javax.swing.JTable | +--sdm.CTable
This class extends JTable to include some features useful for displaying multiple information in an organized manner. We added features so that the table can insert, replace and delete any of the rows and columns as needed. Also this class implements TableColumnListener, MouseListener and ListSelectionListener to know when thing are modified.
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
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 |
Constructor Summary | |
CTable()
Create an empty table |
|
CTable(java.lang.String[] rownames,
java.lang.String[] colnames)
Creates a table with the given device names and property names. |
|
CTable(java.lang.String[] rownames,
java.lang.String[] colnames,
int[] colWidth)
Creates a table with the given device names and property names and also the column width. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent event)
handle the popup menu insert, replace and delete |
int |
getColumnWidth(int i)
Returns the size of the column at index i (not include the row head column) |
int[] |
getColumnWidths()
Returns the array of column widths to the utility. |
java.lang.String[] |
getDeviceNames()
Returns the array of device names. |
java.lang.String[] |
getPropertyNames()
Returns the array of property names. |
boolean |
getTableState()
Return true if table state change otherwise return false. |
void |
insertDevice(int position,
java.lang.String newName)
Insert device at given index |
void |
insertProperty(int position,
java.lang.String newName)
Insert property at given index |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
popup a menu when right mouse down |
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
removeDevice(int position)
Remove device at given index |
void |
removeProperty(int position)
Remove property at given index |
void |
setColumnWidth(int index,
int size)
to be implemented next release sets the column width of the selected column index |
void |
setColumnWidths(int[] width)
to be implemented next release |
void |
setDeviceName(int r,
java.lang.String newName)
This method is called synchronous to setDeviceName at row r. |
void |
setDeviceNames(java.lang.String[] newNames)
This method is called synchronous to set deviceNames. |
void |
setPropertyName(int c,
java.lang.String newName)
Set propertyName at column c. |
void |
setPropertyNames(java.lang.String[] newNames)
This method is called synchronous to setPropertyNames. |
Methods inherited from class javax.swing.JTable |
addColumn,
addColumnSelectionInterval,
addNotify,
addRowSelectionInterval,
clearSelection,
columnAdded,
columnAtPoint,
columnMarginChanged,
columnMoved,
columnRemoved,
columnSelectionChanged,
convertColumnIndexToModel,
convertColumnIndexToView,
createDefaultColumnsFromModel,
createScrollPaneForTable,
editCellAt,
editCellAt,
editingCanceled,
editingStopped,
getAccessibleContext,
getAutoCreateColumnsFromModel,
getAutoResizeMode,
getCellEditor,
getCellEditor,
getCellRect,
getCellRenderer,
getCellSelectionEnabled,
getColumn,
getColumnClass,
getColumnCount,
getColumnModel,
getColumnName,
getColumnSelectionAllowed,
getDefaultEditor,
getDefaultRenderer,
getEditingColumn,
getEditingRow,
getEditorComponent,
getGridColor,
getIntercellSpacing,
getModel,
getPreferredScrollableViewportSize,
getRowCount,
getRowHeight,
getRowMargin,
getRowSelectionAllowed,
getScrollableBlockIncrement,
getScrollableTracksViewportHeight,
getScrollableTracksViewportWidth,
getScrollableUnitIncrement,
getSelectedColumn,
getSelectedColumnCount,
getSelectedColumns,
getSelectedRow,
getSelectedRowCount,
getSelectedRows,
getSelectionBackground,
getSelectionForeground,
getSelectionModel,
getShowHorizontalLines,
getShowVerticalLines,
getTableHeader,
getToolTipText,
getUI,
getUIClassID,
getValueAt,
isCellEditable,
isCellSelected,
isColumnSelected,
isEditing,
isManagingFocus,
isRowSelected,
moveColumn,
prepareEditor,
prepareRenderer,
removeColumn,
removeColumnSelectionInterval,
removeEditor,
removeRowSelectionInterval,
reshape,
rowAtPoint,
selectAll,
setAutoCreateColumnsFromModel,
setAutoResizeMode,
setCellEditor,
setCellSelectionEnabled,
setColumnModel,
setColumnSelectionAllowed,
setColumnSelectionInterval,
setDefaultEditor,
setDefaultRenderer,
setEditingColumn,
setEditingRow,
setGridColor,
setIntercellSpacing,
setModel,
setPreferredScrollableViewportSize,
setRowHeight,
setRowMargin,
setRowSelectionAllowed,
setRowSelectionInterval,
setSelectionBackground,
setSelectionForeground,
setSelectionMode,
setSelectionModel,
setShowGrid,
setShowHorizontalLines,
setShowVerticalLines,
setTableHeader,
setUI,
setValueAt,
sizeColumnsToFit,
sizeColumnsToFit,
tableChanged,
updateUI,
valueChanged |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintImmediately,
paintImmediately,
print,
printAll,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
contains,
createImage,
createImage,
disable,
dispatchEvent,
enable,
enable,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
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,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public CTable()
public CTable(java.lang.String[] rownames, java.lang.String[] colnames)
rownames
- array of Devices.colnames
- array of properties.public CTable(java.lang.String[] rownames, java.lang.String[] colnames, int[] colWidth)
rownames
- This is an array of Devices.colnames
- This is an array of properties.colWidth
- This is an array of column Widths.Method Detail |
public void setDeviceName(int r, java.lang.String newName)
r
- row index for new devicenewName
- new device names to be set.public void setDeviceNames(java.lang.String[] newNames)
newNames
- The array of device names that are passed.public java.lang.String[] getDeviceNames()
public void setPropertyName(int c, java.lang.String newName)
c
- column index for new propertynewName
- new property names to be set.public void setPropertyNames(java.lang.String[] newNames)
newNames
- The array of property names that are passed.public java.lang.String[] getPropertyNames()
public int getColumnWidth(int i)
the
- index of column.public int[] getColumnWidths()
public void setColumnWidths(int[] width)
public void setColumnWidth(int index, int size)
index
- index of the columnsize
- size of the columnpublic boolean getTableState()
public void removeDevice(int position)
position
- device index to be removedpublic void removeProperty(int position)
position
- property index to be removedpublic void insertDevice(int position, java.lang.String newName)
position
- device index to be insertednewName
- new device name to be insertedpublic void insertProperty(int position, java.lang.String newName)
position
- property index to be insertednewName
- new property name to be insertedpublic void actionPerformed(java.awt.event.ActionEvent event)
public void mousePressed(java.awt.event.MouseEvent e)
e
- A MouseEventpublic void mouseReleased(java.awt.event.MouseEvent e)
public void mouseClicked(java.awt.event.MouseEvent e)
public void mouseEntered(java.awt.event.MouseEvent e)
public void mouseExited(java.awt.event.MouseEvent e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |