Package table
Class TableView
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Runnable
,Accessible
,RootPaneContainer
,WindowConstants
Class for a simple table viewer.
- Since:
- 2007.02.09
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
mode flag: all optional menu itemsstatic final int
mode flag: add menu items for loading and saving tablesstatic final int
mode flag: add menu items for loading tablesstatic final int
mode flag: the table viewer is a stand-alone programstatic final int
mode flag: add menu items for saving tablesstatic final String
the version stringstatic final int
mode flag: add menu items for visualizationFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
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
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondialog.FormatDialog
Get the data format dialog (create if necessary).dialog.FormatPanel
Get the data format panel.int
getMode()
Get the read mode.getTable()
Get the currently displayed table.boolean
Load the table to display.static void
Main function for command line invocation.void
run()
Create the user interface.boolean
saveDomains
(File file) Save domain descriptions of the displayed table.boolean
Save the displayed table.void
setFormat
(dialog.FormatPanel fmt) Set the data format.void
setMessage
(String msg) Set the message to display in the status line.void
setMode
(int mode) Set the read mode.void
Set the table to display.Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
VERSION
the version string- See Also:
-
PROGRAM
public static final int PROGRAMmode flag: the table viewer is a stand-alone program- See Also:
-
LOAD_ITEMS
public static final int LOAD_ITEMSmode flag: add menu items for loading tables- See Also:
-
SAVE_ITEMS
public static final int SAVE_ITEMSmode flag: add menu items for saving tables- See Also:
-
FILE_ITEMS
public static final int FILE_ITEMSmode flag: add menu items for loading and saving tables- See Also:
-
VIEW_ITEMS
public static final int VIEW_ITEMSmode flag: add menu items for visualization- See Also:
-
ALL_ITEMS
public static final int ALL_ITEMSmode flag: all optional menu items- See Also:
-
-
Constructor Details
-
TableView
public TableView(int mode) Create a simple table viewer.- Parameters:
mode
- the mode flags- Since:
- 2007.02.09 (Christian Borgelt)
-
TableView
Create a simple table viewer.- Parameters:
owner
- the component that is to own this table viewermode
- the mode flags- Since:
- 2007.02.09 (Christian Borgelt)
-
-
Method Details
-
run
public void run()Create the user interface.Following the recommendations in the Java tutorial, the user interface is created in the "run" method, which is invoked from the event queue, in order to avoid problems with threads.
-
getFormatDialog
public dialog.FormatDialog getFormatDialog()Get the data format dialog (create if necessary).- Returns:
- the data format dialog
- Since:
- 2007.02.12 (Christian Borgelt)
-
getFormatPanel
public dialog.FormatPanel getFormatPanel()Get the data format panel.- Returns:
- the data format panel
- Since:
- 2007.07.24 (Christian Borgelt)
-
setFormat
public void setFormat(dialog.FormatPanel fmt) Set the data format.- Parameters:
fmt
- the data format panel from which to copy the format- Since:
- 2007.07.26 (Christian Borgelt)
-
getMode
public int getMode()Get the read mode.In the returned value the flags
FormatPanel.HEADER
and/orFormatPanel.WEIGHT
(orFormatPanel.TAWGT
) may be set, depending on the selection in the dialog panel.- Returns:
- the read/write mode
- Since:
- 2012.12.13 (Christian Borgelt)
-
setMode
public void setMode(int mode) Set the read mode.- Parameters:
mode
- the read mode to set- Since:
- 2012.12.13 (Christian Borgelt)
-
setMessage
Set the message to display in the status line.- Parameters:
msg
- the message to display- Since:
- 2007.03.12 (Christian Borgelt)
-
setTable
Set the table to display.- Parameters:
tab
- the table to display- Since:
- 2004.06.02 (Christian Borgelt)
-
getTable
Get the currently displayed table.- Returns:
- the currently displayed table
- Since:
- 2007.02.12 (Christian Borgelt)
-
loadTable
Load the table to display.- Parameters:
file
- the file to load the table from- Returns:
- whether the file was successfully loaded
- Since:
- 2007.02.07 (Christian Borgelt)
-
saveTable
Save the displayed table.- Parameters:
file
- the file to save the table to- Returns:
- whether the file was successfully saved
- Since:
- 2007.02.07 (Christian Borgelt)
-
saveDomains
Save domain descriptions of the displayed table.- Parameters:
file
- the file to save the domain descriptions to- Returns:
- whether the file was successfully saved
- Since:
- 2007.05.02 (Christian Borgelt)
-
main
Main function for command line invocation.- Parameters:
args
- the command line arguments- Since:
- 2004.06.02 (Christian Borgelt)
-