|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
edu.neu.ccs.gui.DisplayPanel
edu.neu.ccs.jpf.JPFApplication
This is the main application that sets up a console, a graphics window, and installs a list of actions to select one of several tasks to run from a given collection of "proper" methods.
Recently, a bug was discovered in the Mac OS X look-and-feel. This bug
is triggered by changes in the text color between the three console streams:
in, out, and err. The bug does not appear to occur if the color remains at
black. Hence, the showConsole method no longer sets the
color text scheme by default.
This bug is not triggered on Windows nor is it triggered when using the Metal look-and-feel on a Mac.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
static int |
BUFFER_HEIGHT
Default buffer height. |
static int |
BUFFER_WIDTH
Default buffer width. |
protected TablePanel |
buttonsPanel
Buttons table panel for method buttons and common actions. |
protected Action |
clearGraphics
Clear graphics action. |
private static Color |
commonButtonColor
The color of the common buttons except exit. |
(package private) JButton[] |
commonButtons
The common action buttons. |
protected ActionsPanel |
commonButtonsPanel
Buttons panel for common actions. |
private static Color |
exitButtonColor
The color of the exit button. |
protected Action |
exitFramework
Application closing action. |
protected JPTFrame |
frame
Application frame. |
protected String |
frameTitle
Application frame title. |
protected JPF |
initializer
Initializer object for the class with the methods. |
protected Class |
initializerClass
Class of the initializer object. |
protected DisplayPanel |
LHS
LHS of main GUI panel. |
protected TablePanel |
mainPanel
Main GUI panel. |
private static Color |
methodButtonColor
The color of the method buttons when enabled. |
private static Color |
methodButtonColorDisabled
The color of the method buttons when disabled. |
(package private) JButton[] |
methodButtons
The method buttons. |
protected ActionsPanel |
methodButtonsPanel
Buttons panel for method buttons. |
protected DisplayPanel |
RHS
RHS of main GUI panel. |
protected boolean |
showGraphicsWindow
Whether or not to show graphics window. |
protected Action |
toggleConsole
Toggle graphics action. |
protected Action |
toggleGraphics
Toggle graphics action. |
protected BufferedPanel |
window
Default graphics buffered panel. |
| Fields inherited from class edu.neu.ccs.gui.DisplayPanel |
background, codec, CODEC |
| Fields inherited from class javax.swing.JPanel |
|
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface edu.neu.ccs.console.ConsoleAware |
console |
| Fields inherited from interface edu.neu.ccs.gui.Displayable |
DEFAULT_VIEW_STATE, VIEW_STATE |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JPFApplication(JPF initializer,
String title)
Constructs the GUI. |
|
| Method Summary | |
protected JButton |
addOneButton(ActionsPanel panel,
Action action,
String tooltip)
Adds one button with the given action and tool tip to the panel and then returns the button. |
protected void |
buildButtons()
Builds the buttons. |
protected void |
buildGUI()
Builds the main panel. |
protected static String |
className(Class c)
Returns the unqualified name of the given Class |
void |
clearGraphics()
Clears the graphics window. |
protected void |
exitFramework()
Exits the framework by closing the Java Virtual Machine. |
protected Method[] |
getExtraMethods(Class c,
Class d)
Gets the methods in Class c that do not come from Class d. |
String |
getFrameTitle()
Returns the title for the framework window. |
BufferedPanel |
getGraphicsWindow()
Returns the graphics window. |
protected Method[] |
getMethodList()
Returns a list of the "proper" methods, that is, methods for which we can instantiate buttons in the main GUI. |
protected String |
getMethodToolTip(Method method)
Returns a tool tip appropriate for this method. |
protected String |
getParameterNames(Method method)
Returns a String representing the parameters of the method. |
protected void |
handleMethodException(Throwable exception,
String name)
Handles exception produced by Method invocation. |
void |
iconifyConsole()
Sets the state of an activated console window to iconified. |
protected boolean |
isAcceptableMethodForGUI(Method method)
Returns true if the parameter types and return type are acceptable for the automatic MethodGUI and if the method is either non-void or has parameters. |
protected boolean |
isAcceptableTypeForParameter(Class c)
Returns true if the type is acceptable for a method parameter. |
protected boolean |
isAcceptableTypeForReturn(Class c)
Returns true if the type is acceptable for a method return. |
protected boolean |
isDuplicate(Method method1,
Method method2)
Returns true if the two methods have the same signature. |
protected boolean |
isDuplicateParameterList(Method method1,
Method method2)
Returns true if the two methods have the same parameter list. |
boolean |
isGraphicsVisible()
Returns whether or not the graphics window is visible. |
protected boolean |
isGUIMethod(Method method)
Returns true if the method should be converted to a button with GUI. |
protected boolean |
isSimpleMethod(Method method)
Returns true if the method should be converted to a simple button. |
protected boolean |
isStatic(Method method)
|
protected Method[] |
joinMethodArrays(Method[] listA,
Method[] listB)
Joins two Method arrays into one. |
protected Action |
makeActionFromMethod(Method method)
Makes a ThreadedAction from the given method. |
void |
normalConsole()
Sets the state of an activated console window to normal. |
protected void |
performAction(Method method)
Performs the given method and assures that the method calls are synchronized. |
void |
performActionUsingGUI(Method method)
Performs the given method using an automatice GUI and assures that the method calls are synchronized. |
protected void |
printExceptionTrace(Throwable exception,
String name)
Prints the exception trace minus references to Java reflection. |
protected void |
removeDuplicateVirtualMethods(Method[] methods)
Removes duplicate virtual methods defined in several classes. |
void |
setFrameTitle(String title)
Sets the title for the framework window to the given title. |
void |
setGraphicsVisible(boolean visible)
Sets the visibility of the graphics window. |
protected void |
setMethodButtonsEnabled(boolean enable)
Enable or disable the method buttons. |
protected void |
showConsole()
Shows the console. |
void |
toggleConsole()
Toggles the state of an activated console window between normal and iconified. |
void |
toggleGraphics()
Toggles the visibility of the graphics window. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int BUFFER_WIDTH
public static final int BUFFER_HEIGHT
private static final Color commonButtonColor
private static final Color exitButtonColor
private static final Color methodButtonColor
private static final Color methodButtonColorDisabled
protected BufferedPanel window
protected JPF initializer
protected Class initializerClass
protected JPTFrame frame
protected String frameTitle
protected boolean showGraphicsWindow
protected ActionsPanel methodButtonsPanel
protected ActionsPanel commonButtonsPanel
protected TablePanel buttonsPanel
protected DisplayPanel RHS
protected DisplayPanel LHS
JButton[] methodButtons
JButton[] commonButtons
protected TablePanel mainPanel
protected Action clearGraphics
protected Action toggleGraphics
protected Action toggleConsole
protected Action exitFramework
| Constructor Detail |
public JPFApplication(JPF initializer,
String title)
JPF.
initializer - JPF framework initializing this applicationtitle - title for the application frame| Method Detail |
public BufferedPanel getGraphicsWindow()
public String getFrameTitle()
public void setFrameTitle(String title)
title - title text for the windowpublic void normalConsole()
public void iconifyConsole()
public void toggleConsole()
public void clearGraphics()
public boolean isGraphicsVisible()
public void setGraphicsVisible(boolean visible)
Sets the visibility of the graphics window.
Does nothing if visibility will not change.
visible - the desired visibility settingpublic void toggleGraphics()
protected void exitFramework()
protected void buildButtons()
protected JButton addOneButton(ActionsPanel panel,
Action action,
String tooltip)
protected String getMethodToolTip(Method method)
protected String getParameterNames(Method method)
protected void buildGUI()
protected void showConsole()
Shows the console.
No longer sets the color text scheme by default due to a Mac bug described in the introduction to this class.
protected void setMethodButtonsEnabled(boolean enable)
enable - whether or not to enable.protected Method[] getMethodList()
nulls.
protected void removeDuplicateVirtualMethods(Method[] methods)
protected boolean isDuplicate(Method method1,
Method method2)
protected boolean isDuplicateParameterList(Method method1,
Method method2)
protected Action makeActionFromMethod(Method method)
protected void performAction(Method method)
protected void handleMethodException(Throwable exception,
String name)
protected void printExceptionTrace(Throwable exception,
String name)
public void performActionUsingGUI(Method method)
protected boolean isSimpleMethod(Method method)
protected boolean isGUIMethod(Method method)
protected boolean isAcceptableTypeForParameter(Class c)
protected boolean isAcceptableTypeForReturn(Class c)
protected boolean isAcceptableMethodForGUI(Method method)
protected Method[] getExtraMethods(Class c,
Class d)
protected Method[] joinMethodArrays(Method[] listA,
Method[] listB)
protected boolean isStatic(Method method)
protected static String className(Class c)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||