public class JTableRow
extends javax.swing.JPanel
implements java.awt.event.ActionListener, java.awt.event.MouseListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
colName |
protected javax.swing.JMenuItem |
copyMenuItem |
protected javax.swing.JPanel |
cornerPanel |
protected java.io.File |
currentFile |
protected TableRowModel |
dm |
protected javax.swing.table.TableModel |
dmr |
protected boolean |
editable |
protected int |
hT |
protected java.awt.Point |
menuLocation |
protected static javax.swing.JLabel |
noDataLabel |
static int |
PRINT_BIG |
static int |
PRINT_MEDIUM |
static int |
PRINT_SMALL |
protected javax.swing.JMenuItem |
print1MenuItem |
protected javax.swing.JMenuItem |
print2MenuItem |
protected javax.swing.JMenuItem |
print3MenuItem |
protected java.lang.Object[][] |
rowData |
protected javax.swing.JPanel |
rowPanel |
protected javax.swing.JTable |
rowTable |
protected javax.swing.JMenuItem |
saveMenuItem |
protected javax.swing.JMenuItem |
selectAllMenuItem |
protected javax.swing.JMenuItem |
selectColumnMenuItem |
protected javax.swing.JMenuItem |
selectNoneMenuItem |
protected javax.swing.JMenuItem |
selectRowMenuItem |
protected javax.swing.JPopupMenu |
tableMenu |
protected javax.swing.JScrollPane |
tableView |
protected java.lang.Object[][] |
theData |
protected java.awt.Font |
theFont |
protected javax.swing.JTable |
theTable |
protected int |
wT |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
JTableRow()
Construction
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
adjustColumnSize()
Adjust column size according to data.
|
void |
adjustSize()
Adjust the ScrollPane preferredSize according to
the table size.
|
void |
clearData()
Clear the table
|
protected void |
createTable() |
java.awt.Font |
getFont() |
java.lang.Object |
getObjectAt(int row,
int column)
Returns the cells at the specified pos or null if the table has no data.
|
boolean |
isEditable()
Returns true if this table is editable
|
static void |
main(java.lang.String[] args)
Test function.
|
protected java.lang.String |
makeDataString() |
protected java.lang.String |
makeTabbedString() |
protected int[] |
measureColumns(java.awt.Font f) |
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) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
protected void |
placeComponent() |
void |
printTable(int printSize)
Display the print dialog and sends the table to the printer.
|
void |
saveDataFile() |
void |
setData(java.lang.Object[][] data,
int startLabelX,
int startLabelY)
Sets the data.
|
void |
setData(java.lang.Object[][] data,
java.lang.String[] columnNames)
Sets the data (No row label).
|
void |
setEditable(boolean b)
Sets this table editable.
|
void |
setFont(java.awt.Font f) |
protected void |
updateTables(int nhT,
int nwT) |
protected void |
updateViewPortView() |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, transferFocusBackward, transferFocusUpCycle
public static final int PRINT_BIG
public static final int PRINT_MEDIUM
public static final int PRINT_SMALL
protected int wT
protected int hT
protected boolean editable
protected java.awt.Font theFont
protected java.io.File currentFile
protected javax.swing.JScrollPane tableView
protected javax.swing.JTable theTable
protected TableRowModel dm
protected java.lang.Object[][] theData
protected java.lang.String[] colName
protected javax.swing.JPanel rowPanel
protected javax.swing.JPanel cornerPanel
protected javax.swing.JTable rowTable
protected javax.swing.table.TableModel dmr
protected java.lang.Object[][] rowData
protected java.awt.Point menuLocation
protected javax.swing.JPopupMenu tableMenu
protected javax.swing.JMenuItem selectAllMenuItem
protected javax.swing.JMenuItem selectNoneMenuItem
protected javax.swing.JMenuItem selectColumnMenuItem
protected javax.swing.JMenuItem selectRowMenuItem
protected javax.swing.JMenuItem copyMenuItem
protected javax.swing.JMenuItem saveMenuItem
protected javax.swing.JMenuItem print1MenuItem
protected javax.swing.JMenuItem print2MenuItem
protected javax.swing.JMenuItem print3MenuItem
protected static final javax.swing.JLabel noDataLabel
public void setEditable(boolean b)
b
- Editable flagpublic boolean isEditable()
public void setData(java.lang.Object[][] data, int startLabelX, int startLabelY)
data
- Handle to data array.startLabelX
- Horizontal column labeling starting indexstartLabelY
- Vertical column labeling starting indexpublic void setData(java.lang.Object[][] data, java.lang.String[] columnNames)
data
- Handle to data array.columnNames
- Column nameprotected void updateTables(int nhT, int nwT)
public java.lang.Object getObjectAt(int row, int column)
row
- Row indexcolumn
- Column indexpublic void clearData()
public void setFont(java.awt.Font f)
setFont
in class javax.swing.JComponent
public java.awt.Font getFont()
getFont
in interface java.awt.MenuContainer
getFont
in class java.awt.Component
public void adjustSize()
adjustColumnSize()
public void adjustColumnSize()
adjustSize()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void saveDataFile()
protected java.lang.String makeDataString()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
protected void createTable()
protected void updateViewPortView()
protected void placeComponent()
protected java.lang.String makeTabbedString()
protected int[] measureColumns(java.awt.Font f)
public void printTable(int printSize)
printSize
- Font size for printingPRINT_BIG
,
PRINT_MEDIUM
,
PRINT_SMALL
public static void main(java.lang.String[] args)