Package weka.gui
Class Main
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- weka.gui.Main
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible,javax.swing.RootPaneContainer,javax.swing.WindowConstants,OptionHandler
public class Main extends javax.swing.JFrame implements 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: 10438 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMain.BackgroundDesktopPaneDesktopPane with background image.static classMain.ChildFrameMDISpecialized JInternalFrame class.static classMain.ChildFrameSDISpecialized JFrame class.
-
Field Summary
Fields Modifier and Type Field Description static intGUI_MDIdisplays the GUI as MDI.static intGUI_SDIdisplays the GUI as SDI.static Tag[]TAGS_GUIGUI 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
-
-
Constructor Summary
Constructors Constructor Description Main()default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChildFrame(java.awt.Container c)adds the given child frame to the list of frames.static voidaddStartupListener(StartUpListener s)Add a listener to be notified when startup is complete.booleancontainsWindow(java.lang.Class windowClass)checks, whether an instance of the given window class is already in the Window list.booleancontainsWindow(java.lang.String title)checks, whether a window with the given title is already in the Window list.static voidcreateSingleton(java.lang.String[] args)Create the singleton instance of the Main GUI.SelectedTaggetGUIType()Gets the currently set type of GUI to display.java.lang.String[]getOptions()returns the options of the current setup.static MaingetSingleton()Return the singleton instance of the Main GUI.java.awt.ContainergetWindow(java.lang.Class windowClass)returns the first instance of the given window class, null if none can be found.java.awt.ContainergetWindow(java.lang.String title)returns the first window with the given title, null if none can be found.java.util.IteratorgetWindowList()returns all currently open frames.java.util.EnumerationlistOptions()Gets an enumeration describing the available options.static voidmain(java.lang.String[] args)starts the application.voidminimizeWindows()minimizes all windows.booleanremoveChildFrame(java.awt.Container c)tries to remove the child frame, it returns true if it could do such.voidrestoreWindows()restores all windows.voidsetGUIType(SelectedTag value)Sets the type of GUI to use.voidsetOptions(java.lang.String[] options)Parses the options for this object.voidsetVisible(boolean b)Shows or hides this component depending on the value of parameter b.booleanshowWindow(java.awt.Container c)brings child frame to the top.booleanshowWindow(java.lang.Class windowClass)brings the first frame to the top that is of the specified window class.voidwindowListChanged()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
-
-
-
-
Field Detail
-
GUI_MDI
public static final int GUI_MDI
displays the GUI as MDI.- See Also:
- Constant Field Values
-
GUI_SDI
public static final int GUI_SDI
displays the GUI as SDI.- See Also:
- Constant Field Values
-
TAGS_GUI
public static final Tag[] TAGS_GUI
GUI tags.
-
-
Method Detail
-
addChildFrame
public void addChildFrame(java.awt.Container c)
adds the given child frame to the list of frames.- Parameters:
c- the child frame to add
-
removeChildFrame
public boolean removeChildFrame(java.awt.Container c)
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
public boolean showWindow(java.awt.Container c)
brings child frame to the top.- Parameters:
c- the frame to activate- Returns:
- true if frame was activated
-
showWindow
public boolean showWindow(java.lang.Class windowClass)
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
public java.util.Iterator getWindowList()
returns all currently open frames.- Returns:
- an iterator over all currently open frame
-
getWindow
public java.awt.Container getWindow(java.lang.Class windowClass)
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
public java.awt.Container getWindow(java.lang.String title)
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
public boolean containsWindow(java.lang.Class windowClass)
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
public boolean containsWindow(java.lang.String title)
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:
setVisiblein classjava.awt.Window- Parameters:
b- if true, shows this component; otherwise, hides this component
-
createSingleton
public static void createSingleton(java.lang.String[] args)
Create the singleton instance of the Main GUI.- Parameters:
args- commandline options
-
getSingleton
public static Main getSingleton()
Return the singleton instance of the Main GUI.- Returns:
- the singleton instance
-
addStartupListener
public static void addStartupListener(StartUpListener s)
Add a listener to be notified when startup is complete.- Parameters:
s- a listener to add
-
listOptions
public java.util.Enumeration listOptions()
Gets an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Returns:
- an enumeration of all the available options.
-
getOptions
public java.lang.String[] getOptions()
returns the options of the current setup.- Specified by:
getOptionsin interfaceOptionHandler- Returns:
- the current options
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.ExceptionParses 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:
setOptionsin interfaceOptionHandler- Parameters:
options- the options to use- Throws:
java.lang.Exception- if setting of options fails
-
setGUIType
public void setGUIType(SelectedTag value)
Sets the type of GUI to use.- Parameters:
value- .the GUI type
-
getGUIType
public SelectedTag getGUIType()
Gets the currently set type of GUI to display.- Returns:
- the current GUI Type.
-
main
public static void main(java.lang.String[] args)
starts the application.- Parameters:
args- the commandline arguments - ignored
-
-