bprocessor-commit Mailing List for B-processor (Page 135)
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: Nordholt <nor...@us...> - 2006-02-09 15:02:01
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14742 Modified Files: MoveTool.java Log Message: added some snap to the free move mode Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** MoveTool.java 7 Feb 2006 12:49:55 -0000 1.32 --- MoveTool.java 9 Feb 2006 15:01:48 -0000 1.33 *************** *** 42,52 **** /** The axis restricted movement mode */ ! private static final int AXIS_RESTRICTED = 0; /** The free snap movement mode */ ! private static final int FREE_SNAP = 1; /** The 3 clicks movement mode */ ! private static final int THREE_CLICK = 2; /** The initial movepoint */ --- 42,52 ---- /** The axis restricted movement mode */ ! public static final int AXIS_RESTRICTED = 0; /** The free snap movement mode */ ! public static final int FREE_SNAP = 1; /** The 3 clicks movement mode */ ! public static final int THREE_CLICK = 2; /** The initial movepoint */ *************** *** 83,87 **** private Edge threeClickConst; ! /** /** --- 83,91 ---- private Edge threeClickConst; ! /** The entity that is being snapped to */ ! private Entity snapEntity; ! ! /** The Collection of entities being moved */ ! private Collection moveEntities; /** *************** *** 94,97 **** --- 98,102 ---- moveConstructors = null; restrictionVector = null; + snapEntity = null; numberOfClicks = 1; moveMode = AXIS_RESTRICTED; *************** *** 134,137 **** --- 139,143 ---- vertices = new HashSet(); + moveEntities = selection; collect(selection, vertices); } else { *************** *** 261,265 **** Vertex delta = parentPos.minus(from); //Restricting movement to fit movement mode. ! delta = restrict(delta); if (log.isDebugEnabled()) { --- 267,271 ---- Vertex delta = parentPos.minus(from); //Restricting movement to fit movement mode. ! delta = restrict(delta, e); if (log.isDebugEnabled()) { *************** *** 306,312 **** * given a desired movement vector. * @param delta the movement vector. * @return the restricted movement vector. */ ! private Vertex restrict(Vertex delta) { if (moveMode == AXIS_RESTRICTED) { Vertex restrictCopy = restrictionVector.copy(); --- 312,319 ---- * given a desired movement vector. * @param delta the movement vector. + * @param e the mouseEvent for this restriction * @return the restricted movement vector. */ ! private Vertex restrict(Vertex delta, MouseEvent e) { if (moveMode == AXIS_RESTRICTED) { Vertex restrictCopy = restrictionVector.copy(); *************** *** 314,317 **** --- 321,334 ---- restrictCopy.scale(delta.dot(restrictCopy)); delta = restrictCopy; + } else if (moveMode == FREE_SNAP) { + List objects = glv.getView().getObjectAtPoint(e.getX(), e.getY(), moveEntities); + Iterator it = objects.iterator(); + if (it.hasNext()) { + Object o = it.next(); + if (o != null) { + snapEntity = (Entity)o; + delta = findInitial(snapEntity, e).minus(from); + } + } } return delta; *************** *** 577,579 **** --- 594,604 ---- glv.repaint(true); } + + /** + * sets movemode + * @param mode the mode + */ + public void setMoveMode(int mode) { + moveMode = mode; + } } |
From: Nordholt <nor...@us...> - 2006-02-09 14:16:43
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29446 Modified Files: View.java Log Message: changed the getobjectatpoint method to be able to disregard a set of entities when analysing the selection buffer Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** View.java 6 Feb 2006 14:26:56 -0000 1.58 --- View.java 9 Feb 2006 14:16:28 -0000 1.59 *************** *** 1569,1576 **** /** ! * Processes the select buffer * @return the closest hit and null if no hit. */ ! private List processSelect() { List selection = new LinkedList(); int bufferOffset = 0; --- 1569,1578 ---- /** ! * Processes the select buffer. A set of entities that should ! * not be considered is specified. ! * @param unWantedEntities the collection og unwanted entities * @return the closest hit and null if no hit. */ ! private List processSelect(Collection unWantedEntities) { List selection = new LinkedList(); int bufferOffset = 0; *************** *** 1602,1634 **** id = selectBuffer.get(bufferOffset); current = getName(id); ! boolean isConstructor = false; ! if (current instanceof Vertex) { ! vertices.add(current); ! } else if (current instanceof Edge) { ! Edge e = (Edge) current; ! if (e.getConstructor()) { ! isConstructor = true; ! constructors.add(e); ! } else { ! edges.add(current); } ! } ! if (isConstructor) { ! if (near < nearestConstructor) { ! nearestConstructor = near; ! closestConstructor = (Edge) current; } } else { ! if (near < nearest) { ! nearest = near; ! closest = current; ! } ! } ! bufferOffset += names; } else { bufferOffset += 3; ! } } if (closest instanceof ClippingPlane) { selection.add(closest); --- 1604,1641 ---- id = selectBuffer.get(bufferOffset); current = getName(id); ! if (!unWantedEntities.contains(current)) { ! boolean isConstructor = false; ! if (current instanceof Vertex) { ! vertices.add(current); ! } else if (current instanceof Edge) { ! Edge e = (Edge) current; ! if (e.getConstructor()) { ! isConstructor = true; ! constructors.add(e); ! } else { ! edges.add(current); ! } } ! if (isConstructor) { ! if (near < nearestConstructor) { ! nearestConstructor = near; ! closestConstructor = (Edge) current; ! } ! } else { ! if (near < nearest) { ! nearest = near; ! closest = current; ! } } + bufferOffset += names; } else { ! bufferOffset += 3; ! } } else { bufferOffset += 3; ! } } + if (closest instanceof ClippingPlane) { selection.add(closest); *************** *** 1759,1769 **** } ! /** ! * Gets id of the object under a point. For use in selection. ! * @param x the x coordinate of the point in mouse coordinates ! * @param y the y coordinate of the point in mouse coordinates ! * @return The object under the point, null if no object is there */ ! public List getObjectAtPoint(double x, double y) { this.x = x; this.y = y; --- 1766,1779 ---- } ! /** ! * Gets Entity under a point. For use in selection. ! * A set of unwanted entities can be specified, so that ! * these entities are not considered. ! * @param x x-coordinate of the point ! * @param y y-coordinate of the point ! * @param unWantedEntities the collection of unwanted entities ! * @return entity under the point. */ ! public List getObjectAtPoint(double x, double y, Collection unWantedEntities) { this.x = x; this.y = y; *************** *** 1773,1779 **** glv.repaint(true); ! List selection = processSelect(); clearNames(); ! return selection; } --- 1783,1799 ---- glv.repaint(true); ! List selection = processSelect(unWantedEntities); clearNames(); ! return selection; ! } ! ! /** ! * Gets id of the object under a point. For use in selection. ! * @param x the x coordinate of the point in mouse coordinates ! * @param y the y coordinate of the point in mouse coordinates ! * @return The object under the point, null if no object is there ! */ ! public List getObjectAtPoint(double x, double y) { ! return getObjectAtPoint(x, y, new HashSet()); } *************** *** 1792,1796 **** glv.repaint(true); ! List selection = processSelect(); clearNames(); return selection; --- 1812,1816 ---- glv.repaint(true); ! List selection = processSelect(new HashSet()); clearNames(); return selection; *************** *** 1811,1815 **** glv.repaint(true); ! List selection = processSelect(); clearNames(); return selection; --- 1831,1835 ---- glv.repaint(true); ! List selection = processSelect(new HashSet()); clearNames(); return selection; |
From: rimestad <rim...@us...> - 2006-02-09 13:55:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20280/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: Changed a bit in the attributes of camera Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Camera.java 3 Feb 2006 15:23:47 -0000 1.11 --- Camera.java 9 Feb 2006 13:55:33 -0000 1.12 *************** *** 407,426 **** } else if (a.getName().equals("Type")) { setType(((String)a.getValue()).equals("Orthographic") ? ORTHOGRAPHIC : PERSPECTIVE); ! } else if (a.getName().equals("Camera")) { ! Double x = (Double)((Attribute)iter.next()).getValue(); ! Double y = (Double)((Attribute)iter.next()).getValue(); ! Double z = (Double)((Attribute)iter.next()).getValue(); setCamera(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); ! } else if (a.getName().equals("Center")) { ! Double x = (Double)((Attribute)iter.next()).getValue(); ! Double y = (Double)((Attribute)iter.next()).getValue(); ! Double z = (Double)((Attribute)iter.next()).getValue(); setCenter(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); } else if (a.getName().equals("Roll")) { ! Double x = (Double)((Attribute)iter.next()).getValue(); ! Double y = (Double)((Attribute)iter.next()).getValue(); ! Double z = (Double)((Attribute)iter.next()).getValue(); setRoll(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); ! } else if (a.getName().equals("Focalwidth")) { setFocalwidth(((Double)a.getValue()).doubleValue()); } else { --- 407,429 ---- } else if (a.getName().equals("Type")) { setType(((String)a.getValue()).equals("Orthographic") ? ORTHOGRAPHIC : PERSPECTIVE); ! } else if (a.getName().equals("Eye")) { ! Iterator camit = ((List)a.getValue()).iterator(); ! Double x = (Double)((Attribute)camit.next()).getValue(); ! Double y = (Double)((Attribute)camit.next()).getValue(); ! Double z = (Double)((Attribute)camit.next()).getValue(); setCamera(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); ! } else if (a.getName().equals("Look-at")) { ! Iterator cenit = ((List)a.getValue()).iterator(); ! Double x = (Double)((Attribute)cenit.next()).getValue(); ! Double y = (Double)((Attribute)cenit.next()).getValue(); ! Double z = (Double)((Attribute)cenit.next()).getValue(); setCenter(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); } else if (a.getName().equals("Roll")) { ! Iterator rollit = ((List)a.getValue()).iterator(); ! Double x = (Double)((Attribute)rollit.next()).getValue(); ! Double y = (Double)((Attribute)rollit.next()).getValue(); ! Double z = (Double)((Attribute)rollit.next()).getValue(); setRoll(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); ! } else if (a.getName().equals("FOW")) { setFocalwidth(((Double)a.getValue()).doubleValue()); } else { *************** *** 437,454 **** ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName())); ! res.add(new Attribute("Type", type == ORTHOGRAPHIC ? "Orthographic" : "Perspective")); ! res.add(new Attribute("Camera", null)); ! res.add(new Attribute("X", new Double(getCamera()[0]))); ! res.add(new Attribute("Y", new Double(getCamera()[1]))); ! res.add(new Attribute("Z", new Double(getCamera()[2]))); ! res.add(new Attribute("Center", null)); ! res.add(new Attribute("X", new Double(getCenter()[0]))); ! res.add(new Attribute("Y", new Double(getCenter()[1]))); ! res.add(new Attribute("Z", new Double(getCenter()[2]))); ! res.add(new Attribute("Roll", null)); ! res.add(new Attribute("X", new Double(getRoll()[0]))); ! res.add(new Attribute("Y", new Double(getRoll()[1]))); ! res.add(new Attribute("Z", new Double(getRoll()[2]))); ! res.add(new Attribute("Focalwidth", new Double(getFocalwidth()))); return res; } --- 440,463 ---- ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName())); ! Attribute a = new Attribute("Type", type == ORTHOGRAPHIC ? "Orthographic" : "Perspective"); ! a.setEditable(false); ! res.add(a); ! ! ArrayList cam = new ArrayList(3); ! cam.add(new Attribute("X", new Double(getCamera()[0]))); ! cam.add(new Attribute("Y", new Double(getCamera()[1]))); ! cam.add(new Attribute("Z", new Double(getCamera()[2]))); ! res.add(new Attribute("Eye", cam)); ! ArrayList cen = new ArrayList(3); ! cen.add(new Attribute("X", new Double(getCenter()[0]))); ! cen.add(new Attribute("Y", new Double(getCenter()[1]))); ! cen.add(new Attribute("Z", new Double(getCenter()[2]))); ! res.add(new Attribute("Look-at", cen)); ! ArrayList roll = new ArrayList(3); ! roll.add(new Attribute("X", new Double(getRoll()[0]))); ! roll.add(new Attribute("Y", new Double(getRoll()[1]))); ! roll.add(new Attribute("Z", new Double(getRoll()[2]))); ! res.add(new Attribute("Roll", roll)); ! res.add(new Attribute("FOW", new Double(getFocalwidth()))); return res; } |
From: rimestad <rim...@us...> - 2006-02-09 13:55:21
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20192/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java AttributePanel.java StringAttribute.java GenericPanel.java Log Message: Changes to the attribute view so that it now are able to show attributes more general Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StringAttribute.java 3 Feb 2006 20:11:45 -0000 1.2 --- StringAttribute.java 9 Feb 2006 13:55:12 -0000 1.3 *************** *** 19,22 **** --- 19,23 ---- import javax.swing.Box; import javax.swing.BoxLayout; + import javax.swing.DebugGraphics; import javax.swing.JComponent; import javax.swing.JLabel; *************** *** 70,75 **** this.add(component); this.add(Box.createHorizontalGlue()); ! label.addMouseListener(this); ! component.addMouseListener(this); } --- 71,78 ---- this.add(component); this.add(Box.createHorizontalGlue()); ! if (attribute.isEditable()) { ! label.addMouseListener(this); ! component.addMouseListener(this); ! } } *************** *** 81,85 **** private JLabel createLabel(String key) { JLabel keyLabel = new JLabel(key + " :"); ! keyLabel.setFont(AttributePanel.FONT_BOLD); return keyLabel; } --- 84,88 ---- private JLabel createLabel(String key) { JLabel keyLabel = new JLabel(key + " :"); ! keyLabel.setFont(AttributeView.FONT_BOLD); return keyLabel; } *************** *** 140,147 **** s = (String)value; } else if (value instanceof Double) { ! s = ((Double) value).toString(); } JLabel valueLabel = new JLabel(s); ! valueLabel.setFont(AttributePanel.FONT_PLAIN); return valueLabel; } --- 143,158 ---- 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); ! if (attribute.isEditable()) { ! valueLabel.setFont(AttributeView.FONT_PLAIN); ! } else { ! valueLabel.setFont(AttributeView.FONT_ITALIC); ! } return valueLabel; } *************** *** 160,164 **** } JTextField valueEditor = new JTextField(s); ! valueEditor.setFont(AttributePanel.FONT_PLAIN); return valueEditor; } --- 171,175 ---- } JTextField valueEditor = new JTextField(s); ! valueEditor.setFont(AttributeView.FONT_PLAIN); return valueEditor; } *************** *** 176,188 **** */ public void startEditing() { ! if (editor == null) { ! component.remove(0); ! editor = (JTextField) createValueEditor(attribute.getValue()); ! editor.addKeyListener(this); ! component.add(editor); ! component.revalidate(); } - editor.requestFocus(); - editor.selectAll(); } --- 187,205 ---- */ public void startEditing() { ! 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); ! component.revalidate(); ! } ! editor.requestFocus(); ! editor.selectAll(); } } *************** *** 192,196 **** */ public void stopEditing() { ! if (editor != null) { Object val = attribute.getValue(); if (val instanceof String) { --- 209,213 ---- */ public void stopEditing() { ! if (editor != null && attribute.isEditable()) { Object val = attribute.getValue(); if (val instanceof String) { Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GenericPanel.java 3 Feb 2006 20:11:45 -0000 1.2 --- GenericPanel.java 9 Feb 2006 13:55:12 -0000 1.3 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.gui.attrview; + import java.awt.BorderLayout; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; *************** *** 12,19 **** --- 13,24 ---- import java.util.List; + import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; + import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; + import javax.swing.border.EtchedBorder; + import javax.swing.border.TitledBorder; import net.sourceforge.bprocessor.model.Attribute; *************** *** 41,50 **** */ public GenericPanel(Parametric param) { ! super(); this.content = Box.createVerticalBox(); obj = param; attributes = param.getAttributes(); ! generateContent(attributes); ! add(this.content); addMouseListener(this); } --- 46,63 ---- */ public GenericPanel(Parametric param) { ! super(new BorderLayout()); this.content = Box.createVerticalBox(); obj = param; attributes = param.getAttributes(); ! generateContent(attributes, content); ! 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()); ! b.add(label); ! b.add(Box.createHorizontalGlue()); ! add(BorderLayout.NORTH, b); ! add(BorderLayout.CENTER, this.content); addMouseListener(this); } *************** *** 53,74 **** * local method for generating the content * @param what The list of attrinutes */ ! private void generateContent(List what) { Iterator iter = what.iterator(); while (iter.hasNext()) { Attribute a = (Attribute)iter.next(); if (a.getValue() instanceof String || a.getValue() instanceof Double) { StringAttribute sa = new StringAttribute(a); sa.addStringAttributeListener(new AttributeListener() { public void valueChanged(Attribute a) { - System.out.println("WOW"); obj.setAttributes(attributes); } }); sa.addMouseListener(this); ! content.add(new AttributeRow(sa)); ! } else if (a.getValue() == null) { ! // Just a label ! content.add(new JLabel(a.getName())); } } --- 66,101 ---- * local method for generating the content * @param what The list of attrinutes + * @param where The place to put all the generated content; */ ! private void generateContent(List what, JComponent where) { Iterator iter = what.iterator(); while (iter.hasNext()) { Attribute a = (Attribute)iter.next(); if (a.getValue() instanceof String || a.getValue() instanceof Double) { + // All the simple types in a field just for editing StringAttribute sa = new StringAttribute(a); sa.addStringAttributeListener(new AttributeListener() { public void valueChanged(Attribute a) { obj.setAttributes(attributes); } }); sa.addMouseListener(this); ! where.add(new AttributeRow(sa)); ! } else if (a.getValue() instanceof List) { ! // Take care of all list attributes ! List elems = (List)a.getValue(); ! Iterator iterElems = elems.iterator(); ! Box more = Box.createVerticalBox(); ! TitledBorder b = BorderFactory.createTitledBorder( ! BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), ! a.getName()); ! b.setTitleJustification(TitledBorder.CENTER); ! more.setBorder(b); ! if (iterElems.next() instanceof Attribute) { ! generateContent(elems, more); ! } ! where.add(more); ! } else { ! System.out.println("[GenericPanel] Something were not implemented"); } } Index: AttributePanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributePanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AttributePanel.java 9 Feb 2006 13:12:18 -0000 1.4 --- AttributePanel.java 9 Feb 2006 13:55:12 -0000 1.5 *************** *** 9,13 **** import java.awt.Color; import java.awt.Dimension; - import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; --- 9,12 ---- *************** *** 40,49 **** private Object current; - /** The font used in plain */ - public static final Font FONT_PLAIN = new Font("Sans-serif", Font.PLAIN, 12); - - /** The font used in bold */ - public static final Font FONT_BOLD = new Font("Sans-serif", Font.BOLD, 12); - /** If its a textfield */ public static final int TFIELD = 1; --- 39,42 ---- *************** *** 91,95 **** con.weightx = 0; layout.setConstraints(name, con); ! name.setFont(FONT_BOLD); add(name); --- 84,88 ---- con.weightx = 0; layout.setConstraints(name, con); ! name.setFont(AttributeView.FONT_BOLD); add(name); *************** *** 100,104 **** con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(nameEdit, con); ! nameEdit.setFont(FONT_PLAIN); add(nameEdit); nameEdit.addKeyListener(new MyKeyListener(o, TFIELD)); --- 93,97 ---- con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(nameEdit, con); ! nameEdit.setFont(AttributeView.FONT_PLAIN); add(nameEdit); nameEdit.addKeyListener(new MyKeyListener(o, TFIELD)); *************** *** 194,203 **** con.weightx = 0; layout.setConstraints(name, con); ! name.setFont(FONT_BOLD); add(name); JLabel vertexName = new JLabel(o.getName()); layout.setConstraints(vertexName, con); ! vertexName.setFont(FONT_PLAIN); add(vertexName); --- 187,196 ---- con.weightx = 0; layout.setConstraints(name, con); ! name.setFont(AttributeView.FONT_BOLD); add(name); JLabel vertexName = new JLabel(o.getName()); layout.setConstraints(vertexName, con); ! vertexName.setFont(AttributeView.FONT_PLAIN); add(vertexName); *************** *** 214,218 **** con.weightx = 0; layout.setConstraints(x, con); ! x.setFont(FONT_BOLD); add(x); --- 207,211 ---- con.weightx = 0; layout.setConstraints(x, con); ! x.setFont(AttributeView.FONT_BOLD); add(x); *************** *** 223,227 **** con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(xEdit, con); ! xEdit.setFont(FONT_PLAIN); add(xEdit); xEdit.addKeyListener(new MyKeyListener(o, XCOOR)); --- 216,220 ---- con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(xEdit, con); ! xEdit.setFont(AttributeView.FONT_PLAIN); add(xEdit); xEdit.addKeyListener(new MyKeyListener(o, XCOOR)); *************** *** 232,236 **** con.fill = GridBagConstraints.NONE; layout.setConstraints(y, con); ! y.setFont(FONT_BOLD); add(y); --- 225,229 ---- con.fill = GridBagConstraints.NONE; layout.setConstraints(y, con); ! y.setFont(AttributeView.FONT_BOLD); add(y); *************** *** 241,245 **** con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(yEdit, con); ! yEdit.setFont(FONT_PLAIN); add(yEdit); yEdit.addKeyListener(new MyKeyListener(o, YCOOR)); --- 234,238 ---- con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(yEdit, con); ! yEdit.setFont(AttributeView.FONT_PLAIN); add(yEdit); yEdit.addKeyListener(new MyKeyListener(o, YCOOR)); *************** *** 250,254 **** con.fill = GridBagConstraints.NONE; layout.setConstraints(z, con); ! z.setFont(FONT_BOLD); add(z); --- 243,247 ---- con.fill = GridBagConstraints.NONE; layout.setConstraints(z, con); ! z.setFont(AttributeView.FONT_BOLD); add(z); *************** *** 259,263 **** con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(zEdit, con); ! zEdit.setFont(FONT_PLAIN); add(zEdit); zEdit.addKeyListener(new MyKeyListener(o, ZCOOR)); --- 252,256 ---- con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(zEdit, con); ! zEdit.setFont(AttributeView.FONT_PLAIN); add(zEdit); zEdit.addKeyListener(new MyKeyListener(o, ZCOOR)); *************** *** 287,296 **** con.weightx = 0; layout.setConstraints(name, con); ! name.setFont(FONT_BOLD); add(name); JLabel edgeName = new JLabel(o.getName()); layout.setConstraints(edgeName, con); ! edgeName.setFont(FONT_PLAIN); add(edgeName); --- 280,289 ---- con.weightx = 0; layout.setConstraints(name, con); ! name.setFont(AttributeView.FONT_BOLD); add(name); JLabel edgeName = new JLabel(o.getName()); layout.setConstraints(edgeName, con); ! edgeName.setFont(AttributeView.FONT_PLAIN); add(edgeName); *************** *** 307,311 **** con.gridwidth = 1; layout.setConstraints(length, con); ! length.setFont(FONT_BOLD); add(length); --- 300,304 ---- con.gridwidth = 1; layout.setConstraints(length, con); ! length.setFont(AttributeView.FONT_BOLD); add(length); *************** *** 316,320 **** con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(lengthEdit, con); ! lengthEdit.setFont(FONT_PLAIN); add(lengthEdit); lengthEdit.addKeyListener(new MyKeyListener(o, LENGTH)); --- 309,313 ---- con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(lengthEdit, con); ! lengthEdit.setFont(AttributeView.FONT_PLAIN); add(lengthEdit); lengthEdit.addKeyListener(new MyKeyListener(o, LENGTH)); *************** *** 345,354 **** con.weightx = 0; layout.setConstraints(name, con); ! name.setFont(FONT_BOLD); add(name); JLabel surfaceName = new JLabel(o.getName()); layout.setConstraints(surfaceName, con); ! surfaceName.setFont(FONT_PLAIN); add(surfaceName); --- 338,347 ---- con.weightx = 0; layout.setConstraints(name, con); ! name.setFont(AttributeView.FONT_BOLD); add(name); JLabel surfaceName = new JLabel(o.getName()); layout.setConstraints(surfaceName, con); ! surfaceName.setFont(AttributeView.FONT_PLAIN); add(surfaceName); *************** *** 364,368 **** con.gridwidth = 1; layout.setConstraints(fspace, con); ! fspace.setFont(FONT_BOLD); add(fspace); --- 357,361 ---- con.gridwidth = 1; layout.setConstraints(fspace, con); ! fspace.setFont(AttributeView.FONT_BOLD); add(fspace); *************** *** 380,384 **** con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(frontSpaceName, con); ! frontSpaceName.setFont(FONT_PLAIN); add(frontSpaceName); --- 373,377 ---- con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(frontSpaceName, con); ! frontSpaceName.setFont(AttributeView.FONT_PLAIN); add(frontSpaceName); *************** *** 402,406 **** con.gridwidth = 1; layout.setConstraints(bspace, con); ! bspace.setFont(FONT_BOLD); add(bspace); --- 395,399 ---- con.gridwidth = 1; layout.setConstraints(bspace, con); ! bspace.setFont(AttributeView.FONT_BOLD); add(bspace); *************** *** 417,421 **** con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(backSpaceName, con); ! backSpaceName.setFont(FONT_PLAIN); add(backSpaceName); --- 410,414 ---- con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(backSpaceName, con); ! backSpaceName.setFont(AttributeView.FONT_PLAIN); add(backSpaceName); *************** *** 456,465 **** con.weightx = 0; layout.setConstraints(name, con); ! name.setFont(FONT_BOLD); add(name); JLabel cameraName = new JLabel(c.getName()); layout.setConstraints(cameraName, con); ! cameraName.setFont(FONT_PLAIN); add(cameraName); --- 449,458 ---- con.weightx = 0; layout.setConstraints(name, con); ! name.setFont(AttributeView.FONT_BOLD); add(name); JLabel cameraName = new JLabel(c.getName()); layout.setConstraints(cameraName, con); ! cameraName.setFont(AttributeView.FONT_PLAIN); add(cameraName); *************** *** 491,495 **** typeCon.gridy = 0; JLabel cam = new JLabel("Camera:"); ! cam.setFont(FONT_BOLD); type.add(cam, typeCon); --- 484,488 ---- typeCon.gridy = 0; JLabel cam = new JLabel("Camera:"); ! cam.setFont(AttributeView.FONT_BOLD); type.add(cam, typeCon); *************** *** 529,533 **** typeCon.gridy = 4; JLabel eyel = new JLabel("Eye-point:"); ! cam.setFont(FONT_BOLD); type.add(eyel, typeCon); typeCon.gridwidth = 1; --- 522,526 ---- typeCon.gridy = 4; JLabel eyel = new JLabel("Eye-point:"); ! cam.setFont(AttributeView.FONT_BOLD); type.add(eyel, typeCon); typeCon.gridwidth = 1; *************** *** 564,568 **** typeCon.gridy = 8; JLabel rolll = new JLabel("Roll:"); ! cam.setFont(FONT_BOLD); type.add(rolll, typeCon); typeCon.gridwidth = 1; --- 557,561 ---- typeCon.gridy = 8; JLabel rolll = new JLabel("Roll:"); ! cam.setFont(AttributeView.FONT_BOLD); type.add(rolll, typeCon); typeCon.gridwidth = 1; Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** AttributeView.java 3 Feb 2006 15:23:00 -0000 1.32 --- AttributeView.java 9 Feb 2006 13:55:12 -0000 1.33 *************** *** 12,16 **** --- 12,18 ---- import net.sourceforge.bprocessor.model.Selection; + import java.awt.BorderLayout; import java.awt.Dimension; + import java.awt.Font; import javax.swing.JPanel; *************** *** 25,28 **** --- 27,43 ---- private static Logger log = Logger.getLogger(AttributeView.class); + /** The font used in plain */ + public static final Font FONT_PLAIN = new Font("Sans-serif", Font.PLAIN, 12); + + /** The font used in bold */ + public static final Font FONT_BOLD = new Font("Sans-serif", Font.BOLD, 12); + + /** The font used in bold */ + public static final Font FONT_ITALIC = new Font("Sans-serif", Font.ITALIC, 12); + + /** The font used in bold */ + public static final Font FONT_HEADER = new Font("Sans-serif", Font.BOLD, 13); + + /** * Constructor *************** *** 42,50 **** Selection selection = Selection.primary(); if (object == selection) { ! if (selection.size() > 0) { Object o = selection.iterator().next(); this.removeAll(); if (o instanceof Parametric) { ! this.add(new GenericPanel((Parametric)o)); } else { AttributePanel ap = new AttributePanel(); --- 57,65 ---- 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)); } else { AttributePanel ap = new AttributePanel(); *************** *** 52,55 **** --- 67,72 ---- this.add(ap); } + } else { + this.removeAll(); } } |
From: rimestad <rim...@us...> - 2006-02-09 13:55:21
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20192/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Changes to the attribute view so that it now are able to show attributes more general Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** GUI.java 8 Feb 2006 10:13:20 -0000 1.28 --- GUI.java 9 Feb 2006 13:55:12 -0000 1.29 *************** *** 30,33 **** --- 30,34 ---- import java.awt.BorderLayout; import java.awt.Component; + import java.awt.Dimension; import java.awt.Font; import java.awt.event.KeyEvent; *************** *** 338,342 **** tp.addTab("Surfaces", new JScrollPane (new SurfaceTreeView())); tp.addTab("Views", new CameraView()); ! registerPanel(tp, SPLIT_LEFT); --- 339,344 ---- tp.addTab("Surfaces", new JScrollPane (new SurfaceTreeView())); tp.addTab("Views", new CameraView()); ! tp.setMinimumSize(new Dimension(120, 240)); ! tp.setPreferredSize(new Dimension(120, 240)); registerPanel(tp, SPLIT_LEFT); |
From: Nikolaj B. <nbr...@us...> - 2006-02-09 13:12:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2649/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributePanel.java Log Message: Fixed wrong a wrong panel color Index: AttributePanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributePanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AttributePanel.java 8 Feb 2006 10:13:20 -0000 1.3 --- AttributePanel.java 9 Feb 2006 13:12:18 -0000 1.4 *************** *** 376,381 **** JLabel frontSpaceName = new JLabel(fsn); layout.setConstraints(frontSpaceName, con); - frontSpaceName.setOpaque(true); - frontSpaceName.setBackground(Color.blue); con.weightx = 1; con.fill = GridBagConstraints.HORIZONTAL; --- 376,379 ---- |
From: rimestad <rim...@us...> - 2006-02-09 11:52:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1355/src/net/sourceforge/bprocessor/gl/tool Modified Files: RotationTool.java Log Message: Now the selection of the circles are removed on tool shift Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RotationTool.java 7 Feb 2006 12:49:55 -0000 1.9 --- RotationTool.java 9 Feb 2006 11:52:46 -0000 1.10 *************** *** 17,20 **** --- 17,21 ---- import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.gl.view.Transformation; *************** *** 238,241 **** --- 239,243 ---- zCircle.clear(); vertices.clear(); + Selection.primary().clear(); } |
From: rimestad <rim...@us...> - 2006-02-09 11:52:12
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1171/src/net/sourceforge/bprocessor/model Modified Files: Attribute.java Log Message: Added a editable parameter Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Attribute.java 8 Feb 2006 10:10:14 -0000 1.6 --- Attribute.java 9 Feb 2006 11:52:04 -0000 1.7 *************** *** 25,28 **** --- 25,31 ---- /** The precision of the object */ private int precision; + + /** If the attribute can be modified or not */ + private boolean editable; /** *************** *** 36,41 **** --- 39,61 ---- setValue(value); setPrecision(precision); + editable = true; } + /** + * True if the attribute is editable + * @return if the attribute is editable + */ + public boolean isEditable() { + return editable; + } + + /** + * Set the attribute editable to edit + * @param edit The truth value + */ + public void setEditable(boolean edit) { + editable = edit; + } + /** * Constructor |
From: Nikolaj B. <nbr...@us...> - 2006-02-08 10:14:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22141/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Log Message: Modified Edge and Vertex to be parametric Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Edge.java 3 Feb 2006 13:01:49 -0000 1.31 --- Edge.java 8 Feb 2006 10:14:14 -0000 1.32 *************** *** 9,12 **** --- 9,13 ---- import org.apache.log4j.Logger; + import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; *************** *** 23,27 **** * usage="read-write" */ ! public class Edge extends Geometric { /** The logger */ private static Logger log = Logger.getLogger(Edge.class); --- 24,28 ---- * usage="read-write" */ ! public class Edge extends Geometric implements Parametric { /** The logger */ private static Logger log = Logger.getLogger(Edge.class); *************** *** 407,409 **** --- 408,439 ---- return false; } + + /** + * Set the attributes of the object to the values in the list + * @param attributes The attributes to set + */ + public void setAttributes(List attributes) { + Iterator iter = attributes.iterator(); + while (iter.hasNext()) { + Attribute a = (Attribute)iter.next(); + if (a.getName().equals("Name")) { + System.out.println(""); + } else if (a.getName().equals("Length")) { + setLength(((Double)a.getValue()).doubleValue()); + } else { + log.error("Wrong attribute for the object " + a); + } + } + } + + /** + * Return a list of the attributes in the object + * @return the list of attributes for the object + */ + public List getAttributes() { + ArrayList res = new ArrayList(); + res.add(new Attribute("Name", getName())); + res.add(new Attribute("Length", new Double(getLength()))); + return res; + } } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Vertex.java 3 Feb 2006 13:01:49 -0000 1.23 --- Vertex.java 8 Feb 2006 10:14:14 -0000 1.24 *************** *** 7,13 **** --- 7,15 ---- package net.sourceforge.bprocessor.model; + import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; + import java.util.List; import java.util.Set; *************** *** 22,26 **** * usage="read-write" */ ! public class Vertex extends Geometric { /** The logger */ private static Logger log = Logger.getLogger(Vertex.class); --- 24,28 ---- * usage="read-write" */ ! public class Vertex extends Geometric implements Parametric { /** The logger */ private static Logger log = Logger.getLogger(Vertex.class); *************** *** 333,335 **** --- 335,372 ---- return this; } + + /** + * Set the attributes of the object to the values in the list + * @param attributes The attributes to set + */ + public void setAttributes(List attributes) { + Iterator iter = attributes.iterator(); + while (iter.hasNext()) { + Attribute a = (Attribute)iter.next(); + if (a.getName().equals("Name")) { + System.out.println(""); + } else if (a.getName().equals("X")) { + setX(((Double)a.getValue()).doubleValue()); + } else if (a.getName().equals("Y")) { + setY(((Double)a.getValue()).doubleValue()); + } else if (a.getName().equals("Z")) { + setZ(((Double)a.getValue()).doubleValue()); + } else { + log.error("Wrong attribute for the object " + a); + } + } + } + + /** + * Return a list of the attributes in the object + * @return the list of attributes for the object + */ + public List getAttributes() { + ArrayList res = new ArrayList(); + res.add(new Attribute("Name", getName())); + res.add(new Attribute("X", new Double(getX()))); + res.add(new Attribute("Y", new Double(getY()))); + res.add(new Attribute("Z", new Double(getZ()))); + return res; + } } |
From: Nikolaj B. <nbr...@us...> - 2006-02-08 10:13:32
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21633/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Added a filefilter, and made some minor tweaks. Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** GUI.java 30 Jan 2006 10:07:43 -0000 1.27 --- GUI.java 8 Feb 2006 10:13:20 -0000 1.28 *************** *** 120,123 **** --- 120,131 ---- file.add(fileLoad); + file.addSeparator(); + + JMenuItem fileClose = new JMenuItem("Close"); + fileClose.addActionListener(new FileCloseActionListener()); + fileClose.setMnemonic(KeyEvent.VK_C); + fileClose.setEnabled(true); + file.add(fileClose); + JMenuItem fileSave = new JMenuItem("Save"); fileSave.addActionListener(new FileSaveActionListener()); *************** *** 132,141 **** file.add(fileSaveAs); - JMenuItem fileClose = new JMenuItem("Close"); - fileClose.addActionListener(new FileCloseActionListener()); - fileClose.setMnemonic(KeyEvent.VK_C); - fileClose.setEnabled(true); - file.add(fileClose); - file.addSeparator(); --- 140,143 ---- |
From: Nikolaj B. <nbr...@us...> - 2006-02-08 10:13:32
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21633/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileSaveActionListener.java FileNewActionListener.java FileExitActionListener.java FileLoadActionListener.java FileCloseActionListener.java FileSaveAsActionListener.java Added Files: MyFileFilter.java Log Message: Added a filefilter, and made some minor tweaks. Index: FileLoadActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileLoadActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FileLoadActionListener.java 30 Jan 2006 10:07:42 -0000 1.3 --- FileLoadActionListener.java 8 Feb 2006 10:13:20 -0000 1.4 *************** *** 38,42 **** */ public void actionPerformed(ActionEvent e) { ! if (Project.getInstance().isDirty()) { int n = JOptionPane.showConfirmDialog( --- 38,42 ---- */ public void actionPerformed(ActionEvent e) { ! if (Project.getInstance().isDirty()) { int n = JOptionPane.showConfirmDialog( *************** *** 47,50 **** --- 47,52 ---- if (n == 0) { JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); + chooser.addChoosableFileFilter(new MyFileFilter()); + int state = chooser.showSaveDialog(null); File file = chooser.getSelectedFile(); *************** *** 57,60 **** --- 59,63 ---- JFileChooser loadChooser = new JFileChooser(Project.getInstance().getDefaultPath()); + loadChooser.addChoosableFileFilter(new MyFileFilter()); int lstate = loadChooser.showOpenDialog(null); File lfile = loadChooser.getSelectedFile(); *************** *** 80,83 **** --- 83,87 ---- if (n == 1) { JFileChooser loadChooser = new JFileChooser(Project.getInstance().getDefaultPath()); + loadChooser.addChoosableFileFilter(new MyFileFilter()); int lstate = loadChooser.showOpenDialog(null); File lfile = loadChooser.getSelectedFile(); *************** *** 101,104 **** --- 105,109 ---- JFileChooser loadChooser = new JFileChooser(Project.getInstance().getDefaultPath()); + loadChooser.addChoosableFileFilter(new MyFileFilter()); int lstate = loadChooser.showOpenDialog(null); File lfile = loadChooser.getSelectedFile(); Index: FileExitActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileExitActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FileExitActionListener.java 5 Dec 2005 21:00:24 -0000 1.3 --- FileExitActionListener.java 8 Feb 2006 10:13:20 -0000 1.4 *************** *** 9,12 **** --- 9,19 ---- import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import java.io.File; + + import javax.swing.JFileChooser; + import javax.swing.JOptionPane; + + import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.xml.PersistenceManager; import org.apache.log4j.Logger; *************** *** 30,34 **** */ public void actionPerformed(ActionEvent e) { ! System.exit(0); } } --- 37,80 ---- */ public void actionPerformed(ActionEvent e) { ! if (Project.getInstance().isDirty()) { ! int n = JOptionPane.showConfirmDialog( ! null, ! "Do you want to save the changes?", ! "Projekt has been changed", ! JOptionPane.YES_NO_CANCEL_OPTION); ! if (n == 0) { ! if (Project.getInstance().getSavePath() == null) { ! JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); ! chooser.addChoosableFileFilter(new MyFileFilter()); ! int state = chooser.showSaveDialog(null); ! File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { ! try { ! PersistenceManager.save(file); ! Project.getInstance().setDefaultPath(file.getAbsolutePath()); ! System.exit(0); ! } catch (Exception ex) { ! log.error("Could not export to file: " + file, ex); ! } ! } ! } ! } ! ! if (n == 1) { ! System.exit(0); ! } else { ! try { ! PersistenceManager.save(new File(Project.getInstance().getSavePath())); ! System.exit(0); ! } catch (Exception ex) { ! log.error("Could not export to file: " + ! new File(Project.getInstance().getSavePath()), ex); ! } ! } ! ! } else { ! System.exit(0); ! } } } Index: FileCloseActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileCloseActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileCloseActionListener.java 30 Jan 2006 10:07:42 -0000 1.2 --- FileCloseActionListener.java 8 Feb 2006 10:13:20 -0000 1.3 *************** *** 42,46 **** */ public void actionPerformed(ActionEvent event) { ! Project.getInstance().setSavePath(null); if (Project.getInstance().isDirty()) { int n = JOptionPane.showConfirmDialog( --- 42,46 ---- */ public void actionPerformed(ActionEvent event) { ! if (Project.getInstance().isDirty()) { int n = JOptionPane.showConfirmDialog( *************** *** 49,69 **** "Projekt has been changed", JOptionPane.YES_NO_CANCEL_OPTION); ! if (n == 0) { ! JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); ! int state = chooser.showSaveDialog(null); ! File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().setDefaultPath(file.getAbsolutePath()); ! PersistenceManager.save(file); Selection.primary().clear(); Project.getInstance().clear(); Project.getInstance().makeClean(); } catch (Exception ex) { ! log.error("Could not export to file: " + file, ex); } } ! } if (n == 1) { --- 49,84 ---- "Projekt has been changed", JOptionPane.YES_NO_CANCEL_OPTION); ! if (n == 0) { ! if (Project.getInstance().getSavePath() == null) { ! JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); ! chooser.addChoosableFileFilter(new MyFileFilter()); ! int state = chooser.showSaveDialog(null); ! File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { ! try { ! Project.getInstance().setDefaultPath(file.getAbsolutePath()); ! PersistenceManager.save(file); ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! Project.getInstance().setSavePath(null); ! } catch (Exception ex) { ! log.error("Could not export to file: " + file, ex); ! } ! } ! } else { try { ! PersistenceManager.save(new File(Project.getInstance().getSavePath())); Selection.primary().clear(); Project.getInstance().clear(); Project.getInstance().makeClean(); + Project.getInstance().setSavePath(null); } catch (Exception ex) { ! log.error("Could not export to file: " + ! new File(Project.getInstance().getSavePath()), ex); } } ! } if (n == 1) { *************** *** 71,74 **** --- 86,90 ---- Project.getInstance().clear(); Project.getInstance().makeClean(); + Project.getInstance().setSavePath(null); } *************** *** 77,80 **** --- 93,97 ---- Project.getInstance().clear(); Project.getInstance().makeClean(); + Project.getInstance().setSavePath(null); } } Index: FileNewActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileNewActionListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FileNewActionListener.java 30 Jan 2006 10:07:42 -0000 1.4 --- FileNewActionListener.java 8 Feb 2006 10:13:20 -0000 1.5 *************** *** 42,46 **** */ public void actionPerformed(ActionEvent event) { ! Project.getInstance().setSavePath(null); if (Project.getInstance().isDirty()) { int n = JOptionPane.showConfirmDialog( --- 42,46 ---- */ public void actionPerformed(ActionEvent event) { ! if (Project.getInstance().isDirty()) { int n = JOptionPane.showConfirmDialog( *************** *** 49,74 **** "Projekt has been changed", JOptionPane.YES_NO_CANCEL_OPTION); ! if (n == 0) { ! JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); ! int state = chooser.showSaveDialog(null); ! File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { try { ! PersistenceManager.save(file); ! Project.getInstance().setDefaultPath(file.getAbsolutePath()); Selection.primary().clear(); Project.getInstance().clear(); Project.getInstance().makeClean(); } catch (Exception ex) { ! log.error("Could not export to file: " + file, ex); } } ! } ! if (n == 1) { Selection.primary().clear(); Project.getInstance().clear(); Project.getInstance().makeClean(); } --- 49,89 ---- "Projekt has been changed", JOptionPane.YES_NO_CANCEL_OPTION); ! if (n == 0) { ! if (Project.getInstance().getSavePath() == null) { ! JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); ! chooser.addChoosableFileFilter(new MyFileFilter()); ! int state = chooser.showSaveDialog(null); ! File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { ! try { ! PersistenceManager.save(file); ! Project.getInstance().setDefaultPath(file.getAbsolutePath()); ! Selection.primary().clear(); ! Project.getInstance().clear(); ! Project.getInstance().makeClean(); ! Project.getInstance().setSavePath(null); ! } catch (Exception ex) { ! log.error("Could not export to file: " + file, ex); ! } ! } ! } else { try { ! PersistenceManager.save(new File(Project.getInstance().getSavePath())); Selection.primary().clear(); Project.getInstance().clear(); Project.getInstance().makeClean(); + Project.getInstance().setSavePath(null); } catch (Exception ex) { ! log.error("Could not export to file: " + ! new File(Project.getInstance().getSavePath()), ex); } } ! } if (n == 1) { Selection.primary().clear(); Project.getInstance().clear(); Project.getInstance().makeClean(); + Project.getInstance().setSavePath(null); } *************** *** 77,80 **** --- 92,96 ---- Project.getInstance().clear(); Project.getInstance().makeClean(); + Project.getInstance().setSavePath(null); } } --- NEW FILE: MyFileFilter.java --- //--------------------------------------------------------------------------------- // $Id: MyFileFilter.java,v 1.1 2006/02/08 10:13:20 nbramsen Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import java.io.File; import javax.swing.filechooser.FileFilter; /** * My filefilter */ public class MyFileFilter extends FileFilter { /** * @param f the file the filter is checking * @return false, if not a .bp file or a directory. */ public boolean accept(File f) { if (f.isDirectory()) { return true; } String ext = null; String s = f.getName(); int i = s.lastIndexOf('.'); if (i > 0 && i < s.length() - 1) { ext = s.substring(i + 1).toLowerCase(); } if (ext != null) { if (ext.equals("bp")) { return true; } } return false; } /** * @return the description of the filter */ public String getDescription() { return "Bp files"; } } Index: FileSaveAsActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveAsActionListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileSaveAsActionListener.java 30 Jan 2006 10:07:42 -0000 1.1 --- FileSaveAsActionListener.java 8 Feb 2006 10:13:20 -0000 1.2 *************** *** 37,40 **** --- 37,41 ---- public void actionPerformed(ActionEvent e) { JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); + chooser.addChoosableFileFilter(new MyFileFilter()); int state = chooser.showSaveDialog(null); File file = chooser.getSelectedFile(); Index: FileSaveActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FileSaveActionListener.java 30 Jan 2006 10:07:42 -0000 1.3 --- FileSaveActionListener.java 8 Feb 2006 10:13:20 -0000 1.4 *************** *** 39,42 **** --- 39,43 ---- if (Project.getInstance().getSavePath() == null) { JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); + chooser.addChoosableFileFilter(new MyFileFilter()); int state = chooser.showSaveDialog(null); File file = chooser.getSelectedFile(); |
From: Nikolaj B. <nbr...@us...> - 2006-02-08 10:13:30
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21633/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributePanel.java Log Message: Added a filefilter, and made some minor tweaks. Index: AttributePanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributePanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AttributePanel.java 6 Feb 2006 07:41:19 -0000 1.2 --- AttributePanel.java 8 Feb 2006 10:13:20 -0000 1.3 *************** *** 376,379 **** --- 376,381 ---- JLabel frontSpaceName = new JLabel(fsn); layout.setConstraints(frontSpaceName, con); + frontSpaceName.setOpaque(true); + frontSpaceName.setBackground(Color.blue); con.weightx = 1; con.fill = GridBagConstraints.HORIZONTAL; |
From: Michael L. <he...@us...> - 2006-02-08 10:10:25
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20100/src/net/sourceforge/bprocessor/model Modified Files: Space.java LayerModellor.java Project.java Attribute.java Log Message: Added Modellor to Space in D-View Implemented Parametric in LayerModellor Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Attribute.java 2 Feb 2006 10:55:14 -0000 1.5 --- Attribute.java 8 Feb 2006 10:10:14 -0000 1.6 *************** *** 88,90 **** --- 88,98 ---- this.value = value; } + + /** + * Return string + * @return String + */ + public String toString() { + return (name + "[" + value) + "]"; + } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Space.java 6 Feb 2006 07:41:23 -0000 1.17 --- Space.java 8 Feb 2006 10:10:14 -0000 1.18 *************** *** 34,37 **** --- 34,39 ---- /** The interior mesh */ private Mesh interior; + /** The modellor */ + private Modellor modellor; *************** *** 145,148 **** --- 147,165 ---- } + /** + * Get the modellor + * @return The modellor + */ + public Modellor getModellor() { + return modellor; + } + + /** + * Set the modellor + * @param modellor The modellor + */ + public void setModellor(Modellor modellor) { + this.modellor = modellor; + } /** *************** *** 248,250 **** --- 265,286 ---- return null; } + + /** + * Notify that this Space has changed + * FIXME: Make the change-update mechanism general + */ + public void changed() { + update(this); + super.changed(); + } + + /** + * Update this Space + * @param entity Changed entity + */ + public void update(Object entity) { + if (modellor != null) { + modellor.update(entity); + } + } } Index: LayerModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/LayerModellor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LayerModellor.java 7 Feb 2006 08:32:16 -0000 1.2 --- LayerModellor.java 8 Feb 2006 10:10:14 -0000 1.3 *************** *** 9,12 **** --- 9,15 ---- import java.util.HashSet; + import java.util.Iterator; + import java.util.LinkedList; + import java.util.List; import java.util.Set; *************** *** 14,18 **** * Modellor */ ! public class LayerModellor extends Modellor { /** The space */ --- 17,21 ---- * Modellor */ ! public class LayerModellor extends Modellor implements Parametric { /** The space */ *************** *** 58,60 **** --- 61,105 ---- return null; } + + /** + * Return name + * @return Name + */ + public String getName() { + return "Layer Modellor"; + } + + /** + * 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("Layer Thickness")) { + Double thickness = (Double) current.getValue(); + distance = thickness.doubleValue(); + space.changed(); + } + } + } + + /** + * Get attributes + * @return The attributes + */ + 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; + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Project.java 7 Feb 2006 12:49:59 -0000 1.35 --- Project.java 8 Feb 2006 10:10:14 -0000 1.36 *************** *** 205,208 **** --- 205,209 ---- HashSet edges = new HashSet(); HashSet surfaces = new HashSet(); + HashSet spaces = new HashSet(); { Iterator iter = vertices.iterator(); *************** *** 219,226 **** } } ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! updateConstraints(current); } } --- 220,248 ---- } } ! { ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! if (current.getBackDomain() != null) { ! spaces.add(current.getBackDomain()); ! } ! if (current.getFrontDomain() != null) { ! spaces.add(current.getFrontDomain()); ! } ! } ! } ! { ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! updateConstraints(current); ! } ! } ! { ! Iterator iter = spaces.iterator(); ! while (iter.hasNext()) { ! Space current = (Space) iter.next(); ! current.update(current); ! } } } |
From: Michael L. <he...@us...> - 2006-02-08 10:10:25
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20046/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Added Modellor to Space in D-View Implemented Parametric in LayerModellor Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GenericTreeView.java 1 Feb 2006 09:00:17 -0000 1.12 --- GenericTreeView.java 8 Feb 2006 10:10:11 -0000 1.13 *************** *** 23,26 **** --- 23,27 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Modellor; import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Project; *************** *** 180,183 **** --- 181,187 ---- add(new SurfaceContainer("Surface", surfaces)); add(new ContainerNode("Element")); + if (space.getModellor() != null) { + add(new ModellorNode(space.getModellor())); + } } } *************** *** 226,229 **** --- 230,246 ---- /** + * ModellorNode + */ + public class ModellorNode extends EntityNode { + /** + * Constructor + * @param modellor The modellor + */ + public ModellorNode(Modellor modellor) { + super(modellor); + } + } + + /** * CameraNode */ |
From: Michael L. <he...@us...> - 2006-02-08 10:10:18
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20027/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Added Modellor to Space in D-View Implemented Parametric in LayerModellor Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SpaceTool.java 6 Feb 2006 14:26:57 -0000 1.13 --- SpaceTool.java 8 Feb 2006 10:10:07 -0000 1.14 *************** *** 112,116 **** if (space != null) { Modellor modellor = new LayerModellor(space, surface, 0.5); ! modellor.update(modellor); } } --- 112,117 ---- if (space != null) { Modellor modellor = new LayerModellor(space, surface, 0.5); ! space.setModellor(modellor); ! space.changed(); } } |
From: Michael L. <he...@us...> - 2006-02-07 19:36:20
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25445/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Change to change-propagation and constraint handling Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Project.java 1 Feb 2006 09:37:57 -0000 1.34 --- Project.java 7 Feb 2006 12:49:59 -0000 1.35 *************** *** 196,199 **** --- 196,229 ---- } + /** + * Handle the fact that a collection of vertices has been changed. + * Re-evaluate constraints and modellors related to the vertices and connected + * edges and surfaces. + * @param vertices The changed vertices. + */ + public void changed(Collection vertices) { + HashSet edges = new HashSet(); + HashSet surfaces = new HashSet(); + { + Iterator iter = vertices.iterator(); + while (iter.hasNext()) { + Vertex current = (Vertex) iter.next(); + edges.addAll(current.getEdges()); + } + } + { + Iterator iter = edges.iterator(); + while (iter.hasNext()) { + Edge current = (Edge) iter.next(); + surfaces.addAll(current.getSurfaces()); + } + } + Iterator iter = surfaces.iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + updateConstraints(current); + } + } + /** |
From: Michael L. <he...@us...> - 2006-02-07 19:29:10
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25413/src/net/sourceforge/bprocessor/gl/tool Modified Files: MoveTool.java RotationTool.java Log Message: Change to change-propagation and constraint handling Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** MoveTool.java 1 Feb 2006 17:26:50 -0000 1.31 --- MoveTool.java 7 Feb 2006 12:49:55 -0000 1.32 *************** *** 111,118 **** } else { if (o instanceof Entity) { ! Project.getInstance().updateConstraints((Entity) o); } } } } /** --- 111,119 ---- } else { if (o instanceof Entity) { ! //Project.getInstance().updateConstraints((Entity) o); } } } + Project.getInstance().changed(vertices); } /** Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RotationTool.java 1 Feb 2006 10:04:28 -0000 1.8 --- RotationTool.java 7 Feb 2006 12:49:55 -0000 1.9 *************** *** 10,18 **** import net.sourceforge.bprocessor.gl.model.ClippingPlane; - import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; --- 10,18 ---- import net.sourceforge.bprocessor.gl.model.ClippingPlane; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Plane; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; *************** *** 81,98 **** /** - * Update selection - * - */ - protected void update() { - Iterator iter = selection.iterator(); - while (iter.hasNext()) { - Object o = iter.next(); - if (o instanceof Entity) { - Project.getInstance().updateConstraints((Entity) o); - } - } - } - - /** * Invoked when a mouse button has been pressed on a component. * @param e The MouseEvent object --- 81,84 ---- *************** *** 238,241 **** --- 224,228 ---- } } + Project.getInstance().changed(vertices); } |
From: Michael L. <he...@us...> - 2006-02-07 08:32:24
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16119/src/net/sourceforge/bprocessor/model Modified Files: LayerModellor.java Log Message: Direction of extrusion fixed in LayerModellor Index: LayerModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/LayerModellor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LayerModellor.java 6 Feb 2006 12:29:57 -0000 1.1 --- LayerModellor.java 7 Feb 2006 08:32:16 -0000 1.2 *************** *** 44,47 **** --- 44,50 ---- Set sides = new HashSet(); Surface bottom = surface.copy(interior); + if (surface.getBackDomain() == space) { + bottom.flip(); + } Surface top = bottom.extrude(distance, sides); space.setInterior(interior); |
From: Michael L. <he...@us...> - 2006-02-06 14:27:10
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5071/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Draws interior mesh in spaces. PopupMenu for adding LayerModellor (does not work properly yet). Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** View.java 2 Feb 2006 14:18:31 -0000 1.57 --- View.java 6 Feb 2006 14:26:56 -0000 1.58 *************** *** 14,17 **** --- 14,18 ---- import net.sourceforge.bprocessor.model.CoordinateSystem; + import net.sourceforge.bprocessor.model.Mesh; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Camera; *************** *** 1307,1313 **** * Draw all edges * @param gld The GLDrawable */ ! private void drawEdges(GLDrawable gld) { ! Collection edges = Project.getInstance().getEdges(); GL gl = gld.getGL(); GLU glu = gld.getGLU(); --- 1308,1314 ---- * Draw all edges * @param gld The GLDrawable + * @param edges The edges */ ! private void drawEdges(GLDrawable gld, Collection edges) { GL gl = gld.getGL(); GLU glu = gld.getGLU(); *************** *** 1462,1465 **** --- 1463,1472 ---- while (spaceIter.hasNext()) { Space space = (Space) spaceIter.next(); + Mesh interior = space.getInterior(); + if (interior != null) { + gl.glColor3fv(CONSTRUCTOR_COLOR); + drawSurfaces(gld, interior.getSurfaces(), BOTH); + drawEdges(gld, interior.getEdges()); + } } } |
From: Michael L. <he...@us...> - 2006-02-06 14:27:10
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5071/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Draws interior mesh in spaces. PopupMenu for adding LayerModellor (does not work properly yet). Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SpaceTool.java 6 Feb 2006 07:41:15 -0000 1.12 --- SpaceTool.java 6 Feb 2006 14:26:57 -0000 1.13 *************** *** 27,30 **** --- 27,31 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.LayerModellor; import net.sourceforge.bprocessor.model.Modellor; import net.sourceforge.bprocessor.model.Project; *************** *** 82,85 **** --- 83,120 ---- } + + /** + * MenuAction for making layers on spaces + */ + protected class LayerAction extends MenuAction { + /** The space */ + private Space space; + + /** The surface */ + private Surface surface; + + /** + * Constructor + * @param space The space + * @param surface The surface + */ + public LayerAction(Space space, Surface surface) { + super(); + this.space = space; + this.surface = surface; + } + + /** + * ActionPerformed + * @param event The action event + */ + public void actionPerformed(ActionEvent event) { + if (space != null) { + Modellor modellor = new LayerModellor(space, surface, 0.5); + modellor.update(modellor); + } + } + } + /** * Create a popup for performing operations on selection *************** *** 87,112 **** */ protected JPopupMenu makeSelectionMenu() { ! JPopupMenu menu = new JPopupMenu(); ! JMenuItem offsetItem = new JMenuItem("Offset Constraint"); ! offsetItem.addActionListener(new MenuAction() { ! public void actionPerformed(ActionEvent event) { ! addOffsetConstraint(selection); } ! } ! ); ! menu.add(offsetItem); ! menu.addSeparator(); ! JMenuItem cylinderItem = new JMenuItem("Cylinder"); ! cylinderItem.addActionListener(new MenuAction() { ! public void actionPerformed(ActionEvent event) { ! createCylinder(selection); ! } ! } ! ); ! menu.add(cylinderItem); ! return menu; } --- 122,177 ---- */ protected JPopupMenu makeSelectionMenu() { ! ! if (target instanceof String) { ! String type = (String) target; ! JPopupMenu menu = new JPopupMenu(); ! JMenuItem layerItem = new JMenuItem("Layer"); ! System.out.println(target); ! Surface surface = null; ! Space space = null; ! ! Iterator iter = selection.iterator(); ! while (iter.hasNext()) { ! Object current = iter.next(); ! if (current instanceof Surface) { ! surface = (Surface) current; ! } } ! if (surface != null) { ! if (type.equals("front")) { ! space = surface.getFrontDomain(); ! } ! if (type.equals("back")) { ! space = surface.getBackDomain(); ! } ! } ! layerItem.addActionListener(new LayerAction(space, surface)); ! menu.add(layerItem); ! return menu; ! } else { ! JPopupMenu menu = new JPopupMenu(); ! JMenuItem offsetItem = new JMenuItem("Offset Constraint"); ! offsetItem.addActionListener(new MenuAction() { ! public void actionPerformed(ActionEvent event) { ! addOffsetConstraint(selection); ! } ! } ! ); ! menu.add(offsetItem); ! menu.addSeparator(); ! JMenuItem cylinderItem = new JMenuItem("Cylinder"); ! cylinderItem.addActionListener(new MenuAction() { ! public void actionPerformed(ActionEvent event) { ! createCylinder(selection); ! } ! } ! ); ! menu.add(cylinderItem); ! ! return menu; ! } } |
From: Michael L. <he...@us...> - 2006-02-06 12:30:12
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13675/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Added Files: LayerModellor.java Log Message: LayerModellor added (untested) Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** Surface.java 3 Feb 2006 13:01:49 -0000 1.72 --- Surface.java 6 Feb 2006 12:29:57 -0000 1.73 *************** *** 298,304 **** /** * Return a copy of this Surface * @return The copy */ ! public Surface copy() { Surface surface = new Surface(); --- 298,305 ---- /** * Return a copy of this Surface + * @param mesh The mesh to copy into * @return The copy */ ! public Surface copy(Mesh mesh) { Surface surface = new Surface(); *************** *** 310,333 **** Edge newEdge = new Edge(); Vertex from = current.getFrom(); ! Vertex newFrom = (Vertex) map.get(from.getId()); if (newFrom == null) { newFrom = from.copy(); ! map.put(from.getId(), newFrom); ! getMesh().add(newFrom); } newEdge.setFrom(newFrom); Vertex to = current.getTo(); ! Vertex newTo = (Vertex) map.get(to.getId()); if (newTo == null) { newTo = to.copy(); ! map.put(to.getId(), newTo); ! getMesh().add(newTo); } newEdge.setTo(newTo); ! getMesh().add(newEdge); edges.add(newEdge); } surface.setEdges(edges); ! getMesh().add(surface); return surface; } --- 311,334 ---- Edge newEdge = new Edge(); Vertex from = current.getFrom(); ! Vertex newFrom = (Vertex) map.get(from); if (newFrom == null) { newFrom = from.copy(); ! map.put(from, newFrom); ! mesh.add(newFrom); } newEdge.setFrom(newFrom); Vertex to = current.getTo(); ! Vertex newTo = (Vertex) map.get(to); if (newTo == null) { newTo = to.copy(); ! map.put(to, newTo); ! mesh.add(newTo); } newEdge.setTo(newTo); ! mesh.add(newEdge); edges.add(newEdge); } surface.setEdges(edges); ! mesh.add(surface); return surface; } --- NEW FILE: LayerModellor.java --- //--------------------------------------------------------------------------------- // $Id: LayerModellor.java,v 1.1 2006/02/06 12:29:57 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; import java.util.HashSet; import java.util.Set; /** * Modellor */ public class LayerModellor extends Modellor { /** The space */ private Space space; /** The surface */ private Surface surface; /** The distance */ private double distance; /** * Constructor for LayerModellor * @param space The space to contain the layer * @param surface The surface to extrude * @param distance The distance of the xtrusion */ public LayerModellor(Space space, Surface surface, double distance) { super(); this.space = space; this.surface = surface; this.distance = distance; } /** * Update the geometry. * @param entity The changed entity */ public void update(Object entity) { Mesh interior = new Mesh(); Set sides = new HashSet(); Surface bottom = surface.copy(interior); Surface top = bottom.extrude(distance, sides); space.setInterior(interior); } /** * Return null as center * @return Null */ public Vertex center() { return null; } } |
From: Michael L. <he...@us...> - 2006-02-06 10:58:16
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5864 Modified Files: build.xml Log Message: New version string Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** build.xml 22 Dec 2005 11:34:51 -0000 1.11 --- build.xml 6 Feb 2006 10:58:07 -0000 1.12 *************** *** 3,7 **** <target name="init"> <property name="project" value="bprocessor"/> ! <property name="version" value="M3a"/> <property name="script.dir" value="${basedir}/bin"/> --- 3,7 ---- <target name="init"> <property name="project" value="bprocessor"/> ! <property name="version" value="M3a-development"/> <property name="script.dir" value="${basedir}/bin"/> |
From: Michael L. <he...@us...> - 2006-02-06 07:41:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8469/src/net/sourceforge/bprocessor/model Modified Files: Space.java Modellor.java Log Message: Elements and interior added to Space Index: Modellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Modellor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Modellor.java 30 Jan 2006 10:04:50 -0000 1.2 --- Modellor.java 6 Feb 2006 07:41:23 -0000 1.3 *************** *** 13,20 **** * established at the creation of the Modellor. */ ! public interface Modellor { /** * Generate a list of surfaces. */ ! public void generate(); } --- 13,21 ---- * established at the creation of the Modellor. */ ! public abstract class Modellor extends Entity implements Observer { /** * Generate a list of surfaces. + * @param entity Changed entity */ ! public abstract void update(Object entity); } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Space.java 1 Feb 2006 09:00:23 -0000 1.16 --- Space.java 6 Feb 2006 07:41:23 -0000 1.17 *************** *** 8,11 **** --- 8,13 ---- import java.util.HashSet; + import java.util.LinkedList; + import java.util.List; import java.util.Set; *************** *** 28,31 **** --- 30,37 ---- /** The envelope (a set of surfaces) */ private Set envelope; + /** The elements (a list of spaces) */ + private List elements; + /** The interior mesh */ + private Mesh interior; *************** *** 124,127 **** --- 130,150 ---- /** + * Get the interior mesh + * @return The interior mesh + */ + public Mesh getInterior() { + return interior; + } + + /** + * Set the interior mesh + * @param mesh The mesh + */ + public void setInterior(Mesh mesh) { + interior = mesh; + } + + + /** * Get the surfaces * @return The surfaces *************** *** 175,178 **** --- 198,221 ---- /** + * Add a space as element + * @param element The space to add as element + */ + public void add(Space element) { + if (elements == null) { + elements = new LinkedList(); + } + elements.add(element); + } + + /** + * Remove a space as element + * @param element The space to remove as element + */ + public void remove(Space element) { + elements.remove(element); + } + + + /** * String representation of the object * @return The string |
From: Michael L. <he...@us...> - 2006-02-06 07:41:27
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8441/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributePanel.java Log Message: Elements and interior added to Space Index: AttributePanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributePanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AttributePanel.java 3 Feb 2006 15:23:00 -0000 1.1 --- AttributePanel.java 6 Feb 2006 07:41:19 -0000 1.2 *************** *** 209,213 **** add(hfiller); ! JLabel x = new JLabel("X: "); con.anchor = GridBagConstraints.NORTH; con.gridwidth = 1; --- 209,213 ---- add(hfiller); ! JLabel x = new JLabel("x: "); con.anchor = GridBagConstraints.NORTH; con.gridwidth = 1; *************** *** 227,231 **** xEdit.addKeyListener(new MyKeyListener(o, XCOOR)); ! JLabel y = new JLabel("Y: "); con.gridwidth = 1; con.weightx = 0; --- 227,231 ---- xEdit.addKeyListener(new MyKeyListener(o, XCOOR)); ! JLabel y = new JLabel("y: "); con.gridwidth = 1; con.weightx = 0; *************** *** 245,249 **** yEdit.addKeyListener(new MyKeyListener(o, YCOOR)); ! JLabel z = new JLabel("Z: "); con.gridwidth = 1; con.weightx = 0; --- 245,249 ---- yEdit.addKeyListener(new MyKeyListener(o, YCOOR)); ! JLabel z = new JLabel("z: "); con.gridwidth = 1; con.weightx = 0; |
From: Michael L. <he...@us...> - 2006-02-06 07:41:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8409/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Elements and interior added to Space Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SpaceTool.java 30 Jan 2006 15:20:18 -0000 1.11 --- SpaceTool.java 6 Feb 2006 07:41:15 -0000 1.12 *************** *** 138,142 **** * The cylinder class parametrically generates a cylinder. */ ! public class Cylinder implements Modellor { /** radius */ --- 138,142 ---- * The cylinder class parametrically generates a cylinder. */ ! public class Cylinder extends Modellor { /** radius */ *************** *** 157,162 **** /*** * Generate a Cylinder */ ! public void generate() { /** Origin */ Vertex o = new Vertex(0, 0, 0); --- 157,163 ---- /*** * Generate a Cylinder + * @param entity Changed entity */ ! public void update(Object entity) { /** Origin */ Vertex o = new Vertex(0, 0, 0); *************** *** 223,227 **** } } ! } --- 224,235 ---- } } ! ! /** ! * Return null for center ! * @return Center ! */ ! public Vertex center() { ! return null; ! } } *************** *** 232,236 **** protected void createCylinder(Collection objects) { Modellor modellor = new Cylinder(); ! modellor.generate(); } --- 240,244 ---- protected void createCylinder(Collection objects) { Modellor modellor = new Cylinder(); ! modellor.update(modellor); } |