bprocessor-commit Mailing List for B-processor (Page 95)
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: rimestad <rim...@us...> - 2006-10-14 23:40:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10521/src/net/sourceforge/bprocessor/gl/tool Modified Files: CreateSpaceActionListener.java Log Message: removed some changed events and added others Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CreateSpaceActionListener.java 26 Sep 2006 09:52:30 -0000 1.10 --- CreateSpaceActionListener.java 14 Oct 2006 23:40:49 -0000 1.11 *************** *** 103,106 **** --- 103,107 ---- surface.setBackDomain(space); } + surface.changed(); Project.getInstance().checkpoint(); } catch (Exception ex) { |
From: rimestad <rim...@us...> - 2006-10-14 23:37:55
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9358/src/net/sourceforge/bprocessor/model/modellor Modified Files: LayerModellor.java Log Message: implemented get and set content for all 4 modellors Index: LayerModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/LayerModellor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** LayerModellor.java 10 Oct 2006 14:02:32 -0000 1.7 --- LayerModellor.java 14 Oct 2006 23:37:54 -0000 1.8 *************** *** 8,11 **** --- 8,12 ---- package net.sourceforge.bprocessor.model.modellor; + import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; *************** *** 209,219 **** /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! // TODO Auto-generated method stub ! } /** @see net.sourceforge.bprocessor.model.modellor.Modellor#getContent() */ public Map getContent() { ! // TODO Auto-generated method stub return null; } --- 210,224 ---- /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! space = (Space)m.get("Space"); ! surface = (Surface)m.get("Surface"); ! distance = ((Double)m.get("Distance")).doubleValue(); } /** @see net.sourceforge.bprocessor.model.modellor.Modellor#getContent() */ public Map getContent() { ! Map m = new HashMap(); ! m.put("Space", space); ! m.put("Surface", surface); ! m.put("Distance", new Double(distance)); return null; } |
From: rimestad <rim...@us...> - 2006-10-14 23:37:49
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9347/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java WindowModellor.java Log Message: implemented get and set content for all 4 modellors Index: WindowModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/WindowModellor.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** WindowModellor.java 10 Oct 2006 14:02:37 -0000 1.13 --- WindowModellor.java 14 Oct 2006 23:37:40 -0000 1.14 *************** *** 245,250 **** /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! // TODO Auto-generated method stub ! } --- 245,254 ---- /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! framewidth = ((Double)m.get("Framewidth")).doubleValue(); ! framedepth = ((Double)m.get("Framedepth")).doubleValue(); ! offset = ((Double)m.get("Offset")).doubleValue(); ! sign = ((Integer)m.get("Sign")).intValue(); ! surface = (Surface)m.get("Surface"); ! space = (Space)m.get("Space"); } *************** *** 252,260 **** public Map getContent() { Map what = new HashMap(); - what.put("name", getName()); what.put("Framewidth", new Double(framewidth)); what.put("Framedepth", new Double(framedepth)); what.put("Offset", new Double(offset)); what.put("Sign", new Integer(sign)); return what; } --- 256,265 ---- public Map getContent() { Map what = new HashMap(); what.put("Framewidth", new Double(framewidth)); what.put("Framedepth", new Double(framedepth)); what.put("Offset", new Double(offset)); what.put("Sign", new Integer(sign)); + what.put("Space", space); + what.put("Surface", surface); return what; } Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** FacadeModellor.java 10 Oct 2006 14:02:37 -0000 1.22 --- FacadeModellor.java 14 Oct 2006 23:37:40 -0000 1.23 *************** *** 196,206 **** public void setAttributes(List attributes) { Iterator it = attributes.iterator(); while (it.hasNext()) { Attribute a = (Attribute)it.next(); if (a.getName().equals("Name")) { - Project.getInstance().checkpoint(); name = (String)a.getValue(); } else if (a.getName().equals("Front")) { - Project.getInstance().checkpoint(); Iterator sit = Project.getInstance().getActiveSpace().getSurfaces().iterator(); while (sit.hasNext()) { --- 196,205 ---- public void setAttributes(List attributes) { Iterator it = attributes.iterator(); + boolean changed = false; while (it.hasNext()) { Attribute a = (Attribute)it.next(); if (a.getName().equals("Name")) { name = (String)a.getValue(); } else if (a.getName().equals("Front")) { Iterator sit = Project.getInstance().getActiveSpace().getSurfaces().iterator(); while (sit.hasNext()) { *************** *** 209,213 **** if (front != s) { front = s; ! createFacade(); } } --- 208,212 ---- if (front != s) { front = s; ! changed = true; } } *************** *** 216,251 **** int n = ((Double)a.getValue()).intValue(); if (n != vertPosts) { ! Project.getInstance().checkpoint(); vertPosts = n; - createFacade(); } } else if (a.getName().equals("H-posts")) { int n = ((Double)a.getValue()).intValue(); if (n != horPosts) { ! Project.getInstance().checkpoint(); horPosts = n; - createFacade(); } } else if (a.getName().equals("V-postwidth")) { double d = ((Double)a.getValue()).doubleValue(); - Project.getInstance().checkpoint(); setVertPostWidth(d); } else if (a.getName().equals("H-postwidth")) { double d = ((Double)a.getValue()).doubleValue(); - Project.getInstance().checkpoint(); setHorPostWidth(d); } else if (a.getName().equals("Frame thickness")) { double n = ((Double)a.getValue()).doubleValue(); if (n != frameThickness) { - Project.getInstance().checkpoint(); frameThickness = n; ! createFacade(); } } else if (a.getName().equals("Depth")) { double n = ((Double)a.getValue()).doubleValue(); if (n != depth) { - Project.getInstance().checkpoint(); depth = n; ! createFacade(); } } else if (a.getName().equals("Single posted")) { --- 215,246 ---- int n = ((Double)a.getValue()).intValue(); if (n != vertPosts) { ! changed = true; vertPosts = n; } } else if (a.getName().equals("H-posts")) { int n = ((Double)a.getValue()).intValue(); if (n != horPosts) { ! changed = true; horPosts = n; } } else if (a.getName().equals("V-postwidth")) { double d = ((Double)a.getValue()).doubleValue(); setVertPostWidth(d); + changed = true; } else if (a.getName().equals("H-postwidth")) { double d = ((Double)a.getValue()).doubleValue(); setHorPostWidth(d); + changed = true; } else if (a.getName().equals("Frame thickness")) { double n = ((Double)a.getValue()).doubleValue(); if (n != frameThickness) { frameThickness = n; ! changed = true; } } else if (a.getName().equals("Depth")) { double n = ((Double)a.getValue()).doubleValue(); if (n != depth) { depth = n; ! changed = true; } } else if (a.getName().equals("Single posted")) { *************** *** 253,258 **** if (b && type != SINGLE_BAR) { type = SINGLE_BAR; ! createFacade(); ! Project.getInstance().changed(this); } if (!b && type == SINGLE_BAR) { --- 248,252 ---- if (b && type != SINGLE_BAR) { type = SINGLE_BAR; ! changed = true; } if (!b && type == SINGLE_BAR) { *************** *** 261,270 **** horPostWidth = 0; frameThickness = 0; ! createFacade(); ! Project.getInstance().changed(this); } } } ! Project.getInstance().changed(space); } /** --- 255,267 ---- horPostWidth = 0; frameThickness = 0; ! changed = true; } } } ! if (changed) { ! createFacade(); ! Project.getInstance().changed(this); ! Project.getInstance().checkpoint(); ! } } /** *************** *** 753,764 **** /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! // TODO Auto-generated method stub ! } /** @see net.sourceforge.bprocessor.model.modellor.Modellor#getContent() */ public Map getContent() { ! ! return null; } } --- 750,787 ---- /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! bottomBound = (Line)m.get("bottomBound"); ! rightBound = (Line)m.get("rightBound"); ! leftBound = (Line)m.get("leftBound"); ! topBound = (Line)m.get("topBound"); ! depth = ((Double)m.get("depth")).doubleValue(); ! frame = (Space)m.get("frame"); ! front = (Surface)m.get("front"); ! frameThickness = ((Double)m.get("frameThickness")).doubleValue(); ! horPosts = ((Integer)m.get("horPosts")).intValue(); ! horPostWidth = ((Double)m.get("horPostWidth")).doubleValue(); ! vertPosts = ((Integer)m.get("vertPosts")).intValue(); ! vertPostWidth = ((Double)m.get("vertPostWidth")).doubleValue(); ! type = ((Integer)m.get("type")).intValue(); ! name = (String)m.get("name"); } /** @see net.sourceforge.bprocessor.model.modellor.Modellor#getContent() */ public Map getContent() { ! Map m = new HashMap(); ! m.put("bottomBound", bottomBound); ! m.put("rightBound", rightBound); ! m.put("leftBound", leftBound); ! m.put("topBound", topBound); ! m.put("depth", new Double(depth)); ! m.put("frame", frame); ! m.put("front", front); ! m.put("frameThickness", new Double(frameThickness)); ! m.put("horPosts", new Integer(horPosts)); ! m.put("horPostWidth", new Double(horPostWidth)); ! m.put("vertPosts", new Integer(vertPosts)); ! m.put("vertPostWidth", new Double(vertPostWidth)); ! m.put("type", new Integer(type)); ! m.put("name", name); ! return m; } } |
From: rimestad <rim...@us...> - 2006-10-14 23:37:43
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9336/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: implemented get and set content for all 4 modellors Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** SpaceTool.java 11 Oct 2006 14:05:20 -0000 1.54 --- SpaceTool.java 14 Oct 2006 23:37:33 -0000 1.55 *************** *** 381,391 **** /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! // TODO Auto-generated method stub } /** @see net.sourceforge.bprocessor.model.modellor.Modellor#getContent() */ public Map getContent() { ! // TODO Auto-generated method stub ! return null; } } --- 381,396 ---- /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! axisDivisions = ((Integer)m.get("Axis")).intValue(); ! height = ((Double)m.get("Height")).doubleValue(); ! radius = ((Double)m.get("Radius")).doubleValue(); } /** @see net.sourceforge.bprocessor.model.modellor.Modellor#getContent() */ public Map getContent() { ! Map m = new HashMap(); ! m.put("Axis", new Integer(axisDivisions)); ! m.put("Height", new Double(height)); ! m.put("Radius", new Double(radius)); ! return m; } } |
From: rimestad <rim...@us...> - 2006-10-14 08:06:31
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1366/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: apperently there were some checkstyle bugs Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** GUI.java 13 Oct 2006 16:26:22 -0000 1.46 --- GUI.java 14 Oct 2006 08:06:27 -0000 1.47 *************** *** 87,90 **** --- 87,91 ---- private Set closedSpaces = new HashSet(); + /** The browsing tree */ private JTabbedPane tree; *************** *** 268,272 **** public void actionPerformed(ActionEvent arg0) { makeTree(); ! };}); edit.add(repaintTree); --- 269,274 ---- public void actionPerformed(ActionEvent arg0) { makeTree(); ! }; ! }); edit.add(repaintTree); |
From: rimestad <rim...@us...> - 2006-10-13 16:27:11
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24337/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: removed a debug logging Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** GenericTreeView.java 13 Oct 2006 16:26:22 -0000 1.57 --- GenericTreeView.java 13 Oct 2006 16:27:09 -0000 1.58 *************** *** 409,413 **** elem.remove(sn.getUserObject()); } else { - log.info("Had to insert " + sn + " into " + this); children.add(sn); } --- 409,412 ---- |
From: rimestad <rim...@us...> - 2006-10-13 16:26:29
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23956/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Added repaintTree to edit menu and made Geometry appear as the first in the Project tree... Later on it should be sorted... Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** GUI.java 10 Oct 2006 09:23:52 -0000 1.45 --- GUI.java 13 Oct 2006 16:26:22 -0000 1.46 *************** *** 87,90 **** --- 87,92 ---- private Set closedSpaces = new HashSet(); + private JTabbedPane tree; + /** * Constructor for GUI *************** *** 261,264 **** --- 263,274 ---- edit.add(editProject); + JMenuItem repaintTree = new JMenuItem("Repaint tree"); + repaintTree.setEnabled(true); + repaintTree.addActionListener(new AbstractAction() { + public void actionPerformed(ActionEvent arg0) { + makeTree(); + };}); + edit.add(repaintTree); + menu.registerMenu(edit); *************** *** 372,384 **** getContentPane().add(splitPaneLeftRight, BorderLayout.CENTER); ! Font font = new Font("Sans-serif", Font.BOLD, 12); ! JTabbedPane tp = new JTabbedPane(JTabbedPane.TOP); ! tp.setFont(font); ! tp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); ! tp.addTab("Project", new JScrollPane (new SpaceTreeView())); ! tp.addTab("Views", new CameraView()); ! tp.setMinimumSize(new Dimension(120, 240)); ! tp.setPreferredSize(new Dimension(120, 240)); ! registerPanel(tp, SPLIT_LEFT); registerPanel(AttributeView.instance(), SPLIT_RIGHT); --- 382,386 ---- getContentPane().add(splitPaneLeftRight, BorderLayout.CENTER); ! makeTree(); registerPanel(AttributeView.instance(), SPLIT_RIGHT); *************** *** 386,389 **** --- 388,409 ---- /** + * generate the tree structure + */ + private void makeTree() { + if (tree != null) { + tree.removeAll(); + } + Font font = new Font("Sans-serif", Font.BOLD, 12); + tree = new JTabbedPane(JTabbedPane.TOP); + tree.setFont(font); + tree.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); + tree.addTab("Project", new JScrollPane (new SpaceTreeView())); + tree.addTab("Views", new CameraView()); + tree.setMinimumSize(new Dimension(120, 240)); + tree.setPreferredSize(new Dimension(120, 240)); + registerPanel(tree, SPLIT_LEFT); + } + + /** * Register panel * @param panel The panel component |
From: rimestad <rim...@us...> - 2006-10-13 16:26:24
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23956/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Added repaintTree to edit menu and made Geometry appear as the first in the Project tree... Later on it should be sorted... Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** GenericTreeView.java 13 Oct 2006 15:49:37 -0000 1.56 --- GenericTreeView.java 13 Oct 2006 16:26:22 -0000 1.57 *************** *** 409,412 **** --- 409,413 ---- elem.remove(sn.getUserObject()); } else { + log.info("Had to insert " + sn + " into " + this); children.add(sn); } *************** *** 856,864 **** public class GeometryContainer extends ContainerNode { ! /** ! * ! */ private static final long serialVersionUID = 1L; ! /** * Constructor --- 857,863 ---- public class GeometryContainer extends ContainerNode { ! /** */ private static final long serialVersionUID = 1L; ! /** * Constructor *************** *** 1019,1023 **** /** ! * Insert the given object into the node * @param elem the elements */ --- 1018,1022 ---- /** ! * Insert the given objects into the node * @param elem the elements */ *************** *** 1029,1033 **** Space s = (Space)iter.next(); if (s.getLevel() == Space.PROJECT_LEVEL) { ! this.add(new GeometryContainer("Geometry", ((Project)userObject).world())); } else { this.add(new SpaceNode(s)); --- 1028,1032 ---- Space s = (Space)iter.next(); if (s.getLevel() == Space.PROJECT_LEVEL) { ! this.insert(new GeometryContainer("Geometry", s), 0); } else { this.add(new SpaceNode(s)); |
From: rimestad <rim...@us...> - 2006-10-13 15:55:01
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11096/src/etc Modified Files: bprocessor.xsd Log Message: now save and load of transformations work, have added a constructor with arguments for rotate and cleared some initialization in persistence space constructor. There is still no support for save and load of modellors but will come during the weekend Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** bprocessor.xsd 10 Oct 2006 14:04:45 -0000 1.19 --- bprocessor.xsd 13 Oct 2006 15:54:59 -0000 1.20 *************** *** 41,44 **** --- 41,45 ---- <xsd:element name="constructor" type="ConstructorType" maxOccurs="unbounded" minOccurs="0"/> <xsd:element name="modellor" type="ModellorType" maxOccurs="1" minOccurs="0"/> + <xsd:element name="transforms" type="TransformType" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="space" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="surface" maxOccurs="unbounded" minOccurs="0"/> *************** *** 49,53 **** <xsd:attribute name="type" type="xsd:int" use="required"/> <xsd:attribute name="name" type="xsd:string"/> ! <xsd:attribute name="voidref" type="xsd:long" use="required"/> <xsd:attribute name="level" type="xsd:int" use="required"/> </xsd:extension> --- 50,56 ---- <xsd:attribute name="type" type="xsd:int" use="required"/> <xsd:attribute name="name" type="xsd:string"/> ! <xsd:attribute name="voidref" type="xsd:long"/> ! <xsd:attribute name="protoref" type="xsd:long"/> ! <xsd:attribute name="transparent" type="xsd:boolean" use="required"/> <xsd:attribute name="level" type="xsd:int" use="required"/> </xsd:extension> *************** *** 163,166 **** --- 166,170 ---- </xsd:complexType> + <!-- HASHMAP --> <xsd:complexType name="Types"> </xsd:complexType> *************** *** 193,202 **** </xsd:complexType> <xsd:complexType name="TransformType"> - <xsd:sequence> - <xsd:element name="content"/> - </xsd:sequence> </xsd:complexType> ! <!-- Element definitions --> <xsd:element name="space" type="SpaceType"/> --- 197,252 ---- </xsd:complexType> + <!-- TRANSFORMATIONS --> <xsd:complexType name="TransformType"> </xsd:complexType> ! ! <xsd:complexType name="RotateType"> ! <xsd:complexContent> ! <xsd:extension base="TransformType"> ! <xsd:attribute name="x" type="xsd:double" use="required"/> ! <xsd:attribute name="y" type="xsd:double" use="required"/> ! <xsd:attribute name="z" type="xsd:double" use="required"/> ! </xsd:extension> ! </xsd:complexContent> ! </xsd:complexType> ! ! <xsd:complexType name="TranslateType"> ! <xsd:complexContent> ! <xsd:extension base="TransformType"> ! <xsd:attribute name="x" type="xsd:double" use="required"/> ! <xsd:attribute name="y" type="xsd:double" use="required"/> ! <xsd:attribute name="z" type="xsd:double" use="required"/> ! </xsd:extension> ! </xsd:complexContent> ! </xsd:complexType> ! ! <xsd:complexType name="ScaleType"> ! <xsd:complexContent> ! <xsd:extension base="TransformType"> ! <xsd:attribute name="x" type="xsd:double" use="required"/> ! <xsd:attribute name="y" type="xsd:double" use="required"/> ! <xsd:attribute name="z" type="xsd:double" use="required"/> ! </xsd:extension> ! </xsd:complexContent> ! </xsd:complexType> ! ! <xsd:complexType name="AxisRotateType"> ! <xsd:complexContent> ! <xsd:extension base="TransformType"> ! <xsd:attribute name="x" type="xsd:double" use="required"/> ! <xsd:attribute name="y" type="xsd:double" use="required"/> ! <xsd:attribute name="z" type="xsd:double" use="required"/> ! <xsd:attribute name="angle" type="xsd:double" use="required"/> ! </xsd:extension> ! </xsd:complexContent> ! </xsd:complexType> ! ! <xsd:complexType name="IDTransformType"> ! <xsd:complexContent> ! <xsd:extension base="TransformType"> ! </xsd:extension> ! </xsd:complexContent> ! </xsd:complexType> ! <!-- Element definitions --> <xsd:element name="space" type="SpaceType"/> |
From: rimestad <rim...@us...> - 2006-10-13 15:55:01
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11096/src/net/sourceforge/bprocessor/model Modified Files: Rotate.java Space.java Persistence.java Log Message: now save and load of transformations work, have added a constructor with arguments for rotate and cleared some initialization in persistence space constructor. There is still no support for save and load of modellors but will come during the weekend Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Persistence.java 10 Oct 2006 14:04:45 -0000 1.11 --- Persistence.java 13 Oct 2006 15:54:59 -0000 1.12 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.model.modellor.Modellor; + import net.sourceforge.bprocessor.model.xml.AxisRotateType; import net.sourceforge.bprocessor.model.xml.Bmodel; import net.sourceforge.bprocessor.model.xml.ConstructorType; *************** *** 13,16 **** --- 14,18 ---- import net.sourceforge.bprocessor.model.xml.EdgeType; import net.sourceforge.bprocessor.model.xml.EntityType; + import net.sourceforge.bprocessor.model.xml.IDTransformType; import net.sourceforge.bprocessor.model.xml.IntegerType; import net.sourceforge.bprocessor.model.xml.LineType; *************** *** 19,30 **** --- 21,38 ---- import net.sourceforge.bprocessor.model.xml.ModellorType; import net.sourceforge.bprocessor.model.xml.PointType; + import net.sourceforge.bprocessor.model.xml.RotateType; + import net.sourceforge.bprocessor.model.xml.ScaleType; import net.sourceforge.bprocessor.model.xml.SpaceType; import net.sourceforge.bprocessor.model.xml.StringType; import net.sourceforge.bprocessor.model.xml.SurfaceType; + import net.sourceforge.bprocessor.model.xml.TransformType; + import net.sourceforge.bprocessor.model.xml.TranslateType; import net.sourceforge.bprocessor.model.xml.VertexType; import net.sourceforge.bprocessor.model.xml.VertexesType; + import net.sourceforge.bprocessor.model.xml.impl.AxisRotateTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.BmodelImpl; import net.sourceforge.bprocessor.model.xml.impl.CoordinateSystemTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.EdgeImpl; + import net.sourceforge.bprocessor.model.xml.impl.IDTransformTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.IntegerTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.LineTypeImpl; *************** *** 33,38 **** --- 41,49 ---- import net.sourceforge.bprocessor.model.xml.impl.ModellorTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.PointTypeImpl; + import net.sourceforge.bprocessor.model.xml.impl.RotateTypeImpl; + import net.sourceforge.bprocessor.model.xml.impl.ScaleTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.SpaceImpl; import net.sourceforge.bprocessor.model.xml.impl.SurfaceImpl; + import net.sourceforge.bprocessor.model.xml.impl.TranslateTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.VertexImpl; import net.sourceforge.bprocessor.model.xml.impl.VertexesTypeImpl; *************** *** 140,144 **** long empty = xml.getVoidref(); boolean container = (empty != 0); ! Space space = new Space(name, type, level, container); space.setId(new Long(xml.getProgid())); space.setDescription(xml.getDescription()); --- 151,160 ---- long empty = xml.getVoidref(); boolean container = (empty != 0); ! Space space = new Space(); ! space.setName(name); ! space.setType(type); ! space.setLevel(level); ! space.setContainer(container); ! space.setTransparent(xml.isTransparent()); space.setId(new Long(xml.getProgid())); space.setDescription(xml.getDescription()); *************** *** 198,201 **** --- 214,239 ---- } { + Iterator iter = xml.getTransforms().iterator(); + while (iter.hasNext()) { + TransformType current = (TransformType) iter.next(); + if (current instanceof RotateType) { + RotateType rot = (RotateType) current; + space.addTransform(new Rotate(rot.getX(), rot.getY(), rot.getZ())); + } else if (current instanceof IDTransformType) { + space.addTransform(new IDTransform()); + } else if (current instanceof AxisRotateType) { + AxisRotateType arot = (AxisRotateType) current; + space.addTransform( + new AxisRotate(arot.getAngle(), arot.getX(), arot.getY(), arot.getZ())); + } else if (current instanceof ScaleType) { + ScaleType st = (ScaleType) current; + space.addTransform(new Scale(st.getX(), st.getY(), st.getZ())); + } else if (current instanceof TranslateType) { + TranslateType tt = (TranslateType) current; + space.addTransform(new Translate(tt.getX(), tt.getY(), tt.getZ())); + } + } + } + { Iterator iter = xml.getConstructor().iterator(); while (iter.hasNext()) { *************** *** 464,467 **** --- 502,506 ---- */ private static void internalizeReferences(Space object, SpaceType xml, Map map) { + object.setProto((Space) get(xml.getProtoref(), map)); object.setEnvelope(asSet(xml.getBoundary(), map)); } *************** *** 617,620 **** --- 656,660 ---- xml.setType(space.getType()); xml.setLevel(space.getLevel()); + xml.setTransparent(space.isTransparent()); xml.setDescription(space.getDescription().toString()); xml.setClassification(space.getClassification().toString()); *************** *** 624,667 **** map.put(space, xml); ! { ! Iterator iter = space.getElements().iterator(); ! while (iter.hasNext()) { ! Space current = (Space) iter.next(); ! xml.getSpace().add(externalizeSpace(current, map)); } ! } ! { ! Iterator iter = space.getSurfaces().iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! xml.getSurface().add(externalizeSurface(current, map)); } ! } ! { ! Iterator iter = space.getEdges().iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! xml.getEdge().add(externalizeEdge(current, map)); } ! } ! { ! Iterator iter = space.getVertices().iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! xml.getVertex().add(externalizeVertex(current, map)); } ! } ! { ! Iterator iter = space.getMaterials().iterator(); ! while (iter.hasNext()) { ! Material current = (Material) iter.next(); ! xml.getMaterial().add(externalizeMaterial(current, map)); } } { ! Iterator iter = space.getConstructors().iterator(); while (iter.hasNext()) { ! Constructor current = (Constructor) iter.next(); ! externalizeConstructor(current, map, xml); } } --- 664,748 ---- map.put(space, xml); ! if (!space.isInstance()) { ! { ! Iterator iter = space.getElements().iterator(); ! while (iter.hasNext()) { ! Space current = (Space) iter.next(); ! xml.getSpace().add(externalizeSpace(current, map)); ! } } ! { ! Iterator iter = space.getSurfaces().iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! xml.getSurface().add(externalizeSurface(current, map)); ! } } ! { ! Iterator iter = space.getEdges().iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! xml.getEdge().add(externalizeEdge(current, map)); ! } } ! { ! Iterator iter = space.getVertices().iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! xml.getVertex().add(externalizeVertex(current, map)); ! } } ! { ! Iterator iter = space.getMaterials().iterator(); ! while (iter.hasNext()) { ! Material current = (Material) iter.next(); ! xml.getMaterial().add(externalizeMaterial(current, map)); ! } ! } ! { ! Iterator iter = space.getConstructors().iterator(); ! while (iter.hasNext()) { ! Constructor current = (Constructor) iter.next(); ! externalizeConstructor(current, map, xml); ! } } } { ! Iterator iter = space.getTransformations().stack().iterator(); while (iter.hasNext()) { ! List trans = xml.getTransforms(); ! Object current = iter.next(); ! if (current instanceof Rotate) { ! Rotate r = (Rotate) current; ! RotateTypeImpl rot = new RotateTypeImpl(); ! rot.setX(r.rx()); ! rot.setY(r.ry()); ! rot.setZ(r.rz()); ! trans.add(0, rot); ! } else if (current instanceof IDTransform) { ! trans.add(0, new IDTransformTypeImpl()); ! } else if (current instanceof AxisRotate) { ! AxisRotate ar = (AxisRotate) current; ! AxisRotateType arot = new AxisRotateTypeImpl(); ! arot.setAngle(ar.angle()); ! arot.setX(ar.rx()); ! arot.setY(ar.ry()); ! arot.setZ(ar.rz()); ! trans.add(0, arot); ! } else if (current instanceof Scale) { ! Scale s = (Scale) current; ! ScaleType st = new ScaleTypeImpl(); ! st.setX(s.sx()); ! st.setY(s.sy()); ! st.setZ(s.sz()); ! trans.add(0, st); ! } else if (current instanceof Translate) { ! Translate t = (Translate) current; ! TranslateType tt = new TranslateTypeImpl(); ! tt.setX(t.tx()); ! tt.setY(t.ty()); ! tt.setZ(t.tz()); ! trans.add(0, tt); ! } } } *************** *** 854,858 **** */ private static void externalizeReferences(Space object, SpaceType xml, Map map) { ! xml.setVoidref(id(map, object.getEmpty())); xml.getBoundary().addAll(ids(map, object.getEnvelope())); } --- 935,944 ---- */ private static void externalizeReferences(Space object, SpaceType xml, Map map) { ! if (object.getEmpty() != null) { ! xml.setVoidref(id(map, object.getEmpty())); ! } ! if (object.getProto() != null) { ! xml.setProtoref(id(map, object.getProto())); ! } xml.getBoundary().addAll(ids(map, object.getEnvelope())); } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** Space.java 13 Oct 2006 12:54:21 -0000 1.79 --- Space.java 13 Oct 2006 15:54:59 -0000 1.80 *************** *** 168,171 **** --- 168,186 ---- */ Space() { + envelope = new HashSet(); + transform = new TransformStack(); + modellor = null; + vertices = new HashMap(); + nextVertexId = 1; + edges = new HashMap(); + nextEdgeId = 1; + surfaces = new HashMap(); + nextSurfaceId = 1; + elements = new HashMap(); + nextElementId = 1; + materials = new HashMap(); + nextMaterialId = 1; + constructors = new HashMap(); + nextConstructorId = 1; } *************** *** 188,191 **** --- 203,207 ---- envelope = new HashSet(); transform = new TransformStack(); + modellor = null; if (container) { vertices = new HashMap(); *************** *** 1135,1139 **** */ public void add(Space element) { ! if (container) { Long id; if (element.getId() != null) { --- 1151,1155 ---- */ public void add(Space element) { ! if (container && elements != null) { Long id; if (element.getId() != null) { *************** *** 2119,2121 **** --- 2135,2153 ---- return level; } + + /** + * Check if this space is a instance of another + * @return true if it is a instance otherwise false + */ + public boolean isInstance() { + return proto != null; + } + + /** + * Set the level of the space MOSTLY FOR PERSISTENCE LAYER + * @param level the level + */ + protected void setLevel(int level) { + this.level = level; + } } Index: Rotate.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Rotate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Rotate.java 19 Sep 2006 10:00:09 -0000 1.1 --- Rotate.java 13 Oct 2006 15:54:59 -0000 1.2 *************** *** 37,40 **** --- 37,53 ---- /** + * Constructor + * @param x the rotation in x + * @param y the rotation in y + * @param z the rotation in z + */ + public Rotate(double x, double y, double z) { + super(); + rx = x; + ry = y; + rz = z; + } + + /** * @param value new value */ |
From: rimestad <rim...@us...> - 2006-10-13 15:51:49
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9807/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: See no need for the history to be cleared at a save inlight me if im wrong, cleared the currentState at resetHistory to avoid undo of a old part of the model Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** Project.java 5 Oct 2006 11:27:04 -0000 1.81 --- Project.java 13 Oct 2006 15:51:41 -0000 1.82 *************** *** 623,626 **** --- 623,627 ---- undoStack.clear(); redoStack.clear(); + currentState = Persistence.externalize(); } *************** *** 642,646 **** Persistence.save(file); makeClean(); - resetHistory(); checkpoint(); setSavePath(file.getCanonicalPath()); --- 643,646 ---- *************** *** 655,659 **** Persistence.save(new File(getSavePath())); makeClean(); - resetHistory(); checkpoint(); } --- 655,658 ---- |
From: rimestad <rim...@us...> - 2006-10-13 15:49:39
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8944/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: Fixed the tree so that it yet again uses the new update functionallity... ALL INSERTION AND DELETION IN THE TREE IS HANDLED BY THE update(Object o) METHODS NOT THE CONSTRUCTORS Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** GenericTreeView.java 9 Oct 2006 12:42:29 -0000 1.55 --- GenericTreeView.java 13 Oct 2006 15:49:37 -0000 1.56 *************** *** 491,496 **** public void update(Object o) { if (o instanceof Entity || o instanceof Attribute) { ! userObject = o; ! model.nodeChanged(this); } } --- 491,498 ---- public void update(Object o) { if (o instanceof Entity || o instanceof Attribute) { ! if (userObject != o) { ! userObject = o; ! model.nodeChanged(this); ! } } } *************** *** 997,1002 **** public ProjectNode(Project p) { super(p); ! update(p); ! add(new GeometryContainer("Geometry", Project.getInstance().world())); } --- 999,1003 ---- public ProjectNode(Project p) { super(p); ! add(new GeometryContainer("Geometry", p.world())); } *************** *** 1007,1011 **** public void update(Object o) { if (o instanceof Project) { ! super.update(((Project)o).getSpaces()); } else { log.warn("Were a " + o + " not a Project"); --- 1008,1016 ---- public void update(Object o) { if (o instanceof Project) { ! Collection c = new LinkedList(); ! Project proj = (Project)o; ! c.add(proj.world()); ! c.addAll(proj.getSpaces()); ! super.update(c); } else { log.warn("Were a " + o + " not a Project"); *************** *** 1023,1027 **** while (iter.hasNext()) { Space s = (Space)iter.next(); ! this.add(new SpaceNode(s)); ins[i] = this.getChildCount() - 1; i++; --- 1028,1036 ---- while (iter.hasNext()) { Space s = (Space)iter.next(); ! if (s.getLevel() == Space.PROJECT_LEVEL) { ! this.add(new GeometryContainer("Geometry", ((Project)userObject).world())); ! } else { ! this.add(new SpaceNode(s)); ! } ins[i] = this.getChildCount() - 1; i++; Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** SpaceTreeView.java 9 Oct 2006 12:42:29 -0000 1.17 --- SpaceTreeView.java 13 Oct 2006 15:49:37 -0000 1.18 *************** *** 8,17 **** package net.sourceforge.bprocessor.gui.treeview; - import java.util.ArrayList; - import java.util.Enumeration; - - import javax.swing.tree.DefaultMutableTreeNode; - import javax.swing.tree.TreePath; - import net.sourceforge.bprocessor.model.Project; --- 8,11 ---- *************** *** 31,34 **** --- 25,34 ---- public SpaceTreeView() { super(); + root.removeAllChildren(); + root.add(new ProjectNode(Project.getInstance())); + root.add(new ConstraintContainer("Constraints", Project.getInstance().getConstraints())); + root.add(new ParameterBlockNode("Globals", Project.getInstance().getGlobals())); + root.add(new ConstructorContainer("Constructors", Project.getInstance().getConstructors())); + model.nodeStructureChanged(root); } *************** *** 37,115 **** */ public void update() { ! if (root.getChildCount() == 5) { ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); ((GenericNode)root.getChildAt(1)).update(Project.getInstance().getConstraints()); ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getGlobals()); ! ((GenericNode)root.getChildAt(3)).update(Project.getInstance().world()); ! ((GenericNode)root.getChildAt(4)).update(Project.getInstance().getConstructors()); ! } else { ! Enumeration e = getExpandedDescendants(new TreePath(root)); ! Object[] paths = findPaths(e); ! root.removeAllChildren(); ! root.add(new ProjectNode(Project.getInstance())); ! root.add(new ConstraintContainer("Constraints", Project.getInstance().getConstraints())); ! root.add(new ParameterBlockNode("Globals", Project.getInstance().getGlobals())); ! root.add(new ConstructorContainer("Constructors", Project.getInstance().getConstructors())); ! model.nodeStructureChanged(root); ! openPaths(paths); ! } ! } ! ! /** ! * Find the paths ! * @param e and enumerator of open nodes ! * @return And array of arrays of objects ! */ ! private Object[] findPaths(Enumeration e) { ! if (e != null) { ! ArrayList res = new ArrayList(); ! while (e.hasMoreElements()) { ! Object o = e.nextElement(); ! if (o instanceof TreePath) { ! TreePath tp = (TreePath)o; ! Object[] os = tp.getPath(); ! Object[] temp = new Object[os.length]; ! for (int i = 0; i < os.length; i++) { ! temp[i] = ((DefaultMutableTreeNode)os[i]).getUserObject(); ! } ! res.add(temp); ! } ! } ! return res.toArray(); ! } ! return null; ! } ! ! /** ! * Open the paths of the given objects ! * @param paths The open paths ! */ ! public void openPaths(Object[] paths) { ! if (paths != null) { ! for (int i = 0; i < paths.length; i++) { ! Object[] route = (Object[])paths[i]; ! if (route.length > 1) { ! openPath(root, 1, route); ! } ! } ! } ! } ! ! /** ! * Open one path in the tree ! * @param depth The depth reached in this call (< route.length) ! * @param node The node to check in ! * @param route The path to open ! */ ! private void openPath(DefaultMutableTreeNode node, int depth, Object[] route) { ! Enumeration e = node.children(); ! while (e.hasMoreElements()) { ! DefaultMutableTreeNode current = (DefaultMutableTreeNode)e.nextElement(); ! if (current.getUserObject() == route[depth]) { ! expandPath(new TreePath(current.getPath())); ! if (depth + 1 < route.length) { ! openPath(current, depth + 1, route); ! } ! } } } --- 37,45 ---- */ public void update() { ! if (root.getChildCount() == 4) { ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); ((GenericNode)root.getChildAt(1)).update(Project.getInstance().getConstraints()); ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getGlobals()); ! ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getConstructors()); } } |
From: rimestad <rim...@us...> - 2006-10-13 15:47:43
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8120/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileNewActionListener.java Log Message: DO NEVER USE MAGIC NUMBERS NO ONE CAN INTERPRET IT.... THERE IS A REASON WHY public static final int mynumber ARE THERE Index: FileNewActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileNewActionListener.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FileNewActionListener.java 21 Mar 2006 12:24:13 -0000 1.7 --- FileNewActionListener.java 13 Oct 2006 15:47:34 -0000 1.8 *************** *** 47,51 **** "Projekt has been changed", JOptionPane.YES_NO_CANCEL_OPTION); ! if (n == 0) { if (Project.getInstance().getSavePath() == null) { JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); --- 47,51 ---- "Projekt has been changed", JOptionPane.YES_NO_CANCEL_OPTION); ! if (n == JOptionPane.YES_OPTION) { if (Project.getInstance().getSavePath() == null) { JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); *************** *** 65,69 **** log.error("Could not export to file: " + file, ex); } ! } } else { try { --- 65,69 ---- log.error("Could not export to file: " + file, ex); } ! } } else { try { *************** *** 76,80 **** } } ! if (n == 1) { Project.getInstance().close(); } --- 76,80 ---- } } ! if (n == JOptionPane.NO_OPTION) { Project.getInstance().close(); } |
From: rimestad <rim...@us...> - 2006-10-13 15:44:27
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6925/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: added some checkpoints so that instantiation and the like to improve undo functionallity Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PopupMenu.java 5 Oct 2006 11:26:56 -0000 1.8 --- PopupMenu.java 13 Oct 2006 15:44:16 -0000 1.9 *************** *** 53,56 **** --- 53,57 ---- space.addTransform(new Translate()); space.changed(); + Project.getInstance().checkpoint(); } }; *************** *** 60,63 **** --- 61,65 ---- space.addTransform(new Rotate()); space.changed(); + Project.getInstance().checkpoint(); } }; *************** *** 67,70 **** --- 69,73 ---- space.addTransform(new Scale()); space.changed(); + Project.getInstance().checkpoint(); } }; *************** *** 74,77 **** --- 77,81 ---- space.pushTransform(new Translate()); space.changed(); + Project.getInstance().checkpoint(); } }; *************** *** 81,84 **** --- 85,89 ---- space.pushTransform(new Rotate()); space.changed(); + Project.getInstance().checkpoint(); } }; *************** *** 88,91 **** --- 93,97 ---- space.pushTransform(new Scale()); space.changed(); + Project.getInstance().checkpoint(); } }; *************** *** 111,114 **** --- 117,121 ---- Space spaceCopy = space.copy(); Selection.primary().set(spaceCopy); + Project.getInstance().checkpoint(); } } *************** *** 123,126 **** --- 130,134 ---- space.getOwner().add(instance); Project.getInstance().changed(Project.getInstance()); + Project.getInstance().checkpoint(); } } *************** *** 157,160 **** --- 165,169 ---- Selection.primary().clear(); Selection.primary().addAll(envelope); + Project.getInstance().checkpoint(); } }; *************** *** 174,177 **** --- 183,187 ---- space.computeEnvelope(); Project.getInstance().changed(Project.getInstance()); + Project.getInstance().checkpoint(); } } *************** *** 189,192 **** --- 199,203 ---- } space.changed(); + Project.getInstance().checkpoint(); } }; |
From: Michael L. <he...@us...> - 2006-10-13 12:54:30
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3913/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Change to the Space.insert(surface) function: Attempt to see if a surface is already existing containing same edges Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** Space.java 13 Oct 2006 07:54:58 -0000 1.78 --- Space.java 13 Oct 2006 12:54:21 -0000 1.79 *************** *** 879,891 **** List edges = surface.getEdges(); List actual = new LinkedList(); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! actual.add(insert(current, split)); } ! surface.setEdges(actual); ! add(surface); ! Geometry.holeAnalysis(surface); ! return surface; } --- 879,907 ---- List edges = surface.getEdges(); List actual = new LinkedList(); ! { ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! actual.add(insert(current, split)); ! } } ! Surface shadow = surface; ! { ! Collection surfaces = getSurfaces(); ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! Set others = new HashSet(current.getEdges()); ! if (others.containsAll(actual)) { ! shadow = current; ! } ! } ! } ! if (shadow == surface) { ! surface.setEdges(actual); ! add(surface); ! Geometry.holeAnalysis(surface); ! } ! return shadow; } |
From: Michael L. <he...@us...> - 2006-10-13 07:55:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15919/src/net/sourceforge/bprocessor/model Modified Files: Space.java Geometric.java Log Message: Added a protect flag to geometric Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Geometric.java 11 Sep 2006 14:58:17 -0000 1.12 --- Geometric.java 13 Oct 2006 07:54:58 -0000 1.13 *************** *** 19,22 **** --- 19,25 ---- private Space owner; + /** protected */ + private boolean protect; + /** * Get the mesh *************** *** 59,62 **** --- 62,81 ---- /** + * Set the protect flag + * @param value protect flag + */ + public void protect(boolean value) { + this.protect = value; + } + + /** + * Get the protect flag + * @return protect flag + */ + public boolean protect() { + return protect; + } + + /** * Collects the set of vertices in this geometric * @return the set of vertices Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** Space.java 11 Oct 2006 13:27:59 -0000 1.77 --- Space.java 13 Oct 2006 07:54:58 -0000 1.78 *************** *** 516,520 **** space.findByLocation (vertex.getX(), vertex.getY(), vertex.getZ(), 0.0000001); if (!vertices.isEmpty()) { ! actual = (Vertex) vertices.iterator().next(); } } --- 516,526 ---- space.findByLocation (vertex.getX(), vertex.getY(), vertex.getZ(), 0.0000001); if (!vertices.isEmpty()) { ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! if (!current.protect()) { ! actual = current; ! } ! } } } *************** *** 529,533 **** while (iter.hasNext()) { Edge e = (Edge) iter.next(); ! if (!e.getStrippled()) { e.split(actual); } --- 535,539 ---- while (iter.hasNext()) { Edge e = (Edge) iter.next(); ! if (!e.getStrippled() && !e.protect()) { e.split(actual); } *************** *** 633,643 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! if (current.getFrom() == edge.getFrom() && current.getTo() == edge.getTo()) { ! actual = current; ! break; ! } ! if (current.getFrom() == edge.getTo() && current.getTo() == edge.getFrom()) { ! actual = current; ! break; } } --- 639,651 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! if (!current.protect()) { ! if (current.getFrom() == edge.getFrom() && current.getTo() == edge.getTo()) { ! actual = current; ! break; ! } ! if (current.getFrom() == edge.getTo() && current.getTo() == edge.getFrom()) { ! actual = current; ! break; ! } } } |
From: Michael L. <he...@us...> - 2006-10-11 14:05:31
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25482/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: push, pop, translate, rotate and scale implemented in b-script Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** SpaceTool.java 11 Oct 2006 13:28:02 -0000 1.53 --- SpaceTool.java 11 Oct 2006 14:05:20 -0000 1.54 *************** *** 39,46 **** --- 39,49 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.IDTransform; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Scale; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.Transform; import net.sourceforge.bprocessor.model.TransformStack; import net.sourceforge.bprocessor.model.Translate; *************** *** 66,69 **** --- 69,75 ---- private TransformStack transform; + /** ID */ + private Transform id; + /** * Construct the SpaceTool *************** *** 610,613 **** --- 616,620 ---- transform = new TransformStack(); + id = new IDTransform(); HashMap globals = Project.getInstance().getGlobals().environment(); *************** *** 636,639 **** --- 643,659 ---- } }); + globals.put("push", new Builtin() { + public void evaluate(Environment env, Stack stack) { + transform.push(id); + } + }); + globals.put("pop", new Builtin() { + public void evaluate(Environment env, Stack stack) { + while (transform.pop() != id) { + // NOTHING + } + } + }); + globals.put("vertex", new Builtin() { *************** *** 700,703 **** --- 720,733 ---- } }); + globals.put("scale", new Builtin() { + public void evaluate(Environment env, Stack stack) { + Double x = (Double) env.get(0); + Double y = (Double) env.get(1); + Double z = (Double) env.get(2); + transform.push( + new Scale(x.doubleValue(), y.doubleValue(), z.doubleValue()) + ); + } + }); globals.put("rotate", new Builtin() { public void evaluate(Environment env, Stack stack) { |
From: Michael L. <he...@us...> - 2006-10-11 14:05:20
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25466/src/net/sourceforge/bprocessor/model Modified Files: TransformStack.java Scale.java Added Files: IDTransform.java Log Message: push, pop, translate, rotate and scale implemented in b-script Index: TransformStack.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/TransformStack.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TransformStack.java 2 Oct 2006 06:10:10 -0000 1.2 --- TransformStack.java 11 Oct 2006 14:05:16 -0000 1.3 *************** *** 46,53 **** /** * Pop a transform ! * */ ! public void pop() { ! stack.pop(); } --- 46,53 ---- /** * Pop a transform ! * @return Trasnform */ ! public Transform pop() { ! return (Transform) stack.pop(); } --- NEW FILE: IDTransform.java --- //--------------------------------------------------------------------------------- // $Id: IDTransform.java,v 1.1 2006/10/11 14:05:16 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; import java.util.List; /** * ID Transform */ public class IDTransform extends Transform { /** * Constructor */ public IDTransform() { super(); } /** * @param vertex Vertex * @return vertex */ public Vertex transform(Vertex vertex) { return vertex; } /** * @param attributes List */ public void setAttributes(List attributes) { } /** * @return List */ public List getAttributes() { return null; } /** * @return String */ public String getGeneralName() { return "ID"; } } Index: Scale.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Scale.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Scale.java 27 Sep 2006 08:36:25 -0000 1.2 --- Scale.java 11 Oct 2006 14:05:16 -0000 1.3 *************** *** 37,40 **** --- 37,53 ---- /** + * Constructor + * @param x Double + * @param y Double + * @param z Double + */ + public Scale(double x, double y, double z) { + super(); + sx = x; + sy = y; + sz = z; + } + + /** * @param value new value */ |
From: Michael L. <he...@us...> - 2006-10-11 13:28:04
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10499/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Creating space and assigning spaces to surfaces by scripting Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** SpaceTool.java 11 Oct 2006 11:23:23 -0000 1.52 --- SpaceTool.java 11 Oct 2006 13:28:02 -0000 1.53 *************** *** 666,669 **** --- 666,683 ---- } }); + globals.put("front", new Builtin() { + public void evaluate(Environment env, Stack stack) { + Surface surface = (Surface) env.get(0); + Space space = (Space) env.get(1); + surface.setFrontDomain(space); + } + }); + globals.put("space", new Builtin() { + public void evaluate(Environment env, Stack stack) { + String name = (String) env.get(0); + Space result = new Space(name, Space.CONSTRUCTION, Space.SPACE_LEVEL, true); + stack.push(result); + } + }); globals.put("contour", new Builtin() { public void evaluate(Environment env, Stack stack) { *************** *** 744,747 **** --- 758,764 ---- result = space.insert((Surface) result, true); Selection.primary().add(result); + } else if (result instanceof Space) { + space.add((Space) result); + Selection.primary().add(result); } else { glv.setLengthValue(result.toString()); |
From: Michael L. <he...@us...> - 2006-10-11 13:28:03
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10426/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Creating space and assigning spaces to surfaces by scripting Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** Space.java 10 Oct 2006 09:23:57 -0000 1.76 --- Space.java 11 Oct 2006 13:27:59 -0000 1.77 *************** *** 1206,1210 **** */ public String toString() { ! return getName(); } --- 1206,1210 ---- */ public String toString() { ! return "[space " + getName() + "]"; } |
From: Michael L. <he...@us...> - 2006-10-11 11:23:36
|
Update of /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26191/src/net/sourceforge/bprocessor/model/evaluator Modified Files: Primitive.java Operation.java Invokable.java Function.java Call.java Added Files: ArityError.java PrimitiveTypeError.java SemanticError.java Log Message: Improved errorhandling in scripting --- NEW FILE: ArityError.java --- package net.sourceforge.bprocessor.model.evaluator; import java.util.List; public class ArityError extends SemanticError { private List arguments; private Function function; public ArityError(List arguments, Function function) { super(); this.arguments = arguments; this.function = function; } public String toString() { return function.name() + " requires " + function.formals().size() + " arguments but got " + arguments.size() + " : " + arguments; } } Index: Call.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Call.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Call.java 29 Sep 2006 07:13:16 -0000 1.7 --- Call.java 11 Oct 2006 11:23:26 -0000 1.8 *************** *** 35,39 **** * @param stack Stack */ ! public int evaluate(Environment env, Stack stack) { int length = stack.search(Function.mark) - 1; List arguments = new ArrayList(length); --- 35,39 ---- * @param stack Stack */ ! public int evaluate(Environment env, Stack stack) throws SemanticError { int length = stack.search(Function.mark) - 1; List arguments = new ArrayList(length); *************** *** 52,56 **** if (invokable instanceof Function) { Function function = (Function) invokable; ! Iterator names = function.formals().iterator(); Iterator values = arguments.iterator(); while (names.hasNext()) { --- 52,63 ---- if (invokable instanceof Function) { Function function = (Function) invokable; ! List formals = function.formals(); ! ! ! if (formals.size() != arguments.size()) { ! throw new ArityError(arguments, function); ! } ! ! Iterator names = formals.iterator(); Iterator values = arguments.iterator(); while (names.hasNext()) { Index: Invokable.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Invokable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Invokable.java 14 Sep 2006 09:21:46 -0000 1.2 --- Invokable.java 11 Oct 2006 11:23:26 -0000 1.3 *************** *** 17,21 **** * @param env Environment * @param stack Stack */ ! public void evaluate(Environment env, Stack stack); } --- 17,22 ---- * @param env Environment * @param stack Stack + * @throws SemanticError */ ! public void evaluate(Environment env, Stack stack) throws SemanticError; } Index: Primitive.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Primitive.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Primitive.java 10 Oct 2006 14:41:36 -0000 1.6 --- Primitive.java 11 Oct 2006 11:23:26 -0000 1.7 *************** *** 53,128 **** * @return offset */ ! public int evaluate(Environment env, 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; } case EQ: { ! Object op1 = stack.pop(); ! Object op2 = stack.pop(); ! stack.push(new Boolean(op1.equals(op2))); ! break; } case LT: { ! Comparable op1 = (Comparable) stack.pop(); ! Comparable op2 = (Comparable) stack.pop(); ! stack.push(new Boolean(op1.compareTo(op2) > 0)); ! break; } case GT: { ! Comparable op1 = (Comparable) stack.pop(); ! Comparable op2 = (Comparable) stack.pop(); ! stack.push(new Boolean(op1.compareTo(op2) < 0)); ! break; } case GET: { ! Double op1 = (Double) stack.pop(); ! List op2 = (List) stack.pop(); ! stack.push(op2.get(op1.intValue())); ! break; } case LST: { ! int length = stack.search(Function.mark) - 1; ! List arguments = new ArrayList(length); ! for (int i = 0; i < length; i++) { ! arguments.add(null); ! } ! while (length > 0) { ! Object current = stack.pop(); ! arguments.set(length - 1, current); ! length--; ! } ! stack.pop(); ! stack.push(arguments); ! break; } } - return 1; } } --- 53,172 ---- * @return offset */ ! public int evaluate(Environment env, Stack stack) throws SemanticError { ! try { ! 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; ! } ! case EQ: { ! Object op1 = stack.pop(); ! Object op2 = stack.pop(); ! stack.push(new Boolean(op1.equals(op2))); ! break; ! } ! case LT: { ! Comparable op1 = (Comparable) stack.pop(); ! Comparable op2 = (Comparable) stack.pop(); ! stack.push(new Boolean(op1.compareTo(op2) > 0)); ! break; ! } ! case GT: { ! Comparable op1 = (Comparable) stack.pop(); ! Comparable op2 = (Comparable) stack.pop(); ! stack.push(new Boolean(op1.compareTo(op2) < 0)); ! break; ! } ! case GET: { ! Double op1 = (Double) stack.pop(); ! List op2 = (List) stack.pop(); ! stack.push(op2.get(op1.intValue())); ! break; ! } ! case LST: { ! int length = stack.search(Function.mark) - 1; ! List arguments = new ArrayList(length); ! for (int i = 0; i < length; i++) { ! arguments.add(null); ! } ! while (length > 0) { ! Object current = stack.pop(); ! arguments.set(length - 1, current); ! length--; ! } ! stack.pop(); ! stack.push(arguments); ! break; ! } ! } ! } catch (Exception e) { ! if (e instanceof ClassCastException) { ! throw new PrimitiveTypeError(this); ! } ! System.out.println("caught: " + e); ! } ! return 1; ! } ! ! public String toString() { switch(opcode) { case ADD: { ! return "+"; } case SUB: { ! return "-"; } case MUL: { ! return "*"; } case DIV: { ! return "/"; } case NEG: { ! return "-"; } case EQ: { ! return "="; } case LT: { ! return "<"; } case GT: { ! return ">"; } case GET: { ! return "array access"; } case LST: { ! return "list"; } + default: + return ""; } } } --- NEW FILE: SemanticError.java --- package net.sourceforge.bprocessor.model.evaluator; public class SemanticError extends Exception { public SemanticError() { super(); } } Index: Operation.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Operation.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Operation.java 17 Sep 2006 17:29:21 -0000 1.4 --- Operation.java 11 Oct 2006 11:23:26 -0000 1.5 *************** *** 28,31 **** * @return offset */ ! public abstract int evaluate(Environment env, Stack stack); } --- 28,31 ---- * @return offset */ ! public abstract int evaluate(Environment env, Stack stack) throws SemanticError; } Index: Function.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Function.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Function.java 17 Sep 2006 17:29:21 -0000 1.6 --- Function.java 11 Oct 2006 11:23:26 -0000 1.7 *************** *** 14,17 **** --- 14,19 ---- import java.util.Vector; + import antlr.CharScanner; + /** * Function *************** *** 81,89 **** } /** * @param env Environment * @param stack Stack */ ! public void evaluate(Environment env, Stack stack) { int pc = 0; while (pc < operations.size()) { --- 83,95 ---- } + public String name() { + return name; + } + /** * @param env Environment * @param stack Stack */ ! public void evaluate(Environment env, Stack stack) throws SemanticError { int pc = 0; while (pc < operations.size()) { --- NEW FILE: PrimitiveTypeError.java --- package net.sourceforge.bprocessor.model.evaluator; public class PrimitiveTypeError extends SemanticError { private Primitive primitive; public PrimitiveTypeError(Primitive primitive) { super(); this.primitive = primitive; } public String toString() { return "wrong arguments for " + primitive; } } |
From: Michael L. <he...@us...> - 2006-10-11 11:23:36
|
Update of /cvsroot/bprocessor/bscript/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26191/src/etc Modified Files: bscript.g Log Message: Improved errorhandling in scripting Index: bscript.g =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/etc/bscript.g,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** bscript.g 10 Oct 2006 14:41:36 -0000 1.11 --- bscript.g 11 Oct 2006 11:23:27 -0000 1.12 *************** *** 5,8 **** --- 5,9 ---- import java.util.List; import java.util.LinkedList; + import antlr.CharScanner; } *************** *** 14,38 **** } ! StartTerm: '(' ; ! EndTerm: ')' ; ! Plus : '+' ; ! Minus : '-' ; ! Multiply : '*' ; ! Divide : '/' ; ! Period : '.' ; ! End : ';' ; ! Comma : ',' ; ! Bar : '|' ; ! Lt : '<' ; ! Gt : '>' ; ! LB : '[' ; ! RB : ']' ; ! LC : '{' ; ! RC : '}' ; ! Equal: '=' ; ! LtEq: "<=" ; ! GtEq: ">=" ; ! Assign: ":=" ; protected Letter --- 15,41 ---- } ! StartTerm options { paraphrase = "'('"; } : '(' ; ! EndTerm options { paraphrase = "')'"; } : ')' ; ! Plus options { paraphrase = "'+'"; } : '+' ; ! Minus options { paraphrase = "'-'"; } : '-' ; ! Multiply options { paraphrase = "'*'"; } : '*' ; ! Divide options { paraphrase = "'/'"; } : '/' ; ! Period options { paraphrase = "'.'"; } : '.' ; ! Semicolon options { paraphrase = "';'"; } : ';' ; ! Comma options { paraphrase = "','"; } : ',' ; ! Bar options { paraphrase = "'|'"; } : '|' ; ! Lt options { paraphrase = "'<'"; } : '<' ; ! Gt options { paraphrase = "'>'"; } : '>' ; ! LB options { paraphrase = "'['"; } : '[' ; ! RB options { paraphrase = "']'"; } : ']' ; ! LC options { paraphrase = "'{'"; } : '{' ; ! RC options { paraphrase = "'}'"; } : '}' ; ! ! Equal options { paraphrase = "'='"; } : '=' ; ! LtEq options { paraphrase = "'<='"; } : "<=" ; ! GtEq options { paraphrase = "'>='"; } : ">=" ; ! Assign options { paraphrase = "':='"; } : ":=" ; ! Elipsis : "..."; protected Letter *************** *** 55,74 **** Identifier : (Letter | '_' ) ( Letter | Digit | '_' )* ; String : ( '"' ( ~'"' )* '"' ) ; WhiteSpace ! : ( ' ' ! | '\r' '\n' ! | '\n' ! | '\t' ! ) ! {$setType(Token.SKIP);} ! ; class ScriptParser extends Parser; --- 58,79 ---- Identifier + options { paraphrase = "an identifier"; } : (Letter | '_' ) ( Letter | Digit | '_' )* ; String + options { paraphrase = "a string"; } : ( '"' ( ~'"' )* '"' ) ; + protected Space : ' ' ; + protected Tab : '\t' ; + protected Form : '\f' ; + WhiteSpace ! : ( Space | Tab | Form ) { $setType(Token.SKIP); } ! | ( '\r' | '\n' | '\r''\n' ) { newline(); $setType(Token.SKIP); } ! ; class ScriptParser extends Parser; *************** *** 76,84 **** options { k=3; } program[Function env] ! : statement[env] End ; --- 81,98 ---- options { k=3; + defaultErrorHandler=false; } + { private CharScanner scanner; + public void setScanner(CharScanner scanner) { + this.scanner = scanner; + } + public int getLine() { + return scanner.getLine(); + } + } program[Function env] ! : statement[env] Semicolon ; *************** *** 92,97 **** ( formal:Identifier { formals.add(formal.getText()); } ) * { function = new Function(name.getText(), formals); } "begin" ! ( statement[function] End ) * "end" { map.put(name.getText(), function); } --- 106,112 ---- ( formal:Identifier { formals.add(formal.getText()); } ) * { function = new Function(name.getText(), formals); } + ( Elipsis ) ? "begin" ! ( statement[function] Semicolon) * "end" { map.put(name.getText(), function); } *************** *** 122,126 **** "while" expression[env] { int beforebranch = env.length(); env.append(branchend); } ! "do" ( statement[env] End ) * "end" { int after = env.length(); Branch branch = new Branch(before - after); --- 137,141 ---- "while" expression[env] { int beforebranch = env.length(); env.append(branchend); } ! "do" ( statement[env] Semicolon ) * "end" { int after = env.length(); Branch branch = new Branch(before - after); *************** *** 137,141 **** env.append(branchelse); } ! ( statement[env] End) * ( "end" --- 152,156 ---- env.append(branchelse); } ! ( statement[env] Semicolon) * ( "end" *************** *** 149,153 **** } "else" ! ( statement[env] End) * "end" { --- 164,168 ---- } "else" ! ( statement[env] Semicolon) * "end" { |
From: Michael L. <he...@us...> - 2006-10-11 11:23:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26181/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Improved errorhandling in scripting Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** SpaceTool.java 11 Oct 2006 06:23:11 -0000 1.51 --- SpaceTool.java 11 Oct 2006 11:23:23 -0000 1.52 *************** *** 657,666 **** globals.put("surface", new Builtin() { public void evaluate(Environment env, Stack stack) { - Vertex previous = (Vertex) env.get(env.length() - 1); List edges = new LinkedList(); for (int i = 0; i < env.length(); i++) { ! Vertex current = (Vertex) env.get(i); ! edges.add(new Edge(previous, current)); ! previous = current; } Surface result = new Surface(edges); --- 657,664 ---- globals.put("surface", new Builtin() { public void evaluate(Environment env, Stack stack) { List edges = new LinkedList(); for (int i = 0; i < env.length(); i++) { ! Edge current = (Edge) env.get(i); ! edges.add(current); } Surface result = new Surface(edges); *************** *** 721,725 **** ScriptParser parser = new ScriptParser(lexer); parser.script(globals); - System.out.println("done parsing globals"); try { Environment global = new Environment(globals, null); --- 719,722 ---- *************** *** 753,763 **** typing = false; } catch (Exception error) { ! ! log.info("runtime error: " + error); } } catch (Exception error) { ! log.info("-- error --"); ! log.info("syntax error: " + error); ! log.info("-----------"); } --- 750,757 ---- typing = false; } catch (Exception error) { ! System.out.println(error); } } catch (Exception error) { ! System.out.println(error); } |
From: Michael L. <he...@us...> - 2006-10-11 06:23:13
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2547/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Small change to error-handling Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** SpaceTool.java 10 Oct 2006 14:41:33 -0000 1.50 --- SpaceTool.java 11 Oct 2006 06:23:11 -0000 1.51 *************** *** 721,760 **** ScriptParser parser = new ScriptParser(lexer); parser.script(globals); ! } catch (Exception error) { ! log.info(error); ! } ! try { ! Environment global = new Environment(globals, null); ! Environment env = new Environment(global, new HashMap(), new LinkedList()); ! Reader input = new StringReader(value); ! ScriptLexer lexer = new ScriptLexer(input); ! ScriptParser parser = new ScriptParser(lexer); ! Function function = new Function(); ! parser.statement(function); ! Stack stack = new Stack(); ! function.evaluate(env, stack); ! Project.getInstance().getGlobals().define(globals); ! Project.getInstance().changed(Project.getInstance().getGlobals()); ! ! Space space = Project.getInstance().getActiveSpace(); ! while (!stack.empty()) { ! Object result = stack.pop(); ! if (result instanceof Vertex) { ! result = space.insert((Vertex)result, true); ! Selection.primary().add(result); ! } else if (result instanceof Edge) { ! result = space.insert((Edge)result, true); ! Selection.primary().add(result); ! } else if (result instanceof Surface) { ! result = space.insert((Surface) result, true); ! Selection.primary().add(result); ! } else { ! glv.setLengthValue(result.toString()); } } - typing = false; } catch (Exception error) { ! log.info(error); } return null; } --- 721,765 ---- ScriptParser parser = new ScriptParser(lexer); parser.script(globals); ! System.out.println("done parsing globals"); ! try { ! Environment global = new Environment(globals, null); ! Environment env = new Environment(global, new HashMap(), new LinkedList()); ! input = new StringReader(value); ! lexer = new ScriptLexer(input); ! parser = new ScriptParser(lexer); ! Function function = new Function(); ! parser.statement(function); ! Stack stack = new Stack(); ! function.evaluate(env, stack); ! Project.getInstance().getGlobals().define(globals); ! Project.getInstance().changed(Project.getInstance().getGlobals()); ! ! Space space = Project.getInstance().getActiveSpace(); ! while (!stack.empty()) { ! Object result = stack.pop(); ! if (result instanceof Vertex) { ! result = space.insert((Vertex)result, true); ! Selection.primary().add(result); ! } else if (result instanceof Edge) { ! result = space.insert((Edge)result, true); ! Selection.primary().add(result); ! } else if (result instanceof Surface) { ! result = space.insert((Surface) result, true); ! Selection.primary().add(result); ! } else { ! glv.setLengthValue(result.toString()); ! } } + typing = false; + } catch (Exception error) { + + log.info("runtime error: " + error); } } catch (Exception error) { ! log.info("-- error --"); ! log.info("syntax error: " + error); ! log.info("-----------"); } + return null; } *************** *** 772,781 **** } char ch = event.getKeyChar(); ! if (ch > 31 && ch < 128) { value = value + ch; glv.setLengthValue(value); typing = true; } else { - log.info(new Character(ch)); if (event.getKeyCode() == KeyEvent.VK_ENTER) { evaluate(value); --- 777,785 ---- } char ch = event.getKeyChar(); ! if (ch > 31 && ch < 256) { value = value + ch; glv.setLengthValue(value); typing = true; } else { if (event.getKeyCode() == KeyEvent.VK_ENTER) { evaluate(value); |
From: Michael L. <he...@us...> - 2006-10-11 06:23:09
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2531/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java Log Message: Small change to error-handling Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** GenericPanel.java 15 Sep 2006 07:31:23 -0000 1.20 --- GenericPanel.java 11 Oct 2006 06:23:07 -0000 1.21 *************** *** 104,110 **** } else if (obj instanceof Camera) { Project.getInstance().changed((Camera)obj); ! } else { ! log.info("Were not a Entity object " + obj); ! } } }); --- 104,108 ---- } else if (obj instanceof Camera) { Project.getInstance().changed((Camera)obj); ! } } }); *************** *** 135,140 **** } else if (obj instanceof Camera) { Project.getInstance().changed((Camera)obj); - } else { - log.info("Were not a Entity object " + obj); } } --- 133,136 ---- *************** *** 152,158 **** } else if (obj instanceof Camera) { Project.getInstance().changed((Camera)obj); ! } else { ! log.info("Were not a Entity object " + obj); ! } } }); --- 148,152 ---- } else if (obj instanceof Camera) { Project.getInstance().changed((Camera)obj); ! } } }); *************** *** 169,174 **** } else if (obj instanceof Camera) { Project.getInstance().changed((Camera)obj); - } else { - log.info("Were not a Entity object " + obj); } } --- 163,166 ---- *************** *** 186,191 **** } else if (obj instanceof Camera) { Project.getInstance().changed((Camera)obj); - } else { - log.info("Were not a Entity object " + obj); } } --- 178,181 ---- *************** *** 203,208 **** } else if (obj instanceof Camera) { Project.getInstance().changed((Camera)obj); - } else { - log.info("Were not a Entity object " + obj); } } --- 193,196 ---- |