Package dialog
Class FormatPanel
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
Class for a data format panel for graphical user interfaces.
- Since:
- 2007.02.11
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
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: show all optional fieldsprotected JTextField
the blank charactersprotected JTextField
the comment charactersprotected JTextField
the field separatorsprotected JCheckBox
whether the first record contains column namesstatic final int
mode: show check box for field names in first recordstatic final int
mode: show message about null valuesprotected JTextField
the null value charactersstatic final int
mode: show null value characters inputthe format of each input recordprotected JTextField
the record separatorsprotected JCheckBox
whether the last column contains transaction weightsstatic final int
mode: show check box for transaction weightstatic final int
mode: show combo box for train record contentsprotected JCheckBox
whether the last column contains tuple weightsstatic final int
mode: show check box for tuple weightFields inherited from class dialog.DialogPanel
BOLD, buf, chooser, FILL, HALF, LEFT, MIDDLE, RIGHT, SMALL
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, 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
ConstructorsConstructorDescriptionCreate a data format panel.FormatPanel
(int mode) Create a data format panel. -
Method Summary
Modifier and TypeMethodDescriptionint
addFormatArgs
(String[] cmd) Add format arguments to a command array.int
addFormatArgs
(String[] cmd, int mode) Add format arguments to a command array.void
copyFrom
(FormatPanel fmt) Copy settings from another data format panel.void
copyTo
(FormatPanel fmt) Copy settings to another data format panel.util.TableReader
createReader
(File file) Create a table reader configured for the current format.util.TableReader
createReader
(Reader reader) Create a table reader configured for the current format.util.TableWriter
createWriter
(File file) Create a table writer configured for the current format.util.TableWriter
createWriter
(Writer writer) Create a table writer configured for the current format.Get the blank characters.Get the comment characters.Get the field separators.int
getMode()
Get the read/write mode.Get the null value characters.Get the record separators.int
Get the read/write mode for tables.int
Get the record contents mode for trains.void
loadConfig
(FileReader reader) Load format arguments from a configuration file.void
saveConfig
(FileWriter writer) Save format arguments to a configuration file.void
Set the blank characters.void
setComment
(String s) Set the comment characters.void
setFldSeps
(String s) Set the field separators.void
setMode
(int mode) Set the read mode.void
Set the null value characters.void
setRecSeps
(String s) Set the record separators.Methods inherited from class dialog.DialogPanel
add, addButton, addButton, addCheckBox, addCheckBox, addCheckBox, addCheckBox, addComboBox, addComboBox, addFileInput, addFileInput, addFiller, addHelp, addLabel, addLabel, addNumberInput, addNumberInput, addSpinner, addSpinner, addTextInput, addTextInput, createNumberInput, editDomains, editDomains, editFile, editFile, getFileChooser, getFileName, getFileName, readInt, readLine, showTable, showTable
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
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, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
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
Methods inherited from class java.awt.Component
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, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
HEADER
public static final int HEADERmode: show check box for field names in first record- See Also:
-
WEIGHT
public static final int WEIGHTmode: show check box for tuple weight- See Also:
-
NULLCHS
public static final int NULLCHSmode: show null value characters input- See Also:
-
NONULLS
public static final int NONULLSmode: show message about null values- See Also:
-
TAWGT
public static final int TAWGTmode: show check box for transaction weight- See Also:
-
TRAIN
public static final int TRAINmode: show combo box for train record contents- See Also:
-
ALL
public static final int ALLmode: show all optional fields- See Also:
-
recseps
the record separators -
fldseps
the field separators -
blanks
the blank characters -
nullchs
the null value characters -
comment
the comment characters -
header
whether the first record contains column names -
weight
whether the last column contains tuple weights -
tawgt
whether the last column contains transaction weights -
recfmt
the format of each input record
-
-
Constructor Details
-
FormatPanel
public FormatPanel()Create a data format panel.- Since:
- 2007.02.11 (Christian Borgelt)
-
FormatPanel
public FormatPanel(int mode) Create a data format panel.- Parameters:
mode
- the mode (additional input selector)- Since:
- 2007.02.24 (Christian Borgelt)
-
-
Method Details
-
getRecSeps
Get the record separators.- Returns:
- the record separators
- Since:
- 2007.05.17 (Christian Borgelt)
-
setRecSeps
Set the record separators.- Parameters:
s
- the record separators- Since:
- 2007.05.21 (Christian Borgelt)
-
getFldSeps
Get the field separators.- Returns:
- the field separators
- Since:
- 2007.05.17 (Christian Borgelt)
-
setFldSeps
Set the field separators.- Parameters:
s
- the field separators- Since:
- 2007.05.21 (Christian Borgelt)
-
getBlanks
Get the blank characters.- Returns:
- the blank characters
- Since:
- 2007.05.17 (Christian Borgelt)
-
setBlanks
Set the blank characters.- Parameters:
s
- the blank characters- Since:
- 2007.05.21 (Christian Borgelt)
-
getNullChars
Get the null value characters.- Returns:
- the null value characters
- Since:
- 2007.05.17 (Christian Borgelt)
-
setNullChars
Set the null value characters.- Parameters:
s
- the null value characters- Since:
- 2007.05.21 (Christian Borgelt)
-
getComment
Get the comment characters.- Returns:
- the comment characters
- Since:
- 2007.05.17 (Christian Borgelt)
-
setComment
Set the comment characters.- Parameters:
s
- the comment characters- Since:
- 2007.05.21 (Christian Borgelt)
-
getMode
public int getMode()Get the read/write mode.In the returned value the flags
HEADER
and/orWEIGHT
(orTAWGT
) may be set, depending on the selection in the dialog panel.- Returns:
- the read/write mode
- Since:
- 2007.03.12 (Christian Borgelt)
-
setMode
public void setMode(int mode) Set the read mode.- Parameters:
mode
- the read mode to set- Since:
- 2007.02.09 (Christian Borgelt)
-
getTableMode
public int getTableMode()Get the read/write mode for tables.In the returned value the flags
Table.HEADER
and/orTable.WEIGHT
may be set, depending on the selection in the dialog panel.- Returns:
- the read/write mode with
Table
flags - Since:
- 2011.08.01 (Christian Borgelt)
-
getTrainMode
public int getTrainMode()Get the record contents mode for trains.- Returns:
- the record contents mode
- Since:
- 2013.11.29 (Christian Borgelt)
-
copyFrom
Copy settings from another data format panel.- Parameters:
fmt
- the data format panel to copy from- Since:
- 2007.07.24 (Christian Borgelt)
-
copyTo
Copy settings to another data format panel.- Parameters:
fmt
- the data format panel to copy to- Since:
- 2007.07.24 (Christian Borgelt)
-
createReader
Create a table reader configured for the current format.- Parameters:
file
- the file to create the reader for- Returns:
- the created table reader
- Throws:
IOException
- if a read error occurs- Since:
- 2007.06.07 (Christian Borgelt)
-
createReader
Create a table reader configured for the current format.- Parameters:
reader
- the reader to create the reader from- Returns:
- the created table reader
- Since:
- 2007.05.08 (Christian Borgelt)
-
createWriter
Create a table writer configured for the current format.- Parameters:
file
- the file to create the table writer for- Returns:
- the created table writer
- Throws:
IOException
- if a write error occurs- Since:
- 2007.06.07 (Christian Borgelt)
-
createWriter
Create a table writer configured for the current format.- Parameters:
writer
- the writer to create the table writer from- Returns:
- the created table writer
- Since:
- 2007.05.20 (Christian Borgelt)
-
addFormatArgs
Add format arguments to a command array.- Parameters:
cmd
- the command array to add to- Returns:
- the number of arguments (assumed to be 1 before)
- Since:
- 2007.02.16 (Christian Borgelt)
-
addFormatArgs
Add format arguments to a command array.- Parameters:
cmd
- the command array to add tomode
- the mode (whether to add null value characters etc.)- Returns:
- the number of arguments (assumed to be 1 before)
- Since:
- 2007.02.16 (Christian Borgelt)
-
loadConfig
Load format arguments from a configuration file.- Parameters:
reader
- file reader to read from- Throws:
IOException
- if a read error occurs- Since:
- 2013.11.26 (Christian Borgelt)
-
saveConfig
Save format arguments to a configuration file.- Parameters:
writer
- file writer to write to- Throws:
IOException
- if a write error occurs- Since:
- 2013.11.26 (Christian Borgelt)
-