[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui PopupMenu.java, 1.89, 1.90 GUI.java, 1.8
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-12-13 12:00:58
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20795/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java GUI.java Log Message: Major change wrt Space/Container Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** PopupMenu.java 12 Dec 2007 12:48:31 -0000 1.89 --- PopupMenu.java 13 Dec 2007 12:00:55 -0000 1.90 *************** *** 42,46 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; - import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.SurfaceAnalysis; --- 42,45 ---- *************** *** 193,199 **** private abstract static class ModellorAction extends AbstractAction { protected Modellor modellor; ! protected Space space; ! public ModellorAction(Modellor modellor, Space space) { super(modellor.getGeneralName()); this.modellor = modellor; --- 192,198 ---- private abstract static class ModellorAction extends AbstractAction { protected Modellor modellor; ! protected Container space; ! public ModellorAction(Modellor modellor, Container space) { super(modellor.getGeneralName()); this.modellor = modellor; *************** *** 215,220 **** AbstractAction action = new CollectionMenuAction(s, "Dissolve") { public void actionPerformed(ActionEvent event) { ! List<Space> spaces = new LinkedList(col); ! for (Space space : spaces) { Collection<Vertex> vertices = new LinkedList(space.getVertices()); Collection<Edge> edges = new LinkedList(space.getEdges()); --- 214,219 ---- AbstractAction action = new CollectionMenuAction(s, "Dissolve") { public void actionPerformed(ActionEvent event) { ! List<Container> spaces = new LinkedList(col); ! for (Container space : spaces) { Collection<Vertex> vertices = new LinkedList(space.getVertices()); Collection<Edge> edges = new LinkedList(space.getEdges()); *************** *** 255,259 **** Iterator iter = col.iterator(); while (iter.hasNext()) { ! Space space = (Space)iter.next(); Instance instance = new Instance("Instance of " + space.getName()); instance.setProto(space); --- 254,258 ---- Iterator iter = col.iterator(); while (iter.hasNext()) { ! Container space = (Container)iter.next(); Instance instance = new Instance("Instance of " + space.getName()); instance.setProto(space); *************** *** 268,272 **** if (s.size() == 1) { // Some options do only apply to one space ! Space sp = (Space)s.iterator().next(); AbstractAction edit = new SpaceMenuAction(sp, "Edit") { --- 267,271 ---- if (s.size() == 1) { // Some options do only apply to one space ! Container sp = (Container)s.iterator().next(); AbstractAction edit = new SpaceMenuAction(sp, "Edit") { *************** *** 312,316 **** AbstractAction action = new SpaceMenuAction(sp, "Normals") { public void actionPerformed(ActionEvent event) { ! Space union = new Container("Normals", Space.CONSTRUCTION, true); for (Surface surface : space.getSurfaces()) { Vertex normal = surface.normal(); --- 311,315 ---- AbstractAction action = new SpaceMenuAction(sp, "Normals") { public void actionPerformed(ActionEvent event) { ! Container union = new Container("Normals", Container.CONSTRUCTION, true); for (Surface surface : space.getSurfaces()) { Vertex normal = surface.normal(); *************** *** 319,323 **** CoordinateSystem system = CoordinateSystem.systemFor(origin, normal); ! Space pyramid = Command.Pyramid.pyramid(0.05, 0.05, 0.2); for (Vertex current : pyramid.getVertices()) { current.set(system.unTranslate(current)); --- 318,322 ---- CoordinateSystem system = CoordinateSystem.systemFor(origin, normal); ! Container pyramid = Command.Pyramid.pyramid(0.05, 0.05, 0.2); for (Vertex current : pyramid.getVertices()) { current.set(system.unTranslate(current)); *************** *** 520,524 **** HashMap map = new HashMap(); Mesh copy = mesh.copy(map); ! Space union = new Container("Union", Space.CONSTRUCTION, true); union.setUnion(true); for (Vertex current : copy.vertices()) { --- 519,523 ---- HashMap map = new HashMap(); Mesh copy = mesh.copy(map); ! Container union = new Container("Union", Container.CONSTRUCTION, true); union.setUnion(true); for (Vertex current : copy.vertices()) { *************** *** 531,535 **** union.add(current); } ! for (Space current : copy.elements()) { union.add(current); } --- 530,534 ---- union.add(current); } ! for (Container current : copy.elements()) { union.add(current); } *************** *** 755,759 **** } } ! if (type instanceof Space) { return PopupMenu.getSpaceMenu(new LinkedList<Geometric>(Selection.primary())); } else if (type instanceof Surface) { --- 754,758 ---- } } ! if (type instanceof Container) { return PopupMenu.getSpaceMenu(new LinkedList<Geometric>(Selection.primary())); } else if (type instanceof Surface) { *************** *** 777,781 **** AbstractAction planeanalysis = new AbstractAction("Plane Analysis") { public void actionPerformed(ActionEvent arg0) { ! Space space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearPlanes(space); --- 776,780 ---- AbstractAction planeanalysis = new AbstractAction("Plane Analysis") { public void actionPerformed(ActionEvent arg0) { ! Container space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearPlanes(space); *************** *** 793,797 **** AbstractAction clearplanes = new AbstractAction("Delete Planes") { public void actionPerformed(ActionEvent arg0) { ! Space space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearPlanes(space); --- 792,796 ---- AbstractAction clearplanes = new AbstractAction("Delete Planes") { public void actionPerformed(ActionEvent arg0) { ! Container space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearPlanes(space); *************** *** 803,807 **** AbstractAction surfaceanalysis = new AbstractAction("Surface Analysis") { public void actionPerformed(ActionEvent arg0) { ! Space space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.surfaceAnalysis(space); --- 802,806 ---- AbstractAction surfaceanalysis = new AbstractAction("Surface Analysis") { public void actionPerformed(ActionEvent arg0) { ! Container space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.surfaceAnalysis(space); *************** *** 813,817 **** AbstractAction clearsurfaces = new AbstractAction("Delete Surfaces") { public void actionPerformed(ActionEvent arg0) { ! Space space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearSurfaces(space); --- 812,816 ---- AbstractAction clearsurfaces = new AbstractAction("Delete Surfaces") { public void actionPerformed(ActionEvent arg0) { ! Container space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearSurfaces(space); Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** GUI.java 12 Dec 2007 10:48:19 -0000 1.87 --- GUI.java 13 Dec 2007 12:00:55 -0000 1.88 *************** *** 36,40 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 36,40 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 115,119 **** /** closed spaces */ ! private Set<Space> closedSpaces = new HashSet<Space>(); /** The browsing tree */ --- 115,119 ---- /** closed spaces */ ! private Set<Container> closedSpaces = new HashSet<Container>(); /** The browsing tree */ *************** *** 270,275 **** create.removeAll(); int lvl = Project.getInstance().getActiveSpace().getLevel(); ! if (lvl < Space.PART_LEVEL) { ! String append = Space.levelToString(lvl + 1); JMenuItem createFunctionalSpace = new JMenuItem("Functional " + append); --- 270,275 ---- create.removeAll(); int lvl = Project.getInstance().getActiveSpace().getLevel(); ! if (lvl < Container.PART_LEVEL) { ! String append = Container.levelToString(lvl + 1); JMenuItem createFunctionalSpace = new JMenuItem("Functional " + append); *************** *** 294,298 **** public void actionPerformed(ActionEvent e) { System.out.println("actionate " + modellor); ! Space space = modellor.createSpace(); Project.getInstance().world().add(space); Project.getInstance().changed(Project.getInstance()); --- 294,298 ---- public void actionPerformed(ActionEvent e) { System.out.println("actionate " + modellor); ! Container space = modellor.createSpace(); Project.getInstance().world().add(space); Project.getInstance().changed(Project.getInstance()); *************** *** 317,321 **** JMenu jm = (JMenu)e.getSource(); jm.removeAll(); ! Space s = Project.getInstance().getActiveSpace(); int level = s.getLevel(); for (Modellor m : Modellor.getRegisteredModellors()) { --- 317,321 ---- JMenu jm = (JMenu)e.getSource(); jm.removeAll(); ! Container s = Project.getInstance().getActiveSpace(); int level = s.getLevel(); for (Modellor m : Modellor.getRegisteredModellors()) { *************** *** 404,408 **** while (iter.hasNext()) { Geometric g = iter.next(); ! if (g instanceof Space) { // nothing } else if (g instanceof Edge) { --- 404,408 ---- while (iter.hasNext()) { Geometric g = iter.next(); ! if (g instanceof Container) { // nothing } else if (g instanceof Edge) { *************** *** 752,756 **** * @return wherther or not the space is closed. */ ! public boolean isClosed(Space sp) { boolean closed = closedSpaces.contains(sp); return closed; --- 752,756 ---- * @return wherther or not the space is closed. */ ! public boolean isClosed(Container sp) { boolean closed = closedSpaces.contains(sp); return closed; |