|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
scphEditor.ExpressionView
public class ExpressionView
This AWT component is the view class for Expression objects. It displays the expression recursively. It automatically updates itself whenever the expression changes (child manipulations), by way of the Observable-Observer mechanism.
Expression
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected Expression |
myClient
The expression viewed by me. |
protected OperandControl |
myControl
Remembers my control object (event listener), so I can pass it on to children. |
protected IEmbedding |
myEmbedding
The Embedding for the Operator of my expression. |
protected boolean |
paren
True iff I am showing parentheses. |
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 | |
---|---|
ExpressionView(Expression exOf,
OperandControl c)
Constructor. |
Method Summary | |
---|---|
void |
addNotify()
|
IEmbedding |
getEmbedding()
Returns the Embedding for the Operator of my Expression. |
Operand |
getOperand()
|
OperandVector |
getOperandVector()
|
java.awt.Component |
getOperandView(int opindex)
|
protected void |
makeComponents()
Creates my components - views for child operands as well as operator symbols and parentheses. |
int |
operandIndex(java.awt.Component child)
|
void |
paint(java.awt.Graphics g)
|
protected void |
parenthesize()
Helper function. |
void |
removeNotify()
|
protected java.awt.Component |
setOperandView(int opindex,
java.awt.Component view)
Helper function. |
void |
update(java.util.Observable o,
java.lang.Object arg)
|
int |
viewIndex(java.awt.Component child)
Given a child view object, looks up the Component index it belongs to in me. |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Expression myClient
protected IEmbedding myEmbedding
protected boolean paren
protected OperandControl myControl
Constructor Detail |
---|
public ExpressionView(Expression exOf, OperandControl c)
exOf
- the Expression object to view.c
- the control object (event listener) for me.Method Detail |
---|
protected void makeComponents()
protected void parenthesize()
public void addNotify()
addNotify
in class java.awt.Container
public void removeNotify()
removeNotify
in class java.awt.Container
public IEmbedding getEmbedding()
public Operand getOperand()
getOperand
in interface OperandView
public OperandVector getOperandVector()
getOperandVector
in interface OperandVectorView
public int operandIndex(java.awt.Component child)
operandIndex
in interface OperandVectorView
public java.awt.Component getOperandView(int opindex)
getOperandView
in interface OperandVectorView
protected java.awt.Component setOperandView(int opindex, java.awt.Component view)
opindex
- the index.view
- the new view object.
public int viewIndex(java.awt.Component child)
child
- the child view object.
public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
public void paint(java.awt.Graphics g)
paint
in class java.awt.Container
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |