|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--edu.princeton.toy.TSimStdoutPane
TSimStdoutPane is a Scrollable component which displays the stdin stream of a virtualMachine in sim mode.
| Nested Class Summary | |
protected class |
TSimStdoutPane.Listener
The Listener of a TBaseConverterPane pays attention to the changes in the PTextFields, and fires off changes to the other PTextFields. |
| Field Summary | |
static int |
MAX_SCALE
The maxmimum scale which the TSimStdoutPane can be scaled to. |
static int |
MIN_SCALE
The minimum scale which the TSimStdoutPane can be scaled to. |
static int |
PREFERRED_SCALE
The scale used in determining the preferred size of the TSimStdoutPane. |
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.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 | |
TSimStdoutPane(TVirtualMachine virtualMachine)
Creates a new TSimStdoutPane. |
|
| Method Summary | |
boolean |
doCommand(String command,
Object extraInfo)
Performs a command based on the argument. |
Dimension |
getPreferredScrollableViewportSize()
Implement scrollable to make the viewport's preferred size that of the page size at the PREFERRED_SCALE. |
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
Implement scrollable to make the block increment a full page. |
boolean |
getScrollableTracksViewportHeight()
Implement scrollable to make the InternalTextArea's height always equal to that of it's viewport's. |
boolean |
getScrollableTracksViewportWidth()
Implement scrollable to make the InternalTextArea's size the greater of its own size and its viewport's size. |
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Implement scrollable to make the unit increment a tenth of a page. |
TVirtualMachine |
getVirtualMachine()
Returns the virtualMachine attached to this TSimStdoutPane. |
void |
paintComponent(Graphics g)
Override paintComponent() to make this TSimStdoutPane actually paint the memory information. |
protected void |
processComponentEvent(ComponentEvent e)
Intercept ComponentEvents to do resize and move the memPanel when this component is resized. |
protected void |
processHierarchyBoundsEvent(HierarchyEvent e)
Intercept HierarchyEvents to do resize and move the detailPanel when this component is resized. |
protected void |
processMouseEvent(MouseEvent e)
Process MouseEvents to mark the beginning of a mouse dragging session. |
protected void |
processMouseMotionEvent(MouseEvent e)
Process MouseEvents to scroll the pane when the mouse is dragged. |
void |
scrollToFrontier()
Ensures that the cell representing the word at the frontier of the stdout list is visible. |
void |
setVirtualMachine(TVirtualMachine virtualMachine)
Sets the virtualMachine attached to this TSimStdoutPane. |
| 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 RESCALE_COMMAND
public static final String UPDATE_COMMAND
public static final int MIN_SCALE
public static final int MAX_SCALE
public static final int PREFERRED_SCALE
| Constructor Detail |
public TSimStdoutPane(TVirtualMachine virtualMachine)
| Method Detail |
public void setVirtualMachine(TVirtualMachine virtualMachine)
virtualMachine - The virtualMachine to be attached to this TSimStdoutPane.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.
public void paintComponent(Graphics g)
paintComponent in class JComponentprotected void processHierarchyBoundsEvent(HierarchyEvent e)
processHierarchyBoundsEvent in class Componentprotected void processComponentEvent(ComponentEvent e)
processComponentEvent in class Componentprotected void processMouseEvent(MouseEvent e)
processMouseEvent in class Componentprotected void processMouseMotionEvent(MouseEvent e)
processMouseMotionEvent in class JComponentpublic void scrollToFrontier()
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize in interface Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
getScrollableUnitIncrement in interface Scrollable
public int getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
getScrollableBlockIncrement in interface Scrollablepublic boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth in interface Scrollablepublic boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight in interface Scrollable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||