Package weka.gui
Class Main
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,RootPaneContainer
,WindowConstants
,OptionHandler
Menu-based GUI for Weka, replacement for the GUIChooser.
Valid options are:
-gui <MDI|SDI> Determines the layout of the GUI: MDI = MDI Layout SDI = SDI Layout (default: MDI)
- Version:
- $Revision: 15257 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
DesktopPane with background image.static class
Specialized JInternalFrame class.static class
Specialized JFrame class.Nested classes/interfaces inherited from class java.awt.Window
Window.Type
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
displays the GUI as MDI.static final int
displays the GUI as SDI.static final Tag[]
GUI tags.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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
adds the given child frame to the list of frames.static void
Add a listener to be notified when startup is complete.boolean
containsWindow
(Class<?> windowClass) checks, whether an instance of the given window class is already in the Window list.boolean
containsWindow
(String title) checks, whether a window with the given title is already in the Window list.static void
createSingleton
(String[] args) Create the singleton instance of the Main GUI.Gets the currently set type of GUI to display.String[]
returns the options of the current setup.static Main
Return the singleton instance of the Main GUI.returns the first instance of the given window class, null if none can be found.returns the first window with the given title, null if none can be found.returns all currently open frames.Gets an enumeration describing the available options.static void
starts the application.void
minimizes all windows.boolean
tries to remove the child frame, it returns true if it could do such.void
restores all windows.void
setGUIType
(SelectedTag value) Sets the type of GUI to use.void
setOptions
(String[] options) Parses the options for this object.void
setVisible
(boolean b) Shows or hides this component depending on the value of parameter b.boolean
brings child frame to the top.boolean
showWindow
(Class<?> windowClass) brings the first frame to the top that is of the specified window class.void
is called when window list changed somehow (add or remove).Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, 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, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
GUI_MDI
public static final int GUI_MDIdisplays the GUI as MDI.- See Also:
-
GUI_SDI
public static final int GUI_SDIdisplays the GUI as SDI.- See Also:
-
TAGS_GUI
GUI tags.
-
-
Constructor Details
-
Main
public Main()default constructor.
-
-
Method Details
-
addChildFrame
adds the given child frame to the list of frames.- Parameters:
c
- the child frame to add
-
removeChildFrame
tries to remove the child frame, it returns true if it could do such.- Parameters:
c
- the child frame to remove- Returns:
- true if the child frame could be removed
-
showWindow
brings child frame to the top.- Parameters:
c
- the frame to activate- Returns:
- true if frame was activated
-
showWindow
brings the first frame to the top that is of the specified window class.- Parameters:
windowClass
- the class to display the first child for- Returns:
- true, if a child was found and brought to front
-
getWindowList
returns all currently open frames.- Returns:
- an iterator over all currently open frame
-
getWindow
returns the first instance of the given window class, null if none can be found.- Parameters:
windowClass
- the class to retrieve the first instance for- Returns:
- null, if no instance can be found
-
getWindow
returns the first window with the given title, null if none can be found.- Parameters:
title
- the title to look for- Returns:
- null, if no instance can be found
-
containsWindow
checks, whether an instance of the given window class is already in the Window list.- Parameters:
windowClass
- the class to check for an instance in the current window list- Returns:
- true if the class is already listed in the Window list
-
containsWindow
checks, whether a window with the given title is already in the Window list.- Parameters:
title
- the title to check for in the current window list- Returns:
- true if a window with the given title is already listed in the Window list
-
minimizeWindows
public void minimizeWindows()minimizes all windows. -
restoreWindows
public void restoreWindows()restores all windows. -
windowListChanged
public void windowListChanged()is called when window list changed somehow (add or remove). -
setVisible
public void setVisible(boolean b) Shows or hides this component depending on the value of parameter b.- Overrides:
setVisible
in classWindow
- Parameters:
b
- if true, shows this component; otherwise, hides this component
-
createSingleton
Create the singleton instance of the Main GUI.- Parameters:
args
- commandline options
-
getSingleton
Return the singleton instance of the Main GUI.- Returns:
- the singleton instance
-
addStartupListener
Add a listener to be notified when startup is complete.- Parameters:
s
- a listener to add
-
listOptions
Gets an enumeration describing the available options.- Specified by:
listOptions
in interfaceOptionHandler
- Returns:
- an enumeration of all the available options.
-
getOptions
returns the options of the current setup.- Specified by:
getOptions
in interfaceOptionHandler
- Returns:
- the current options
-
setOptions
Parses the options for this object. Valid options are:-gui <MDI|SDI> Determines the layout of the GUI: MDI = MDI Layout SDI = SDI Layout (default: MDI)
- Specified by:
setOptions
in interfaceOptionHandler
- Parameters:
options
- the options to use- Throws:
Exception
- if setting of options fails
-
setGUIType
Sets the type of GUI to use.- Parameters:
value
- .the GUI type
-
getGUIType
Gets the currently set type of GUI to display.- Returns:
- the current GUI Type.
-
main
starts the application.- Parameters:
args
- the commandline arguments - ignored
-