UTJML

edu.utep.cs.utjml.canica
Class Main

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by edu.utep.cs.utjml.canica.Main
All Implemented Interfaces:
Constants, Mainable, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class Main
extends JFrame
implements Constants, Mainable

A graphics user interface to the JML-based unit testing tool for Java. The GUI consists of three main panes, the file browser pane, the editor pane, and the output pane. The explorer pane allows one to browse directories and files, the editor pane allows one to edit one or more Java/JML source programs, and the output pane displays console view, test generation view, and run test view from the GUI. The status bar at the bottom of the GUI shows various status information.

Author:
Yoonsik Cheon and Angelica B Perez
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
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
static String CLASSPATH
          The class path of this program.
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
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 edu.utep.cs.utjml.canica.Constants
BLANK_ICON, CLASS_EXTENSION, COLOR_EXPLORER, COLOR_OUTPUT, COPYRIGHT, DEBUG, EDIT_MENU_NAME, EXPLORER_DIR, EXPLORER_ROOT, FILE_MENU_NAME, FILE_SEPARATOR, HELP_MENU_NAME, ICON_ABOUT, ICON_BROWSER, ICON_CASE_ACCEPTED, ICON_CASE_REJECTED, ICON_CHECK_JML, ICON_CLASS, ICON_COMMENT, ICON_COMPILE_FORTEST, ICON_COMPILE_JAVA, ICON_COMPILE_JML, ICON_COMPILE_JML_TEST, ICON_CONSOLE_VIEW, ICON_COPY, ICON_CUT, ICON_DELETE, ICON_ERROR, ICON_FILE, ICON_FOLDER, ICON_GOTO, ICON_HOME, ICON_INFORM, ICON_JAVA_FILE, ICON_JML_LOGO, ICON_JML_LOGO_ICONBEST, ICON_LOAD_ANDTEST, ICON_METHOD, ICON_NEW, ICON_NEWTESTSUITE, ICON_NOTE, ICON_OPEN, ICON_PASTE, ICON_PREFERENCES, ICON_PRINT, ICON_QUESTION, ICON_REDO, ICON_RUN, ICON_RUN_TEST, ICON_SAVE, ICON_SAVEALL, ICON_SAVEAS, ICON_SELECT_ALL, ICON_TEST_FILE, ICON_TEST_WIZARD, ICON_TESTCASE, ICON_TESTCASE_ERROR, ICON_TESTCASE_FAIL, ICON_TESTCASE_HIERARCHY, ICON_TESTCASE_OK, ICON_TESTCASE_RUNS, ICON_UNCOMMENT, ICON_UNDO, ICON_UNKNOWN, ICON_WARN, INSERT_MENU_NAME, JAVA, JAVA_EXTENSION, JAVAC, JUNIT_SWINGGUI_TESTRUNNER, looks, NEWLINE, OPTION_MENU_NAME, PATH_SEPARATOR, SEARCH_MENU_NAME, TEST_MENU_NAME, TOOL_MENU_NAME, VERSION, WEB_PAGE_LOCATION, WEB_PAGE_NAME, WINDOW_HEIGHT, WINDOW_MIN_HEIGHT, WINDOW_MIN_WIDTH, WINDOW_WIDTH
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Main(String name)
          Creates a new instance of Canica
 
Method Summary
 void changeTheLookAndFeel(int value)
          Changes the look and feel of this GUI, using the integer value.
 JMLEditorable editor()
          Returns the editor of this GUI
 FileBrowserable fileBrowser()
          Returns the explorer of this GUI.
 JFrame frame()
          Returns the frame of this GUI.
 String getCLASSPATH()
          Returns the CLASSPATH specified in the global IDE preferences for Canica
 String getHomeDirectory()
          Returns the home directory specified in the global IDE preferences for Canica
 int getIndentationSize()
          Returns the indentation size specified in the editor preferences
 String getJavaCompilerHomePath()
          Returns the Java Compiler Home path specified in the global IDE preferences for Canica
 String getJavaDocPath()
          Returns the path specified to the Javadoc tool in the global IDE preferences for Canica
 String getJMLDocPath()
          Returns the path specified to the JMLdoc tool in the global IDE preferences for Canica
 int getMaxFilesOpen()
          Returns the maximum number of files that can be opened in the JML editor
 String getOptionsToJavaC()
          Returns the option values specified to the Java compiler in the global IDE preferences for Canica
 String getOptionsToJMLC()
          Returns the option values specified to the JML compiler tool in the global IDE preferences for Canica
 boolean getPrefToSearchAndReplace()
          Returns the preference to the search and replace functionalities located in the JML Editor Subsystem.
 String getSyntaxHighlightPath()
          Returns the syntax highlighting file path specified in the editor preferences
 String getWorkingDirectory()
          Returns the working directory assigned by default for Canica
static void main(String[] args)
          The main entry point of this GUI.
 OutputPaneable outputPane()
          Returns the output pane of this GUI.
 void putValueToRedoAction(String actionName, Object redoPresentationName)
          Puts a new value to the Redo action in the Edit Menu
 void putValueToUndoAction(String actionName, Object undoPresentationName)
          Puts a new value to the Undo action in the Edit Menu
 void resetCLASSPATH()
           
 void resetMenu()
          Reset the Menu to original state
 void setEnabledToMenuItems(MenuOptions menuOptions)
          Sets the "setEnabled" properties to the menu items of the main menu
 void setEnabledToMenuItems(String menuName, boolean[] menuItems)
          Sets the "setEnabled" properties to the menu items of the main menu, corresponding to the menu name
 void setWorkingDirectory(String workingDir)
          Sets the actual working directory
 StatusBarable statusBar()
          Returns the status bar of this GUI.
 Toolable tool()
          Returns the tool of this GUI
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, 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, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

