bprocessor-commit Mailing List for B-processor (Page 134)
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: rimestad <rim...@us...> - 2006-02-15 11:10:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19616/src/net/sourceforge/bprocessor/gl/tool Modified Files: MoveTool.java Log Message: Move tool have to call change propagation on the moved elements Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** MoveTool.java 11 Feb 2006 18:15:14 -0000 1.35 --- MoveTool.java 15 Feb 2006 11:10:39 -0000 1.36 *************** *** 512,515 **** --- 512,516 ---- } } + Project.getInstance().changed(sel); } |
From: Michael L. <he...@us...> - 2006-02-14 14:10:37
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7918/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Renderer class added Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GenericTreeView.java 8 Feb 2006 10:10:11 -0000 1.13 --- GenericTreeView.java 14 Feb 2006 14:10:28 -0000 1.14 *************** *** 16,19 **** --- 16,20 ---- import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; + import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; *************** *** 36,39 **** --- 37,52 ---- public class GenericTreeView extends TreeView implements Observer { + /** + * Renderer + */ + public class Renderer extends DefaultTreeCellRenderer { + /** + * Constructor + */ + public Renderer() { + super(); + } + } + /** Show numbers of elements in display-string of container-nodes */ private static final boolean SHOW_COUNTERS = false; |
From: rimestad <rim...@us...> - 2006-02-14 11:56:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28252/src/net/sourceforge/bprocessor/gl/tool Modified Files: SelectTool.java Log Message: Added drag selection with the left mousebutton, and fixed the selectionBuffer so that if the selection were too big to fit in the selectionBuffer the size will double and it will try again, that will keep going forever, so some kind of valve have to be added if GL starts to redisplay all the time Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** SelectTool.java 1 Feb 2006 09:00:11 -0000 1.53 --- SelectTool.java 14 Feb 2006 11:56:21 -0000 1.54 *************** *** 9,12 **** --- 9,14 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.ClippingPlane; + import net.sourceforge.bprocessor.gl.view.Transformation; + import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Edge; *************** *** 24,28 **** --- 26,33 ---- import javax.swing.JMenuItem; + import java.util.ArrayList; + import java.util.HashSet; import java.util.Iterator; + import java.util.List; import org.apache.log4j.Logger; *************** *** 35,38 **** --- 40,55 ---- private static Logger log = Logger.getLogger(SelectTool.class); + /** Tempoary vertexes for multiple selection */ + private Vertex first, last, temp1, temp2; + + /** Tempoary edges for multiple selection */ + private Edge e1, e2, e3, e4; + + /** The drag box */ + private HashSet box; + + /** Telling if it were a multiple selection */ + private boolean multipleSelection = false; + /** * The constructor *************** *** 42,45 **** --- 59,76 ---- public SelectTool(GLView glv, Cursor cursor) { super(glv, cursor); + e1 = new Edge(); + e1.setConstructor(true); + e2 = new Edge(); + e2.setConstructor(true); + e3 = new Edge(); + e3.setConstructor(true); + e4 = new Edge(); + e4.setConstructor(true); + + box = new HashSet(); + box.add(e1); + box.add(e2); + box.add(e3); + box.add(e4); } *************** *** 58,61 **** --- 89,107 ---- */ protected void dragged(MouseEvent e) { + if (!multipleSelection) { + multipleSelection = true; + + } + Transformation t = glv.getView().transformation(); + last = t.unProject(new Vertex(e.getX(), View.getHeight() - e.getY(), 0.001)); + temp1 = t.unProject(new Vertex(e.getX(), View.getHeight() - pressPos[1], 0.001)); + temp2 = t.unProject(new Vertex(pressPos[0], View.getHeight() - e.getY(), 0.001)); + e1.setTo(temp1); + e2.setFrom(temp1); + e2.setTo(last); + e3.setFrom(last); + e3.setTo(temp2); + e4.setFrom(temp2); + displayConstructors(box); findTarget(e); glv.getView().makeTarget(target); *************** *** 67,71 **** */ protected void pressed(MouseEvent e) { ! findTarget(e); if (e.getButton() == MouseEvent.BUTTON3) { if (target != null) { --- 113,121 ---- */ protected void pressed(MouseEvent e) { ! // for multiple selection ! Transformation t = glv.getView().transformation(); ! first = t.unProject(new Vertex(e.getX(), View.getHeight() - e.getY(), 0.001)); ! e1.setFrom(first); ! e4.setTo(first); if (e.getButton() == MouseEvent.BUTTON3) { if (target != null) { *************** *** 144,148 **** * @param e The MouseEvent */ ! protected void released(MouseEvent e) { } /** --- 194,208 ---- * @param e The MouseEvent */ ! protected void released(MouseEvent e) { ! if (multipleSelection) { ! selection.clear(); ! clearConstructors(box); ! List l = glv.getView().getObjectInArea(pressPos[0], pressPos[1], ! e.getX(), e.getY()); ! glv.getView().makeTarget(null); ! selection.addAll(l); ! multipleSelection = false; ! } ! } /** *************** *** 154,165 **** e.getKeyCode() == KeyEvent.VK_BACK_SPACE) { Iterator it = selection.iterator(); while (it.hasNext()) { Object selected = it.next(); if (selected instanceof Surface) { ! Project.getInstance().delete((Surface)selected); } else if (selected instanceof Edge) { ! Project.getInstance().delete((Edge)selected); } else if (selected instanceof Vertex) { ! Project.getInstance().delete((Vertex) selected); } else if (selected instanceof ClippingPlane) { glv.getView().removeClippingPlane((ClippingPlane)selected); --- 214,228 ---- e.getKeyCode() == KeyEvent.VK_BACK_SPACE) { Iterator it = selection.iterator(); + List edges = new ArrayList(); + List vertices = new ArrayList(); + List surfaces = new ArrayList(); while (it.hasNext()) { Object selected = it.next(); if (selected instanceof Surface) { ! surfaces.add((Surface)selected); } else if (selected instanceof Edge) { ! edges.add((Edge)selected); } else if (selected instanceof Vertex) { ! vertices.add((Vertex) selected); } else if (selected instanceof ClippingPlane) { glv.getView().removeClippingPlane((ClippingPlane)selected); *************** *** 168,171 **** --- 231,237 ---- selection.clear(); glv.getView().makeTarget(null); + Project.getInstance().delete(surfaces); + Project.getInstance().delete(edges); + Project.getInstance().delete(vertices); } else { super.keyPressed(e); |
From: rimestad <rim...@us...> - 2006-02-14 11:56:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28252/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Added drag selection with the left mousebutton, and fixed the selectionBuffer so that if the selection were too big to fit in the selectionBuffer the size will double and it will try again, that will keep going forever, so some kind of valve have to be added if GL starts to redisplay all the time Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** View.java 11 Feb 2006 18:00:00 -0000 1.60 --- View.java 14 Feb 2006 11:56:21 -0000 1.61 *************** *** 209,212 **** --- 209,218 ---- protected IntBuffer selectBuffer; + /** The size of the selection buffer */ + protected int selectionLength = 256; + + /** The size of the selection box */ + protected int[] selectionSize = new int[]{6, 6}; + /** The objectTable used for assigning unique ID's during selection */ protected ArrayList objectTable; *************** *** 449,456 **** View.width = width; if (picking > 0) { ! //notice 512 is just some magic number for the size of the selectbuffer ! // TODO Catch overflow in select buffer ! selectBuffer = BufferUtils.newIntBuffer(512); ! gl.glSelectBuffer(512, selectBuffer); gl.glRenderMode(GL.GL_SELECT); hitdetection = true; --- 455,460 ---- View.width = width; if (picking > 0) { ! selectBuffer = BufferUtils.newIntBuffer(selectionLength); ! gl.glSelectBuffer(selectionLength, selectBuffer); gl.glRenderMode(GL.GL_SELECT); hitdetection = true; *************** *** 518,521 **** --- 522,534 ---- gl.glFlush(); hits = gl.glRenderMode(GL.GL_RENDER); + if (hits < 0) { + // There were overflow in the selctionBuffer double the buffer and try again + selectionLength *= 2; + picking = 10; + glv.repaint(true); + } + if (log.isDebugEnabled()) { + log.debug("Hits: " + hits); + } } else { gld.swapBuffers(); *************** *** 1794,1797 **** --- 1807,1864 ---- /** + * find all geometry affected by the selection + * @return All geometry in the selection + */ + private List getAllGeometryInSelection() { + List selection = new ArrayList(); + int bufferOffset = 0; + int names = 0; + + for (int i = 0; i < hits; i++) { + names = selectBuffer.get(bufferOffset); + bufferOffset += 3; + if (names > 0) { + int tar = selectBuffer.get(bufferOffset); + Object current = getName(tar); + selection.add(current); + bufferOffset += names; + } + } + return selection; + } + + /** + * Gets id of the objects in a given area with corner x1,y1 and opposite corner x2,y2 + * @param x1 the x coordinate in the first corner + * @param y1 the y coordinate in the first corner + * @param x2 the x coordinate in the second corner + * @param y2 the y coordinate in the second corner + * @return The objects in the area + */ + public List getObjectInArea(double x1, double y1, double x2, double y2) { + double x = (x1 - x2); + double y = (y1 - y2); + // save default selection box + int[] tempsize = selectionSize; + // set new selection size + selectionSize = new int[] {(int)Math.abs(x) < 6 ? 6 : (int)Math.abs(x), + (int)Math.abs(y) < 6 ? 6 : (int)Math.abs(y)}; + + // Do selection on vertices + this.x = x1 - (x / 2); + this.y = y1 - (y / 2); + picking = 10; + selectMode = ALL; + int lengthTemp = selectionLength; + selectionLength = 2056; + glv.repaint(true); + List selection = getAllGeometryInSelection(); + selectionLength = lengthTemp; + //restore default selection box + selectionSize = tempsize; + return selection; + } + + /** * Gets id of any Edges under a point. For use in selection. * @param x the x coordinate of the point in mouse coordinates *************** *** 2109,2113 **** if (picking > 0) { int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, 6, 6, viewport); } --- 2176,2180 ---- if (picking > 0) { int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, selectionSize[0], selectionSize[1], viewport); } |
From: rimestad <rim...@us...> - 2006-02-14 11:56:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28279/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Added drag selection with the left mousebutton, and fixed the selectionBuffer so that if the selection were too big to fit in the selectionBuffer the size will double and it will try again, that will keep going forever, so some kind of valve have to be added if GL starts to redisplay all the time Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Project.java 11 Feb 2006 18:04:24 -0000 1.37 --- Project.java 14 Feb 2006 11:56:25 -0000 1.38 *************** *** 130,135 **** */ private void addCams() { ! Camera cam0 = Camera.create(Camera.VIEW_3D); // The starting cam cam0.setId(new Long(cameraId++)); Camera cam1 = Camera.create(Camera.VIEW_3D); // Reset to 3D position cam1.setId(new Long(cameraId++)); --- 130,136 ---- */ private void addCams() { ! Camera cam0 = Camera.create(Camera.VIEW_3D); // The starting cam (copy of 3d cam) cam0.setId(new Long(cameraId++)); + cameras.put(cam0.getId(), cam0); Camera cam1 = Camera.create(Camera.VIEW_3D); // Reset to 3D position cam1.setId(new Long(cameraId++)); *************** *** 148,151 **** --- 149,171 ---- /** + * remove all elements in the collection from the project + * @param c the collection of elements + */ + public void delete(Collection c) { + Iterator iter = c.iterator(); + while (iter.hasNext()) { + Object next = iter.next(); + if (next instanceof Edge) { + mesh.delete((Edge)next); + } else if (next instanceof Surface) { + mesh.delete((Surface)next); + } else if (next instanceof Vertex) { + mesh.delete((Vertex)next); + } + } + changed(this); + } + + /** * Add a constraint * @param constraint The constraint to add |
From: Michael L. <he...@us...> - 2006-02-13 21:16:56
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/constraints In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28219/src/net/sourceforge/bprocessor/model/constraints Modified Files: OffsetConstraint.java Log Message: LayoutManager added to attributeview OffsetConstraint implements Parametric Index: OffsetConstraint.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/constraints/OffsetConstraint.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OffsetConstraint.java 30 Jan 2006 15:20:31 -0000 1.1 --- OffsetConstraint.java 13 Feb 2006 21:16:47 -0000 1.2 *************** *** 10,28 **** import java.util.HashSet; import java.util.Iterator; import java.util.Set; import net.sourceforge.bprocessor.model.Constraint; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** ! * @author henryml ! * ! * TODO To change the template for this generated type comment go to ! * Window - Preferences - Java - Code Style - Code Templates */ ! public class OffsetConstraint extends Constraint { /** The offset */ private double offset; --- 10,29 ---- import java.util.HashSet; import java.util.Iterator; + import java.util.LinkedList; + import java.util.List; import java.util.Set; + import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Constraint; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Parametric; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** ! * OffsetConstraint */ ! public class OffsetConstraint extends Constraint implements Parametric { /** The offset */ private double offset; *************** *** 93,98 **** Set vertices = new HashSet(); - // List vertices = slave.getVertices(); - // vertices.remove(0); collect(slave, vertices); Iterator iter = vertices.iterator(); --- 94,97 ---- *************** *** 119,121 **** --- 118,160 ---- } } + + /** + * Set attributes + * @param attributes The attributes + */ + public void setAttributes(List attributes) { + Iterator iter = attributes.iterator(); + while (iter.hasNext()) { + Attribute current = (Attribute) iter.next(); + if (current.getName().equals("Offset")) { + Double offset = (Double) current.getValue(); + this.offset = offset.doubleValue(); + update(this); + Surface slave = (Surface) getSlave(); + slave.changed(); + } + } + } + + /** + * Get attributes + * @return The attributes + */ + public List getAttributes() { + LinkedList attributes = new LinkedList(); + Surface master = (Surface) getMaster(); + Surface slave = (Surface) getSlave(); + attributes.add(new Attribute("Master", master.getName())); + attributes.add(new Attribute("Slave", slave.getName())); + attributes.add(new Attribute("Offset", new Double(offset))); + return attributes; + } + + /** + * Return general name + * @return General name + */ + public String getGeneralName() { + return "Offset Constraint"; + } } |
From: Michael L. <he...@us...> - 2006-02-13 21:16:56
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28219/src/net/sourceforge/bprocessor/model Modified Files: LayerModellor.java Log Message: LayoutManager added to attributeview OffsetConstraint implements Parametric Index: LayerModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/LayerModellor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LayerModellor.java 8 Feb 2006 10:10:14 -0000 1.3 --- LayerModellor.java 13 Feb 2006 21:16:47 -0000 1.4 *************** *** 78,82 **** while (iter.hasNext()) { Attribute current = (Attribute) iter.next(); ! if (current.getName().equals("Layer Thickness")) { Double thickness = (Double) current.getValue(); distance = thickness.doubleValue(); --- 78,82 ---- while (iter.hasNext()) { Attribute current = (Attribute) iter.next(); ! if (current.getName().equals("Thickness")) { Double thickness = (Double) current.getValue(); distance = thickness.doubleValue(); *************** *** 92,104 **** public List getAttributes() { LinkedList attributes = new LinkedList(); ! attributes.add(new Attribute("Element Name", "Layer 1")); ! attributes.add(new Attribute("Element Classification", "????")); ! attributes.add(new Attribute("Element Specification", "????")); attributes.add(new Attribute("Surface", surface.getName())); ! attributes.add(new Attribute("Layer Thickness", new Double(distance))); ! attributes.add(new Attribute("Layer Top Offset", new Double(0))); ! attributes.add(new Attribute("Layer Bottom Offset", new Double(0))); ! attributes.add(new Attribute("Next Layer", "NONE")); ! attributes.add(new Attribute("Relation", "????")); return attributes; } --- 92,102 ---- public List getAttributes() { LinkedList attributes = new LinkedList(); ! attributes.add(new Attribute("Name", "Layer 1")); ! attributes.add(new Attribute("Classification", "?")); ! attributes.add(new Attribute("Specification", "?")); attributes.add(new Attribute("Surface", surface.getName())); ! attributes.add(new Attribute("Thickness", new Double(distance))); ! attributes.add(new Attribute("Top Offset", new Double(0))); ! attributes.add(new Attribute("Bottom Offset", new Double(0))); return attributes; } |
From: Michael L. <he...@us...> - 2006-02-13 21:16:50
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28158/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java StringAttribute.java GenericPanel.java Log Message: LayoutManager added to attributeview OffsetConstraint implements Parametric Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StringAttribute.java 11 Feb 2006 18:02:40 -0000 1.4 --- StringAttribute.java 13 Feb 2006 21:16:39 -0000 1.5 *************** *** 60,66 **** 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)); this.add(column); --- 60,68 ---- header.add(Box.createHorizontalGlue()); header.add(label); ! //column.add(Box.createHorizontalStrut(60)); ! column.add(Box.createRigidArea(new Dimension(70, 3))); column.add(header); ! column.add(Box.createRigidArea(new Dimension(70, 3))); ! //column.add(Box.createHorizontalStrut(60)); column.setMaximumSize(new Dimension(60, Short.MAX_VALUE)); this.add(column); *************** *** 77,80 **** --- 79,92 ---- /** + * Round + * @param value The value + * @return The rounded value + */ + protected double round(double value) { + int i = (int) (value * 100000); + return ((double) i) / 100000.0; + } + + /** * Create a label for the * @param key The key *************** *** 142,150 **** s = (String)value; } else if (value instanceof Double) { ! s = ((Double)value).toString(); ! int index = s.indexOf('.'); ! if (index > 0) { ! s = s.substring(0, index + 4 > s.length() ? s.length() - 1 : index + 4); ! } } JLabel valueLabel = new JLabel(s); --- 154,159 ---- s = (String)value; } else if (value instanceof Double) { ! double rounded = round(((Double) value).doubleValue()); ! s = Double.toString(rounded); } JLabel valueLabel = new JLabel(s); *************** *** 167,171 **** s = (String)value; } else if (value instanceof Double) { ! s = ((Double) value).toString(); } JTextField valueEditor = new JTextField(s); --- 176,181 ---- s = (String)value; } else if (value instanceof Double) { ! double rounded = round(((Double) value).doubleValue()); ! s = Double.toString(rounded); } JTextField valueEditor = new JTextField(s); Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GenericPanel.java 11 Feb 2006 18:02:40 -0000 1.5 --- GenericPanel.java 13 Feb 2006 21:16:39 -0000 1.6 *************** *** 60,71 **** attributes = param.getAttributes(); generateContent(attributes, content); ! Box b = Box.createHorizontalBox(); JLabel label = new JLabel(" - " + param.getGeneralName() + " - "); label.setFont(AttributeView.FONT_HEADER); ! b.add(Box.createHorizontalGlue()); ! b.add(label); ! b.add(Box.createHorizontalGlue()); ! add(BorderLayout.NORTH, b); add(BorderLayout.CENTER, this.content); addMouseListener(this); --- 60,74 ---- attributes = param.getAttributes(); generateContent(attributes, content); ! Box title = Box.createVerticalBox(); ! Box header = Box.createHorizontalBox(); JLabel label = new JLabel(" - " + param.getGeneralName() + " - "); label.setFont(AttributeView.FONT_HEADER); ! header.add(Box.createHorizontalGlue()); ! header.add(label); ! header.add(Box.createHorizontalGlue()); ! title.add(header); ! title.add(Box.createVerticalStrut(7)); ! add(BorderLayout.NORTH, title); add(BorderLayout.CENTER, this.content); addMouseListener(this); Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** AttributeView.java 11 Feb 2006 18:02:40 -0000 1.34 --- AttributeView.java 13 Feb 2006 21:16:39 -0000 1.35 *************** *** 45,51 **** */ public AttributeView() { ! super(); ! setMinimumSize(new Dimension(120, 240)); ! setPreferredSize(new Dimension(120, 240)); Selection.primary().addObserver(this); Project.getInstance().addObserver(this); --- 45,51 ---- */ public AttributeView() { ! super(new BorderLayout()); ! setMinimumSize(new Dimension(140, 240)); ! setPreferredSize(new Dimension(140, 240)); Selection.primary().addObserver(this); Project.getInstance().addObserver(this); *************** *** 58,64 **** Selection selection = Selection.primary(); if (object == selection) { if (selection.size() == 1) { Object o = selection.iterator().next(); ! this.removeAll(); if (o instanceof Parametric) { this.add(BorderLayout.NORTH, new GenericPanel((Parametric)o)); --- 58,65 ---- Selection selection = Selection.primary(); if (object == selection) { + this.removeAll(); if (selection.size() == 1) { Object o = selection.iterator().next(); ! if (o instanceof Parametric) { this.add(BorderLayout.NORTH, new GenericPanel((Parametric)o)); *************** *** 66,73 **** AttributePanel ap = new AttributePanel(); ap.display(o); ! this.add(ap); } - } else { - this.removeAll(); } } else { --- 67,72 ---- AttributePanel ap = new AttributePanel(); ap.display(o); ! this.add(BorderLayout.CENTER, ap); } } } else { |
From: Nikolaj B. <nbr...@us...> - 2006-02-13 12:37:33
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3194/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileSaveActionListener.java FileNewActionListener.java FileLoadActionListener.java FileCloseActionListener.java FileSaveAsActionListener.java Log Message: Added auto completion of extension. So files not allready containing a . will now get the .bp extension. Index: FileSaveActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveActionListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FileSaveActionListener.java 8 Feb 2006 10:13:20 -0000 1.4 --- FileSaveActionListener.java 13 Feb 2006 12:37:22 -0000 1.5 *************** *** 46,50 **** state == JFileChooser.APPROVE_OPTION) { try { ! PersistenceManager.save(file); Project.getInstance().setSavePath(file.getAbsolutePath()); Project.getInstance().setDefaultPath(file.getAbsolutePath()); --- 46,54 ---- state == JFileChooser.APPROVE_OPTION) { try { ! if (file.getName().lastIndexOf('.') != -1) { ! PersistenceManager.save(file); ! } else { ! PersistenceManager.save(new File(file.getCanonicalFile() + ".bp")); ! } Project.getInstance().setSavePath(file.getAbsolutePath()); Project.getInstance().setDefaultPath(file.getAbsolutePath()); Index: FileLoadActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileLoadActionListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FileLoadActionListener.java 8 Feb 2006 10:13:20 -0000 1.4 --- FileLoadActionListener.java 13 Feb 2006 12:37:23 -0000 1.5 *************** *** 56,60 **** try { Project.getInstance().setDefaultPath(file.getAbsolutePath()); ! PersistenceManager.save(file); JFileChooser loadChooser = new JFileChooser(Project.getInstance().getDefaultPath()); --- 56,64 ---- try { Project.getInstance().setDefaultPath(file.getAbsolutePath()); ! if (file.getName().lastIndexOf('.') != -1) { ! PersistenceManager.save(file); ! } else { ! PersistenceManager.save(new File(file.getCanonicalFile() + ".bp")); ! } JFileChooser loadChooser = new JFileChooser(Project.getInstance().getDefaultPath()); Index: FileSaveAsActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveAsActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileSaveAsActionListener.java 8 Feb 2006 10:13:20 -0000 1.2 --- FileSaveAsActionListener.java 13 Feb 2006 12:37:23 -0000 1.3 *************** *** 45,49 **** Project.getInstance().setDefaultPath(file.getAbsolutePath()); Project.getInstance().setSavePath(file.getAbsolutePath()); ! PersistenceManager.save(file); Project.getInstance().makeClean(); } catch (Exception ex) { --- 45,53 ---- Project.getInstance().setDefaultPath(file.getAbsolutePath()); Project.getInstance().setSavePath(file.getAbsolutePath()); ! if (file.getName().lastIndexOf('.') != -1) { ! PersistenceManager.save(file); ! } else { ! PersistenceManager.save(new File(file.getCanonicalFile() + ".bp")); ! } Project.getInstance().makeClean(); } catch (Exception ex) { Index: FileNewActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileNewActionListener.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileNewActionListener.java 8 Feb 2006 10:13:20 -0000 1.5 --- FileNewActionListener.java 13 Feb 2006 12:37:23 -0000 1.6 *************** *** 58,62 **** state == JFileChooser.APPROVE_OPTION) { try { ! PersistenceManager.save(file); Project.getInstance().setDefaultPath(file.getAbsolutePath()); Selection.primary().clear(); --- 58,66 ---- state == JFileChooser.APPROVE_OPTION) { try { ! if (file.getName().lastIndexOf('.') != -1) { ! PersistenceManager.save(file); ! } else { ! PersistenceManager.save(new File(file.getCanonicalFile() + ".bp")); ! } Project.getInstance().setDefaultPath(file.getAbsolutePath()); Selection.primary().clear(); Index: FileCloseActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileCloseActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FileCloseActionListener.java 8 Feb 2006 10:13:20 -0000 1.3 --- FileCloseActionListener.java 13 Feb 2006 12:37:23 -0000 1.4 *************** *** 59,63 **** try { Project.getInstance().setDefaultPath(file.getAbsolutePath()); ! PersistenceManager.save(file); Selection.primary().clear(); Project.getInstance().clear(); --- 59,67 ---- try { Project.getInstance().setDefaultPath(file.getAbsolutePath()); ! if (file.getName().lastIndexOf('.') != -1) { ! PersistenceManager.save(file); ! } else { ! PersistenceManager.save(new File(file.getCanonicalFile() + ".bp")); ! } Selection.primary().clear(); Project.getInstance().clear(); |
From: Nikolaj B. <nbr...@us...> - 2006-02-13 07:58:39
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3749/src/net/sourceforge/bprocessor/gui/actions Modified Files: MyFileFilter.java Log Message: Small name fix Index: MyFileFilter.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/MyFileFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MyFileFilter.java 8 Feb 2006 10:13:20 -0000 1.1 --- MyFileFilter.java 13 Feb 2006 07:58:30 -0000 1.2 *************** *** 47,51 **** */ public String getDescription() { ! return "Bp files"; } } --- 47,51 ---- */ public String getDescription() { ! return "bprocessor files"; } } |
From: Nordholt <nor...@us...> - 2006-02-11 18:17:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10200 Modified Files: Vertex.java Log Message: preventing null pointer exception in getEdges method Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Vertex.java 11 Feb 2006 15:02:21 -0000 1.25 --- Vertex.java 11 Feb 2006 18:16:54 -0000 1.26 *************** *** 128,131 **** --- 128,134 ---- public Set getEdges() { Set result = new HashSet(); + if (getMesh() == null) { + return result; + } Collection edges = getMesh().getEdges(); Iterator iter = edges.iterator(); |
From: Nordholt <nor...@us...> - 2006-02-11 18:15:22
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9572 Modified Files: MoveTool.java Log Message: moving vertecies fixed Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** MoveTool.java 9 Feb 2006 15:10:18 -0000 1.34 --- MoveTool.java 11 Feb 2006 18:15:14 -0000 1.35 *************** *** 175,183 **** private void setupConstructors() { if (moveMode == AXIS_RESTRICTED) { ! if (target instanceof Vertex && !((Vertex)target).getEdges().isEmpty()) { ! moveConstructors = makeEdgeConstructors((Vertex)target); ! } else { ! moveConstructors = makeXYZConstructors(initial); ! } } else if (moveMode == FREE_SNAP) { moveConstructors = makeXYZConerConstructors(initial); --- 175,179 ---- private void setupConstructors() { if (moveMode == AXIS_RESTRICTED) { ! moveConstructors = makeXYZConstructors(initial); } else if (moveMode == FREE_SNAP) { moveConstructors = makeXYZConerConstructors(initial); |
From: Nordholt <nor...@us...> - 2006-02-11 18:14:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9175 Modified Files: ClippingPlane.java Log Message: clippingplane keeps it size if drawn past areas where it cuts nothing Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/ClippingPlane.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ClippingPlane.java 19 Dec 2005 07:51:30 -0000 1.6 --- ClippingPlane.java 11 Feb 2006 18:14:15 -0000 1.7 *************** *** 121,160 **** public void findCorners() { Collection c = findIntersections(); ! Iterator it = c.iterator(); ! double minX = Integer.MAX_VALUE; ! double minY = Integer.MAX_VALUE; ! double maxX = Integer.MIN_VALUE; ! double maxY = Integer.MIN_VALUE; ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! v = system.translate(v); ! if (v.getX() < minX) { ! minX = v.getX(); ! } ! if (v.getX() > maxX) { ! maxX = v.getX(); ! } ! if (v.getY() < minY) { ! minY = v.getY(); ! } ! if (v.getY() > maxY) { ! maxY = v.getY(); ! } } - Vertex v1 = new Vertex(minX - 1, minY - 1, 0.0); - Vertex v2 = new Vertex(minX - 1, maxY + 1, 0.0); - Vertex v3 = new Vertex(maxX + 1, maxY + 1, 0.0); - Vertex v4 = new Vertex(maxX + 1, minY - 1, 0.0); - v1 = system.unTranslate(v1); - v2 = system.unTranslate(v2); - v3 = system.unTranslate(v3); - v4 = system.unTranslate(v4); - corners = new ArrayList(); - corners.add(v1); - corners.add(v2); - corners.add(v3); - corners.add(v4); } ! /** * Getter for corners --- 121,178 ---- public void findCorners() { Collection c = findIntersections(); ! if (c.isEmpty()) { ! if (!corners.isEmpty()) { ! Vertex v1 = system.translate((Vertex)corners.get(0)); ! v1.setZ(0); ! Vertex v2 = system.translate((Vertex)corners.get(1)); ! v2.setZ(0); ! Vertex v3 = system.translate((Vertex)corners.get(2)); ! v3.setZ(0); ! Vertex v4 = system.translate((Vertex)corners.get(3)); ! v4.setZ(0); ! corners = new ArrayList(); ! corners.add(system.unTranslate(v1)); ! corners.add(system.unTranslate(v2)); ! corners.add(system.unTranslate(v3)); ! corners.add(system.unTranslate(v4)); ! } ! } else { ! Iterator it = c.iterator(); ! double minX = Integer.MAX_VALUE; ! double minY = Integer.MAX_VALUE; ! double maxX = Integer.MIN_VALUE; ! double maxY = Integer.MIN_VALUE; ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! v = system.translate(v); ! if (v.getX() < minX) { ! minX = v.getX(); ! } ! if (v.getX() > maxX) { ! maxX = v.getX(); ! } ! if (v.getY() < minY) { ! minY = v.getY(); ! } ! if (v.getY() > maxY) { ! maxY = v.getY(); ! } ! } ! Vertex v1 = new Vertex(minX - 1, minY - 1, 0.0); ! Vertex v2 = new Vertex(minX - 1, maxY + 1, 0.0); ! Vertex v3 = new Vertex(maxX + 1, maxY + 1, 0.0); ! Vertex v4 = new Vertex(maxX + 1, minY - 1, 0.0); ! v1 = system.unTranslate(v1); ! v2 = system.unTranslate(v2); ! v3 = system.unTranslate(v3); ! v4 = system.unTranslate(v4); ! corners = new ArrayList(); ! corners.add(v1); ! corners.add(v2); ! corners.add(v3); ! corners.add(v4); } } ! /** * Getter for corners |
From: rimestad <rim...@us...> - 2006-02-11 18:09:26
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6535/src/net/sourceforge/bprocessor/gui Modified Files: CameraView.java Log Message: Removed the set button in the cameratab in the tree view... working on making selection make camera change instead Index: CameraView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/CameraView.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CameraView.java 25 Jan 2006 14:54:04 -0000 1.2 --- CameraView.java 11 Feb 2006 18:09:15 -0000 1.3 *************** *** 52,61 **** add = new JButton("+"); remove = new JButton("-"); ! set = new JButton("Set"); add.addActionListener(this); remove.addActionListener(this); ! set.addActionListener(this); but.add(add); ! but.add(set); but.add(remove); this.setBackground(new Color(255, 255, 255)); --- 52,61 ---- add = new JButton("+"); remove = new JButton("-"); ! //set = new JButton("Set"); add.addActionListener(this); remove.addActionListener(this); ! //set.addActionListener(this); but.add(add); ! //but.add(set); but.add(remove); this.setBackground(new Color(255, 255, 255)); *************** *** 71,76 **** Project p = Project.getInstance(); if (which == add) { ! p.add(p.getCurrentCamera()); ! p.setCurrentCamera(new Camera(p.getCurrentCamera(), "default")); } else if (which == remove) { Object[] tar = Selection.primary().toArray(); --- 71,77 ---- Project p = Project.getInstance(); if (which == add) { ! Camera c = new Camera(p.getCurrentCamera(), "copy " + p.getCurrentCamera().getName()); ! p.add(c); ! p.setCurrentCamera(c); } else if (which == remove) { Object[] tar = Selection.primary().toArray(); *************** *** 78,82 **** p.remove((Camera)tar[0]); } ! } else if (which == set) { Object[] tar = Selection.primary().toArray(); if (tar[0] instanceof Camera) { --- 79,83 ---- p.remove((Camera)tar[0]); } ! } /*else if (which == set) { Object[] tar = Selection.primary().toArray(); if (tar[0] instanceof Camera) { *************** *** 85,89 **** p.changed(c); } ! } } } --- 86,90 ---- p.changed(c); } ! }*/ } } |
From: rimestad <rim...@us...> - 2006-02-11 18:04:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3401/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Removed the fixme on change call on camera and added a call to change on the singleton vertex in change(Collection) if it is singleton :D Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Project.java 8 Feb 2006 10:10:14 -0000 1.36 --- Project.java 11 Feb 2006 18:04:24 -0000 1.37 *************** *** 80,84 **** super(); makeClean(); ! addCams(); // To do camera initializasation (MAYBE IT SHOULD NOT BE HERE) observers = new LinkedList(); mesh = new Mesh(); --- 80,84 ---- super(); makeClean(); ! addCams(); observers = new LinkedList(); mesh = new Mesh(); *************** *** 124,129 **** addCams(); changed(this); - // FIXME: The current camera object has not really changed.. - changed(currentCamera); } --- 124,127 ---- *************** *** 212,215 **** --- 210,218 ---- edges.addAll(current.getEdges()); } + // THE CASE WHERE THERE ARE ONLY ONE I WOULD LIKE TO KNOW IT HAS CHANGED + if (vertices.size() == 1) { + Iterator it = vertices.iterator(); + changed(it.next()); + } } { *************** *** 543,547 **** */ public void setCurrentCamera(Camera camera) { ! currentCamera = camera; } --- 546,551 ---- */ public void setCurrentCamera(Camera camera) { ! currentCamera = camera; ! changed(this); } |
From: rimestad <rim...@us...> - 2006-02-11 18:02:54
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2401/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java GenericAttribute.java StringAttribute.java GenericPanel.java Log Message: Made changes so that change calls reflects to the attribute view and so that changes to the attributeview call change on the affected objects Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StringAttribute.java 9 Feb 2006 13:55:12 -0000 1.3 --- StringAttribute.java 11 Feb 2006 18:02:40 -0000 1.4 *************** *** 19,23 **** import javax.swing.Box; import javax.swing.BoxLayout; - import javax.swing.DebugGraphics; import javax.swing.JComponent; import javax.swing.JLabel; --- 19,22 ---- *************** *** 189,198 **** if (attribute.isEditable()) { if (editor == null) { - Dimension d = component.getSize(); component.remove(0); editor = (JTextField) createValueEditor(attribute.getValue()); - editor.setMaximumSize(new Dimension((int)(d.getWidth()), - (int)d.getHeight())); - editor.setDebugGraphicsOptions(DebugGraphics.LOG_OPTION); editor.addKeyListener(this); component.add(editor); --- 188,193 ---- *************** *** 240,243 **** --- 235,247 ---- /** + * Update the content + */ + public void update() { + component.remove(0); + component.add(createValueLabel((String)attribute.getValue())); + component.revalidate(); + } + + /** * Respond to the enter key by stopping editing. * @param event The KeyEvent Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GenericPanel.java 10 Feb 2006 14:59:03 -0000 1.4 --- GenericPanel.java 11 Feb 2006 18:02:40 -0000 1.5 *************** *** 8,11 **** --- 8,12 ---- import java.awt.BorderLayout; + import java.awt.Component; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; *************** *** 61,65 **** Box b = Box.createHorizontalBox(); JLabel label = new JLabel(" - " + ! param.getClass().getName().replaceFirst("net.sourceforge.bprocessor.model.", "") + " - "); label.setFont(AttributeView.FONT_HEADER); b.add(Box.createHorizontalGlue()); --- 62,66 ---- Box b = Box.createHorizontalBox(); JLabel label = new JLabel(" - " + ! param.getGeneralName() + " - "); label.setFont(AttributeView.FONT_HEADER); b.add(Box.createHorizontalGlue()); *************** *** 218,220 **** --- 219,242 ---- public void mouseExited(MouseEvent event) { } } + + /** + * Getter for the parametric + * @return the parametric + */ + public Parametric getParametric() { + return obj; + } + + /** + * Update the view + */ + public void update() { + Component[] c = content.getComponents(); + for (int i = 0; i < content.getComponentCount(); i++) { + if (c[i] instanceof GenericAttribute) { + ((GenericAttribute)c[i]).update(); + } + } + revalidate(); + } } Index: GenericAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericAttribute.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenericAttribute.java 3 Feb 2006 15:23:00 -0000 1.1 --- GenericAttribute.java 11 Feb 2006 18:02:40 -0000 1.2 *************** *** 49,51 **** --- 49,56 ---- */ public abstract void cancelEditing(); + + /** + * Update the content + */ + public abstract void update(); } Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** AttributeView.java 9 Feb 2006 13:55:12 -0000 1.33 --- AttributeView.java 11 Feb 2006 18:02:40 -0000 1.34 *************** *** 13,16 **** --- 13,17 ---- import java.awt.BorderLayout; + import java.awt.Component; import java.awt.Dimension; import java.awt.Font; *************** *** 70,78 **** this.removeAll(); } } - /*Object current = ap.getCurrent(); - if (object == current) { - ap.display(current); - }*/ revalidate(); repaint(); --- 71,92 ---- this.removeAll(); } + } else { + if (this.getComponents().length > 0) { + Component jc = this.getComponent(0); + if (jc instanceof AttributePanel) { + AttributePanel ap = (AttributePanel)jc; + Object current = ap.getCurrent(); + if (object == current) { + ap.display(current); + } + } else if (jc instanceof GenericPanel) { + GenericPanel gp = (GenericPanel)jc; + Object current = gp.getParametric(); + if (current == object) { + gp.update(); + } + } + } } revalidate(); repaint(); |
From: rimestad <rim...@us...> - 2006-02-11 18:00:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1157/src/net/sourceforge/bprocessor/gl/tool Modified Files: RotationTool.java Log Message: Fixed so that it rotates and removes the selection in the circles after use Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RotationTool.java 9 Feb 2006 11:52:46 -0000 1.10 --- RotationTool.java 11 Feb 2006 18:00:39 -0000 1.11 *************** *** 119,123 **** } } else { ! cleanUp(); } } --- 119,123 ---- } } else { ! clear(); } } *************** *** 146,150 **** return; } ! cleanUp(); collect(selection, vertices); --- 146,150 ---- return; } ! clear(); collect(selection, vertices); *************** *** 232,235 **** --- 232,243 ---- */ public void cleanUp() { + clear(); + Selection.primary().clear(); + } + + /** + * Remove all internal stuff + */ + private void clear() { clearConstructors(xCircle); clearConstructors(yCircle); *************** *** 239,243 **** zCircle.clear(); vertices.clear(); - Selection.primary().clear(); } --- 247,250 ---- |
From: rimestad <rim...@us...> - 2006-02-11 18:00:12
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv464/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Removed camera from the gl module now it fetches it from the project Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** GLView.java 25 Jan 2006 14:45:25 -0000 1.34 --- GLView.java 11 Feb 2006 18:00:01 -0000 1.35 *************** *** 10,14 **** import net.sourceforge.bprocessor.gl.tool.ToolFactory; import net.sourceforge.bprocessor.gl.view.View; - import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Observer; --- 10,13 ---- *************** *** 87,91 **** jp.add(lengthPanel, BorderLayout.SOUTH); ! view = new View(this, Project.getInstance().getCurrentCamera()); glc.addGLEventListener(view); --- 86,90 ---- jp.add(lengthPanel, BorderLayout.SOUTH); ! view = new View(this); glc.addGLEventListener(view); *************** *** 339,345 **** if (entity == Selection.primary()) { repaint(); - } else if (entity instanceof Camera) { - getView().setCamera((Camera)entity); - repaint(); } else { repaint(); --- 338,341 ---- |
From: rimestad <rim...@us...> - 2006-02-11 18:00:11
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv464/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Removed camera from the gl module now it fetches it from the project Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** View.java 9 Feb 2006 14:16:28 -0000 1.59 --- View.java 11 Feb 2006 18:00:00 -0000 1.60 *************** *** 272,278 **** private Set tempVertices; - /** The camera for the view */ - private Camera camera; - static { setTransparency(100); --- 272,275 ---- *************** *** 354,360 **** * The constructor * @param glv The glview - * @param camera the Camera */ ! public View(GLView glv, Camera camera) { this.glv = glv; clippingPlanes = new ArrayList(); --- 351,356 ---- * The constructor * @param glv The glview */ ! public View(GLView glv) { this.glv = glv; clippingPlanes = new ArrayList(); *************** *** 366,370 **** tempSurfaces = new HashSet(); tempVertices = new HashSet(); - this.camera = camera; Toolbar tb = Toolbar.getInstance(); --- 362,365 ---- *************** *** 2118,2122 **** double aspect = width / height; ! double[] eye = camera.getCamera(); double[] center = camera.getCenter(); --- 2113,2118 ---- double aspect = width / height; ! /** fetch the current camera */ ! Camera camera = Project.getInstance().getCurrentCamera(); double[] eye = camera.getCamera(); double[] center = camera.getCenter(); *************** *** 2133,2137 **** if (camera.getType() == Camera.ORTHOGRAPHIC) { double tal = Math.tan(focalwidth) * length; ! gl.glOrtho(tal, -tal, tal, -tal, near, far); //TODO find the best pararms } else if (camera.getType() == Camera.PERSPECTIVE) { // fovy, aspect, near, far (relative to camera position) --- 2129,2133 ---- if (camera.getType() == Camera.ORTHOGRAPHIC) { double tal = Math.tan(focalwidth) * length; ! glu.gluOrtho2D(tal, -tal, tal, -tal); //TODO find the best pararms } else if (camera.getType() == Camera.PERSPECTIVE) { // fovy, aspect, near, far (relative to camera position) *************** *** 2342,2360 **** } } - - /** - * Getter for camera - * @return the Camera - */ - public Camera getCamera() { - return camera; - } - - /** - * Setter for camera - * @param camera the Camera - */ - public void setCamera(Camera camera) { - this.camera = camera; - } } --- 2338,2340 ---- |
From: rimestad <rim...@us...> - 2006-02-11 17:22:26
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18875/src/net/sourceforge/bprocessor/gl/tool Modified Files: CameraFlyTool.java AbstractTool.java CameraWalkTool.java CameraTool.java Log Message: Now changed are called on project with the camera when one of the camera tools are used. In abstractTool the drag plane are fixed so that dragging work better Index: CameraTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CameraTool.java 25 Jan 2006 14:45:25 -0000 1.7 --- CameraTool.java 11 Feb 2006 17:22:17 -0000 1.8 *************** *** 90,94 **** Camera.rotateVertically(c, angleY, pivot); } ! glv.repaint(); } } --- 90,94 ---- Camera.rotateVertically(c, angleY, pivot); } ! Project.getInstance().changed(c); } } Index: CameraWalkTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraWalkTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CameraWalkTool.java 25 Jan 2006 14:45:25 -0000 1.3 --- CameraWalkTool.java 11 Feb 2006 17:22:17 -0000 1.4 *************** *** 53,56 **** --- 53,57 ---- Camera.rotateHorizontallyEye(c, -angleX); Camera.rotateVerticallyEye(c, angleY); + Project.getInstance().changed(c); } } *************** *** 96,100 **** super.keyPressed(e); } ! glv.repaint(true); } } --- 97,101 ---- super.keyPressed(e); } ! Project.getInstance().changed(c); } } Index: CameraFlyTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraFlyTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CameraFlyTool.java 25 Jan 2006 14:45:25 -0000 1.5 --- CameraFlyTool.java 11 Feb 2006 17:22:17 -0000 1.6 *************** *** 53,56 **** --- 53,57 ---- Camera.rotateHorizontallyEye(c, -angleX); Camera.rotateVerticallyEye(c, angleY); + Project.getInstance().changed(c); } } *************** *** 96,100 **** super.keyPressed(e); } ! glv.repaint(true); } } --- 97,101 ---- super.keyPressed(e); } ! Project.getInstance().changed(c); } } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** AbstractTool.java 30 Jan 2006 11:32:52 -0000 1.57 --- AbstractTool.java 11 Feb 2006 17:22:17 -0000 1.58 *************** *** 262,274 **** dz *= 1 / sqr; } Vertex first = view.toPlaneCoords(new double[] {previousPos[0], previousPos[1]}, ! new Plane(dx, dy, dz, 0)); Vertex second = view.toPlaneCoords(new double[] {e.getX(), e.getY()}, ! new Plane(dx, dy, dz, 0)); c.translate(new double[] {first.getX() - second.getX(), first.getY() - second.getY(), first.getZ() - second.getZ()}); } else { dragged(e); --- 262,276 ---- dz *= 1 / sqr; } + double d = -dx * center[0] - dy * center[1] - dz * center[2]; Vertex first = view.toPlaneCoords(new double[] {previousPos[0], previousPos[1]}, ! new Plane(dx, dy, dz, d)); Vertex second = view.toPlaneCoords(new double[] {e.getX(), e.getY()}, ! new Plane(dx, dy, dz, d)); c.translate(new double[] {first.getX() - second.getX(), first.getY() - second.getY(), first.getZ() - second.getZ()}); + Project.getInstance().changed(c); } else { dragged(e); *************** *** 432,440 **** Vertex yDir = new Vertex(0, 1, 0); Vertex zDir = new Vertex(0, 0, 1); ! double[] center = glv.getView().getCamera().getCenter(); ! double[] camera = glv.getView().getCamera().getCamera(); ! Vertex cameraDir = new Vertex(center[0] - camera[0], ! center[1] - camera[1], ! center[2] - camera[2]); Edge x = new Edge(xAxis.getFrom().add(v), --- 434,443 ---- Vertex yDir = new Vertex(0, 1, 0); Vertex zDir = new Vertex(0, 0, 1); ! Camera camera = Project.getInstance().getCurrentCamera(); ! double[] center = camera.getCenter(); ! double[] eye = camera.getCamera(); ! Vertex cameraDir = new Vertex(center[0] - eye[0], ! center[1] - eye[1], ! center[2] - eye[2]); Edge x = new Edge(xAxis.getFrom().add(v), |
From: rimestad <rim...@us...> - 2006-02-11 16:20:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22117/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: forgot to implement the correct return value in getGeneralName Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Edge.java 11 Feb 2006 15:02:21 -0000 1.33 --- Edge.java 11 Feb 2006 16:20:27 -0000 1.34 *************** *** 442,446 **** */ public String getGeneralName() { ! return null; } } --- 442,446 ---- */ public String getGeneralName() { ! return "Edge"; } } |
From: rimestad <rim...@us...> - 2006-02-11 15:02:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26461/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Camera.java Parametric.java Modellor.java Log Message: Added getGeneralName to the parametric interface Index: Modellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Modellor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Modellor.java 6 Feb 2006 07:41:23 -0000 1.3 --- Modellor.java 11 Feb 2006 15:02:21 -0000 1.4 *************** *** 19,21 **** --- 19,28 ---- */ public abstract void update(Object entity); + + /** + * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() + */ + public String getGeneralName() { + return "Modellor"; + } } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Edge.java 8 Feb 2006 10:14:14 -0000 1.32 --- Edge.java 11 Feb 2006 15:02:21 -0000 1.33 *************** *** 437,439 **** --- 437,446 ---- return res; } + + /** + * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() + */ + public String getGeneralName() { + return null; + } } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Vertex.java 8 Feb 2006 10:14:14 -0000 1.24 --- Vertex.java 11 Feb 2006 15:02:21 -0000 1.25 *************** *** 370,372 **** --- 370,379 ---- return res; } + + /** + * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() + */ + public String getGeneralName() { + return "Vertex"; + } } Index: Parametric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Parametric.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Parametric.java 30 Jan 2006 11:41:12 -0000 1.1 --- Parametric.java 11 Feb 2006 15:02:21 -0000 1.2 *************** *** 25,27 **** --- 25,33 ---- */ public List getAttributes(); + + /** + * Return the general name of the object + * @return The general name + */ + public String getGeneralName(); } Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Camera.java 9 Feb 2006 13:55:33 -0000 1.12 --- Camera.java 11 Feb 2006 15:02:21 -0000 1.13 *************** *** 462,464 **** --- 462,472 ---- return res; } + + /** + * Return the general name of Camera + * @return "Camera" + */ + public String getGeneralName() { + return "Camera"; + } } |
From: rimestad <rim...@us...> - 2006-02-10 14:59:12
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31015/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java Log Message: Added to changelistener so that it call changed to the project and changes reflects changes in the view Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GenericPanel.java 9 Feb 2006 13:55:12 -0000 1.3 --- GenericPanel.java 10 Feb 2006 14:59:03 -0000 1.4 *************** *** 22,27 **** --- 22,32 ---- import javax.swing.border.TitledBorder; + import org.apache.log4j.Logger; + import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Parametric; + import net.sourceforge.bprocessor.model.Project; /** *************** *** 29,32 **** --- 34,40 ---- */ class GenericPanel extends JPanel implements MouseListener { + /** The logger */ + private static Logger log = Logger.getLogger(GenericPanel.class); + /** The current object shown */ private Parametric obj; *************** *** 78,81 **** --- 86,96 ---- public void valueChanged(Attribute a) { obj.setAttributes(attributes); + if (obj instanceof Entity) { + ((Entity)obj).changed(); + } else if (obj instanceof Camera) { + Project.getInstance().changed((Camera)obj); + } else { + log.info("Were not a Entity object " + obj); + } } }); |
From: Nordholt <nor...@us...> - 2006-02-09 15:10:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18110 Modified Files: MoveTool.java Log Message: corrected nullpointer exception in vector movement mode Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** MoveTool.java 9 Feb 2006 15:01:48 -0000 1.33 --- MoveTool.java 9 Feb 2006 15:10:18 -0000 1.34 *************** *** 210,214 **** Edge edge = (Edge) entity; Edge intersection = edge.intersection(ray); ! return intersection.getFrom(); } else if (entity instanceof ClippingPlane) { Plane plane = ((ClippingPlane) entity).getPlane(); --- 210,218 ---- Edge edge = (Edge) entity; Edge intersection = edge.intersection(ray); ! if (intersection != null) { ! return intersection.getFrom(); ! } else { ! return null; ! } } else if (entity instanceof ClippingPlane) { Plane plane = ((ClippingPlane) entity).getPlane(); |
From: Nordholt <nor...@us...> - 2006-02-09 15:02:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15042 Modified Files: ToolFactory.java Log Message: added new way of choosing movement mode Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ToolFactory.java 3 Feb 2006 14:53:19 -0000 1.29 --- ToolFactory.java 9 Feb 2006 15:02:22 -0000 1.30 *************** *** 16,21 **** --- 16,27 ---- import java.awt.Toolkit; import java.awt.event.ActionEvent; + import java.awt.event.MouseAdapter; + import java.awt.event.MouseEvent; + import java.awt.event.ActionListener; + import javax.swing.JPopupMenu; + import javax.swing.JMenuItem; import javax.swing.AbstractAction; import javax.swing.Action; + import javax.swing.ImageIcon; import javax.swing.JToggleButton; *************** *** 148,151 **** --- 154,158 ---- bg.add(moveBut); moveBut.setToolTipText("Move"); + moveBut.addMouseListener(new MoveButtonMouseListener(moveBut)); rotBut = tb.registerAction(new RotationAction(glv)); bg.add(rotBut); *************** *** 586,588 **** --- 593,654 ---- } } + + /** + * The listener for the move button + */ + class MoveButtonMouseListener extends MouseAdapter { + /** + * The button + */ + private JToggleButton button; + + /** + * Constructs the listener. + * @param button the button to listen on + */ + public MoveButtonMouseListener(JToggleButton button) { + super(); + this.button = button; + } + /** + * Invoked when the mouse is pressed + * @param e the mouse event + */ + public void mousePressed(MouseEvent e) { + if (e.getButton() == e.BUTTON3) { + JPopupMenu pm = new JPopupMenu(); + MovePopupActionListener mpal = new MovePopupActionListener(); + JMenuItem mi = new JMenuItem("Axis restricted"); + mi.addActionListener(mpal); + pm.add(mi); + mi = new JMenuItem("Free plane"); + mi.addActionListener(mpal); + pm.add(mi); + mi = new JMenuItem("Vector"); + mi.addActionListener(mpal); + pm.add(mi); + pm.show(button, 0, button.getHeight()); + } + } + + /** + listener + */ + class MovePopupActionListener implements ActionListener { + /** + * invoked when action performed + * @param actionEvent the event. + */ + public void actionPerformed(ActionEvent actionEvent) { + if (actionEvent.getActionCommand().equals("Vector")) { + move.setMoveMode(move.THREE_CLICK); + } else if (actionEvent.getActionCommand().equals("Axis restricted")) { + move.setMoveMode(move.AXIS_RESTRICTED); + } else if (actionEvent.getActionCommand().equals("Free plane")) { + move.setMoveMode(move.FREE_SNAP); + } + } + } + } } + |