bprocessor-commit Mailing List for B-processor (Page 88)
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-12-01 10:56:47
|
Update of /cvsroot/bprocessor/CVSROOT In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10954 Modified Files: modules Log Message: Added bscript and bprocessor to the "all" module alias Index: modules =================================================================== RCS file: /cvsroot/bprocessor/CVSROOT/modules,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** modules 18 Aug 2006 11:52:03 -0000 1.4 --- modules 1 Dec 2006 10:56:45 -0000 1.5 *************** *** 25,29 **** # can be useful for creating a module that consists of many directories # spread out over the entire source repository. ! all -a build kernel model gui gl tools facade build build --- 25,29 ---- # can be useful for creating a module that consists of many directories # spread out over the entire source repository. ! all -a build kernel model gui gl tools facade bscript bprocessor build build *************** *** 33,35 **** gl gl tools tools ! facade facade --- 33,37 ---- gl gl tools tools ! facade facade ! bscript bscript ! bprocessor bprocessor |
|
From: Michael L. <he...@us...> - 2006-11-30 22:03:56
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23991/src/net/sourceforge/bprocessor/model Modified Files: Space.java Entity.java Log Message: New PencilTool implements a new algorithm to find surface. Currently not incremental Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** Space.java 28 Nov 2006 16:15:44 -0000 1.104 --- Space.java 30 Nov 2006 22:03:46 -0000 1.105 *************** *** 546,549 **** --- 546,569 ---- this.constructors = constructors; } + + /** + * Answer with a collection of coordinatesystems in this space + * @return collection of coordinatesystems + */ + public Collection getCoordinateSystems() { + Collection planes = new LinkedList(); + { + Collection constructors = getConstructors(); + Iterator iter = constructors.iterator(); + while (iter.hasNext()) { + Constructor current = (Constructor) iter.next(); + if (current instanceof CoordinateSystem) { + planes.add(current); + } + } + } + return planes; + } + /** * Add a vertex Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Entity.java 6 Nov 2006 11:00:54 -0000 1.10 --- Entity.java 30 Nov 2006 22:03:46 -0000 1.11 *************** *** 9,13 **** --- 9,16 ---- import java.io.Serializable; import java.util.Collection; + import java.util.Collections; + import java.util.Comparator; import java.util.Iterator; + import java.util.List; /** *************** *** 36,39 **** --- 39,56 ---- return value; } + + /** + * Sort list of entities with respect to id + * @param entities List of entities to be sorted + */ + public static void sort(List entities) { + final Comparator comparator = + new Comparator() { + public int compare(Object s1, Object s2) { + return ((Entity) s1).getId().compareTo(((Entity) s2).getId()); + } + }; + Collections.sort(entities, comparator); + } /** |
|
From: Michael L. <he...@us...> - 2006-11-30 22:03:53
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24004/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: New PencilTool implements a new algorithm to find surface. Currently not incremental Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** GenericTreeView.java 28 Nov 2006 15:39:35 -0000 1.66 --- GenericTreeView.java 30 Nov 2006 22:03:51 -0000 1.67 *************** *** 442,461 **** /** ! * Insert the given object into the node ! * @param elem the elements */ ! public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Entity) s1).getId().compareTo(((Entity) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! //insert ! int[] ins = new int[sort.size()]; int i = 0; ! Iterator iter = sort.iterator(); while (iter.hasNext()) { this.add(new EntityNode(iter.next())); --- 442,454 ---- /** ! * Insert a collection of Entity into this node ! * @param entities collection of Entity */ ! public void insertChildren(Collection entities) { ! LinkedList sorted = new LinkedList(entities); ! Entity.sort(sorted); ! int[] ins = new int[sorted.size()]; int i = 0; ! Iterator iter = sorted.iterator(); while (iter.hasNext()) { this.add(new EntityNode(iter.next())); *************** *** 982,1000 **** /** ! * Insert the given object into the node ! * @param elem the elements */ ! public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Edge) s1).getId().compareTo(((Edge) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! int[] ins = new int[sort.size()]; int i = 0; ! Iterator iter = sort.iterator(); while (iter.hasNext()) { Edge s = (Edge)iter.next(); --- 975,987 ---- /** ! * Insert collection of Entity in this node ! * @param entities collection of Entity */ ! public void insertChildren(Collection entities) { ! LinkedList sorted = new LinkedList(entities); ! Entity.sort(sorted); ! int[] ins = new int[sorted.size()]; int i = 0; ! Iterator iter = sorted.iterator(); while (iter.hasNext()) { Edge s = (Edge)iter.next(); |
|
From: Michael L. <he...@us...> - 2006-11-30 22:03:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23976/src/net/sourceforge/bprocessor/gl/tool Modified Files: Tool.java ToolFactory.java Added Files: PencilTool.java Log Message: New PencilTool implements a new algorithm to find surface. Currently not incremental Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** ToolFactory.java 17 Nov 2006 15:47:33 -0000 1.67 --- ToolFactory.java 30 Nov 2006 22:03:41 -0000 1.68 *************** *** 70,73 **** --- 70,76 ---- /** pencil tool */ private Pencil pencil; + + /** extra pencil tool */ + private PencilTool penciltool; /** eraser tool */ *************** *** 174,177 **** --- 177,181 ---- select = new SpaceTool(glv, null); pencil = new Pencil(glv, pencilcursor); + penciltool = new PencilTool(glv, pencilcursor); eraser = new EraserTool(glv, pencilcursor); arc = new ArcTool(glv, pencilcursor); *************** *** 194,197 **** --- 198,202 ---- pencilBut = this.registerTool(Tool.PENCIL_TOOL, pencil, "Biconpentool.gif", "Pencil"); pencilBut.setMnemonic(KeyEvent.VK_W); + this.registerTool(Tool.ALT_PENCIL_TOOL, penciltool, "Biconpentool2.gif", "Pencil"); eraserBut = this.registerTool(Tool.ERASER_TOOL, eraser, "Biconeraser.gif", "Eraser"); eraserBut.setMnemonic(KeyEvent.VK_A); Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Tool.java 4 Aug 2006 11:48:11 -0000 1.26 --- Tool.java 30 Nov 2006 22:03:41 -0000 1.27 *************** *** 58,61 **** --- 58,63 ---- /** The controlled move tool */ public static final int CONTROLLED_MOVE_TOOL = 18; + /** the alternative pecnil tool */ + public static final int ALT_PENCIL_TOOL = 19; /** --- NEW FILE: PencilTool.java --- //--------------------------------------------------------------------------------- // $Id: PencilTool.java,v 1.66 2006/11/30 22:03:41 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.gl.tool; import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import javax.swing.AbstractAction; import javax.swing.JPopupMenu; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * Pencil * */ public class PencilTool extends AbstractPencil { /** * Constructor for Pencil * @param glv GLView * @param cursor Cursor */ public PencilTool(GLView glv, Cursor cursor) { super(glv, cursor); dragging = false; } /** * * Update feedback */ public void updateFeedback() { if (start != null) { Edge edge = new Edge(start.vertex(), current.vertex()); List edges = new LinkedList(); edges.add(edge); feedback(edges); } else { constructors(new LinkedList()); feedback(new LinkedList()); } makeTarget(current); updateConstructors(); } /** * @param e MouseEvent */ protected void moved(MouseEvent e) { current = findIntersection(e); if (current != null) { updateFeedback(); } } /** * * @return JPopupMenu */ public JPopupMenu menu() { JPopupMenu menu = new JPopupMenu(); AbstractAction planeanalysis = new AbstractAction("Plane Analysis") { public void actionPerformed(ActionEvent arg0) { Space space = Project.getInstance().getActiveSpace(); clearPlanes(space); Collection planes = planeAnalysis(space); Iterator iter = planes.iterator(); while (iter.hasNext()) { CoordinateSystem current = (CoordinateSystem) iter.next(); space.insert(current); } Project.getInstance().changed(space); Project.getInstance().checkpoint(); } }; menu.add(planeanalysis); AbstractAction clearplanes = new AbstractAction("Delete Planes") { public void actionPerformed(ActionEvent arg0) { Space space = Project.getInstance().getActiveSpace(); clearPlanes(space); Project.getInstance().changed(space); Project.getInstance().checkpoint(); } }; menu.add(clearplanes); AbstractAction surfaceanalysis = new AbstractAction("Surface Analysis") { public void actionPerformed(ActionEvent arg0) { Space space = Project.getInstance().getActiveSpace(); clearSurfaces(space); surfaceAnalysis(space); Project.getInstance().changed(space); Project.getInstance().checkpoint(); } }; menu.add(surfaceanalysis); AbstractAction clearsurfaces = new AbstractAction("Delete Surfaces") { public void actionPerformed(ActionEvent arg0) { Space space = Project.getInstance().getActiveSpace(); clearSurfaces(space); Project.getInstance().changed(space); Project.getInstance().checkpoint(); } }; menu.add(clearsurfaces); return menu; } /** * * @param planes Collection of coordinatesystem * @param edge Edge * @return True if edge is contained in a coordinatesystem */ private boolean contains(Collection planes, Edge edge) { Iterator iter = planes.iterator(); while (iter.hasNext()) { CoordinateSystem system = (CoordinateSystem) iter.next(); if (system.plane().contains(edge)) { return true; } } return false; } /** * Remove all coordinatesystems from space * @param space Space */ public void clearPlanes(Space space) { Collection planes = space.getCoordinateSystems(); Iterator iter = planes.iterator(); while (iter.hasNext()) { CoordinateSystem current = (CoordinateSystem) iter.next(); space.remove(current); } } /** * @param space Space * @return Collection of planes */ public Collection planeAnalysis(Space space) { Collection planes = new LinkedList(); Collection edges = space.getEdges(); { Set mark = new HashSet(); Map neighbours = new HashMap(); { Collection vertices = space.getVertices(); Map edgemap = new HashMap(); { Iterator iter = vertices.iterator(); while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); edgemap.put(current, new LinkedList()); } } { Iterator iter = edges.iterator(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); Vertex from = current.getFrom(); List fl = (List) edgemap.get(from); fl.add(current); Vertex to = current.getTo(); List tl = (List) edgemap.get(to); tl.add(current); } } { Iterator iter = edges.iterator(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); List incident = new LinkedList(); { Vertex from = current.getFrom(); List fl = (List) edgemap.get(from); Iterator flit = fl.iterator(); while (flit.hasNext()) { Edge edge = (Edge) flit.next(); if (edge != current) { incident.add(edge); } } } { Vertex to = current.getTo(); List tl = (List) edgemap.get(to); Iterator tlit = tl.iterator(); while (tlit.hasNext()) { Edge edge = (Edge) tlit.next(); if (edge != current) { incident.add(edge); } } } neighbours.put(current, incident); } } } Iterator iter = edges.iterator(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); if (!mark.contains(current)) { mark.add(current); if (!contains(planes, current)) { List incident = (List) neighbours.get(current); List pls = new LinkedList(); Iterator it = incident.iterator(); while (it.hasNext()) { Edge edge = (Edge) it.next(); if (!contains(pls, edge)) { CoordinateSystem system = CoordinateSystem.create(current, edge); mark.add(edge); if (system != null) { pls.add(system); } } } planes.addAll(pls); } } } } return planes; } /** * @param e MouseEvent */ protected void pressed(MouseEvent e) { if (e.isPopupTrigger()) { glv.popup(menu(), e.getX(), e.getY()); } else { onVertex(); moved(e); } } /** * Current vertex is pressed */ public void onVertex() { if (start == null) { start = current; active = true; } else { if (start.vertex().equalEps(current.vertex())) { cleanUp(); return; } else { Edge edge = new Edge(start.vertex(), current.vertex()); Project.getInstance().getActiveSpace().insert(edge); Project.getInstance().changed(Project.getInstance().getActiveSpace()); Project.getInstance().checkpoint(); hooverEdge = edge; start = current; incident = null; cleanUp(); } } updateConstructors(); updateFeedback(); glv.repaint(); } /** * Clear surfaces in specified space * @param space Space */ public void clearSurfaces(Space space) { Collection surfaces = new LinkedList(space.getSurfaces()); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); space.remove(current); } } /** * Find surfaces in specified space * @param space Space */ public void surfaceAnalysis(Space space) { Collection planes = space.getCoordinateSystems(); Iterator iter = planes.iterator(); while (iter.hasNext()) { CoordinateSystem current = (CoordinateSystem) iter.next(); surfaceAnalysis(space, current); } } /** * Find surfaces in specified space that lies in the specified * coordinatesystem * @param space Space * @param system CoordinateSystem */ public void surfaceAnalysis(Space space, CoordinateSystem system) { Plane plane = system.plane(); Map vmap = new LinkedHashMap(); Map emap = new LinkedHashMap(); { List vertices = new LinkedList(space.getVertices()); Entity.sort(vertices); Iterator iter = vertices.iterator(); while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); glv.getView().clearColor(current); if (plane.contains(current)) { glv.getView().changeColor(current, View.CLIP_PLANE_COLOR); Selection.primary().add(current); vmap.put(current, new VertexNode(current)); } } } { List edges = new LinkedList(space.getEdges()); Entity.sort(edges); Iterator iter = edges.iterator(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); glv.getView().clearColor(current); VertexNode from = (VertexNode) vmap.get(current.getFrom()); VertexNode to = (VertexNode) vmap.get(current.getTo()); if (from != null && to != null) { glv.getView().changeColor(current, View.CLIP_PLANE_COLOR); EdgeNode node = new EdgeNode(current, from, to); emap.put(current, node); from.add(node); to.add(node); } } } { Iterator iter = vmap.values().iterator(); while (iter.hasNext()) { VertexNode current = (VertexNode) iter.next(); current.sort(system); } } { Iterator iter = emap.values().iterator(); System.out.println("-- analysis --"); while (iter.hasNext()) { EdgeNode current = (EdgeNode) iter.next(); surfaceAnalysis(current, system); } } } /** * Return a list of Edge corresponding to a list of EdgeNodes such * that all nodes with the same surfacenode on both sides are ignored. * @param nodes list of EdgeNode * @return list of Edge */ public List contour(List nodes) { List edges = new LinkedList(); { Iterator iter = nodes.iterator(); while (iter.hasNext()) { EdgeNode current = (EdgeNode) iter.next(); if (current.left != current.right) { edges.add(current.edge); } } } return edges; } /** * * @param start EdgeNode * @param system CoordinateSystem */ public void surfaceAnalysis(EdgeNode start, CoordinateSystem system) { if (start.left == null) { System.out.println("left analyze " + start); SurfaceNode s = new SurfaceNode(); List nodes = new LinkedList(); VertexNode to = start.to; EdgeNode current = start; while (current.getLeft(to) != s) { System.out.println(current); nodes.add(current); current.setLeft(to, s); current = current.pred(to); to = current.other(to); } List edges = contour(nodes); if (edges.size() > 2) { System.out.println("left surface:" + edges); int turn = direction(edges, system); if (turn == LEFT) { System.out.println("turns left"); Surface surface = new Surface(edges); Project.getInstance().getActiveSpace().add(surface); } if (turn == RIGHT) { System.out.println("turns right"); } } } if (start.right == null) { System.out.println("right analyze " + start); SurfaceNode s = new SurfaceNode(); List nodes = new LinkedList(); VertexNode to = start.to; EdgeNode current = start; while (current.getRight(to) != s) { System.out.println(current); nodes.add(current); current.setRight(to, s); current = current.succ(to); to = current.other(to); } List edges = contour(nodes); if (edges.size() > 2) { System.out.println("right surface:" + edges); int turn = direction(edges, system); if (turn == LEFT) { System.out.println("turns left"); } if (turn == RIGHT) { System.out.println("turns right"); Surface surface = new Surface(edges); Project.getInstance().getActiveSpace().add(surface); } } } } /** LEFT means counterclockwise */ public static final int LEFT = 1; /** RIGHT means clockwise */ public static final int RIGHT = 2; /** PARALLEL means not turning */ public static final int PARALLEL = 3; /** * Find the turn direction of the edges * @param edges list of Edge * @param system CoordinateSystem * @return direction (LEFT or RIGHT) */ public int direction(List edges, CoordinateSystem system) { double y = Double.MAX_VALUE; Edge e1 = null; Edge e2 = null; Edge previous = (Edge) edges.get(edges.size() - 1); Iterator iter = edges.iterator(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); Vertex v = Edge.commonVertex(previous, current); v = system.translate(v); if (v.getY() <= y) { y = v.getY(); e1 = previous; e2 = current; } previous = current; } Vertex common = Edge.commonVertex(e1, e2); Vertex from = e1.otherVertex(common); Vertex to = e2.otherVertex(common); from = system.translate(from); common = system.translate(common); to = system.translate(to); Vertex u = common.minus(from); Vertex v = to.minus(common); Vertex cross = u.cross(v); double determinant = cross.getZ(); // if the cross points into the screen (along the negative z), // the vectors are doing a right turn. Otherwise they are doing // a left turn. If the cross are zero, they er parallel, but the // above code should ensure that does not happen assuming the // edges has a nonzero area. if (determinant < 0) { return RIGHT; } if (determinant > 0) { return LEFT; } return PARALLEL; } /** * VertexNode */ public class VertexNode { /** vertex */ private Vertex vertex; /** edges */ private List edges; /** * Constructor * @param vertex Vertex */ public VertexNode(Vertex vertex) { this.vertex = vertex; edges = new LinkedList(); } /** * * @param edge Edge */ public void add(EdgeNode edge) { edges.add(edge); } /** * * @param system CoordinateSystem */ public void sort(CoordinateSystem system) { /** * Entry */ class Entry implements Comparable { protected double dx; protected double dy; protected EdgeNode node; /** * * @param node EdgeNode * @param dx double * @param dy double */ public Entry(EdgeNode node, double dx, double dy) { this.node = node; this.dx = dx; this.dy = dy; } /** * @param other Object * @return int */ public int compareTo(Object other) { Entry entry = (Entry) other; if (this.dx == 0) { return -1; } if (entry.dx == 0) { return 1; } if ((this.dy / this.dx) < (entry.dy / entry.dx)) { return -1; } else { return 1; } } } { List left = new LinkedList(); List right = new LinkedList(); Iterator iter = edges.iterator(); while (iter.hasNext()) { EdgeNode current = (EdgeNode) iter.next(); VertexNode other = current.other(this); Vertex delta = other.vertex.minus(vertex); double dx = system.getI().dot(delta); double dy = system.getJ().dot(delta); Entry entry = new Entry(current, dx, dy); if (dx == 0) { if (dy < 0) { right.add(entry); } if (dy > 0) { left.add(entry); } } else { if (dx > 0) { right.add(entry); } if (dx < 0) { left.add(entry); } } } Object[] rights = right.toArray(); Arrays.sort(rights); Object[] lefts = left.toArray(); Arrays.sort(lefts); List result = new LinkedList(); for (int i = 0; i < rights.length; i++) { result.add(((Entry) rights[i]).node); } for (int i = 0; i < lefts.length; i++) { result.add(((Entry) lefts[i]).node); } edges = result; } { EdgeNode previous = (EdgeNode) edges.get(edges.size() - 1); Iterator iter = edges.iterator(); while (iter.hasNext()) { EdgeNode current = (EdgeNode) iter.next(); if (previous.to == this) { previous.toSucc = current; } if (previous.from == this) { previous.fromSucc = current; } if (current.to == this) { current.toPred = previous; } if (current.from == this) { current.fromPred = previous; } previous = current; } } } /** * @return String */ public String toString() { return "{" + vertex.getName() + " " + edges + "}"; } } /** * EdgeNode */ public class EdgeNode { /** edge */ private Edge edge; /** from */ private VertexNode from; /** to */ private VertexNode to; /** successor arround to */ private EdgeNode toSucc; /** predecessor around to */ private EdgeNode toPred; /** sucessor around from */ private EdgeNode fromSucc; /** predecessor around from */ private EdgeNode fromPred; /** left surface */ private SurfaceNode left; /** right surface */ private SurfaceNode right; /** * * @param edge Edge * @param from VertexNode * @param to VertexNode */ public EdgeNode(Edge edge, VertexNode from, VertexNode to) { this.edge = edge; this.from = from; this.to = to; } /** * * @param end VertexNode * @return VertexNode */ public VertexNode other(VertexNode end) { if (end == from) { return to; } if (end == to) { return from; } return null; } /** * * @param end VertexNode * @return EdgeNode */ public EdgeNode succ(VertexNode end) { if (end == to) { return toSucc; } if (end == from) { return fromSucc; } return null; } /** * * @param end VertexNode * @return EdgeNode */ public EdgeNode pred(VertexNode end) { if (end == to) { return toPred; } if (end == from) { return fromPred; } return null; } /** * * @param end VertexNode * @return SurfaceNode */ public SurfaceNode getLeft(VertexNode end) { if (end == to) { return left; } if (end == from) { return right; } return null; } /** * @param end VertexNode * @param left SurfaceNode */ public void setLeft(VertexNode end, SurfaceNode left) { if (end == to) { this.left = left; } if (end == from) { this.right = left; } } /** * * @param end VertexNode * @return SurfaceNode */ public SurfaceNode getRight(VertexNode end) { if (end == to) { return right; } if (end == from) { return left; } return null; } /** * * @param end VertexNode * @param right SurfaceNode */ public void setRight(VertexNode end, SurfaceNode right) { if (end == to) { this.right = right; } if (end == from) { this.left = right; } } /** * @return String */ public String toString() { return "{" + edge.getName() + " fp:" + ((fromPred == null) ? "nil" : fromPred.edge.getName()) + " fs:" + ((fromSucc == null) ? "nil" : fromSucc.edge.getName()) + " tp:" + ((toPred == null) ? "nil" : toPred.edge.getName()) + " ts:" + ((toSucc == null) ? "nil" : toSucc.edge.getName()) + "}"; } } /** * SurfaceNode */ public class SurfaceNode { } } |
|
From: Michael L. <he...@us...> - 2006-11-30 22:03:50
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23976/src/gfx Added Files: Biconpentool2.gif Log Message: New PencilTool implements a new algorithm to find surface. Currently not incremental --- NEW FILE: Biconpentool2.gif --- (This appears to be a binary file; contents omitted.) |
|
From: rimestad <rim...@us...> - 2006-11-28 20:52:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30754/src/net/sourceforge/bprocessor/gui/actions Added Files: AboutActionListener.java Log Message: enabled the about button and made a actionlistener for it... made a somewhat boring about splash, should be improved, but contains a link that can be clicked. --- NEW FILE: AboutActionListener.java --- //--------------------------------------------------------------------------------- // $Id: AboutActionListener.java,v 1.1 2006/11/28 20:51:57 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.FileReader; import java.lang.reflect.Method; import java.net.URL; import javax.swing.Box; import javax.swing.ImageIcon; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import javax.swing.text.html.HTMLEditorKit; import javax.swing.text.html.HTMLFrameHyperlinkEvent; import org.apache.log4j.Logger; /** * The FileCloseActionListener */ public class AboutActionListener implements ActionListener { /** The logger */ private static Logger log = Logger.getLogger(AboutActionListener.class); /** * Constructs the FileCloseActionListner */ public AboutActionListener() { super(); } /** * Clears the project * @param event The event */ public void actionPerformed(ActionEvent event) { JFrame frame = new JFrame("About"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("splash3_24bit.png"); JLabel l = new JLabel(new ImageIcon(url)); Container c = frame.getContentPane(); c.setBackground(Color.WHITE); c.add(l, BorderLayout.CENTER); Box txt = Box.createVerticalBox(); txt.setBackground(Color.WHITE); try { BufferedReader br = new BufferedReader(new FileReader(".version.file")); String s = "Version: " + br.readLine(); Box version = Box.createHorizontalBox(); JLabel ver = new JLabel(s); ver.setForeground(Color.GRAY); version.add(Box.createHorizontalStrut(10)); version.add(ver); version.add(Box.createHorizontalGlue()); txt.add(version); } catch (Exception e) { log.error(e.getMessage()); } String rest = "<html>The B-processor is a open source project driven by " + "Alexandra instituttet,<br>" + "Aarhus School of Architecture and Technological Institute.<br><br>" + "To read more about the project visit " + "<a href=http://www.b-processor.dk>www.b-processor.dk</a></html>"; JEditorPane hmm = new JEditorPane(); hmm.setEditorKit(new HTMLEditorKit()); hmm.setText(rest); hmm.setEditable(false); hmm.addHyperlinkListener(new Hyperactive()); Box insert = Box.createHorizontalBox(); insert.add(Box.createHorizontalStrut(10)); insert.add(hmm); insert.add(Box.createHorizontalGlue()); txt.add(insert); c.add(txt, BorderLayout.SOUTH); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension labelSize = l.getPreferredSize(); frame.setLocation(screenSize.width / 2 - (labelSize.width / 2), screenSize.height / 2 - (labelSize.height / 2)); frame.pack(); frame.pack(); frame.setVisible(true); } /** * Static method to open url in a system browser * @param url the string url to open */ public static void openURL(String url) { String osName = System.getProperty("os.name"); try { if (osName.startsWith("Mac OS")) { Class fileMgr = Class.forName("com.apple.eio.FileManager"); Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class}); openURL.invoke(null, new Object[] {url}); } else if (osName.startsWith("Windows")) { Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); } else { //assume Unix or Linux String[] browsers = {"firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape"}; String browser = null; for (int count = 0; count < browsers.length && browser == null; count++) { if (Runtime.getRuntime().exec(new String[]{"which", browsers[count]}).waitFor() == 0) { browser = browsers[count]; } } if (browser == null) { throw new Exception("Could not find web browser"); } else { Runtime.getRuntime().exec(new String[] {browser, url}); } } } catch (Exception e) { JOptionPane.showMessageDialog(null, "Error attempting to launch web browser" + ":\n" + e.getLocalizedMessage()); } } /** * Listener for reacting on the hyperlink event */ class Hyperactive implements HyperlinkListener { /** * The method for the update event * @param e the hyperlinkevent */ public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (e instanceof HTMLFrameHyperlinkEvent) { HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e; AboutActionListener.openURL(evt.getURL().toString()); } else { try { AboutActionListener.openURL(e.getURL().toString()); } catch (Throwable t) { t.printStackTrace(); } } } } } } |
|
From: rimestad <rim...@us...> - 2006-11-28 20:51:59
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30754/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: enabled the about button and made a actionlistener for it... made a somewhat boring about splash, should be improved, but contains a link that can be clicked. Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** GUI.java 26 Nov 2006 22:13:47 -0000 1.52 --- GUI.java 28 Nov 2006 20:51:57 -0000 1.53 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.gui; + import net.sourceforge.bprocessor.gui.actions.AboutActionListener; import net.sourceforge.bprocessor.gui.actions.CreateConstructionSpaceActionListener; import net.sourceforge.bprocessor.gui.actions.CreateConstructorActionListener; *************** *** 361,366 **** JMenuItem helpAbout = new JMenuItem("About"); helpAbout.setMnemonic(KeyEvent.VK_A); - helpAbout.setEnabled(false); help.add(helpAbout); --- 362,367 ---- JMenuItem helpAbout = new JMenuItem("About"); + helpAbout.addActionListener(new AboutActionListener()); helpAbout.setMnemonic(KeyEvent.VK_A); help.add(helpAbout); |
|
From: rimestad <rim...@us...> - 2006-11-28 20:50:39
|
Update of /cvsroot/bprocessor/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30309 Modified Files: .cvsignore Log Message: made the ant write a file with the version number for the program to use... Index: .cvsignore =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 31 Aug 2006 13:01:52 -0000 1.2 --- .cvsignore 28 Nov 2006 20:50:33 -0000 1.3 *************** *** 5,6 **** --- 5,7 ---- *.tar.bz2 bin + .version.file |
|
From: rimestad <rim...@us...> - 2006-11-28 20:50:35
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30297 Modified Files: build.xml Log Message: made the ant write a file with the version number for the program to use... Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** build.xml 20 Nov 2006 10:11:18 -0000 1.27 --- build.xml 28 Nov 2006 20:50:30 -0000 1.28 *************** *** 38,41 **** --- 38,42 ---- <mkdir dir="${release.dir}/plugin"/> + <echo file="${release.dir}/.version.file">${version}</echo> <ant dir="${kernel.dir}" target="dist"/> <ant dir="${model.dir}" target="dist"/> |
|
From: Nordholt <nor...@us...> - 2006-11-28 17:54:06
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21722/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: work on net facademodellor Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NetFacadeModellor.java 28 Nov 2006 17:23:14 -0000 1.2 --- NetFacadeModellor.java 28 Nov 2006 17:53:05 -0000 1.3 *************** *** 211,215 **** */ private void regenerate() { ! createFacade(net); } --- 211,217 ---- */ private void regenerate() { ! space.setEdges(new HashMap()); ! space.setSurfaces(new HashMap()); ! space.setVertices(new HashMap()); createFacade(net); } *************** *** 235,239 **** Edge e = (Edge)edge.next(); h = new Surface(e.offset(fcopy.getEdges(), fcopy, -frameWidth)); ! space.insert(h); Geometry.holeAnalysis(h); } --- 237,241 ---- Edge e = (Edge)edge.next(); h = new Surface(e.offset(fcopy.getEdges(), fcopy, -frameWidth)); ! h = space.insert(h); Geometry.holeAnalysis(h); } *************** *** 242,246 **** extrudeIntoSpace(fcopy, depth, sides); sides = new HashSet(); ! Geometry.holeAnalysis(extrudeIntoSpace(h, depth, sides)); } } --- 244,248 ---- extrudeIntoSpace(fcopy, depth, sides); sides = new HashSet(); ! Geometry.holeAnalysis(space.insert(extrudeIntoSpace(h, depth, sides))); } } |
|
From: Nordholt <nor...@us...> - 2006-11-28 17:23:31
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9505/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: checkstyle fixes Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NetFacadeModellor.java 28 Nov 2006 16:18:18 -0000 1.1 --- NetFacadeModellor.java 28 Nov 2006 17:23:14 -0000 1.2 *************** *** 16,19 **** --- 16,21 ---- import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Net; import net.sourceforge.bprocessor.model.Project; *************** *** 35,38 **** --- 37,43 ---- private Space space; + /** The frame space */ + private Space frame; + /** The net for this facade */ private Net net; *************** *** 121,124 **** --- 126,130 ---- /** * Get the attributes of this modellor + * @return the attributes */ public List getAttributes() { *************** *** 132,135 **** --- 138,142 ---- /** * Set the attributes of the modellor + * @param attributes the new attributes */ public void setAttributes(List attributes) { *************** *** 137,143 **** while (it.hasNext()) { Attribute att = (Attribute)it.next(); ! if (att.getName() == "Net") { setNet((Space)att.getValue()); ! } else if(att.getName() == "Framewidth") { setFrameWidth(((Double)att.getValue()).doubleValue()); } --- 144,150 ---- while (it.hasNext()) { Attribute att = (Attribute)it.next(); ! if (att.getName().equals("Net")) { setNet((Space)att.getValue()); ! } else if (att.getName().equals("Framewidth")) { setFrameWidth(((Double)att.getValue()).doubleValue()); } *************** *** 204,210 **** */ private void regenerate() { ! space.setVertices(new HashMap()); ! space.setEdges(new HashMap()); ! space.setSurfaces(new HashMap()); createFacade(net); } --- 211,215 ---- */ private void regenerate() { ! createFacade(net); } *************** *** 215,218 **** --- 220,228 ---- */ private void createFacade(Net net) { + if (frame == null) { + frame = new Space("Frame", Space.CONSTRUCTION, + Space.ELEMENT_LEVEL, true); + space.add(frame); + } if (net != null) { Iterator fields = net.getSurfaces().iterator(); *************** *** 220,225 **** Surface field = (Surface)fields.next(); Surface fcopy = field.copyall(space); Set sides = new HashSet(); ! fcopy.extrude(depth, sides); } } --- 230,246 ---- Surface field = (Surface)fields.next(); Surface fcopy = field.copyall(space); + Surface h = null; + Iterator edge = fcopy.getEdges().iterator(); + if (edge.hasNext()) { + Edge e = (Edge)edge.next(); + h = new Surface(e.offset(fcopy.getEdges(), fcopy, -frameWidth)); + space.insert(h); + Geometry.holeAnalysis(h); + } + assignSame(front, fcopy, space, frame); Set sides = new HashSet(); ! extrudeIntoSpace(fcopy, depth, sides); ! sides = new HashSet(); ! Geometry.holeAnalysis(extrudeIntoSpace(h, depth, sides)); } } *************** *** 254,256 **** --- 275,319 ---- this.front = front; } + + /** + * Makes sure to extrude the a surface to the right side + * (towards the space of this modellor). + * @param s the surface + * @param delta the length to extrude + * @param sides this set will hold the sides of the extrusion + * @return the top surface of the extrusion + */ + private Surface extrudeIntoSpace(Surface s, double delta, Set sides) { + int deltaCorrection = 1; + if (s.normal().dot(front.normal()) < 0) { + deltaCorrection *= -1; + } + if (front.getFrontDomain() != space) { + deltaCorrection *= -1; + } + return s.extrude(delta * deltaCorrection, sides); + } + + /** + * Assign space sp2 to the same side of s2 as space sp1 is assigned to s1 + * @param s1 first surface + * @param s2 second surface + * @param sp1 first space + * @param sp2 second space + */ + private void assignSame(Surface s1, Surface s2, Space sp1, Space sp2) { + if (s1.getFrontDomain() == sp1) { + if (s1.normal().dot(s2.normal()) > 0) { + s2.setFrontDomain(sp2); + } else { + s2.setBackDomain(sp2); + } + } else if (s1.getBackDomain() == sp1) { + if (s1.normal().dot(s2.normal()) > 0) { + s2.setBackDomain(sp2); + } else { + s2.setFrontDomain(sp2); + } + } + } } |
|
From: rimestad <rim...@us...> - 2006-11-28 16:43:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25071/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: made changes to make labels both visible and clickable both in orthographic and perspective views, fix is to change the z value from 0 to 1, seems to work in both view formats Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** View.java 28 Nov 2006 15:40:02 -0000 1.164 --- View.java 28 Nov 2006 16:43:26 -0000 1.165 *************** *** 1705,1715 **** * @param x The x position * @param y The y position * @param string The string to draw */ ! void drawString(double x, double y, String string) { gl.glPushMatrix(); ! gl.glTranslated(x, y, 0.1); ! ! gl.glRasterPos2i(0, 0); glut.glutBitmapString(gl, GLUT.BITMAP_HELVETICA_12, string); gl.glPopMatrix(); --- 1705,1714 ---- * @param x The x position * @param y The y position + * @param z The z position * @param string The string to draw */ ! void drawString(double x, double y, double z, String string) { gl.glPushMatrix(); ! gl.glRasterPos3d(x, y, z); glut.glutBitmapString(gl, GLUT.BITMAP_HELVETICA_12, string); gl.glPopMatrix(); *************** *** 1720,1731 **** * @param x The x position * @param y The y position * @param string The String */ ! void drawTextBox(double x, double y, String string) { int width = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_12, string); gl.glColor3d(0.85, 0.85, 0.85); gl.glRectd(x - 4, y - 8, x + width + 4, y + 18); gl.glColor3d(0, 0, 0); ! drawString(x, y, string); } --- 1719,1731 ---- * @param x The x position * @param y The y position + * @param z The z position * @param string The String */ ! void drawTextBox(double x, double y, double z, String string) { int width = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_12, string); gl.glColor3d(0.85, 0.85, 0.85); gl.glRectd(x - 4, y - 8, x + width + 4, y + 18); gl.glColor3d(0, 0, 0); ! drawString(x, y, z, string); } *************** *** 1793,1796 **** --- 1793,1798 ---- Vertex from = surface.center(); Vertex front = transformation.project(from); + //fix for making label selection work in ortho mode + front.setZ(1); Space frontDomain = surface.getFrontDomain(); Space backDomain = surface.getBackDomain(); *************** *** 1854,1858 **** gl.glColor3d(0.8 + fcb, 0.2 + fcb, 0.4 + fcb); } ! drawString(frontTextAnchor.getX(), frontTextAnchor.getY(), frontName); double bcb = 0; if (backLabelSelect) { --- 1856,1861 ---- gl.glColor3d(0.8 + fcb, 0.2 + fcb, 0.4 + fcb); } ! drawString(frontTextAnchor.getX(), frontTextAnchor.getY(), ! frontTextAnchor.getZ(), frontName); double bcb = 0; if (backLabelSelect) { *************** *** 1869,1873 **** } ! drawString(backTextAnchor.getX(), backTextAnchor.getY(), backName); drawSeperator(front, Math.max(frontWidth, backWidth)); --- 1872,1877 ---- } ! drawString(backTextAnchor.getX(), backTextAnchor.getY(), ! backTextAnchor.getZ(), backName); drawSeperator(front, Math.max(frontWidth, backWidth)); |
|
From: Nordholt <nor...@us...> - 2006-11-28 16:18:32
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14809/src/net/sourceforge/bprocessor/facade/modellor Added Files: NetFacadeModellor.java Log Message: added facade modellor using nets --- NEW FILE: NetFacadeModellor.java --- //--------------------------------------------------------------------------------- // $Id: NetFacadeModellor.java,v 1.1 2006/11/28 16:18:18 nordholt Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.facade.modellor; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Net; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.modellor.Modellor; import org.apache.log4j.Logger; /** * The new facade modellor using nets. * */ public class NetFacadeModellor extends Modellor { /** serial id */ private static final long serialVersionUID = 1L; /** The space of the facade */ private Space space; /** The net for this facade */ private Net net; /** The framewidth of the facade */ private double frameWidth = 0.1; /** The depth of the facade */ private double depth = 0.4; /** The front surface of the facade */ private Surface front; /** The logger */ private static Logger log = Logger.getLogger(NetFacadeModellor.class); /** * Empty constructor for the net facade */ public NetFacadeModellor() { space = null; net = null; } /** * Get content of the modellor for persistence * @return a map for persistence */ public Map getContent() { Map content = new HashMap(); content.put("space", space); content.put("net", net); content.put("depth", new Double(depth)); content.put("frameWidth", new Double(frameWidth)); content.put("front", front); return content; } /** * get a new instance of the net facade modellor * @param s the space of the modellor * @return a new modellor */ public Modellor newInstance(Space s) { NetFacadeModellor mod = new NetFacadeModellor(); mod.setSpace(s); Project.getInstance().addObserver(mod); s.setModellor(mod); Iterator it = s.getEnvelope().iterator(); if (it.hasNext()) { mod.setFront((Surface)it.next()); } mod.setNet(mod.createNet(mod.getFront())); mod.regenerate(); return mod; } /** * Set the content of the modellor from a map, for persistence * @param m persistence map */ public void setContent(Map m) { space = (Space)m.get("space"); net = (Net)m.get("net"); depth = ((Double)m.get("depth")).doubleValue(); frameWidth = ((Double)m.get("frameWidth")).doubleValue(); front = (Surface)m.get("front"); } /** * Update when an entity changes * @param entity the changed entity */ public void update(Object entity) { log.info("update"); regenerate(); } /** * Delete this modellor */ public void delete() { space.setModellor(null); } /** * Get the attributes of this modellor */ public List getAttributes() { List attributes = new LinkedList(); attributes.add(new Attribute("Net", net, true)); attributes.add(new Attribute("Framewidth", new Double(frameWidth), true)); attributes.add(new Attribute("Depth", new Double(depth), true)); return attributes; } /** * Set the attributes of the modellor */ public void setAttributes(List attributes) { Iterator it = attributes.iterator(); while (it.hasNext()) { Attribute att = (Attribute)it.next(); if (att.getName() == "Net") { setNet((Space)att.getValue()); } else if(att.getName() == "Framewidth") { setFrameWidth(((Double)att.getValue()).doubleValue()); } } } /** * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() */ public String getGeneralName() { return "Net Facade Modellor"; } /** *@return the space */ public Space getSpace() { return space; } /** * Set the space of this modellor * @param space the space */ public void setSpace(Space space) { this.space = space; } /** * get the net of the modellor * @return the net of this modellor */ public Net getNet() { return net; } /** * Set the net of this modellor * @param net the net */ public void setNet(Space net) { this.net = (Net)net; space.add(net); } /** * Gets the framewidth of the facade * @return the frameWidth */ public double getFrameWidth() { return frameWidth; } /** * Sets the framewidth of the facade * @param frameWidth the framewidth */ public void setFrameWidth(double frameWidth) { this.frameWidth = frameWidth; } /** * Regenerate the entire facade, deleting what ever was there before. */ private void regenerate() { space.setVertices(new HashMap()); space.setEdges(new HashMap()); space.setSurfaces(new HashMap()); createFacade(net); } /** * Creates a facade from a net. * @param net the net */ private void createFacade(Net net) { if (net != null) { Iterator fields = net.getSurfaces().iterator(); while (fields.hasNext()) { Surface field = (Surface)fields.next(); Surface fcopy = field.copyall(space); Set sides = new HashSet(); fcopy.extrude(depth, sides); } } } /** * Creates a net the size of a suface. * @param front the front surface * @return a new net */ private Net createNet(Surface front) { Net n = new Net("Facade net"); if (front != null) { Surface s = front.copyall(n); } return n; } /** * gets the front surface for the facade * @return front surface */ public Surface getFront() { return front; } /** * Sets the front surface of the facade * @param front the front surface */ public void setFront(Surface front) { this.front = front; } } |
|
From: Nordholt <nor...@us...> - 2006-11-28 16:18:29
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14809/src/net/sourceforge/bprocessor/facade Modified Files: FacadeMain.java Log Message: added facade modellor using nets Index: FacadeMain.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/FacadeMain.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FacadeMain.java 16 Nov 2006 14:26:57 -0000 1.4 --- FacadeMain.java 28 Nov 2006 16:18:18 -0000 1.5 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.facade.modellor.FacadeModellor; + import net.sourceforge.bprocessor.facade.modellor.NetFacadeModellor; import net.sourceforge.bprocessor.model.modellor.Modellor; *************** *** 24,27 **** --- 25,29 ---- public FacadeMain () { Modellor.registerModellor(new FacadeModellor()); + Modellor.registerModellor(new NetFacadeModellor()); } } |
|
From: Nordholt <nor...@us...> - 2006-11-28 16:16:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13609/src/net/sourceforge/bprocessor/model Modified Files: Space.java Added Files: Net.java Log Message: made nets into seperate class from space Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** Space.java 17 Nov 2006 15:47:28 -0000 1.103 --- Space.java 28 Nov 2006 16:15:44 -0000 1.104 *************** *** 664,671 **** edge.setId(id); } ! edges.put(id, edge); ! if (level == NET_LEVEL) { ! edge.setStrippled(true); ! } edge.setOwner(this); } else { --- 664,668 ---- edge.setId(id); } ! edges.put(id, edge); edge.setOwner(this); } else { --- NEW FILE: Net.java --- //--------------------------------------------------------------------------------- // $Id: Net.java,v 1.1 2006/11/28 16:15:45 nordholt 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 org.apache.log4j.Logger; /** * The B-Net class * */ public class Net extends Space { /** The logger */ private static Logger log = Logger.getLogger(Net.class); /** * Generic constructor */ public Net() { super(); } /** * Constructor with name * @param name of the net */ public Net(String name) { super(name, Space.FUNCTIONAL, Space.NET_LEVEL, true); } /** * adding edges to the net * @param e the edge to add */ public void add(Edge e) { super.add(e); e.setStrippled(true); } } |
|
From: Nordholt <nor...@us...> - 2006-11-28 16:16:01
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13623/src/net/sourceforge/bprocessor/gui/actions Modified Files: CreateNetActionListener.java Log Message: made nets into seperate class from space Index: CreateNetActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateNetActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CreateNetActionListener.java 6 Nov 2006 16:27:57 -0000 1.2 --- CreateNetActionListener.java 28 Nov 2006 16:15:49 -0000 1.3 *************** *** 10,13 **** --- 10,14 ---- import java.awt.event.ActionListener; + import net.sourceforge.bprocessor.model.Net; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; *************** *** 28,32 **** */ public void actionPerformed(ActionEvent arg0) { ! Space net = new Space("B-net", Space.CONSTRUCTION, Space.NET_LEVEL, true); Space active = Project.getInstance().getActiveSpace(); active.add(net); --- 29,33 ---- */ public void actionPerformed(ActionEvent arg0) { ! Space net = new Net("B-net"); Space active = Project.getInstance().getActiveSpace(); active.add(net); |
|
From: rimestad <rim...@us...> - 2006-11-28 15:40:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31042/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: fixed the inconsistence of the active coordinatesystems size Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -d -r1.163 -r1.164 *** View.java 17 Nov 2006 15:47:33 -0000 1.163 --- View.java 28 Nov 2006 15:40:02 -0000 1.164 *************** *** 1235,1238 **** --- 1235,1239 ---- gl.glPushMatrix(); transformTo(active); + dist = v.distance(Project.getInstance().getActiveCoordinateSystem().center()) * scale; drawGeneralConstructor(Project.getInstance().getActiveCoordinateSystem(), dist, true, OBJECTS); |
|
From: rimestad <rim...@us...> - 2006-11-28 15:39:36
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31012/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: added transforms to the space tree Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** GenericTreeView.java 28 Nov 2006 10:07:40 -0000 1.65 --- GenericTreeView.java 28 Nov 2006 15:39:35 -0000 1.66 *************** *** 22,25 **** --- 22,26 ---- import java.util.Map; import java.util.Set; + import java.util.Stack; import java.awt.event.ActionEvent; *************** *** 533,536 **** --- 534,541 ---- ContainerNode cn = new ConstructorContainer("Constructors", space.getConstructors()); add(cn); + ContainerNode tc = + new TransformationContainer("Transformations", space.getTransformations().stack()); + tc.update(space.getTransformations().stack()); + add(tc); } if (space.getModellor() != null) { *************** *** 555,571 **** if (s.isContainer()) { ((GenericNode)getChildAt(3)).update(s.getConstructors()); ! } ! if (s.getModellor() != null) { ! if (getChildCount() == 5) { ! ((GenericNode)getChildAt(4)).update(s.getModellor()); } else { ! add(new ModellorNode(s.getModellor())); ! model.nodesWereInserted(this, new int[]{4}); ! } ! } else { ! if (getChildCount() == 5) { ! TreeNode node = getChildAt(4); ! remove(4); ! model.nodesWereRemoved(this, new int[]{4}, new Object[]{node}); } } --- 560,577 ---- if (s.isContainer()) { ((GenericNode)getChildAt(3)).update(s.getConstructors()); ! ((GenericNode)getChildAt(4)).update(s.getTransformations().stack()); ! if (s.getModellor() != null) { ! if (getChildCount() == 6) { ! ((GenericNode)getChildAt(5)).update(s.getModellor()); ! } else { ! add(new ModellorNode(s.getModellor())); ! model.nodesWereInserted(this, new int[]{5}); ! } } else { ! if (getChildCount() == 6) { ! TreeNode node = getChildAt(5); ! remove(5); ! model.nodesWereRemoved(this, new int[]{5}, new Object[]{node}); ! } } } *************** *** 1239,1242 **** --- 1245,1307 ---- /** + * ConstraintContainer + */ + public class TransformationContainer extends ContainerNode { + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor for ConstraintContainer + * @param name The name + * @param transforms The constraints + */ + public TransformationContainer(String name, Stack transforms) { + super(name, transforms); + update(transforms); + } + + /** + * Update the node with the given object + * @param o The object + */ + public void update(Object o) { + if (o instanceof Stack) { + content = (Stack) o; + if (((Stack)o).size() != this.getChildCount()) { + this.removeAllChildren(); + LinkedList elem = new LinkedList(); + Iterator iter = ((Stack)o).iterator(); + while (iter.hasNext()) { + elem.add(iter.next()); + } + this.insertChildren(elem); + model.nodeStructureChanged(this); + } + } else { + log.warn(userObject + " were called with " + o + " and not a list"); + } + } + + /** + * Insert the given object into the node + * @param elem the elements + */ + public void insertChildren(Collection elem) { + //insert + int[] ins = new int[elem.size()]; + int i = 0; + Iterator iter = elem.iterator(); + while (iter.hasNext()) { + this.add(new EntityNode(iter.next())); + ins[i] = this.getChildCount() - 1; + i++; + } + model.nodesWereInserted(this, ins); + } + } + + /** * Selection Listener */ |
|
From: rimestad <rim...@us...> - 2006-11-28 15:39:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30994/src/net/sourceforge/bprocessor/model Modified Files: Transform.java Log Message: added transforms to the space tree Index: Transform.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Transform.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Transform.java 19 Sep 2006 10:00:09 -0000 1.3 --- Transform.java 28 Nov 2006 15:39:28 -0000 1.4 *************** *** 24,26 **** --- 24,34 ---- */ public abstract Vertex transform(Vertex vertex); + + /** + * to string for a transform + * @return the string representation of the object + */ + public String toString() { + return getGeneralName(); + } } |
|
From: rimestad <rim...@us...> - 2006-11-28 10:53:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9174/src/net/sourceforge/bprocessor/gl/tool Modified Files: MoveTool.java ControlledMoveTool.java Log Message: Now the move tools react correctly on escape Index: ControlledMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledMoveTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ControlledMoveTool.java 26 Sep 2006 09:52:30 -0000 1.5 --- ControlledMoveTool.java 28 Nov 2006 10:53:11 -0000 1.6 *************** *** 276,282 **** */ public void cleanUp() { slideMap = null; direction = null; - super.cleanUp(); } } --- 276,282 ---- */ public void cleanUp() { + super.cleanUp(); slideMap = null; direction = null; } } Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** MoveTool.java 15 Nov 2006 09:53:17 -0000 1.73 --- MoveTool.java 28 Nov 2006 10:53:11 -0000 1.74 *************** *** 178,181 **** --- 178,182 ---- Project.getInstance().changed(vertices); Project.getInstance().checkpoint(); + start = null; cleanUp(); } *************** *** 235,238 **** --- 236,244 ---- */ public void cleanUp() { + current = start; + if (current != null) { + move(); + } + entities = new HashSet(); affected = new HashSet(); |
|
From: rimestad <rim...@us...> - 2006-11-28 10:07:43
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22938/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: removed log print and fixed the Geometry node name change... Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** GenericTreeView.java 21 Nov 2006 17:36:55 -0000 1.64 --- GenericTreeView.java 28 Nov 2006 10:07:40 -0000 1.65 *************** *** 895,902 **** if (o instanceof Space) { Space s = (Space)o; - if (s == updated) { - userObject = s; - model.nodeChanged(this); - } ((SurfaceContainer)this.getChildAt(0)).update(s.getSurfaces()); ((EdgeContainer)this.getChildAt(1)).update(s.getEdges()); --- 895,898 ---- *************** *** 1342,1350 **** */ public void update(Object object) { - log.info("changed"); updated = object; ! update(); ! updated = null; ! //changed(); } } --- 1338,1343 ---- */ public void update(Object object) { updated = object; ! changed(); } } |
|
From: rimestad <rim...@us...> - 2006-11-28 10:06:56
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22557/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: removed log print Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** Project.java 21 Nov 2006 17:43:30 -0000 1.97 --- Project.java 28 Nov 2006 10:06:55 -0000 1.98 *************** *** 204,208 **** */ public void changed(Object entity) { - log.info("Changed call on " + entity); Iterator iter = observers.iterator(); while (iter.hasNext()) { --- 204,207 ---- |
|
From: rimestad <rim...@us...> - 2006-11-28 10:06:44
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22539/src/net/sourceforge/bprocessor/model Modified Files: Translate.java Rotate.java AxisRotate.java Scale.java Persistence.java Log Message: fixed the persistence of transforms and made checkpoints when they are altered. Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Persistence.java 21 Nov 2006 17:42:17 -0000 1.25 --- Persistence.java 28 Nov 2006 10:06:34 -0000 1.26 *************** *** 60,63 **** --- 60,64 ---- import java.io.InputStream; import java.io.OutputStream; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; *************** *** 246,252 **** { Iterator iter = xml.getTransforms().iterator(); while (iter.hasNext()) { TransformType current = (TransformType) iter.next(); ! space.addTransform(internalizeTransformation(current, xmls)); } } --- 247,257 ---- { Iterator iter = xml.getTransforms().iterator(); + ArrayList trans = new ArrayList(); while (iter.hasNext()) { TransformType current = (TransformType) iter.next(); ! trans.add(internalizeTransformation(current, new HashSet())); ! } ! for (int i = trans.size() - 1; i >= 0; i--) { ! space.addTransform((Transform)trans.get(i)); } } *************** *** 785,789 **** while (iter.hasNext()) { Transform t = (Transform)iter.next(); ! xml.getTransforms().add(externalizeTransformation(t, map)); } } --- 790,794 ---- while (iter.hasNext()) { Transform t = (Transform)iter.next(); ! xml.getTransforms().add(externalizeTransformation(t, new HashMap())); } } Index: Rotate.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Rotate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Rotate.java 13 Oct 2006 15:54:59 -0000 1.2 --- Rotate.java 28 Nov 2006 10:06:34 -0000 1.3 *************** *** 108,111 **** --- 108,112 ---- } Project.getInstance().changed(Project.getInstance()); + Project.getInstance().checkpoint(); } Index: Scale.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Scale.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Scale.java 11 Oct 2006 14:05:16 -0000 1.3 --- Scale.java 28 Nov 2006 10:06:34 -0000 1.4 *************** *** 108,111 **** --- 108,112 ---- } Project.getInstance().changed(Project.getInstance()); + Project.getInstance().checkpoint(); } Index: Translate.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Translate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Translate.java 27 Sep 2006 08:36:25 -0000 1.2 --- Translate.java 28 Nov 2006 10:06:34 -0000 1.3 *************** *** 109,112 **** --- 109,113 ---- } Project.getInstance().changed(Project.getInstance()); + Project.getInstance().checkpoint(); } Index: AxisRotate.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/AxisRotate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AxisRotate.java 2 Oct 2006 06:10:10 -0000 1.2 --- AxisRotate.java 28 Nov 2006 10:06:34 -0000 1.3 *************** *** 132,135 **** --- 132,136 ---- } Project.getInstance().changed(Project.getInstance()); + Project.getInstance().checkpoint(); } |
|
From: Nordholt <nor...@us...> - 2006-11-26 22:15:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8513/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java PanStrategy.java Log Message: removed changed calls from camera some camera movements. (seemed unneeded) Index: PanStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PanStrategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PanStrategy.java 21 Jun 2006 10:26:33 -0000 1.1 --- PanStrategy.java 26 Nov 2006 22:15:15 -0000 1.2 *************** *** 84,88 **** first.getY() - second.getY(), first.getZ() - second.getZ()}); - Project.getInstance().changed(c); x = e.getX(); y = e.getY(); --- 84,87 ---- Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** AbstractTool.java 10 Oct 2006 13:49:31 -0000 1.104 --- AbstractTool.java 26 Nov 2006 22:15:15 -0000 1.105 *************** *** 42,46 **** private static Logger log = Logger.getLogger(AbstractTool.class); ! /** minimum drag length */ private static final int MIN_DRAG_LENGTH = 5; --- 42,46 ---- private static Logger log = Logger.getLogger(AbstractTool.class); ! /** The minimum drag length */ private static final int MIN_DRAG_LENGTH = 5; *************** *** 159,163 **** cam.zoomin(); } - Project.getInstance().changed(cam); glv.repaint(false); } --- 159,162 ---- |
|
From: Nordholt <nor...@us...> - 2006-11-26 22:14:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7601/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: added progressbar to the splash screen! (updates a little to fast to see though) Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** GLView.java 26 Sep 2006 09:52:30 -0000 1.42 --- GLView.java 26 Nov 2006 22:13:51 -0000 1.43 *************** *** 68,71 **** --- 68,72 ---- glCap.setHardwareAccelerated(true); glc = GLDrawableFactory.getFactory().createGLCanvas(glCap); + GUI.getInstance().incrementPB(); JPanel jp = new JPanel(); *************** *** 74,77 **** --- 75,79 ---- jp.setMinimumSize(new Dimension(320, 240)); jp.setPreferredSize(new Dimension(640, 480)); + GUI.getInstance().incrementPB(); JPanel lengthPanel = new JPanel(); *************** *** 81,84 **** --- 83,87 ---- lengthPanel.add(lengthField, BorderLayout.CENTER); jp.add(lengthPanel, BorderLayout.SOUTH); + GUI.getInstance().incrementPB(); tool = ToolFactory.getFactory(this).getDefault(); *************** *** 86,90 **** view = new View(this); glc.addGLEventListener(view); ! glc.addMouseListener(tool); --- 89,93 ---- view = new View(this); glc.addGLEventListener(view); ! GUI.getInstance().incrementPB(); glc.addMouseListener(tool); *************** *** 94,97 **** --- 97,101 ---- glc.addMouseListener(this); GUI.getInstance().registerPanel(jp, GUI.SPLIT_MIDDLE); + GUI.getInstance().incrementPB(); JMenu colorMenu = new JMenu("GL Colors"); *************** *** 109,112 **** --- 113,117 ---- JMenuItem defaultItem = new JMenuItem("Default"); defaultItem.addActionListener(colorMenuListener); + GUI.getInstance().incrementPB(); colorMenu.add(gridItem); *************** *** 116,129 **** colorMenu.add(noneItem); colorMenu.add(defaultItem); GUI.getInstance().addMenu(colorMenu); glc.setAutoSwapBufferMode(false); repaint(); SwingUtilities.invokeLater ( new Runnable() { public void run() { GUI.getInstance().present(); ! } } ); --- 121,138 ---- colorMenu.add(noneItem); colorMenu.add(defaultItem); + GUI.getInstance().incrementPB(); GUI.getInstance().addMenu(colorMenu); + GUI.getInstance().incrementPB(); glc.setAutoSwapBufferMode(false); repaint(); + GUI.getInstance().incrementPB(); SwingUtilities.invokeLater ( new Runnable() { public void run() { + GUI.getInstance().incrementPB(); GUI.getInstance().present(); ! } } ); |