CLASSPATH

public static final String CLASSPATH
The class path of this program. If this program is started as an executable jar, then append the current working directory to the front.

Constructor Detail

Main

public Main(String name)
Creates a new instance of Canica

Parameters:
name - The IDE name
Method Detail

changeTheLookAndFeel

public void changeTheLookAndFeel(int value)
Changes the look and feel of this GUI, using the integer value.


frame

public JFrame frame()
Returns the frame of this GUI.

Specified by:
frame in interface Mainable

editor

public JMLEditorable editor()
Returns the editor of this GUI

Specified by:
editor in interface Mainable

statusBar

public StatusBarable statusBar()
Returns the status bar of this GUI.

Specified by:
statusBar in interface Mainable

outputPane

public OutputPaneable outputPane()
Description copied from interface: Mainable
Returns the output pane of this GUI.

Specified by:
outputPane in interface Mainable

tool

public Toolable tool()
Description copied from interface: Mainable
Returns the tool of this GUI

Specified by:
tool in interface Mainable

fileBrowser

public FileBrowserable fileBrowser()
Description copied from interface: Mainable
Returns the explorer of this GUI.

Specified by:
fileBrowser in interface Mainable

getHomeDirectory

public String getHomeDirectory()
Description copied from interface: Mainable
Returns the home directory specified in the global IDE preferences for Canica

Specified by:
getHomeDirectory in interface Mainable

getWorkingDirectory

public String getWorkingDirectory()
Description copied from interface: Mainable
Returns the working directory assigned by default for Canica

Specified by:
getWorkingDirectory in interface Mainable

setWorkingDirectory

public void setWorkingDirectory(String workingDir)
Description copied from interface: Mainable
Sets the actual working directory

Specified by:
setWorkingDirectory in interface Mainable
Parameters:
workingDir - Actual directory

getJavaCompilerHomePath

public String getJavaCompilerHomePath()
Description copied from interface: Mainable
Returns the Java Compiler Home path specified in the global IDE preferences for Canica

Specified by:
getJavaCompilerHomePath in interface Mainable

getOptionsToJavaC

public String getOptionsToJavaC()
Description copied from interface: Mainable
Returns the option values specified to the Java compiler in the global IDE preferences for Canica

Specified by:
getOptionsToJavaC in interface Mainable

getCLASSPATH

public String getCLASSPATH()
Description copied from interface: Mainable
Returns the CLASSPATH specified in the global IDE preferences for Canica

Specified by:
getCLASSPATH in interface Mainable

resetCLASSPATH

public void resetCLASSPATH()

getOptionsToJMLC

public String getOptionsToJMLC()
Description copied from interface: Mainable
Returns the option values specified to the JML compiler tool in the global IDE preferences for Canica

Specified by:
getOptionsToJMLC in interface Mainable

getJavaDocPath

public String getJavaDocPath()
Description copied from interface: Mainable
Returns the path specified to the Javadoc tool in the global IDE preferences for Canica

Specified by:
getJavaDocPath in interface Mainable

getJMLDocPath

public String getJMLDocPath()
Description copied from interface: Mainable
Returns the path specified to the JMLdoc tool in the global IDE preferences for Canica

Specified by:
getJMLDocPath in interface Mainable

getSyntaxHighlightPath

public String getSyntaxHighlightPath()
Description copied from interface: Mainable
Returns the syntax highlighting file path specified in the editor preferences

Specified by:
getSyntaxHighlightPath in interface Mainable

getIndentationSize

public int getIndentationSize()
Description copied from interface: Mainable
Returns the indentation size specified in the editor preferences

Specified by:
getIndentationSize in interface Mainable

getMaxFilesOpen

public int getMaxFilesOpen()
Description copied from interface: Mainable
Returns the maximum number of files that can be opened in the JML editor

Specified by:
getMaxFilesOpen in interface Mainable

getPrefToSearchAndReplace

public boolean getPrefToSearchAndReplace()
Description copied from interface: Mainable
Returns the preference to the search and replace functionalities located in the JML Editor Subsystem. The preference should be true by default, this means, the search and replace should be to the current file only; and false if the search and replace should be to all files opened.

Specified by:
getPrefToSearchAndReplace in interface Mainable

setEnabledToMenuItems

public void setEnabledToMenuItems(String menuName,
                                  boolean[] menuItems)
Description copied from interface: Mainable
Sets the "setEnabled" properties to the menu items of the main menu, corresponding to the menu name

Specified by:
setEnabledToMenuItems in interface Mainable
Parameters:
menuName - The menu name
menuItems - The boolean array containing the values to the menu items set enabled property.

setEnabledToMenuItems

public void setEnabledToMenuItems(MenuOptions menuOptions)
Description copied from interface: Mainable
Sets the "setEnabled" properties to the menu items of the main menu

Specified by:
setEnabledToMenuItems in interface Mainable

resetMenu

public void resetMenu()
Description copied from interface: Mainable
Reset the Menu to original state

Specified by:
resetMenu in interface Mainable

putValueToUndoAction

public void putValueToUndoAction(String actionName,
                                 Object undoPresentationName)
Description copied from interface: Mainable
Puts a new value to the Undo action in the Edit Menu

Specified by:
putValueToUndoAction in interface Mainable

putValueToRedoAction

public void putValueToRedoAction(String actionName,
                                 Object redoPresentationName)
Description copied from interface: Mainable
Puts a new value to the Redo action in the Edit Menu

Specified by:
putValueToRedoAction in interface Mainable

main

public static void main(String[] args)
The main entry point of this GUI.


UTJML

UTJML is Copyright (C) 2004-2006 by University of Texas at El Paso and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the JML project.