|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
edu.princeton.toy.TFrame
public class TFrame
Nested Class Summary | |
---|---|
protected static class |
TFrame.Runner
Runner is the implementation of Runnable which updates the warnings of all TFrames (if the program had changed since the last syntax check). |
protected class |
TFrame.TFrameAction
TFrameAction is a generalizable action for the TFrame; basically, it relays all ActionEvents to the doCommand() method. |
static class |
TFrame.WorkspaceMenuItem
TWorkspaceMenuItem is a simple subclass of JRadioButtonMenuItem which keeps an index property. |
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 |
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 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 | |
---|---|
TFrame()
|
|
TFrame(TProgramDocument program)
|
|
TFrame(TProgramDocument program,
File file)
|
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
Implement ActionListener to pass the command onto doCommand(). |
static TFrame |
createInitialFrame()
Creates the first frame, initializing locations and bounds from the TOptionFrame's memory of the last closed TFrame. |
void |
dispose()
Override this method to prevent unclean disposals. |
boolean |
doCommand(String command,
Object extraInfo)
Performs a command based on the argument. |
int |
getClockPeriod()
This function is called by the TVirtualMachine's runner after it has recieved an order for a batch of steps to be run. |
protected void |
processWindowEvent(WindowEvent e)
Intercept WindowEvents to pick up WINDOW_CLOSING events. |
static void |
setAutoCheck(boolean autoCheck)
Starts or stops the auto-syntax-check runner. |
void |
stateChanged(ChangeEvent e)
Implement ChangeListener to listen to changes in the state of the virtual machine. |
int |
statusUpdate(TVirtualMachine virtualMachine,
int n,
int elapsedTime,
boolean willStop)
This function is called by the TVirtualMachine's runner when it has completed the previous batch of steps. |
void |
textValueChanged(TextEvent e)
Implement TextListener to update the other components when the document changes. |
void |
valueChanged(ListSelectionEvent e)
Implement ListSelectionListener to update the editTextArea selection when the list's selection changes. |
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.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
public static final int CASCADE_X
public static final int CASCADE_Y
public static final String NEW_COMMAND
public static final String OPEN_COMMAND
public static final String OPEN_EXAMPLE_COMMAND
public static final String CLOSE_COMMAND
public static final String REVERT_COMMAND
public static final String SAVE_COMMAND
public static final String SAVE_ALL_COMMAND
public static final String SAVE_AS_COMMAND
public static final String QUIT_COMMAND
public static final String EDIT_MODE_COMMAND
public static final String DEBUG_MODE_COMMAND
public static final String SIM_MODE_COMMAND
public static final String LOOK_COMMAND
public static final String LOAD_COMMAND
public static final String RESET_COMMAND
public static final String STEP_COMMAND
public static final String RUN_COMMAND
public static final String INTERRUPT_COMMAND
public static final String ENTER_COMMAND
public static final String OPEN_STDIN_COMMAND
public static final String SAVE_STDIN_COMMAND
public static final String SAVE_STDOUT_COMMAND
public static final String SAVE_MEM_DUMP_COMMAND
public static final String SAVE_CORE_DUMP_COMMAND
public static final String WORKSPACE_COMMAND
public static final String CHECK_SYNTAX_COMMAND
public static final String FUNCTION_COMMAND
public static final String AUTOCOMMENT_COMMAND
public static final String STRIP_COMMENTS_COMMAND
public static final String CHANGE_EXECUTION_COMMAND
public static final String CLEAR_ODOMETER_COMMAND
public static final String CHANGE_CHECKING_COMMAND
public static final String HIDE_WARNINGS_COMMAND
Constructor Detail |
---|
public TFrame()
public TFrame(TProgramDocument program)
public TFrame(TProgramDocument program, File file)
Method Detail |
---|
public void dispose()
dispose
in class Window
public static void setAutoCheck(boolean autoCheck)
autoCheck
- Wheter or not the auto-syntax-check runner should be running.public static TFrame createInitialFrame()
public boolean doCommand(String command, Object extraInfo)
command
- A string representing the command. Note that pointer equality (not string
equality) is tested here, so it is important to use the string constants defined in this
class. TFrame.WORKSPACE_COMMAND requires an integer to be appended to it in order to
distinguish between the arbitrarily large number of other workspaces. An
IllegalArgumentException will be thrown if the argument is invalid.extraInfo
- Any extra information necessary. This is specific to the command:
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
doCommand(String, Object)
public void textValueChanged(TextEvent e)
textValueChanged
in interface TextListener
public void valueChanged(ListSelectionEvent e)
valueChanged
in interface ListSelectionListener
public void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
public int statusUpdate(TVirtualMachine virtualMachine, int n, int elapsedTime, boolean willStop)
statusUpdate
in interface TVirtualMachine.ExecutionController
virtualMachine
- The virtual machine whose status is being reported.n
- The number of steps taken since the last update.elapsedTime
- The number of milliseconds between the lastUpdate and the present.willStop
- Wheter or not the TVirtualMachine will stop after this status update.
public int getClockPeriod()
getClockPeriod
in interface TVirtualMachine.ExecutionController
protected void processWindowEvent(WindowEvent e)
processWindowEvent
in class JFrame
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |