bprocessor-commit Mailing List for B-processor (Page 140)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2006-01-23 10:16:41
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28575/src/net/sourceforge/bprocessor/model/xml Modified Files: PersistenceManager.java Log Message: Startet implementation of Mesh. Changed uses of Set to Collection. Index: PersistenceManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml/PersistenceManager.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PersistenceManager.java 17 Jan 2006 14:05:08 -0000 1.20 --- PersistenceManager.java 23 Jan 2006 10:16:32 -0000 1.21 *************** *** 26,29 **** --- 26,30 ---- import java.io.OutputStream; import java.util.ArrayList; + import java.util.Collection; import java.util.HashMap; import java.util.HashSet; *************** *** 476,480 **** * @param css The construction spaces */ ! private static void saveConstructionSpace(Bprocessor bp, Set css) { Iterator i = css.iterator(); while (i.hasNext()) { --- 477,481 ---- * @param css The construction spaces */ ! private static void saveConstructionSpace(Bprocessor bp, Collection css) { Iterator i = css.iterator(); while (i.hasNext()) { *************** *** 510,514 **** * @param fss The functional spaces */ ! private static void saveFunctionalSpace(Bprocessor bp, Set fss) { Iterator i = fss.iterator(); while (i.hasNext()) { --- 511,515 ---- * @param fss The functional spaces */ ! private static void saveFunctionalSpace(Bprocessor bp, Collection fss) { Iterator i = fss.iterator(); while (i.hasNext()) { *************** *** 544,548 **** * @param ss The surfaces */ ! private static void saveSurface(Bprocessor bp, Set ss) { Iterator i = ss.iterator(); while (i.hasNext()) { --- 545,549 ---- * @param ss The surfaces */ ! private static void saveSurface(Bprocessor bp, Collection ss) { Iterator i = ss.iterator(); while (i.hasNext()) { *************** *** 567,571 **** * @param es The edges */ ! private static void saveEdge(Bprocessor bp, Set es) { Iterator i = es.iterator(); while (i.hasNext()) { --- 568,572 ---- * @param es The edges */ ! private static void saveEdge(Bprocessor bp, Collection es) { Iterator i = es.iterator(); while (i.hasNext()) { *************** *** 590,594 **** * @param vs The vertex */ ! private static void saveVertex(Bprocessor bp, Set vs) { Iterator i = vs.iterator(); while (i.hasNext()) { --- 591,595 ---- * @param vs The vertex */ ! private static void saveVertex(Bprocessor bp, Collection vs) { Iterator i = vs.iterator(); while (i.hasNext()) { *************** *** 615,619 **** * @param css The construction spaces */ ! private static void saveRefConstructionSpace(Bprocessor bp, Set css) { Iterator i = css.iterator(); while (i.hasNext()) { --- 616,620 ---- * @param css The construction spaces */ ! private static void saveRefConstructionSpace(Bprocessor bp, Collection css) { Iterator i = css.iterator(); while (i.hasNext()) { *************** *** 659,663 **** * @param fss The functional spaces */ ! private static void saveRefFunctionalSpace(Bprocessor bp, Set fss) { Iterator i = fss.iterator(); while (i.hasNext()) { --- 660,664 ---- * @param fss The functional spaces */ ! private static void saveRefFunctionalSpace(Bprocessor bp, Collection fss) { Iterator i = fss.iterator(); while (i.hasNext()) { *************** *** 703,707 **** * @param ss The surfaces */ ! private static void saveRefSurface(Bprocessor bp, Set ss) { Iterator i = ss.iterator(); while (i.hasNext()) { --- 704,708 ---- * @param ss The surfaces */ ! private static void saveRefSurface(Bprocessor bp, Collection ss) { Iterator i = ss.iterator(); while (i.hasNext()) { *************** *** 780,784 **** * @param es The edges */ ! private static void saveRefEdge(Bprocessor bp, Set es) { Iterator i = es.iterator(); while (i.hasNext()) { --- 781,785 ---- * @param es The edges */ ! private static void saveRefEdge(Bprocessor bp, Collection es) { Iterator i = es.iterator(); while (i.hasNext()) { *************** *** 824,828 **** * @param vs The vertex */ ! private static void saveRefVertex(Bprocessor bp, Set vs) { Iterator i = vs.iterator(); while (i.hasNext()) { --- 825,829 ---- * @param vs The vertex */ ! private static void saveRefVertex(Bprocessor bp, Collection vs) { Iterator i = vs.iterator(); while (i.hasNext()) { |
From: Michael L. <he...@us...> - 2006-01-23 10:16:41
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28575/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Project.java Added Files: Mesh.java Log Message: Startet implementation of Mesh. Changed uses of Set to Collection. Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Surface.java 5 Jan 2006 10:40:39 -0000 1.64 --- Surface.java 23 Jan 2006 10:16:32 -0000 1.65 *************** *** 8,11 **** --- 8,12 ---- import java.util.ArrayList; + import java.util.Collection; import java.util.HashMap; import java.util.Iterator; *************** *** 582,586 **** if (this.isInner()) { ! Set surfaces = Project.getInstance().getSurfaces(); Iterator surfIt = surfaces.iterator(); while (surfIt.hasNext()) { --- 583,587 ---- if (this.isInner()) { ! Collection surfaces = Project.getInstance().getSurfaces(); Iterator surfIt = surfaces.iterator(); while (surfIt.hasNext()) { --- NEW FILE: Mesh.java --- //--------------------------------------------------------------------------------- // $Id: Mesh.java,v 1.1 2006/01/23 10:16:32 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.Collection; import java.util.HashMap; /** * The Mesh is a collection of surfaces, edges and vertices. */ public class Mesh { /** The vertices */ private HashMap vertices; /** The next vertex id */ private long nextVertexId; /** * Constructor for Mesh */ public Mesh() { super(); vertices = new HashMap(); } /** * Add a vertex * @param vertex The vertex */ public void add(Vertex vertex) { Long id = new Long(nextVertexId++); vertex.setId(id); vertices.put(id, vertex); } /** * Remove a vertex * @param vertex The vertex */ public void remove(Vertex vertex) { vertices.remove(vertex.getId()); vertex.setId(null); } /** * Insert a vertex * @param vertex The vertex * @return The vertex */ public Vertex insert(Vertex vertex) { add(vertex); return vertex; } /** * Delete a vertex * @param vertex The vertex */ public void delete(Vertex vertex) { remove(vertex); } /** * Return the vertices * @return The vertices */ public Collection getVertices() { return vertices.values(); } /** * Return the vertex * @param id The id * @return The vertex */ public Vertex getVertex(long id) { return (Vertex) vertices.get(new Long(id)); } } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Vertex.java 19 Dec 2005 19:37:54 -0000 1.18 --- Vertex.java 23 Jan 2006 10:16:32 -0000 1.19 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.model; + import java.util.Collection; import java.util.HashSet; import java.util.Iterator; *************** *** 125,129 **** public Set getEdges() { Set result = new HashSet(); ! Set edges = Project.getInstance().getEdges(); Iterator iter = edges.iterator(); while (iter.hasNext()) { --- 126,130 ---- public Set getEdges() { Set result = new HashSet(); ! Collection edges = Project.getInstance().getEdges(); Iterator iter = edges.iterator(); while (iter.hasNext()) { Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Edge.java 21 Dec 2005 14:36:36 -0000 1.25 --- Edge.java 23 Jan 2006 10:16:32 -0000 1.26 *************** *** 9,12 **** --- 9,13 ---- import org.apache.log4j.Logger; + import java.util.Collection; import java.util.HashSet; import java.util.Iterator; *************** *** 299,303 **** public Set getSurfaces() { Set result = new HashSet(); ! Set surfaces = Project.getInstance().getSurfaces(); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { --- 300,304 ---- public Set getSurfaces() { Set result = new HashSet(); ! Collection surfaces = Project.getInstance().getSurfaces(); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Project.java 19 Jan 2006 17:23:35 -0000 1.19 --- Project.java 23 Jan 2006 10:16:32 -0000 1.20 *************** *** 155,159 **** * @return The construction spaces */ ! public Set getConstructionSpaces() { return filter(spaces.values(), ConstructionSpace.class); } --- 155,159 ---- * @return The construction spaces */ ! public Collection getConstructionSpaces() { return filter(spaces.values(), ConstructionSpace.class); } *************** *** 163,167 **** * @return the set of all domains */ ! public Set getSpaces() { return new HashSet(spaces.values()); } --- 163,167 ---- * @return the set of all domains */ ! public Collection getSpaces() { return new HashSet(spaces.values()); } *************** *** 200,204 **** * @return The edges */ ! public Set getEdges() { return new HashSet(edges.values()); } --- 200,204 ---- * @return The edges */ ! public Collection getEdges() { return new HashSet(edges.values()); } *************** *** 242,246 **** * @return The functional spaces */ ! public Set getFunctionalSpaces() { return filter(spaces.values(), FunctionalSpace.class); } --- 242,246 ---- * @return The functional spaces */ ! public Collection getFunctionalSpaces() { return filter(spaces.values(), FunctionalSpace.class); } *************** *** 280,284 **** * @return The surfaces */ ! public Set getSurfaces() { return new HashSet(surfaces.values()); } --- 280,284 ---- * @return The surfaces */ ! public Collection getSurfaces() { return new HashSet(surfaces.values()); } *************** *** 317,321 **** * @return The vertexs */ ! public Set getVertices() { return new HashSet(vertices.values()); } --- 317,321 ---- * @return The vertexs */ ! public Collection getVertices() { return new HashSet(vertices.values()); } *************** *** 344,348 **** * @return The cameras */ ! public Set getCameras() { return new HashSet(cameras.values()); } --- 344,348 ---- * @return The cameras */ ! public Collection getCameras() { return new HashSet(cameras.values()); } *************** *** 367,371 **** public Set findByLocation(double x, double y, double z, double delta) { Set result = new HashSet(); ! Set vertices = getVertices(); Iterator iter = vertices.iterator(); double limit = delta; --- 367,371 ---- public Set findByLocation(double x, double y, double z, double delta) { Set result = new HashSet(); ! Collection vertices = getVertices(); Iterator iter = vertices.iterator(); double limit = delta; *************** *** 388,392 **** public Set findEdge(Vertex vertex) { Set result = new HashSet(); ! Set edges = getEdges(); Iterator iter = edges.iterator(); while (iter.hasNext()) { --- 388,392 ---- public Set findEdge(Vertex vertex) { Set result = new HashSet(); ! Collection edges = getEdges(); Iterator iter = edges.iterator(); while (iter.hasNext()) { |
From: Michael L. <he...@us...> - 2006-01-23 10:16:36
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28556/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java CameraTreeView.java SurfaceTreeView.java Log Message: Startet implementation of Mesh. Changed uses of Set to Collection. Index: SurfaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SurfaceTreeView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SurfaceTreeView.java 4 Jan 2006 14:29:55 -0000 1.3 --- SurfaceTreeView.java 23 Jan 2006 10:16:26 -0000 1.4 *************** *** 8,12 **** package net.sourceforge.bprocessor.gui.treeview; ! import java.util.Set; import net.sourceforge.bprocessor.model.Project; --- 8,12 ---- package net.sourceforge.bprocessor.gui.treeview; ! import java.util.Collection; import net.sourceforge.bprocessor.model.Project; *************** *** 28,32 **** public void update() { root.removeAllChildren(); ! Set surfaces = Project.getInstance().getSurfaces(); root.add(new SurfaceContainer("Surfaces", surfaces)); model.nodeStructureChanged(root); --- 28,32 ---- public void update() { root.removeAllChildren(); ! Collection surfaces = Project.getInstance().getSurfaces(); root.add(new SurfaceContainer("Surfaces", surfaces)); model.nodeStructureChanged(root); Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GenericTreeView.java 19 Jan 2006 10:59:40 -0000 1.9 --- GenericTreeView.java 23 Jan 2006 10:16:26 -0000 1.10 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.gui.treeview; + import java.util.Collection; import java.util.Iterator; import java.util.List; *************** *** 245,249 **** * @param spaces The spaces */ ! public SpaceContainer(String name, Set spaces) { super(name); Iterator iter = spaces.iterator(); --- 246,250 ---- * @param spaces The spaces */ ! public SpaceContainer(String name, Collection spaces) { super(name); Iterator iter = spaces.iterator(); *************** *** 264,268 **** * @param surfaces The surfaces */ ! public SurfaceContainer(String name, Set surfaces) { super(name); Iterator iter = surfaces.iterator(); --- 265,269 ---- * @param surfaces The surfaces */ ! public SurfaceContainer(String name, Collection surfaces) { super(name); Iterator iter = surfaces.iterator(); Index: CameraTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/CameraTreeView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CameraTreeView.java 19 Jan 2006 10:59:40 -0000 1.1 --- CameraTreeView.java 23 Jan 2006 10:16:26 -0000 1.2 *************** *** 8,15 **** package net.sourceforge.bprocessor.gui.treeview; import java.util.Iterator; - import java.util.Set; - import net.sourceforge.bprocessor.gui.treeview.GenericTreeView.CameraNode; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Project; --- 8,14 ---- package net.sourceforge.bprocessor.gui.treeview; + import java.util.Collection; import java.util.Iterator; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Project; *************** *** 32,36 **** public void update() { root.removeAllChildren(); ! Set cameras = Project.getInstance().getCameras(); Iterator iter = cameras.iterator(); while (iter.hasNext()) { --- 31,35 ---- public void update() { root.removeAllChildren(); ! Collection cameras = Project.getInstance().getCameras(); Iterator iter = cameras.iterator(); while (iter.hasNext()) { Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SpaceTreeView.java 4 Jan 2006 14:29:55 -0000 1.3 --- SpaceTreeView.java 23 Jan 2006 10:16:26 -0000 1.4 *************** *** 8,12 **** package net.sourceforge.bprocessor.gui.treeview; ! import java.util.Set; import net.sourceforge.bprocessor.model.Project; --- 8,12 ---- package net.sourceforge.bprocessor.gui.treeview; ! import java.util.Collection; import net.sourceforge.bprocessor.model.Project; *************** *** 29,35 **** public void update() { root.removeAllChildren(); ! Set construction = Project.getInstance().getConstructionSpaces(); ! Set functional = Project.getInstance().getFunctionalSpaces(); ! Set surfaces = Project.getInstance().getSurfaces(); root.add(new SpaceContainer("Functional", functional)); root.add(new SpaceContainer("Construction", construction)); --- 29,35 ---- public void update() { root.removeAllChildren(); ! Collection construction = Project.getInstance().getConstructionSpaces(); ! Collection functional = Project.getInstance().getFunctionalSpaces(); ! Collection surfaces = Project.getInstance().getSurfaces(); root.add(new SpaceContainer("Functional", functional)); root.add(new SpaceContainer("Construction", construction)); |
From: Michael L. <he...@us...> - 2006-01-23 10:16:31
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28525/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java PencilTool.java ExtrudeTool.java SpaceTool.java Log Message: Startet implementation of Mesh. Changed uses of Set to Collection. Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SpaceTool.java 18 Jan 2006 11:56:20 -0000 1.7 --- SpaceTool.java 23 Jan 2006 10:16:22 -0000 1.8 *************** *** 252,256 **** JPopupMenu pp = new JPopupMenu(side); SpacePopupListener spl = new SpacePopupListener(side.equals("front"), glv.getView()); ! Set domains = Project.getInstance().getSpaces(); Iterator domIt = domains.iterator(); Iterator selIt = new HashSet(selection).iterator(); --- 252,256 ---- JPopupMenu pp = new JPopupMenu(side); SpacePopupListener spl = new SpacePopupListener(side.equals("front"), glv.getView()); ! Collection domains = Project.getInstance().getSpaces(); Iterator domIt = domains.iterator(); Iterator selIt = new HashSet(selection).iterator(); Index: ExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrudeTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ExtrudeTool.java 10 Jan 2006 08:47:41 -0000 1.6 --- ExtrudeTool.java 23 Jan 2006 10:16:22 -0000 1.7 *************** *** 11,14 **** --- 11,15 ---- import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; + import java.util.Collection; import java.util.HashSet; import java.util.Iterator; *************** *** 174,178 **** } ! Set surfaces = Project.getInstance().getSurfaces(); Iterator iter = surfaces.iterator(); Vertex normal = top.normal(); --- 175,179 ---- } ! Collection surfaces = Project.getInstance().getSurfaces(); Iterator iter = surfaces.iterator(); Vertex normal = top.normal(); Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** PencilTool.java 10 Jan 2006 14:35:37 -0000 1.56 --- PencilTool.java 23 Jan 2006 10:16:22 -0000 1.57 *************** *** 11,14 **** --- 11,15 ---- import java.awt.event.KeyEvent; import java.util.ArrayList; + import java.util.Collection; import java.util.List; import java.util.Set; *************** *** 786,790 **** */ private Space findSpace(Surface s) { ! Set set = Project.getInstance().getFunctionalSpaces(); Iterator it = set.iterator(); while (it.hasNext()) { --- 787,791 ---- */ private Space findSpace(Surface s) { ! Collection set = Project.getInstance().getFunctionalSpaces(); Iterator it = set.iterator(); while (it.hasNext()) { Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** AbstractTool.java 18 Jan 2006 11:56:20 -0000 1.51 --- AbstractTool.java 23 Jan 2006 10:16:22 -0000 1.52 *************** *** 165,169 **** */ protected void holeAnalysis(Surface surface) { ! Set surfaces = Project.getInstance().getSurfaces(); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { --- 165,169 ---- */ protected void holeAnalysis(Surface surface) { ! Collection surfaces = Project.getInstance().getSurfaces(); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { |
From: Michael L. <he...@us...> - 2006-01-23 10:16:31
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28525/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Startet implementation of Mesh. Changed uses of Set to Collection. Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** View.java 19 Jan 2006 10:57:22 -0000 1.49 --- View.java 23 Jan 2006 10:16:22 -0000 1.50 *************** *** 808,814 **** */ protected void drawAll(GLDrawable gld) { ! Set surfaces = Project.getInstance().getSurfaces(); ! Set edges = Project.getInstance().getEdges(); ! Set vertices = Project.getInstance().getVertices(); Collection selection = glv.getTool().getSelection(); --- 808,814 ---- */ protected void drawAll(GLDrawable gld) { ! Collection surfaces = Project.getInstance().getSurfaces(); ! Collection edges = Project.getInstance().getEdges(); ! Collection vertices = Project.getInstance().getVertices(); Collection selection = glv.getTool().getSelection(); *************** *** 1015,1019 **** * @param surfaces the set of surfaces that should be selectable */ ! private void drawSelectionMode(Set vertices, Set edges, Set surfaces) { // HERE STARTS SELECTION MODE DRAWING if (selectMode == VERTICES || selectMode == ALL) { --- 1015,1019 ---- * @param surfaces the set of surfaces that should be selectable */ ! private void drawSelectionMode(Collection vertices, Collection edges, Collection surfaces) { // HERE STARTS SELECTION MODE DRAWING if (selectMode == VERTICES || selectMode == ALL) { *************** *** 1335,1339 **** */ private void drawEdges(GLDrawable gld) { ! Set edges = Project.getInstance().getEdges(); GL gl = gld.getGL(); GLU glu = gld.getGLU(); --- 1335,1339 ---- */ private void drawEdges(GLDrawable gld) { ! Collection edges = Project.getInstance().getEdges(); GL gl = gld.getGL(); GLU glu = gld.getGLU(); *************** *** 1396,1400 **** * @param side The side of the Surface to draw */ ! private void drawSurfaces(GLDrawable gld, Set surfaces, int side) { Collection selection = glv.getTool().getSelection(); GL gl = gld.getGL(); --- 1396,1400 ---- * @param side The side of the Surface to draw */ ! private void drawSurfaces(GLDrawable gld, Collection surfaces, int side) { Collection selection = glv.getTool().getSelection(); GL gl = gld.getGL(); *************** *** 1440,1444 **** */ private void drawSurfaces(GLDrawable gld, int side) { ! Set surfaces = Project.getInstance().getSurfaces(); drawSurfaces(gld, surfaces, side); drawSurfaces(gld, tempSurfaces, side); --- 1440,1444 ---- */ private void drawSurfaces(GLDrawable gld, int side) { ! Collection surfaces = Project.getInstance().getSurfaces(); drawSurfaces(gld, surfaces, side); drawSurfaces(gld, tempSurfaces, side); *************** *** 1474,1478 **** */ private void drawSpaces(GLDrawable gld) { ! Set spaces = Project.getInstance().getSpaces(); Iterator spaceIter = spaces.iterator(); --- 1474,1478 ---- */ private void drawSpaces(GLDrawable gld) { ! Collection spaces = Project.getInstance().getSpaces(); Iterator spaceIter = spaces.iterator(); |
From: Nikolaj B. <nbr...@us...> - 2006-01-23 02:47:09
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18550/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java MyKeyListener.java Log Message: Updated the attributeview, so it can now show info for Vertex, and Edge too. Index: MyKeyListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/MyKeyListener.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MyKeyListener.java 18 Jan 2006 10:12:39 -0000 1.5 --- MyKeyListener.java 23 Jan 2006 02:47:00 -0000 1.6 *************** *** 9,15 **** --- 9,19 ---- import java.awt.event.KeyListener; import java.awt.event.KeyEvent; + + import javax.swing.JOptionPane; import javax.swing.text.JTextComponent; + import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Space; + import net.sourceforge.bprocessor.model.Vertex; /** *************** *** 24,27 **** --- 28,43 ---- public static final int TAREA = 2; + /** If its the length field */ + public static final int LENGTH = 3; + + /** The X coordinate */ + public static final int XCOOR = 4; + + /** The Y coordinate */ + public static final int YCOOR = 5; + + /** The Z coordinate */ + public static final int ZCOOR = 6; + /** The current ConstructionSpace */ private Space cons; *************** *** 38,42 **** /** * The constructor ! * @param o the event * @param type shows the type of the component the listeners listens too. */ --- 54,58 ---- /** * The constructor ! * @param o the object that has the listener attached. * @param type shows the type of the component the listeners listens too. */ *************** *** 85,88 **** --- 101,204 ---- } } + + if (type == LENGTH) { + JTextComponent tf = (JTextComponent)e.getSource(); + double newLength = 0; + boolean validInput = true; + try { + newLength = new Double(tf.getText()).doubleValue(); + } catch (Exception wrongInput) { + validInput = false; + } + + if (validInput) { + if (current instanceof Edge) { + Edge edge = (Edge) current; + edge.setLength(newLength); + edge.changed(); + } + } else { + JOptionPane.showMessageDialog(null, + "Please enter a number", + "Error - Invalid input", + JOptionPane.ERROR_MESSAGE); + } + + } + + if (type == XCOOR) { + JTextComponent tf = (JTextComponent)e.getSource(); + double newX = 0; + boolean validInput = true; + try { + newX = new Double(tf.getText()).doubleValue(); + } catch (Exception wrongInput) { + validInput = false; + } + + if (validInput) { + if (current instanceof Vertex) { + Vertex vertex = (Vertex) current; + vertex.setX(newX); + vertex.changed(); + } + } else { + JOptionPane.showMessageDialog(null, + "Please enter a number", + "Error - Invalid input", + JOptionPane.ERROR_MESSAGE); + } + + } + + if (type == YCOOR) { + JTextComponent tf = (JTextComponent)e.getSource(); + double newY = 0; + boolean validInput = true; + try { + newY = new Double(tf.getText()).doubleValue(); + } catch (Exception wrongInput) { + validInput = false; + } + + if (validInput) { + if (current instanceof Vertex) { + Vertex vertex = (Vertex) current; + vertex.setY(newY); + vertex.changed(); + } + } else { + JOptionPane.showMessageDialog(null, + "Please enter a number", + "Error - Invalid input", + JOptionPane.ERROR_MESSAGE); + } + + } + + if (type == ZCOOR) { + JTextComponent tf = (JTextComponent)e.getSource(); + double newZ = 0; + boolean validInput = true; + try { + newZ = new Double(tf.getText()).doubleValue(); + } catch (Exception wrongInput) { + validInput = false; + } + + if (validInput) { + if (current instanceof Vertex) { + Vertex vertex = (Vertex) current; + vertex.setZ(newZ); + vertex.changed(); + } + } else { + JOptionPane.showMessageDialog(null, + "Please enter a number", + "Error - Invalid input", + JOptionPane.ERROR_MESSAGE); + } + + } } } Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** AttributeView.java 19 Jan 2006 17:25:02 -0000 1.27 --- AttributeView.java 23 Jan 2006 02:46:59 -0000 1.28 *************** *** 15,18 **** --- 15,20 ---- import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Vertex; import java.awt.Color; *************** *** 95,98 **** --- 97,112 ---- public static final int TAREA = 2; + /** The length field */ + public static final int LENGTH = 3; + + /** The X coordinate */ + public static final int XCOOR = 4; + + /** The Y coordinate */ + public static final int YCOOR = 5; + + /** The Z coordinate */ + public static final int ZCOOR = 6; + /** * Constructor *************** *** 212,215 **** --- 226,379 ---- } + /** + * Display the edge + * @param o The object + */ + void displayVertex(Vertex o) { + GridBagLayout layout = new GridBagLayout(); + GridBagConstraints con = new GridBagConstraints(); + setLayout(layout); + + JLabel name = new JLabel("Name: "); + con.anchor = GridBagConstraints.NORTH; + con.weightx = 0; + layout.setConstraints(name, con); + name.setFont(fontBold); + add(name); + + JLabel vertexName = new JLabel(o.getName()); + layout.setConstraints(vertexName, con); + vertexName.setFont(fontPlain); + add(vertexName); + + JPanel hfiller = new JPanel(); + hfiller.setOpaque(true); + con.weightx = 1.0; + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(hfiller, con); + add(hfiller); + + JLabel x = new JLabel("X: "); + con.anchor = GridBagConstraints.NORTH; + con.gridwidth = 1; + con.weightx = 0; + layout.setConstraints(x, con); + x.setFont(fontBold); + add(x); + + int xval = (int) (o.getX() * 100); + JTextField xEdit = new JTextField((Double.toString(((double) xval) / 100))); + con.gridwidth = GridBagConstraints.REMAINDER; + con.weightx = 1.0; + con.fill = GridBagConstraints.HORIZONTAL; + layout.setConstraints(xEdit, con); + xEdit.setFont(fontPlain); + add(xEdit); + xEdit.addKeyListener(new MyKeyListener(o, XCOOR)); + + JLabel y = new JLabel("Y: "); + con.gridwidth = 1; + con.weightx = 0; + con.fill = GridBagConstraints.NONE; + layout.setConstraints(y, con); + y.setFont(fontBold); + add(y); + + int yval = (int) (o.getY() * 100); + JTextField yEdit = new JTextField((Double.toString(((double) yval) / 100))); + con.gridwidth = GridBagConstraints.REMAINDER; + con.weightx = 1.0; + con.fill = GridBagConstraints.HORIZONTAL; + layout.setConstraints(yEdit, con); + yEdit.setFont(fontPlain); + add(yEdit); + yEdit.addKeyListener(new MyKeyListener(o, YCOOR)); + + JLabel z = new JLabel("Z: "); + con.gridwidth = 1; + con.weightx = 0; + con.fill = GridBagConstraints.NONE; + layout.setConstraints(z, con); + z.setFont(fontBold); + add(z); + + int zval = (int) (o.getZ() * 100); + JTextField zEdit = new JTextField((Double.toString(((double) zval) / 100))); + con.gridwidth = GridBagConstraints.REMAINDER; + con.weightx = 1.0; + con.fill = GridBagConstraints.HORIZONTAL; + layout.setConstraints(zEdit, con); + zEdit.setFont(fontPlain); + add(zEdit); + zEdit.addKeyListener(new MyKeyListener(o, ZCOOR)); + + JPanel vfiller = new JPanel(); + vfiller.setOpaque(true); + con.weighty = 1.0; + con.fill = GridBagConstraints.BOTH; + layout.setConstraints(vfiller, con); + add(vfiller); + + + + } + + /** + * Display the edge + * @param o The object + */ + void displayEdge(Edge o) { + GridBagLayout layout = new GridBagLayout(); + GridBagConstraints con = new GridBagConstraints(); + setLayout(layout); + + JLabel name = new JLabel("Name: "); + con.anchor = GridBagConstraints.NORTH; + con.weightx = 0; + layout.setConstraints(name, con); + name.setFont(fontBold); + add(name); + + JLabel edgeName = new JLabel(o.getName()); + layout.setConstraints(edgeName, con); + edgeName.setFont(fontPlain); + add(edgeName); + + JPanel hfiller = new JPanel(); + hfiller.setOpaque(true); + con.weightx = 1.0; + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(hfiller, con); + add(hfiller); + + JLabel length = new JLabel("Length: "); + con.anchor = GridBagConstraints.NORTH; + con.weightx = 0; + con.gridwidth = 1; + layout.setConstraints(length, con); + length.setFont(fontBold); + add(length); + + int l = (int) (o.getLength() * 100); + JTextField lengthEdit = new JTextField((Double.toString(((double) l) / 100))); + con.gridwidth = GridBagConstraints.REMAINDER; + con.weightx = 1.0; + con.fill = GridBagConstraints.HORIZONTAL; + layout.setConstraints(lengthEdit, con); + lengthEdit.setFont(fontPlain); + add(lengthEdit); + lengthEdit.addKeyListener(new MyKeyListener(o, LENGTH)); + + + JPanel vfiller = new JPanel(); + vfiller.setOpaque(true); + con.weighty = 1.0; + con.fill = GridBagConstraints.BOTH; + layout.setConstraints(vfiller, con); + add(vfiller); + + + } + /** *************** *** 516,519 **** --- 680,687 ---- } else if (current instanceof Camera) { displayCamera((Camera) current); + } else if (current instanceof Edge) { + displayEdge((Edge) current); + } else if (current instanceof Vertex) { + displayVertex((Vertex) current); } else { if (current != null) { *************** *** 525,526 **** --- 693,695 ---- } } + |
From: rimestad <rim...@us...> - 2006-01-19 17:25:11
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7696/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Added better info in the attributeview for cams but there are still several layout problems Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** AttributeView.java 19 Jan 2006 10:59:40 -0000 1.26 --- AttributeView.java 19 Jan 2006 17:25:02 -0000 1.27 *************** *** 371,374 **** --- 371,503 ---- cameraName.setFont(fontPlain); add(cameraName); + + // make a empty line + JPanel hfiller = new JPanel(); + hfiller.setOpaque(true); + con.weightx = 1.0; + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(hfiller, con); + add(hfiller); + + // make tab indentation + JLabel emptyLine = new JLabel(" "); + con.weightx = 1; + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(emptyLine, con); + add(emptyLine); + + JPanel type = new JPanel(); + type.setMinimumSize(new Dimension(120, 120)); + type.setBorder(BorderFactory.createTitledBorder("Type")); + type.setLayout(new GridBagLayout()); + GridBagConstraints typeCon = new GridBagConstraints(); + typeCon.fill = GridBagConstraints.HORIZONTAL; + typeCon.gridwidth = 2; // Let top label cover 2 collums + typeCon.weightx = 0.5; + typeCon.gridx = 0; + typeCon.gridy = 0; + JLabel cam = new JLabel("Camera:"); + cam.setFont(fontBold); + type.add(cam, typeCon); + + // ADD the camera coordinates + double[] camera = c.getCamera(); + typeCon.gridwidth = 1; + typeCon.gridx = 0; + typeCon.gridy = 1; + JLabel camxl = new JLabel("x:"); + type.add(camxl, typeCon); + JTextField camx = new JTextField("" + camera[0]); + typeCon.gridx = 1; + typeCon.gridy = 1; + type.add(camx, typeCon); + JLabel camyl = new JLabel("y:"); + typeCon.gridx = 0; + typeCon.gridy = 2; + type.add(camyl, typeCon); + JTextField camy = new JTextField("" + camera[1]); + typeCon.gridx = 1; + typeCon.gridy = 2; + type.add(camy, typeCon); + JLabel camzl = new JLabel("z:"); + typeCon.gridx = 0; + typeCon.gridy = 3; + type.add(camzl, typeCon); + JTextField camz = new JTextField("" + camera[2]); + typeCon.gridx = 1; + typeCon.gridy = 3; + type.add(camz, typeCon); + + // ADD the eye pointcoordinates + typeCon.gridwidth = 2; // Let top label cover 2 collums + + double[] eye = c.getCenter(); + typeCon.gridx = 0; + typeCon.gridy = 4; + JLabel eyel = new JLabel("Eye-point:"); + cam.setFont(fontBold); + type.add(eyel, typeCon); + typeCon.gridwidth = 1; + JLabel eyexl = new JLabel("x:"); + typeCon.gridx = 0; + typeCon.gridy = 5; + type.add(eyexl, typeCon); + JTextField eyex = new JTextField("" + eye[0]); + typeCon.gridx = 1; + typeCon.gridy = 5; + type.add(eyex, typeCon); + JLabel eyeyl = new JLabel("y:"); + typeCon.gridx = 0; + typeCon.gridy = 6; + type.add(eyeyl, typeCon); + JTextField eyey = new JTextField("" + eye[1]); + typeCon.gridx = 1; + typeCon.gridy = 6; + type.add(eyey, typeCon); + JLabel eyezl = new JLabel("z:"); + typeCon.gridx = 0; + typeCon.gridy = 7; + type.add(eyezl, typeCon); + JTextField eyez = new JTextField("" + eye[2]); + typeCon.gridx = 1; + typeCon.gridy = 7; + type.add(eyez, typeCon); + + + // ADD the roll coordinates + typeCon.gridwidth = 2; // Let top label cover 2 collums + double[] roll = c.getRoll(); + typeCon.gridx = 0; + typeCon.gridy = 8; + JLabel rolll = new JLabel("Roll:"); + cam.setFont(fontBold); + type.add(rolll, typeCon); + typeCon.gridwidth = 1; + JLabel rollxl = new JLabel("x:"); + typeCon.gridx = 0; + typeCon.gridy = 9; + type.add(rollxl, typeCon); + JTextField rollx = new JTextField("" + roll[0]); + typeCon.gridx = 1; + typeCon.gridy = 9; + type.add(rollx, typeCon); + JLabel rollyl = new JLabel("y:"); + typeCon.gridx = 0; + typeCon.gridy = 10; + type.add(rollyl, typeCon); + JTextField rolly = new JTextField("" + roll[1]); + typeCon.gridx = 1; + typeCon.gridy = 10; + type.add(rolly, typeCon); + JLabel rollzl = new JLabel("z:"); + typeCon.gridx = 0; + typeCon.gridy = 11; + type.add(rollzl, typeCon); + JTextField rollz = new JTextField("" + roll[2]); + typeCon.gridx = 1; + typeCon.gridy = 11; + type.add(rollz, typeCon); + + add(type); } |
From: rimestad <rim...@us...> - 2006-01-19 17:23:43
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7178/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Added cams to the project Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Project.java 16 Jan 2006 13:46:59 -0000 1.18 --- Project.java 19 Jan 2006 17:23:35 -0000 1.19 *************** *** 54,57 **** --- 54,62 ---- private long spaceId; + /** The domains */ + private HashMap cameras = new HashMap(); + /** The domain id */ + private long cameraId; + /** * Get the instance *************** *** 70,73 **** --- 75,79 ---- public Project() { super(); + addCams(); // To do camera initializasation (MAYBE IT SHOULD NOT BE HERE) observers = new LinkedList(); } *************** *** 109,115 **** --- 115,143 ---- surfaces.clear(); vertices.clear(); + cameras.clear(); + addCams(); changed(this); } + /** + * Add the default cameras to cameras + */ + private void addCams() { + Camera cam0 = Camera.create(Camera.VIEW_3D); // The starting cam + cam0.setId(new Long(cameraId++)); + cameras.put(cam0.getId(), cam0); + Camera cam1 = Camera.create(Camera.VIEW_3D); // Reset to 3D position + cam1.setId(new Long(cameraId++)); + cameras.put(cam1.getId(), cam1); + Camera cam2 = Camera.create(Camera.VIEW_XY); // Reset to 2D position XY with ortho + cam1.setId(new Long(cameraId++)); + cameras.put(cam2.getId(), cam2); + Camera cam3 = Camera.create(Camera.VIEW_XZ); // Reset to 2D position XZ with ortho + cam1.setId(new Long(cameraId++)); + cameras.put(cam3.getId(), cam3); + Camera cam4 = Camera.create(Camera.VIEW_YZ); // Reset to 2D position YZ with ortho + cam1.setId(new Long(cameraId++)); + cameras.put(cam4.getId(), cam4); + } /** *************** *** 303,306 **** --- 331,361 ---- /** + * Intern a camera + * @param c The camera + */ + public void intern(Camera c) { + c.setId(new Long(cameraId++)); + cameras.put(c.getId(), c); + changed(this); + } + + /** + * Get all cameras + * @return The cameras + */ + public Set getCameras() { + return new HashSet(cameras.values()); + } + + /** + * Find Camera by id + * @param id The id + * @return The Camera + */ + public Camera findCameraById(Long id) { + return (Camera)cameras.get(id); + } + + /** * Find vertex based upon location and delta * @param x The x coordinate |
From: rimestad <rim...@us...> - 2006-01-19 10:59:49
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28732/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Added Files: CameraTreeView.java Log Message: Added a CameraTreeView so that the avail cameras are in the tree view and so that it can be selected and shown (only with name) in the attribute view Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GenericTreeView.java 18 Jan 2006 11:41:17 -0000 1.8 --- GenericTreeView.java 19 Jan 2006 10:59:40 -0000 1.9 *************** *** 18,21 **** --- 18,22 ---- import javax.swing.tree.TreePath; + import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; *************** *** 223,226 **** --- 224,240 ---- /** + * CameraNode + */ + public class CameraNode extends EntityNode { + /** + * Constructor for CameraNode + * @param camera The camera + */ + public CameraNode(Camera camera) { + super(camera); + } + } + + /** * SpaceContainer */ --- NEW FILE: CameraTreeView.java --- //--------------------------------------------------------------------------------- // $Id: CameraTreeView.java,v 1.1 2006/01/19 10:59:40 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.treeview; import java.util.Iterator; import java.util.Set; import net.sourceforge.bprocessor.gui.treeview.GenericTreeView.CameraNode; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Project; /** * SurfaceTreeView */ public class CameraTreeView extends GenericTreeView { /** * Constructor for SurfaceTreeView */ public CameraTreeView() { super(); } /** * Update the TreeView */ public void update() { root.removeAllChildren(); Set cameras = Project.getInstance().getCameras(); Iterator iter = cameras.iterator(); while (iter.hasNext()) { Camera current = (Camera) iter.next(); root.add(new CameraNode(current)); } model.nodeStructureChanged(root); } } |
From: rimestad <rim...@us...> - 2006-01-19 10:59:49
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28732/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Added a CameraTreeView so that the avail cameras are in the tree view and so that it can be selected and shown (only with name) in the attribute view Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** AttributeView.java 18 Jan 2006 11:41:17 -0000 1.25 --- AttributeView.java 19 Jan 2006 10:59:40 -0000 1.26 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.gui.Defaults; + import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Observer; *************** *** 351,354 **** --- 352,377 ---- /** + * Display the camera + * @param c The camera + */ + void displayCamera(Camera c) { + GridBagLayout layout = new GridBagLayout(); + GridBagConstraints con = new GridBagConstraints(); + setLayout(layout); + + JLabel name = new JLabel("Name: "); + con.anchor = GridBagConstraints.NORTH; + con.weightx = 0; + layout.setConstraints(name, con); + name.setFont(fontBold); + add(name); + + JLabel cameraName = new JLabel(c.getName()); + layout.setConstraints(cameraName, con); + cameraName.setFont(fontPlain); + add(cameraName); + } + + /** * Display the object * @param o The object *************** *** 362,365 **** --- 385,390 ---- } else if (current instanceof Surface) { displaySurface((Surface) current); + } else if (current instanceof Camera) { + displayCamera((Camera) current); } else { if (current != null) { |
From: rimestad <rim...@us...> - 2006-01-19 10:59:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28732/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Added a CameraTreeView so that the avail cameras are in the tree view and so that it can be selected and shown (only with name) in the attribute view Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** GUI.java 3 Jan 2006 12:14:04 -0000 1.21 --- GUI.java 19 Jan 2006 10:59:40 -0000 1.22 *************** *** 22,26 **** import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.gui.splash.SplashWindow; ! import net.sourceforge.bprocessor.gui.treeview.GenericTreeView; import net.sourceforge.bprocessor.gui.treeview.SpaceTreeView; import net.sourceforge.bprocessor.gui.treeview.SurfaceTreeView; --- 22,26 ---- import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.gui.splash.SplashWindow; ! import net.sourceforge.bprocessor.gui.treeview.CameraTreeView; import net.sourceforge.bprocessor.gui.treeview.SpaceTreeView; import net.sourceforge.bprocessor.gui.treeview.SurfaceTreeView; *************** *** 308,312 **** tp.addTab("Spaces", new JScrollPane (new SpaceTreeView())); tp.addTab("Surfaces", new JScrollPane (new SurfaceTreeView())); ! tp.addTab("Views", new JScrollPane (new GenericTreeView())); registerPanel(tp, SPLIT_LEFT); --- 308,312 ---- tp.addTab("Spaces", new JScrollPane (new SpaceTreeView())); tp.addTab("Surfaces", new JScrollPane (new SurfaceTreeView())); ! tp.addTab("Views", new JScrollPane (new CameraTreeView())); registerPanel(tp, SPLIT_LEFT); |
From: rimestad <rim...@us...> - 2006-01-19 10:58:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28207/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java Log Message: Prev tool works even if the same tool is selected multiple times Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ToolFactory.java 6 Jan 2006 15:36:14 -0000 1.23 --- ToolFactory.java 19 Jan 2006 10:58:12 -0000 1.24 *************** *** 161,196 **** */ public Tool get(int i) { ! previousTool = currentTool; if (i == Tool.SELECT_TOOL) { currentTool = select; - return select; } else if (i == Tool.MOVE_TOOL) { currentTool = move; - return move; } else if (i == Tool.EXTRUSION_TOOL) { currentTool = extrusion; - return extrusion; } else if (i == Tool.PENCIL_TOOL) { currentTool = pencil; - return pencil; } else if (i == Tool.CLIP_TOOL) { currentTool = clipplane; - return clipplane; } else if (i == Tool.ROTATION_TOOL) { currentTool = rotation; - return rotation; } else if (i == Tool.FLY_TOOL) { currentTool = fly; - return fly; } else if (i == Tool.WALK_TOOL) { currentTool = walk; - return walk; } else if (i == Tool.TAPE_MEASURE_TOOL) { currentTool = tapeMeasure; - return tapeMeasure; } else { log.error("[get] No such tool " + i); return null; } } --- 161,191 ---- */ public Tool get(int i) { ! Tool temp = currentTool; if (i == Tool.SELECT_TOOL) { currentTool = select; } else if (i == Tool.MOVE_TOOL) { currentTool = move; } else if (i == Tool.EXTRUSION_TOOL) { currentTool = extrusion; } else if (i == Tool.PENCIL_TOOL) { currentTool = pencil; } else if (i == Tool.CLIP_TOOL) { currentTool = clipplane; } else if (i == Tool.ROTATION_TOOL) { currentTool = rotation; } else if (i == Tool.FLY_TOOL) { currentTool = fly; } else if (i == Tool.WALK_TOOL) { currentTool = walk; } else if (i == Tool.TAPE_MEASURE_TOOL) { currentTool = tapeMeasure; } else { log.error("[get] No such tool " + i); return null; } + if (currentTool != temp) { + previousTool = temp; + } + return currentTool; } |
From: rimestad <rim...@us...> - 2006-01-19 10:57:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27954/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Added capabillity for orthographic view and converted all the 2D views to orthographic. It is a type modifier in Camera Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** View.java 18 Jan 2006 09:43:36 -0000 1.48 --- View.java 19 Jan 2006 10:57:22 -0000 1.49 *************** *** 2140,2147 **** double focalwidth = camera.getFocalwidth(); if (aspect < 1.0) { ! // fovy, aspect, near, far (relative to camera position) ! glu.gluPerspective(aspect * focalwidth, 1.0, near, far); } else { ! glu.gluPerspective(focalwidth, aspect, near, far); } --- 2140,2157 ---- double focalwidth = camera.getFocalwidth(); if (aspect < 1.0) { ! if (camera.getType() == Camera.ORTHOGRAPHIC) { ! double tal = Math.tan(focalwidth) * length; ! gl.glOrtho(tal, -tal, tal, -tal, near, far); //TODO find the best pararms ! } else if (camera.getType() == Camera.PERSPECTIVE) { ! // fovy, aspect, near, far (relative to camera position) ! glu.gluPerspective(aspect * focalwidth, 1.0, near, far); ! } } else { ! if (camera.getType() == Camera.ORTHOGRAPHIC) { ! double tal = Math.tan(focalwidth) * length; ! gl.glOrtho(tal, -tal, tal, -tal, near, far); ! } else if (camera.getType() == Camera.PERSPECTIVE) { ! glu.gluPerspective(focalwidth, aspect, near, far); ! } } |
From: rimestad <rim...@us...> - 2006-01-19 10:57:30
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27932/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: Added capabillity for orthographic view and converted all the 2D views to orthographic. It is a type modifier in Camera Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Camera.java 20 Dec 2005 12:23:14 -0000 1.6 --- Camera.java 19 Jan 2006 10:57:18 -0000 1.7 *************** *** 26,29 **** --- 26,35 ---- public static final int VIEW_YZ = 4; + /** The orthographic view type */ + public static final int ORTHOGRAPHIC = 5; + + /** The perspective view type */ + public static final int PERSPECTIVE = 6; + /** The logger */ private static Logger log = Logger.getLogger(Camera.class); *************** *** 41,44 **** --- 47,53 ---- private String name; + /** The type of the camera */ + private int type; + /** * The constructor for the persistence layer *************** *** 55,73 **** Camera res = null; if (type == VIEW_3D) { ! res = new Camera("3d", new double[]{0, 0, 0}, new double[]{22, 19, 22}, new double[] {0, 0, 1}); } else if (type == VIEW_XZ) { ! res = new Camera("xz", new double[]{0, 0, 0}, ! new double[]{0, 20, 0}, new double[] {0, 0, 1}); } else if (type == VIEW_XY) { ! res = new Camera("xy", new double[]{0, 0, 0}, new double[]{0, 0, 20}, new double[] {0, 1, 0}); } else if (type == VIEW_YZ) { ! res = new Camera("yz", new double[]{0, 0, 0}, new double[]{20, 0, 0}, new double[] {0, 0, 1}); } return res; --- 64,86 ---- Camera res = null; if (type == VIEW_3D) { ! res = new Camera("3D", new double[]{0, 0, 0}, new double[]{22, 19, 22}, new double[] {0, 0, 1}); + res.setType(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}); + res.setType(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}); + res.setType(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}); + res.setType(ORTHOGRAPHIC); } return res; *************** *** 75,78 **** --- 88,111 ---- /** + * Set the type of the camera + * @param type The type + */ + public void setType(int type) { + if (type == PERSPECTIVE || type == ORTHOGRAPHIC) { + this.type = type; + } else { + log.error("Wrong camera type should be either Camera.PERSPECTIVE or Camera.ORTHOGRAPIC"); + } + } + + /** + * Getter for camera.type + * @return The camera type + */ + public int getType() { + return type; + } + + /** * Constructor with arguments * @param center The center position *************** *** 340,349 **** */ public String toString() { ! String s = getName() ! + "[(" ! + camera[0] + ", " + camera[1] + ", " + camera[2] + ",) -> (" ! + center[0] + ", " + center[1] + ", " + center[2] + ",) ^ (" ! + roll[0] + ", " + roll[1] + ", " + roll[2] + "]"; ! return s; } } --- 373,377 ---- */ public String toString() { ! return getName(); } } |
From: Michael L. <he...@us...> - 2006-01-18 11:56:31
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5886/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java SpaceTool.java Log Message: Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SpaceTool.java 16 Jan 2006 10:07:28 -0000 1.6 --- SpaceTool.java 18 Jan 2006 11:56:20 -0000 1.7 *************** *** 15,19 **** import java.util.HashSet; import java.util.Iterator; - import java.util.List; import java.util.Set; --- 15,18 ---- *************** *** 143,148 **** Vertex n = system.getN(); n.scale(1 / n.length()); ! List vertices = slave.getVertices(); ! vertices.remove(0); Iterator iter = vertices.iterator(); while (iter.hasNext()) { --- 142,150 ---- Vertex n = system.getN(); n.scale(1 / n.length()); ! Set vertices = new HashSet(); ! ! // List vertices = slave.getVertices(); ! // vertices.remove(0); ! collect(slave, vertices); Iterator iter = vertices.iterator(); while (iter.hasNext()) { Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** AbstractTool.java 18 Jan 2006 11:46:50 -0000 1.50 --- AbstractTool.java 18 Jan 2006 11:56:20 -0000 1.51 *************** *** 767,771 **** * @param vertices The vertices */ ! private void collect(Object o, Set vertices) { if (o instanceof Vertex) { vertices.add(o); --- 767,771 ---- * @param vertices The vertices */ ! protected void collect(Object o, Set vertices) { if (o instanceof Vertex) { vertices.add(o); |
From: Michael L. <he...@us...> - 2006-01-18 11:46:58
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2714/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java MoveTool.java Log Message: Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** MoveTool.java 18 Jan 2006 11:41:14 -0000 1.25 --- MoveTool.java 18 Jan 2006 11:46:50 -0000 1.26 *************** *** 87,118 **** /** - * Collect vertices from object - * @param o The object - * @param vertices The vertices - */ - private void collect(Object o, Set vertices) { - if (o instanceof Vertex) { - vertices.add(o); - } else if (o instanceof Edge) { - Edge edge = (Edge) o; - vertices.add(edge.getFrom()); - vertices.add(edge.getTo()); - } else if (o instanceof Surface) { - Surface surface = (Surface) o; - vertices.addAll(surface.getVertices()); - if (surface.getHoles() != null) { - Iterator iter = surface.getHoles().iterator(); - while (iter.hasNext()) { - Surface current = (Surface) iter.next(); - collect(current, vertices); - } - } - } else if (o instanceof ClippingPlane) { - ClippingPlane plane = (ClippingPlane) o; - vertices.add(plane.origin()); - } - } - - /** * Update selection * --- 87,90 ---- *************** *** 148,160 **** vertices = new HashSet(); ! Iterator iter = selection.iterator(); ! while (iter.hasNext()) { ! collect(iter.next(), vertices); ! } ! // There is a delay before selection has been updated with target ! // because asynch notifications are being used to update selection. ! // TODO fix it ! // Meanwhile just collect points from target. ! collect(target, vertices); } } --- 120,124 ---- vertices = new HashSet(); ! collect(selection, vertices); } } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** AbstractTool.java 13 Jan 2006 15:57:32 -0000 1.49 --- AbstractTool.java 18 Jan 2006 11:46:50 -0000 1.50 *************** *** 14,17 **** --- 14,18 ---- import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; + import net.sourceforge.bprocessor.gl.model.ClippingPlane; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.gl.GLView; *************** *** 747,749 **** --- 748,791 ---- return; } + + /** + * Collect all vertices from a collection of objects + * @param objects Collection of objects + * @param vertices Set of vertices + */ + protected void collect(Collection objects, Set vertices) { + Iterator iter = objects.iterator(); + while (iter.hasNext()) { + Object current = iter.next(); + collect(current, vertices); + } + } + + /** + * Collect vertices from object + * @param o The object + * @param vertices The vertices + */ + private void collect(Object o, Set vertices) { + if (o instanceof Vertex) { + vertices.add(o); + } else if (o instanceof Edge) { + Edge edge = (Edge) o; + vertices.add(edge.getFrom()); + vertices.add(edge.getTo()); + } else if (o instanceof Surface) { + Surface surface = (Surface) o; + vertices.addAll(surface.getVertices()); + if (surface.getHoles() != null) { + Iterator iter = surface.getHoles().iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + collect(current, vertices); + } + } + } else if (o instanceof ClippingPlane) { + ClippingPlane plane = (ClippingPlane) o; + vertices.add(plane.origin()); + } + } } |
From: Michael L. <he...@us...> - 2006-01-18 11:41:25
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv845/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: MoveTool: AXIS_RESTRICTED now default AttributeView: Updates when displayed object are changed Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** AttributeView.java 18 Jan 2006 10:12:39 -0000 1.24 --- AttributeView.java 18 Jan 2006 11:41:17 -0000 1.25 *************** *** 10,13 **** --- 10,14 ---- import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Observer; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; *************** *** 52,55 **** --- 53,57 ---- setPreferredSize(new Dimension(120, 240)); Selection.primary().addObserver(this); + Project.getInstance().addObserver(this); } *************** *** 66,71 **** } } repaint(); - //FIXME should re-display if anything else is changed } --- 68,76 ---- } } + Object current = ap.getCurrent(); + if (object == current) { + ap.display(current); + } repaint(); } *************** *** 97,100 **** --- 102,112 ---- /** + * Get current + * @return Current + */ + public Object getCurrent() { + return current; + } + /** * Display the construction space * @param o The object |
From: Michael L. <he...@us...> - 2006-01-18 11:41:25
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv845/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: MoveTool: AXIS_RESTRICTED now default AttributeView: Updates when displayed object are changed Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GenericTreeView.java 18 Jan 2006 09:43:40 -0000 1.7 --- GenericTreeView.java 18 Jan 2006 11:41:17 -0000 1.8 *************** *** 32,35 **** --- 32,38 ---- public class GenericTreeView extends TreeView implements Observer { + /** Show numbers of elements in display-string of container-nodes */ + private static final boolean SHOW_COUNTERS = false; + /** The model */ protected DefaultTreeModel model; *************** *** 120,124 **** */ public String toString() { ! return (this.getUserObject().toString() + " #" + this.getChildCount()); } /** --- 123,131 ---- */ public String toString() { ! if (SHOW_COUNTERS) { ! return (this.getUserObject().toString() + " #" + this.getChildCount()); ! } else { ! return this.getUserObject().toString(); ! } } /** |
From: Michael L. <he...@us...> - 2006-01-18 11:41:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv811/src/net/sourceforge/bprocessor/gl/tool Modified Files: MoveTool.java Log Message: MoveTool: AXIS_RESTRICTED now default AttributeView: Updates when displayed object are changed Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** MoveTool.java 13 Jan 2006 15:56:34 -0000 1.24 --- MoveTool.java 18 Jan 2006 11:41:14 -0000 1.25 *************** *** 83,87 **** moveConstructors = null; restrictionVector = null; ! moveMode = FREE_SNAP; } --- 83,87 ---- moveConstructors = null; restrictionVector = null; ! moveMode = AXIS_RESTRICTED; } |
From: Nikolaj B. <nbr...@us...> - 2006-01-18 10:12:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2658/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java MyKeyListener.java Log Message: Updated the attribute view for Surfaces to now also display space assignments. Index: MyKeyListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/MyKeyListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MyKeyListener.java 13 Jan 2006 09:29:29 -0000 1.4 --- MyKeyListener.java 18 Jan 2006 10:12:39 -0000 1.5 *************** *** 19,26 **** /** If its a textfield */ ! public static final String TFIELD = "Textfield"; /** If its a textfield */ ! public static final String TAREA = "Textarea"; /** The current ConstructionSpace */ --- 19,26 ---- /** If its a textfield */ ! public static final int TFIELD = 1; /** If its a textfield */ ! public static final int TAREA = 2; /** The current ConstructionSpace */ *************** *** 34,38 **** /** The type of component */ ! private String type; /** --- 34,38 ---- /** The type of component */ ! private int type; /** *************** *** 41,45 **** * @param type shows the type of the component the listeners listens too. */ ! public MyKeyListener (Object o, String type) { current = o; this.type = type; --- 41,45 ---- * @param type shows the type of the component the listeners listens too. */ ! public MyKeyListener (Object o, int type) { current = o; this.type = type; Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** AttributeView.java 16 Jan 2006 09:01:21 -0000 1.23 --- AttributeView.java 18 Jan 2006 10:12:39 -0000 1.24 *************** *** 16,19 **** --- 16,20 ---- import java.awt.Color; import java.awt.Dimension; + import java.awt.Font; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; *************** *** 75,84 **** /** Current object */ private Object current; /** If its a textfield */ ! public static final String TFIELD = "Textfield"; /** If its a textfield */ ! public static final String TAREA = "Textarea"; /** --- 76,91 ---- /** Current object */ private Object current; + + /** The font used in plain */ + private Font fontPlain = new Font("Sans-serif", Font.PLAIN, 12); + /** The font used in bold */ + private Font fontBold = new Font("Sans-serif", Font.BOLD, 12); + /** If its a textfield */ ! public static final int TFIELD = 1; /** If its a textfield */ ! public static final int TAREA = 2; /** *************** *** 102,107 **** --- 109,116 ---- con.weightx = 0; layout.setConstraints(name, con); + name.setFont(fontBold); add(name); + JTextField nameEdit = new JTextField(o.getName()); con.gridwidth = GridBagConstraints.REMAINDER; *************** *** 109,112 **** --- 118,122 ---- con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(nameEdit, con); + nameEdit.setFont(fontPlain); add(nameEdit); nameEdit.addKeyListener(new MyKeyListener(o, TFIELD)); *************** *** 203,210 **** --- 213,222 ---- con.weightx = 0; layout.setConstraints(name, con); + name.setFont(fontBold); add(name); JLabel surfaceName = new JLabel(o.getName()); layout.setConstraints(surfaceName, con); + surfaceName.setFont(fontPlain); add(surfaceName); *************** *** 214,225 **** con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(hfiller, con); ! add(hfiller); JLabel fcolor = new JLabel("Front: "); con.weightx = 0; ! con.gridwidth = 1; layout.setConstraints(fcolor, con); add(fcolor); { float[] frontColor = getFrontColor(o); --- 226,267 ---- con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(hfiller, con); ! add(hfiller); ! ! JLabel emptyLine = new JLabel(" "); ! con.weightx = 1; ! con.gridwidth = GridBagConstraints.REMAINDER; ! layout.setConstraints(emptyLine, con); ! add(emptyLine); JLabel fcolor = new JLabel("Front: "); con.weightx = 0; ! con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(fcolor, con); + fcolor.setFont(fontBold); add(fcolor); + + JLabel fspace = new JLabel("Space: "); + con.weightx = 0; + con.gridwidth = 1; + layout.setConstraints(fspace, con); + fspace.setFont(fontBold); + add(fspace); + + String fsn; + if (o.getFrontDomain() == null) { + fsn = "None"; + } else { + fsn = o.getFrontDomain().getName(); + } + + JLabel frontSpaceName = new JLabel(fsn); + layout.setConstraints(frontSpaceName, con); + con.weightx = 1; + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(frontSpaceName, con); + frontSpaceName.setFont(fontPlain); + add(frontSpaceName); + { float[] frontColor = getFrontColor(o); *************** *** 237,247 **** } JLabel bcolor = new JLabel("Back: "); con.weightx = 0; ! con.fill = GridBagConstraints.NONE; ! con.gridwidth = 1; layout.setConstraints(bcolor, con); ! add(bcolor); { float[] backColor = getBackColor(o); --- 279,318 ---- } + JLabel el = new JLabel(" "); + con.weightx = 1; + con.fill = GridBagConstraints.NONE; + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(el, con); + add(el); + JLabel bcolor = new JLabel("Back: "); con.weightx = 0; ! con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(bcolor, con); ! bcolor.setFont(fontBold); ! add(bcolor); ! ! JLabel bspace = new JLabel("Space: "); ! con.weightx = 0; ! con.gridwidth = 1; ! layout.setConstraints(bspace, con); ! bspace.setFont(fontBold); ! add(bspace); + String bsn; + if (o.getBackDomain() == null) { + bsn = "None"; + } else { + bsn = o.getBackDomain().getName(); + } + + JLabel backSpaceName = new JLabel(bsn); + layout.setConstraints(backSpaceName, con); + con.weightx = 1; + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(backSpaceName, con); + backSpaceName.setFont(fontPlain); + add(backSpaceName); + { float[] backColor = getBackColor(o); |
From: Michael L. <he...@us...> - 2006-01-18 09:43:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24903/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Removed drawing of lone vertices Ð gave bad performance Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GenericTreeView.java 6 Jan 2006 15:36:19 -0000 1.6 --- GenericTreeView.java 18 Jan 2006 09:43:40 -0000 1.7 *************** *** 115,118 **** --- 115,125 ---- super(object); } + + /** + * @return Display String + */ + public String toString() { + return (this.getUserObject().toString() + " #" + this.getChildCount()); + } /** * Always not be leaf |
From: Michael L. <he...@us...> - 2006-01-18 09:43:45
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24876/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Removed drawing of lone vertices Ð gave bad performance Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** View.java 16 Jan 2006 10:07:28 -0000 1.47 --- View.java 18 Jan 2006 09:43:36 -0000 1.48 *************** *** 58,61 **** --- 58,64 ---- private static Logger log = Logger.getLogger(View.class); + /** Specify if lone vertices are displayed */ + private static final boolean DRAW_LONE_VERTICES = false; + /** the color of the x axis */ public static final float[] X_AXIS_COLOR = new float[] {0.1f, 0.8f, 0.1f}; *************** *** 439,447 **** */ public void display(GLDrawable gld) { gl.glClearColor(bgColor[0], bgColor[1], bgColor[2], bgColor[3]); Plane xy = new Plane(0, 0, 1, 0); gl = gld.getGL(); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); ! glu = gld.getGLU(); int[] mode = new int[1]; --- 442,452 ---- */ public void display(GLDrawable gld) { + boolean hitdetection = false; + gl.glClearColor(bgColor[0], bgColor[1], bgColor[2], bgColor[3]); Plane xy = new Plane(0, 0, 1, 0); gl = gld.getGL(); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); ! glu = gld.getGLU(); int[] mode = new int[1]; *************** *** 455,458 **** --- 460,464 ---- gl.glSelectBuffer(512, selectBuffer); gl.glRenderMode(GL.GL_SELECT); + hitdetection = true; } *************** *** 475,479 **** --- 481,487 ---- gl.glColor3fv(lineColor); gl.glLineWidth(1.0f); + drawAll(gld); + gl.glEnable(GL.GL_DEPTH_TEST); *************** *** 824,856 **** } - - - // Draw any Vertex that are not part of an edge { ! gl.glColor3fv(lineColor); ! Iterator it = vertices.iterator(); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! if (v.getEdges().isEmpty()) { ! gl.glColor3fv(lineColor); ! gl.glPointSize(5.0f); ! gl.glBegin(GL.GL_POINTS); ! gl.glVertex3d(v.getX(), v.getY(), v.getZ()); ! gl.glEnd(); ! gl.glPointSize(1.0f); } ! } ! //Draw any temporary vertex not part of an edge ! gl.glColor3fv(lineColor); ! it = tempVertices.iterator(); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! if (v.getEdges().isEmpty()) { ! gl.glColor3fv(lineColor); ! gl.glPointSize(5.0f); ! gl.glBegin(GL.GL_POINTS); ! gl.glVertex3d(v.getX(), v.getY(), v.getZ()); ! gl.glEnd(); ! gl.glPointSize(1.0f); } } --- 832,864 ---- } { ! if (DRAW_LONE_VERTICES) { ! // Draw any Vertex that are not part of an edge ! gl.glColor3fv(lineColor); ! Iterator it = vertices.iterator(); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! if (v.getEdges().isEmpty()) { ! gl.glColor3fv(lineColor); ! gl.glPointSize(5.0f); ! gl.glBegin(GL.GL_POINTS); ! gl.glVertex3d(v.getX(), v.getY(), v.getZ()); ! gl.glEnd(); ! gl.glPointSize(1.0f); ! } } ! // Draw any temporary vertex not part of an edge ! gl.glColor3fv(lineColor); ! it = tempVertices.iterator(); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! if (v.getEdges().isEmpty()) { ! gl.glColor3fv(lineColor); ! gl.glPointSize(5.0f); ! gl.glBegin(GL.GL_POINTS); ! gl.glVertex3d(v.getX(), v.getY(), v.getZ()); ! gl.glEnd(); ! gl.glPointSize(1.0f); ! } } } |
From: Michael L. <he...@us...> - 2006-01-17 14:05:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31007/src/net/sourceforge/bprocessor/model/xml Modified Files: PersistenceManager.java Log Message: Some refactoring Index: PersistenceManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml/PersistenceManager.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PersistenceManager.java 16 Jan 2006 10:07:32 -0000 1.19 --- PersistenceManager.java 17 Jan 2006 14:05:08 -0000 1.20 *************** *** 142,146 **** Project.getInstance().intern(csm); ! mapper.put(new Long(cs.getId()), csm.getId()); } } --- 142,146 ---- Project.getInstance().intern(csm); ! mapper.put(new Long(cs.getId()), csm); } } *************** *** 160,164 **** Project.getInstance().intern(fsm); ! mapper.put(new Long(fs.getId()), fsm.getId()); } } --- 160,164 ---- Project.getInstance().intern(fsm); ! mapper.put(new Long(fs.getId()), fsm); } } *************** *** 183,187 **** Project.getInstance().intern(sm); ! mapper.put(new Long(s.getId()), sm.getId()); } } --- 183,187 ---- Project.getInstance().intern(sm); ! mapper.put(new Long(s.getId()), sm); } } *************** *** 204,208 **** Project.getInstance().intern(em); ! mapper.put(new Long(e.getId()), em.getId()); } } --- 204,208 ---- Project.getInstance().intern(em); ! mapper.put(new Long(e.getId()), em); } } *************** *** 227,231 **** Project.getInstance().intern(vm); ! mapper.put(new Long(v.getId()), vm.getId()); } } --- 227,231 ---- Project.getInstance().intern(vm); ! mapper.put(new Long(v.getId()), vm); } } *************** *** 241,247 **** Constructionspace cs = (Constructionspace)it.next(); ! Long id = (Long)mapper.get(new Long(cs.getId())); ! Space csm = ! Project.getInstance().findSpaceById(id); List as = cs.getAttributeref(); --- 241,245 ---- Constructionspace cs = (Constructionspace)it.next(); ! Space csm = (Space) mapper.get(new Long(cs.getId())); List as = cs.getAttributeref(); *************** *** 262,268 **** Iterator iss = ss.iterator(); while (iss.hasNext()) { ! Long sid = (Long)mapper.get((Long)iss.next()); ! net.sourceforge.bprocessor.model.Surface s = ! Project.getInstance().findSurfaceById(sid); sr.add(s); } --- 260,265 ---- Iterator iss = ss.iterator(); while (iss.hasNext()) { ! net.sourceforge.bprocessor.model.Surface s = ! (net.sourceforge.bprocessor.model.Surface) mapper.get((Long)iss.next()); sr.add(s); } *************** *** 282,288 **** Functionalspace fs = (Functionalspace)it.next(); ! Long id = (Long)mapper.get(new Long(fs.getId())); ! Space fsm = ! Project.getInstance().findSpaceById(id); List as = fs.getAttributeref(); --- 279,283 ---- Functionalspace fs = (Functionalspace)it.next(); ! Space fsm = (Space) mapper.get(new Long(fs.getId())); List as = fs.getAttributeref(); *************** *** 303,309 **** Iterator iss = ss.iterator(); while (iss.hasNext()) { ! Long sid = (Long)mapper.get((Long)iss.next()); ! net.sourceforge.bprocessor.model.Surface s = ! Project.getInstance().findSurfaceById(sid); sr.add(s); } --- 298,303 ---- Iterator iss = ss.iterator(); while (iss.hasNext()) { ! net.sourceforge.bprocessor.model.Surface s = ! (net.sourceforge.bprocessor.model.Surface) mapper.get((Long)iss.next()); sr.add(s); } *************** *** 324,330 **** (net.sourceforge.bprocessor.model.xml.Surface)it.next(); ! Long id = (Long)mapper.get(new Long(s.getId())); ! net.sourceforge.bprocessor.model.Surface sm = ! Project.getInstance().findSurfaceById(id); List es = s.getEdgeref(); --- 318,323 ---- (net.sourceforge.bprocessor.model.xml.Surface)it.next(); ! net.sourceforge.bprocessor.model.Surface sm = ! (net.sourceforge.bprocessor.model.Surface) mapper.get(new Long(s.getId())); List es = s.getEdgeref(); *************** *** 333,339 **** Iterator ies = es.iterator(); while (ies.hasNext()) { - Long eid = (Long)mapper.get((Long)ies.next()); net.sourceforge.bprocessor.model.Edge e = ! Project.getInstance().findEdgeById(eid); er.add(e); } --- 326,331 ---- Iterator ies = es.iterator(); while (ies.hasNext()) { net.sourceforge.bprocessor.model.Edge e = ! (net.sourceforge.bprocessor.model.Edge) mapper.get((Long)ies.next()); er.add(e); } *************** *** 346,367 **** Iterator iiss = iss.iterator(); while (iiss.hasNext()) { ! Long isid = (Long)mapper.get((Long)iiss.next()); ! net.sourceforge.bprocessor.model.Surface is = ! Project.getInstance().findSurfaceById(isid); isr.add(is); } sm.setHoles(isr); } ! Long bid = (Long)(mapper.get(new Long(s.getBackdomainref()))); ! if (bid != null) { ! sm.setBackDomain((Space) Project.getInstance().findSpaceById(bid)); } ! Long fid = (Long)(mapper.get(new Long(s.getFrontdomainref()))); ! if (fid != null) { ! sm.setFrontDomain((Space) Project.getInstance().findSpaceById(fid)); } ! Long eid = (Long)(mapper.get(new Long(s.getExteriorref()))); ! if (eid != null) { ! sm.setExterior(Project.getInstance().findSurfaceById(eid)); } } --- 338,359 ---- Iterator iiss = iss.iterator(); while (iiss.hasNext()) { ! net.sourceforge.bprocessor.model.Surface is = ! (net.sourceforge.bprocessor.model.Surface)mapper.get((Long)iiss.next()); isr.add(is); } sm.setHoles(isr); } ! Space b = (Space)(mapper.get(new Long(s.getBackdomainref()))); ! if (b != null) { ! sm.setBackDomain(b); } ! Space f = (Space)(mapper.get(new Long(s.getFrontdomainref()))); ! if (f != null) { ! sm.setFrontDomain(f); } ! net.sourceforge.bprocessor.model.Surface surface = ! (net.sourceforge.bprocessor.model.Surface)(mapper.get(new Long(s.getExteriorref()))); ! if (surface != null) { ! sm.setExterior(surface); } } *************** *** 379,394 **** (net.sourceforge.bprocessor.model.xml.Edge)it.next(); ! Long id = (Long)mapper.get(new Long(e.getId())); ! net.sourceforge.bprocessor.model.Edge em = ! Project.getInstance().findEdgeById(id); ! ! Long vid = (Long)mapper.get(new Long(e.getVertexfromref())); ! net.sourceforge.bprocessor.model.Vertex v = ! Project.getInstance().findVertexById(vid); ! em.setFrom(v); ! vid = (Long)mapper.get(new Long(e.getVertextoref())); ! v = Project.getInstance().findVertexById(vid); ! em.setTo(v); } } --- 371,384 ---- (net.sourceforge.bprocessor.model.xml.Edge)it.next(); ! net.sourceforge.bprocessor.model.Edge em = ! (net.sourceforge.bprocessor.model.Edge) mapper.get(new Long(e.getId())); ! net.sourceforge.bprocessor.model.Vertex from = ! (net.sourceforge.bprocessor.model.Vertex)mapper.get(new Long(e.getVertexfromref())); ! em.setFrom(from); ! ! net.sourceforge.bprocessor.model.Vertex to = ! (net.sourceforge.bprocessor.model.Vertex)mapper.get(new Long(e.getVertextoref())); ! em.setTo(to); } } *************** *** 403,411 **** while (it.hasNext()) { net.sourceforge.bprocessor.model.xml.Vertex v = ! (net.sourceforge.bprocessor.model.xml.Vertex)it.next(); ! ! Long id = (Long)mapper.get(new Long(v.getId())); ! net.sourceforge.bprocessor.model.Vertex vm = ! Project.getInstance().findVertexById(id); } } --- 393,400 ---- while (it.hasNext()) { net.sourceforge.bprocessor.model.xml.Vertex v = ! (net.sourceforge.bprocessor.model.xml.Vertex)it.next(); ! ! net.sourceforge.bprocessor.model.Vertex vm = ! (net.sourceforge.bprocessor.model.Vertex)mapper.get(new Long(v.getId())); } } |
From: Michael L. <he...@us...> - 2006-01-16 13:47:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31463/src/net/sourceforge/bprocessor/model Modified Files: Project.java Removed Files: MemoryFacade.java DatabaseFacade.java Log Message: Removed DatabaseFacade and MemoryFacade --- DatabaseFacade.java DELETED --- --- MemoryFacade.java DELETED --- Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Project.java 16 Jan 2006 11:42:50 -0000 1.17 --- Project.java 16 Jan 2006 13:46:59 -0000 1.18 *************** *** 8,11 **** --- 8,13 ---- package net.sourceforge.bprocessor.model; + import java.util.Collection; + import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; *************** *** 32,35 **** --- 34,57 ---- private List observers; + /** The vertices */ + private HashMap vertices = new HashMap(); + /** The vertex id */ + private long vertexId; + + /** The edges */ + private HashMap edges = new HashMap(); + /** The edge id */ + private long edgeId; + + /** The surfaces */ + private HashMap surfaces = new HashMap(); + /** The surface id */ + private long surfaceId; + + /** The domains */ + private HashMap spaces = new HashMap(); + /** The domain id */ + private long spaceId; + /** * Get the instance *************** *** 83,87 **** */ public void clear() { ! DatabaseFacade.getInstance().clear(); changed(this); } --- 105,112 ---- */ public void clear() { ! spaces.clear(); ! edges.clear(); ! surfaces.clear(); ! vertices.clear(); changed(this); } *************** *** 93,97 **** */ public void intern(Space space) { ! DatabaseFacade.getInstance().intern((Object) space); changed(this); } --- 118,123 ---- */ public void intern(Space space) { ! space.setId(new Long(spaceId++)); ! spaces.put(space.getId(), space); changed(this); } *************** *** 102,106 **** */ public Set getConstructionSpaces() { ! return DatabaseFacade.getInstance().getConstructionSpaces(); } --- 128,132 ---- */ public Set getConstructionSpaces() { ! return filter(spaces.values(), ConstructionSpace.class); } *************** *** 110,114 **** */ public Set getSpaces() { ! return DatabaseFacade.getInstance().getSpaces(); } --- 136,140 ---- */ public Set getSpaces() { ! return new HashSet(spaces.values()); } *************** *** 119,123 **** */ public Space findSpaceById(Long id) { ! return DatabaseFacade.getInstance().findSpaceById(id); } --- 145,149 ---- */ public Space findSpaceById(Long id) { ! return (Space) spaces.get(id); } *************** *** 127,131 **** */ public void intern(Edge e) { ! DatabaseFacade.getInstance().intern((Object) e); changed(this); } --- 153,158 ---- */ public void intern(Edge e) { ! e.setId(new Long(edgeId++)); ! edges.put(e.getId(), e); changed(this); } *************** *** 136,140 **** */ public void remove(Edge e) { ! DatabaseFacade.getInstance().remove(e); changed(this); } --- 163,168 ---- */ public void remove(Edge e) { ! edges.remove(e.getId()); ! e.setId(null); changed(this); } *************** *** 145,149 **** */ public Set getEdges() { ! return DatabaseFacade.getInstance().getEdges(); } --- 173,177 ---- */ public Set getEdges() { ! return new HashSet(edges.values()); } *************** *** 154,158 **** */ public Edge findEdgeById(Long id) { ! return DatabaseFacade.getInstance().findEdgeById(id); } --- 182,186 ---- */ public Edge findEdgeById(Long id) { ! return (Edge) edges.get(id); } *************** *** 177,183 **** } } ! } ! DatabaseFacade.getInstance().remove(space); ! changed(this); } --- 205,211 ---- } } ! } ! spaces.remove(space.getId()); ! space.setId(null); } *************** *** 187,191 **** */ public Set getFunctionalSpaces() { ! return DatabaseFacade.getInstance().getFunctionalSpaces(); } --- 215,219 ---- */ public Set getFunctionalSpaces() { ! return filter(spaces.values(), FunctionalSpace.class); } *************** *** 195,199 **** */ public void intern(Surface s) { ! DatabaseFacade.getInstance().intern((Object) s); changed(this); } --- 223,228 ---- */ public void intern(Surface s) { ! s.setId(new Long(surfaceId++)); ! surfaces.put(s.getId(), s); changed(this); } *************** *** 214,218 **** s.setFrontDomain(null); } ! DatabaseFacade.getInstance().remove(s); changed(this); } --- 243,248 ---- s.setFrontDomain(null); } ! surfaces.remove(s.getId()); ! s.setId(null); changed(this); } *************** *** 223,227 **** */ public Set getSurfaces() { ! return DatabaseFacade.getInstance().getSurfaces(); } --- 253,257 ---- */ public Set getSurfaces() { ! return new HashSet(surfaces.values()); } *************** *** 232,236 **** */ public Surface findSurfaceById(Long id) { ! return DatabaseFacade.getInstance().findSurfaceById(id); } --- 262,266 ---- */ public Surface findSurfaceById(Long id) { ! return (Surface) surfaces.get(id); } *************** *** 240,244 **** */ public void intern(Vertex v) { ! DatabaseFacade.getInstance().intern((Object) v); changed(this); } --- 270,275 ---- */ public void intern(Vertex v) { ! v.setId(new Long(vertexId++)); ! vertices.put(v.getId(), v); changed(this); } *************** *** 249,253 **** */ public void remove(Vertex v) { ! DatabaseFacade.getInstance().remove(v); changed(this); } --- 280,285 ---- */ public void remove(Vertex v) { ! vertices.remove(v.getId()); ! v.setId(null); changed(this); } *************** *** 258,262 **** */ public Set getVertices() { ! return DatabaseFacade.getInstance().getVertices(); } --- 290,294 ---- */ public Set getVertices() { ! return new HashSet(vertices.values()); } *************** *** 267,271 **** */ public Vertex findVertexById(Long id) { ! return DatabaseFacade.getInstance().findVertexById(id); } --- 299,303 ---- */ public Vertex findVertexById(Long id) { ! return (Vertex) vertices.get(id); } *************** *** 311,313 **** --- 343,364 ---- return result; } + + /** + * Make a set of objects in values of the specified clarse + * @param values The values to filter + * @param clarse The class + * @return The set + */ + private Set filter(Collection values, Class clarse) { + HashSet result = new HashSet(); + Iterator iter = values.iterator(); + while (iter.hasNext()) { + Object current = iter.next(); + if (current.getClass() == clarse) { + result.add(current); + } + } + return result; + } + } |
From: Michael L. <he...@us...> - 2006-01-16 11:43:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3369/src/net/sourceforge/bprocessor/model Modified Files: MemoryFacade.java Project.java DatabaseFacade.java Log Message: Cleaning up Index: DatabaseFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/DatabaseFacade.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DatabaseFacade.java 12 Dec 2005 20:18:52 -0000 1.6 --- DatabaseFacade.java 16 Jan 2006 11:42:50 -0000 1.7 *************** *** 37,47 **** */ public abstract void intern(Object o); - - /** - * Update an object - * @param o The object - */ - public abstract void update(Object o); - /** * Remove and object --- 37,40 ---- *************** *** 51,61 **** /** - * Find a attribute by id - * @param id The id - * @return The attribute - */ - public abstract Attribute findAttributeById(Long id); - - /** * Find all construction spaces * @return The construction spaces --- 44,47 ---- *************** *** 64,78 **** /** - * Find a construction space by id - * @param id The id - * @return The construction space - */ - public abstract ConstructionSpace findConstructionSpaceById(Long id); - - /** * Find all domains * @return the set of all domains */ ! public abstract Set getDomains(); /** --- 50,57 ---- /** * Find all domains * @return the set of all domains */ ! public abstract Set getSpaces(); /** *************** *** 81,85 **** * @return The domain */ ! public abstract Space findDomainById(Long id); /** --- 60,64 ---- * @return The domain */ ! public abstract Space findSpaceById(Long id); /** Index: MemoryFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/MemoryFacade.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MemoryFacade.java 12 Dec 2005 20:18:52 -0000 1.6 --- MemoryFacade.java 16 Jan 2006 11:42:50 -0000 1.7 *************** *** 35,41 **** /** The domains */ ! private HashMap domains = new HashMap(); /** The domain id */ ! private long domainId; /** --- 35,41 ---- /** The domains */ ! private HashMap spaces = new HashMap(); /** The domain id */ ! private long spaceId; /** *************** *** 63,67 **** v.setId(new Long(vertexId++)); vertices.put(v.getId(), v); - //System.out.println("v-intern " + v.toString()); } --- 63,66 ---- *************** *** 73,77 **** e.setId(new Long(edgeId++)); edges.put(e.getId(), e); - //System.out.println("e-intern " + e.toString()); } --- 72,75 ---- *************** *** 83,87 **** s.setId(new Long(surfaceId++)); surfaces.put(s.getId(), s); - //System.out.println("s-intern " + s.toString()); } --- 81,84 ---- *************** *** 91,104 **** */ private void intern(Space d) { ! d.setId(new Long(domainId++)); ! domains.put(d.getId(), d); ! } ! ! /** ! * Update an object ! * @param o The object ! */ ! public void update(Object o) { ! } --- 88,93 ---- */ private void intern(Space d) { ! d.setId(new Long(spaceId++)); ! spaces.put(d.getId(), d); } *************** *** 151,168 **** */ private void remove(Space d) { ! domains.remove(d.getId()); d.setId(null); } - - /** - * Find an attribute by id - * @param id The id - * @return The Attribute - */ - public Attribute findAttributeById(Long id) { - return null; - } - /** * Get construction spaces --- 140,147 ---- */ private void remove(Space d) { ! spaces.remove(d.getId()); d.setId(null); } /** * Get construction spaces *************** *** 170,183 **** */ public Set getConstructionSpaces() { ! return filter(domains.values(), ConstructionSpace.class); ! } ! ! /** ! * Find a construction space by id ! * @param id The id ! * @return The construction space ! */ ! public ConstructionSpace findConstructionSpaceById(Long id) { ! return (ConstructionSpace) domains.get(id); } --- 149,153 ---- */ public Set getConstructionSpaces() { ! return filter(spaces.values(), ConstructionSpace.class); } *************** *** 186,191 **** * @return The domains */ ! public Set getDomains() { ! return new HashSet(domains.values()); } --- 156,161 ---- * @return The domains */ ! public Set getSpaces() { ! return new HashSet(spaces.values()); } *************** *** 195,200 **** * @return The Domain */ ! public Space findDomainById(Long id) { ! return (Space) domains.get(id); } --- 165,170 ---- * @return The Domain */ ! public Space findSpaceById(Long id) { ! return (Space) spaces.get(id); } *************** *** 221,225 **** */ public Set getFunctionalSpaces() { ! return filter(domains.values(), FunctionalSpace.class); } --- 191,195 ---- */ public Set getFunctionalSpaces() { ! return filter(spaces.values(), FunctionalSpace.class); } *************** *** 230,234 **** */ public FunctionalSpace findFunctionalSpaceById(Long id) { ! return (FunctionalSpace) domains.get(id); } --- 200,204 ---- */ public FunctionalSpace findFunctionalSpaceById(Long id) { ! return (FunctionalSpace) spaces.get(id); } *************** *** 289,293 **** */ public void clear() { ! domains.clear(); edges.clear(); surfaces.clear(); --- 259,263 ---- */ public void clear() { ! spaces.clear(); edges.clear(); surfaces.clear(); Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Project.java 16 Jan 2006 10:07:32 -0000 1.16 --- Project.java 16 Jan 2006 11:42:50 -0000 1.17 *************** *** 110,114 **** */ public Set getSpaces() { ! return DatabaseFacade.getInstance().getDomains(); } --- 110,114 ---- */ public Set getSpaces() { ! return DatabaseFacade.getInstance().getSpaces(); } *************** *** 119,123 **** */ public Space findSpaceById(Long id) { ! return DatabaseFacade.getInstance().findDomainById(id); } --- 119,123 ---- */ public Space findSpaceById(Long id) { ! return DatabaseFacade.getInstance().findSpaceById(id); } *************** *** 170,179 **** if (back == space) { surface.setBackDomain(null); - DatabaseFacade.getInstance().update(surface); } else { Space front = surface.getFrontDomain(); if (front == space) { surface.setFrontDomain(null); - DatabaseFacade.getInstance().update(surface); } } --- 170,177 ---- |