|
|||||||||
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.TSimMemPane
public class TSimMemPane
TSimMemPane is a Scrollable component which displays the memory of a virtualMachine in sim mode.
Nested Class Summary | |
---|---|
protected class |
TSimMemPane.Listener
The Listener of a TBaseConverterPane pays attention to the changes in the PTextFields, and fires off changes to the other PTextFields. |
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 int |
MAX_SCALE
The maxmimum scale which the TSimMemPane can be scaled to. |
static int |
MIN_SCALE
The minimum scale which the TSimMemPane can be scaled to. |
static int |
PREFERRED_SCALE
The scale used in determining the preferred size of the TSimMemPane. |
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 | |
---|---|
TSimMemPane(TVirtualMachine virtualMachine)
Creates a new TSimMemPane. |
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 TSimMemPane. |
void |
paintComponent(Graphics g)
Override paintComponent() to make this TSimMemPane 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 |
scrollToPc()
Ensures that the cell representing the memory sector to which the pc points is visible. |
void |
setVirtualMachine(TVirtualMachine virtualMachine)
Sets the virtualMachine attached to this TSimMemPane. |
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 TSimMemPane(TVirtualMachine virtualMachine)
Method Detail |
---|
public void setVirtualMachine(TVirtualMachine virtualMachine)
virtualMachine
- The virtualMachine to be attached to this TSimMemPane.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 JComponent
protected void processHierarchyBoundsEvent(HierarchyEvent e)
processHierarchyBoundsEvent
in class Component
protected void processComponentEvent(ComponentEvent e)
processComponentEvent
in class Component
protected void processMouseEvent(MouseEvent e)
processMouseEvent
in class JComponent
protected void processMouseMotionEvent(MouseEvent e)
processMouseMotionEvent
in class JComponent
public void scrollToPc()
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 Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface Scrollable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |