public class Explorer extends MekaPanel implements MenuBarProvider, CommandLineArgsHandler
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected File |
m_CurrentFile
the current file.
|
protected weka.core.Instances |
m_Data
data currently loaded.
|
protected weka.gui.ConverterFileChooser |
m_FileChooser
the file chooser for loading/saving files.
|
protected LogTab |
m_LogTab
the log tab.
|
protected JMenuBar |
m_MenuBar
the menu bar.
|
protected JMenu |
m_MenuFileOpenRecent
the "load recent" submenu.
|
protected JMenuItem |
m_MenuItemEditData
the "redo" menu item.
|
protected JMenuItem |
m_MenuItemEditUndo
the "undo" menu item.
|
protected JMenuItem |
m_MenuItemFileClose
the "close" menu item.
|
protected JMenuItem |
m_MenuItemFileOpen
the "open" menu item.
|
protected JMenuItem |
m_MenuItemFileSave
the "save" menu item.
|
protected JMenuItem |
m_MenuItemFileSaveAs
the "save as" menu item.
|
protected RecentFilesHandlerWithCommandline<JMenu> |
m_RecentFilesHandler
the recent files handler.
|
protected StatusBar |
m_StatusBar
the statusbar to use.
|
protected JTabbedPane |
m_TabbedPane
the tabbed pane for the various panels.
|
protected ArrayList<AbstractExplorerTab> |
m_Tabs
the tabs.
|
protected ArrayList<File> |
m_Undo
the undo list.
|
static String |
SESSION_FILE
the file to store the recent files in.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
Explorer() |
Modifier and Type | Method and Description |
---|---|
boolean |
addUndoPoint()
Adds an undo point.
|
boolean |
canUndo()
Returns whether any operations can be undone currently.
|
void |
close()
Closes the explorer.
|
void |
edit()
edits the current instances object in the viewer
|
protected void |
finishInit()
Finishes the initialization.
|
weka.core.Instances |
getCurrentData()
Returns the currently loaded data.
|
File |
getCurrentFile()
Returns the filename of the currently loaded data.
|
JMenuBar |
getMenuBar()
Returns the menu bar to use.
|
StatusBar |
getStatusBar()
Returns the status bar.
|
String |
handleException(AbstractExplorerTab tab,
String msg,
Throwable t)
Logs the stacktrace along with the message on the log tab and returns a
combination of both of them as string.
|
protected void |
initGUI()
Initializes the widgets.
|
protected void |
initialize()
Initializes the members.
|
protected void |
log(AbstractExplorerTab tab,
String msg)
For logging messages.
|
static void |
main(String[] args)
Starts the GUI.
|
void |
notifyTabsDataChanged(AbstractExplorerTab source,
weka.core.Instances data)
Notifies all the tabs that the data has changed.
|
void |
open()
Opens a dataset.
|
void |
open(File file,
weka.core.converters.AbstractFileLoader loader)
Opens the specified file.
|
void |
processCommandLineArgs(String[] args)
Processes the commandline arguments.
|
void |
save()
Saves the current dataset.
|
void |
save(File file,
weka.core.converters.AbstractFileSaver saver)
Saves the data to the specified file.
|
void |
saveAs()
Saves the current dataset under a new name.
|
void |
undo()
Undos the last operation.
|
protected void |
updateMenu()
Updates the enabled/disabled state of the menu items.
|
closeParent, getParentDialog, getParentFrame
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, setFont, 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, 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, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final String SESSION_FILE
protected JTabbedPane m_TabbedPane
protected ArrayList<AbstractExplorerTab> m_Tabs
protected JMenuBar m_MenuBar
protected JMenuItem m_MenuItemFileOpen
protected JMenuItem m_MenuItemFileSave
protected JMenu m_MenuFileOpenRecent
protected JMenuItem m_MenuItemFileSaveAs
protected JMenuItem m_MenuItemFileClose
protected JMenuItem m_MenuItemEditUndo
protected JMenuItem m_MenuItemEditData
protected RecentFilesHandlerWithCommandline<JMenu> m_RecentFilesHandler
protected weka.core.Instances m_Data
protected File m_CurrentFile
protected weka.gui.ConverterFileChooser m_FileChooser
protected StatusBar m_StatusBar
protected LogTab m_LogTab
protected void initialize()
initialize
in class MekaPanel
protected void finishInit()
finishInit
in class MekaPanel
public void notifyTabsDataChanged(AbstractExplorerTab source, weka.core.Instances data)
source
- not null if a tab triggered this calldata
- the new data to usepublic JMenuBar getMenuBar()
getMenuBar
in interface MenuBarProvider
protected void updateMenu()
public StatusBar getStatusBar()
public weka.core.Instances getCurrentData()
public File getCurrentFile()
public void open(File file, weka.core.converters.AbstractFileLoader loader)
file
- the file to openloader
- the loader to usepublic void open()
public void save(File file, weka.core.converters.AbstractFileSaver saver)
file
- the file to save the data tosaver
- the saver to use, determines it automatically if nullpublic void save()
public void saveAs()
public void close()
public void edit()
public boolean addUndoPoint()
public boolean canUndo()
public void undo()
protected void log(AbstractExplorerTab tab, String msg)
tab
- the origin of the messagemsg
- the message to outputpublic String handleException(AbstractExplorerTab tab, String msg, Throwable t)
tab
- the origin of the messagemsg
- the message for the exceptiont
- the exceptionpublic void processCommandLineArgs(String[] args)
processCommandLineArgs
in interface CommandLineArgsHandler
args
- the argumentsCopyright © 2017. All Rights Reserved.