bprocessor-commit Mailing List for B-processor (Page 15)
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...> - 2009-09-18 10:16:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15421/src/net/sourceforge/bprocessor/model Modified Files: Grid.java Log Message: grid Index: Grid.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Grid.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Grid.java 18 Sep 2009 09:09:06 -0000 1.10 --- Grid.java 18 Sep 2009 10:16:21 -0000 1.11 *************** *** 173,180 **** double h = getHeight(); double d = getDistance(); ! int n = (int) Math.round((w / d) + 0.5); ! int m = (int) Math.round((h / d) + 0.5); Vertex from = origin.copy(); ! for (int k = 0; k < n; k++) { Vertex to = from.add(j.scale(h)); Edge edge = new Edge(from, to); --- 173,181 ---- double h = getHeight(); double d = getDistance(); ! int n = (int) Math.floor((w / d) + 0.0001); ! int m = (int) Math.floor((h / d) + 0.0001); ! Vertex from = origin.copy(); ! for (int k = 0; k < (n + 1); k++) { Vertex to = from.add(j.scale(h)); Edge edge = new Edge(from, to); *************** *** 183,187 **** } from = origin.copy(); ! for (int k = 0; k < m; k++) { Vertex to = from.add(i.scale(w)); Edge edge = new Edge(from, to); --- 184,188 ---- } from = origin.copy(); ! for (int k = 0; k < (m + 1); k++) { Vertex to = from.add(i.scale(w)); Edge edge = new Edge(from, to); |
From: Michael L. <he...@us...> - 2009-09-18 10:16:31
|
Update of /cvsroot/bprocessor/model/src/etc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15421/src/etc Modified Files: bprocessor.xsd Log Message: grid Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** bprocessor.xsd 18 Sep 2009 09:09:06 -0000 1.46 --- bprocessor.xsd 18 Sep 2009 10:16:21 -0000 1.47 *************** *** 201,208 **** <xsd:complexContent> <xsd:extension base="ConstructorType"> ! <xsd:attribute name="size" type="xsd:float" use="optional"/> ! <xsd:attribute name="width" type="xsd:float" use="optional"/> ! <xsd:attribute name="height" type="xsd:float" use="optional"/> ! <xsd:attribute name="distance" type="xsd:float" use="optional"/> </xsd:extension> </xsd:complexContent> --- 201,208 ---- <xsd:complexContent> <xsd:extension base="ConstructorType"> ! <xsd:attribute name="size" type="xsd:double" use="optional"/> ! <xsd:attribute name="width" type="xsd:double" use="optional"/> ! <xsd:attribute name="height" type="xsd:double" use="optional"/> ! <xsd:attribute name="distance" type="xsd:double" use="optional"/> </xsd:extension> </xsd:complexContent> |
From: Michael L. <he...@us...> - 2009-09-18 09:09:20
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9203/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Grid Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** AbstractPencil.java 9 Sep 2009 10:31:03 -0000 1.109 --- AbstractPencil.java 18 Sep 2009 09:09:09 -0000 1.110 *************** *** 628,632 **** break; } ! updateConstructors(); editor.repaint(); } --- 628,634 ---- break; } ! if (!typing) { ! updateConstructors(); ! } editor.repaint(); } |
From: Michael L. <he...@us...> - 2009-09-18 09:09:18
|
Update of /cvsroot/bprocessor/model/src/etc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9185/src/etc Modified Files: bprocessor.xsd Log Message: Grid Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** bprocessor.xsd 9 Sep 2009 10:31:00 -0000 1.45 --- bprocessor.xsd 18 Sep 2009 09:09:06 -0000 1.46 *************** *** 201,205 **** <xsd:complexContent> <xsd:extension base="ConstructorType"> ! <xsd:attribute name="size" type="xsd:float" use="optional"/> <xsd:attribute name="distance" type="xsd:float" use="optional"/> </xsd:extension> --- 201,207 ---- <xsd:complexContent> <xsd:extension base="ConstructorType"> ! <xsd:attribute name="size" type="xsd:float" use="optional"/> ! <xsd:attribute name="width" type="xsd:float" use="optional"/> ! <xsd:attribute name="height" type="xsd:float" use="optional"/> <xsd:attribute name="distance" type="xsd:float" use="optional"/> </xsd:extension> |
From: Michael L. <he...@us...> - 2009-09-18 09:09:14
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9185/src/net/sourceforge/bprocessor/model Modified Files: Item.java Grid.java Persistence.java Log Message: Grid Index: Item.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Item.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Item.java 29 Jun 2009 10:57:45 -0000 1.2 --- Item.java 18 Sep 2009 09:09:06 -0000 1.3 *************** *** 532,535 **** --- 532,536 ---- setName((String)a.getValue()); } else if (a.getName().equals("Classification")) { + System.out.println("setting classification:"); setClassification(((Classification)a.getValue())); } else if (a.getName().equals("Type")) { *************** *** 615,619 **** } res.add(new Attribute("Material", new Reference(material(), materials))); - res.add(new Attribute("Euler", Double.valueOf(eulerCharacteristic()))); res.add(new Attribute("Closed", Boolean.valueOf(closed()))); res.add(new Attribute("Description", getDescription())); --- 616,619 ---- Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Persistence.java 9 Sep 2009 10:31:00 -0000 1.83 --- Persistence.java 18 Sep 2009 09:09:06 -0000 1.84 *************** *** 577,581 **** res.setActive(xml.isActive()); res.setDistance(xml.getDistance()); ! res.setWidth(xml.getSize()); res.setId(xml.getProgid()); mapper.put(xml.getId(), res); --- 577,591 ---- res.setActive(xml.isActive()); res.setDistance(xml.getDistance()); ! ! double size = xml.getSize(); ! if (size > 0.0) { ! res.setWidth(size); ! res.setHeight(size); ! } else { ! double width = xml.getWidth(); ! double height = xml.getHeight(); ! res.setWidth(width); ! res.setHeight(height); ! } res.setId(xml.getProgid()); mapper.put(xml.getId(), res); *************** *** 1269,1274 **** xml.setActive(grid.isActive()); xml.setDistance((float) grid.getDistance()); ! xml.setSize((float) grid.getWidth()); ! xml.setVertex(externalizeVertex(grid.getOrigin(), new HashMap())); --- 1279,1284 ---- xml.setActive(grid.isActive()); xml.setDistance((float) grid.getDistance()); ! xml.setWidth((float) grid.getWidth()); ! xml.setHeight((float) grid.getHeight()); xml.setVertex(externalizeVertex(grid.getOrigin(), new HashMap())); Index: Grid.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Grid.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Grid.java 9 Sep 2009 12:51:32 -0000 1.9 --- Grid.java 18 Sep 2009 09:09:06 -0000 1.10 *************** *** 173,178 **** double h = getHeight(); double d = getDistance(); ! int n = (int) Math.round((w + d) / d); ! int m = (int) Math.round((h + d) / d); Vertex from = origin.copy(); for (int k = 0; k < n; k++) { --- 173,178 ---- double h = getHeight(); double d = getDistance(); ! int n = (int) Math.round((w / d) + 0.5); ! int m = (int) Math.round((h / d) + 0.5); Vertex from = origin.copy(); for (int k = 0; k < n; k++) { |
From: Michael L. <he...@us...> - 2009-09-18 09:09:11
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9166/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java Log Message: Grid Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** GenericPanel.java 9 Sep 2009 12:51:35 -0000 1.54 --- GenericPanel.java 18 Sep 2009 09:09:02 -0000 1.55 *************** *** 264,267 **** --- 264,268 ---- */ public void stopEditing() { + System.out.println("stop editing"); if (current != null) { current.stopEditing(); |
From: Michael L. <he...@us...> - 2009-09-14 16:23:13
|
Update of /cvsroot/bprocessor/tools/checkstyle In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20877/checkstyle Modified Files: checkstyle.xml Log Message: Brunata Index: checkstyle.xml =================================================================== RCS file: /cvsroot/bprocessor/tools/checkstyle/checkstyle.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** checkstyle.xml 11 Apr 2007 09:11:16 -0000 1.8 --- checkstyle.xml 14 Sep 2009 16:23:02 -0000 1.9 *************** *** 122,126 **** <module name="MethodLength"> <property name="tokens" value="CTOR_DEF"/> ! <property name="max" value="200"/> </module> <module name="FileLength"> --- 122,126 ---- <module name="MethodLength"> <property name="tokens" value="CTOR_DEF"/> ! <property name="max" value="300"/> </module> <module name="FileLength"> |
From: Michael L. <he...@us...> - 2009-09-14 16:23:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20840/src/net/sourceforge/bprocessor/gl/view Modified Files: ViewToolbarFactory.java View.java Display.java Log Message: Brunata Index: ViewToolbarFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewToolbarFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ViewToolbarFactory.java 18 Nov 2007 21:30:16 -0000 1.7 --- ViewToolbarFactory.java 14 Sep 2009 16:22:59 -0000 1.8 *************** *** 15,18 **** --- 15,19 ---- import javax.swing.ButtonGroup; import javax.swing.ImageIcon; + import javax.swing.JComponent; import javax.swing.JToggleButton; *************** *** 24,27 **** --- 25,67 ---- */ public class ViewToolbarFactory { + + private static ViewToolbarFactory instance; + + private JComponent s1; + private JToggleButton shading; + private JToggleButton solid; + private JToggleButton wireframe; + + private JComponent s2; + private JToggleButton noraster; + private JToggleButton grid; + private JToggleButton edges; + + /** + * + * @return me + */ + public static ViewToolbarFactory instance() { + if (instance == null) { + instance = new ViewToolbarFactory(); + } + return instance; + } + + /** + * + */ + public void setup() { + Toolbar toolbar = Toolbar.getInstance(); + toolbar.addButton(s1); + toolbar.addButton(shading); + toolbar.addButton(solid); + toolbar.addButton(wireframe); + toolbar.addButton(s2); + toolbar.addButton(noraster); + toolbar.addButton(grid); + toolbar.addButton(edges); + } + /** * Registers the buttons in the toolbar *************** *** 30,67 **** public void registerToolbar(Editor editor) { Toolbar tb = Toolbar.getInstance(); - tb.addSeparator(5); ButtonGroup bg = new ButtonGroup(); ! JToggleButton but = tb.registerAction(new ViewLighting(editor)); ! bg.add(but); ! but.setToolTipText("Shading"); ! but.setMnemonic(KeyEvent.VK_F5); ! but.setSelected(true); ! but = tb.registerAction(new ViewSolid(editor)); ! bg.add(but); ! but.setToolTipText("Solid"); ! but.setMnemonic(KeyEvent.VK_F7); ! but = tb.registerAction(new ViewWireframe(editor)); ! bg.add(but); ! but.setToolTipText("Wireframe"); ! but.setMnemonic(KeyEvent.VK_F8); ! tb.addSeparator(5); ! but = tb.registerAction(new ViewNoRaster(editor)); ! but.setSelected(true); ! but.setToolTipText("Shading no raster"); ! but.setMnemonic(KeyEvent.VK_F6); ! but = tb.registerAction(new ViewGrid(editor)); ! but.setToolTipText("Grid"); ! but.setSelected(true); ! but = tb.registerAction(new ViewEdges(editor)); ! but.setToolTipText("Edges"); ! but.setSelected(true); } --- 70,107 ---- public void registerToolbar(Editor editor) { Toolbar tb = Toolbar.getInstance(); ButtonGroup bg = new ButtonGroup(); ! s1 = tb.addSeparator(5); ! shading = tb.registerAction(new ViewLighting(editor)); ! bg.add(shading); ! shading.setToolTipText("Shading"); ! shading.setMnemonic(KeyEvent.VK_F5); ! shading.setSelected(true); ! solid = tb.registerAction(new ViewSolid(editor)); ! bg.add(solid); ! solid.setToolTipText("Solid"); ! solid.setMnemonic(KeyEvent.VK_F7); ! wireframe = tb.registerAction(new ViewWireframe(editor)); ! bg.add(wireframe); ! wireframe.setToolTipText("Wireframe"); ! wireframe.setMnemonic(KeyEvent.VK_F8); ! s2 = tb.addSeparator(5); ! noraster = tb.registerAction(new ViewNoRaster(editor)); ! noraster.setSelected(true); ! noraster.setToolTipText("Shading no raster"); ! noraster.setMnemonic(KeyEvent.VK_F6); ! grid = tb.registerAction(new ViewGrid(editor)); ! grid.setToolTipText("Grid"); ! grid.setSelected(true); ! edges = tb.registerAction(new ViewEdges(editor)); ! edges.setToolTipText("Edges"); ! edges.setSelected(true); } Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** Display.java 9 Sep 2009 10:31:03 -0000 1.96 --- Display.java 14 Sep 2009 16:22:59 -0000 1.97 *************** *** 875,879 **** ! private static boolean transparent(Surface surface) { Space front = surface.getFrontDomain(); Space back = surface.getBackDomain(); --- 875,884 ---- ! /** ! * ! * @param surface Surface ! * @return true if transparent ! */ ! public static boolean transparent(Surface surface) { Space front = surface.getFrontDomain(); Space back = surface.getBackDomain(); Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.290 retrieving revision 1.291 diff -C2 -d -r1.290 -r1.291 *** View.java 25 Jun 2009 22:17:40 -0000 1.290 --- View.java 14 Sep 2009 16:22:59 -0000 1.291 *************** *** 35,38 **** --- 35,39 ---- import java.util.ArrayList; + import java.util.Date; import java.util.HashSet; import java.util.Iterator; *************** *** 765,768 **** --- 766,773 ---- drawSpacePath(hitdetection); + + if (Editor.getViewing()) { + drawDate(); + } for (Widget widget : widgets) { *************** *** 1012,1015 **** --- 1017,1032 ---- /** + * + */ + public void drawDate() { + Date date = Project.getInstance().getDate(); + if (date != null) { + String string = date.toString(); + gl.glColor3d(0.1, 0.1, 0.1); + drawString(13, 13, 1, string); + } + } + + /** * Draw string at specified position * @param x The x position *************** *** 1866,1869 **** --- 1883,1954 ---- return selection; } + + /** + * + * @param x x + * @param y y + * @return surface + */ + public Surface getSelectedSurface(double x, double y) { + this.x = x; + this.y = y; + + picking = 10; + + editor.repaint(true); + + { + int bufferOffset = 0; + int names = 0; + long zMax = 0xFFFFFFFFL; + double nearestSurface = 1.0; + SelectionPath surface = null; + + for (int i = 0; i < hits; i++) { + names = selectBuffer.get(bufferOffset); + if (names > 0) { + long z1 = 0xFFFFFFFFL & selectBuffer.get(bufferOffset + 1); + long z2 = 0xFFFFFFFFL & selectBuffer.get(bufferOffset + 2); + double near = (double) z1 / (double) zMax; + double far = (double) z2 / (double) zMax; + near = (near + far) / 2; + bufferOffset += 2; + SelectionPath currentPath = new SelectionPath(); + if (names > 1) { + for (int namesIndex = 1; namesIndex < names; namesIndex++) { + Instance instance = (Instance)getObject(selectBuffer.get(bufferOffset + namesIndex)); + currentPath.addGeometricToPath(instance); + } + if (currentPath == null) { + bufferOffset += names + 1; + continue; + } + } + int id = selectBuffer.get(bufferOffset + names); + bufferOffset += names + 1; + Object current = getObject(id); + + if (current instanceof Surface) { + Surface it = (Surface) current; + if (!Display.transparent(it)) { + if (near < nearestSurface) { + nearestSurface = near; + currentPath.addGeometricToPath((Surface) current); + surface = currentPath; + } + } + } + } else { + bufferOffset += 3; + } + } + clearNames(); + if (surface != null) { + return ((Surface)surface.getLastInPath()); + } else { + return null; + } + } + } /** |
From: Michael L. <he...@us...> - 2009-09-14 16:23:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20840/src/net/sourceforge/bprocessor/gl Modified Files: Editor.java Log Message: Brunata Index: Editor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Editor.java 25 May 2009 12:00:40 -0000 1.14 --- Editor.java 14 Sep 2009 16:22:59 -0000 1.15 *************** *** 67,70 **** --- 67,72 ---- */ private static boolean multi = true; + + private static boolean viewing = false; /** GL canvas */ *************** *** 109,112 **** --- 111,130 ---- } + /** + * + * @param value boolean + */ + public static void setViewing(boolean value) { + viewing = value; + } + + /** + * + * @return viewing + */ + public static boolean getViewing() { + return viewing; + } + private void setControlPanel(JComponent panel) { if (controlpanel != null) { *************** *** 252,256 **** view = new View(this); ! (new ViewToolbarFactory()).registerToolbar(this); glc.addGLEventListener(view); GUI.getInstance().incrementPB(); --- 270,276 ---- view = new View(this); ! ViewToolbarFactory.instance().registerToolbar(this); ! ViewToolbarFactory.instance().setup(); ! glc.addGLEventListener(view); GUI.getInstance().incrementPB(); |
From: Michael L. <he...@us...> - 2009-09-14 16:23:08
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20840/src/gfx Added Files: modellingicon.gif backwardicon.gif viewingicon.gif forwardicon.gif Log Message: Brunata --- NEW FILE: backwardicon.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: forwardicon.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: viewingicon.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: modellingicon.gif --- (This appears to be a binary file; contents omitted.) |
From: Michael L. <he...@us...> - 2009-09-14 16:23:07
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20821/src/net/sourceforge/bprocessor/model/sense Added Files: package.html SensorItem.java DataReader.java Log Message: Brunata --- NEW FILE: package.html --- <body> Defines the package that contains the model </body> --- NEW FILE: DataReader.java --- //--------------------------------------------------------------------------------- // $Id: DataReader.java,v 1.1 2009/09/14 16:22:55 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.sense; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.LinkedList; import java.util.List; /** * */ public class DataReader { /** * * @param string String * @return date * @throws ParseException exception */ public Date parseDate(String string) throws ParseException { DateFormat format = new SimpleDateFormat("d/M/yy H:mm"); Date date = format.parse(string); return date; } /** * * @param string String * @return SensorItem * @throws ParseException exception */ public SensorItem parse(String string) throws ParseException { String[] values = string.split(","); Date date = parseDate(values[1]); String id = values[5]; double temperature = Double.valueOf(values[6]); double humidity = Double.valueOf(values[7]); return new SensorItem(id, date.getTime(), temperature, humidity); } /** * * @param file File * @return list of SensorItem * @throws IOException exception * @throws ParseException exception */ public List<SensorItem> read(File file) throws IOException, ParseException { List<SensorItem> items = new LinkedList(); InputStream input = new FileInputStream(file); BufferedReader reader = new BufferedReader(new InputStreamReader(input)); String line = reader.readLine(); // SKIP first line line = reader.readLine(); while (line != null) { SensorItem item = parse(line); System.out.println(item); items.add(item); line = reader.readLine(); } return items; } } --- NEW FILE: SensorItem.java --- //--------------------------------------------------------------------------------- // $Id: SensorItem.java,v 1.1 2009/09/14 16:22:55 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.sense; import java.text.DecimalFormat; import java.util.Date; /** * */ public class SensorItem { private String id; private long time; private double temperature; private double humidity; /** * * @param id id * @param time time * @param temperature temperature * @param humidity humidity */ public SensorItem(String id, long time, double temperature, double humidity) { this.id = id; this.time = time; this.temperature = temperature; this.humidity = humidity; } /** * * @return date */ public Date date() { return new Date(time); } /** * * @return id */ public String id() { return id; } /** * * @return temperature */ public double temperature() { return temperature; } /** * * @return humidity */ public double humimdity() { return humidity; } /** * {@inheritDoc} */ public String toString() { Date date = new Date(time); DecimalFormat format = new DecimalFormat("0.000"); return "{" + id + " | " + date + " | " + format.format(temperature) + "C | " + format.format(humidity) + "%" + "}"; } } |
From: Michael L. <he...@us...> - 2009-09-14 16:23:07
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20807/src/net/sourceforge/bprocessor/gui Modified Files: Toolbar.java GUI.java Log Message: Brunata Index: Toolbar.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/Toolbar.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Toolbar.java 25 Jun 2009 20:29:36 -0000 1.9 --- Toolbar.java 14 Sep 2009 16:22:52 -0000 1.10 *************** *** 8,13 **** --- 8,18 ---- import java.awt.Dimension; + import java.awt.event.MouseEvent; + import java.awt.event.MouseListener; + import java.util.LinkedList; + import java.util.List; import javax.swing.Action; + import javax.swing.JComponent; import javax.swing.JToggleButton; import javax.swing.JPanel; *************** *** 25,28 **** --- 30,35 ---- /** The toolbar bar */ private JToolBar toolBar; + + private List<JComponent> content; /** *************** *** 33,36 **** --- 40,44 ---- toolBar = new JToolBar(); add(toolBar); + content = new LinkedList(); } *************** *** 52,61 **** */ public JToggleButton registerAction(Action action) { ! JToggleButton tb = new JToggleButton(action); ! toolBar.add(tb); ! return tb; } /** * Register a toolbar action, with a push button. * @param action The action --- 60,107 ---- */ public JToggleButton registerAction(Action action) { ! JToggleButton button = new JToggleButton(action); ! ! for (MouseListener current : button.getMouseListeners()) { ! button.removeMouseListener(current); ! } ! button.addMouseListener(new MouseListener() { ! public void mouseClicked(MouseEvent arg0) { ! } ! public void mouseEntered(MouseEvent arg0) { ! } ! public void mouseExited(MouseEvent arg0) { ! } ! public void mousePressed(MouseEvent event) { ! JToggleButton button = (JToggleButton) event.getComponent(); ! button.doClick(); ! } ! public void mouseReleased(MouseEvent arg0) { ! } ! }); ! return button; } /** + * + * @param component JComponent + */ + public void addButton(JComponent component) { + toolBar.add(component); + content.add(component); + } + + /** + * + */ + public void clear() { + for (JComponent current : content) { + toolBar.remove(current); + } + content.clear(); + } + + + + /** * Register a toolbar action, with a push button. * @param action The action *************** *** 66,70 **** JButton tb = new JButton(action); tb.setToolTipText(tooltip); - toolBar.add(tb); return tb; } --- 112,115 ---- *************** *** 73,79 **** * Add a separator to the toolbar * @param size size */ ! public void addSeparator(int size) { ! toolBar.addSeparator(new Dimension(size, 0)); } } --- 118,126 ---- * Add a separator to the toolbar * @param size size + * @return component */ ! public JComponent addSeparator(int size) { ! JToolBar.Separator s = new JToolBar.Separator(new Dimension(size, 0)); ! return s; } } Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** GUI.java 25 Jun 2009 23:28:46 -0000 1.112 --- GUI.java 14 Sep 2009 16:22:52 -0000 1.113 *************** *** 32,37 **** --- 32,41 ---- import net.sourceforge.bprocessor.model.Item; import net.sourceforge.bprocessor.model.modellor.Modellor; + import net.sourceforge.bprocessor.model.sense.DataReader; + import net.sourceforge.bprocessor.model.sense.SensorItem; + import java.text.ParseException; import java.util.Collection; + import java.util.List; import java.util.Set; import java.util.HashSet; *************** *** 51,54 **** --- 55,59 ---- import java.io.FileNotFoundException; import java.io.FileOutputStream; + import java.io.IOException; import java.io.OutputStream; *************** *** 515,522 **** saveDBK.setEnabled(true); file.add(saveDBK); file.addSeparator(); ! JMenuItem fileImport = new JMenuItem("Import"); fileImport.addActionListener(new FileImportActionListener()); fileImport.setMnemonic(KeyEvent.VK_I); --- 520,551 ---- saveDBK.setEnabled(true); file.add(saveDBK); + file.addSeparator(); + + { + JMenuItem item = new JMenuItem("Import Data..."); + item.addActionListener(new AbstractAction() { + public void actionPerformed(ActionEvent e) { + JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); + int state = chooser.showOpenDialog(null); + File file = chooser.getSelectedFile(); + DataReader reader = new DataReader(); + try { + List<SensorItem> data = reader.read(file); + Project.getInstance().setMeasures(data); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + file.add(item); + } file.addSeparator(); ! JMenuItem fileImport = new JMenuItem("Import..."); fileImport.addActionListener(new FileImportActionListener()); fileImport.setMnemonic(KeyEvent.VK_I); *************** *** 530,533 **** --- 559,564 ---- file.add(fileExport); + + JMenuItem jlmaExport = new JMenuItem("Export JLMA"); jlmaExport.addActionListener(new ActionListener() { |
From: Michael L. <he...@us...> - 2009-09-14 16:23:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20840/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceSelectTool.java ToolFactory.java Log Message: Brunata Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** ToolFactory.java 19 Jun 2009 13:32:29 -0000 1.105 --- ToolFactory.java 14 Sep 2009 16:22:59 -0000 1.106 *************** *** 9,12 **** --- 9,13 ---- import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.gl.view.ViewToolbarFactory; import net.sourceforge.bprocessor.gui.Toolbar; *************** *** 26,31 **** import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; - import java.awt.event.MouseEvent; - import java.awt.event.MouseListener; import javax.swing.AbstractAction; --- 27,30 ---- *************** *** 33,36 **** --- 32,36 ---- import javax.swing.ImageIcon; + import javax.swing.JComponent; import javax.swing.JToggleButton; import javax.swing.ButtonGroup; *************** *** 44,47 **** --- 44,51 ---- /** The logger */ private static Logger log = Logger.getLogger(ToolFactory.class); + + private List<JComponent> modellingset; + + private List<JComponent> viewingset; /** glv */ *************** *** 57,61 **** private ButtonGroup group; - /** The factory */ private static ToolFactory factory; --- 61,64 ---- *************** *** 93,96 **** --- 96,100 ---- protected static Cursor errorCursor; + /** * Constructor *************** *** 98,101 **** --- 102,107 ---- */ private ToolFactory(Editor editor) { + modellingset = new LinkedList(); + viewingset = new LinkedList(); tools = new HashMap(); buttons = new HashMap(); *************** *** 104,107 **** --- 110,116 ---- ClassLoader cl = Thread.currentThread().getContextClassLoader(); + + + URL url = cl.getResource("Bcursorpen1.gif"); Image pencilimage = Toolkit.getDefaultToolkit().getImage(url); *************** *** 152,207 **** pan = new PanTool(editor, panCursor); zoom = new ZoomTool(editor, zoomCursor); - Toolbar tb = Toolbar.getInstance(); ! registerTool(Tool.SPACE_SELECT, spaceselect, "Biconselecttool2.gif", "Sensor Select"); ! registerTool(Tool.SELECT_TOOL, select, "Biconselecttool.gif", "Select"); ! registerTool(Tool.ASSIGN_TOOL, assign, "assign-icon-3.png", "Assign"); ! tb.addSeparator(10); ! registerTool(Tool.PENCIL_TOOL, pencil, "pen-icon.png", "Pencil"); ! registerTool(Tool.ERASER_TOOL, eraser, "eraser-icon.png", "Eraser"); ! tb.addSeparator(2); ! registerTool(Tool.TAPE_MEASURE_TOOL, ruler, "ruler-icon.png", "Ruler"); ! registerTool(Tool.PROTRACTOR_TOOL, protractor, "protractor-icon.png", "Protractor"); ! tb.addSeparator(2); ! registerTool(Tool.FINAL_MOVE_TOOL, moving, "Biconmovetool.gif", "Move"); ! registerTool(Tool.ROTATION_TOOL, rotation, "rotation-icon.png", "Rotate"); ! tb.addSeparator(2); ! registerTool(Tool.OFFSET_TOOL, offset, "offset-icon.png", "Offset"); ! registerTool(Tool.EXTRUSION_TOOL, extrude, "Biconextrudetool.gif", "Extrude"); ! tb.addSeparator(10); ! registerTool(Tool.ALT_RECT_TOOL, rectangle, "Biconaltrect.gif", "Rectangle"); ! registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc"); ! tb.addSeparator(2); ! registerTool(Tool.EXTEND_TOOL, extend, "Biconextrudetool2.gif", "Extend"); ! tb.addSeparator(10); ! registerTool(Tool.CONSTRUCTOR_TOOL, constructor, "constructor-icon.png", "Constructor"); ! registerTool(Tool.RELATION_TOOL, relation, "chaintool.gif", "Relate"); ! tb.addSeparator(10); ! registerTool(Tool.FOCUS_TOOL, focus, "Biconzomeselect.gif", "Focus"); ! registerTool(Tool.CLIP_TOOL, clipplane, "Bclip.gif", "Section"); ! tb.addSeparator(10); ! registerTool(Tool.CAMERA_TOOL, orbit, "Biconrotcam.png", "Orbit"); ! registerTool(Tool.PAN_TOOL, pan, "Bicondrag.gif", "Pan"); ! registerTool(Tool.ZOOM_TOOL, zoom, "Biconzomeinout.gif", "Zoom"); ! tb.addSeparator(10); Action orthoAction = new ToolAction(editor, 0, "Borto.gif") { --- 161,219 ---- pan = new PanTool(editor, panCursor); zoom = new ZoomTool(editor, zoomCursor); ! viewingset.add(registerTool(Tool.SPACE_SELECT, spaceselect, ! "Biconselecttool2.gif", "Sensor Select")); ! modellingset.add(registerTool(Tool.SELECT_TOOL, select, "Biconselecttool.gif", "Select")); ! modellingset.add(registerTool(Tool.ASSIGN_TOOL, assign, "assign-icon-3.png", "Assign")); ! modellingset.add(addSeparator(10)); ! modellingset.add(registerTool(Tool.PENCIL_TOOL, pencil, "pen-icon.png", "Pencil")); ! modellingset.add(registerTool(Tool.ERASER_TOOL, eraser, "eraser-icon.png", "Eraser")); ! modellingset.add(addSeparator(2)); ! modellingset.add(registerTool(Tool.TAPE_MEASURE_TOOL, ruler, "ruler-icon.png", "Ruler")); ! modellingset.add(registerTool(Tool.PROTRACTOR_TOOL, protractor, ! "protractor-icon.png", "Protractor")); ! modellingset.add(addSeparator(2)); ! modellingset.add(registerTool(Tool.FINAL_MOVE_TOOL, moving, "Biconmovetool.gif", "Move")); ! modellingset.add(registerTool(Tool.ROTATION_TOOL, rotation, "rotation-icon.png", "Rotate")); ! modellingset.add(addSeparator(2)); ! modellingset.add(registerTool(Tool.OFFSET_TOOL, offset, "offset-icon.png", "Offset")); ! modellingset.add(registerTool(Tool.EXTRUSION_TOOL, extrude, "Biconextrudetool.gif", "Extrude")); ! modellingset.add(addSeparator(10)); ! modellingset.add(registerTool(Tool.ALT_RECT_TOOL, rectangle, "Biconaltrect.gif", "Rectangle")); ! modellingset.add(registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc")); ! modellingset.add(addSeparator(2)); ! ! modellingset.add(registerTool(Tool.EXTEND_TOOL, extend, "Biconextrudetool2.gif", "Extend")); ! modellingset.add(addSeparator(10)); ! modellingset.add(registerTool(Tool.CONSTRUCTOR_TOOL, constructor, ! "constructor-icon.png", "Constructor")); ! modellingset.add(registerTool(Tool.RELATION_TOOL, relation, "chaintool.gif", "Relate")); ! modellingset.add(addSeparator(10)); ! modellingset.add(registerTool(Tool.FOCUS_TOOL, focus, "Biconzomeselect.gif", "Focus")); ! modellingset.add(registerTool(Tool.CLIP_TOOL, clipplane, "Bclip.gif", "Section")); ! modellingset.add(addSeparator(10)); ! modellingset.add(registerTool(Tool.CAMERA_TOOL, orbit, "Biconrotcam.png", "Orbit")); ! modellingset.add(registerTool(Tool.PAN_TOOL, pan, "Bicondrag.gif", "Pan")); ! modellingset.add(registerTool(Tool.ZOOM_TOOL, zoom, "Biconzomeinout.gif", "Zoom")); ! modellingset.add(addSeparator(10)); Action orthoAction = new ToolAction(editor, 0, "Borto.gif") { *************** *** 238,242 **** } }; ! Toolbar.getInstance().registerPushButtonAction(topAction, "Top"); Action zoomAction = new ToolAction(editor, 0, "Biconzomeall.gif") { public void actionPerformed(ActionEvent agr0) { --- 250,254 ---- } }; ! modellingset.add(Toolbar.getInstance().registerPushButtonAction(topAction, "Top")); Action zoomAction = new ToolAction(editor, 0, "Biconzomeall.gif") { public void actionPerformed(ActionEvent agr0) { *************** *** 254,261 **** } }; ! Toolbar.getInstance().registerPushButtonAction(zoomAction, "Zoom All"); ! tb.addSeparator(10); ButtonGroup viewGroup = new ButtonGroup(); JToggleButton perspBut = Toolbar.getInstance().registerAction(perspAction); --- 266,273 ---- } }; ! modellingset.add(Toolbar.getInstance().registerPushButtonAction(zoomAction, "Zoom All")); ! modellingset.add(addSeparator(10)); ButtonGroup viewGroup = new ButtonGroup(); JToggleButton perspBut = Toolbar.getInstance().registerAction(perspAction); *************** *** 263,273 **** --- 275,368 ---- perspBut.setMnemonic(KeyEvent.VK_P); viewGroup.add(perspBut); + modellingset.add(perspBut); JToggleButton orthoBut = Toolbar.getInstance().registerAction(orthoAction); orthoBut.setToolTipText("Orthographic"); orthoBut.setMnemonic(KeyEvent.VK_O); viewGroup.add(orthoBut); + modellingset.add(orthoBut); perspBut.setSelected(true); + + { + { + Action action = new ToolAction(editor, 0, "backwardicon.gif") { + public void actionPerformed(ActionEvent arg0) { + Project.getInstance().backward(); + } + }; + viewingset.add(Toolbar.getInstance().registerPushButtonAction(action, "Back")); + } + + { + Action action = new ToolAction(editor, 0, "forwardicon.gif") { + public void actionPerformed(ActionEvent arg0) { + Project.getInstance().forward(); + } + }; + viewingset.add(Toolbar.getInstance().registerPushButtonAction(action, "Forward")); + } + } + + { + ButtonGroup group = new ButtonGroup(); + JToggleButton modelling; + JToggleButton viewing; + { + Action action = new ToolAction(editor, 0, "modellingicon.gif") { + public void actionPerformed(ActionEvent event) { + modelling(); + } + }; + modelling = Toolbar.getInstance().registerAction(action); + group.add(modelling); + modellingset.add(modelling); + viewingset.add(modelling); + } + { + Action action = new ToolAction(editor, 0, "viewingicon.gif") { + public void actionPerformed(ActionEvent event) { + viewing(); + } + }; + viewing = Toolbar.getInstance().registerAction(action); + group.add(viewing); + modellingset.add(viewing); + viewingset.add(viewing); + } + modelling.setSelected(true); + } + + setup(); + } + + private void modelling() { + Toolbar toolbar = Toolbar.getInstance(); + toolbar.clear(); + for (JComponent current : modellingset) { + toolbar.addButton(current); + } + ViewToolbarFactory.instance().setup(); + Editor.setViewing(false); + } + + private void viewing() { + Toolbar toolbar = Toolbar.getInstance(); + toolbar.clear(); + for (JComponent current : viewingset) { + toolbar.addButton(current); + } + ViewToolbarFactory.instance().setup(); + Editor.setViewing(true); } + + private void setup() { + Toolbar toolbar = Toolbar.getInstance(); + for (JComponent current : modellingset) { + toolbar.addButton(current); + } + } + + + /** * Get the factory *************** *** 317,356 **** ToolAction action = new ToolAction(editor, key, iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); - for (MouseListener current : button.getMouseListeners()) { - button.removeMouseListener(current); - } - button.addMouseListener(new MouseListener() { - - public void mouseClicked(MouseEvent arg0) { - // TODO Auto-generated method stub - - } - - public void mouseEntered(MouseEvent arg0) { - // TODO Auto-generated method stub - - } - - public void mouseExited(MouseEvent arg0) { - // TODO Auto-generated method stub - - } - - public void mousePressed(MouseEvent event) { - JToggleButton button = (JToggleButton) event.getComponent(); - button.doClick(); - } - - public void mouseReleased(MouseEvent arg0) { - // TODO Auto-generated method stub - - } - - }); button.setToolTipText(tooltip); group.add(button); buttons.put(tool, button); return button; ! } /** --- 412,430 ---- ToolAction action = new ToolAction(editor, key, iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); button.setToolTipText(tooltip); group.add(button); buttons.put(tool, button); return button; ! } ! ! /** ! * ! * @param size int ! * @return component ! */ ! public JComponent addSeparator(int size) { ! JComponent sep = Toolbar.getInstance().addSeparator(size); ! return sep; ! } /** Index: SpaceSelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceSelectTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SpaceSelectTool.java 25 Jun 2009 23:28:49 -0000 1.4 --- SpaceSelectTool.java 14 Sep 2009 16:22:59 -0000 1.5 *************** *** 53,61 **** */ protected void pressed(MouseEvent e) { - boolean done = false; if (e.getButton() == MouseEvent.BUTTON1) { ! findTarget(e); ! if (target instanceof Surface) { ! Surface surface = (Surface) target; Space front = surface.getFrontDomain(); Space back = surface.getBackDomain(); --- 53,63 ---- */ protected void pressed(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { ! ! double x = e.getX(); ! double y = e.getY(); ! ! Surface surface = editor.getView().getSelectedSurface(x, y); ! if (surface != null) { Space front = surface.getFrontDomain(); Space back = surface.getBackDomain(); *************** *** 68,71 **** --- 70,75 ---- Selection.primary().clear(); } + } else { + Selection.primary().clear(); } } |
From: Michael L. <he...@us...> - 2009-09-14 16:23:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20821/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Brunata Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.181 retrieving revision 1.182 diff -C2 -d -r1.181 -r1.182 *** Project.java 28 Aug 2009 12:58:46 -0000 1.181 --- Project.java 14 Sep 2009 16:22:55 -0000 1.182 *************** *** 22,27 **** --- 22,29 ---- import java.net.Socket; import java.net.SocketAddress; + import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Collection; + import java.util.Date; import java.util.HashMap; import java.util.HashSet; *************** *** 47,50 **** --- 49,53 ---- import net.sourceforge.bprocessor.model.modellor.Modellor; import net.sourceforge.bprocessor.model.modellor.TileModellor; + import net.sourceforge.bprocessor.model.sense.SensorItem; import net.sourceforge.bprocessor.model.xml.Bmodel; *************** *** 81,84 **** --- 84,90 ---- private Tesselator tesselator; + private List<SensorItem> measures; + private int index; + /** The observers */ private List<Observer> observers; *************** *** 163,166 **** --- 169,290 ---- private List<Component> catalog; + + + /** + * + * @param data data + */ + public void setMeasures(List<SensorItem> data) { + measures = data; + index = 0; + } + + + private Space findIn(Item item, String name) { + if (item instanceof Space) { + Space space = (Space) item; + if (space.getName().equals(name)) { + return space; + } else { + for (Item current : space.getElements()) { + Space result = findIn(current, name); + if (result != null) { + return result; + } + } + } + } + return null; + } + + /** + * + * @param name String + * @return space + */ + public Space find(String name) { + return findIn(world, name); + } + + /** + * + * @param name name + * @return material + */ + public Material findMaterial(String name) { + for (Material current : getMaterials()) { + if (current.getName().equals(name)) { + return current; + } + } + return null; + } + + /** + * + */ + public void updateSensorData() { + if (measures != null) { + if (index < measures.size()) { + SensorItem data = measures.get(index); + if (data != null) { + String name = "Sensor - " + data.id(); + Space sensor = find(name); + if (sensor != null) { + DecimalFormat format = new DecimalFormat("0.000"); + String t = format.format(data.temperature()); + String h = format.format(data.humimdity()); + + String info = "Temperatur: " + t + " C\n" + "Relativ luftfugtighed: " + h + "ä\n"; + sensor.setDescription(info); + + if (data.temperature() < 18 && data.humimdity() > 70) { + sensor.setMaterial(findMaterial("Red")); + } else { + sensor.setMaterial(findMaterial("Green")); + } + changed(sensor); + } + } + } + } + } + + /** + * + */ + public void forward() { + if (measures != null) { + if ((index + 1) < measures.size()) { + index++; + updateSensorData(); + } + } + } + + /** + * + */ + public void backward() { + if (measures != null) { + if (index > 0) { + index--; + updateSensorData(); + } + } + } + + /** + * + * @return date + */ + public Date getDate() { + if (measures != null) { + SensorItem item = measures.get(index); + return item.date(); + } + return null; + } + /** * |
From: Michael L. <he...@us...> - 2009-09-14 16:22:56
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20750/src/net/sourceforge/bprocessor/model/sense Log Message: Directory /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense added to the repository |
From: Michael L. <he...@us...> - 2009-09-09 12:51:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4395/src/net/sourceforge/bprocessor/model Modified Files: Grid.java Command.java ParameterBlock.java Log Message: rounding of numbers Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** Command.java 25 Jun 2009 22:17:30 -0000 1.79 --- Command.java 9 Sep 2009 12:51:32 -0000 1.80 *************** *** 859,863 **** public Split(Edge edge) { parameters.put(new Attribute("edge", edge)); ! parameters.putDouble("n", 2); } /** --- 859,863 ---- public Split(Edge edge) { parameters.put(new Attribute("edge", edge)); ! parameters.putInteger("n", 2); } /** *************** *** 873,877 **** public void evaluate() { Edge edge = (Edge) parameters.get("edge"); ! int n = (int) parameters.getDouble("n"); Vertex from = edge.from; Vertex to = edge.to; --- 873,877 ---- public void evaluate() { Edge edge = (Edge) parameters.get("edge"); ! int n = (int) parameters.getInteger("n"); Vertex from = edge.from; Vertex to = edge.to; Index: ParameterBlock.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ParameterBlock.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ParameterBlock.java 20 Feb 2008 15:20:23 -0000 1.17 --- ParameterBlock.java 9 Sep 2009 12:51:32 -0000 1.18 *************** *** 56,59 **** --- 56,68 ---- /** + * + * @param key String + * @param value int + */ + public void putInteger(String key, int value) { + add(new Attribute(key, new Integer(value))); + } + + /** * Put * @param key String *************** *** 89,92 **** --- 98,115 ---- * * @param key String + * @return int + */ + public int getInteger(String key) { + for (Attribute current : parameters) { + if (current.getName().equals(key)) { + return ((Integer)(current.getValue())).intValue(); + } + } + return 0; + } + + /** + * + * @param key String * @return boolean value */ Index: Grid.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Grid.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Grid.java 9 Sep 2009 10:31:00 -0000 1.8 --- Grid.java 9 Sep 2009 12:51:32 -0000 1.9 *************** *** 119,123 **** Vertex v = system.getI(); Vertex u = system.getJ(); ! int n = (int) Math.floor((size / 2) / delta); Collection<Line> lines = new LinkedList(); --- 119,123 ---- Vertex v = system.getI(); Vertex u = system.getJ(); ! int n = (int) Math.round((size / 2) / delta); Collection<Line> lines = new LinkedList(); *************** *** 173,178 **** double h = getHeight(); double d = getDistance(); ! int n = (int) Math.floor((w + d) / d); ! int m = (int) Math.floor((h + d) / d); Vertex from = origin.copy(); for (int k = 0; k < n; k++) { --- 173,178 ---- double h = getHeight(); double d = getDistance(); ! int n = (int) Math.round((w + d) / d); ! int m = (int) Math.round((h + d) / d); Vertex from = origin.copy(); for (int k = 0; k < n; k++) { |
From: Michael L. <he...@us...> - 2009-09-09 12:51:45
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4418/src/net/sourceforge/bprocessor/gui/attrview Modified Files: StringAttribute.java GenericPanel.java Log Message: rounding of numbers Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** StringAttribute.java 26 Nov 2007 10:51:04 -0000 1.19 --- StringAttribute.java 9 Sep 2009 12:51:35 -0000 1.20 *************** *** 15,18 **** --- 15,19 ---- import java.io.Reader; import java.io.StringReader; + import java.text.DecimalFormat; import java.util.HashMap; import java.util.Iterator; *************** *** 170,173 **** --- 171,187 ---- } + protected String valueOf(Object value) { + String s = ""; + if (value instanceof String) { + s = (String)value; + } else if (value instanceof Double) { + DecimalFormat format = new DecimalFormat("0.000"); + s = format.format(((Double) value).doubleValue()); + } else if (value instanceof Integer) { + s = String.valueOf((Integer) value); + } + return s; + } + /** * Create a value label *************** *** 176,187 **** */ private JComponent createValueLabel(Object value) { ! String s = ""; JLabel valueLabel; - if (value instanceof String) { - s = (String)value; - } else if (value instanceof Double) { - double rounded = round(((Double) value).doubleValue()); - s = Double.toString(rounded); - } valueLabel = new JLabel(s); if (attribute.isEditable()) { --- 190,195 ---- */ private JComponent createValueLabel(Object value) { ! String s = valueOf(value); JLabel valueLabel; valueLabel = new JLabel(s); if (attribute.isEditable()) { *************** *** 199,209 **** */ private JComponent createValueEditor(Object value) { ! String s = ""; ! if (value instanceof String) { ! s = (String)value; ! } else if (value instanceof Double) { ! double rounded = round(((Double) value).doubleValue()); ! s = Double.toString(rounded); ! } JTextField valueEditor = new JTextField(s); valueEditor.setFont(AttributeView.FONT_PLAIN); --- 207,211 ---- */ private JComponent createValueEditor(Object value) { ! String s = valueOf(value); JTextField valueEditor = new JTextField(s); valueEditor.setFont(AttributeView.FONT_PLAIN); *************** *** 253,257 **** try { Object val = attribute.getValue(); ! if (val instanceof String) { attribute.setValue(editor.getText()); } else if (val instanceof Double) { --- 255,261 ---- try { Object val = attribute.getValue(); ! if (val instanceof Integer) { ! attribute.setValue(Integer.valueOf(editor.getText())); ! } else if (val instanceof String) { attribute.setValue(editor.getText()); } else if (val instanceof Double) { Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** GenericPanel.java 28 Dec 2007 11:17:09 -0000 1.53 --- GenericPanel.java 9 Sep 2009 12:51:35 -0000 1.54 *************** *** 217,221 **** while (iter.hasNext()) { Attribute a = (Attribute)iter.next(); ! if (a.getValue() instanceof String || a.getValue() instanceof Double) { handleString(a, where); } else if (a.getValue() instanceof List) { --- 217,223 ---- while (iter.hasNext()) { Attribute a = (Attribute)iter.next(); ! if (a.getValue() instanceof String ! || a.getValue() instanceof Double ! || a.getValue() instanceof Integer) { handleString(a, where); } else if (a.getValue() instanceof List) { |
From: Michael L. <he...@us...> - 2009-09-09 10:31:15
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11582/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Grid drawing changed Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** AbstractPencil.java 25 Jun 2009 22:17:40 -0000 1.108 --- AbstractPencil.java 9 Sep 2009 10:31:03 -0000 1.109 *************** *** 265,269 **** } } ! } return intersection; } --- 265,272 ---- } } ! } ! ! // Round off ! intersection.roundIt(); return intersection; } *************** *** 594,602 **** if (cs.isEditable()) { if (hooverConstructor != null) { ! hooverConstructor.showPlane(false); } if (!cs.showPlane()) { hooverConstructor = (CoordinateSystem)p; ! hooverConstructor.showPlane(true); } } --- 597,605 ---- if (cs.isEditable()) { if (hooverConstructor != null) { ! //hooverConstructor.showPlane(false); } if (!cs.showPlane()) { hooverConstructor = (CoordinateSystem)p; ! //hooverConstructor.showPlane(true); } } *************** *** 810,814 **** hooverEdge = null; if (hooverConstructor != null) { ! hooverConstructor.showPlane(false); } hooverConstructor = null; --- 813,817 ---- hooverEdge = null; if (hooverConstructor != null) { ! //hooverConstructor.showPlane(false); } hooverConstructor = null; |
From: Michael L. <he...@us...> - 2009-09-09 10:31:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11521/src/net/sourceforge/bprocessor/model Modified Files: Grid.java Camera.java Space.java Persistence.java Log Message: Grid drawing changed Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Persistence.java 28 Aug 2009 12:58:46 -0000 1.82 --- Persistence.java 9 Sep 2009 10:31:00 -0000 1.83 *************** *** 577,581 **** res.setActive(xml.isActive()); res.setDistance(xml.getDistance()); ! res.setSize(xml.getSize()); res.setId(xml.getProgid()); mapper.put(xml.getId(), res); --- 577,581 ---- res.setActive(xml.isActive()); res.setDistance(xml.getDistance()); ! res.setWidth(xml.getSize()); res.setId(xml.getProgid()); mapper.put(xml.getId(), res); *************** *** 856,859 **** --- 856,860 ---- public static Bmodel externalize() { Bmodel document = new BmodelImpl(); + document.setUnits("meter"); counter = 1; HashMap mapper = new HashMap(); *************** *** 1268,1272 **** xml.setActive(grid.isActive()); xml.setDistance((float) grid.getDistance()); ! xml.setSize((float) grid.getSize()); xml.setVertex(externalizeVertex(grid.getOrigin(), new HashMap())); --- 1269,1273 ---- xml.setActive(grid.isActive()); xml.setDistance((float) grid.getDistance()); ! xml.setSize((float) grid.getWidth()); xml.setVertex(externalizeVertex(grid.getOrigin(), new HashMap())); Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.243 retrieving revision 1.244 diff -C2 -d -r1.243 -r1.244 *** Space.java 30 Jun 2009 11:34:45 -0000 1.243 --- Space.java 9 Sep 2009 10:31:00 -0000 1.244 *************** *** 1738,1740 **** --- 1738,1761 ---- } } + + private boolean verify(double value) { + double result = Math.round(value); + return value == result; + } + + private boolean verify(Vertex v) { + return verify(v.x) && verify(v.y) && verify(v.z); + } + + /** + * + */ + public void verify() { + Collection<Vertex> vertices = collect(); + for (Vertex current : vertices) { + if (!verify(current)) { + System.out.println(current + " imprecise"); + } + } + } } Index: Grid.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Grid.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Grid.java 26 May 2009 10:33:50 -0000 1.7 --- Grid.java 9 Sep 2009 10:31:00 -0000 1.8 *************** *** 15,19 **** */ public class Grid extends Constructor { ! private double size; private double distance; --- 15,20 ---- */ public class Grid extends Constructor { ! private double width; ! private double height; private double distance; *************** *** 24,29 **** public Grid() { super(new Vertex(0, 0, 0)); ! size = 40.0; ! distance = 1.0; } --- 25,31 ---- public Grid() { super(new Vertex(0, 0, 0)); ! distance = 2.4; ! width = 12 * distance; ! height = 8 * distance; } *************** *** 32,37 **** * @return size */ ! public double getSize() { ! return size; } --- 34,39 ---- * @return size */ ! public double getWidth() { ! return width; } *************** *** 40,47 **** * @param value new size */ ! public void setSize(double value) { ! size = value; } /** * --- 42,66 ---- * @param value new size */ ! public void setWidth(double value) { ! width = value; } + + /** + * Sets the height. + * @param value new value of height. + */ + public void setHeight(double value) { + height = value; + } + + /** + * Returns the height. + * @return the height. + */ + public double getHeight() { + return height; + } + /** * *************** *** 68,72 **** public List<Attribute> getAttributes() { LinkedList<Attribute> attributes = new LinkedList(); ! attributes.add(new Attribute("Size", new Double(size))); attributes.add(new Attribute("Distance", new Double(distance))); return attributes; --- 87,92 ---- public List<Attribute> getAttributes() { LinkedList<Attribute> attributes = new LinkedList(); ! attributes.add(new Attribute("Width", new Double(width))); ! attributes.add(new Attribute("Height", new Double(height))); attributes.add(new Attribute("Distance", new Double(distance))); return attributes; *************** *** 76,81 **** public void setAttributes(List<Attribute> attributes) { for (Attribute current : attributes) { ! if (current.getName().equals("Size")) { ! size = (Double)(current.getValue()); } else if (current.getName().equals("Distance")) { distance = (Double)(current.getValue()); --- 96,103 ---- public void setAttributes(List<Attribute> attributes) { for (Attribute current : attributes) { ! if (current.getName().equals("Width")) { ! width = (Double)(current.getValue()); ! } else if (current.getName().equals("Height")) { ! height = (Double)(current.getValue()); } else if (current.getName().equals("Distance")) { distance = (Double)(current.getValue()); *************** *** 91,95 **** public Collection<Line> lines() { ! double size = getSize(); double delta = getDistance(); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); --- 113,117 ---- public Collection<Line> lines() { ! double size = getWidth(); double delta = getDistance(); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); *************** *** 137,140 **** --- 159,197 ---- } + /** + * + * @param system CoordinateSystem + * @return grid lines + */ + public Collection<Edge> guides(CoordinateSystem system) { + Collection<Edge> guides = new LinkedList(); + Vertex origin = system.getOrigin(); + Vertex i = system.getI(); + Vertex j = system.getJ(); + { + double w = getWidth(); + double h = getHeight(); + double d = getDistance(); + int n = (int) Math.floor((w + d) / d); + int m = (int) Math.floor((h + d) / d); + Vertex from = origin.copy(); + for (int k = 0; k < n; k++) { + Vertex to = from.add(j.scale(h)); + Edge edge = new Edge(from, to); + guides.add(edge); + from = from.add(i.scale(d)); + } + from = origin.copy(); + for (int k = 0; k < m; k++) { + Vertex to = from.add(i.scale(w)); + Edge edge = new Edge(from, to); + guides.add(edge); + from = from.add(j.scale(d)); + } + } + return guides; + } + + /** {@inheritDoc} */ public String title() { Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Camera.java 25 Jun 2009 20:29:33 -0000 1.59 --- Camera.java 9 Sep 2009 10:31:00 -0000 1.60 *************** *** 142,173 **** this.setHiddenGeometrics(new HashSet(other.getHiddenGeometrics())); } - - /** - /** - * Create a default camera of your choice - * @param type the camera type - * @return a new camera - */ - public static Camera create(int type) { - Camera res = null; - if (type == VIEW_3D) { - res = new Camera("3D", new double[]{6, 3, 2}, - new double[]{7, -12, 16}, - new double[] {0, 0, 1}, PERSPECTIVE); - } else if (type == VIEW_XZ) { - res = new Camera("xz (ortho)", new double[]{0, 0, 0}, - new double[]{0, -20, 0}, - new double[] {0, 0, 1}, ORTHOGRAPHIC); - } else if (type == VIEW_XY) { - res = new Camera("xy (ortho)", new double[]{0, 0, 0}, - new double[]{0, 0, 20}, - new double[] {0, 1, 0}, ORTHOGRAPHIC); - } else if (type == VIEW_YZ) { - res = new Camera("yz (ortho)", new double[]{0, 0, 0}, - new double[]{20, 0, 0}, - new double[] {0, 0, 1}, ORTHOGRAPHIC); - } - return res; - } /** --- 142,145 ---- |
From: Michael L. <he...@us...> - 2009-09-09 10:31:12
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11582/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java PopupMenu.java Log Message: Grid drawing changed Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** Display.java 26 Jun 2009 15:39:13 -0000 1.95 --- Display.java 9 Sep 2009 10:31:03 -0000 1.96 *************** *** 719,723 **** private static void draw(Line line) { ! double size = (grid != null) ? grid.getSize() : 50; Edge edge = line.edge(size); --- 719,723 ---- private static void draw(Line line) { ! double size = (grid != null) ? grid.getWidth() : 50; Edge edge = line.edge(size); *************** *** 809,814 **** for (Constructor current : constructors) { if (!excluded.contains(current)) { ! double size = (grid != null) ? grid.getSize() / 2 : 50; ! Collection<Edge> guides = current.guides(size); selectEdges(guides); if (current instanceof CoordinateSystem) { --- 809,820 ---- for (Constructor current : constructors) { if (!excluded.contains(current)) { ! double size = (grid != null) ? grid.getWidth() / 2 : 50; ! Collection<Edge> guides = null; ! if (current instanceof Grid) { ! guides = ((Grid) current).guides(Project.getInstance().getActiveCoordinateSystem()); ! } else { ! guides = current.guides(size); ! } ! selectEdges(guides); if (current instanceof CoordinateSystem) { *************** *** 1310,1322 **** private static void draw(Grid grid) { ! gl.glColor3fv(grey, 0); gl.glLineWidth(1.0f); ! ! Collection<Edge> guides = grid.guides(grid.getSize() / 2); for (Edge edge : guides) { draw(edge); } } /** --- 1316,1345 ---- private static void draw(Grid grid) { ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); ! gl.glColor3fv(grey, 0); gl.glLineWidth(1.0f); ! drawCircle(system, 0.3); ! //Collection<Edge> guides = grid.guides(grid.getWidth() / 2); ! Collection<Edge> guides = grid.guides(system); for (Edge edge : guides) { draw(edge); } } + + private static void drawCircle(CoordinateSystem system, double radius) { + int n = 32; + gl.glBegin(GL.GL_LINE_LOOP); + for (int i = 0; i < n; i++) { + double angle = 2 * i * Math.PI / n; + double x = Math.cos(angle) * radius; + double y = Math.sin(angle) * radius; + Vertex v = new Vertex(x, y, 0); + v = system.unTranslate(v); + gl.glVertex3d(v.getX(), v.getY(), v.getZ()); + } + gl.glEnd(); + } + /** Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** PopupMenu.java 29 Jun 2009 10:57:48 -0000 1.36 --- PopupMenu.java 9 Sep 2009 10:31:03 -0000 1.37 *************** *** 443,446 **** --- 443,453 ---- } + AbstractAction item = new SpaceMenuAction(sp, "Consistency Check") { + public void actionPerformed(ActionEvent arg0) { + space.verify(); + } + }; + menu.add(item); + if (CHECKS) { AbstractAction check = new SpaceMenuAction(sp, "Consistency Check") { |
From: Michael L. <he...@us...> - 2009-09-09 10:31:12
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11582/src/net/sourceforge/bprocessor/gl/model Modified Files: Intersection.java Log Message: Grid drawing changed Index: Intersection.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/Intersection.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Intersection.java 26 Jun 2007 00:42:17 -0000 1.6 --- Intersection.java 9 Sep 2009 10:31:04 -0000 1.7 *************** *** 162,164 **** --- 162,170 ---- return vertex.equalEps(other.vertex()); } + + /** + * Round it + */ + public void roundIt() { + } } |
From: Michael L. <he...@us...> - 2009-09-09 10:31:10
|
Update of /cvsroot/bprocessor/model/src/etc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11521/src/etc Modified Files: bprocessor.xsd Log Message: Grid drawing changed Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** bprocessor.xsd 22 Jun 2009 12:39:16 -0000 1.44 --- bprocessor.xsd 9 Sep 2009 10:31:00 -0000 1.45 *************** *** 391,394 **** --- 391,395 ---- <xsd:complexType> <xsd:sequence> + <xsd:element name="units" type="xsd:string" maxOccurs="1" minOccurs="0"/> <xsd:element name="active" type="xsd:long" maxOccurs="1" minOccurs="0"/> <xsd:element name="cs" type="xsd:long" maxOccurs="1" minOccurs="0"/> |
From: Michael L. <he...@us...> - 2009-09-03 08:18:23
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26755/src/net/sourceforge/bprocessor/model Modified Files: Attribute.java Log Message: Fixed a spelling mistake. Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Attribute.java 17 Dec 2007 13:09:16 -0000 1.26 --- Attribute.java 3 Sep 2009 08:18:12 -0000 1.27 *************** *** 17,21 **** /** * A class for holding the info for objects in the model so that it can be ! * shown in the attributeview in the gui */ public class Attribute extends Entity implements Parametric { --- 17,21 ---- /** * A class for holding the info for objects in the model so that it can be ! * shown in the attribute view in the gui. */ public class Attribute extends Entity implements Parametric { *************** *** 37,41 **** /** * True if the attribute is editable ! * @return if the attribute is editable */ public boolean isEditable() { --- 37,41 ---- /** * True if the attribute is editable ! * @return true if the attribute is editable */ public boolean isEditable() { |
From: Michael L. <he...@us...> - 2009-09-01 06:43:55
|
Update of /cvsroot/bprocessor/bprocessor In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14191 Added Files: b-processor (mac).launch b-processor (windows).launch Removed Files: b-processor.launch Log Message: launch configurations --- b-processor.launch DELETED --- --- NEW FILE: b-processor (windows).launch --- <?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> <listEntry value="/bprocessor/src/net/sourceforge/bprocessor/Application.java"/> </listAttribute> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listEntry value="1"/> </listAttribute> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.sourceforge.bprocessor.Application"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value=""${workspace_loc:kernel}/src/etc/log4j.properties""/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="bprocessor"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.library.path=${workspace_loc:tools}/jogl/win32"/> </launchConfiguration> --- NEW FILE: b-processor (mac).launch --- <?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> <stringAttribute key="bad_container_name" value="/bprocessor/s"/> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> <listEntry value="/bprocessor/src/net/sourceforge/bprocessor/Application.java"/> </listAttribute> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listEntry value="1"/> </listAttribute> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.sourceforge.bprocessor.Application"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="${workspace_loc:kernel}/src/etc/log4j.properties"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="bprocessor"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.library.path="${workspace_loc:tools}/jogl/macosx" -Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=B-Processor"/> </launchConfiguration> |
From: Michael L. <he...@us...> - 2009-08-28 12:58:54
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11722/src/net/sourceforge/bprocessor/model Modified Files: Document.java Defaults.java Project.java Persistence.java Log Message: Index: Defaults.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Defaults.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Defaults.java 22 Jun 2009 13:30:23 -0000 1.6 --- Defaults.java 28 Aug 2009 12:58:46 -0000 1.7 *************** *** 27,30 **** --- 27,38 ---- return functionalMaterial; } + + /** + * + * @param value new material + */ + public static void setFunctionalMaterial(Material value) { + functionalMaterial = value; + } *************** *** 35,38 **** --- 43,53 ---- return constructionMaterial; } + /** + * + * @param value new material + */ + public static void setConstructionMaterial(Material value) { + constructionMaterial = value; + } *************** *** 43,46 **** --- 58,68 ---- return voidMaterial; } + /** + * + * @param value new material + */ + public static void setVoidMaterial(Material value) { + voidMaterial = value; + } /** Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** Persistence.java 29 Jun 2009 08:37:37 -0000 1.81 --- Persistence.java 28 Aug 2009 12:58:46 -0000 1.82 *************** *** 82,85 **** --- 82,86 ---- import java.io.FileInputStream; import java.io.FileOutputStream; + import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; *************** *** 910,923 **** * This method saves the Bmodel document to a file * @param file The output file - * @exception Exception Thrown if an exception occurs */ ! public static void save(File file) throws Exception { ! FileOutputStream fos = new FileOutputStream(file); ! Bmodel bp = externalize(); ! ! saveFile(bp, fos); ! fos.flush(); ! fos.close(); } --- 911,936 ---- * This method saves the Bmodel document to a file * @param file The output file */ ! public static void save(File file) { ! try { ! String name = file.getName(); ! File tmp; ! tmp = File.createTempFile(name, ".tmp"); ! FileOutputStream fos = new FileOutputStream(tmp); ! Bmodel bp = externalize(); ! saveFile(bp, fos); ! ! fos.flush(); ! fos.close(); ! boolean success = tmp.renameTo(file); ! if (!success) { ! System.out.println("problem while saving to " + name); ! } ! } catch (IOException e) { ! System.out.println(e.getMessage() + " while saving to " + file.getName()); ! } catch (JAXBException e) { ! System.out.println(e.getMessage() + " while marshalling model"); ! } } Index: Document.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Document.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Document.java 29 Jun 2009 08:37:37 -0000 1.1 --- Document.java 28 Aug 2009 12:58:46 -0000 1.2 *************** *** 160,162 **** --- 160,176 ---- return components; } + + /** + * + * @param name the name of the material to find + * @return the found material + */ + public Material findMaterial(String name) { + for (Material current : materials) { + if (current.getName().equals(name)) { + return current; + } + } + return null; + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.180 retrieving revision 1.181 diff -C2 -d -r1.180 -r1.181 *** Project.java 29 Jun 2009 08:37:37 -0000 1.180 --- Project.java 28 Aug 2009 12:58:46 -0000 1.181 *************** *** 319,322 **** --- 319,323 ---- public Project() { super(); + System.out.println("-- construct --"); staticObservers = new LinkedList(); reset(); *************** *** 793,801 **** */ public void checkpoint() { ! redoStack.clear(); ! if (currentState != null) { ! undoStack.push(currentState); } - currentState = Persistence.externalize(); log.debug("--------CheckPoint--------"); } --- 794,807 ---- */ public void checkpoint() { ! ! Bmodel state = Persistence.externalize(); ! ! if (state != null) { ! redoStack.clear(); ! if (currentState != null) { ! undoStack.push(currentState); ! } ! currentState = state; } log.debug("--------CheckPoint--------"); } *************** *** 875,879 **** add(current); } ! changed(this); } --- 881,898 ---- add(current); } ! { ! Material construction = document.findMaterial("Construction"); ! if (construction != null) { ! Defaults.setConstructionMaterial(construction); ! } ! Material functional = document.findMaterial("Functional"); ! if (functional != null) { ! Defaults.setFunctionalMaterial(functional); ! } ! Material material = document.findMaterial("Void"); ! if (material != null) { ! Defaults.setVoidMaterial(material); ! } ! } changed(this); } *************** *** 1472,1475 **** --- 1491,1516 ---- } } + } else { + List<Surface> surfaces = new LinkedList(); + for (Surface current : space.getSurfaces()) { + if (current.getExterior() == null) { + surfaces.add(current); + } + } + if (surfaces.size() > 0) { + Command.Inverse inv = new Command.Inverse(surfaces); + Collection<Edge> soup = Surface.edges(surfaces); + List<Edge> loners = new LinkedList(); + for (Edge current : soup) { + List<Surface> lst = inv.surfaces(current); + if (lst.size() == 1) { + loners.add(current); + } + } + List<Edge> external = Command.Offset.order(loners); + List<Vertex> verts = Command.Offset.vertices(external); + Boundary b = new Boundary(convert(verts)); + location.setExternalBoundary(b); + } } *************** *** 1600,1605 **** } - private void processBoundary(Area location) { if (location.getChildren().isEmpty()) { // --- 1641,1649 ---- } private void processBoundary(Area location) { + + } + + private void processBoundary1(Area location) { if (location.getChildren().isEmpty()) { // *************** *** 1612,1617 **** LinkedList<Boundary> internals = new LinkedList(); for (Area current : location.getChildren()) { ! processBoundary(current); ! internals.add(current.getExternalBoundary()); } LinkedList<Point2d> points = new LinkedList(); --- 1656,1666 ---- LinkedList<Boundary> internals = new LinkedList(); for (Area current : location.getChildren()) { ! processBoundary1(current); ! Boundary external = current.getExternalBoundary(); ! if (external != null) { ! internals.add(current.getExternalBoundary()); ! } else { ! System.out.println("failed to create boundary on " + current); ! } } LinkedList<Point2d> points = new LinkedList(); *************** *** 1661,1666 **** processBoundary(root); - - LocationModel model = new LocationModel(); model.setLocation(root); --- 1710,1713 ---- *************** *** 1685,1689 **** List<Space> containers = new LinkedList(); for (Space current : constructs) { - System.out.println("-- " + current.getName() + " --"); Space tesselation = current.tesselate(); tesselation.setMaterial(current.getMaterial()); --- 1732,1735 ---- |