bprocessor-commit Mailing List for B-processor (Page 129)
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-03-22 10:53:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9006/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: - Finished ArcTool - Chekpoint after delete Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CoordinateSystem.java 19 Dec 2005 07:50:06 -0000 1.8 --- CoordinateSystem.java 22 Mar 2006 10:53:18 -0000 1.9 *************** *** 200,202 **** --- 200,221 ---- return result; } + + /** + * Translate an edge + * @param edge The edge + * @return The translated edge + */ + public Edge translate(Edge edge) { + return new Edge(translate(edge.getFrom()), translate(edge.getTo())); + } + + /** + * Un-translate an edge + * @param edge The edge + * @return The un-translated edge + */ + public Edge unTranslate(Edge edge) { + return new Edge(unTranslate(edge.getFrom()), unTranslate(edge.getTo())); + } + } |
From: Michael L. <he...@us...> - 2006-03-21 22:33:44
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16784/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java MoveTool.java TapeMeasureTool.java EraserTool.java Log Message: Checkpoints inserted in most tools (for the benefit of undo) Index: TapeMeasureTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasureTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TapeMeasureTool.java 10 Mar 2006 16:41:25 -0000 1.11 --- TapeMeasureTool.java 21 Mar 2006 22:33:36 -0000 1.12 *************** *** 333,336 **** --- 333,337 ---- Project.getInstance().remove(constructionPoint); measuring = false; + Project.getInstance().checkpoint(); } } Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EraserTool.java 22 Feb 2006 09:02:45 -0000 1.2 --- EraserTool.java 21 Mar 2006 22:33:36 -0000 1.3 *************** *** 50,54 **** findTarget(e); if (target instanceof Edge) { ! Project.getInstance().delete((Edge) target); } else { glv.getView().makeTarget(null); --- 50,55 ---- findTarget(e); if (target instanceof Edge) { ! ((Edge) target).delete(); ! Project.getInstance().checkpoint(); } else { glv.getView().makeTarget(null); Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** MoveTool.java 20 Mar 2006 23:18:09 -0000 1.47 --- MoveTool.java 21 Mar 2006 22:33:36 -0000 1.48 *************** *** 277,280 **** --- 277,281 ---- dragPlane = null; number = ""; + Project.getInstance().checkpoint(); } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** AbstractTool.java 17 Mar 2006 09:55:20 -0000 1.63 --- AbstractTool.java 21 Mar 2006 22:33:36 -0000 1.64 *************** *** 192,223 **** } } else { ! if (e.getKeyCode() == KeyEvent.VK_UP) { ! c.translate(new double[] {up.getX(), up.getY(), up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { ! c.translate(new double[] {-up.getX(), -up.getY(), -up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { ! c.translate(new double[] {sidewards.getX(), sidewards.getY(), sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { ! c.translate(new double[] {-sidewards.getX(), -sidewards.getY(), -sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_Z) { ! c.zoomout(); ! } else if (e.getKeyCode() == KeyEvent.VK_X) { ! c.zoomin(); ! } else if (e.getKeyCode() == KeyEvent.VK_Q) { ! glv.changeTool(Tool.SELECT_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_W) { ! glv.changeTool(Tool.PENCIL_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_M) { ! glv.changeTool(Tool.MOVE_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_R) { ! glv.changeTool(Tool.CAMERA_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_E) { ! glv.changeTool(Tool.EXTRUSION_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_F5) { ! glv.getView().changeDrawMode(View.WIREFRAME_MODE); ! } else if (e.getKeyCode() == KeyEvent.VK_F6) { ! glv.getView().changeDrawMode(View.SOLID_MODE); ! } else if (e.getKeyCode() == KeyEvent.VK_F7) { ! glv.getView().changeDrawMode(View.LIGHTING_MODE); } } --- 192,225 ---- } } else { ! if (e.getModifiers() == 0) { ! if (e.getKeyCode() == KeyEvent.VK_UP) { ! c.translate(new double[] {up.getX(), up.getY(), up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { ! c.translate(new double[] {-up.getX(), -up.getY(), -up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { ! c.translate(new double[] {sidewards.getX(), sidewards.getY(), sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { ! c.translate(new double[] {-sidewards.getX(), -sidewards.getY(), -sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_Z) { ! c.zoomout(); ! } else if (e.getKeyCode() == KeyEvent.VK_X) { ! c.zoomin(); ! } else if (e.getKeyCode() == KeyEvent.VK_Q) { ! glv.changeTool(Tool.SELECT_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_W) { ! glv.changeTool(Tool.PENCIL_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_M) { ! glv.changeTool(Tool.MOVE_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_R) { ! glv.changeTool(Tool.CAMERA_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_E) { ! glv.changeTool(Tool.EXTRUSION_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_F5) { ! glv.getView().changeDrawMode(View.WIREFRAME_MODE); ! } else if (e.getKeyCode() == KeyEvent.VK_F6) { ! glv.getView().changeDrawMode(View.SOLID_MODE); ! } else if (e.getKeyCode() == KeyEvent.VK_F7) { ! glv.getView().changeDrawMode(View.LIGHTING_MODE); ! } } } |
From: Michael L. <he...@us...> - 2006-03-21 22:33:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16755/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: Checkpoints inserted in most tools (for the benefit of undo) Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Edge.java 17 Mar 2006 18:59:24 -0000 1.40 --- Edge.java 21 Mar 2006 22:33:28 -0000 1.41 *************** *** 138,141 **** --- 138,147 ---- } + /** + * Delete + */ + public void delete() { + getMesh().delete(this); + } /** |
From: Michael L. <he...@us...> - 2006-03-21 22:00:30
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31312/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Implemented a simple Undo/Redo mechanism that remembers the entire model state for each operation Ð this may be too slow with larger models (and require large amounts of memory). The history is cleared when saving the model. Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Project.java 21 Mar 2006 15:10:22 -0000 1.48 --- Project.java 21 Mar 2006 21:59:59 -0000 1.49 *************** *** 71,80 **** private Space activeSpace; - /** Previous state */ - private Bprocessor previousState; - - /** Current state */ - private Bprocessor currentState; - /** The undo stack */ private Stack undoStack; --- 71,74 ---- *************** *** 83,86 **** --- 77,83 ---- private Stack redoStack; + /** The current state */ + private Bprocessor currentState; + /** * Get the instance *************** *** 649,653 **** */ public void checkpoint() { ! previousState = currentState; currentState = PersistenceManager.externalize(); } --- 646,655 ---- */ public void checkpoint() { ! redoStack.clear(); ! if (currentState != null) { ! log.info("pushing state on undo-stack"); ! undoStack.push(currentState); ! } ! log.info("externalizing current-state"); currentState = PersistenceManager.externalize(); } *************** *** 658,662 **** */ public boolean canUndo() { ! return false; } --- 660,664 ---- */ public boolean canUndo() { ! return (!undoStack.isEmpty()); } *************** *** 666,670 **** */ public boolean canRedo() { ! return false; } --- 668,712 ---- */ public boolean canRedo() { ! return (!redoStack.isEmpty()); ! } ! ! /** ! * Undo ! */ ! public void undo() { ! if (canUndo()) { ! if (currentState != null) { ! log.info("pushing state on redo-stack"); ! redoStack.push(currentState); ! } ! log.info("popping state from undo-stack"); ! currentState = (Bprocessor) undoStack.pop(); ! clear(); ! PersistenceManager.internalize(currentState); ! } ! } ! ! /** ! * Redo ! */ ! public void redo() { ! if (canRedo()) { ! if (currentState != null) { ! log.info("pushing state on undo-stack"); ! undoStack.push(currentState); ! } ! log.info("popping state from redo-stack"); ! currentState = (Bprocessor) redoStack.pop(); ! clear(); ! PersistenceManager.internalize(currentState); ! } ! } ! ! /** ! * Reset undo/redo history ! */ ! public void resetHistory() { ! undoStack.clear(); ! redoStack.clear(); } *************** *** 675,685 **** */ public void revert() { ! if (previousState != null) { ! Bprocessor temporary = previousState; ! clear(); ! PersistenceManager.internalize(previousState); ! previousState = currentState; ! currentState = temporary; ! } } --- 717,721 ---- */ public void revert() { ! undo(); } *************** *** 692,695 **** --- 728,733 ---- PersistenceManager.save(file); makeClean(); + resetHistory(); + checkpoint(); setSavePath(file.getCanonicalPath()); setDefaultPath(file.getParent()); *************** *** 703,706 **** --- 741,746 ---- PersistenceManager.save(new File(getSavePath())); makeClean(); + resetHistory(); + checkpoint(); } *************** *** 715,718 **** --- 755,760 ---- PersistenceManager.load(file); makeClean(); + resetHistory(); + checkpoint(); setSavePath(file.getCanonicalPath()); setDefaultPath(file.getParent()); *************** *** 726,729 **** --- 768,772 ---- clear(); makeClean(); + resetHistory(); setSavePath(null); } |
From: Michael L. <he...@us...> - 2006-03-21 21:59:55
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31257/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Implemented a simple Undo/Redo mechanism that remembers the entire model state for each operation Ð this may be too slow with larger models (and require large amounts of memory). The history is cleared when saving the model. Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** GUI.java 20 Mar 2006 09:09:27 -0000 1.30 --- GUI.java 21 Mar 2006 21:59:52 -0000 1.31 *************** *** 34,37 **** --- 34,38 ---- import java.awt.Dimension; import java.awt.Font; + import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; *************** *** 47,50 **** --- 48,52 ---- import javax.swing.ToolTipManager; import javax.swing.JPopupMenu; + import javax.swing.KeyStroke; import org.apache.log4j.Logger; *************** *** 184,190 **** JMenuItem editUndo = new JMenuItem("Undo"); editUndo.setMnemonic(KeyEvent.VK_N); editUndo.addActionListener(new AbstractAction() { public void actionPerformed(ActionEvent arg0) { ! Project.getInstance().revert(); } }); --- 186,194 ---- JMenuItem editUndo = new JMenuItem("Undo"); editUndo.setMnemonic(KeyEvent.VK_N); + editUndo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, + Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); editUndo.addActionListener(new AbstractAction() { public void actionPerformed(ActionEvent arg0) { ! Project.getInstance().undo(); } }); *************** *** 194,198 **** JMenuItem editRedo = new JMenuItem("Redo"); editRedo.setMnemonic(KeyEvent.VK_R); ! editRedo.setEnabled(false); edit.add(editRedo); --- 198,209 ---- JMenuItem editRedo = new JMenuItem("Redo"); editRedo.setMnemonic(KeyEvent.VK_R); ! editRedo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, ! Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); ! editRedo.addActionListener(new AbstractAction() { ! public void actionPerformed(ActionEvent arg0) { ! Project.getInstance().redo(); ! } ! }); ! editRedo.setEnabled(true); edit.add(editRedo); *************** *** 395,398 **** --- 406,410 ---- pack(); setVisible(true); + Project.getInstance().checkpoint(); } } |
From: Michael L. <he...@us...> - 2006-03-21 17:04:35
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3567/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileSaveActionListener.java FileNewActionListener.java FileExitActionListener.java FileLoadActionListener.java FileCloseActionListener.java FileSaveAsActionListener.java Log Message: Cleaned structure of File Menu Code Fixed a large number of bugs in File menu Code (there are still bugs left) Index: FileLoadActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileLoadActionListener.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileLoadActionListener.java 13 Feb 2006 12:37:23 -0000 1.5 --- FileLoadActionListener.java 21 Mar 2006 12:24:13 -0000 1.6 *************** *** 8,13 **** import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.Selection; - import net.sourceforge.bprocessor.model.xml.PersistenceManager; import java.awt.event.ActionEvent; --- 8,11 ---- *************** *** 57,65 **** Project.getInstance().setDefaultPath(file.getAbsolutePath()); if (file.getName().lastIndexOf('.') != -1) { ! PersistenceManager.save(file); } else { ! PersistenceManager.save(new File(file.getCanonicalFile() + ".bp")); } ! JFileChooser loadChooser = new JFileChooser(Project.getInstance().getDefaultPath()); loadChooser.addChoosableFileFilter(new MyFileFilter()); --- 55,63 ---- Project.getInstance().setDefaultPath(file.getAbsolutePath()); if (file.getName().lastIndexOf('.') != -1) { ! Project.getInstance().saveAs(file); } else { ! Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); } ! JFileChooser loadChooser = new JFileChooser(Project.getInstance().getDefaultPath()); loadChooser.addChoosableFileFilter(new MyFileFilter()); *************** *** 69,84 **** lstate == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().setSavePath(lfile.getAbsolutePath()); ! Project.getInstance().setDefaultPath(lfile.getAbsolutePath()); ! 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); } } --- 67,77 ---- lstate == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().load(lfile); } catch (Exception ex) { ! log.error("Could not open file: " + lfile, ex); } } } catch (Exception ex) { ! log.error("Could not save to file: " + file, ex); } } *************** *** 93,104 **** lstate == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().setSavePath(lfile.getAbsolutePath()); ! Project.getInstance().setDefaultPath(lfile.getAbsolutePath()); ! Selection.primary().clear(); ! Project.getInstance().clear(); ! PersistenceManager.load(lfile); ! Project.getInstance().makeClean(); } catch (Exception ex) { ! log.error("Could not import file: " + lfile, ex); } } --- 86,92 ---- lstate == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().load(lfile); } catch (Exception ex) { ! log.error("Could not open file: " + lfile, ex); } } *************** *** 115,126 **** lstate == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().setSavePath(lfile.getAbsolutePath()); ! Project.getInstance().setDefaultPath(lfile.getAbsolutePath()); ! Selection.primary().clear(); ! Project.getInstance().clear(); ! PersistenceManager.load(lfile); ! Project.getInstance().makeClean(); } catch (Exception ex) { ! log.error("Could not import file: " + lfile, ex); } } --- 103,109 ---- lstate == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().load(lfile); } catch (Exception ex) { ! log.error("Could not open file: " + lfile, ex); } } Index: FileExitActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileExitActionListener.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileExitActionListener.java 2 Mar 2006 13:08:12 -0000 1.5 --- FileExitActionListener.java 21 Mar 2006 12:24:13 -0000 1.6 *************** *** 15,19 **** import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.xml.PersistenceManager; import org.apache.log4j.Logger; --- 15,18 ---- *************** *** 52,63 **** state == JFileChooser.APPROVE_OPTION) { try { ! PersistenceManager.save(file); ! Project.getInstance().setDefaultPath(file.getAbsolutePath()); System.exit(0); } catch (Exception ex) { ! log.error("Could not export to file: " + file, ex); } } ! } } else if (n == 1) { System.exit(0); --- 51,69 ---- state == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().saveAs(file); System.exit(0); } catch (Exception ex) { ! log.error("Could not save to file: " + file, ex); } } ! } else { ! try { ! Project.getInstance().save(); ! System.exit(0); ! } catch (Exception ex) { ! log.error("Could not save to file: " + ! new File(Project.getInstance().getSavePath()), ex); ! } ! } } else if (n == 1) { System.exit(0); Index: FileCloseActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileCloseActionListener.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileCloseActionListener.java 20 Mar 2006 15:13:08 -0000 1.5 --- FileCloseActionListener.java 21 Mar 2006 12:24:13 -0000 1.6 *************** *** 18,23 **** import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.Selection; - import net.sourceforge.bprocessor.model.xml.PersistenceManager; /** --- 18,21 ---- *************** *** 42,46 **** */ public void actionPerformed(ActionEvent event) { - if (Project.getInstance().isDirty()) { int n = JOptionPane.showConfirmDialog( --- 40,43 ---- *************** *** 51,55 **** if (n == 0) { if (Project.getInstance().getSavePath() == null) { ! JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); chooser.addChoosableFileFilter(new MyFileFilter()); int state = chooser.showSaveDialog(null); --- 48,53 ---- if (n == 0) { if (Project.getInstance().getSavePath() == null) { ! String path = Project.getInstance().getDefaultPath(); ! JFileChooser chooser = new JFileChooser(path); chooser.addChoosableFileFilter(new MyFileFilter()); int state = chooser.showSaveDialog(null); *************** *** 58,82 **** state == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().setDefaultPath(file.getAbsolutePath()); if (file.getName().lastIndexOf('.') != -1) { ! PersistenceManager.save(file); } else { ! PersistenceManager.save(new File(file.getCanonicalFile() + ".bp")); } ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! Project.getInstance().setSavePath(null); } catch (Exception ex) { ! log.error("Could not export to file: " + file, ex); } } } else { try { ! PersistenceManager.save(new File(Project.getInstance().getSavePath())); ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! Project.getInstance().setSavePath(null); } catch (Exception ex) { log.error("Could not export to file: " + --- 56,74 ---- state == JFileChooser.APPROVE_OPTION) { try { ! if (file.getName().lastIndexOf('.') != -1) { ! Project.getInstance().saveAs(file); } else { ! Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); } ! Project.getInstance().close(); } catch (Exception ex) { ! log.error("Could not save to file: " + file, ex); } } } else { try { ! Project.getInstance().save(); ! Project.getInstance().close(); } catch (Exception ex) { log.error("Could not export to file: " + *************** *** 87,103 **** if (n == 1) { ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! Project.getInstance().setSavePath(null); } - } else { ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! Project.getInstance().setSavePath(null); } } - } --- 79,87 ---- if (n == 1) { ! Project.getInstance().close(); } } else { ! Project.getInstance().close(); } } } Index: FileNewActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileNewActionListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileNewActionListener.java 13 Feb 2006 12:37:23 -0000 1.6 --- FileNewActionListener.java 21 Mar 2006 12:24:13 -0000 1.7 *************** *** 18,23 **** import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.Selection; - import net.sourceforge.bprocessor.model.xml.PersistenceManager; /** --- 18,21 ---- *************** *** 59,71 **** try { if (file.getName().lastIndexOf('.') != -1) { ! PersistenceManager.save(file); } else { ! PersistenceManager.save(new File(file.getCanonicalFile() + ".bp")); } ! Project.getInstance().setDefaultPath(file.getAbsolutePath()); ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! Project.getInstance().setSavePath(null); } catch (Exception ex) { log.error("Could not export to file: " + file, ex); --- 57,65 ---- try { if (file.getName().lastIndexOf('.') != -1) { ! Project.getInstance().saveAs(file); } else { ! Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); } ! Project.getInstance().close(); } catch (Exception ex) { log.error("Could not export to file: " + file, ex); *************** *** 74,82 **** } else { try { ! PersistenceManager.save(new File(Project.getInstance().getSavePath())); ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! Project.getInstance().setSavePath(null); } catch (Exception ex) { log.error("Could not export to file: " + --- 68,73 ---- } else { try { ! Project.getInstance().save(); ! Project.getInstance().close(); } catch (Exception ex) { log.error("Could not export to file: " + *************** *** 86,100 **** } if (n == 1) { ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! Project.getInstance().setSavePath(null); } - } else { ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! Project.getInstance().setSavePath(null); } } --- 77,84 ---- } if (n == 1) { ! Project.getInstance().close(); } } else { ! Project.getInstance().close(); } } Index: FileSaveAsActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveAsActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FileSaveAsActionListener.java 13 Feb 2006 12:37:23 -0000 1.3 --- FileSaveAsActionListener.java 21 Mar 2006 12:24:13 -0000 1.4 *************** *** 8,12 **** import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.xml.PersistenceManager; import java.awt.event.ActionEvent; --- 8,11 ---- *************** *** 43,54 **** state == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().setDefaultPath(file.getAbsolutePath()); ! Project.getInstance().setSavePath(file.getAbsolutePath()); if (file.getName().lastIndexOf('.') != -1) { ! PersistenceManager.save(file); } else { ! PersistenceManager.save(new File(file.getCanonicalFile() + ".bp")); } - Project.getInstance().makeClean(); } catch (Exception ex) { log.error("Could not export to file: " + file, ex); --- 42,51 ---- state == JFileChooser.APPROVE_OPTION) { try { ! if (file.getName().lastIndexOf('.') != -1) { ! Project.getInstance().saveAs(file); } else { ! Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); } } catch (Exception ex) { log.error("Could not export to file: " + file, ex); Index: FileSaveActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveActionListener.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileSaveActionListener.java 13 Feb 2006 12:37:22 -0000 1.5 --- FileSaveActionListener.java 21 Mar 2006 12:24:13 -0000 1.6 *************** *** 8,12 **** import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.xml.PersistenceManager; import java.awt.event.ActionEvent; --- 8,11 ---- *************** *** 47,67 **** try { if (file.getName().lastIndexOf('.') != -1) { ! PersistenceManager.save(file); } else { ! PersistenceManager.save(new File(file.getCanonicalFile() + ".bp")); } - Project.getInstance().setSavePath(file.getAbsolutePath()); - Project.getInstance().setDefaultPath(file.getAbsolutePath()); - Project.getInstance().makeClean(); } catch (Exception ex) { ! log.error("Could not export to file: " + file, ex); } } } else { try { ! PersistenceManager.save(new File(Project.getInstance().getSavePath())); ! Project.getInstance().makeClean(); } catch (Exception ex) { ! log.error("Could not export to file: " + new File(Project.getInstance().getSavePath()), ex); } --- 46,62 ---- try { if (file.getName().lastIndexOf('.') != -1) { ! Project.getInstance().saveAs(file); } else { ! Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); } } catch (Exception ex) { ! log.error("Could not save to file: " + file, ex); } } } else { try { ! Project.getInstance().save(); } catch (Exception ex) { ! log.error("Could not save to file: " + new File(Project.getInstance().getSavePath()), ex); } |
From: Michael L. <he...@us...> - 2006-03-21 17:01:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3477/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Cleaned structure of File Menu Code Fixed a large number of bugs in File menu Code (there are still bugs left) Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Project.java 20 Mar 2006 15:12:58 -0000 1.46 --- Project.java 21 Mar 2006 12:24:09 -0000 1.47 *************** *** 660,667 **** /** * Save to file * @param file The file to save to */ ! public void save(File file) { ! } --- 660,704 ---- /** * Save to file + * @exception Exception Thrown if an exception occurs * @param file The file to save to */ ! public void saveAs(File file) throws Exception { ! PersistenceManager.save(file); ! makeClean(); ! setSavePath(file.getCanonicalPath()); ! setDefaultPath(file.getParent()); ! } ! ! /** ! * Save to current save-path ! * @exception Exception Thrown if an exception occurs ! */ ! public void save() throws Exception { ! PersistenceManager.save(new File(getSavePath())); ! makeClean(); ! } ! ! /** ! * Load a file ! * @param file The file to load ! * @exception Exception Thrown if an exception occurs ! */ ! public void load(File file) throws Exception { ! Selection.primary().clear(); ! clear(); ! PersistenceManager.load(file); ! makeClean(); ! setSavePath(file.getCanonicalPath()); ! setDefaultPath(file.getParent()); ! } ! ! /** ! * Close the project ! */ ! public void close() { ! Selection.primary().clear(); ! clear(); ! makeClean(); ! setSavePath(null); } |
From: Michael L. <he...@us...> - 2006-03-21 16:58:02
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3967/src/net/sourceforge/bprocessor/gl/tool Modified Files: MultiExtrudeTool.java AbstractPencil.java Log Message: Checkpointing in MultiExtrudeTool Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AbstractPencil.java 20 Mar 2006 09:09:23 -0000 1.8 --- AbstractPencil.java 21 Mar 2006 12:24:49 -0000 1.9 *************** *** 148,151 **** --- 148,152 ---- } } + Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } Index: MultiExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MultiExtrudeTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MultiExtrudeTool.java 20 Mar 2006 13:49:30 -0000 1.10 --- MultiExtrudeTool.java 21 Mar 2006 12:24:49 -0000 1.11 *************** *** 247,250 **** --- 247,251 ---- holeAnalysis(current); } + Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } |
From: Michael L. <he...@us...> - 2006-03-21 16:30:41
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28768/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Added undo/redo-stack Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Project.java 21 Mar 2006 12:24:09 -0000 1.47 --- Project.java 21 Mar 2006 15:10:22 -0000 1.48 *************** *** 16,19 **** --- 16,20 ---- import java.util.List; import java.util.Set; + import java.util.Stack; import net.sourceforge.bprocessor.model.xml.Bprocessor; *************** *** 76,79 **** --- 77,86 ---- private Bprocessor currentState; + /** The undo stack */ + private Stack undoStack; + + /** The redo stack */ + private Stack redoStack; + /** * Get the instance *************** *** 92,95 **** --- 99,104 ---- public Project() { super(); + undoStack = new Stack(); + redoStack = new Stack(); makeClean(); addCams(); *************** *** 645,648 **** --- 654,674 ---- /** + * Can undo + * @return can undo + */ + public boolean canUndo() { + return false; + } + + /** + * Can redo + * @return can redo + */ + public boolean canRedo() { + return false; + } + + + /** * Revert to previous checkpoint and swap current * with previous. |
From: Nordholt <nor...@us...> - 2006-03-20 23:18:14
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23119 Modified Files: MoveTool.java Log Message: hoover aligning in vector movement mode Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** MoveTool.java 12 Mar 2006 21:10:29 -0000 1.46 --- MoveTool.java 20 Mar 2006 23:18:09 -0000 1.47 *************** *** 32,35 **** --- 32,37 ---- import java.util.List; import java.util.LinkedList; + import java.util.Timer; + import java.util.TimerTask; import org.apache.log4j.Logger; *************** *** 54,57 **** --- 56,62 ---- public static final int CONTROLLED = 3; + /** The goemetry based movement mode */ + public static final int GEOMETRY = 4; + /** The initial movepoint */ private Vertex initial; *************** *** 90,102 **** private Entity snapEntity; ! /** The Collection of entities being moved */ private Collection moveEntities; - /** Sliding edge of the to point */ - private Edge toSlideEdge; - - /** Sliding edge of the from point */ - private Edge fromSlideEdge; - /** * Mapping from each vertex being moved, --- 95,101 ---- private Entity snapEntity; ! /** The Collection of entities being moved*/ private Collection moveEntities; /** * Mapping from each vertex being moved, *************** *** 108,111 **** --- 107,113 ---- /** The entity being moved in a controlled way */ private Entity controlled; + + /** The aligning edge */ + private Edge alignEdge; /** *************** *** 119,125 **** restrictionVector = null; snapEntity = null; ! toSlideEdge = null; ! fromSlideEdge = null; ! slideMap = null; numberOfClicks = 1; moveMode = AXIS_RESTRICTED; --- 121,126 ---- restrictionVector = null; snapEntity = null; ! alignEdge = null; ! slideMap = new HashMap(); numberOfClicks = 1; moveMode = AXIS_RESTRICTED; *************** *** 188,192 **** } ! /** Talking care of the three-click mode * @param e the MouseEvent object */ --- 189,193 ---- } ! /** Taking care of the three-click mode * @param e the MouseEvent object */ *************** *** 206,209 **** --- 207,214 ---- glv.getView().removeTempEdge(threeClickConst); threeClickConst = null; + if (alignEdge != null) { + glv.getView().removeTempEdge(alignEdge); + alignEdge = null; + } update(); numberOfClicks = 1; *************** *** 226,233 **** /** ! * 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) { --- 231,238 ---- /** ! * Finds the point clicked. ! * @param entity the entity clicked * @param e the mouse event associated with the click. ! * @return the point. */ protected Vertex findInitial(Object entity, MouseEvent e) { *************** *** 271,276 **** restrictionVector = null; dragPlane = null; - toSlideEdge = null; - fromSlideEdge = null; number = ""; } --- 276,279 ---- *************** *** 281,293 **** */ protected void moved(MouseEvent e) { ! findTarget(e); ! glv.getView().makeTarget(target); ! if (moveMode == THREE_CLICK && threeClickConst != null) { if (target != null) { Vertex to = findInitial(target, e); if (to != null) { threeClickConst.setTo(to); } } } } --- 284,332 ---- */ protected void moved(MouseEvent e) { ! boolean showAlign = false; ! if (moveMode == THREE_CLICK && threeClickConst != null) { ! moveConstructors = makeXYZConerConstructors(new Vertex(0, 0, 0)); ! displayConstructors(moveConstructors); ! glv.getView().removeTempEdge(threeClickConst); ! if (alignEdge != null) { ! glv.getView().addTempEdge(alignEdge); ! } ! ! findTarget(e); ! glv.getView().makeTarget(target); if (target != null) { Vertex to = findInitial(target, e); + if (target instanceof Edge) { + Edge targetEdge = (Edge)target; + if (!targetEdge.equals(alignEdge)) { + Timer alignTimer = new Timer(); + TimerTask alignTask = new AlignTask(targetEdge); + alignTimer.schedule(alignTask, 300); + } + if (alignEdge != null) { + Vertex alignDir = alignEdge.getDirection(); + Vertex targetDir = targetEdge.getDirection(); + Vertex dirCross = alignDir.cross(targetDir); + showAlign = dirCross.length() < 0.000001; + } + } + if (to != null) { threeClickConst.setTo(to); } + } else { + threeClickConst.setTo(from); + } + + if (threeClickConst != null) { + glv.getView().addTempEdge(threeClickConst); } + if (!showAlign) { + glv.getView().removeTempEdge(alignEdge); + } + clearConstructors(moveConstructors); + } else { + findTarget(e); + glv.getView().makeTarget(target); } } *************** *** 426,430 **** } } else if (moveMode == CONTROLLED && controlled != null) { ! if (toSlideEdge == null && fromSlideEdge == null) { findTarget(e); if (controlled instanceof Edge) { --- 465,469 ---- } } else if (moveMode == CONTROLLED && controlled != null) { ! if (slideMap.isEmpty()) { findTarget(e); if (controlled instanceof Edge) { *************** *** 454,457 **** --- 493,498 ---- rightEdge = (Edge)edges.get(index + 1); } + Edge toSlideEdge = null; + Edge fromSlideEdge = null; if (controlledDir.cross(leftEdge.getDirection()).length() > 0.00001 && controlledDir.cross(rightEdge.getDirection()).length() > 0.00001) { *************** *** 462,469 **** toSlideEdge = leftEdge; fromSlideEdge = rightEdge; ! } else if (from.getEdges().contains(leftEdge) && to.getEdges().contains(rightEdge)) { fromSlideEdge = leftEdge; ! toSlideEdge = rightEdge; } slideMap = new HashMap(); --- 503,510 ---- toSlideEdge = leftEdge; fromSlideEdge = rightEdge; ! } else if (from.getEdges().contains(leftEdge) && to.getEdges().contains(rightEdge)) { fromSlideEdge = leftEdge; ! toSlideEdge = rightEdge; } slideMap = new HashMap(); *************** *** 486,491 **** restrictionVector = targetEdge.getDirection(); findRestrictionPlane(); - fromSlideEdge = targetEdge; - toSlideEdge = targetEdge; } } else if (controlled instanceof Surface) { --- 527,530 ---- *************** *** 702,710 **** move(vertices, initial.minus(from)); } - } else if (e.getKeyCode() == KeyEvent.VK_M) { - if (dragPlane == null) { - moveMode = (moveMode + 1) % 3; - } - numberOfClicks = 1; } else if (lastRestriction != null && initial != null && --- 741,744 ---- *************** *** 775,777 **** --- 809,849 ---- moveMode = mode; } + + /** + * Class for handeling the task of assigning an alignedge. + */ + private class AlignTask extends TimerTask { + /** The edge candidate to become the alignedge */ + private Edge candidateEdge; + + /** + * Constructor + * @param candidate the candidate to become alignedge + */ + public AlignTask(Edge candidate) { + super(); + candidateEdge = candidate; + } + + /** + * checks if the target is still the same edge, + * thus making it the alignedge + */ + public void run() { + if (target instanceof Edge) { + candidateEdge.equals((Edge)target); + + Vertex direction = candidateEdge.getDirection(); + Vertex alignTo = direction.copy(); + Vertex alignFrom = direction.copy(); + alignFrom.scale(-1000); + alignTo.scale(1000); + glv.getView().removeTempEdge(alignEdge); + alignEdge = new Edge(alignFrom.add(from), alignTo.add(from)); + alignEdge.setConstructor(true); + glv.getView().addTempEdge(alignEdge); + glv.repaint(true); + } + } + } } |
From: Michael L. <he...@us...> - 2006-03-20 15:13:15
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6236/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileCloseActionListener.java Log Message: Added an unimplemented save operation to Project Index: FileCloseActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileCloseActionListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FileCloseActionListener.java 13 Feb 2006 12:37:23 -0000 1.4 --- FileCloseActionListener.java 20 Mar 2006 15:13:08 -0000 1.5 *************** *** 47,51 **** null, "Do you want to save the changes?", ! "Projekt has been changed", JOptionPane.YES_NO_CANCEL_OPTION); if (n == 0) { --- 47,51 ---- null, "Do you want to save the changes?", ! "Project has been changed", JOptionPane.YES_NO_CANCEL_OPTION); if (n == 0) { |
From: Michael L. <he...@us...> - 2006-03-20 15:13:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6200/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Added an unimplemented save operation to Project Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Project.java 20 Mar 2006 09:09:31 -0000 1.45 --- Project.java 20 Mar 2006 15:12:58 -0000 1.46 *************** *** 8,11 **** --- 8,12 ---- package net.sourceforge.bprocessor.model; + import java.io.File; import java.util.Collection; import java.util.HashMap; *************** *** 140,146 **** public void clear() { spaces.clear(); - cameras.clear(); mesh.clear(); ! addCams(); changed(this); } --- 141,146 ---- public void clear() { spaces.clear(); mesh.clear(); ! this.setActiveSpace(null); changed(this); } *************** *** 659,662 **** --- 659,670 ---- /** + * Save to file + * @param file The file to save to + */ + public void save(File file) { + + } + + /** * Attribute Info * @param info String |
From: Michael L. <he...@us...> - 2006-03-20 13:49:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29938/src/net/sourceforge/bprocessor/gl/tool Modified Files: MultiExtrudeTool.java Log Message: Got rid of warnins. Checkpoints model. Index: MultiExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MultiExtrudeTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MultiExtrudeTool.java 12 Mar 2006 21:10:29 -0000 1.9 --- MultiExtrudeTool.java 20 Mar 2006 13:49:30 -0000 1.10 *************** *** 201,204 **** --- 201,205 ---- */ private void remove(Set elem) { + if (elem != null) { Iterator iter = elem.iterator(); *************** *** 206,210 **** Object o = iter.next(); if (o instanceof Surface) { ! Project.getInstance().delete((Surface)o); } } --- 207,211 ---- Object o = iter.next(); if (o instanceof Surface) { ! ((Surface)o).delete(); } } *************** *** 246,250 **** holeAnalysis(current); } ! // Selection.primary().addAll(tops); } } --- 247,251 ---- holeAnalysis(current); } ! Project.getInstance().checkpoint(); } } *************** *** 296,298 **** --- 297,307 ---- } } + + /** + * Log an object + * @param message Object to log + */ + public static void info(Object message) { + log.info(message); + } } |
From: Michael L. <he...@us...> - 2006-03-20 13:49:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29600/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Delete operation Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Surface.java 17 Mar 2006 18:59:24 -0000 1.83 --- Surface.java 20 Mar 2006 13:48:58 -0000 1.84 *************** *** 173,176 **** --- 173,186 ---- /** + * Delete surface + * + */ + public void delete() { + if (getMesh() != null) { + getMesh().delete(this); + } + } + + /** * Calculate center of gravity * @return The center of gravity |
From: Michael L. <he...@us...> - 2006-03-20 09:09:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25274/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: First version of Undo implemented Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** Project.java 17 Mar 2006 09:55:27 -0000 1.44 --- Project.java 20 Mar 2006 09:09:31 -0000 1.45 *************** *** 16,19 **** --- 16,22 ---- import java.util.Set; + import net.sourceforge.bprocessor.model.xml.Bprocessor; + import net.sourceforge.bprocessor.model.xml.PersistenceManager; + import org.apache.log4j.Logger; /** *************** *** 66,69 **** --- 69,78 ---- private Space activeSpace; + /** Previous state */ + private Bprocessor previousState; + + /** Current state */ + private Bprocessor currentState; + /** * Get the instance *************** *** 628,631 **** --- 637,662 ---- /** + * Checkpoint the B-model + */ + public void checkpoint() { + previousState = currentState; + currentState = PersistenceManager.externalize(); + } + + /** + * Revert to previous checkpoint and swap current + * with previous. + */ + public void revert() { + if (previousState != null) { + Bprocessor temporary = previousState; + clear(); + PersistenceManager.internalize(previousState); + previousState = currentState; + currentState = temporary; + } + } + + /** * Attribute Info * @param info String |
From: Michael L. <he...@us...> - 2006-03-20 09:09:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25274/src/net/sourceforge/bprocessor/model/xml Modified Files: PersistenceManager.java Log Message: First version of Undo implemented Index: PersistenceManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml/PersistenceManager.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** PersistenceManager.java 10 Mar 2006 16:41:37 -0000 1.26 --- PersistenceManager.java 20 Mar 2006 09:09:31 -0000 1.27 *************** *** 78,89 **** /** ! * This method loads the Bprocessor document from a file ! * @param file The input file ! * @exception Exception Thrown if an exception occurs */ ! public static void load(File file) throws Exception { ! FileInputStream fis = new FileInputStream(file); ! Bprocessor bp = loadFile(fis); ! mapper = new HashMap(); --- 78,85 ---- /** ! * This method internalizes a b-processor document ! * @param bp XML */ ! public static void internalize(Bprocessor bp) { mapper = new HashMap(); *************** *** 101,105 **** loadRefEdge(bp.getEdge()); loadRefVertex(bp.getVertex()); ! fis.close(); } --- 97,111 ---- loadRefEdge(bp.getEdge()); loadRefVertex(bp.getVertex()); ! } ! ! /** ! * This method loads the Bprocessor document from a file ! * @param file The input file ! * @exception Exception Thrown if an exception occurs ! */ ! public static void load(File file) throws Exception { ! FileInputStream fis = new FileInputStream(file); ! Bprocessor bp = loadFile(fis); ! internalize(bp); fis.close(); } *************** *** 360,370 **** } /** ! * This method saves the Bprocessor document to a file ! * @param file The output file ! * @exception Exception Thrown if an exception occurs */ ! public static void save(File file) throws Exception { ! FileOutputStream fos = new FileOutputStream(file); Bprocessor bp = new BprocessorImpl(); --- 366,375 ---- } + /** ! * This method externalizes the B-model to an XML structure. ! * @return XML */ ! public static Bprocessor externalize() { Bprocessor bp = new BprocessorImpl(); *************** *** 394,398 **** saveRefSurface(bp, project.getSurfaces()); saveRefVertex(bp, project.getVertices()); ! saveFile(bp, fos); --- 399,415 ---- saveRefSurface(bp, project.getSurfaces()); saveRefVertex(bp, project.getVertices()); ! ! return bp; ! } ! ! /** ! * This method saves the Bprocessor document to a file ! * @param file The output file ! * @exception Exception Thrown if an exception occurs ! */ ! public static void save(File file) throws Exception { ! FileOutputStream fos = new FileOutputStream(file); ! Bprocessor bp = externalize(); ! saveFile(bp, fos); |
From: Michael L. <he...@us...> - 2006-03-20 09:09:30
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25260/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: First version of Undo implemented Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** GUI.java 9 Feb 2006 13:55:12 -0000 1.29 --- GUI.java 20 Mar 2006 09:09:27 -0000 1.30 *************** *** 28,35 **** --- 28,39 ---- import net.sourceforge.bprocessor.gui.treeview.SpaceTreeView; import net.sourceforge.bprocessor.gui.treeview.SurfaceTreeView; + import net.sourceforge.bprocessor.model.Project; + import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.Font; + import java.awt.event.ActionEvent; + import java.awt.event.ActionListener; import java.awt.event.KeyEvent; *************** *** 96,99 **** --- 100,108 ---- } + /** Abstract action */ + private abstract class AbstractAction implements ActionListener { + + } + /** * Create menus *************** *** 175,179 **** JMenuItem editUndo = new JMenuItem("Undo"); editUndo.setMnemonic(KeyEvent.VK_N); ! editUndo.setEnabled(false); edit.add(editUndo); --- 184,193 ---- JMenuItem editUndo = new JMenuItem("Undo"); editUndo.setMnemonic(KeyEvent.VK_N); ! editUndo.addActionListener(new AbstractAction() { ! public void actionPerformed(ActionEvent arg0) { ! Project.getInstance().revert(); ! } ! }); ! editUndo.setEnabled(true); edit.add(editUndo); |
From: Michael L. <he...@us...> - 2006-03-20 09:09:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25246/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: First version of Undo implemented Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractPencil.java 17 Mar 2006 09:55:20 -0000 1.7 --- AbstractPencil.java 20 Mar 2006 09:09:23 -0000 1.8 *************** *** 148,151 **** --- 148,152 ---- } } + Project.getInstance().checkpoint(); } |
From: Michael L. <he...@us...> - 2006-03-17 18:59:30
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10793/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Geometric.java Log Message: Changed nameing for Surface, Edge, Vertex depending on space-level or element-level. Workaround for problem in Surface.getAttributes() and AttributeView Removed hashcode and equals methods for Surface, Edge and Vertex Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Surface.java 17 Mar 2006 09:30:34 -0000 1.82 --- Surface.java 17 Mar 2006 18:59:24 -0000 1.83 *************** *** 78,86 **** */ public String getName() { ! String name; if (id == null) { ! name = "S"; } else { ! name = "S" + id; } return name; --- 78,86 ---- */ public String getName() { ! String name = super.getName(); if (id == null) { ! name = name + "S"; } else { ! name = name + "S" + id; } return name; *************** *** 887,920 **** return null; } - - /** - * Return the hash code of the object - * @return The hash - */ - public int hashCode() { - if (id == null) { - return super.hashCode(); - } else { - return id.hashCode(); - } - } - - /** - * Indicates whether some other object is equal to this one. - * @param o The other object - * @return True if equal; otherwise false - */ - public boolean equals(Object o) { - if (!(o instanceof Surface)) { - return false; - } - Surface s = (Surface)o; - - if (id == null || s.getId() == null) { - return this == s; - } else { - return this.id.equals(s.getId()); - } - } /** --- 887,890 ---- *************** *** 961,965 **** res.add(new Attribute("Space", "None", false)); } ! res.add(new Attribute("Front Material", getId())); if (getBackDomain() != null) { res.add(new Attribute("Space", getBackDomain(), false)); --- 931,940 ---- res.add(new Attribute("Space", "None", false)); } ! // FIXME The material attribute should be ... a material! ! // The id does not work if this is not a toplevel surface. ! if (getMesh() == Project.getInstance().mesh()) { ! res.add(new Attribute("Front Material", getId())); ! } ! if (getBackDomain() != null) { res.add(new Attribute("Space", getBackDomain(), false)); *************** *** 967,971 **** res.add(new Attribute("Space", "None", false)); } ! res.add(new Attribute("Back Material", getId())); if (isInner()) { res.add(new Attribute("Exterior", getExterior(), false)); --- 942,950 ---- res.add(new Attribute("Space", "None", false)); } ! // FIXME The material attribute should be ... a material! ! // The id does not work if this is not a toplevel surface. ! if (getMesh() == Project.getInstance().mesh()) { ! res.add(new Attribute("Back Material", getId())); ! } if (isInner()) { res.add(new Attribute("Exterior", getExterior(), false)); Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Edge.java 17 Mar 2006 09:30:34 -0000 1.39 --- Edge.java 17 Mar 2006 18:59:24 -0000 1.40 *************** *** 145,153 **** */ public String getName() { ! String name; if (id == null) { ! name = "E"; } else { ! name = "E" + id; } return name; --- 145,154 ---- */ public String getName() { ! String name = super.getName(); ! if (id == null) { ! name = name + "E"; } else { ! name = name + "E" + id; } return name; *************** *** 199,232 **** /** - * Return the hash code of the object - * @return The hash - */ - public int hashCode() { - if (id == null) { - return super.hashCode(); - } else { - return id.hashCode(); - } - } - - /** - * Indicates whether some other object is equal to this one. - * @param o The other object - * @return True if equal; otherwise false - */ - public boolean equals(Object o) { - if (!(o instanceof Edge)) { - return false; - } - Edge e = (Edge)o; - - if (id == null || e.getId() == null) { - return this == e; - } else { - return this.id.equals(e.getId()); - } - } - - /** * Find the intersection between this Edge and the Other. * The intersection is considered to be the shortest Edge --- 200,203 ---- Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Vertex.java 17 Mar 2006 09:30:34 -0000 1.29 --- Vertex.java 17 Mar 2006 18:59:24 -0000 1.30 *************** *** 65,73 **** */ public String getName() { ! String name; if (id != null) { ! name = "V" + id; } else { ! name = "V"; } return name; --- 65,73 ---- */ public String getName() { ! String name = super.getName(); if (id != null) { ! name = name + "V" + id; } else { ! name = name + "V"; } return name; *************** *** 296,329 **** /** - * Return the hash code of the object - * @return The hash - */ - public int hashCode() { - if (id == null) { - return super.hashCode(); - } else { - return id.hashCode(); - } - } - - /** - * Indicates whether some other object is equal to this one. - * @param o The other object - * @return True if equal; otherwise false - */ - public boolean equals(Object o) { - if (!(o instanceof Vertex)) { - return false; - } - Vertex v = (Vertex)o; - - if (id == null || v.getId() == null) { - return this == v; - } else { - return this.id.equals(v.getId()); - } - } - - /** * String representation of the object * @return The string --- 296,299 ---- Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Geometric.java 1 Feb 2006 11:45:25 -0000 1.2 --- Geometric.java 17 Mar 2006 18:59:24 -0000 1.3 *************** *** 31,33 **** --- 31,49 ---- this.mesh = mesh; } + + /** + * Get the name + * @return The name + */ + public String getName() { + String name; + if (getMesh() == Project.getInstance().mesh()) { + name = ""; + } else { + name = "E"; + } + return name; + } + + } |
From: Michael L. <he...@us...> - 2006-03-17 09:55:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12785/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Pencil, Arc and Rect now edits the active space - Problem: cannot hit vertices in activespace Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Project.java 17 Mar 2006 09:30:34 -0000 1.43 --- Project.java 17 Mar 2006 09:55:27 -0000 1.44 *************** *** 90,93 **** --- 90,101 ---- /** + * Get the mesh + * @return The mesh + */ + public Mesh mesh() { + return mesh; + } + + /** * Add observer * @param observer The observer |
From: Michael L. <he...@us...> - 2006-03-17 09:55:27
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12757/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Pencil, Arc and Rect now edits the active space - Problem: cannot hit vertices in activespace Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** GenericTreeView.java 10 Mar 2006 16:41:31 -0000 1.18 --- GenericTreeView.java 17 Mar 2006 09:55:24 -0000 1.19 *************** *** 34,37 **** --- 34,38 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Mesh; import net.sourceforge.bprocessor.model.Modellor; import net.sourceforge.bprocessor.model.Observer; *************** *** 543,546 **** --- 544,550 ---- offsetItem.addActionListener(new MenuAction() { public void actionPerformed(ActionEvent event) { + if (space.getInterior() == null) { + space.setInterior(new Mesh()); + } Project.getInstance().setActiveSpace(space); } |
From: Michael L. <he...@us...> - 2006-03-17 09:55:22
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12714/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java AbstractPencil.java Log Message: Pencil, Arc and Rect now edits the active space - Problem: cannot hit vertices in activespace Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractPencil.java 16 Mar 2006 20:01:47 -0000 1.6 --- AbstractPencil.java 17 Mar 2006 09:55:20 -0000 1.7 *************** *** 20,23 **** --- 20,24 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; + import net.sourceforge.bprocessor.model.Mesh; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; *************** *** 43,46 **** --- 44,59 ---- /** + * Get the mesh + * @return The mesh + */ + public Mesh mesh() { + if (Project.getInstance().getActiveSpace() != null) { + return Project.getInstance().getActiveSpace().getInterior(); + } else { + return Project.getInstance().mesh(); + } + } + + /** * Find an intersection * @param e MouseEvent *************** *** 60,64 **** Vertex actual = vertex; { ! Set vertices = Project.getInstance().findByLocation (vertex.getX(), vertex.getY(), vertex.getZ(), 0.0000001); if (!vertices.isEmpty()) { --- 73,77 ---- Vertex actual = vertex; { ! Set vertices = mesh().findByLocation (vertex.getX(), vertex.getY(), vertex.getZ(), 0.0000001); if (!vertices.isEmpty()) { *************** *** 67,72 **** } if (actual == vertex) { ! Project.getInstance().add(actual); ! Set es = Project.getInstance().findEdge(actual); if (es.size() > 0) { Iterator iter = es.iterator(); --- 80,85 ---- } if (actual == vertex) { ! mesh().add(actual); ! Set es = mesh().findEdge(actual); if (es.size() > 0) { Iterator iter = es.iterator(); *************** *** 92,96 **** edge.setTo(insertVertex(edge.getTo())); { ! Collection edges = Project.getInstance().getEdges(); Iterator iter = edges.iterator(); while (iter.hasNext()) { --- 105,109 ---- edge.setTo(insertVertex(edge.getTo())); { ! Collection edges = mesh().getEdges(); Iterator iter = edges.iterator(); while (iter.hasNext()) { *************** *** 107,111 **** } if (actual == edge) { ! Project.getInstance().add(edge); } return actual; --- 120,124 ---- } if (actual == edge) { ! mesh().add(edge); } return actual; *************** *** 129,133 **** if (from == to) { Surface surface = new Surface(actual); ! Project.getInstance().add(surface); holeAnalysis(surface); } else { --- 142,146 ---- if (from == to) { Surface surface = new Surface(actual); ! mesh().add(surface); holeAnalysis(surface); } else { Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** AbstractTool.java 12 Mar 2006 12:33:00 -0000 1.62 --- AbstractTool.java 17 Mar 2006 09:55:20 -0000 1.63 *************** *** 155,159 **** */ protected void holeAnalysis(Surface surface) { ! Collection surfaces = Project.getInstance().getSurfaces(); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { --- 155,159 ---- */ protected void holeAnalysis(Surface surface) { ! Collection surfaces = surface.getMesh().getSurfaces(); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { |
From: Michael L. <he...@us...> - 2006-03-17 09:45:14
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1085/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Geometry.java ConstructionSpace.java Space.java LayerModellor.java FunctionalSpace.java Project.java Attribute.java Plane.java Entity.java Log Message: God rid of java warnings Index: LayerModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/LayerModellor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LayerModellor.java 10 Mar 2006 16:41:37 -0000 1.5 --- LayerModellor.java 17 Mar 2006 09:30:34 -0000 1.6 *************** *** 18,22 **** */ public class LayerModellor extends Modellor implements Parametric { ! /** The space */ private Space space; --- 18,23 ---- */ public class LayerModellor extends Modellor implements Parametric { ! /** Default */ ! private static final long serialVersionUID = 1L; /** The space */ private Space space; Index: FunctionalSpace.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/FunctionalSpace.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FunctionalSpace.java 16 Mar 2006 10:17:50 -0000 1.6 --- FunctionalSpace.java 17 Mar 2006 09:30:34 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- */ public class FunctionalSpace extends Space implements Parametric { + /** Default */ + private static final long serialVersionUID = 1L; + /** The logger */ private static Logger log = Logger.getLogger(FunctionalSpace.class); *************** *** 54,65 **** /** - * Set the functional space id - * @param id The functional space id - */ - private void setFunctionalSpaceId(Long id) { - this.functionalSpaceId = id; - } - - /** * Test for functional-space * @return True if functional-space --- 57,60 ---- *************** *** 107,109 **** --- 102,112 ---- return "Functional Space"; } + + /** + * Attribute Info + * @param info String + */ + public static void info(String info) { + log.info(info); + } } Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** Surface.java 10 Mar 2006 16:41:37 -0000 1.81 --- Surface.java 17 Mar 2006 09:30:34 -0000 1.82 *************** *** 28,31 **** --- 28,34 ---- */ public class Surface extends Geometric implements Parametric { + /** Default */ + private static final long serialVersionUID = 1L; + /** The logger */ private static Logger log = Logger.getLogger(Surface.class); Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Edge.java 28 Feb 2006 02:26:25 -0000 1.38 --- Edge.java 17 Mar 2006 09:30:34 -0000 1.39 *************** *** 25,28 **** --- 25,31 ---- */ public class Edge extends Geometric implements Parametric { + /** Default */ + private static final long serialVersionUID = 1L; + /** The logger */ private static Logger log = Logger.getLogger(Edge.class); Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Plane.java 23 Feb 2006 21:31:37 -0000 1.15 --- Plane.java 17 Mar 2006 09:30:34 -0000 1.16 *************** *** 212,214 **** --- 212,222 ---- return "[Plane a: " + a + " b:" + b + " c:" + c + " d:" + d + "]"; } + + /** + * Attribute Info + * @param info String + */ + public static void info(String info) { + log.info(info); + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Project.java 17 Mar 2006 09:04:53 -0000 1.42 --- Project.java 17 Mar 2006 09:30:34 -0000 1.43 *************** *** 618,620 **** --- 618,628 ---- this.defaultPath = defaultPath; } + + /** + * Attribute Info + * @param info String + */ + public static void info(String info) { + log.info(info); + } } Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Attribute.java 28 Feb 2006 02:26:25 -0000 1.8 --- Attribute.java 17 Mar 2006 09:30:34 -0000 1.9 *************** *** 29,32 **** --- 29,33 ---- private boolean editable; + /** * Constructor *************** *** 127,129 **** --- 128,138 ---- return (name + "[" + value) + "]"; } + + /** + * Attribute Info + * @param info String + */ + public static void info(String info) { + log.info(info); + } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Space.java 16 Mar 2006 10:17:49 -0000 1.20 --- Space.java 17 Mar 2006 09:30:34 -0000 1.21 *************** *** 26,29 **** --- 26,31 ---- */ public class Space extends Entity implements Parametric { + /** Default */ + private static final long serialVersionUID = 1L; /** The logger */ private static Logger log = Logger.getLogger(FunctionalSpace.class); Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Geometry.java 2 Feb 2006 14:18:35 -0000 1.14 --- Geometry.java 17 Mar 2006 09:30:34 -0000 1.15 *************** *** 226,230 **** siblings.remove(first); siblings.remove(last); - Iterator iter = siblings.iterator(); while (!siblings.isEmpty()) { Edge current = (Edge) siblings.iterator().next(); --- 226,229 ---- *************** *** 312,316 **** Vertex from = ((Edge) edges.get(0)).getFrom(); - Vertex to = ((Edge) edges.get(edges.size() - 1)).getTo(); EdgeNode currentEdge = last; --- 311,314 ---- *************** *** 341,345 **** Vertex from = ((Edge) edges.get(0)).getFrom(); - Vertex to = ((Edge) edges.get(edges.size() - 1)).getTo(); EdgeNode currentEdge = last; --- 339,342 ---- Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Entity.java 27 Jan 2006 11:41:55 -0000 1.5 --- Entity.java 17 Mar 2006 09:30:34 -0000 1.6 *************** *** 13,17 **** */ public abstract class Entity implements Serializable { - /** The id */ protected Long id; --- 13,16 ---- Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Vertex.java 28 Feb 2006 02:26:25 -0000 1.28 --- Vertex.java 17 Mar 2006 09:30:34 -0000 1.29 *************** *** 25,28 **** --- 25,31 ---- */ public class Vertex extends Geometric implements Parametric { + /** Default */ + private static final long serialVersionUID = 1L; + /** The logger */ private static Logger log = Logger.getLogger(Vertex.class); Index: ConstructionSpace.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ConstructionSpace.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ConstructionSpace.java 16 Mar 2006 10:17:49 -0000 1.6 --- ConstructionSpace.java 17 Mar 2006 09:30:34 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- */ public class ConstructionSpace extends Space implements Parametric { + /** Default */ + private static final long serialVersionUID = 1L; + /** The logger */ private static Logger log = Logger.getLogger(ConstructionSpace.class); *************** *** 54,65 **** /** - * Set the construction space id - * @param id The construction space id - */ - private void setConstructionSpaceId(Long id) { - this.constructionSpaceId = id; - } - - /** * Test for construction-space * @return True if constructionspace --- 57,60 ---- *************** *** 107,109 **** --- 102,112 ---- return "Construction Space"; } + + /** + * Attribute Info + * @param info String + */ + public static void info(String info) { + log.info(info); + } } |
From: Michael L. <he...@us...> - 2006-03-17 09:04:57
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22657/src/net/sourceforge/bprocessor/model Modified Files: Project.java Mesh.java Log Message: Moved findEdge and findByLocation to mesh Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Mesh.java 3 Feb 2006 13:01:49 -0000 1.9 --- Mesh.java 17 Mar 2006 09:04:53 -0000 1.10 *************** *** 11,14 **** --- 11,15 ---- import java.util.Collections; import java.util.HashMap; + import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; *************** *** 375,377 **** --- 376,419 ---- } + /** + * Find vertex based upon location and delta + * @param x The x coordinate + * @param y The y coordinate + * @param z The z coordinate + * @param delta The delta value + * @return The vertexs + */ + 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; + Vertex tester = new Vertex(x, y, z); + while (iter.hasNext()) { + Vertex current = (Vertex) iter.next(); + double distance = current.distance(tester); + if (distance <= limit) { + result.add(current); + } + } + return result; + } + + /** + * Find set of edges that coincides with the vertex + * @param vertex The vertex + * @return The set of edges + */ + public Set findEdge(Vertex vertex) { + Set result = new HashSet(); + Collection edges = getEdges(); + Iterator iter = edges.iterator(); + while (iter.hasNext()) { + Edge current = (Edge) iter.next(); + if (current.coincides(vertex)) { + result.add(current); + } + } + return result; + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Project.java 8 Mar 2006 14:22:51 -0000 1.41 --- Project.java 17 Mar 2006 09:04:53 -0000 1.42 *************** *** 503,519 **** */ 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; ! Vertex tester = new Vertex(x, y, z); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! double distance = current.distance(tester); ! if (distance <= limit) { ! result.add(current); ! } ! } ! return result; } --- 503,507 ---- */ public Set findByLocation(double x, double y, double z, double delta) { ! return mesh.findByLocation(x, y, z, delta); } *************** *** 524,537 **** */ public Set findEdge(Vertex vertex) { ! Set result = new HashSet(); ! Collection edges = getEdges(); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! if (current.coincides(vertex)) { ! result.add(current); ! } ! } ! return result; } --- 512,516 ---- */ public Set findEdge(Vertex vertex) { ! return mesh.findEdge(vertex); } |
From: Michael L. <he...@us...> - 2006-03-16 20:01:54
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv841/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java ArcTool.java RectTool.java Pencil.java AbstractPencil.java Log Message: There is a new version of the Pencil, which currently lacks snapping length field support. The new version is however much simpler and uses a general mechanism for interaction and feedback. The general mechanism are to be extended with snapping and length field support to the benefit of Pencil and other instruments Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Pencil.java 16 Mar 2006 15:24:46 -0000 1.1 --- Pencil.java 16 Mar 2006 20:01:47 -0000 1.2 *************** *** 10,17 **** --- 10,19 ---- import java.awt.Cursor; import java.awt.event.MouseEvent; + import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; + import net.sourceforge.bprocessor.model.Edge; /** *************** *** 28,34 **** private Intersection current; - /** Edges */ - private List edges; - /** * Constructor for Pencil --- 30,33 ---- *************** *** 39,42 **** --- 38,57 ---- super(glv, cursor); } + + /** + * + * Update feedback + */ + public void updateFeedback() { + if (start != null) { + Edge edge = new Edge(start.vertex(), current.vertex()); + List edges = new LinkedList(); + edges.add(edge); + feedback(edges); + } else { + feedback(new LinkedList()); + } + makeTarget(current); + } /** *************** *** 44,47 **** --- 59,66 ---- */ protected void moved(MouseEvent e) { + current = findIntersection(e); + if (current != null) { + updateFeedback(); + } } *************** *** 50,53 **** --- 69,81 ---- */ protected void pressed(MouseEvent e) { + if (start == null) { + start = current; + } else { + Edge edge = new Edge(start.vertex(), current.vertex()); + List edges = new LinkedList(); + edges.add(edge); + insertEdges(edges); + start = null; + } } Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ArcTool.java 16 Mar 2006 09:43:50 -0000 1.5 --- ArcTool.java 16 Mar 2006 20:01:47 -0000 1.6 *************** *** 18,22 **** import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; - import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Vertex; --- 18,21 ---- *************** *** 148,153 **** */ protected void moved(MouseEvent e) { ! current = (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), ! elements, true, new Plane(0, 0, 1, 0)); if (current != null) { updateFeedback(); --- 147,151 ---- */ protected void moved(MouseEvent e) { ! current = findIntersection(e); if (current != null) { updateFeedback(); Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ToolFactory.java 15 Mar 2006 10:36:29 -0000 1.37 --- ToolFactory.java 16 Mar 2006 20:01:47 -0000 1.38 *************** *** 68,72 **** /** pencil tool */ ! private PencilTool pencil; /** eraser tool */ --- 68,72 ---- /** pencil tool */ ! private Pencil pencil; /** eraser tool */ *************** *** 163,167 **** select = new SpaceTool(glv, null); ! pencil = new PencilTool(glv, pencilcursor); eraser = new EraserTool(glv, pencilcursor); arc = new ArcTool(glv, pencilcursor); --- 163,167 ---- select = new SpaceTool(glv, null); ! pencil = new Pencil(glv, pencilcursor); eraser = new EraserTool(glv, pencilcursor); arc = new ArcTool(glv, pencilcursor); Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RectTool.java 16 Mar 2006 14:34:50 -0000 1.2 --- RectTool.java 16 Mar 2006 20:01:47 -0000 1.3 *************** *** 16,20 **** import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.Edge; - import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Vertex; --- 16,19 ---- *************** *** 105,110 **** */ protected void moved(MouseEvent e) { ! current = (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), ! elements, true, new Plane(0, 0, 1, 0)); if (current != null) { updateFeedback(); --- 104,108 ---- */ protected void moved(MouseEvent e) { ! current = findIntersection(e); if (current != null) { updateFeedback(); Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractPencil.java 16 Mar 2006 14:34:50 -0000 1.5 --- AbstractPencil.java 16 Mar 2006 20:01:47 -0000 1.6 *************** *** 8,11 **** --- 8,12 ---- import java.awt.Cursor; + import java.awt.event.MouseEvent; import java.util.Collection; import java.util.HashSet; *************** *** 19,22 **** --- 20,24 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; + import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; *************** *** 40,44 **** } ! /** * Insert a vertex into model --- 42,55 ---- } ! /** ! * Find an intersection ! * @param e MouseEvent ! * @return Intersection ! */ ! protected Intersection findIntersection(MouseEvent e) { ! Intersection intersection = (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), ! elements, true, new Plane(0, 0, 1, 0)); ! return intersection; ! } /** * Insert a vertex into model |