public class ArffViewerMainPanel
extends javax.swing.JPanel
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected boolean |
confirmExit |
static int |
DEFAULT_HEIGHT
the default for height
|
static int |
DEFAULT_LEFT
the default for left
|
static int |
DEFAULT_TOP
the default for top
|
static int |
DEFAULT_WIDTH
the default for width
|
protected boolean |
exitOnClose |
protected ConverterFileChooser |
fileChooser |
protected java.lang.String |
frameTitle |
protected int |
height |
static int |
HEIGHT
default height
|
protected int |
left |
protected javax.swing.JMenuBar |
menuBar |
protected javax.swing.JMenu |
menuEdit |
protected javax.swing.JMenuItem |
menuEditAttributeAsClass |
protected javax.swing.JMenuItem |
menuEditClearSearch |
protected javax.swing.JMenuItem |
menuEditCopy |
protected javax.swing.JMenuItem |
menuEditDeleteAttribute |
protected javax.swing.JMenuItem |
menuEditDeleteAttributes |
protected javax.swing.JMenuItem |
menuEditDeleteInstance |
protected javax.swing.JMenuItem |
menuEditDeleteInstances |
protected javax.swing.JMenuItem |
menuEditRenameAttribute |
protected javax.swing.JMenuItem |
menuEditSearch |
protected javax.swing.JMenuItem |
menuEditSortInstances |
protected javax.swing.JMenuItem |
menuEditUndo |
protected javax.swing.JMenu |
menuFile |
protected javax.swing.JMenuItem |
menuFileClose |
protected javax.swing.JMenuItem |
menuFileCloseAll |
protected javax.swing.JMenuItem |
menuFileExit |
protected javax.swing.JMenuItem |
menuFileOpen |
protected javax.swing.JMenuItem |
menuFileProperties |
protected javax.swing.JMenuItem |
menuFileSave |
protected javax.swing.JMenuItem |
menuFileSaveAs |
protected javax.swing.JMenu |
menuView |
protected javax.swing.JMenuItem |
menuViewAttributes |
protected javax.swing.JMenuItem |
menuViewOptimalColWidths |
protected javax.swing.JMenuItem |
menuViewValues |
protected java.awt.Container |
parent |
protected javax.swing.JTabbedPane |
tabbedPane |
protected int |
top |
protected int |
width |
static int |
WIDTH
default width
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
ArffViewerMainPanel(java.awt.Container parentFrame)
initializes the object
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
invoked when an action occurs
|
void |
attributeAsClass()
sets the current selected Attribute as class attribute, i.e. it moves it to
the end of the attributes
|
void |
clearSearch()
clears the search, i.e. resets the found cells
|
void |
close()
closes the window, i.e., if the parent is not null and implements the
WindowListener interface it calls the windowClosing method
|
void |
closeAllFiles()
closes all open files
|
void |
closeFile()
closes the current tab
|
void |
closeFile(boolean showCancel)
closes the current tab
|
void |
copyContent()
copies the content of the selection to the clipboard
|
protected void |
createPanel()
creates all the components in the panel
|
void |
deleteAttribute(boolean multiple)
deletes the current selected Attribute or several chosen ones
|
void |
deleteInstance(boolean multiple)
deletes the current selected Instance or several chosen ones
|
boolean |
getConfirmExit()
returns the setting of whether to display a confirm messagebox or not on
exit
|
java.lang.String |
getCurrentFilename()
returns the filename of the current tab
|
int |
getCurrentIndex()
returns the currently selected tab index
|
ArffPanel |
getCurrentPanel()
returns the currently selected panel
|
boolean |
getExitOnClose()
returns TRUE if a System.exit(0) is done on a close
|
java.lang.String |
getFilename(int index)
returns the filename of the specified panel
|
java.lang.String |
getFrameTitle()
returns the title (incl. filename) for the frame
|
javax.swing.JMenuBar |
getMenu()
returns the menu bar to be added in a frame
|
ArffPanel |
getPanel(int index)
returns the specified panel,
null if index is out of bounds |
int |
getPanelCount()
returns the number of panels currently open
|
javax.swing.JFrame |
getParentFrame()
returns the parent frame, if it's a JFrame, otherwise null
|
javax.swing.JInternalFrame |
getParentInternalFrame()
returns the parent frame, if it's a JInternalFrame, otherwise null
|
javax.swing.JTabbedPane |
getTabbedPane()
returns the tabbedpane instance
|
boolean |
isPanelSelected()
checks whether a panel is currently selected
|
void |
loadFile()
loads the specified file into the table
|
void |
loadFile(java.lang.String filename,
AbstractFileLoader... loaders)
loads the specified file
|
void |
refresh()
validates and repaints the frame
|
void |
renameAttribute()
renames the current selected Attribute
|
protected boolean |
saveChanges()
if the file is changed it pops up a dialog whether to change the settings.
|
protected boolean |
saveChanges(boolean showCancel)
if the file is changed it pops up a dialog whether to change the settings.
|
void |
saveFile()
saves the current data into a file
|
void |
saveFileAs()
saves the current data into a new file
|
void |
search()
searches for a string in the cells
|
void |
setConfirmExit(boolean confirm)
whether to present a MessageBox on Exit or not
|
void |
setCurrentFilename(java.lang.String filename)
sets the filename of the current tab
|
void |
setExitOnClose(boolean value)
whether to do a System.exit(0) on close
|
void |
setFilename(int index,
java.lang.String filename)
sets the filename of the specified panel
|
void |
setOptimalColWidths()
sets the optimal column width for all columns
|
void |
setParent(java.awt.Container value)
sets the new parent frame
|
protected void |
setTabTitle(javax.swing.JComponent component)
sets the title of the tab that contains the given component
|
java.lang.String |
showAttributes()
displays all the attributes, returns the selected item or NULL if canceled
|
void |
showProperties()
displays some properties of the instances
|
void |
showValues()
displays all the distinct values for an attribute
|
void |
sortInstances()
sorts the current selected attribute
|
void |
stateChanged(javax.swing.event.ChangeEvent e)
Invoked when the target of the listener has changed its state.
|
java.lang.String |
toString()
returns only the classname
|
void |
undo()
undoes the last action
|
void |
updateFrameTitle()
sets the title of the parent frame, if one was provided
|
protected void |
updateMenu()
sets the enabled/disabled state of the menu
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, updateadd, 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, validateTreeaction, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final int DEFAULT_LEFT
public static final int DEFAULT_TOP
public static final int WIDTH
public static final int HEIGHT
protected java.awt.Container parent
protected javax.swing.JTabbedPane tabbedPane
protected javax.swing.JMenuBar menuBar
protected javax.swing.JMenu menuFile
protected javax.swing.JMenuItem menuFileOpen
protected javax.swing.JMenuItem menuFileSave
protected javax.swing.JMenuItem menuFileSaveAs
protected javax.swing.JMenuItem menuFileClose
protected javax.swing.JMenuItem menuFileCloseAll
protected javax.swing.JMenuItem menuFileProperties
protected javax.swing.JMenuItem menuFileExit
protected javax.swing.JMenu menuEdit
protected javax.swing.JMenuItem menuEditUndo
protected javax.swing.JMenuItem menuEditCopy
protected javax.swing.JMenuItem menuEditSearch
protected javax.swing.JMenuItem menuEditClearSearch
protected javax.swing.JMenuItem menuEditDeleteAttribute
protected javax.swing.JMenuItem menuEditDeleteAttributes
protected javax.swing.JMenuItem menuEditRenameAttribute
protected javax.swing.JMenuItem menuEditAttributeAsClass
protected javax.swing.JMenuItem menuEditDeleteInstance
protected javax.swing.JMenuItem menuEditDeleteInstances
protected javax.swing.JMenuItem menuEditSortInstances
protected javax.swing.JMenu menuView
protected javax.swing.JMenuItem menuViewAttributes
protected javax.swing.JMenuItem menuViewValues
protected javax.swing.JMenuItem menuViewOptimalColWidths
protected ConverterFileChooser fileChooser
protected java.lang.String frameTitle
protected boolean confirmExit
protected int width
protected int height
protected int top
protected int left
protected boolean exitOnClose
public ArffViewerMainPanel(java.awt.Container parentFrame)
parentFrame - the parent frame (JFrame or JInternalFrame)protected void createPanel()
public javax.swing.JFrame getParentFrame()
public javax.swing.JInternalFrame getParentInternalFrame()
public void setParent(java.awt.Container value)
value - the parent framepublic javax.swing.JMenuBar getMenu()
public javax.swing.JTabbedPane getTabbedPane()
public void setConfirmExit(boolean confirm)
confirm - whether a MessageBox pops up or not to confirm exitpublic boolean getConfirmExit()
public void setExitOnClose(boolean value)
value - enables/disables a System.exit(0) on closepublic boolean getExitOnClose()
public void refresh()
public java.lang.String getFrameTitle()
public void updateFrameTitle()
protected void updateMenu()
protected void setTabTitle(javax.swing.JComponent component)
component - the component to set the title forpublic int getPanelCount()
public ArffPanel getPanel(int index)
null if index is out of boundsindex - the index of the panelpublic int getCurrentIndex()
public ArffPanel getCurrentPanel()
public boolean isPanelSelected()
public java.lang.String getFilename(int index)
index - the index of the panelpublic java.lang.String getCurrentFilename()
public void setFilename(int index,
java.lang.String filename)
index - the index of the panelfilename - the new filenamepublic void setCurrentFilename(java.lang.String filename)
filename - the new filenameprotected boolean saveChanges()
protected boolean saveChanges(boolean showCancel)
showCancel - whether we have YES/NO/CANCEL or only YES/NOpublic void loadFile(java.lang.String filename,
AbstractFileLoader... loaders)
filename - the file to loadloaders - optional varargs loader to usepublic void loadFile()
public void saveFile()
public void saveFileAs()
public void closeFile()
public void closeFile(boolean showCancel)
showCancel - whether to show an additional CANCEL button in the
"Want to save changes"-dialogsaveChanges(boolean)public void closeAllFiles()
public void showProperties()
public void close()
public void undo()
public void copyContent()
public void search()
public void clearSearch()
public void renameAttribute()
public void attributeAsClass()
public void deleteAttribute(boolean multiple)
multiple - whether to delete myultiple attributespublic void deleteInstance(boolean multiple)
multiple - whether to delete multiple instancespublic void sortInstances()
public java.lang.String showAttributes()
public void showValues()
public void setOptimalColWidths()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenere - the action eventpublic void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged in interface javax.swing.event.ChangeListenere - the change eventpublic java.lang.String toString()
toString in class java.awt.Component