|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectscphEditor.OperandViewFactory
public class OperandViewFactory
This class is a factory of view objects for Operand objects. It is mainly a helper of the ExpressionView and ExpressionNaryView classes, when they recursively create views for children. Just call make() with the operand and you are done.
It does its job by being a visitor of concrete Operand objects. Each visit method creates an appropriate view object. In case the given Operand object is null, an appropriate view object is created without visiting.
make(scphEditor.Operand)
Constructor Summary | |
---|---|
OperandViewFactory(OperandControl c)
Constructor. |
Method Summary | |
---|---|
java.awt.Component |
make(Operand p)
Creates and returns a view object for the given Operand object. |
void |
visitExpression(Expression e)
Visits an Expression object and creates an ExpressionView object. |
void |
visitExpressionNary(ExpressionNary e)
Visits an ExpressionNary object and creates an ExpressionViewNary object. |
void |
visitIdentifier(Identifier id)
Visits an identifier and creates an IdentifierView object. |
void |
visitVariable(Variable v)
Called by Variable.acceptVisitor(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OperandViewFactory(OperandControl c)
Method Detail |
---|
public java.awt.Component make(Operand p)
p
- the operand.
public void visitVariable(Variable v)
OperandVisitor
visitVariable
in interface OperandVisitor
v
- the Variable object that calls me.Variable.acceptVisitor(scphEditor.OperandVisitor)
public void visitIdentifier(Identifier id)
visitIdentifier
in interface OperandVisitor
id
- the visited identifier.Identifier.acceptVisitor(scphEditor.OperandVisitor)
public void visitExpression(Expression e)
visitExpression
in interface OperandVisitor
e
- the visited expression.Expression.acceptVisitor(scphEditor.OperandVisitor)
public void visitExpressionNary(ExpressionNary e)
visitExpressionNary
in interface OperandVisitor
e
- the visited n-ary expression.ExpressionNary.acceptVisitor(scphEditor.OperandVisitor)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |