|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.problets.domain.model.expression.node.NodeView
org.problets.domain.model.expression.node.operator.OperatorView
org.problets.domain.model.expression.node.operator.misc.ParenthesisView
public class ParenthesisView
To keep track of displaying a parenthesized expression, and underbraces
Constructor Summary | |
---|---|
ParenthesisView(NodeModel inOperator)
|
Method Summary | |
---|---|
void |
classifyNodes(java.util.Vector operatorViewVector,
java.util.Vector operandViewVector)
Does an in-order traversal of the view tree (to preserve left to right order) and adds leaf operators to operatorView, and leaf operands to operandView |
void |
explain(java.util.Vector explanation)
Graphically explains the evaluation of the expression as opposed to textual explanation by the model |
NodeView |
getCopyIfExists(java.util.Vector availableViews,
java.lang.String presumedValue)
If actualNodeView exists in availableViews, return a copy of it, else return null actualNodeView is part of the actual answer, an OperatorView or OperandView object. |
boolean |
isCovered(int leftCoord,
int rightCoord)
Returns true if this node is straddled by leftX and rightX, and false otherwise. |
void |
paintExpression(java.awt.Graphics g,
int y)
Method should be called only after this node has been typeset first |
static java.util.Vector |
stripParentheses(java.util.Vector originalVector)
Given a vector of ExpressionViewStep objects, strip all that correspond to parenthesis |
int |
typeset(java.awt.Graphics g,
java.awt.FontMetrics inFontMetrics,
int x,
int y,
int spacing)
Given the graphics context and the font metrics used, this method will calculate the left and right extents of all the operators and operands in an expression. |
Methods inherited from class org.problets.domain.model.expression.node.operator.OperatorView |
---|
getContentWidth |
Methods inherited from class org.problets.domain.model.expression.node.NodeView |
---|
clone, getBackupLeftX, getBackupRightX, getContent, getFontMetrics, getLeftChild, getLeftMax, getLeftMin, getLeftX, getNode, getNodeView, getRightChild, getRightMax, getRightMin, getRightX, getSideEffects, getValue, print, setLeftChild, setRightChild, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ParenthesisView(NodeModel inOperator)
Method Detail |
---|
public int typeset(java.awt.Graphics g, java.awt.FontMetrics inFontMetrics, int x, int y, int spacing)
typeset
in class NodeView
public void paintExpression(java.awt.Graphics g, int y)
paintExpression
in class NodeView
public void classifyNodes(java.util.Vector operatorViewVector, java.util.Vector operandViewVector)
classifyNodes
in class NodeView
public boolean isCovered(int leftCoord, int rightCoord)
isCovered
in class NodeView
public NodeView getCopyIfExists(java.util.Vector availableViews, java.lang.String presumedValue)
getCopyIfExists
in class OperatorView
public static java.util.Vector stripParentheses(java.util.Vector originalVector)
public void explain(java.util.Vector explanation)
explain
in class OperatorView
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |