bprocessor-commit Mailing List for B-processor (Page 143)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2006-01-10 08:47:48
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23920/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrudeTool.java Log Message: Fixed bug in extrude and more holeanalysis Index: ExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrudeTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExtrudeTool.java 22 Dec 2005 10:36:01 -0000 1.5 --- ExtrudeTool.java 10 Jan 2006 08:47:41 -0000 1.6 *************** *** 252,265 **** super.released(e); if (Math.abs(t) < 0.0000001) { ! deleteSurface(top); ! top = null; Iterator iter = sides.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); ! deleteSurface(current); } - sides = null; - } else { - holeAnalysis(top); } } --- 252,272 ---- super.released(e); 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; ! } ! } else { ! holeAnalysis(top); Iterator iter = sides.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); ! holeAnalysis(current); } } } |
From: Michael L. <he...@us...> - 2006-01-10 08:35:29
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21963/src/net/sourceforge/bprocessor/gl/tool Removed Files: ExtrusionTool.java Log Message: Clean up --- ExtrusionTool.java DELETED --- |
From: Michael L. <he...@us...> - 2006-01-10 08:24:10
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19672/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Added two TODO's to drawSurfaces about front and back color Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** View.java 4 Jan 2006 12:57:43 -0000 1.38 --- View.java 10 Jan 2006 08:23:59 -0000 1.39 *************** *** 1386,1393 **** --- 1386,1395 ---- } else { if (side == FRONT) { + // TODO Check the color of the front material of the Surface Space back = s.getFrontDomain(); gl.glColor3fv(getSpaceColor(back)); } if (side == BACK) { + // TODO Check the color of the back material of the Surface Space front = s.getBackDomain(); gl.glColor3fv(getSpaceColor(front)); |
From: Michael L. <he...@us...> - 2006-01-06 15:46:37
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27315/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java Log Message: Removed usage of Notifier Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ExtrusionTool.java 4 Jan 2006 14:29:50 -0000 1.37 --- ExtrusionTool.java 6 Jan 2006 15:46:26 -0000 1.38 *************** *** 11,16 **** import net.sourceforge.bprocessor.gl.view.Transformation; - import net.sourceforge.bprocessor.kernel.notification.Notification; - import net.sourceforge.bprocessor.kernel.notification.Notifier; import net.sourceforge.bprocessor.model.Edge; --- 11,14 ---- *************** *** 590,595 **** //moving this line to the top Surface topSurf = createSurface(top); - Notification n = new Notification(Notification.SURFACE_SELECTED, topSurf.getId()); - Notifier.getInstance().sendNotification(n); newSurfaces.addFirst(topSurf); --- 588,591 ---- |
From: Michael L. <he...@us...> - 2006-01-06 15:36:30
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25204/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Selection refactored. Selection is now a special observable collection. Views responds to changed in the selection. Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GenericTreeView.java 4 Jan 2006 14:29:55 -0000 1.5 --- GenericTreeView.java 6 Jan 2006 15:36:19 -0000 1.6 *************** *** 18,27 **** import javax.swing.tree.TreePath; - import net.sourceforge.bprocessor.kernel.notification.Notification; - import net.sourceforge.bprocessor.kernel.notification.Notifier; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; --- 18,26 ---- import javax.swing.tree.TreePath; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 102,142 **** */ public void select(Object target) { ! if (selection != null) { ! if (selection instanceof Space) { ! Space space = (Space) selection; ! if (space.isFunctionalSpace()) { ! Notification n = ! new Notification(Notification.FUNCTIONAL_SPACE_DESELECTED, space.getId()); ! Notifier.getInstance().sendNotification(n); ! } else { ! Notification n = ! new Notification(Notification.CONSTRUCTION_SPACE_DESELECTED, space.getId()); ! Notifier.getInstance().sendNotification(n); ! } ! } else if (selection instanceof Surface) { ! Surface surface = (Surface) selection; ! Notification n = new Notification(Notification.SURFACE_DESELECTED, surface.getId()); ! Notifier.getInstance().sendNotification(n); ! } ! } ! selection = target; ! if (selection != null) { ! if (selection instanceof Space) { ! Space space = (Space) selection; ! if (space.isFunctionalSpace()) { ! Notification n = ! new Notification(Notification.FUNCTIONAL_SPACE_SELECTED, space.getId()); ! Notifier.getInstance().sendNotification(n); ! } else { ! Notification n = ! new Notification(Notification.CONSTRUCTION_SPACE_SELECTED, space.getId()); ! Notifier.getInstance().sendNotification(n); ! } ! } else if (selection instanceof Surface) { ! Surface surface = (Surface) selection; ! Notification n = new Notification(Notification.SURFACE_SELECTED, surface.getId()); ! Notifier.getInstance().sendNotification(n); ! } ! } } --- 101,105 ---- */ public void select(Object target) { ! Selection.primary().set(target); } |
From: Michael L. <he...@us...> - 2006-01-06 15:36:26
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25204/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Selection refactored. Selection is now a special observable collection. Views responds to changed in the selection. Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AttributeView.java 6 Jan 2006 11:21:41 -0000 1.14 --- AttributeView.java 6 Jan 2006 15:36:19 -0000 1.15 *************** *** 7,14 **** package net.sourceforge.bprocessor.gui.attrview; ! import net.sourceforge.bprocessor.kernel.notification.Notification; ! import net.sourceforge.bprocessor.kernel.notification.NotificationListener; ! import net.sourceforge.bprocessor.kernel.notification.Notifier; ! import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; --- 7,12 ---- package net.sourceforge.bprocessor.gui.attrview; ! import net.sourceforge.bprocessor.model.Observer; ! import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 34,38 **** * The attribute view */ ! public class AttributeView extends JTabbedPane implements NotificationListener { /** The logger */ private static Logger log = Logger.getLogger(AttributeView.class); --- 32,36 ---- * The attribute view */ ! public class AttributeView extends JTabbedPane implements Observer { /** The logger */ private static Logger log = Logger.getLogger(AttributeView.class); *************** *** 52,108 **** setMinimumSize(new Dimension(120, 240)); setPreferredSize(new Dimension(120, 240)); ! Notifier.getInstance().addListener(this); } ! /** ! * Handle a notification ! * @param n The notification */ ! public void handleNotification(Notification n) { ! if (log.isDebugEnabled()) { ! log.debug(n); ! } ! ! String type = n.getType(); ! if (type.equals(Notification.FUNCTIONAL_SPACE_SELECTED)) { ! Space current = Project.getInstance().findFunctionalSpaceById(n.getObject()); ! ap.displayFuncSpace(current); ! } else if (type.equals(Notification.CONSTRUCTION_SPACE_SELECTED)) { ! Space current = Project.getInstance().findConstructionSpaceById(n.getObject()); ! ap.displayConsSpace(current); ! } else if (type.equals(Notification.SURFACE_SELECTED)) { ! Surface current = Project.getInstance().findSurfaceById(n.getObject()); ! ap.displaySurface(current); ! } else if (type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || ! type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED) || ! type.equals(Notification.ELEMENT_DESELECTED) || ! type.equals(Notification.PART_DESELECTED) || ! type.equals(Notification.SURFACE_DESELECTED)) { ! ! ap.display(null); } - repaint(); ! } ! ! /** ! * Should the listener handle this notification ! * @param type The notification type ! * @return True if it should handle it; otherwise false ! */ ! public boolean isNotificationEnabled(String type) { ! if (type.equals(Notification.FUNCTIONAL_SPACE_SELECTED) || ! type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || ! type.equals(Notification.CONSTRUCTION_SPACE_SELECTED) || ! type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED) || ! type.equals(Notification.ELEMENT_SELECTED) || ! type.equals(Notification.ELEMENT_DESELECTED) || ! type.equals(Notification.PART_SELECTED) || ! type.equals(Notification.PART_DESELECTED) || ! type.equals(Notification.SURFACE_SELECTED) || ! type.equals(Notification.SURFACE_DESELECTED)) { ! return true; ! } ! return false; } --- 50,83 ---- setMinimumSize(new Dimension(120, 240)); setPreferredSize(new Dimension(120, 240)); ! Selection.primary().addObserver(this); } ! /** ! * @param object The changed object */ ! public void update(Object object) { ! Selection selection = Selection.primary(); ! if (object == selection) { ! if (selection.size() == 1) { ! Object target = selection.iterator().next(); ! if (target instanceof Space) { ! Space space = (Space) target; ! if (space.isConstructionSpace()) { ! ap.displayConsSpace(space); ! } ! if (space.isFunctionalSpace()) { ! ap.displayFuncSpace(space); ! } ! } else if (target instanceof Surface) { ! ap.displaySurface((Surface) target); ! } else { ! ap.display(null); ! } ! } else { ! ap.display(null); ! } } repaint(); ! //FIXME should re-display if anything else is changed } *************** *** 250,253 **** --- 225,229 ---- add((JLabel)components.get(i)); } + revalidate(); } |
From: Michael L. <he...@us...> - 2006-01-06 15:36:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25160/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Selection refactored. Selection is now a special observable collection. Views responds to changed in the selection. Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** GLView.java 4 Jan 2006 14:29:51 -0000 1.32 --- GLView.java 6 Jan 2006 15:36:14 -0000 1.33 *************** *** 14,20 **** import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.kernel.notification.NotificationListener; ! import net.sourceforge.bprocessor.kernel.notification.Notification; ! import net.sourceforge.bprocessor.kernel.notification.Notifier; import net.sourceforge.bprocessor.gui.GUI; --- 14,18 ---- import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.gui.GUI; *************** *** 33,36 **** --- 31,35 ---- import java.awt.event.MouseListener; import java.awt.event.ActionListener; + import java.util.Collection; import javax.swing.JTextField; *************** *** 46,50 **** * The 3D display */ ! public class GLView implements MouseListener, NotificationListener, Observer { /** The logger */ private static Logger log = Logger.getLogger(GLView.class); --- 45,49 ---- * The 3D display */ ! public class GLView implements MouseListener, Observer { /** The logger */ private static Logger log = Logger.getLogger(GLView.class); *************** *** 67,71 **** public GLView() { log.info("Using JOGL version " + Version.getVersion()); ! Notifier.getInstance().addListener(this); Project.getInstance().addObserver(this); GLCapabilities glCap = new GLCapabilities(); --- 66,70 ---- public GLView() { log.info("Using JOGL version " + Version.getVersion()); ! Selection.primary().addObserver(this); Project.getInstance().addObserver(this); GLCapabilities glCap = new GLCapabilities(); *************** *** 248,252 **** * The length field class */ ! class LengthField extends JTextField implements NotificationListener { /** The logger */ private Logger log = Logger.getLogger(LengthField.class); --- 247,251 ---- * The length field class */ ! class LengthField extends JTextField implements Observer { /** The logger */ private Logger log = Logger.getLogger(LengthField.class); *************** *** 257,262 **** public LengthField() { super(15); ! ! Notifier.getInstance().addListener(this); } --- 256,260 ---- public LengthField() { super(15); ! Selection.primary().addObserver(this); } *************** *** 284,313 **** return 0; } - - /** - * Handle a notification - * @param n The notification - */ - public void handleNotification(Notification n) { - if (n.getType().equals(Notification.EDGE_SELECTED)) { - Edge e = (Project.getInstance().findEdgeById(n.getObject())); - setText(e.getLength()); - } else if (n.getType().equals(Notification.EDGE_DESELECTED)) { - setText(0); - } - } - /** ! * Should the listener handle this notification ! * @param type The notification type ! * @return Returns true on SELECTED events; otherwise false */ ! public boolean isNotificationEnabled(String type) { ! if (type.equals(Notification.EDGE_SELECTED) || ! type.equals(Notification.EDGE_DESELECTED)) { ! return true; ! } ! return false; } } --- 282,304 ---- return 0; } /** ! * @param object The changed object (Selection) */ ! public void update(Object object) { ! Collection selection = Selection.primary(); ! if (selection == object) { ! if (selection.size() == 1) { ! Object entity = selection.iterator().next(); ! if (entity instanceof Edge) { ! Edge edge = (Edge) entity; ! setText(edge.getLength()); ! } else { ! setText(0); ! } ! } else { ! setText(0); ! } ! } } } *************** *** 350,381 **** /** - * Handle a notification - * @param n The notification - */ - public void handleNotification(Notification n) { - repaint(); - } - - /** - * Should the listener handle this notification - * @param type The notification type - * @return True if it should handle it; otherwise false - */ - public boolean isNotificationEnabled(String type) { - if (type.equals(Notification.FUNCTIONAL_SPACE_SELECTED) || - type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || - type.equals(Notification.CONSTRUCTION_SPACE_SELECTED) || - type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED)) { - return true; - } - return false; - } - - /** * Update this view * @param entity The changed entity */ public void update(Object entity) { ! repaint(); } } --- 341,353 ---- /** * Update this view * @param entity The changed entity */ public void update(Object entity) { ! if (entity == Selection.primary()) { ! repaint(); ! } else { ! repaint(); ! } } } |
From: Michael L. <he...@us...> - 2006-01-06 15:36:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25160/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java ToolFactory.java SelectTool.java Log Message: Selection refactored. Selection is now a special observable collection. Views responds to changed in the selection. Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ToolFactory.java 20 Dec 2005 15:43:36 -0000 1.22 --- ToolFactory.java 6 Jan 2006 15:36:14 -0000 1.23 *************** *** 9,13 **** import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gui.Toolbar; - import net.sourceforge.bprocessor.kernel.notification.Notifier; import java.net.URL; --- 9,12 ---- *************** *** 123,128 **** fly = new CameraFlyTool(glv, flyCursor); walk = new CameraWalkTool(glv, walkCursor); - - Notifier.getInstance().addListener(select); } --- 122,125 ---- Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** SelectTool.java 29 Dec 2005 15:06:48 -0000 1.48 --- SelectTool.java 6 Jan 2006 15:36:14 -0000 1.49 *************** *** 10,18 **** import net.sourceforge.bprocessor.gl.model.ClippingPlane; - import net.sourceforge.bprocessor.kernel.notification.Notification; - import net.sourceforge.bprocessor.kernel.notification.NotificationListener; - import net.sourceforge.bprocessor.kernel.notification.Notifier; - - import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Project; --- 10,13 ---- *************** *** 40,44 **** * The selecttool */ ! public class SelectTool extends AbstractTool implements NotificationListener { /** The logger */ private static Logger log = Logger.getLogger(SelectTool.class); --- 35,39 ---- * The selecttool */ ! public class SelectTool extends AbstractTool { /** The logger */ private static Logger log = Logger.getLogger(SelectTool.class); *************** *** 306,324 **** */ private void select(Object obj) { ! if (obj instanceof Vertex) { ! Vertex v = (Vertex)obj; ! Notification n = new Notification(Notification.VERTEX_SELECTED, v.getId()); ! Notifier.getInstance().sendNotification(n); ! } else if (obj instanceof Surface) { ! Surface surface = (Surface)obj; ! Notification n = new Notification(Notification.SURFACE_SELECTED, surface.getId()); ! Notifier.getInstance().sendNotification(n); ! } else if (obj instanceof Edge) { ! Edge edge = (Edge)obj; ! Notification n = new Notification(Notification.EDGE_SELECTED, edge.getId()); ! Notifier.getInstance().sendNotification(n); ! } else if (obj instanceof ClippingPlane) { ! selection.add(obj); ! } } --- 301,305 ---- */ private void select(Object obj) { ! selection.add(obj); } *************** *** 328,349 **** */ private void deselect(Object obj) { ! if (obj instanceof Vertex) { ! Vertex v = (Vertex)obj; ! Notification n = new Notification(Notification.VERTEX_DESELECTED, v.getId()); ! Notifier.getInstance().sendNotification(n); ! } else if (obj instanceof Surface) { ! Surface surface = (Surface)obj; ! Notification n = new Notification(Notification.SURFACE_DESELECTED, surface.getId()); ! Notifier.getInstance().sendNotification(n); ! } else if (obj instanceof Edge) { ! Edge edge = (Edge)obj; ! Notification n = new Notification(Notification.EDGE_DESELECTED, edge.getId()); ! Notifier.getInstance().sendNotification(n); ! } else if (obj instanceof ClippingPlane) { ! log.info("Clip selected"); ! if (selection.contains(obj)) { ! selection.remove(obj); ! } ! } } --- 309,313 ---- */ private void deselect(Object obj) { ! selection.remove(obj); } *************** *** 368,385 **** if (selected instanceof Surface) { Surface selectedSurface = (Surface)selected; - selection.remove(selectedSurface); deleteSurface(selectedSurface); } else if (selected instanceof Edge) { Edge selectedEdge = (Edge)selected; - selection.remove(selectedEdge); deleteEdge(selectedEdge); } else if (selected instanceof Vertex) { - selection.remove(selected); deleteVertex((Vertex) selected); } else if (selected instanceof ClippingPlane) { - selection.remove(selected); glv.getView().removeClippingPlane((ClippingPlane)selected); } } glv.getView().makeTarget(null); glv.repaint(); --- 332,346 ---- 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); } } + selection.clear(); glv.getView().makeTarget(null); glv.repaint(); *************** *** 387,494 **** super.keyPressed(e); } - } - - /** - * Handle a notification - * @param n The notification - */ - public void handleNotification(Notification n) { - if (n.getType().equals(Notification.VERTEX_SELECTED)) { - Vertex o = Project.getInstance().findVertexById(n.getObject()); - if (!selection.contains(o)) { - selection.add(o); - } - } else if (n.getType().equals(Notification.VERTEX_DESELECTED)) { - Vertex o = Project.getInstance().findVertexById(n.getObject()); - if (selection.contains(o)) { - selection.remove(o); - } - } else if (n.getType().equals(Notification.EDGE_SELECTED)) { - Edge o = Project.getInstance().findEdgeById(n.getObject()); - if (!selection.contains(o)) { - selection.add(o); - } - } else if (n.getType().equals(Notification.EDGE_DESELECTED)) { - Edge o = Project.getInstance().findEdgeById(n.getObject()); - if (selection.contains(o)) { - selection.remove(o); - } - } else if (n.getType().equals(Notification.SURFACE_SELECTED)) { - Surface o = Project.getInstance().findSurfaceById(n.getObject()); - if (!selection.contains(o)) { - selection.add(o); - } - } else if (n.getType().equals(Notification.SURFACE_DESELECTED)) { - Surface o = Project.getInstance().findSurfaceById(n.getObject()); - if (selection.contains(o)) { - selection.remove(o); - } - } else if (n.getType().equals(Notification.FUNCTIONAL_SPACE_SELECTED)) { - Space fs = - Project.getInstance().findFunctionalSpaceById(n.getObject()); - Set s = fs.getSurfaces(); - Iterator it = s.iterator(); - while (it.hasNext()) { - Surface surface = (Surface)it.next(); - if (!selection.contains(surface)) { - selection.add(surface); - } - } - } else if (n.getType().equals(Notification.FUNCTIONAL_SPACE_DESELECTED)) { - Space fs = - Project.getInstance().findFunctionalSpaceById(n.getObject()); - Set s = fs.getSurfaces(); - Iterator it = s.iterator(); - while (it.hasNext()) { - Surface surface = (Surface)it.next(); - if (selection.contains(surface)) { - selection.remove(surface); - } - } - } else if (n.getType().equals(Notification.CONSTRUCTION_SPACE_SELECTED)) { - Space cs = - Project.getInstance().findConstructionSpaceById(n.getObject()); - Set s = cs.getSurfaces(); - Iterator it = s.iterator(); - while (it.hasNext()) { - Surface surface = (Surface)it.next(); - if (!selection.contains(surface)) { - selection.add(surface); - } - } - } else if (n.getType().equals(Notification.CONSTRUCTION_SPACE_DESELECTED)) { - Space cs = - Project.getInstance().findConstructionSpaceById(n.getObject()); - Set s = cs.getSurfaces(); - Iterator it = s.iterator(); - while (it.hasNext()) { - Surface surface = (Surface)it.next(); - if (selection.contains(surface)) { - selection.remove(surface); - } - } - } - glv.repaint(); } - - /** - * Should the listener handle this notification - * @param type The notification type - * @return Returns true on SELECTED events; otherwise false - */ - public boolean isNotificationEnabled(String type) { - if (type.equals(Notification.VERTEX_SELECTED) || - type.equals(Notification.VERTEX_DESELECTED) || - type.equals(Notification.EDGE_SELECTED) || - type.equals(Notification.EDGE_DESELECTED) || - type.equals(Notification.SURFACE_SELECTED) || - type.equals(Notification.SURFACE_DESELECTED) || - type.equals(Notification.FUNCTIONAL_SPACE_SELECTED) || - type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || - type.equals(Notification.CONSTRUCTION_SPACE_SELECTED) || - type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED)) { - return true; - } - return false; - } } --- 348,351 ---- Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** AbstractTool.java 4 Jan 2006 14:29:50 -0000 1.46 --- AbstractTool.java 6 Jan 2006 15:36:14 -0000 1.47 *************** *** 11,14 **** --- 11,15 ---- import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 29,33 **** import java.util.Set; import java.util.Collection; - import java.util.HashSet; import org.apache.log4j.Logger; --- 30,33 ---- *************** *** 79,83 **** static { ! selection = new HashSet(); } --- 79,83 ---- static { ! selection = Selection.primary(); } |
From: Michael L. <he...@us...> - 2006-01-06 14:13:55
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7005/src/net/sourceforge/bprocessor/model Modified Files: Selection.java Log Message: Selection implements Collection interface Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Selection.java 6 Jan 2006 10:31:56 -0000 1.3 --- Selection.java 6 Jan 2006 14:13:45 -0000 1.4 *************** *** 19,23 **** * in the userinterface. */ ! public class Selection { /** The collection of objects */ private Collection selection; --- 19,23 ---- * in the userinterface. */ ! public class Selection implements Collection { /** The collection of objects */ private Collection selection; *************** *** 58,65 **** * Add an object to the Selection * @param object The object */ ! public void add(Object object) { ! selection.add(object); ! changed(); } --- 58,70 ---- * Add an object to the Selection * @param object The object + * @return True if changed */ ! public boolean add(Object object) { ! if (selection.add(object)) { ! changed(); ! return true; ! } else { ! return false; ! } } *************** *** 67,74 **** * Remove and object from the Selection * @param object The object */ ! public void remove(Object object) { ! selection.remove(object); ! changed(); } --- 72,84 ---- * Remove and object from the Selection * @param object The object + * @return True if changed */ ! public boolean remove(Object object) { ! if (selection.remove(object)) { ! changed(); ! return true; ! } else { ! return false; ! } } *************** *** 125,130 **** } } ! ! ! } --- 135,221 ---- } } ! ! /** ! * Return the size of selection ! * @return size of selection ! */ ! public int size() { ! return selection.size(); ! } ! ! /** ! * Return true if empty ! * @return true if empty ! */ ! public boolean isEmpty() { ! return selection.isEmpty(); ! } ! ! /** ! * Convert to array ! * @return Array of all elements in selection ! */ ! public Object[] toArray() { ! return selection.toArray(); ! } ! ! /** ! * Add all elements to array ! * @param array Elements to add ! * @return The array ! */ ! public Object[] toArray(Object[] array) { ! return selection.toArray(array); ! } ! ! /** ! * Test if selection contains all elements in a collection ! * @param objects The collection ! * @return True if all elements are contained in this selection ! */ ! public boolean containsAll(Collection objects) { ! return selection.containsAll(objects); ! } ! ! /** ! * Add all elements from collection ! * @param objects The collection ! * @return True if changed ! */ ! public boolean addAll(Collection objects) { ! if (selection.addAll(objects)) { ! changed(); ! return true; ! } else { ! return false; ! } ! } ! ! /** ! * Remove all elements from collection ! * @param objects The collection ! * @return True if changed ! */ ! public boolean removeAll(Collection objects) { ! if (selection.removeAll(objects)) { ! changed(); ! return true; ! } else { ! return false; ! } ! } ! ! /** ! * Retain all elements in collection ! * @param objects Collection ! * @return True if changed ! */ ! public boolean retainAll(Collection objects) { ! if (selection.retainAll(objects)) { ! changed(); ! return true; ! } else { ! return false; ! } ! } } |
From: Michael L. <he...@us...> - 2006-01-06 11:21:52
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1067/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Color example Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AttributeView.java 6 Jan 2006 11:14:50 -0000 1.13 --- AttributeView.java 6 Jan 2006 11:21:41 -0000 1.14 *************** *** 14,17 **** --- 14,18 ---- import net.sourceforge.bprocessor.model.Surface; + import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; *************** *** 150,153 **** --- 151,157 ---- JPanel filler = new JPanel(); + filler.setOpaque(true); + Color background = new Color(0.1f, 0.2f, 0.5f); + filler.setBackground(background); con.weighty = 1.0; con.fill = GridBagConstraints.BOTH; |
From: Michael L. <he...@us...> - 2006-01-06 11:15:07
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32254/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Fixes to usage of GridBagLayout Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** AttributeView.java 23 Dec 2005 11:19:03 -0000 1.12 --- AttributeView.java 6 Jan 2006 11:14:50 -0000 1.13 *************** *** 132,151 **** JLabel name = new JLabel("Name:"); ! con.anchor = GridBagConstraints.PAGE_START; ! con.weightx = 1.0; layout.setConstraints(name, con); ! add(name); ! JTextField nameEdit = new JTextField(o.getName(), 10); con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(nameEdit, con); add(nameEdit); nameEdit.addKeyListener(new MyKeyListener(o)); ! Object[] options = {"Arbejdsværelse", "Badeværelse", "Gang", "Køkken", "Stue", "Værelse"}; JComboBox klassifikation = new JComboBox(options); - con.weightx = 0.0; layout.setConstraints(klassifikation, con); add(klassifikation); } --- 132,158 ---- JLabel name = new JLabel("Name:"); ! con.anchor = GridBagConstraints.NORTHEAST; layout.setConstraints(name, con); ! add(name); ! JTextField nameEdit = new JTextField(o.getName()); con.gridwidth = GridBagConstraints.REMAINDER; + con.weightx = 1.0; + con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(nameEdit, con); add(nameEdit); nameEdit.addKeyListener(new MyKeyListener(o)); ! Object[] options = {"Arbejdsv¾relse", "Badev¾relse", "Gang", "K¿kken", "Stue", "V¾relse"}; JComboBox klassifikation = new JComboBox(options); layout.setConstraints(klassifikation, con); add(klassifikation); + + JPanel filler = new JPanel(); + con.weighty = 1.0; + con.fill = GridBagConstraints.BOTH; + layout.setConstraints(filler, con); + add(filler); + revalidate(); } *************** *** 163,167 **** JLabel name = new JLabel("Name:"); con.anchor = GridBagConstraints.NORTH; ! con.weightx = 1.0; layout.setConstraints(name, con); add(name); --- 170,174 ---- JLabel name = new JLabel("Name:"); con.anchor = GridBagConstraints.NORTH; ! con.weightx = 1.0; layout.setConstraints(name, con); add(name); *************** *** 171,174 **** --- 178,182 ---- layout.setConstraints(nameEdit, con); add(nameEdit); + revalidate(); } *************** *** 194,197 **** --- 202,206 ---- layout.setConstraints(surfaceName, con); add(surfaceName); + revalidate(); } |
From: Michael L. <he...@us...> - 2006-01-06 10:32:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24505/src/net/sourceforge/bprocessor/model Modified Files: Selection.java Log Message: - Selection.iterator() - Observer interface for selection Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Selection.java 6 Jan 2006 10:03:49 -0000 1.2 --- Selection.java 6 Jan 2006 10:31:56 -0000 1.3 *************** *** 10,13 **** --- 10,16 ---- import java.util.Collection; import java.util.HashSet; + import java.util.Iterator; + import java.util.LinkedList; + import java.util.List; /** *************** *** 20,23 **** --- 23,29 ---- private Collection selection; + /** The observers */ + private List observers; + /** The primary selection */ private static Selection primary = new Selection(); *************** *** 37,40 **** --- 43,56 ---- super(); selection = new HashSet(); + observers = new LinkedList(); + } + + /** + * Return true if object is contained in this Selection + * @param object The object + * @return True if object is contained in this Selection + */ + public boolean contains(Object object) { + return selection.contains(object); } *************** *** 45,48 **** --- 61,65 ---- public void add(Object object) { selection.add(object); + changed(); } *************** *** 53,65 **** public void remove(Object object) { selection.remove(object); ! } ! ! /** ! * Return true if object is contained in this Selection ! * @param object The object ! * @return True if object is contained in this Selection ! */ ! public boolean contains(Object object) { ! return selection.contains(object); } --- 70,74 ---- public void remove(Object object) { selection.remove(object); ! changed(); } *************** *** 69,72 **** --- 78,82 ---- public void clear() { selection.clear(); + changed(); } *************** *** 78,83 **** --- 88,130 ---- clear(); add(object); + changed(); } + /** + * Return an iterator + * @return An iterator + */ + public Iterator iterator() { + return selection.iterator(); + } + + /** + * Add observer + * @param observer The observer + */ + public void addObserver(Observer observer) { + observers.add(observer); + } + + /** + * Remove observer + * @param observer The observer + */ + public void removeObserver(Observer observer) { + observers.remove(observer); + } + + /** + * Tell observers to update because this selection has changed + */ + public void changed() { + Iterator iter = observers.iterator(); + while (iter.hasNext()) { + Observer current = (Observer) iter.next(); + current.update(this); + } + } + + } |
From: Michael L. <he...@us...> - 2006-01-06 10:03:57
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20138/src/net/sourceforge/bprocessor/model Modified Files: Selection.java Log Message: Added a "contains" method to Selection Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Selection.java 6 Jan 2006 09:59:23 -0000 1.1 --- Selection.java 6 Jan 2006 10:03:49 -0000 1.2 *************** *** 56,59 **** --- 56,68 ---- /** + * Return true if object is contained in this Selection + * @param object The object + * @return True if object is contained in this Selection + */ + public boolean contains(Object object) { + return selection.contains(object); + } + + /** * Clear the selection */ |
From: Michael L. <he...@us...> - 2006-01-06 09:59:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19293/src/net/sourceforge/bprocessor/model Added Files: Selection.java Log Message: Added a Selection class to handle the selection --- NEW FILE: Selection.java --- //--------------------------------------------------------------------------------- // $Id: Selection.java,v 1.1 2006/01/06 09:59:23 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; import java.util.Collection; import java.util.HashSet; /** * The represents a collection of objects. * The primary collection are shared for all elements * in the userinterface. */ public class Selection { /** The collection of objects */ private Collection selection; /** The primary selection */ private static Selection primary = new Selection(); /** * Return the primary selection * @return The primary selection */ public static Selection primary() { return primary; } /** * Constructor for Selection */ public Selection() { super(); selection = new HashSet(); } /** * Add an object to the Selection * @param object The object */ public void add(Object object) { selection.add(object); } /** * Remove and object from the Selection * @param object The object */ public void remove(Object object) { selection.remove(object); } /** * Clear the selection */ public void clear() { selection.clear(); } /** * Set the selection * @param object The object */ public void set(Object object) { clear(); add(object); } } |
From: Michael L. <he...@us...> - 2006-01-05 13:48:18
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attributesview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23340/src/net/sourceforge/bprocessor/gui/attributesview Modified Files: AttributesPanel.java AttributeView.java Log Message: Comments Index: AttributesPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attributesview/AttributesPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AttributesPanel.java 5 Jan 2006 13:28:02 -0000 1.1 --- AttributesPanel.java 5 Jan 2006 13:48:06 -0000 1.2 *************** *** 22,26 **** /** ! * The AttributesPanel */ public class AttributesPanel extends JPanel implements MouseListener { --- 22,27 ---- /** ! * The AttributesPanel contains a list of attributes each represented by ! * the AttributeView interface. */ public class AttributesPanel extends JPanel implements MouseListener { Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attributesview/AttributeView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AttributeView.java 5 Jan 2006 13:28:02 -0000 1.1 --- AttributeView.java 5 Jan 2006 13:48:06 -0000 1.2 *************** *** 11,15 **** /** ! * The AttributeView */ public interface AttributeView { --- 11,15 ---- /** ! * The AttributeView represents *one* attribute */ public interface AttributeView { |
From: Michael L. <he...@us...> - 2006-01-05 13:35:44
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attributesview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20921/src/net/sourceforge/bprocessor/gui/attributesview Added Files: AttributeExample.java Log Message: Example of using AttributesPanel --- NEW FILE: AttributeExample.java --- //--------------------------------------------------------------------------------- // $Id: AttributeExample.java,v 1.1 2006/01/05 13:35:32 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.attributesview; import java.awt.BorderLayout; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import javax.swing.JFrame; import javax.swing.JPanel; /** * An example of using AttributesPanel */ public class AttributeExample extends JFrame { /** * Constructor */ public AttributeExample() { super(); this.setTitle("Attribute Panel"); HashMap map = new HashMap(); List keys = new LinkedList(); keys.add("x"); keys.add("y"); keys.add("z"); keys.add("rotation"); keys.add("label"); map.put("x", "1.0000"); map.put("y", "2.0000"); map.put("z", "0.7500"); map.put("rotation", "90"); map.put("label", "Vertex 1"); AttributesPanel attributeView = new AttributesPanel(); attributeView.setAttributes(build(keys, map)); this.getContentPane().add(attributeView, BorderLayout.NORTH); this.getContentPane().add(new JPanel(), BorderLayout.CENTER); this.pack(); this.setVisible(true); } /** * Build a list of AttributeView using the values in the map * @param keys Specifies the order of the keys * @param map Specifies the values * @return A list of AttributeView */ List build(List keys, HashMap map) { List attributes = new LinkedList(); Iterator iter = keys.iterator(); while (iter.hasNext()) { String key = (String) iter.next(); String value = (String) map.get(key); StringAttributeView current = new StringAttributeView(key, value); current.addStringAttributeListener( new StringAttributeListener() { public void valueChanged(String name, String value) { System.out.println(name + " = " + value); } } ); attributes.add(current); } return attributes; } /** * Main * @param args Arguments */ public static void main(String[] args) { new AttributeExample(); } } |
From: Michael L. <he...@us...> - 2006-01-05 13:28:18
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attributesview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19313/src/net/sourceforge/bprocessor/gui/attributesview Log Message: Directory /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attributesview added to the repository |
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attributesview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19328/src/net/sourceforge/bprocessor/gui/attributesview Added Files: AttributesPanel.java AttributeView.java package.html StringAttributeListener.java StringAttributeView.java Log Message: New attributes view code --- NEW FILE: StringAttributeView.java --- //--------------------------------------------------------------------------------- // $Id: StringAttributeView.java,v 1.1 2006/01/05 13:28:02 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.attributesview; import java.awt.Component; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import javax.swing.Box; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JTextField; /** * The StringAttributeView */ public class StringAttributeView implements AttributeView, KeyListener { /** The listeners */ private List listeners; /** The name of this AttributeView */ private String name; /** The String value of this AttributeView */ private String value; /** The component */ private JComponent component; /** The editor, when this AttributeView is being edited */ private JTextField editor; /** * Constructor for StringAttributeView * @param name The name * @param value The value */ public StringAttributeView(String name, String value) { super(); this.name = name; this.value = value; this.listeners = new LinkedList(); component = Box.createHorizontalBox(); component.add(createValueLabel(value)); } /** * Add a listener that are notified when the value is changed * @param listener The listener */ public void addStringAttributeListener(StringAttributeListener listener) { listeners.add(listener); } /** * Remove a listener * @param listener The listener */ public void removeStringAttributeListener(StringAttributeListener listener) { listeners.remove(listener); } /** * Send valueChanged to all listeners */ protected void valueChanged() { Iterator iter = listeners.iterator(); while (iter.hasNext()) { StringAttributeListener current = (StringAttributeListener) iter.next(); current.valueChanged(name, value); } } /** * Create a value label * @param value The value * @return The label */ protected JComponent createValueLabel(String value) { JLabel valueLabel = new JLabel(value); valueLabel.setFont(AttributesPanel.VALUE_FONT); return valueLabel; } /** * Create a value editor * @param value The value * @return The editor */ JComponent createValueEditor(String value) { JTextField valueEditor = new JTextField(value); valueEditor.setFont(AttributesPanel.VALUE_FONT); return valueEditor; } /** * Return the name * @return The name */ public String name() { return name; } /** * Return the component * @return The component */ public JComponent component() { return component; } /** * Start editing the value by replacing the label with an editor */ public void startEditing() { if (editor == null) { component.remove(0); editor = (JTextField) createValueEditor(value); editor.addKeyListener(this); component.add(editor); component.revalidate(); } editor.requestFocus(); editor.selectAll(); } /** * Stop editing the value by replacing the editor with an label, * and sending valueChanged to all listeners. */ public void stopEditing() { if (editor != null) { component.remove(editor); value = editor.getText(); editor.removeKeyListener(this); editor = null; component.add(createValueLabel(value)); component.revalidate(); valueChanged(); } } /** * Cancels editing the value by replacing the editor with an label, * without sending any events to listeners. */ public void cancelEditing() { if (editor != null) { component.remove(editor); editor.removeKeyListener(this); editor = null; component.add(createValueLabel(value)); component.revalidate(); } } /** * Find the AttributesPanel this AttributeView belongs to and * ask it to stopEditing the current AttributeView, which will * be this one */ public void forceStopEditing() { Component current = editor; while (current != null) { if (current instanceof AttributesPanel) { AttributesPanel panel = (AttributesPanel) current; panel.stopEditing(); current = null; } else { current = current.getParent(); } } } /** * Respond to the enter key by stopping editing. * @param event The KeyEvent */ public void keyPressed(KeyEvent event) { if (event.getKeyCode() == KeyEvent.VK_ENTER) { forceStopEditing(); } } /** * Not in use * @param event The KeyEvent */ public void keyTyped(KeyEvent event) { } /** * Not in use * @param event The KeyEvent */ public void keyReleased(KeyEvent event) { } } --- NEW FILE: package.html --- <body> This package defines functionality to show attributes for an object </body> --- NEW FILE: AttributesPanel.java --- //--------------------------------------------------------------------------------- // $Id: AttributesPanel.java,v 1.1 2006/01/05 13:28:02 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.attributesview; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Font; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.Iterator; import java.util.List; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JLabel; import javax.swing.JPanel; /** * The AttributesPanel */ public class AttributesPanel extends JPanel implements MouseListener { /** The value font */ public static final Font VALUE_FONT = new Font("Sans-serif", Font.PLAIN, 12); /** The key font */ public static final Font KEY_FONT = new Font("Sans-serif", Font.BOLD, 12); /** The column - a vertical box */ private Box column; /** The list of AttributeView */ private List attributes; /** The currently edited AttributeView */ private AttributeView current; /** * Constructor for AttributesPanel */ public AttributesPanel() { super(); setLayout(new BorderLayout()); column = Box.createVerticalBox(); column.addMouseListener(this); add(column); } /** * Set the attributes in this AttributesPanel * @param attributes List of AttributeView */ public void setAttributes(List attributes) { column.removeAll(); this.attributes = attributes; if (attributes != null) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { AttributeView current = (AttributeView) iter.next(); AttributeRow row = new AttributeRow(current); column.add(row); } } column.revalidate(); } /** * Get the attributes in this AttributesPanel * @return List of AttributeView */ public List getAttributes() { return attributes; } /** * Start editing the specified AttributeView * @param view The AttributeView to edit */ public void startEditing(AttributeView view) { if (current != null) { current.stopEditing(); } current = view; if (current != null) { view.startEditing(); } } /** * Stop editing the current AttributeView */ public void stopEditing() { if (current != null) { current.stopEditing(); current = null; } } /** * The AttributeRow */ protected class AttributeRow extends Box implements MouseListener { /** The AttributeView displayed in this AttributeRow */ private AttributeView view; /** * Constructor for AttributeRow * @param view The AttributeView for this AttributeRow */ public AttributeRow(AttributeView view) { super(BoxLayout.X_AXIS); this.view = view; JLabel label = createLabel(view.name()); Box header = Box.createHorizontalBox(); Box column = Box.createVerticalBox(); header.add(Box.createHorizontalGlue()); header.add(label); column.add(Box.createHorizontalStrut(60)); column.add(header); column.add(Box.createHorizontalStrut(60)); column.setMaximumSize(new Dimension(60, Short.MAX_VALUE)); add(column); add(Box.createHorizontalStrut(7)); add(view.component()); add(Box.createHorizontalGlue()); label.addMouseListener(this); view.component().addMouseListener(this); } /** * Create a label for the * @param key The key * @return A JLabel */ private JLabel createLabel(String key) { JLabel keyLabel = new JLabel(key + " :"); keyLabel.setFont(KEY_FONT); return keyLabel; } /** * Start editing on the view * @param event The event */ public void mouseClicked(MouseEvent event) { startEditing(view); } /** * Not in use * @param event The MouseEvent */ public void mousePressed(MouseEvent event) { } /** * Not in use * @param event The MouseEvent */ public void mouseReleased(MouseEvent event) { } /** * Not in use * @param event The MouseEvent */ public void mouseEntered(MouseEvent event) { } /** * Not in use * @param event The MouseEvent */ public void mouseExited(MouseEvent event) { } } /** * Stop editing the current attribute * @param event The mouse event */ public void mouseClicked(MouseEvent event) { stopEditing(); } /** * Not in use * @param event The MouseEvent */ public void mousePressed(MouseEvent event) { } /** * Not in use * @param event The MouseEvent */ public void mouseReleased(MouseEvent event) { } /** * Not in use * @param event The MouseEvent */ public void mouseEntered(MouseEvent event) { } /** * Not in use * @param event The MouseEvent */ public void mouseExited(MouseEvent event) { } } --- NEW FILE: AttributeView.java --- //--------------------------------------------------------------------------------- // $Id: AttributeView.java,v 1.1 2006/01/05 13:28:02 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.attributesview; import javax.swing.JComponent; /** * The AttributeView */ public interface AttributeView { /** * Return the name for this AttributeView * @return The name */ public String name(); /** * Get the component for this AttributeView * @return The component */ public JComponent component(); /** * Called when editing is started on this AttributeView * Should change the component to an editing state */ public void startEditing(); /** * Called when editing is stopped on this AttributeView * Should send a valueChanged to any listeners in concrete AttributeViews, * and change the component to the default non-editing state */ public void stopEditing(); /** * Called when editing should be cancelled on this AttributeView. * Should change the state back to before editing was started. * Should not send events the listeners. */ public void cancelEditing(); } --- NEW FILE: StringAttributeListener.java --- //--------------------------------------------------------------------------------- // $Id: StringAttributeListener.java,v 1.1 2006/01/05 13:28:02 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.attributesview; import java.util.EventListener; /** * The StringAttributeListener */ public interface StringAttributeListener extends EventListener { /** * Called when the value has changed * @param name The name of the attribute * @param value The new value for the attribute */ public void valueChanged(String name, String value); } |
From: Nikolaj B. <nbr...@us...> - 2006-01-05 10:40:47
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18101/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Added Files: Material.java Log Message: Added the Materials class, and now Surfaces have a frontside and a backside Material. Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Surface.java 4 Jan 2006 14:30:07 -0000 1.63 --- Surface.java 5 Jan 2006 10:40:39 -0000 1.64 *************** *** 44,47 **** --- 44,53 ---- private Space backDomain; + /** The material on the frontside of the surface */ + private Material frontMaterial; + + /** The material on the backside of the surface */ + private Material backMaterial; + /** The exterior surface if this is a hole */ private Surface exterior; *************** *** 677,680 **** --- 683,726 ---- /** + * Get the material on the backside of the surface + * @return the backmaterial + * @hibernate.one-to-one + * column="BACK_MATERIAL_ID" + * class="net.sourceforge.bprocessor.model.Material" + */ + public Material getBackMaterial() { + return backMaterial; + } + + /** + * Set the material on the backside of the surface + * @param back the Material + */ + public void setBackMaterial(Material back) { + backMaterial = back; + + } + + /** + * Get the material on the frontside of the surface + * @return the frontmaterial + * @hibernate.one-to-one + * column="FRONT_MATERIAL_ID" + * class="net.sourceforge.bprocessor.model.Material" + */ + public Material getFrontMaterial() { + return frontMaterial; + } + + /** + * Set the material on the frontside of the surface + * @param front the Material + */ + public void setFrontMaterial(Material front) { + frontMaterial = front; + + } + + /** * Get the domain behind the surface * @return the backdomain --- NEW FILE: Material.java --- //--------------------------------------------------------------------------------- // $Id: Material.java,v 1.1 2006/01/05 10:40:39 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.model; /** * The Material of a Surface */ public class Material { /** The name of the material */ private String name; /** The color of the material */ private float[] color; /** * Default Constructor for space */ public Material() { } /** * Constructor for space * @param name The name of the material * @param color The color of the material */ public Material(String name, float[] color) { setName(name); setColor(color); } /** * Get the name * @return The name * @hibernate.property */ public String getName() { return name; } /** * Set the name * @param name The name */ public void setName(String name) { this.name = name; } /** * Get the color * @return The color * @hibernate.property */ public float[] getColor() { return color; } /** * Set the color * @param color The color */ public void setColor(float[] color) { this.color = color; } } |
From: Michael L. <he...@us...> - 2006-01-04 14:30:19
|
Update of /cvsroot/bprocessor/kernel/src/net/sourceforge/bprocessor/kernel/notification In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21840/src/net/sourceforge/bprocessor/kernel/notification Modified Files: Notification.java Log Message: Replaced created/remove/modified from Notifier with changed/update Index: Notification.java =================================================================== RCS file: /cvsroot/bprocessor/kernel/src/net/sourceforge/bprocessor/kernel/notification/Notification.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Notification.java 28 Jul 2005 10:15:09 -0000 1.5 --- Notification.java 4 Jan 2006 14:29:59 -0000 1.6 *************** *** 16,25 **** private static Logger log = Logger.getLogger(Notification.class); - /** Functional space created */ - public static final String FUNCTIONAL_SPACE_CREATED = "functionalspace.created"; - - /** Functional space deleted */ - public static final String FUNCTIONAL_SPACE_DELETED = "functionalspace.deleted"; - /** Functional space selected */ public static final String FUNCTIONAL_SPACE_SELECTED = "functionalspace.selected"; --- 16,19 ---- *************** *** 28,40 **** public static final String FUNCTIONAL_SPACE_DESELECTED = "functionalspace.deselected"; - /** Functional space modified */ - public static final String FUNCTIONAL_SPACE_MODIFIED = "functionalspace.modified"; - - /** Construction space created */ - public static final String CONSTRUCTION_SPACE_CREATED = "constructionspace.created"; - - /** Construction space deleted */ - public static final String CONSTRUCTION_SPACE_DELETED = "constructionspace.deleted"; - /** Construction space selected */ public static final String CONSTRUCTION_SPACE_SELECTED = "constructionspace.selected"; --- 22,25 ---- *************** *** 43,55 **** public static final String CONSTRUCTION_SPACE_DESELECTED = "constructionspace.deselected"; - /** Construction space modified */ - public static final String CONSTRUCTION_SPACE_MODIFIED = "constructionspace.modified"; - - /** Element created */ - public static final String ELEMENT_CREATED = "element.created"; - - /** Element deleted */ - public static final String ELEMENT_DELETED = "element.deleted"; - /** Element selected */ public static final String ELEMENT_SELECTED = "element.selected"; --- 28,31 ---- *************** *** 58,70 **** public static final String ELEMENT_DESELECTED = "element.deselected"; - /** Element modified */ - public static final String ELEMENT_MODIFIED = "element.modified"; - - /** Part created */ - public static final String PART_CREATED = "part.created"; - - /** Part deleted */ - public static final String PART_DELETED = "part.deleted"; - /** Part selected */ public static final String PART_SELECTED = "part.selected"; --- 34,37 ---- *************** *** 73,85 **** public static final String PART_DESELECTED = "part.deselected"; - /** Part modified */ - public static final String PART_MODIFIED = "part.modified"; - - /** Surface created */ - public static final String SURFACE_CREATED = "surface.created"; - - /** Surface deleted */ - public static final String SURFACE_DELETED = "surface.deleted"; - /** Surface selected */ public static final String SURFACE_SELECTED = "surface.selected"; --- 40,43 ---- *************** *** 88,100 **** public static final String SURFACE_DESELECTED = "surface.deselected"; - /** Surface modified */ - public static final String SURFACE_MODIFIED = "surface.modified"; - - /** Edge created */ - public static final String EDGE_CREATED = "edge.created"; - - /** Edge deleted */ - public static final String EDGE_DELETED = "edge.deleted"; - /** Edge selected */ public static final String EDGE_SELECTED = "edge.selected"; --- 46,49 ---- *************** *** 103,115 **** public static final String EDGE_DESELECTED = "edge.deselected"; - /** Edge modified */ - public static final String EDGE_MODIFIED = "edge.modified"; - - /** Vertex created */ - public static final String VERTEX_CREATED = "vertex.created"; - - /** Vertex deleted */ - public static final String VERTEX_DELETED = "vertex.deleted"; - /** Vertex selected */ public static final String VERTEX_SELECTED = "vertex.selected"; --- 52,55 ---- *************** *** 118,124 **** public static final String VERTEX_DESELECTED = "vertex.deselected"; - /** Vertex modified */ - public static final String VERTEX_MODIFIED = "vertex.modified"; - /** The type */ private String type; --- 58,61 ---- |
From: Michael L. <he...@us...> - 2006-01-04 14:30:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21879/src/net/sourceforge/bprocessor/model/xml Modified Files: PersistenceManager.java Log Message: Replaced created/remove/modified from Notifier with changed/update Index: PersistenceManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml/PersistenceManager.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PersistenceManager.java 20 Dec 2005 13:54:53 -0000 1.16 --- PersistenceManager.java 4 Jan 2006 14:30:07 -0000 1.17 *************** *** 269,273 **** csm.setSurfaces(sr); } - Project.getInstance().update(csm); } } --- 269,272 ---- *************** *** 311,315 **** fsm.setSurfaces(sr); } - Project.getInstance().update(fsm); } } --- 310,313 ---- *************** *** 367,371 **** sm.setExterior(Project.getInstance().findSurfaceById(eid)); } - Project.getInstance().update(sm); } } --- 365,368 ---- *************** *** 394,399 **** v = Project.getInstance().findVertexById(vid); em.setTo(v); - - Project.getInstance().update(em); } } --- 391,394 ---- |
From: Michael L. <he...@us...> - 2006-01-04 14:30:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21879/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Space.java Project.java Log Message: Replaced created/remove/modified from Notifier with changed/update Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Surface.java 22 Dec 2005 10:35:01 -0000 1.62 --- Surface.java 4 Jan 2006 14:30:07 -0000 1.63 *************** *** 533,538 **** } } ! Project.getInstance().update(this); ! Project.getInstance().update(hole); } --- 533,538 ---- } } ! changed(); ! hole.changed(); } *************** *** 616,620 **** } } ! Project.getInstance().update(this); } --- 616,620 ---- } } ! changed(); } *************** *** 700,704 **** backDomain.addSurface(this); } ! Project.getInstance().update(this); } } --- 700,704 ---- backDomain.addSurface(this); } ! changed(); } } *************** *** 727,731 **** frontDomain.addSurface(this); } ! Project.getInstance().update(this); } } --- 727,731 ---- frontDomain.addSurface(this); } ! changed(); } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Space.java 3 Jan 2006 10:52:57 -0000 1.11 --- Space.java 4 Jan 2006 14:30:07 -0000 1.12 *************** *** 137,141 **** } surfaces.add(surface); ! Project.getInstance().update(this); } --- 137,141 ---- } surfaces.add(surface); ! changed(); } *************** *** 149,153 **** if (s != null && s.contains(surface)) { s.remove(surface); ! Project.getInstance().update(this); return true; } --- 149,153 ---- if (s != null && s.contains(surface)) { s.remove(surface); ! changed(); return true; } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Project.java 3 Jan 2006 13:23:22 -0000 1.14 --- Project.java 4 Jan 2006 14:30:07 -0000 1.15 *************** *** 14,20 **** import java.util.Set; - import net.sourceforge.bprocessor.kernel.notification.Notification; - import net.sourceforge.bprocessor.kernel.notification.Notifier; - import org.apache.log4j.Logger; /** --- 14,17 ---- *************** *** 87,90 **** --- 84,88 ---- public void clear() { DatabaseFacade.getInstance().clear(); + changed(this); } /** *************** *** 97,108 **** /** - * Update an attribute - * @param a The attribute - */ - public void update(Attribute a) { - DatabaseFacade.getInstance().update(a); - } - - /** * Remove an attribute * @param a The attribute --- 95,98 ---- *************** *** 140,145 **** public void intern(ConstructionSpace c) { DatabaseFacade.getInstance().intern((Object) c); ! Notification n = new Notification(Notification.CONSTRUCTION_SPACE_CREATED, c.getId()); ! Notifier.getInstance().sendNotification(n); } --- 130,134 ---- public void intern(ConstructionSpace c) { DatabaseFacade.getInstance().intern((Object) c); ! changed(this); } *************** *** 149,153 **** */ public void remove(ConstructionSpace c) { - // setting references to this space to null Set surfaces = c.getSurfaces(); if (surfaces != null) { --- 138,141 ---- *************** *** 158,167 **** if (back == c) { surface.setBackDomain(null); - update(surface); } else { Space front = surface.getFrontDomain(); if (front == c) { surface.setFrontDomain(null); - update(surface); } } --- 146,153 ---- *************** *** 169,174 **** } DatabaseFacade.getInstance().remove(c); ! Notification n = new Notification(Notification.CONSTRUCTION_SPACE_DELETED, c.getId()); ! Notifier.getInstance().sendNotification(n); } --- 155,159 ---- } DatabaseFacade.getInstance().remove(c); ! changed(this); } *************** *** 191,212 **** /** - * Update the Domain - * @param domain The domain to update - */ - public void update(Space domain) { - if (domain instanceof ConstructionSpace) { - DatabaseFacade.getInstance().update((ConstructionSpace)domain); - Notification n = new Notification(Notification.CONSTRUCTION_SPACE_MODIFIED, domain.getId()); - Notifier.getInstance().sendNotification(n); - } else if (domain instanceof FunctionalSpace) { - DatabaseFacade.getInstance().update((FunctionalSpace)domain); - Notification n = new Notification(Notification.FUNCTIONAL_SPACE_MODIFIED, domain.getId()); - Notifier.getInstance().sendNotification(n); - } else { - log.error("Unsupported type: " + domain.getClass().getName()); - } - } - - /** * Find all domains * @return the set of all domains --- 176,179 ---- *************** *** 231,246 **** public void intern(Edge e) { DatabaseFacade.getInstance().intern((Object) e); ! Notification n = new Notification(Notification.EDGE_CREATED, e.getId()); ! Notifier.getInstance().sendNotification(n); ! } ! ! /** ! * Update an edge ! * @param e The edge ! */ ! public void update(Edge e) { ! DatabaseFacade.getInstance().update(e); ! Notification n = new Notification(Notification.EDGE_MODIFIED, e.getId()); ! Notifier.getInstance().sendNotification(n); } --- 198,202 ---- public void intern(Edge e) { DatabaseFacade.getInstance().intern((Object) e); ! changed(this); } *************** *** 251,256 **** public void remove(Edge e) { DatabaseFacade.getInstance().remove(e); ! Notification n = new Notification(Notification.EDGE_DELETED, e.getId()); ! Notifier.getInstance().sendNotification(n); } --- 207,211 ---- public void remove(Edge e) { DatabaseFacade.getInstance().remove(e); ! changed(this); } *************** *** 278,283 **** public void intern(FunctionalSpace f) { DatabaseFacade.getInstance().intern((Object) f); ! Notification n = new Notification(Notification.FUNCTIONAL_SPACE_CREATED, f.getId()); ! Notifier.getInstance().sendNotification(n); } --- 233,237 ---- public void intern(FunctionalSpace f) { DatabaseFacade.getInstance().intern((Object) f); ! changed(this); } *************** *** 287,291 **** */ public void remove(Space space) { - // setting references to this space to null Set surfaces = space.getSurfaces(); if (surfaces != null) { --- 241,244 ---- *************** *** 307,312 **** } DatabaseFacade.getInstance().remove(space); ! Notification n = new Notification(Notification.FUNCTIONAL_SPACE_DELETED, space.getId()); ! Notifier.getInstance().sendNotification(n); } --- 260,264 ---- } DatabaseFacade.getInstance().remove(space); ! changed(this); } *************** *** 316,320 **** */ public void remove(FunctionalSpace f) { - // setting references to this space to null Set surfaces = f.getSurfaces(); if (surfaces != null) { --- 268,271 ---- *************** *** 336,341 **** } DatabaseFacade.getInstance().remove(f); ! Notification n = new Notification(Notification.FUNCTIONAL_SPACE_DELETED, f.getId()); ! Notifier.getInstance().sendNotification(n); } --- 287,291 ---- } DatabaseFacade.getInstance().remove(f); ! changed(this); } *************** *** 363,378 **** public void intern(Surface s) { DatabaseFacade.getInstance().intern((Object) s); ! Notification n = new Notification(Notification.SURFACE_CREATED, s.getId()); ! Notifier.getInstance().sendNotification(n); ! } ! ! /** ! * Update a surface ! * @param s The surface ! */ ! public void update(Surface s) { ! DatabaseFacade.getInstance().update(s); ! Notification n = new Notification(Notification.SURFACE_MODIFIED, s.getId()); ! Notifier.getInstance().sendNotification(n); } --- 313,317 ---- public void intern(Surface s) { DatabaseFacade.getInstance().intern((Object) s); ! changed(this); } *************** *** 382,406 **** */ public void remove(Surface s) { - // to make it safe to remove a surface we need to remove it - //from any domain to which it belongs. - Space back = s.getBackDomain(); if (back != null) { ! if (back.removeSurface(s)) { ! update(back); ! } s.setBackDomain(null); } Space front = s.getFrontDomain(); if (front != null) { ! if (front.removeSurface(s)) { ! update(front); ! } s.setFrontDomain(null); } - DatabaseFacade.getInstance().remove(s); ! Notification n = new Notification(Notification.SURFACE_DELETED, s.getId()); ! Notifier.getInstance().sendNotification(n); } --- 321,336 ---- */ public void remove(Surface s) { Space back = s.getBackDomain(); if (back != null) { ! back.removeSurface(s); s.setBackDomain(null); } Space front = s.getFrontDomain(); if (front != null) { ! front.removeSurface(s); s.setFrontDomain(null); } DatabaseFacade.getInstance().remove(s); ! changed(this); } *************** *** 428,445 **** public void intern(Vertex v) { DatabaseFacade.getInstance().intern((Object) v); ! Notification n = new Notification(Notification.VERTEX_CREATED, v.getId()); ! Notifier.getInstance().sendNotification(n); ! } ! ! /** ! * Update a vertex ! * @param v The vertex ! */ ! public void update(Vertex v) { ! DatabaseFacade.getInstance().update(v); ! Notification n = new Notification(Notification.VERTEX_MODIFIED, v.getId()); ! Notifier.getInstance().sendNotification(n); } ! /** * Remove a vertex --- 358,364 ---- public void intern(Vertex v) { DatabaseFacade.getInstance().intern((Object) v); ! changed(this); } ! /** * Remove a vertex *************** *** 448,453 **** public void remove(Vertex v) { DatabaseFacade.getInstance().remove(v); ! Notification n = new Notification(Notification.VERTEX_DELETED, v.getId()); ! Notifier.getInstance().sendNotification(n); } --- 367,371 ---- public void remove(Vertex v) { DatabaseFacade.getInstance().remove(v); ! changed(this); } |
From: Michael L. <he...@us...> - 2006-01-04 14:30:18
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21815/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java SurfaceTreeView.java Log Message: Replaced created/remove/modified from Notifier with changed/update Index: SurfaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SurfaceTreeView.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SurfaceTreeView.java 3 Jan 2006 12:14:04 -0000 1.2 --- SurfaceTreeView.java 4 Jan 2006 14:29:55 -0000 1.3 *************** *** 9,14 **** import java.util.Set; - - import net.sourceforge.bprocessor.kernel.notification.Notification; import net.sourceforge.bprocessor.model.Project; --- 9,12 ---- *************** *** 27,31 **** /** * Update the TreeView - * */ public void update() { --- 25,28 ---- *************** *** 35,52 **** model.nodeStructureChanged(root); } - - /** - * Specify if we want to handle notification - * @param type String specifying type of notification - * @return True if we want to handle it - */ - public boolean isNotificationEnabled(String type) { - if (type.equals(Notification.SURFACE_CREATED) || - type.equals(Notification.SURFACE_DELETED) || - type.equals(Notification.SURFACE_MODIFIED)) { - return true; - } - return false; - } - } --- 32,34 ---- Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GenericTreeView.java 3 Jan 2006 16:00:24 -0000 1.4 --- GenericTreeView.java 4 Jan 2006 14:29:55 -0000 1.5 *************** *** 19,23 **** import net.sourceforge.bprocessor.kernel.notification.Notification; - import net.sourceforge.bprocessor.kernel.notification.NotificationListener; import net.sourceforge.bprocessor.kernel.notification.Notifier; import net.sourceforge.bprocessor.model.Edge; --- 19,22 ---- *************** *** 32,36 **** * The GenericTreeView */ ! public class GenericTreeView extends TreeView implements NotificationListener, Observer { /** The model */ --- 31,35 ---- * The GenericTreeView */ ! public class GenericTreeView extends TreeView implements Observer { /** The model */ *************** *** 53,57 **** setRootVisible(false); setShowsRootHandles(true); - Notifier.getInstance().addListener(this); Project.getInstance().addObserver(this); this.addTreeSelectionListener(new SelectionListener()); --- 52,55 ---- *************** *** 322,342 **** } } ! /** ! * Handle notification ! * @param arg0 The notification ! */ ! public void handleNotification(Notification arg0) { ! changed(); ! } ! ! /** ! * Specify if we want to handle notification ! * @param type String specifying type of notification ! * @return True if we want to handle it ! */ ! public boolean isNotificationEnabled(String type) { ! return false; ! } ! /** * Update --- 320,324 ---- } } ! /** * Update Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SpaceTreeView.java 3 Jan 2006 12:14:04 -0000 1.2 --- SpaceTreeView.java 4 Jan 2006 14:29:55 -0000 1.3 *************** *** 10,14 **** import java.util.Set; - import net.sourceforge.bprocessor.kernel.notification.Notification; import net.sourceforge.bprocessor.model.Project; --- 10,13 ---- *************** *** 37,57 **** model.nodeStructureChanged(root); } - - /** - * Specify if we want to handle notification - * @param type String specifying type of notification - * @return True if we want to handle it - */ - public boolean isNotificationEnabled(String type) { - if (type.equals(Notification.FUNCTIONAL_SPACE_CREATED) || - type.equals(Notification.FUNCTIONAL_SPACE_DELETED) || - type.equals(Notification.FUNCTIONAL_SPACE_MODIFIED) || - type.equals(Notification.CONSTRUCTION_SPACE_CREATED) || - type.equals(Notification.CONSTRUCTION_SPACE_DELETED) || - type.equals(Notification.CONSTRUCTION_SPACE_MODIFIED)) { - return true; - } - return false; - } - } --- 36,38 ---- |
From: Michael L. <he...@us...> - 2006-01-04 14:30:18
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21815/src/net/sourceforge/bprocessor/gui/attrview Modified Files: MyKeyListener.java Log Message: Replaced created/remove/modified from Notifier with changed/update Index: MyKeyListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/MyKeyListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MyKeyListener.java 12 Dec 2005 10:06:21 -0000 1.2 --- MyKeyListener.java 4 Jan 2006 14:29:55 -0000 1.3 *************** *** 11,16 **** import javax.swing.text.JTextComponent; - - import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; --- 11,14 ---- *************** *** 65,74 **** funs = space; funs.setName(newName); ! Project.getInstance().update(funs); } if (space.isConstructionSpace()) { cons = space; ! cons.setName(newName); ! Project.getInstance().update(cons); } } --- 63,72 ---- funs = space; funs.setName(newName); ! funs.changed(); } if (space.isConstructionSpace()) { cons = space; ! cons.setName(newName); ! cons.changed(); } } |
From: Michael L. <he...@us...> - 2006-01-04 14:30:17
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21783/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Replaced created/remove/modified from Notifier with changed/update Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** GLView.java 23 Dec 2005 11:19:20 -0000 1.31 --- GLView.java 4 Jan 2006 14:29:51 -0000 1.32 *************** *** 12,15 **** --- 12,16 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.kernel.notification.NotificationListener; *************** *** 45,49 **** * The 3D display */ ! public class GLView implements MouseListener, NotificationListener { /** The logger */ private static Logger log = Logger.getLogger(GLView.class); --- 46,50 ---- * The 3D display */ ! public class GLView implements MouseListener, NotificationListener, Observer { /** The logger */ private static Logger log = Logger.getLogger(GLView.class); *************** *** 67,70 **** --- 68,72 ---- log.info("Using JOGL version " + Version.getVersion()); Notifier.getInstance().addListener(this); + Project.getInstance().addObserver(this); GLCapabilities glCap = new GLCapabilities(); glCap.setDoubleBuffered(true); *************** *** 361,377 **** */ public boolean isNotificationEnabled(String type) { ! if (type.equals(Notification.FUNCTIONAL_SPACE_CREATED) || ! type.equals(Notification.FUNCTIONAL_SPACE_DELETED) || ! type.equals(Notification.FUNCTIONAL_SPACE_SELECTED) || type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || - type.equals(Notification.FUNCTIONAL_SPACE_MODIFIED) || - type.equals(Notification.CONSTRUCTION_SPACE_CREATED) || - type.equals(Notification.CONSTRUCTION_SPACE_DELETED) || type.equals(Notification.CONSTRUCTION_SPACE_SELECTED) || ! type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED) || ! type.equals(Notification.CONSTRUCTION_SPACE_MODIFIED)) { return true; } return false; } } --- 363,381 ---- */ public boolean isNotificationEnabled(String type) { ! if (type.equals(Notification.FUNCTIONAL_SPACE_SELECTED) || type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || type.equals(Notification.CONSTRUCTION_SPACE_SELECTED) || ! type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED)) { return true; } return false; } + + /** + * Update this view + * @param entity The changed entity + */ + public void update(Object entity) { + repaint(); + } } |