|
||||||||||
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
public class NodeView
To display one node - serves as base class for OperatorView
Constructor Summary | |
---|---|
NodeView(NodeModel inNode)
This constructor will be called for the root of a complete expression tree. |
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 |
java.lang.Object |
clone()
This simply returns a shallow copy of NodeView |
void |
explain(java.util.Vector explanation)
|
int |
getBackupLeftX()
|
int |
getBackupRightX()
|
java.lang.String |
getContent()
|
int |
getContentWidth()
|
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. |
java.awt.FontMetrics |
getFontMetrics()
|
NodeView |
getLeftChild()
|
int |
getLeftMax()
|
int |
getLeftMin()
|
int |
getLeftX()
|
NodeModel |
getNode()
|
static NodeView |
getNodeView(NodeModel node)
Factory method to return the correct OperatorView |
NodeView |
getRightChild()
|
int |
getRightMax()
|
int |
getRightMin()
|
int |
getRightX()
|
java.util.Vector |
getSideEffects()
Returns a vector of views of AssignmentStep objects |
java.lang.String |
getValue()
|
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 |
void |
print()
|
void |
setLeftChild(NodeView child)
Method used by OperatorView.getCopyIfExists() to construct student's answer |
void |
setRightChild(NodeView child)
Method used by OperatorView.getCopyIfExists() to construct student's answer |
java.lang.String |
toString()
Returns a string representation of this nodeview |
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 java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NodeView(NodeModel inNode)
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public static NodeView getNodeView(NodeModel node)
public void paintExpression(java.awt.Graphics g, int y)
public int typeset(java.awt.Graphics g, java.awt.FontMetrics inFontMetrics, int x, int y, int spacing)
public int getLeftX()
public int getRightX()
public int getLeftMin()
public int getLeftMax()
public NodeView getLeftChild()
public NodeView getRightChild()
public int getRightMin()
public int getRightMax()
public int getBackupLeftX()
public int getBackupRightX()
public java.lang.String getContent()
public NodeModel getNode()
public java.lang.String getValue()
public int getContentWidth()
public java.awt.FontMetrics getFontMetrics()
public void classifyNodes(java.util.Vector operatorViewVector, java.util.Vector operandViewVector)
public boolean isCovered(int leftCoord, int rightCoord)
public NodeView getCopyIfExists(java.util.Vector availableViews, java.lang.String presumedValue)
public java.util.Vector getSideEffects()
public void setLeftChild(NodeView child)
public void setRightChild(NodeView child)
public void explain(java.util.Vector explanation)
public void print()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |