|
|||||||||
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.princeton.toy.TStdinPane
public class TStdinPane
TStdinPane is a JPanel which acts as an editor for the stdin of a TVirtualMachine.
Nested Class Summary | |
---|---|
protected class |
TStdinPane.Listener
The Listener of a TStdoutPane pays attention to the changes in the virtualMachine and updates the components, it also stops the stdin text field from blinking if the user clicks on it and listens to action events from JButtons and PTextFields. |
protected static class |
TStdinPane.ListModel
A customized implementation of ListModel meant specifically for displaying stdin. |
protected class |
TStdinPane.Runner
The Runner of a TStdin blinks the inputField when the Virtual machine needs input. |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
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 |
ADD_COMMAND
The command to add the contents of the inputField to the stdin stream of the virtualMachine. |
static String |
REMOVE_COMMAND
The command to remove the selected items from the stdin stream of the virtualMachine. |
static String |
UPDATE_COMMAND
The command to update the contents of the inputList with the stdin stream of the virtualMachine. |
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.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
TStdinPane(TVirtualMachine virtualMachine,
Action openStdinAction,
Action saveStdinAction,
boolean allowBlink)
Creates a new TStdinPane. |
Method Summary | |
---|---|
boolean |
doCommand(String command,
Object extraInfo)
Performs a command based on the argument. |
TVirtualMachine |
getVirtualMachine()
Returns the virtualMachine attached to this TStdinPane. |
void |
setVirtualMachine(TVirtualMachine virtualMachine)
Sets the virtualMachine attached to this TStdinPane. |
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 String ADD_COMMAND
public static final String REMOVE_COMMAND
public static final String UPDATE_COMMAND
Constructor Detail |
---|
public TStdinPane(TVirtualMachine virtualMachine, Action openStdinAction, Action saveStdinAction, boolean allowBlink)
Method Detail |
---|
public void setVirtualMachine(TVirtualMachine virtualMachine)
virtualMachine
- The virtualMachine to be attached to this TStdinPane.public TVirtualMachine getVirtualMachine()
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |