bprocessor-commit Mailing List for B-processor (Page 139)
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: Nikolaj B. <nbr...@us...> - 2006-01-25 11:05:23
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13851/src/net/sourceforge/bprocessor/model Modified Files: Entity.java Log Message: Now sets the dirty attribute when an entity has been modified Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Entity.java 3 Jan 2006 13:03:32 -0000 1.2 --- Entity.java 25 Jan 2006 11:05:11 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- */ public void changed() { + Project.getInstance().makeDirty(); Project.getInstance().changed(this); } |
From: Nikolaj B. <nbr...@us...> - 2006-01-25 11:01:35
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12587/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileSaveActionListener.java FileNewActionListener.java FileLoadActionListener.java Added Files: FileCloseActionListener.java Log Message: File options, now check if changes has been made, also added close option. Index: FileSaveActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveActionListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileSaveActionListener.java 25 Jan 2006 09:33:04 -0000 1.1 --- FileSaveActionListener.java 25 Jan 2006 11:01:14 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.gui.actions; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.xml.PersistenceManager; *************** *** 43,46 **** --- 44,48 ---- try { PersistenceManager.save(file); + Project.getInstance().makeClean(); } catch (Exception ex) { log.error("Could not export to file: " + file, ex); Index: FileLoadActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileLoadActionListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileLoadActionListener.java 25 Jan 2006 09:33:04 -0000 1.1 --- FileLoadActionListener.java 25 Jan 2006 11:01:14 -0000 1.2 *************** *** 16,19 **** --- 16,20 ---- import javax.swing.JFileChooser; + import javax.swing.JOptionPane; import org.apache.log4j.Logger; *************** *** 37,54 **** */ public void actionPerformed(ActionEvent e) { ! JFileChooser chooser = new JFileChooser(); ! int state = chooser.showOpenDialog(null); ! File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { ! try { ! Selection.primary().clear(); ! Project.getInstance().clear(); ! PersistenceManager.load(file); ! } catch (Exception ex) { ! log.error("Could not import file: " + file, ex); } } } } --- 38,119 ---- */ public void actionPerformed(ActionEvent e) { ! ! if (Project.getInstance().isDirty()) { ! int n = JOptionPane.showConfirmDialog( ! null, ! "Do you want to save the changes?", ! "Projekt has been changed", ! JOptionPane.YES_NO_CANCEL_OPTION); ! if (n == 0) { ! JFileChooser chooser = new JFileChooser(); ! int state = chooser.showSaveDialog(null); ! File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { ! try { ! PersistenceManager.save(file); ! JFileChooser loadChooser = new JFileChooser(); ! int lstate = loadChooser.showOpenDialog(null); ! File lfile = loadChooser.getSelectedFile(); ! ! if (lfile != null && ! lstate == JFileChooser.APPROVE_OPTION) { ! try { ! Selection.primary().clear(); ! Project.getInstance().clear(); ! PersistenceManager.load(lfile); ! Project.getInstance().makeClean(); ! } catch (Exception ex) { ! log.error("Could not import file: " + lfile, ex); ! } ! } ! } catch (Exception ex) { ! log.error("Could not export to file: " + file, ex); ! } ! } ! } ! ! if (n == 1) { ! JFileChooser loadChooser = new JFileChooser(); ! int lstate = loadChooser.showOpenDialog(null); ! File lfile = loadChooser.getSelectedFile(); ! ! if (lfile != null && ! lstate == JFileChooser.APPROVE_OPTION) { ! try { ! Selection.primary().clear(); ! Project.getInstance().clear(); ! PersistenceManager.load(lfile); ! Project.getInstance().makeClean(); ! } catch (Exception ex) { ! log.error("Could not import file: " + lfile, ex); ! } ! } ! } ! ! } else { ! ! JFileChooser loadChooser = new JFileChooser(); ! int lstate = loadChooser.showOpenDialog(null); ! File lfile = loadChooser.getSelectedFile(); ! ! if (lfile != null && ! lstate == JFileChooser.APPROVE_OPTION) { ! try { ! Selection.primary().clear(); ! Project.getInstance().clear(); ! PersistenceManager.load(lfile); ! Project.getInstance().makeClean(); ! } catch (Exception ex) { ! log.error("Could not import file: " + lfile, ex); ! } } } + + + + + } } Index: FileNewActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileNewActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileNewActionListener.java 11 Jan 2006 09:07:58 -0000 1.2 --- FileNewActionListener.java 25 Jan 2006 11:01:14 -0000 1.3 *************** *** 10,16 **** --- 10,23 ---- import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import java.io.File; + + import javax.swing.JFileChooser; + import javax.swing.JOptionPane; + + import org.apache.log4j.Logger; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; + import net.sourceforge.bprocessor.model.xml.PersistenceManager; /** *************** *** 20,23 **** --- 27,33 ---- public class FileNewActionListener implements ActionListener { + /** The logger */ + private static Logger log = Logger.getLogger(FileCloseActionListener.class); + /** * Constructs the FileNewActionListner *************** *** 32,37 **** */ public void actionPerformed(ActionEvent event) { ! Selection.primary().clear(); ! Project.getInstance().clear(); } --- 42,79 ---- */ public void actionPerformed(ActionEvent event) { ! if (Project.getInstance().isDirty()) { ! int n = JOptionPane.showConfirmDialog( ! null, ! "Do you want to save the changes?", ! "Projekt has been changed", ! JOptionPane.YES_NO_CANCEL_OPTION); ! if (n == 0) { ! JFileChooser chooser = new JFileChooser(); ! int state = chooser.showSaveDialog(null); ! File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { ! try { ! PersistenceManager.save(file); ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! } catch (Exception ex) { ! log.error("Could not export to file: " + file, ex); ! } ! } ! } ! ! if (n == 1) { ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! } ! ! } else { ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! } } --- NEW FILE: FileCloseActionListener.java --- //--------------------------------------------------------------------------------- // $Id: FileCloseActionListener.java,v 1.1 2006/01/25 11:01:14 nbramsen 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.actions; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import org.apache.log4j.Logger; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.xml.PersistenceManager; /** * The FileCloseActionListener */ public class FileCloseActionListener implements ActionListener { /** The logger */ private static Logger log = Logger.getLogger(FileCloseActionListener.class); /** * Constructs the FileCloseActionListner */ public FileCloseActionListener() { super(); } /** * Clears the project * @param event The event */ public void actionPerformed(ActionEvent event) { if (Project.getInstance().isDirty()) { int n = JOptionPane.showConfirmDialog( null, "Do you want to save the changes?", "Projekt has been changed", JOptionPane.YES_NO_CANCEL_OPTION); if (n == 0) { JFileChooser chooser = new JFileChooser(); int state = chooser.showSaveDialog(null); File file = chooser.getSelectedFile(); if (file != null && state == JFileChooser.APPROVE_OPTION) { try { PersistenceManager.save(file); Selection.primary().clear(); Project.getInstance().clear(); Project.getInstance().makeClean(); } catch (Exception ex) { log.error("Could not export to file: " + file, ex); } } } if (n == 1) { Selection.primary().clear(); Project.getInstance().clear(); Project.getInstance().makeClean(); } } else { Selection.primary().clear(); Project.getInstance().clear(); Project.getInstance().makeClean(); } } } |
From: Nikolaj B. <nbr...@us...> - 2006-01-25 11:01:33
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12587/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: File options, now check if changes has been made, also added close option. Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GUI.java 25 Jan 2006 09:33:04 -0000 1.23 --- GUI.java 25 Jan 2006 11:01:14 -0000 1.24 *************** *** 13,16 **** --- 13,17 ---- import net.sourceforge.bprocessor.gui.actions.CreatePartActionListener; import net.sourceforge.bprocessor.gui.actions.CreateSurfaceActionListener; + import net.sourceforge.bprocessor.gui.actions.FileCloseActionListener; import net.sourceforge.bprocessor.gui.actions.FileExitActionListener; import net.sourceforge.bprocessor.gui.actions.FileExportActionListener; *************** *** 125,128 **** --- 126,135 ---- file.add(fileSave); + JMenuItem fileClose = new JMenuItem("Close"); + fileClose.addActionListener(new FileCloseActionListener()); + fileClose.setMnemonic(KeyEvent.VK_C); + fileClose.setEnabled(true); + file.add(fileClose); + file.addSeparator(); |
From: Michael L. <he...@us...> - 2006-01-25 10:02:20
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25291a/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: code cleanup Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Project.java 24 Jan 2006 14:10:42 -0000 1.22 --- Project.java 25 Jan 2006 10:02:13 -0000 1.23 *************** *** 187,190 **** --- 187,209 ---- /** + * Delete an Edge + * @param edge The edge + */ + public void delete(Edge edge) { + if (edge.getId() != null) { + Set surfaces = edge.getSurfaces(); + remove(edge); + Iterator it = surfaces.iterator(); + while (it.hasNext()) { + Surface surface = (Surface)it.next(); + remove(surface); + } + delete(edge.getTo()); + delete(edge.getFrom()); + } + } + + + /** * Remove an edge * @param e The edge *************** *** 239,242 **** --- 258,269 ---- /** + * Delete a space + * @param space The space to delete + */ + public void delete(Space space) { + + } + + /** * Find all functional spaces * @return The functional spaces *************** *** 275,278 **** --- 302,325 ---- changed(this); } + + /** + * Delete a surface + * @param surface The surface to delete + */ + public void delete(Surface surface) { + if (surface.getExterior() != null) { + Surface exterior = surface.getExterior(); + exterior.removeHole(surface); + } + remove(surface); + List edges = surface.getEdges(); + Iterator it = edges.iterator(); + while (it.hasNext()) { + Edge edge = (Edge)it.next(); + if (edge.getSurfaces().size() < 1) { + delete(edge); + } + } + } /** *************** *** 312,315 **** --- 359,375 ---- changed(this); } + + /** + * Delete a vertex + * @param vertex The vertex to delete + */ + public void delete(Vertex vertex) { + if (vertex.getId() != null) { + Set edges = vertex.getEdges(); + if (edges.size() < 1) { + Project.getInstance().remove(vertex); + } + } + } /** |
From: Michael L. <he...@us...> - 2006-01-25 10:02:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25269/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java PencilTool.java ExtrudeTool.java TapeMeasureTool.java SelectTool.java Log Message: code cleanup Index: TapeMeasureTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasureTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TapeMeasureTool.java 26 Dec 2005 15:09:04 -0000 1.6 --- TapeMeasureTool.java 25 Jan 2006 10:02:09 -0000 1.7 *************** *** 12,15 **** --- 12,16 ---- import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; *************** *** 296,301 **** movePlane = null; edgeToConstruction = null; ! removeVertex(edgePoint); ! removeVertex(constructionPoint); measuring = false; } --- 297,302 ---- movePlane = null; edgeToConstruction = null; ! Project.getInstance().remove(edgePoint); ! Project.getInstance().remove(constructionPoint); measuring = false; } Index: ExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrudeTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ExtrudeTool.java 23 Jan 2006 10:16:22 -0000 1.7 --- ExtrudeTool.java 25 Jan 2006 10:02:09 -0000 1.8 *************** *** 142,150 **** private void apply(double length) { if (top != null) { ! deleteSurface(top); Iterator iter = sides.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); ! deleteSurface(current); } sides = null; --- 142,150 ---- private void apply(double length) { if (top != null) { ! Project.getInstance().delete(top); Iterator iter = sides.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); ! Project.getInstance().delete(current); } sides = null; *************** *** 254,263 **** if (Math.abs(t) < 0.0000001) { if (top != null) { ! deleteSurface(top); top = null; Iterator iter = sides.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); ! deleteSurface(current); } sides = null; --- 254,263 ---- if (Math.abs(t) < 0.0000001) { if (top != null) { ! Project.getInstance().delete(top); top = null; Iterator iter = sides.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); ! Project.getInstance().delete(current); } sides = null; Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** SelectTool.java 11 Jan 2006 12:05:33 -0000 1.51 --- SelectTool.java 25 Jan 2006 10:02:09 -0000 1.52 *************** *** 11,14 **** --- 11,15 ---- import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; *************** *** 156,167 **** Object selected = it.next(); if (selected instanceof Surface) { ! Surface selectedSurface = (Surface)selected; ! deleteSurface(selectedSurface); } else if (selected instanceof Edge) { ! Edge selectedEdge = (Edge)selected; ! deleteEdge(selectedEdge); } else if (selected instanceof Vertex) { ! deleteVertex((Vertex) selected); ! } else if (selected instanceof ClippingPlane) { glv.getView().removeClippingPlane((ClippingPlane)selected); } --- 157,166 ---- Object selected = it.next(); if (selected instanceof Surface) { ! Project.getInstance().delete((Surface)selected); } else if (selected instanceof Edge) { ! Project.getInstance().delete((Edge)selected); } else if (selected instanceof Vertex) { ! Project.getInstance().delete((Vertex) selected); ! } else if (selected instanceof ClippingPlane) { glv.getView().removeClippingPlane((ClippingPlane)selected); } *************** *** 169,173 **** selection.clear(); glv.getView().makeTarget(null); - glv.repaint(); } else { super.keyPressed(e); --- 168,171 ---- Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** PencilTool.java 24 Jan 2006 14:10:32 -0000 1.58 --- PencilTool.java 25 Jan 2006 10:02:09 -0000 1.59 *************** *** 671,680 **** if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { if (active != null) { ! deleteEdge(active); } Iterator it = edges.iterator(); while (it.hasNext()) { Edge edge = (Edge)it.next(); ! deleteEdge(edge); } edges = null; --- 671,680 ---- if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { if (active != null) { ! Project.getInstance().delete(active); } Iterator it = edges.iterator(); while (it.hasNext()) { Edge edge = (Edge)it.next(); ! Project.getInstance().delete(edge); } edges = null; Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** AbstractTool.java 24 Jan 2006 14:10:32 -0000 1.53 --- AbstractTool.java 25 Jan 2006 10:02:09 -0000 1.54 *************** *** 62,74 **** private static int dy = 0; - /** An vertex counter */ - protected static long vertexNum = 1; - - /** An edge counter */ - protected static long edgeNum = 1; - - /** An surface counter */ - protected static long surfaceNum = 1; - /** The snap variable */ protected static final double EPSILON = 0.4; --- 62,65 ---- *************** *** 375,410 **** /** - * @return The x distance the mouse has moved since press - */ - protected int getdx() { - return dx; - } - - /** - * @return The y distance the mouse has moved since press - */ - protected int getdy() { - return dy; - } - - /** - * Take a coordinate and check if it should snap to grid - * @param coords The coordinates to check for snapping - * @return the snapped coordinates - */ - protected double[] snapToGrid(double[] coords) { - if (Math.abs(coords[0] - Math.round(coords[0])) < EPSILON) { - coords[0] = Math.round(coords[0]); - } - if (Math.abs(coords[1] - Math.round(coords[1])) < EPSILON) { - coords[1] = Math.round(coords[1]); - } - if (Math.abs(coords[2] - Math.round(coords[2])) < EPSILON) { - coords[2] = Math.round(coords[2]); - } - return coords; - } - - /** * Make and register a new vertex * @param coord The coordinates to create with --- 366,369 ---- *************** *** 413,425 **** protected Vertex createVertex(double[] coord) { if (coord.length == 3) { ! Vertex v = new Vertex(); ! vertexNum++; ! ! v.setX(coord[0]); ! v.setY(coord[1]); ! v.setZ(coord[2]); ! Project.getInstance().add(v); ! ! return v; } else { log.error("[createVertex] wrong argument length was: " + coord.length); --- 372,378 ---- protected Vertex createVertex(double[] coord) { if (coord.length == 3) { ! Vertex vertex = new Vertex(coord[0], coord[1], coord[2]); ! Project.getInstance().add(vertex); ! return vertex; } else { log.error("[createVertex] wrong argument length was: " + coord.length); *************** *** 427,472 **** } } - - /** - * Make and register a new vertex - * @param vertex The vertex - * @return The registered Vertex - */ - protected Vertex createVertex(Vertex vertex) { - if (vertex != null) { - Vertex v = new Vertex(vertex.getX(), - vertex.getY(), - vertex.getZ()); - Project.getInstance().add(v); - return v; - } else { - log.warn("attempted to create null vertex"); - return null; - } - } - - /** - * Update the coordinates of the vertex v - * @param v The vertex to change coordinates on - * @param coord The new coordinates - */ - protected void updateVertex(Vertex v, double[] coord) { - if (coord.length == 3) { - v.setX(coord[0]); - v.setY(coord[1]); - v.setZ(coord[2]); - v.changed(); - } else { - log.error("[updateVertex] wrong argument length was: " + coord.length); - } - } - - /** - * Remove a vertex for good - * @param v Vertex to remove - */ - protected void removeVertex(Vertex v) { - Project.getInstance().remove(v); - } /** --- 380,383 ---- *************** *** 477,574 **** */ protected Edge createEdge(Vertex from, Vertex to) { ! Edge e = new Edge(); ! e.setTo(to); ! e.setFrom(from); ! Project.getInstance().add(e); ! return e; ! } ! ! /** ! * Remove a edge for good ! * @param e Edge to remove ! */ ! protected void removeEdge(Edge e) { ! Project.getInstance().remove(e); ! } ! ! /** ! * Updates the edge ! * @param e The edge to update ! */ ! protected void updateEdge(Edge e) { ! e.changed(); } /** * Make and register a new Surface ! * @param list The list of edges in the surface * @return The new Surface */ ! protected Surface createSurface(List list) { ! Surface s = new Surface(list); ! Project.getInstance().add(s); ! return s; ! } ! ! /** ! * Remove a Surface for good ! * @param s Surface to remove ! */ ! protected void removeSurface(Surface s) { ! Project.getInstance().remove(s); ! } ! ! /** ! * Deletes a surface and its edges if it is safe to do so. ! * @param surface the surface to delete ! */ ! protected void deleteSurface(Surface surface) { ! if (surface.getExterior() != null) { ! Surface exterior = surface.getExterior(); ! exterior.removeHole(surface); ! } ! removeSurface(surface); ! List edges = surface.getEdges(); ! Iterator it = edges.iterator(); ! while (it.hasNext()) { ! Edge edge = (Edge)it.next(); ! if (edge.getSurfaces().size() < 1) { ! deleteEdge(edge); ! } ! } ! glv.repaint(); ! } ! ! /** ! * Deletes an edge and it's endpoint vertecies if it is safe to do so. ! * @param edge the edge to delete ! */ ! protected void deleteEdge(Edge edge) { ! if (edge.getId() != null) { ! Set surfaces = edge.getSurfaces(); ! removeEdge(edge); ! Iterator it = surfaces.iterator(); ! while (it.hasNext()) { ! Surface surf = (Surface)it.next(); ! deleteSurface(surf); ! } ! deleteVertex(edge.getTo()); ! deleteVertex(edge.getFrom()); ! glv.repaint(); ! } ! } ! ! /** ! * Deletes a vertex if it is safe to do so. ! * @param vertex the vertex to delete ! */ ! protected void deleteVertex(Vertex vertex) { ! if (vertex.getId() != null) { ! Set edges = vertex.getEdges(); ! if (edges.size() < 1) { ! removeVertex(vertex); ! glv.repaint(); ! } ! } } --- 388,405 ---- */ protected Edge createEdge(Vertex from, Vertex to) { ! Edge edge = new Edge(from, to); ! Project.getInstance().add(edge); ! return edge; } /** * Make and register a new Surface ! * @param edges The list of edges in the surface * @return The new Surface */ ! protected Surface createSurface(List edges) { ! Surface surface = new Surface(edges); ! Project.getInstance().add(surface); ! return surface; } |
From: Nikolaj B. <nbr...@us...> - 2006-01-25 09:33:18
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15603/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Added Load and Save functionality to the File menu Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** GUI.java 19 Jan 2006 10:59:40 -0000 1.22 --- GUI.java 25 Jan 2006 09:33:04 -0000 1.23 *************** *** 16,21 **** --- 16,23 ---- import net.sourceforge.bprocessor.gui.actions.FileExportActionListener; import net.sourceforge.bprocessor.gui.actions.FileImportActionListener; + import net.sourceforge.bprocessor.gui.actions.FileLoadActionListener; import net.sourceforge.bprocessor.gui.actions.FileNewActionListener; import net.sourceforge.bprocessor.gui.actions.FilePropertiesActionListener; + import net.sourceforge.bprocessor.gui.actions.FileSaveActionListener; import net.sourceforge.bprocessor.gui.actions.ToolsDetachActionListener; import net.sourceforge.bprocessor.gui.actions.ToolsJoinActionListener; *************** *** 111,114 **** --- 113,128 ---- file.add(fileNew); + JMenuItem fileLoad = new JMenuItem("Load"); + fileLoad.addActionListener(new FileLoadActionListener()); + fileLoad.setMnemonic(KeyEvent.VK_L); + fileLoad.setEnabled(true); + file.add(fileLoad); + + JMenuItem fileSave = new JMenuItem("Save"); + fileSave.addActionListener(new FileSaveActionListener()); + fileSave.setMnemonic(KeyEvent.VK_S); + fileSave.setEnabled(true); + file.add(fileSave); + file.addSeparator(); |
From: Nikolaj B. <nbr...@us...> - 2006-01-25 09:33:12
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15603/src/net/sourceforge/bprocessor/gui/actions Added Files: FileSaveActionListener.java FileLoadActionListener.java Log Message: Added Load and Save functionality to the File menu --- NEW FILE: FileSaveActionListener.java --- //--------------------------------------------------------------------------------- // $Id: FileSaveActionListener.java,v 1.1 2006/01/25 09:33:04 nbramsen 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.actions; import net.sourceforge.bprocessor.model.xml.PersistenceManager; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import javax.swing.JFileChooser; import org.apache.log4j.Logger; /** * The file->save action listener */ public class FileSaveActionListener implements ActionListener { /** The logger */ private static Logger log = Logger.getLogger(FileSaveActionListener.class); /** * FileSaveActionListener */ public FileSaveActionListener() { } /** * Action performed * @param e The action event */ public void actionPerformed(ActionEvent e) { JFileChooser chooser = new JFileChooser(); int state = chooser.showSaveDialog(null); File file = chooser.getSelectedFile(); if (file != null && state == JFileChooser.APPROVE_OPTION) { try { PersistenceManager.save(file); } catch (Exception ex) { log.error("Could not export to file: " + file, ex); } } } } --- NEW FILE: FileLoadActionListener.java --- //--------------------------------------------------------------------------------- // $Id: FileLoadActionListener.java,v 1.1 2006/01/25 09:33:04 nbramsen 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.actions; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.xml.PersistenceManager; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import javax.swing.JFileChooser; import org.apache.log4j.Logger; /** * The file->load action listener */ public class FileLoadActionListener implements ActionListener { /** The logger */ private static Logger log = Logger.getLogger(FileLoadActionListener.class); /** * FileLoadActionListener */ public FileLoadActionListener() { } /** * Action performed * @param e The action event */ public void actionPerformed(ActionEvent e) { JFileChooser chooser = new JFileChooser(); int state = chooser.showOpenDialog(null); File file = chooser.getSelectedFile(); if (file != null && state == JFileChooser.APPROVE_OPTION) { try { Selection.primary().clear(); Project.getInstance().clear(); PersistenceManager.load(file); } catch (Exception ex) { log.error("Could not import file: " + file, ex); } } } } |
From: Nikolaj B. <nbr...@us...> - 2006-01-25 09:32:40
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15456/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Small adjustment. Back, and Front labels remove, and more decimals added. Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AttributeView.java 23 Jan 2006 02:46:59 -0000 1.28 --- AttributeView.java 25 Jan 2006 09:32:29 -0000 1.29 *************** *** 262,267 **** 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; --- 262,267 ---- add(x); ! int xval = (int) (o.getX() * 10000); ! JTextField xEdit = new JTextField((Double.toString(((double) xval) / 10000))); con.gridwidth = GridBagConstraints.REMAINDER; con.weightx = 1.0; *************** *** 280,285 **** 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; --- 280,285 ---- add(y); ! int yval = (int) (o.getY() * 10000); ! JTextField yEdit = new JTextField((Double.toString(((double) yval) / 10000))); con.gridwidth = GridBagConstraints.REMAINDER; con.weightx = 1.0; *************** *** 298,303 **** 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; --- 298,303 ---- add(z); ! int zval = (int) (o.getZ() * 10000); ! JTextField zEdit = new JTextField((Double.toString(((double) zval) / 10000))); con.gridwidth = GridBagConstraints.REMAINDER; con.weightx = 1.0; *************** *** 355,360 **** 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; --- 355,360 ---- add(length); ! int l = (int) (o.getLength() * 10000); ! JTextField lengthEdit = new JTextField((Double.toString(((double) l) / 10000))); con.gridwidth = GridBagConstraints.REMAINDER; con.weightx = 1.0; *************** *** 404,422 **** 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; --- 404,408 ---- layout.setConstraints(hfiller, con); add(hfiller); ! JLabel fspace = new JLabel("Space: "); con.weightx = 0; *************** *** 436,439 **** --- 422,426 ---- layout.setConstraints(frontSpaceName, con); con.weightx = 1; + con.fill = GridBagConstraints.HORIZONTAL; con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(frontSpaceName, con); *************** *** 455,473 **** front.addMouseListener(new MyMouseListener(o, true)); //true = front color to be changed } ! ! 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; --- 442,446 ---- front.addMouseListener(new MyMouseListener(o, true)); //true = front color to be changed } ! JLabel bspace = new JLabel("Space: "); con.weightx = 0; |
From: Michael L. <he...@us...> - 2006-01-24 14:11:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25681/src/net/sourceforge/bprocessor/model/xml Modified Files: PersistenceManager.java Log Message: intern renamed to add Index: PersistenceManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml/PersistenceManager.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PersistenceManager.java 23 Jan 2006 10:16:32 -0000 1.21 --- PersistenceManager.java 24 Jan 2006 14:10:42 -0000 1.22 *************** *** 141,145 **** csm.setDescription(cs.getDescription()); ! Project.getInstance().intern(csm); mapper.put(new Long(cs.getId()), csm); --- 141,145 ---- csm.setDescription(cs.getDescription()); ! Project.getInstance().add(csm); mapper.put(new Long(cs.getId()), csm); *************** *** 159,163 **** fsm.setDescription(fs.getDescription()); ! Project.getInstance().intern(fsm); mapper.put(new Long(fs.getId()), fsm); --- 159,163 ---- fsm.setDescription(fs.getDescription()); ! Project.getInstance().add(fsm); mapper.put(new Long(fs.getId()), fsm); *************** *** 182,186 **** //sm.setIsInner(s.isIsinner()); ! Project.getInstance().intern(sm); mapper.put(new Long(s.getId()), sm); --- 182,186 ---- //sm.setIsInner(s.isIsinner()); ! Project.getInstance().add(sm); mapper.put(new Long(s.getId()), sm); *************** *** 203,207 **** em.setConstructor(e.isConstructor()); ! Project.getInstance().intern(em); mapper.put(new Long(e.getId()), em); --- 203,207 ---- em.setConstructor(e.isConstructor()); ! Project.getInstance().add(em); mapper.put(new Long(e.getId()), em); *************** *** 226,230 **** vm.setZ(v.getZ()); ! Project.getInstance().intern(vm); mapper.put(new Long(v.getId()), vm); --- 226,230 ---- vm.setZ(v.getZ()); ! Project.getInstance().add(vm); mapper.put(new Long(v.getId()), vm); |
From: Michael L. <he...@us...> - 2006-01-24 14:11:08
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25623/src/net/sourceforge/bprocessor/gui/actions Modified Files: CreateConstructionSpaceActionListener.java CreateConstructorActionListener.java CreateElementActionListener.java CreateFunctionalSpaceActionListener.java CreatePartActionListener.java CreateSurfaceActionListener.java Log Message: intern renamed to add Index: CreateElementActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateElementActionListener.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CreateElementActionListener.java 11 Dec 2005 17:27:54 -0000 1.7 --- CreateElementActionListener.java 24 Jan 2006 14:10:37 -0000 1.8 *************** *** 46,50 **** Space space = new Space(result.trim()); ! Project.getInstance().intern(space); } } --- 46,50 ---- Space space = new Space(result.trim()); ! Project.getInstance().add(space); } } Index: CreatePartActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreatePartActionListener.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CreatePartActionListener.java 11 Dec 2005 17:27:54 -0000 1.7 --- CreatePartActionListener.java 24 Jan 2006 14:10:37 -0000 1.8 *************** *** 45,49 **** if (result != null && !result.trim().equals("")) { Space space = new Space(result.trim()); ! Project.getInstance().intern(space); } } --- 45,49 ---- if (result != null && !result.trim().equals("")) { Space space = new Space(result.trim()); ! Project.getInstance().add(space); } } Index: CreateSurfaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateSurfaceActionListener.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CreateSurfaceActionListener.java 19 Dec 2005 07:50:31 -0000 1.7 --- CreateSurfaceActionListener.java 24 Jan 2006 14:10:37 -0000 1.8 *************** *** 46,50 **** Surface s = new Surface(); ! Project.getInstance().intern(s); } } --- 46,50 ---- Surface s = new Surface(); ! Project.getInstance().add(s); } } Index: CreateConstructionSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateConstructionSpaceActionListener.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CreateConstructionSpaceActionListener.java 12 Dec 2005 20:19:22 -0000 1.7 --- CreateConstructionSpaceActionListener.java 24 Jan 2006 14:10:36 -0000 1.8 *************** *** 45,49 **** if (result != null && !result.trim().equals("")) { Space cs = Space.createConstructionSpace(result.trim()); ! Project.getInstance().intern(cs); } } --- 45,49 ---- if (result != null && !result.trim().equals("")) { Space cs = Space.createConstructionSpace(result.trim()); ! Project.getInstance().add(cs); } } Index: CreateConstructorActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateConstructorActionListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CreateConstructorActionListener.java 19 Dec 2005 07:50:31 -0000 1.6 --- CreateConstructorActionListener.java 24 Jan 2006 14:10:37 -0000 1.7 *************** *** 47,51 **** s.setConstructor(true); ! Project.getInstance().intern(s); } } --- 47,51 ---- s.setConstructor(true); ! Project.getInstance().add(s); } } Index: CreateFunctionalSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateFunctionalSpaceActionListener.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CreateFunctionalSpaceActionListener.java 12 Dec 2005 20:19:22 -0000 1.7 --- CreateFunctionalSpaceActionListener.java 24 Jan 2006 14:10:37 -0000 1.8 *************** *** 45,49 **** if (result != null && !result.trim().equals("")) { Space fs = Space.createFunctionalSpace(result.trim()); ! Project.getInstance().intern(fs); } } --- 45,49 ---- if (result != null && !result.trim().equals("")) { Space fs = Space.createFunctionalSpace(result.trim()); ! Project.getInstance().add(fs); } } |
From: Michael L. <he...@us...> - 2006-01-24 14:11:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25681/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Surface.java Geometry.java Project.java Log Message: intern renamed to add Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Surface.java 23 Jan 2006 10:16:32 -0000 1.65 --- Surface.java 24 Jan 2006 14:10:42 -0000 1.66 *************** *** 365,369 **** newFrom = from.copy(); map.put(from.getId(), newFrom); ! Project.getInstance().intern(newFrom); } newEdge.setFrom(newFrom); --- 365,369 ---- newFrom = from.copy(); map.put(from.getId(), newFrom); ! Project.getInstance().add(newFrom); } newEdge.setFrom(newFrom); *************** *** 373,384 **** newTo = to.copy(); map.put(to.getId(), newTo); ! Project.getInstance().intern(newTo); } newEdge.setTo(newTo); ! Project.getInstance().intern(newEdge); edges.add(newEdge); } surface.setEdges(edges); ! Project.getInstance().intern(surface); return surface; } --- 373,384 ---- newTo = to.copy(); map.put(to.getId(), newTo); ! Project.getInstance().add(newTo); } newEdge.setTo(newTo); ! Project.getInstance().add(newEdge); edges.add(newEdge); } surface.setEdges(edges); ! Project.getInstance().add(surface); return surface; } *************** *** 425,439 **** for (int i = 0; i < n; i++) { vmap[i] = v[i].add(normal); ! Project.getInstance().intern(vmap[i]); } for (int i = 0; i < n; i++) { topmap[i] = new Edge(vmap[i], vmap[(i + 1) % n]); ! Project.getInstance().intern(topmap[i]); } for (int i = 0; i < n; i++) { sidemap[i] = new Edge(v[i], vmap[i]); ! Project.getInstance().intern(sidemap[i]); } --- 425,439 ---- for (int i = 0; i < n; i++) { vmap[i] = v[i].add(normal); ! Project.getInstance().add(vmap[i]); } for (int i = 0; i < n; i++) { topmap[i] = new Edge(vmap[i], vmap[(i + 1) % n]); ! Project.getInstance().add(topmap[i]); } for (int i = 0; i < n; i++) { sidemap[i] = new Edge(v[i], vmap[i]); ! Project.getInstance().add(sidemap[i]); } *************** *** 449,453 **** newEdges.add(b); facemap[i] = new Surface(newEdges); ! Project.getInstance().intern(facemap[i]); sides.add(facemap[i]); } --- 449,453 ---- newEdges.add(b); facemap[i] = new Surface(newEdges); ! Project.getInstance().add(facemap[i]); sides.add(facemap[i]); } *************** *** 459,463 **** } top = new Surface(newEdges); ! Project.getInstance().intern(top); } --- 459,463 ---- } top = new Surface(newEdges); ! Project.getInstance().add(top); } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Edge.java 23 Jan 2006 10:16:32 -0000 1.26 --- Edge.java 24 Jan 2006 14:10:42 -0000 1.27 *************** *** 271,277 **** Vertex to = getTo(); Edge e1 = new Edge(from, vertex); ! Project.getInstance().intern(e1); Edge e2 = new Edge(vertex, to); ! Project.getInstance().intern(e2); --- 271,277 ---- Vertex to = getTo(); Edge e1 = new Edge(from, vertex); ! Project.getInstance().add(e1); Edge e2 = new Edge(vertex, to); ! Project.getInstance().add(e2); Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Geometry.java 22 Dec 2005 11:19:57 -0000 1.9 --- Geometry.java 24 Jan 2006 14:10:42 -0000 1.10 *************** *** 236,240 **** if (clockwise != null) { if (clockwise.angle(vertex.system()) < 0) { ! Project.getInstance().intern(clockwise); surfaces.add(clockwise); count++; --- 236,240 ---- if (clockwise != null) { if (clockwise.angle(vertex.system()) < 0) { ! Project.getInstance().add(clockwise); surfaces.add(clockwise); count++; *************** *** 246,250 **** if (counterclockwise != null) { if (counterclockwise.angle(vertex.system()) > 0) { ! Project.getInstance().intern(counterclockwise); surfaces.add(counterclockwise); count++; --- 246,250 ---- if (counterclockwise != null) { if (counterclockwise.angle(vertex.system()) > 0) { ! Project.getInstance().add(counterclockwise); surfaces.add(counterclockwise); count++; Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Project.java 24 Jan 2006 09:24:57 -0000 1.21 --- Project.java 24 Jan 2006 14:10:42 -0000 1.22 *************** *** 145,149 **** * @param space The space */ ! public void intern(Space space) { space.setId(new Long(spaceId++)); spaces.put(space.getId(), space); --- 145,149 ---- * @param space The space */ ! public void add(Space space) { space.setId(new Long(spaceId++)); spaces.put(space.getId(), space); *************** *** 180,184 **** * @param e The edge */ ! public void intern(Edge e) { e.setId(new Long(edgeId++)); edges.put(e.getId(), e); --- 180,184 ---- * @param e The edge */ ! public void add(Edge e) { e.setId(new Long(edgeId++)); edges.put(e.getId(), e); *************** *** 250,254 **** * @param s The surface */ ! public void intern(Surface s) { s.setId(new Long(surfaceId++)); surfaces.put(s.getId(), s); --- 250,254 ---- * @param s The surface */ ! public void add(Surface s) { s.setId(new Long(surfaceId++)); surfaces.put(s.getId(), s); *************** *** 297,301 **** * @param v The vertex */ ! public void intern(Vertex v) { v.setId(new Long(vertexId++)); vertices.put(v.getId(), v); --- 297,301 ---- * @param v The vertex */ ! public void add(Vertex v) { v.setId(new Long(vertexId++)); vertices.put(v.getId(), v); *************** *** 334,338 **** * @param c The camera */ ! public void intern(Camera c) { c.setId(new Long(cameraId++)); cameras.put(c.getId(), c); --- 334,338 ---- * @param c The camera */ ! public void add(Camera c) { c.setId(new Long(cameraId++)); cameras.put(c.getId(), c); |
From: Michael L. <he...@us...> - 2006-01-24 14:11:03
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25564/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java PencilTool.java CreateSpaceActionListener.java Log Message: intern renamed to add Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CreateSpaceActionListener.java 4 Jan 2006 14:29:50 -0000 1.5 --- CreateSpaceActionListener.java 24 Jan 2006 14:10:32 -0000 1.6 *************** *** 74,81 **** if (functional) { space = Space.createFunctionalSpace(result.trim()); ! Project.getInstance().intern(space); } else { space = Space.createConstructionSpace(result.trim()); ! Project.getInstance().intern(space); } --- 74,81 ---- if (functional) { space = Space.createFunctionalSpace(result.trim()); ! Project.getInstance().add(space); } else { space = Space.createConstructionSpace(result.trim()); ! Project.getInstance().add(space); } Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** PencilTool.java 23 Jan 2006 10:16:22 -0000 1.57 --- PencilTool.java 24 Jan 2006 14:10:32 -0000 1.58 *************** *** 149,153 **** protected void intern(Vertex vertex) { if (vertex.getId() == null) { ! Project.getInstance().intern(vertex); } } --- 149,153 ---- protected void intern(Vertex vertex) { if (vertex.getId() == null) { ! Project.getInstance().add(vertex); } } *************** *** 159,163 **** protected void intern(Edge edge) { if (edge.getId() == null) { ! Project.getInstance().intern(edge); edges.add(edge); } --- 159,163 ---- protected void intern(Edge edge) { if (edge.getId() == null) { ! Project.getInstance().add(edge); edges.add(edge); } *************** *** 211,215 **** protected void intern(Surface surface) { if (surface.getId() == null) { ! Project.getInstance().intern(surface); } } --- 211,215 ---- protected void intern(Surface surface) { if (surface.getId() == null) { ! Project.getInstance().add(surface); } } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** AbstractTool.java 23 Jan 2006 10:16:22 -0000 1.52 --- AbstractTool.java 24 Jan 2006 14:10:32 -0000 1.53 *************** *** 419,423 **** v.setY(coord[1]); v.setZ(coord[2]); ! Project.getInstance().intern(v); return v; --- 419,423 ---- v.setY(coord[1]); v.setZ(coord[2]); ! Project.getInstance().add(v); return v; *************** *** 438,442 **** vertex.getY(), vertex.getZ()); ! Project.getInstance().intern(v); return v; } else { --- 438,442 ---- vertex.getY(), vertex.getZ()); ! Project.getInstance().add(v); return v; } else { *************** *** 480,484 **** e.setTo(to); e.setFrom(from); ! Project.getInstance().intern(e); return e; } --- 480,484 ---- e.setTo(to); e.setFrom(from); ! Project.getInstance().add(e); return e; } *************** *** 507,511 **** protected Surface createSurface(List list) { Surface s = new Surface(list); ! Project.getInstance().intern(s); return s; } --- 507,511 ---- protected Surface createSurface(List list) { Surface s = new Surface(list); ! Project.getInstance().add(s); return s; } |
From: Michael L. <he...@us...> - 2006-01-24 13:57:47
|
Update of /cvsroot/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20028 Modified Files: .classpath Log Message: A slightly different dependency setup Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/model/.classpath,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** .classpath 24 Jan 2006 13:45:41 -0000 1.5 --- .classpath 24 Jan 2006 13:57:35 -0000 1.6 *************** *** 4,8 **** <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="build/code"/> ! <classpathentry kind="src" path="/kernel"/> <classpathentry kind="output" path="bin"/> </classpath> --- 4,9 ---- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="build/code"/> ! <classpathentry exported="true" kind="lib" path="/tools/log4j/log4j.jar"/> ! <classpathentry exported="true" kind="lib" path="/tools/jaxb/jaxb.jar"/> <classpathentry kind="output" path="bin"/> </classpath> |
From: Michael L. <he...@us...> - 2006-01-24 13:57:42
|
Update of /cvsroot/bprocessor/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20002 Modified Files: .classpath Log Message: A slightly different dependency setup Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/kernel/.classpath,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** .classpath 24 Jan 2006 13:45:37 -0000 1.4 --- .classpath 24 Jan 2006 13:57:31 -0000 1.5 *************** *** 4,9 **** <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="build"/> ! <classpathentry exported="true" kind="lib" path="/tools/jaxb/jaxb.jar"/> ! <classpathentry exported="true" kind="lib" path="/tools/log4j/log4j.jar"/> <classpathentry kind="output" path="bin"/> </classpath> --- 4,10 ---- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="build"/> ! <classpathentry kind="src" path="/gl"/> ! <classpathentry kind="src" path="/gui"/> ! <classpathentry kind="src" path="/model"/> <classpathentry kind="output" path="bin"/> </classpath> |
From: Michael L. <he...@us...> - 2006-01-24 13:57:42
|
Update of /cvsroot/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19979 Modified Files: .classpath Log Message: A slightly different dependency setup Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/gui/.classpath,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .classpath 24 Jan 2006 13:45:33 -0000 1.3 --- .classpath 24 Jan 2006 13:57:28 -0000 1.4 *************** *** 3,7 **** <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="src" path="/kernel"/> <classpathentry kind="src" path="/model"/> <classpathentry kind="output" path="bin"/> --- 3,6 ---- |
From: Michael L. <he...@us...> - 2006-01-24 13:57:39
|
Update of /cvsroot/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19939 Modified Files: .classpath Log Message: A slightly different dependency setup Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/gl/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .classpath 24 Jan 2006 13:45:30 -0000 1.2 --- .classpath 24 Jan 2006 13:57:25 -0000 1.3 *************** *** 4,8 **** <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="src" path="/gui"/> - <classpathentry kind="src" path="/kernel"/> <classpathentry kind="src" path="/model"/> <classpathentry kind="lib" path="/tools/jogl/jogl.jar"/> --- 4,7 ---- |
From: Michael L. <he...@us...> - 2006-01-24 13:45:50
|
Update of /cvsroot/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15235 Modified Files: .classpath Log Message: Eclipse is now set-up with project-dependencies which makes the semantic navigation work across projects (fx. show references on a method in model will yield results in gl and gui). Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/model/.classpath,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** .classpath 24 Jan 2006 13:13:04 -0000 1.4 --- .classpath 24 Jan 2006 13:45:41 -0000 1.5 *************** *** 3,9 **** <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="lib/log4j.jar"/> - <classpathentry kind="lib" path="lib/jaxb.jar"/> <classpathentry kind="lib" path="build/code"/> <classpathentry kind="output" path="bin"/> </classpath> --- 3,8 ---- <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="build/code"/> + <classpathentry kind="src" path="/kernel"/> <classpathentry kind="output" path="bin"/> </classpath> |
From: Michael L. <he...@us...> - 2006-01-24 13:45:47
|
Update of /cvsroot/bprocessor/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15208 Modified Files: .classpath Log Message: Eclipse is now set-up with project-dependencies which makes the semantic navigation work across projects (fx. show references on a method in model will yield results in gl and gui). Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/kernel/.classpath,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .classpath 24 Jan 2006 13:12:59 -0000 1.3 --- .classpath 24 Jan 2006 13:45:37 -0000 1.4 *************** *** 4,9 **** <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="build"/> ! <classpathentry kind="lib" path="lib/log4j.jar"/> ! <classpathentry kind="lib" path="lib/jaxb.jar"/> <classpathentry kind="output" path="bin"/> </classpath> --- 4,9 ---- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="build"/> ! <classpathentry exported="true" kind="lib" path="/tools/jaxb/jaxb.jar"/> ! <classpathentry exported="true" kind="lib" path="/tools/log4j/log4j.jar"/> <classpathentry kind="output" path="bin"/> </classpath> |
From: Michael L. <he...@us...> - 2006-01-24 13:45:45
|
Update of /cvsroot/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15159 Modified Files: .classpath Log Message: Eclipse is now set-up with project-dependencies which makes the semantic navigation work across projects (fx. show references on a method in model will yield results in gl and gui). Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/gl/.classpath,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .classpath 10 Aug 2005 12:42:46 -0000 1.1 --- .classpath 24 Jan 2006 13:45:30 -0000 1.2 *************** *** 3,11 **** <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="lib" path="lib/model.jar"/> ! <classpathentry kind="lib" path="lib/log4j.jar"/> ! <classpathentry kind="lib" path="lib/kernel.jar"/> ! <classpathentry kind="lib" path="lib/jogl.jar"/> ! <classpathentry kind="lib" path="lib/gui.jar"/> <classpathentry kind="output" path="build"/> </classpath> --- 3,10 ---- <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="src" path="/gui"/> ! <classpathentry kind="src" path="/kernel"/> ! <classpathentry kind="src" path="/model"/> ! <classpathentry kind="lib" path="/tools/jogl/jogl.jar"/> <classpathentry kind="output" path="build"/> </classpath> |
From: Michael L. <he...@us...> - 2006-01-24 13:45:45
|
Update of /cvsroot/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15185 Modified Files: .classpath Log Message: Eclipse is now set-up with project-dependencies which makes the semantic navigation work across projects (fx. show references on a method in model will yield results in gl and gui). Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/gui/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .classpath 18 Nov 2005 16:27:02 -0000 1.2 --- .classpath 24 Jan 2006 13:45:33 -0000 1.3 *************** *** 3,9 **** <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="lib" path="lib/model.jar"/> ! <classpathentry kind="lib" path="lib/log4j.jar"/> ! <classpathentry kind="lib" path="lib/kernel.jar"/> <classpathentry kind="output" path="bin"/> </classpath> --- 3,8 ---- <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="src" path="/kernel"/> ! <classpathentry kind="src" path="/model"/> <classpathentry kind="output" path="bin"/> </classpath> |
From: Michael L. <he...@us...> - 2006-01-24 13:13:12
|
Update of /cvsroot/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2287 Modified Files: .classpath Log Message: Class path fixed Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/model/.classpath,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .classpath 9 Dec 2005 15:42:10 -0000 1.3 --- .classpath 24 Jan 2006 13:13:04 -0000 1.4 *************** *** 5,9 **** <classpathentry kind="lib" path="lib/log4j.jar"/> <classpathentry kind="lib" path="lib/jaxb.jar"/> - <classpathentry kind="src" path="/kernel"/> <classpathentry kind="lib" path="build/code"/> <classpathentry kind="output" path="bin"/> --- 5,8 ---- |
From: Michael L. <he...@us...> - 2006-01-24 13:13:09
|
Update of /cvsroot/bprocessor/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2216 Modified Files: .classpath Log Message: Class path fixed Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/kernel/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .classpath 13 Nov 2005 11:44:15 -0000 1.2 --- .classpath 24 Jan 2006 13:12:59 -0000 1.3 *************** *** 3,9 **** <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="/tools/log4j/log4j.jar"/> - <classpathentry kind="lib" path="/tools/jaxb/jaxb.jar"/> <classpathentry kind="lib" path="build"/> <classpathentry kind="output" path="bin"/> </classpath> --- 3,9 ---- <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="build"/> + <classpathentry kind="lib" path="lib/log4j.jar"/> + <classpathentry kind="lib" path="lib/jaxb.jar"/> <classpathentry kind="output" path="bin"/> </classpath> |
From: Michael L. <he...@us...> - 2006-01-24 12:14:55
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13385/src/net/sourceforge/bprocessor/gl/tool Modified Files: MoveTool.java Log Message: Fixed MoveTool to be able to move ClippingPlanes Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** MoveTool.java 18 Jan 2006 11:46:50 -0000 1.26 --- MoveTool.java 24 Jan 2006 12:14:39 -0000 1.27 *************** *** 113,117 **** clearConstructors(moveConstructors); if (target != null) { ! initial = findInitial((Entity)target, e); from = initial.copy(); --- 113,117 ---- clearConstructors(moveConstructors); if (target != null) { ! initial = findInitial(target, e); from = initial.copy(); *************** *** 142,150 **** /** * Finds the initial point clicked for movement. ! * @param ent the entity initialy clicked * @param e the mouse event associated with the click. * @return the initial point of movement. */ ! protected Vertex findInitial(Entity ent, MouseEvent e) { double x = e.getX(); double y = View.getHeight() - e.getY(); --- 142,150 ---- /** * Finds the initial point clicked for movement. ! * @param entity the entity initialy clicked * @param e the mouse event associated with the click. * @return the initial point of movement. */ ! protected Vertex findInitial(Object entity, MouseEvent e) { double x = e.getX(); double y = View.getHeight() - e.getY(); *************** *** 155,167 **** Edge ray = new Edge(near, far); ray = transformation.unProject(ray); ! if (ent instanceof Vertex) { ! return ((Vertex)ent).copy(); ! } else if (ent instanceof Surface) { ! Plane surfacePlane = ((Surface)ent).plane(); ! return surfacePlane.intersection(ray); ! } else if (ent instanceof Edge) { ! Edge edge = (Edge) ent; Edge intersection = edge.intersection(ray); return intersection.getFrom(); } log.warn("The clicked object is not an Entity"); --- 155,170 ---- Edge ray = new Edge(near, far); ray = transformation.unProject(ray); ! if (entity instanceof Vertex) { ! return ((Vertex)entity).copy(); ! } else if (entity instanceof Surface) { ! Plane plane = ((Surface)entity).plane(); ! return plane.intersection(ray); ! } else if (entity instanceof Edge) { ! Edge edge = (Edge) entity; Edge intersection = edge.intersection(ray); return intersection.getFrom(); + } else if (entity instanceof ClippingPlane) { + Plane plane = ((ClippingPlane) entity).getPlane(); + return plane.intersection(ray); } log.warn("The clicked object is not an Entity"); |
From: Michael L. <he...@us...> - 2006-01-24 09:42:02
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32482/src/net/sourceforge/bprocessor/model Modified Files: Mesh.java Log Message: More work on the Mesh Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mesh.java 23 Jan 2006 10:16:32 -0000 1.1 --- Mesh.java 24 Jan 2006 09:41:54 -0000 1.2 *************** *** 21,24 **** --- 21,36 ---- private long nextVertexId; + /** The edges */ + private HashMap edges; + + /** The next edge id */ + private long nextEdgeId; + + /** The surfaces */ + private HashMap surfaces; + + /** The next surface id */ + private long nextSurfaceId; + /** * Constructor for Mesh *************** *** 27,30 **** --- 39,44 ---- super(); vertices = new HashMap(); + edges = new HashMap(); + surfaces = new HashMap(); } *************** *** 83,86 **** --- 97,208 ---- return (Vertex) vertices.get(new Long(id)); } + + /** + * Add a edge + * @param edge The edge + */ + public void add(Edge edge) { + Long id = new Long(nextEdgeId++); + edge.setId(id); + edges.put(id, edge); + } + + /** + * Remove a edge + * @param edge The edge + */ + public void remove(Edge edge) { + edges.remove(edge.getId()); + edge.setId(null); + } + + /** + * Insert a edge + * @param edge The edge + * @return The edge + */ + public Edge insert(Edge edge) { + add(edge); + return edge; + } + + /** + * Delete a edge + * @param edge The edge + */ + public void delete(Edge edge) { + remove(edge); + } + + /** + * Return the edges + * @return The edges + */ + public Collection getEdges() { + return edges.values(); + } + + /** + * Return the edge + * @param id The id + * @return The edge + */ + public Edge getEdge(long id) { + return (Edge) edges.get(new Long(id)); + } + + /** + * Add a surface + * @param surface The surface + */ + public void add(Surface surface) { + Long id = new Long(nextSurfaceId++); + surface.setId(id); + surfaces.put(id, surface); + } + + /** + * Remove a surface + * @param surface The surface + */ + public void remove(Surface surface) { + surfaces.remove(surface.getId()); + surface.setId(null); + } + + /** + * Insert a surface + * @param surface The surface + * @return The surface + */ + public Surface insert(Surface surface) { + add(surface); + return surface; + } + + /** + * Delete a surface + * @param surface The surface + */ + public void delete(Surface surface) { + remove(surface); + } + + /** + * Return the surfaces + * @return The surfaces + */ + public Collection getSurfaces() { + return surfaces.values(); + } + + /** + * Return the surface + * @param id The id + * @return The surface + */ + public Surface getSurface(long id) { + return (Surface) surfaces.get(new Long(id)); + } } |
From: Michael L. <he...@us...> - 2006-01-24 09:25:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27322/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Changed getEdges, getSurfaces, getVertices and getSpaces to return values() instead of new HashSet(values()) Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Project.java 23 Jan 2006 10:16:32 -0000 1.20 --- Project.java 24 Jan 2006 09:24:57 -0000 1.21 *************** *** 164,168 **** */ public Collection getSpaces() { ! return new HashSet(spaces.values()); } --- 164,168 ---- */ public Collection getSpaces() { ! return spaces.values(); } *************** *** 201,205 **** */ public Collection getEdges() { ! return new HashSet(edges.values()); } --- 201,205 ---- */ public Collection getEdges() { ! return edges.values(); } *************** *** 281,285 **** */ public Collection getSurfaces() { ! return new HashSet(surfaces.values()); } --- 281,285 ---- */ public Collection getSurfaces() { ! return surfaces.values(); } *************** *** 318,322 **** */ public Collection getVertices() { ! return new HashSet(vertices.values()); } --- 318,322 ---- */ public Collection getVertices() { ! return vertices.values(); } |