bprocessor-commit Mailing List for B-processor (Page 103)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2006-09-12 09:27:36
|
Update of /cvsroot/bprocessor/bscript/lib In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4945/lib Added Files: model.jar Log Message: new scripting capabilities --- NEW FILE: model.jar --- (This appears to be a binary file; contents omitted.) |
From: Michael L. <he...@us...> - 2006-09-12 09:27:34
|
Update of /cvsroot/bprocessor/bscript In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4945 Modified Files: .classpath build.xml Log Message: new scripting capabilities Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/bscript/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .classpath 11 Sep 2006 19:07:12 -0000 1.2 --- .classpath 12 Sep 2006 09:27:31 -0000 1.3 *************** *** 4,7 **** --- 4,8 ---- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="/tools/antlr/antlr.jar"/> + <classpathentry combineaccessrules="false" kind="src" path="/model"/> <classpathentry kind="output" path="build"/> </classpath> Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/bscript/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build.xml 11 Sep 2006 19:07:12 -0000 1.2 --- build.xml 12 Sep 2006 09:27:31 -0000 1.3 *************** *** 27,31 **** --- 27,38 ---- </target> + + <target name="compile" depends="compile-grammar,init"> + <copy todir="${lib.dir}"> + <fileset dir="${model.dir}/dist"> + <include name="**/model*"/> + </fileset> + </copy> <ant dir="src" target="compile"/> </target> |
From: Michael L. <he...@us...> - 2006-09-12 09:27:33
|
Update of /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4945/src/net/sourceforge/bprocessor/model/evaluator Modified Files: Primitive.java Operation.java Literal.java Variable.java Function.java Added Files: Mark.java Environment.java Invokable.java Call.java Log Message: new scripting capabilities Index: Variable.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Variable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Variable.java 11 Sep 2006 22:57:25 -0000 1.2 --- Variable.java 12 Sep 2006 09:27:31 -0000 1.3 *************** *** 27,34 **** /** * @param stack Stack */ ! public void evaluate(Stack stack) { ! stack.push(new Double(87)); } } --- 27,35 ---- /** + * @param env Environment * @param stack Stack */ ! public void evaluate(Environment env, Stack stack) { ! stack.push(env.lookupGlobal(id)); } } --- NEW FILE: Call.java --- //--------------------------------------------------------------------------------- // $Id: Call.java,v 1.1 2006/09/12 09:27:30 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.evaluator; import java.util.LinkedList; import java.util.List; import java.util.Stack; /** * Call */ public class Call extends Operation { /** name */ private String name; /** * Constructor * @param name String */ public Call(String name) { super(); this.name = name; } /** * @param env Environment * @param stack Stack */ public void evaluate(Environment env, Stack stack) { List arguments = new LinkedList(); Object current = stack.pop(); while (current != Function.mark) { arguments.add(current); current = stack.pop(); } Invokable function = env.lookupFunction(name); if (function != null) { Object result = function.evaluate(env.copy(arguments)); stack.push(result); } else { stack.push(name); } } } --- NEW FILE: Invokable.java --- //--------------------------------------------------------------------------------- // $Id: Invokable.java,v 1.1 2006/09/12 09:27:30 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.evaluator; /** * Invokable */ public interface Invokable { /** * * @return result */ public Object evaluate(Environment env); } Index: Primitive.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Primitive.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Primitive.java 11 Sep 2006 22:57:25 -0000 1.2 --- Primitive.java 12 Sep 2006 09:27:30 -0000 1.3 *************** *** 38,44 **** /** * @param stack Stack */ ! public void evaluate(Stack stack) { switch(opcode) { case ADD: { --- 38,45 ---- /** + * @param env Environment * @param stack Stack */ ! public void evaluate(Environment env, Stack stack) { switch(opcode) { case ADD: { Index: Literal.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Literal.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Literal.java 11 Sep 2006 22:57:25 -0000 1.2 --- Literal.java 12 Sep 2006 09:27:30 -0000 1.3 *************** *** 27,33 **** /** * @param stack Stack */ ! public void evaluate(Stack stack) { stack.push(value); } --- 27,34 ---- /** + * @param env Environment * @param stack Stack */ ! public void evaluate(Environment env, Stack stack) { stack.push(value); } --- NEW FILE: Mark.java --- //--------------------------------------------------------------------------------- // $Id: Mark.java,v 1.1 2006/09/12 09:27:30 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.evaluator; import java.util.Stack; /** * Mark */ public class Mark extends Operation { /** * Constructor * */ public Mark() { super(); } /** * @param env Environment * @param stack Stack */ public void evaluate(Environment env, Stack stack) { stack.push(Function.mark); } } Index: Operation.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Operation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Operation.java 11 Sep 2006 22:57:25 -0000 1.2 --- Operation.java 12 Sep 2006 09:27:30 -0000 1.3 *************** *** 24,29 **** /** * Evaluate * @param stack Stack */ ! public abstract void evaluate(Stack stack); } --- 24,30 ---- /** * Evaluate + * @param env Environment * @param stack Stack */ ! public abstract void evaluate(Environment env, Stack stack); } Index: Function.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Function.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Function.java 11 Sep 2006 22:57:25 -0000 1.2 --- Function.java 12 Sep 2006 09:27:31 -0000 1.3 *************** *** 16,20 **** * Function */ ! public class Function { /** operations */ private List operations; --- 16,23 ---- * Function */ ! public class Function implements Invokable { ! /** marker */ ! public final static Object mark = new Object(); ! /** operations */ private List operations; *************** *** 40,49 **** * @return result */ ! public Object evaluate() { Iterator iter = operations.iterator(); Stack stack = new Stack(); while (iter.hasNext()) { Operation current = (Operation) iter.next(); ! current.evaluate(stack); } return stack.pop(); --- 43,52 ---- * @return result */ ! public Object evaluate(Environment env) { Iterator iter = operations.iterator(); Stack stack = new Stack(); while (iter.hasNext()) { Operation current = (Operation) iter.next(); ! current.evaluate(env, stack); } return stack.pop(); --- NEW FILE: Environment.java --- //--------------------------------------------------------------------------------- // $Id: Environment.java,v 1.1 2006/09/12 09:27:30 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.evaluator; import java.util.HashMap; import java.util.List; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Vertex; /** * Environment */ public class Environment { /** Functions */ private HashMap functions; /** Globals */ private HashMap globals; /** Locals */ private List locals; /** * Constructor */ public Environment(HashMap functions, HashMap globals, List locals) { super(); this.functions = functions; this.globals = globals; this.locals = locals; } /** * Return a copy with locals replaced * @param locals List * @return Environment */ public Environment copy(List locals) { return new Environment(functions, globals, locals); } /** * @param name String * @return Function */ public Invokable lookupFunction(String name) { return (Invokable) functions.get(name); } /** * @param name String * @return Object */ public Object lookupGlobal(String name) { Object value = globals.get(name); if (value == null) { Space active = Project.getInstance().getActiveSpace(); if (name.charAt(0) == 'v') { String sub = name.substring(1, name.length()); Long id = Long.valueOf(sub); value = (Vertex) active.getVertex(id.longValue()); } } return value; } /** * Return local * @param i Index * @return Object */ public Object get(int i) { return locals.get(i); } } |
From: Michael L. <he...@us...> - 2006-09-12 09:27:33
|
Update of /cvsroot/bprocessor/bscript/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4945/src/etc Modified Files: bscript.g Log Message: new scripting capabilities Index: bscript.g =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/etc/bscript.g,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bscript.g 11 Sep 2006 22:57:25 -0000 1.3 --- bscript.g 12 Sep 2006 09:27:31 -0000 1.4 *************** *** 101,106 **** call[Function env] ! : name1:Identifier StartTerm EndTerm ! | name2:Identifier StartTerm expression[env] ( Comma expression[env] ) * EndTerm ; \ No newline at end of file --- 101,110 ---- call[Function env] ! : name1:Identifier { env.append(new Mark()); } ! StartTerm EndTerm ! { env.append(new Call(name1.getText())); } ! | name2:Identifier { env.append(new Mark()); } ! StartTerm expression[env] ( Comma expression[env] ) * EndTerm ! { env.append(new Call(name2.getText())); } ; \ No newline at end of file |
From: Michael L. <he...@us...> - 2006-09-12 09:26:00
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4164 Modified Files: build.xml Log Message: new scripting capabilities Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** build.xml 11 Sep 2006 22:57:16 -0000 1.22 --- build.xml 12 Sep 2006 09:25:51 -0000 1.23 *************** *** 39,44 **** <ant dir="${kernel.dir}" target="dist"/> <ant dir="${bscript.dir}" target="dist"/> - <ant dir="${model.dir}" target="dist"/> <ant dir="${gui.dir}" target="dist"/> <ant dir="${gl.dir}" target="dist"/> --- 39,44 ---- <ant dir="${kernel.dir}" target="dist"/> + <ant dir="${model.dir}" target="dist"/> <ant dir="${bscript.dir}" target="dist"/> <ant dir="${gui.dir}" target="dist"/> <ant dir="${gl.dir}" target="dist"/> |
From: Michael L. <he...@us...> - 2006-09-12 09:26:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4152/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: new scripting capabilities Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** SpaceTool.java 11 Sep 2006 22:57:21 -0000 1.32 --- SpaceTool.java 12 Sep 2006 09:25:48 -0000 1.33 *************** *** 18,21 **** --- 18,22 ---- import java.util.Arrays; import java.util.Collection; + import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; *************** *** 40,44 **** --- 41,47 ---- import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.constraints.OffsetConstraint; + import net.sourceforge.bprocessor.model.evaluator.Environment; import net.sourceforge.bprocessor.model.evaluator.Function; + import net.sourceforge.bprocessor.model.evaluator.Invokable; import net.sourceforge.bprocessor.model.modellor.LayerModellor; import net.sourceforge.bprocessor.model.modellor.Modellor; *************** *** 542,545 **** --- 545,555 ---- /** + * Builtin function + */ + public abstract class Builtin implements Invokable { + + } + + /** * Evaluate the string * @param value String *************** *** 554,560 **** try { parser.expression(function); ! Object result = function.evaluate(); glv.setLengthValue(result.toString()); typing = false; } catch (Exception error) { Project.info(error); --- 564,612 ---- try { parser.expression(function); ! ! HashMap globals = Project.getInstance().getGlobals().environment(); ! HashMap functions = new HashMap(); ! functions.put("cos", new Builtin() { ! public Object evaluate(Environment env) { ! Double argument = (Double) env.get(0); ! return new Double(Math.cos(argument.doubleValue())); ! } ! }); ! functions.put("vertex", new Builtin() { ! public Object evaluate(Environment env) { ! Double z = (Double) env.get(0); ! Double y = (Double) env.get(1); ! Double x = (Double) env.get(2); ! Vertex result = new Vertex(x.doubleValue(), y.doubleValue(), z.doubleValue()); ! return result; ! } ! }); ! functions.put("edge", new Builtin() { ! public Object evaluate(Environment env) { ! Vertex from = (Vertex) env.get(1); ! Vertex to = (Vertex) env.get(0); ! Edge result = new Edge(from, to); ! return result; ! } ! }); ! ! Environment env = new Environment(functions, globals, null); ! ! Object result = function.evaluate(env); ! ! ! if (result instanceof Vertex) { ! result = Geometry.insertVertex((Vertex)result, true); ! Selection.primary().set(result); ! } ! ! if (result instanceof Edge) { ! result = Geometry.insertEdge((Edge)result, true); ! Selection.primary().set(result); ! } ! glv.setLengthValue(result.toString()); typing = false; + } catch (Exception error) { Project.info(error); |
From: Michael L. <he...@us...> - 2006-09-11 22:57:27
|
Update of /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14460/src/net/sourceforge/bprocessor/model/evaluator Modified Files: Primitive.java Operation.java Variable.java Function.java Literal.java Log Message: basic evaluation Index: Primitive.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Primitive.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Primitive.java 6 Sep 2006 09:49:05 -0000 1.1 --- Primitive.java 11 Sep 2006 22:57:25 -0000 1.2 *************** *** 8,11 **** --- 8,13 ---- package net.sourceforge.bprocessor.model.evaluator; + import java.util.Stack; + /** * Primitive *************** *** 34,36 **** --- 36,76 ---- this.opcode = opcode; } + + /** + * @param stack Stack + */ + public void evaluate(Stack stack) { + switch(opcode) { + case ADD: { + Double op1 = (Double) stack.pop(); + Double op2 = (Double) stack.pop(); + stack.push(new Double(op1.doubleValue() + op2.doubleValue())); + break; + } + case SUB: { + Double op1 = (Double) stack.pop(); + Double op2 = (Double) stack.pop(); + stack.push(new Double(op2.doubleValue() - op1.doubleValue())); + break; + } + case MUL: { + Double op1 = (Double) stack.pop(); + Double op2 = (Double) stack.pop(); + stack.push(new Double(op1.doubleValue() * op2.doubleValue())); + break; + } + case DIV: { + Double op1 = (Double) stack.pop(); + Double op2 = (Double) stack.pop(); + stack.push(new Double(op2.doubleValue() / op1.doubleValue())); + break; + } + case NEG: { + Double op1 = (Double) stack.pop(); + stack.push(new Double(-op1.doubleValue())); + break; + } + + } + } } Index: Variable.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Variable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Variable.java 6 Sep 2006 09:49:05 -0000 1.1 --- Variable.java 11 Sep 2006 22:57:25 -0000 1.2 *************** *** 8,11 **** --- 8,13 ---- package net.sourceforge.bprocessor.model.evaluator; + import java.util.Stack; + /** * Variable *************** *** 23,25 **** --- 25,34 ---- this.id = id; } + + /** + * @param stack Stack + */ + public void evaluate(Stack stack) { + stack.push(new Double(87)); + } } Index: Function.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Function.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Function.java 6 Sep 2006 09:49:05 -0000 1.1 --- Function.java 11 Sep 2006 22:57:25 -0000 1.2 *************** *** 8,13 **** --- 8,15 ---- package net.sourceforge.bprocessor.model.evaluator; + import java.util.Iterator; import java.util.LinkedList; import java.util.List; + import java.util.Stack; /** *************** *** 33,35 **** --- 35,51 ---- operations.add(operation); } + + /** + * + * @return result + */ + public Object evaluate() { + Iterator iter = operations.iterator(); + Stack stack = new Stack(); + while (iter.hasNext()) { + Operation current = (Operation) iter.next(); + current.evaluate(stack); + } + return stack.pop(); + } } Index: Literal.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Literal.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Literal.java 6 Sep 2006 09:49:05 -0000 1.1 --- Literal.java 11 Sep 2006 22:57:25 -0000 1.2 *************** *** 8,11 **** --- 8,13 ---- package net.sourceforge.bprocessor.model.evaluator; + import java.util.Stack; + /** * Literal *************** *** 23,25 **** --- 25,34 ---- this.value = value; } + + /** + * @param stack Stack + */ + public void evaluate(Stack stack) { + stack.push(value); + } } Index: Operation.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Operation.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Operation.java 6 Sep 2006 09:49:05 -0000 1.1 --- Operation.java 11 Sep 2006 22:57:25 -0000 1.2 *************** *** 8,16 **** package net.sourceforge.bprocessor.model.evaluator; /** * Operation * */ ! public class Operation { /** * Constructor --- 8,18 ---- package net.sourceforge.bprocessor.model.evaluator; + import java.util.Stack; + /** * Operation * */ ! public abstract class Operation { /** * Constructor *************** *** 19,21 **** --- 21,29 ---- super(); } + + /** + * Evaluate + * @param stack Stack + */ + public abstract void evaluate(Stack stack); } |
From: Michael L. <he...@us...> - 2006-09-11 22:57:27
|
Update of /cvsroot/bprocessor/bscript/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14460/src/etc Modified Files: bscript.g Log Message: basic evaluation Index: bscript.g =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/etc/bscript.g,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bscript.g 11 Sep 2006 20:39:06 -0000 1.2 --- bscript.g 11 Sep 2006 22:57:25 -0000 1.3 *************** *** 20,24 **** Period : '.' ; End : ';' ; ! protected Letter --- 20,24 ---- Period : '.' ; End : ';' ; ! Comma : ',' ; protected Letter *************** *** 57,60 **** --- 57,63 ---- class ScriptParser extends Parser; + options { + k=3; + } *************** *** 81,84 **** --- 84,88 ---- | StartTerm expression[env] EndTerm | unary[env] + | call[env] ; *************** *** 95,96 **** --- 99,106 ---- : i:Identifier { env.append(new Variable(i.getText())); } ; + + call[Function env] + : name1:Identifier StartTerm EndTerm + | name2:Identifier StartTerm expression[env] ( Comma expression[env] ) * EndTerm + ; + \ No newline at end of file |
From: Michael L. <he...@us...> - 2006-09-11 22:57:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14441/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java SpaceTool.java Log Message: basic evaluation Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** SpaceTool.java 11 Sep 2006 20:38:59 -0000 1.31 --- SpaceTool.java 11 Sep 2006 22:57:21 -0000 1.32 *************** *** 40,46 **** --- 40,48 ---- import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.constraints.OffsetConstraint; + import net.sourceforge.bprocessor.model.evaluator.Function; import net.sourceforge.bprocessor.model.modellor.LayerModellor; import net.sourceforge.bprocessor.model.modellor.Modellor; import net.sourceforge.bprocessor.parser.ScriptLexer; + import net.sourceforge.bprocessor.parser.ScriptParser; /** *************** *** 548,551 **** --- 550,563 ---- Reader input = new StringReader(value); ScriptLexer lexer = new ScriptLexer(input); + ScriptParser parser = new ScriptParser(lexer); + Function function = new Function(); + try { + parser.expression(function); + Object result = function.evaluate(); + glv.setLengthValue(result.toString()); + typing = false; + } catch (Exception error) { + Project.info(error); + } return null; } *************** *** 568,571 **** --- 580,584 ---- typing = true; } else { + Project.info(new Character(ch)); if (event.getKeyCode() == KeyEvent.VK_ENTER) { evaluate(value); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** AbstractTool.java 11 Sep 2006 12:47:32 -0000 1.99 --- AbstractTool.java 11 Sep 2006 22:57:21 -0000 1.100 *************** *** 237,257 **** } ! if (e.getModifiers() == 0) { ! if (e.getKeyCode() == KeyEvent.VK_UP) { ! c.translate(new double[] {up.getX(), up.getY(), up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { ! c.translate(new double[] {-up.getX(), -up.getY(), -up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { ! c.translate(new double[] {sidewards.getX(), sidewards.getY(), sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { ! c.translate(new double[] {-sidewards.getX(), -sidewards.getY(), -sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_Z) { ! c.zoomout(); ! } else if (e.getKeyCode() == KeyEvent.VK_X) { ! c.zoomin(); ! } else { ! key(e); ! } } glv.repaint(true); } --- 237,252 ---- } ! if (e.getKeyCode() == KeyEvent.VK_UP) { ! c.translate(new double[] {up.getX(), up.getY(), up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { ! c.translate(new double[] {-up.getX(), -up.getY(), -up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { ! c.translate(new double[] {sidewards.getX(), sidewards.getY(), sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { ! c.translate(new double[] {-sidewards.getX(), -sidewards.getY(), -sidewards.getZ()}); ! } else { ! key(e); } + glv.repaint(true); } |
From: Michael L. <he...@us...> - 2006-09-11 22:57:18
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14432 Modified Files: build.xml Log Message: basic evaluation Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** build.xml 11 Sep 2006 20:38:54 -0000 1.21 --- build.xml 11 Sep 2006 22:57:16 -0000 1.22 *************** *** 26,29 **** --- 26,30 ---- <ant dir="${kernel.dir}" target="clean"/> <ant dir="${model.dir}" target="clean"/> + <ant dir="${bscript.dir}" target="clean"/> <ant dir="${gui.dir}" target="clean"/> <ant dir="${gl.dir}" target="clean"/> |
From: Michael L. <he...@us...> - 2006-09-11 20:39:08
|
Update of /cvsroot/bprocessor/bscript/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19664/src/etc Modified Files: bscript.g Log Message: bscript added to build Index: bscript.g =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/etc/bscript.g,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bscript.g 6 Sep 2006 09:49:05 -0000 1.1 --- bscript.g 11 Sep 2006 20:39:06 -0000 1.2 *************** *** 1,4 **** header { ! package net.sourceforge.bprocessor.model.parser; import net.sourceforge.bprocessor.model.evaluator.*; } --- 1,4 ---- header { ! package net.sourceforge.bprocessor.parser; import net.sourceforge.bprocessor.model.evaluator.*; } |
From: Michael L. <he...@us...> - 2006-09-11 20:39:05
|
Update of /cvsroot/bprocessor/kernel In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19444 Modified Files: build.xml Log Message: bscript added to build Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/kernel/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build.xml 6 Sep 2006 13:03:26 -0000 1.4 --- build.xml 11 Sep 2006 20:39:03 -0000 1.5 *************** *** 107,110 **** --- 107,111 ---- <fileset dir="${xml.dir}"> <include name="**/*.class"/> + <include name="**/*.properties"/> </fileset> </copy> |
From: Michael L. <he...@us...> - 2006-09-11 20:39:04
|
Update of /cvsroot/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19343 Modified Files: build.xml .classpath Log Message: bscript added to build Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/gl/.classpath,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .classpath 24 Jan 2006 13:57:25 -0000 1.3 --- .classpath 11 Sep 2006 20:38:59 -0000 1.4 *************** *** 6,9 **** --- 6,10 ---- <classpathentry kind="src" path="/model"/> <classpathentry kind="lib" path="/tools/jogl/jogl.jar"/> + <classpathentry combineaccessrules="false" kind="src" path="/bscript"/> <classpathentry kind="output" path="build"/> </classpath> Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/gl/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build.xml 29 Sep 2005 21:00:37 -0000 1.4 --- build.xml 11 Sep 2006 20:38:59 -0000 1.5 *************** *** 7,10 **** --- 7,11 ---- <property name="kernel.dir" value="${basedir}/../kernel"/> <property name="model.dir" value="${basedir}/../model"/> + <property name="bscript.dir" value="${basedir}/../bscript"/> <property name="tools.dir" value="${basedir}/../tools"/> <property name="gui.dir" value="${basedir}/../gui"/> *************** *** 71,74 **** --- 72,80 ---- </fileset> </copy> + <copy todir="${lib.dir}"> + <fileset dir="${bscript.dir}/dist"> + <include name="**/bscript*"/> + </fileset> + </copy> <copy todir="${lib.dir}"> <fileset dir="${gui.dir}/dist"> |
From: Michael L. <he...@us...> - 2006-09-11 20:39:04
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19343/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: bscript added to build Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** SpaceTool.java 11 Sep 2006 12:47:32 -0000 1.30 --- SpaceTool.java 11 Sep 2006 20:38:59 -0000 1.31 *************** *** 13,16 **** --- 13,18 ---- import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; + import java.io.Reader; + import java.io.StringReader; import java.util.ArrayList; import java.util.Arrays; *************** *** 40,43 **** --- 42,46 ---- import net.sourceforge.bprocessor.model.modellor.LayerModellor; import net.sourceforge.bprocessor.model.modellor.Modellor; + import net.sourceforge.bprocessor.parser.ScriptLexer; /** *************** *** 543,546 **** --- 546,551 ---- public Object evaluate(String value) { Project.info("evaluate '" + value + "'"); + Reader input = new StringReader(value); + ScriptLexer lexer = new ScriptLexer(input); return null; } |
From: Michael L. <he...@us...> - 2006-09-11 20:39:01
|
Update of /cvsroot/bprocessor/gl/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19343/src Modified Files: build.xml Log Message: bscript added to build Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/gl/src/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build.xml 28 Apr 2006 11:29:12 -0000 1.2 --- build.xml 11 Sep 2006 20:38:59 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- </fileset> <pathelement location="."/> + <pathelement location="${tools.dir}/antlr/antlr.jar"/> </path> |
From: Michael L. <he...@us...> - 2006-09-11 20:38:58
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19333 Modified Files: build.xml Log Message: bscript added to build Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** build.xml 15 Aug 2006 08:33:26 -0000 1.20 --- build.xml 11 Sep 2006 20:38:54 -0000 1.21 *************** *** 12,15 **** --- 12,16 ---- <property name="kernel.dir" value="${basedir}/../kernel"/> <property name="model.dir" value="${basedir}/../model"/> + <property name="bscript.dir" value="${basedir}/../bscript"/> <property name="gui.dir" value="${basedir}/../gui"/> <property name="gl.dir" value="${basedir}/../gl"/> *************** *** 37,40 **** --- 38,42 ---- <ant dir="${kernel.dir}" target="dist"/> + <ant dir="${bscript.dir}" target="dist"/> <ant dir="${model.dir}" target="dist"/> <ant dir="${gui.dir}" target="dist"/> *************** *** 67,70 **** --- 69,77 ---- </fileset> </copy> + <copy todir="${release.dir}/library"> + <fileset dir="${bscript.dir}/dist"> + <include name="**/*"/> + </fileset> + </copy> <copy todir="${release.dir}/library"> <fileset dir="${tools.dir}/hibernate"/> |
From: Michael L. <he...@us...> - 2006-09-11 19:07:18
|
Update of /cvsroot/bprocessor/bscript In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14102 Modified Files: .classpath build.xml Log Message: Improved build strategy: - The autogenerated sources are placed in the src directory, but *not* checked in - The autogenerated sources are placed independent of the regular sources in the pacekage tree to avoid stylechecking. - All sources are compiled in one go - The autogenerated sources are not deleted after building to allow inspection Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/bscript/.classpath,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .classpath 6 Sep 2006 09:49:04 -0000 1.1 --- .classpath 11 Sep 2006 19:07:12 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="/tools/antlr/antlr.jar"/> <classpathentry kind="output" path="build"/> </classpath> Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/bscript/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.xml 6 Sep 2006 09:49:04 -0000 1.1 --- build.xml 11 Sep 2006 19:07:12 -0000 1.2 *************** *** 12,22 **** <property name="lib.dir" value="${basedir}/lib"/> <property name="dist.dir" value="${basedir}/dist"/> <property name="checkstyle-results" value="${build.dir}/checkstyle-results.txt" /> <property name="build.compiler" value="modern"/> </target> ! <target name="compile-grammar" depends="compile-src,init"> ! <mkdir dir="${build.dir}/net/sourceforge/bprocessor/model/parser"/> <antlr target="${conf.dir}/bscript.g" ! outputdirectory="${build.dir}/net/sourceforge/bprocessor/model/parser"> <classpath> <pathelement location="${tools.dir}/antlr/antlr.jar"/> --- 12,23 ---- <property name="lib.dir" value="${basedir}/lib"/> <property name="dist.dir" value="${basedir}/dist"/> + <property name="parser.dir" value="${src.dir}/net/sourceforge/bprocessor/parser"/> <property name="checkstyle-results" value="${build.dir}/checkstyle-results.txt" /> <property name="build.compiler" value="modern"/> </target> ! <target name="compile-grammar" depends="init"> ! <mkdir dir="${parser.dir}"/> <antlr target="${conf.dir}/bscript.g" ! outputdirectory="${parser.dir}"> <classpath> <pathelement location="${tools.dir}/antlr/antlr.jar"/> *************** *** 26,34 **** </target> ! <target name="compile-src" depends="checkstyle,init"> <ant dir="src" target="compile"/> </target> ! <target name="compile" depends="compile-grammar"> <javac srcdir="${build.dir}" destdir="${build.dir}" deprecation="yes" debug="yes" target="1.2" source="1.3" --- 27,35 ---- </target> ! <target name="compile" depends="compile-grammar,init"> <ant dir="src" target="compile"/> </target> ! <target name="compile-old" depends="compile-grammar"> <javac srcdir="${build.dir}" destdir="${build.dir}" deprecation="yes" debug="yes" target="1.2" source="1.3" *************** *** 44,47 **** --- 45,49 ---- <delete dir="${dist.dir}"/> <delete dir="${doc.api.dir}"/> + <delete dir="${parser.dir}"/> <delete> <fileset dir="${lib.dir}"> |
From: Michael L. <he...@us...> - 2006-09-11 19:07:15
|
Update of /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14102/src/net/sourceforge/bprocessor Added Files: .cvsignore Log Message: Improved build strategy: - The autogenerated sources are placed in the src directory, but *not* checked in - The autogenerated sources are placed independent of the regular sources in the pacekage tree to avoid stylechecking. - All sources are compiled in one go - The autogenerated sources are not deleted after building to allow inspection --- NEW FILE: .cvsignore --- parser |
From: Michael L. <he...@us...> - 2006-09-11 19:07:15
|
Update of /cvsroot/bprocessor/bscript/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14102/src Modified Files: build.xml Log Message: Improved build strategy: - The autogenerated sources are placed in the src directory, but *not* checked in - The autogenerated sources are placed independent of the regular sources in the pacekage tree to avoid stylechecking. - All sources are compiled in one go - The autogenerated sources are not deleted after building to allow inspection Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.xml 6 Sep 2006 09:49:05 -0000 1.1 --- build.xml 11 Sep 2006 19:07:12 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- <pathelement location="."/> <pathelement location="${build.dir}"/> + <pathelement location="${tools.dir}/antlr/antlr.jar"/> </path> |
From: Nordholt <nor...@us...> - 2006-09-11 14:58:20
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4171/src/net/sourceforge/bprocessor/model Modified Files: Geometric.java Log Message: Corrected spelling in documentation :) Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Geometric.java 5 Sep 2006 11:01:37 -0000 1.11 --- Geometric.java 11 Sep 2006 14:58:17 -0000 1.12 *************** *** 86,90 **** /** ! * Check how much of the give direction this object can move * @param x the x distance * @param y the y distance --- 86,90 ---- /** ! * Check how much of the given direction this object can move * @param x the x distance * @param y the y distance |
From: Nordholt <nor...@us...> - 2006-09-11 14:57:49
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3724/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Log Message: Fixed clippingplane so it should work on element level, and also so that it does not crash when there is only one surface. Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ClippingPlane.java 5 Sep 2006 11:01:36 -0000 1.8 --- ClippingPlane.java 11 Sep 2006 14:57:47 -0000 1.9 *************** *** 47,51 **** this.cs = system; this.isActive = true; ! plane = cs.plane(); update(); } --- 47,53 ---- this.cs = system; this.isActive = true; ! this.plane = cs.plane(); ! this.silluet = new ArrayList(); ! this.corners = new ArrayList(); update(); } *************** *** 100,104 **** */ public Collection getCorners() { ! if (corners == null) { update(); } --- 102,106 ---- */ public Collection getCorners() { ! if (corners.isEmpty()) { update(); } *************** *** 172,175 **** --- 174,187 ---- res.add(v); } + Vertex transTo = cs.translate(e.getTo()); + Vertex transFrom = cs.translate(e.getFrom()); + if (Math.abs(transTo.getZ()) < 0.01 && + Math.abs(transFrom.getZ()) < 0.01) { + res.add(e.getTo().copy()); + res.add(e.getFrom().copy()); + Edge eCopy = e.copy(); + eCopy.setStrippled(true); + silluet.add(eCopy); + } } Collection surfaces = Project.getInstance().getSurfaces(); |
From: Nordholt <nor...@us...> - 2006-09-11 14:55:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2627/src/net/sourceforge/bprocessor/model Modified Files: Constructor.java Log Message: Moving the handles properly, so that moving the origin has the wanted effect. Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Constructor.java 8 Sep 2006 14:10:32 -0000 1.12 --- Constructor.java 11 Sep 2006 14:55:06 -0000 1.13 *************** *** 186,190 **** Iterator it = collect().iterator(); while (it.hasNext()) { ! ((Geometric)it.next()).move(x, y, z); } } --- 186,191 ---- Iterator it = collect().iterator(); while (it.hasNext()) { ! Geometric g = (Geometric)it.next(); ! g.move(x, y, z); } } *************** *** 234,237 **** --- 235,239 ---- public void move(double x, double y, double z) { parent().move(x, y, z); + super.move(x, y, z); } |
From: Nordholt <nor...@us...> - 2006-09-11 14:54:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1783/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Project now gets edges and surfaces from the current active space. Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** Project.java 11 Sep 2006 09:22:46 -0000 1.71 --- Project.java 11 Sep 2006 14:53:59 -0000 1.72 *************** *** 417,421 **** */ public Collection getEdges() { ! return world.getEdges(); } --- 417,421 ---- */ public Collection getEdges() { ! return getActiveSpace().getEdges(); } *************** *** 486,490 **** */ public Collection getSurfaces() { ! return world.getSurfaces(); } --- 486,490 ---- */ public Collection getSurfaces() { ! return getActiveSpace().getSurfaces(); } |
From: rimestad <rim...@us...> - 2006-09-11 14:03:55
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9455/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: added delete and add of globals to the database view Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** GenericTreeView.java 11 Sep 2006 09:21:03 -0000 1.40 --- GenericTreeView.java 11 Sep 2006 14:03:45 -0000 1.41 *************** *** 384,395 **** if (object instanceof Entity) { AbstractAction delete = new EntityAction((Entity)object, "Delete") { ! public void actionPerformed(ActionEvent arg0) { ! if (entity != null) { ! entity.delete(); ! Project.getInstance().checkpoint(); ! } } ! }; pm.add(delete); } return pm; --- 384,407 ---- if (object instanceof Entity) { AbstractAction delete = new EntityAction((Entity)object, "Delete") { ! public void actionPerformed(ActionEvent arg0) { ! if (entity != null) { ! entity.delete(); ! Project.getInstance().checkpoint(); } ! } ! }; pm.add(delete); + } else if (object instanceof Attribute) { + AbstractAction delete = new AttributeAction((Attribute)object, "Delete") { + public void actionPerformed(ActionEvent arg0) { + Project p = Project.getInstance(); + p.getGlobals().remove(attribute); + p.changed(p); + p.checkpoint(); + } + }; + pm.add(delete); + } else { + return null; } return pm; *************** *** 416,419 **** --- 428,449 ---- /** + * Actions for a attribute + */ + public abstract class AttributeAction extends AbstractAction { + /** The entity */ + protected Attribute attribute; + + /** + * The constructor + * @param a the attribute + * @param name the name of the action + */ + public AttributeAction(Attribute a, String name) { + super(name); + this.attribute = a; + } + } + + /** * Actions for a entity */ *************** *** 833,843 **** return spacegroupicon; } - - /** - * @return Menu - */ - public JPopupMenu menu() { - return null; - } } --- 863,866 ---- *************** *** 1007,1010 **** --- 1030,1051 ---- return name; } + + /** + * Context menu for ParameterBlockNode + * @return the menu + */ + public JPopupMenu menu() { + JPopupMenu pm = new JPopupMenu(); + AbstractAction add = new EntityAction(null, "Add global") { + public void actionPerformed(ActionEvent arg0) { + ParameterBlock pb = Project.getInstance().getGlobals(); + pb.put("new global", 0); + Project.getInstance().changed(pb); + Project.getInstance().checkpoint(); + } + }; + pm.add(add); + return pm; + } } |
From: rimestad <rim...@us...> - 2006-09-11 14:01:47
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8300/src/net/sourceforge/bprocessor/model Modified Files: ParameterBlock.java Log Message: Added remove to parmeterblock Index: ParameterBlock.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ParameterBlock.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ParameterBlock.java 24 May 2006 13:43:36 -0000 1.1 --- ParameterBlock.java 11 Sep 2006 14:01:37 -0000 1.2 *************** *** 78,80 **** --- 78,89 ---- return "Parameters"; } + + /** + * Remove a global from the list + * @param a The global to remove + */ + public void remove(Attribute a) { + //FIXME have to check the system for use before removing + parameters.remove(a); + } } |