|
|||||||||
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.TOptionsFrame
public class TOptionsFrame
Nested Class Summary | |
---|---|
protected static class |
TOptionsFrame.FileHistoryAction
FileHistoryAction is an action for opening a file that had been opened in the past. |
protected static class |
TOptionsFrame.IntStruct
IntStruct is a simple structure that encapsulates an integer. |
protected static class |
TOptionsFrame.OptionsAction
OptionsAction is an action for showing the TOptionFrame instance. |
protected class |
TOptionsFrame.ShutdownHook
ShutdownHook implements Runnable to store the TOptionsFrame's parameters upon exit. |
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, PROPERTIES, SOMEBITS |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
Implement ActionListener to pass the command onto doCommand(). |
void |
dispose()
Override this method to prevent unclean disposals. |
boolean |
doCommand(String command,
Object extraInfo)
Performs a command based on the argument. |
static boolean |
getAutoCheck()
Returns wheter or not the syntax should be checked automatically as the user types. |
static int |
getClockPeriod()
Returns the clock period (in milliseconds) that the vitrual machine should attempt to attain. |
static Document |
getClockPeriodDocument()
Returns a document containing a text representation of the clock period that the vitrual machine should attempt to attain. |
static File |
getCurrentDirectory()
Gets the directory in which JFileChoosers should start. |
static TExceptionHandler |
getExceptionHandler()
Gets the exception handler that all TVirtualMachines should use. |
static File |
getFileFromHistory(int index)
Gets a File object from the list of recent files. |
static boolean |
getIgnoreWarnings()
Returns wheter or not regular warnings should be ignored when the syntax of a program is being checked. |
static int |
getLastEditHorizontalDividerLocation()
Returns the location of the horizontal divider of the edit pane of the last TFrame which was closed. |
static Rectangle |
getLastFrameBounds()
Returns a copy of the bounds for the last TFrame which was closed. |
static int |
getLastSimHorizontalDividerLocation()
Returns the location of the horizontal divider of the sim pane of the last TFrame which was closed. |
static int |
getLastVerticalDividerLocation()
Returns the location of the vertical divider of the last TFrame which was closed. |
static int |
getRefreshRate()
Returns the refresh rate (in steps per refresh) that the TFrame should use in rendering a running toy machine. |
static Document |
getRefreshRateDocument()
Returns a document containing a text representation of the refresh rate that the TFrame should use in rendering a running toy machine. |
protected void |
processComponentEvent(ComponentEvent e)
Intercept ComponentEvents to pick up COMPONENT_MOVED events. |
protected void |
processWindowEvent(WindowEvent e)
Intercept WindowEvents to pick up WINDOW_CLOSING events. |
static void |
putFileIntoHistory(File file)
Puts a File object in the list of recent files. |
static void |
registerComponent(Component comp,
int areaIndex)
Registers a component to receive font assignments for a particular area. |
static void |
registerHighlightedTextArea(PHighlightedTextArea textArea)
Registers a PHighlightedTextArea to receive non-font assignments (color, column markers, etc...). |
static void |
setCurrentDirectory(File currentDirectory)
Sets the directory in which JFileChoosers should start. |
static void |
setLastEditHorizontalDividerLocation(int location)
Sets the location of the horizontal divider of the edit pane of the last TFrame which was closed. |
static void |
setLastFrameBounds(Rectangle bounds)
Sets the bounds for the last TFrame which was closed. |
static void |
setLastSimHorizontalDividerLocation(int location)
Sets the location of the horizontal divider of the sim pane of the last TFrame which was closed. |
static void |
setLastVerticalDividerLocation(int location)
Sets the location of the vertical divider of the last TFrame which was closed. |
static void |
show(DefaultMutableTreeNode node)
Shows a particular pane in the TOptionsFrame. |
static void |
unregisterComponent(Component comp,
int areaIndex)
Unregisters a component which previously received font assignments for a particular area. |
static void |
unregisterHighlightedTextArea(PHighlightedTextArea textArea)
Unregisters a component which previously received non-font assignments. |
void |
valueChanged(TreeSelectionEvent e)
Implement TreeSelectionListener to update the cardPanel's selection when the tree'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 WIDTH
public static final int HEIGHT
public static final String OK_COMMAND
public static final String CANCEL_COMMAND
public static final String DEFAULTS_COMMAND
public static final String APPLY_COMMAND
public static final DefaultMutableTreeNode ROOT_NODE
public static final DefaultMutableTreeNode EDITING_NODE
public static final DefaultMutableTreeNode EDITING_FONTS_NODE
public static final DefaultMutableTreeNode EDITING_COLORS_NODE
public static final DefaultMutableTreeNode EDITING_HIGHLIGHTING_NODE
public static final DefaultMutableTreeNode EDITING_AUTO_COMPLETE_NODE
public static final DefaultMutableTreeNode EDITING_CHECKING_NODE
public static final DefaultMutableTreeNode EXECUTION_NODE
public static final DefaultMutableTreeNode EXECUTION_EXCEPTION_NODE
public static final DefaultMutableTreeNode EXECUTION_PERFORMANCE_NODE
public static final String[] FONT_AREA_NAMES
public static final String[] FONT_AREA_KEYS
public static final int PROGRAM_AREA_INDEX
public static final int WARNING_AREA_INDEX
public static final int REFERENCE_AREA_INDEX
public static final int STDIN_AREA_INDEX
public static final int STDOUT_AREA_INDEX
public static final int CORE_AREA_INDEX
public static final String[] COLOR_NAMES
public static final String[] COLOR_DISABLED_DESCRIPTIONS
public static final String[] COLOR_COLOR_KEYS
public static final String[] COLOR_DISABLED_KEYS
public static final int FOREGROUND_COLOR_INDEX
public static final int BACKGROUND_COLOR_INDEX
public static final int CARET_COLOR_INDEX
public static final int SELECTION_COLOR_INDEX
public static final int SELECTED_TEXT_COLOR_INDEX
public static final int HIGHLIGHTED_LINE_COLOR_INDEX
public static final int HIGHLIGHTED_TEXT_COLOR_INDEX
public static final int LINE_NUMBERS_COLOR_INDEX
public static final int COLUMN_MARKERS_COLOR_INDEX
public static final String[] HIGHLIGHT_STYLE_NAMES
public static final String[] HIGHLIGHT_STYLE_KEYS
public static final AutoCompleter[] AUTO_COMPLETERS
public static final String[] AUTO_COMPLETER_NAMES
public static final String AUTO_COMPLETER_KEY
public static final String IGNORE_WARNINGS_KEY
public static final String AUTO_CHECK_KEY
public static final String[] EXCEPTION_TYPE_KEYS
TExceptionType.TYPES
public static final String CLOCK_PERIOD_KEY
public static final int[] CLOCK_PERIODS
public static final String REFRESH_RATE_KEY
public static final int[] REFRESH_RATES
public static final AbstractAction2 OPTIONS_ACTION
public static final int FILE_HISTORY_SIZE
public static final AbstractAction2[] FILE_HISTORY_ACTIONS
public static final String[] FILE_HISTORY_KEYS
public static final String CURRENT_DIRECTORY_KEY
public static final String LAST_FRAME_BOUNDS_KEY
public static final String LAST_VERTICAL_DIVIDER_LOCATION_KEY
public static final String LAST_EDIT_HORIZONTAL_DIVIDER_LOCATION_KEY
public static final String LAST_SIM_HORIZONTAL_DIVIDER_LOCATION_KEY
public static final String LAST_OPTIONS_FRAME_POSITION_KEY
Method Detail |
---|
public void dispose()
dispose
in class Window
public static void show(DefaultMutableTreeNode node)
node
- The node of the pane which should be shown. A null value will result in a
NullPointerException.public static void registerComponent(Component comp, int areaIndex)
component
- The component to register. If this is null, a NullPointerException will
be thrown.areaIndex
- The index of the area for which the component will receive font assignments.
If this is invalid, an ArrayIndexOutOfBoundsException will be thrown.public static void unregisterComponent(Component comp, int areaIndex)
component
- The component to unregister. If this is null, a NullPointerException will
be thrown.areaIndex
- The index of the area for which the component will no longer receive font
assignments. If this is invalid, an ArrayIndexOutOfBoundsException will be thrown.public static void registerHighlightedTextArea(PHighlightedTextArea textArea)
textArea
- The text area to register. If this is null, a NullPointerException will
be thrown.public static void unregisterHighlightedTextArea(PHighlightedTextArea textArea)
component
- The text area to unregister. If this is null, a NullPointerException will
be thrown.public static TExceptionHandler getExceptionHandler()
public static int getClockPeriod()
public static Document getClockPeriodDocument()
public static int getRefreshRate()
public static Document getRefreshRateDocument()
public static boolean getIgnoreWarnings()
public static boolean getAutoCheck()
public static File getCurrentDirectory()
public static void setCurrentDirectory(File currentDirectory)
currentDirectory
- The File object that should be associated with the "current
directory" of the program. If null is passed, a NullPointerException will be thrown.
If the File object does not correspond to an existing directory, the command will be ignored.public static File getFileFromHistory(int index)
index
- The index of the requested file. An invalid value will result in an
ArrayIndexOutOfBoundsException.
public static void putFileIntoHistory(File file)
file
- The File object that should be addedIf the File object does not correspond to
a readable file, the command will be ignored.public static void setLastFrameBounds(Rectangle bounds)
bounds
- The bounds of the last TFrame which was closed.public static Rectangle getLastFrameBounds()
public static void setLastVerticalDividerLocation(int location)
location
- The location of the vertical divider of the last TFrame which was closed.public static int getLastVerticalDividerLocation()
public static void setLastEditHorizontalDividerLocation(int location)
location
- The location of the horizontal divider of the edit pane of the last TFrame
which was closed.public static int getLastEditHorizontalDividerLocation()
public static void setLastSimHorizontalDividerLocation(int location)
location
- The location of the horizontal divider of the sim pane of the last TFrame
which was closed.public static int getLastSimHorizontalDividerLocation()
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. An IllegalArgumentException will be thrown if the argument is invalid.
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
doCommand(String, Object)
public void valueChanged(TreeSelectionEvent e)
valueChanged
in interface TreeSelectionListener
protected void processComponentEvent(ComponentEvent e)
processComponentEvent
in class Component
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 |