|
|||||||||
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.JLayeredPane
edu.princeton.toy.TSimMachinePane
public class TSimMachinePane
TSimMachinePane is a JPanel which acts the interface between the TVirtualMachine and the user when Visual X-TOY is in Sim mode.
Nested Class Summary | |
---|---|
protected class |
TSimMachinePane.Listener
The Listener of a TBaseConverterPane pays attention to the changes in the PTextFields, and fires off changes to the other PTextFields. |
protected class |
TSimMachinePane.Runner
Runner is a simple implementation of Runnable for the Thread started when the component's size changes. |
Nested classes/interfaces inherited from class javax.swing.JLayeredPane |
---|
JLayeredPane.AccessibleJLayeredPane |
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 int |
ADDR_BIT_COUNT
The number of addr switches in the TSimMachinePane. |
static Border |
BLUE_AREA_BORDER
The border of the blue area in the TSimMachinePane. |
static Color |
BLUE_AREA_COLOR
The color of the blue area in the TSimMachinePane. |
static int |
DATA_BIT_COUNT
The number of addr switches in the TSimMachinePane. |
static int |
INSTR_BIT_COUNT
The number of instr lights in the TSimMachinePane. |
static int |
MAX_SCALE
The maxmimum scale to which the TSimMachinePane can be scaled. |
static int |
MIN_SCALE
The minimum scale which the TSimMachinePane can be scaled to. |
static int |
PC_BIT_COUNT
The number of pc lights in the TSimMachinePane. |
static Border |
PLACEHOLDER_BORDER
The border of the resizing placeholder in the TSimMachinePane. |
static int |
PREFERRED_SCALE
The scale used in determining the preferred size of the TSimMachinePane. |
static String |
RESCALE_COMMAND
The command to update the contents of the inputList with 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.JLayeredPane |
---|
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER |
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 | |
---|---|
TSimMachinePane(TVirtualMachine virtualMachine,
Action loadAction,
Action lookAction,
Action stepAction,
Action runAction,
Action enterAction,
Action interruptAction,
Action resetAction)
Creates a new TSimMachinePane. |
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener listener)
Adds a listener to monitor changes in the state of the switches. |
boolean |
doCommand(String command,
Object extraInfo)
Performs a command based on the argument. |
protected void |
fireStateChanged()
Fires a state changed event to all the listeners. |
TWord |
getAddr()
Returns the TWord derived from the positions of the addr switches. |
TWord |
getData()
Returns the TWord derived from the positions of the data switches. |
TVirtualMachine |
getVirtualMachine()
Returns the virtualMachine attached to this TSimMachinePane. |
protected void |
processComponentEvent(ComponentEvent e)
Intercept ComponentEvents to do resize and move the bluePanel when this component is resized. |
void |
removeChangeListener(ChangeListener listener)
Removes a listener from this machine. |
void |
setVirtualMachine(TVirtualMachine virtualMachine)
Sets the virtualMachine attached to this TSimMachinePane. |
Methods inherited from class javax.swing.JLayeredPane |
---|
addImpl, getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, paramString, putLayer, remove, removeAll, setLayer, setLayer, setPosition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String RESCALE_COMMAND
public static final String UPDATE_COMMAND
public static final int PC_BIT_COUNT
public static final int ADDR_BIT_COUNT
public static final int INSTR_BIT_COUNT
public static final int DATA_BIT_COUNT
public static final Color BLUE_AREA_COLOR
public static final Border BLUE_AREA_BORDER
public static final Border PLACEHOLDER_BORDER
public static final int MIN_SCALE
public static final int MAX_SCALE
public static final int PREFERRED_SCALE
Constructor Detail |
---|
public TSimMachinePane(TVirtualMachine virtualMachine, Action loadAction, Action lookAction, Action stepAction, Action runAction, Action enterAction, Action interruptAction, Action resetAction)
Method Detail |
---|
public void addChangeListener(ChangeListener listener)
listener
- The listener to add to this pane. A null value will cause a
NullPointerException.public void removeChangeListener(ChangeListener listener)
listener
- The listener to remove from this pane. A null value will cause a
NullPointerException.public void setVirtualMachine(TVirtualMachine virtualMachine)
virtualMachine
- The virtualMachine to be attached to this TSimMachinePane.public TVirtualMachine getVirtualMachine()
public TWord getAddr()
public TWord getData()
protected void fireStateChanged()
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.
protected void processComponentEvent(ComponentEvent e)
processComponentEvent
in class Component
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |