[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Command.java, 1.4, 1.5 ParameterBloc
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-10-19 12:11:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32514/src/net/sourceforge/bprocessor/model Modified Files: Command.java ParameterBlock.java Entity.java Log Message: cube command with parameters Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Command.java 19 Oct 2007 08:28:36 -0000 1.4 --- Command.java 19 Oct 2007 12:11:34 -0000 1.5 *************** *** 16,21 **** * Command */ ! public class Command implements Parametric { /** {@inheritDoc} */ public List<Attribute> getAttributes() { --- 16,31 ---- * Command */ ! public class Command extends Entity implements Parametric { + /** + * + */ + public Command() { + parameters = new ParameterBlock(); + parameters.add(new Attribute("width", 1.0)); + parameters.add(new Attribute("height", 1.0)); + parameters.add(new Attribute("depth", 1.0)); + } + /** {@inheritDoc} */ public List<Attribute> getAttributes() { *************** *** 51,57 **** */ public void evaluate() { ! double w = 1; ! double h = 1; ! double d = 1; double x = -w / 2; double y = -h / 2; --- 61,67 ---- */ public void evaluate() { ! double w = parameters.getDouble("width"); ! double h = parameters.getDouble("height"); ! double d = parameters.getDouble("depth"); double x = -w / 2; double y = -h / 2; *************** *** 78,80 **** --- 88,97 ---- Project.getInstance().changed(world); } + + /** {@inheritDoc} */ + @Override + public void delete() { + // TODO Auto-generated method stub + + } } Index: ParameterBlock.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ParameterBlock.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ParameterBlock.java 24 May 2007 10:49:34 -0000 1.9 --- ParameterBlock.java 19 Oct 2007 12:11:34 -0000 1.10 *************** *** 76,79 **** --- 76,93 ---- /** + * Returns the double value associated with key + * @param key String + * @return double value + */ + public double getDouble(String key) { + for (Attribute current : parameters) { + if (current.getName().equals(key)) { + return ((Double)(current.getValue())).doubleValue(); + } + } + return 0.0; + } + + /** * * @param attribute Attribute Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Entity.java 18 Oct 2007 08:46:37 -0000 1.21 --- Entity.java 19 Oct 2007 12:11:34 -0000 1.22 *************** *** 26,30 **** /** Parameterblock for extra parameters */ ! private ParameterBlock parameters; /** --- 26,30 ---- /** Parameterblock for extra parameters */ ! protected ParameterBlock parameters; /** |