bprocessor-commit Mailing List for B-processor (Page 91)
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-11-12 23:02:49
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8264/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: Fixups in the facde. Including making undo work better. Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** FacadeModellor.java 6 Nov 2006 11:01:03 -0000 1.27 --- FacadeModellor.java 12 Nov 2006 23:02:46 -0000 1.28 *************** *** 141,145 **** depth = 0.2; createPostConstructors(); ! createFacade(); } --- 141,146 ---- depth = 0.2; createPostConstructors(); ! createFacade(); ! Project.getInstance().checkpoint(); } *************** *** 168,172 **** } } - /** * Creates the facade based on its type. --- 169,172 ---- *************** *** 194,197 **** --- 194,206 ---- } } + if (topBound != null && + leftBound != null && + bottomBound != null && + rightBound != null) { + space.add(topBound); + space.add(leftBound); + space.add(bottomBound); + space.add(rightBound); + } if (type == SINGLE_BAR) { createFrame(); *************** *** 203,220 **** */ private void removeConstructors() { ! { ! Iterator it = vertCons.iterator(); ! while (it.hasNext()) { ! space.remove((Constructor)it.next()); ! } ! vertCons = new LinkedList(); } ! { ! Iterator it = horCons.iterator(); ! while (it.hasNext()) { ! space.remove((Constructor)it.next()); ! } ! horCons = new LinkedList(); } } /** --- 212,226 ---- */ private void removeConstructors() { ! Iterator it = vertCons.iterator(); ! while (it.hasNext()) { ! space.remove((Constructor)it.next()); } ! it = horCons.iterator(); ! while (it.hasNext()) { ! space.remove((Constructor)it.next()); } + + vertCons = new LinkedList(); + horCons = new LinkedList(); } /** *************** *** 447,453 **** leftBound = new Line(cross.add(leftOffset), vertDir); bottomBound = new Line(cross.add(bottomOffset), horDir); ! rightBound = new Line(cross.add(rightOffset), vertDir); } createSegmentLines(); } } --- 453,468 ---- leftBound = new Line(cross.add(leftOffset), vertDir); bottomBound = new Line(cross.add(bottomOffset), horDir); ! rightBound = new Line(cross.add(rightOffset), vertDir); ! space.add(topBound); ! space.add(leftBound); ! space.add(bottomBound); ! space.add(rightBound); } createSegmentLines(); + } else { + /** The front surface is somehow out of shape */ + removeConstructors(); + removeSegmentLines(); + removeFacade(); } } *************** *** 525,529 **** */ private void createWindows() { ! if (front != null && depth > 0) { Vertex vDir = new Vertex(0, 0, 0); Vertex hDir = new Vertex(0, 0, 0); --- 540,545 ---- */ private void createWindows() { ! if (front != null && depth > 0 && ! vertSegs[0][0] != null && horSegs[0][0] != null) { Vertex vDir = new Vertex(0, 0, 0); Vertex hDir = new Vertex(0, 0, 0); |
From: Nordholt <nor...@us...> - 2006-11-12 23:00:39
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7341/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: less annoying exception handling on concurrent modfication in the spacechecker. Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** GUI.java 6 Nov 2006 16:19:00 -0000 1.49 --- GUI.java 12 Nov 2006 23:00:34 -0000 1.50 *************** *** 27,30 **** --- 27,31 ---- import net.sourceforge.bprocessor.model.Space; + import java.util.ConcurrentModificationException; import java.util.Iterator; import java.util.Set; *************** *** 488,491 **** --- 489,495 ---- } sleep(1000); + } catch (ConcurrentModificationException e) { + //Something is done to the spaces while they are being checked. + log.info("Concurrent modification in spacechecker"); } catch (Exception e) { e.printStackTrace(); |
From: Nordholt <nor...@us...> - 2006-11-12 22:59:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6729/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: remembering to copy transparent attribute of spaces. Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** Space.java 10 Nov 2006 13:48:44 -0000 1.98 --- Space.java 12 Nov 2006 22:59:03 -0000 1.99 *************** *** 1647,1650 **** --- 1647,1651 ---- copy.setName(this.getName()); copy.setUnion(this.isUnion()); + copy.setTransparent(transparent); Set envelopeCopy = copyEnvelope(copiedVertices, copiedEdges, |
From: Nordholt <nor...@us...> - 2006-11-12 22:58:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6430/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: sanity check when loading connected geometry, sometimes this was null Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Persistence.java 6 Nov 2006 14:04:27 -0000 1.19 --- Persistence.java 12 Nov 2006 22:58:29 -0000 1.20 *************** *** 245,249 **** while (cs.hasNext()) { Long l = (Long)cs.next(); ! connected.add(get(l.longValue(), mapper)); } c.connect(connected); --- 245,252 ---- while (cs.hasNext()) { Long l = (Long)cs.next(); ! Object g = get(l.longValue(), mapper); ! if (g instanceof Geometric) { ! connected.add(g); ! } } c.connect(connected); |
From: Nordholt <nor...@us...> - 2006-11-12 22:57:18
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5976/src/net/sourceforge/bprocessor/model Modified Files: Constructor.java Log Message: sanity check in the collect method Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Constructor.java 11 Sep 2006 14:55:06 -0000 1.13 --- Constructor.java 12 Nov 2006 22:57:06 -0000 1.14 *************** *** 111,115 **** Iterator it = connectedGeometry.iterator(); while (it.hasNext()) { ! res.addAll(((Geometric)it.next()).collect()); } return res; --- 111,118 ---- Iterator it = connectedGeometry.iterator(); while (it.hasNext()) { ! Object o = it.next(); ! if (o instanceof Geometric) { ! res.addAll(((Geometric)o).collect()); ! } } return res; |
From: Nordholt <nor...@us...> - 2006-11-12 20:35:27
|
Update of /cvsroot/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10821 Modified Files: .classpath Log Message: updated class path to make the camera class compile Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/model/.classpath,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** .classpath 10 Aug 2006 15:37:27 -0000 1.10 --- .classpath 12 Nov 2006 20:35:18 -0000 1.11 *************** *** 6,9 **** --- 6,10 ---- <classpathentry exported="true" kind="lib" path="/tools/jaxb/jaxb.jar"/> <classpathentry exported="true" kind="lib" path="/tools/antlr/antlr.jar"/> + <classpathentry kind="lib" path="/tools/jogl/jogl.jar"/> <classpathentry kind="lib" path="/tools/junit/junit.jar"/> <classpathentry exported="true" kind="lib" path="xml"/> |
From: Nikolaj B. <nbr...@us...> - 2006-11-10 13:48:51
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30349/src/net/sourceforge/bprocessor/model Modified Files: Classification.java Space.java Attribute.java Log Message: Further implementation of the classificaion view Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Attribute.java 30 Oct 2006 00:02:12 -0000 1.14 --- Attribute.java 10 Nov 2006 13:48:45 -0000 1.15 *************** *** 30,33 **** --- 30,36 ---- private Classification classification; + /** The level of the space ie if its space, element or part level */ + private int level; + /** The precision of the object */ private int precision; *************** *** 92,100 **** * @param value The value * @param classification The classification */ ! public Attribute(String name, Object value, Classification classification) { setName(name); setValue(value); setClassification(classification); editable = true; } --- 95,105 ---- * @param value The value * @param classification The classification + * @param level the level of the space ie 1: space, 2: element or 3: part */ ! public Attribute(String name, Object value, Classification classification, int level) { setName(name); setValue(value); setClassification(classification); + setLevel(level); editable = true; } *************** *** 208,211 **** --- 213,230 ---- } + /** + * @return Returns the level. + */ + public int getLevel() { + return level; + } + + /** + * @param level The level of the space. + */ + public void setLevel(int level) { + this.level = level; + } + } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** Space.java 7 Nov 2006 09:53:59 -0000 1.97 --- Space.java 10 Nov 2006 13:48:44 -0000 1.98 *************** *** 1425,1435 **** public List getAttributes() { ArrayList res = new ArrayList(); ! res.add(new Attribute("Name", getName())); ! res.add(new Attribute("ID", getId().toString(), false)); ! res.add(new Attribute("Owner", getOwner(), false)); if (getOwner() == Project.getInstance().world()) { if (isConstructionSpace()) { res.add(new Attribute("Classification", ! Project.getInstance().getClassification(), getClassification())); } else { //res.add(new Attribute("Classification", functionalOptions, getClassification())); --- 1425,1433 ---- public List getAttributes() { ArrayList res = new ArrayList(); ! //res.add(new Attribute("Name", getName())); if (getOwner() == Project.getInstance().world()) { if (isConstructionSpace()) { res.add(new Attribute("Classification", ! Project.getInstance().getClassification(), getClassification(), 1)); } else { //res.add(new Attribute("Classification", functionalOptions, getClassification())); *************** *** 1441,1448 **** if (getOwner().getClassification() != null) { res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification())); } else { res.add(new Attribute("Classification", ! Project.getInstance().getClassification(), getClassification())); } } else { --- 1439,1446 ---- if (getOwner().getClassification() != null) { res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification(), 2)); } else { res.add(new Attribute("Classification", ! Project.getInstance().getClassification(), getClassification(), 2)); } } else { *************** *** 1453,1460 **** if (getOwner().getClassification() != null) { res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification())); } else { res.add(new Attribute("Classification", ! Project.getInstance().getClassification(), getClassification())); } } else { --- 1451,1458 ---- if (getOwner().getClassification() != null) { res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification(), 3)); } else { res.add(new Attribute("Classification", ! Project.getInstance().getClassification(), getClassification(), 3)); } } else { *************** *** 1463,1466 **** --- 1461,1466 ---- } } + res.add(new Attribute("ID", getId().toString(), false)); + res.add(new Attribute("Owner", getOwner(), false)); if (isConstructionSpace()) { if (isTransparent()) { Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Classification.java 27 Oct 2006 10:25:14 -0000 1.2 --- Classification.java 10 Nov 2006 13:48:44 -0000 1.3 *************** *** 43,46 **** --- 43,55 ---- /** + * Constructor for a custom name element + * @param name the name + */ + public Classification(String name) { + setName(name); + setId(new Integer(-1)); + } + + /** * Constructor for base element */ |
From: Nikolaj B. <nbr...@us...> - 2006-11-10 13:48:17
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30315/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java Log Message: Further implementation of the classificaion view, and a minor bug fix Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** GenericPanel.java 6 Nov 2006 11:00:58 -0000 1.25 --- GenericPanel.java 10 Nov 2006 13:48:12 -0000 1.26 *************** *** 209,214 **** genAttributes.add(catext);; where.add(new AttributeRow(catext)); ! if (a.getClassification() != null) { ! where.add(new AttributeRow(catext)); // Handles the id part of classification ClassificationIdAttribute caid = new ClassificationIdAttribute(a); --- 209,213 ---- genAttributes.add(catext);; where.add(new AttributeRow(catext)); ! if (a.getClassification() != null && a.getClassification().getId().intValue() != -1) { // Handles the id part of classification ClassificationIdAttribute caid = new ClassificationIdAttribute(a); *************** *** 300,306 **** this.ga = ga; this.add(ga); ! if (ga.attribute().isEditable() || ga instanceof LinkAttribute ! || ga instanceof ClassificationTextAttribute) { ! ga.addMouseListener(this); } } --- 299,304 ---- this.ga = ga; this.add(ga); ! if (ga.attribute().isEditable() || ga instanceof LinkAttribute) { ! ga.addMouseListener(this); } } |
From: Nikolaj B. <nbr...@us...> - 2006-11-10 13:47:51
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29942/src/net/sourceforge/bprocessor/gui/attrview Modified Files: ClassificationIdAttribute.java ClassificationTextAttribute.java LinkAttribute.java Log Message: Further implementation of the classificaion view Index: ClassificationTextAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationTextAttribute.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassificationTextAttribute.java 30 Oct 2006 00:00:02 -0000 1.1 --- ClassificationTextAttribute.java 10 Nov 2006 13:47:41 -0000 1.2 *************** *** 11,27 **** import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JComponent; import javax.swing.JMenu; - import javax.swing.JMenuBar; import javax.swing.JMenuItem; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Classification; /** --- 11,41 ---- import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import java.awt.event.KeyEvent; + import java.awt.event.KeyListener; + import java.awt.event.MouseEvent; + import java.awt.event.MouseListener; + import java.net.URL; import java.util.Iterator; import java.util.LinkedList; import java.util.List; + import java.util.StringTokenizer; + import java.util.Vector; import javax.swing.Box; import javax.swing.BoxLayout; + import javax.swing.ImageIcon; import javax.swing.JComponent; + import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuItem; + import javax.swing.JPopupMenu; + import javax.swing.JTextField; + import javax.swing.text.AttributeSet; + import javax.swing.text.BadLocationException; + import javax.swing.text.PlainDocument; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Classification; + import net.sourceforge.bprocessor.model.Project; /** *************** *** 29,33 **** */ public class ClassificationTextAttribute extends GenericAttribute ! implements ActionListener { /** The listeners */ --- 43,47 ---- */ public class ClassificationTextAttribute extends GenericAttribute ! implements ActionListener, MouseListener, KeyListener { /** The listeners */ *************** *** 39,43 **** /** The component */ private JComponent component; ! --- 53,66 ---- /** The component */ private JComponent component; ! ! /** The link icon */ ! private JLabel icon; ! ! /** The popup menu */ ! private JPopupMenu classification; ! ! ! /** The editor, when this EditableAttribute is being edited */ ! private AutoCompleteField editor; *************** *** 53,57 **** Box column = Box.createVerticalBox(); component = Box.createHorizontalBox(); ! component.add(createMenu(attribute.getValue())); Box header = Box.createHorizontalBox(); header.add(Box.createHorizontalStrut(7)); --- 76,85 ---- Box column = Box.createVerticalBox(); component = Box.createHorizontalBox(); ! if (attribute.getClassification() != null) { ! component.add((JLabel) createValueLabel(attribute.getClassification())); ! } else { ! component.add(new JLabel("Classification")); ! } ! createMenu(attribute.getValue()); Box header = Box.createHorizontalBox(); header.add(Box.createHorizontalStrut(7)); *************** *** 61,69 **** --- 89,120 ---- column.add(header); column.add(Box.createRigidArea(new Dimension(70, 3))); + ClassLoader classloader = Thread.currentThread().getContextClassLoader(); + URL url = classloader.getResource("Biconlink.gif"); + icon = new JLabel(new ImageIcon(url)); this.add(column); + this.add(icon); } /** + * Add a mouselisterner to the active elements in the ClassificationTextAttribute + * @param mouseListener the mouselistener + */ + public void addMouseListener(MouseListener mouseListener) { + component.addMouseListener(mouseListener); + icon.addMouseListener(this); + } + + /** + * Remove a mouselisterner to the active elements in the ClassificationTextAttribute + * @param mouseListener the mouselistener + */ + public void removeMouseListener(MouseListener mouseListener) { + component.removeMouseListener(mouseListener); + icon.removeMouseListener(this); + } + + + /** * Add a listener that are notified when the value is changed * @param listener The listener *************** *** 95,110 **** * Create a value label * @param value The value - * @return The label */ ! private JComponent createMenu(Object value) { ! JMenuBar valueLabel = new JMenuBar(); ! JMenu menu, subMenu; MyMenuItem mi, submi; boolean hasChildren = false; - if (attribute.getClassification() != null) { - menu = new JMenu(attribute.getClassification().getName()); - } else { - menu = new JMenu("Classification"); - } Iterator it = ((Classification) value).getChildren().iterator(); while (it.hasNext()) { --- 146,155 ---- * Create a value label * @param value The value */ ! private void createMenu(Object value) { ! classification = new JPopupMenu(); ! JMenu subMenu; MyMenuItem mi, submi; boolean hasChildren = false; Iterator it = ((Classification) value).getChildren().iterator(); while (it.hasNext()) { *************** *** 125,141 **** subMenu.add(submi); } ! menu.add(subMenu); } else { mi = new MyMenuItem(current); mi.addActionListener(this); ! menu.add(mi); } } - valueLabel.add(menu); - return valueLabel; } /** --- 170,220 ---- subMenu.add(submi); } ! classification.add(subMenu); } else { mi = new MyMenuItem(current); mi.addActionListener(this); ! classification.add(mi); } } } + /** + * Create a value label + * @param value The value + * @return The label + */ + private JComponent createValueLabel(Classification value) { + JLabel valueLabel; + if (attribute.getClassification().getId().intValue() == -1) { + valueLabel = new JLabel(value.getName()); + } else { + if (attribute.getClassification() == null || + ((Classification)attribute.getValue()).getName(). + equalsIgnoreCase(attribute.getClassification().getParent().getName())) { + valueLabel = new JLabel(value.getName()); + } else { + //valueLabel = new JLabel(value.getParent().getName() + "." + value.getName()); + valueLabel = new JLabel(value.getName()); + } + } + return valueLabel; + } + /** + * Create a value editor + * @param value The value + * @param name the current name + * @return The value editor + */ + private JComponent createValueEditor(String name, Classification value) { + String s = ""; + if (!name.equalsIgnoreCase("Classification")) { + s = name; + } + AutoCompleteField valueEditor = new AutoCompleteField(s, (Classification) attribute.getValue()); + valueEditor.setFont(AttributeView.FONT_PLAIN); + return valueEditor; + } /** *************** *** 146,150 **** return attribute; } - /** --- 225,228 ---- *************** *** 193,218 **** /** ! * Not in use */ public void startEditing() { ! // TODO Auto-generated method stub ! } /** * Not in use */ ! public void stopEditing() { ! // TODO Auto-generated method stub ! } /** * Not in use */ ! public void cancelEditing() { ! // TODO Auto-generated method stub } } --- 271,523 ---- /** ! * Start editing */ public void startEditing() { ! if (editor == null) { ! editor = (AutoCompleteField) createValueEditor(((JLabel)component.getComponent(0)) ! .getText(), attribute.getClassification()); ! component.remove(0); ! editor.addKeyListener(this); ! component.add(editor); ! component.revalidate(); ! } ! editor.requestFocus(); ! editor.selectAll(); } + + /** + * Stop editing + */ + public void stopEditing() { + if (editor != null && attribute.isEditable()) { + Vector cur = ((Classification) attribute.getValue()).getChildren(); + Classification current; + Classification entered = null; + StringTokenizer st = new StringTokenizer(editor.getText(), "."); + while (st.hasMoreTokens()) { + String name = st.nextToken(); + Iterator it = cur.iterator(); + while (it.hasNext()) { + current = (Classification) it.next(); + if (current.getName().equalsIgnoreCase(name)) { + cur = current.getChildren(); + entered = current; + } + } + } + if (entered != null) { + attribute.setClassification(entered); + } else { + Classification newclas = new Classification(editor.getText()); + Project.getInstance().getClassification().addChild(newclas); + attribute.setClassification(newclas); + } + component.remove(editor); + editor.removeKeyListener(this); + editor = null; + component.add(createValueLabel((Classification) attribute.getClassification())); + component.revalidate(); + valueChanged(); + } + } + + /** + * Not in use + */ + public void cancelEditing() { + if (editor != null) { + component.remove(editor); + editor.removeKeyListener(this); + editor = null; + component.add(createValueLabel((Classification) attribute.getValue())); + component.revalidate(); + } + } + + /** + * Start editing on the view + * @param event The event + */ + public void mouseClicked(MouseEvent event) { } /** * Not in use + * @param event The MouseEvent */ ! public void mousePressed(MouseEvent event) { ! classification.show(event.getComponent(), ! event.getX(), event.getY()); ! } + + /** + * Not in use + * @param event The MouseEvent + */ + public void mouseReleased(MouseEvent event) { } + + /** + * Not in use + * @param event The MouseEvent + */ + public void mouseEntered(MouseEvent event) { } + + /** + * Not in use + * @param event The MouseEvent + */ + public void mouseExited(MouseEvent event) { } /** + * Respond to the enter key by stopping editing. + * @param event The KeyEvent + */ + public void keyPressed(KeyEvent event) { + if (event.getKeyCode() == KeyEvent.VK_ENTER) { + stopEditing(); + } else if (event.getKeyCode() == KeyEvent.VK_ESCAPE) { + cancelEditing(); + } + } + + /** * Not in use + * @param event The KeyEvent */ ! public void keyTyped(KeyEvent event) { } ! /** ! * Not in use ! * @param event The KeyEvent ! */ ! public void keyReleased(KeyEvent event) { } ! ! /** ! * Start editing on the view ! * @param event The event ! */ ! ! ! /** ! * Autocomplete textfield ! */ ! public class AutoCompleteField extends JTextField { ! /** The parent classification */ ! private Classification parent; + /** + * constructor of autocomplete field + * @param string is the number of colums in the field + * @param parent the parent to the classification + */ + public AutoCompleteField(String string, Classification parent) { + super(string); + this.setDocument(new AutoCompleteDocument(this, parent)); + this.setText(string); + } } + /** + * The autocomplete document + */ + public class AutoCompleteDocument extends PlainDocument { + /** The typed text */ + private String typed; + + /** The textfield */ + private JTextField field; + + /** The parent classification */ + private Classification parent; + + /** + * The AutoCompleteDocoment constructor + * @param field the Textfield + * @param parent the parent to the classification + */ + public AutoCompleteDocument(JTextField field, Classification parent) { + this.field = field; + this.parent = parent; + typed = ""; + } + + /** + * insertString, insert a string into the document + * @param offs the offset + * @param str the string to be inserted + * @param a the AttributeSet + * @throws BadLocationException is thrown if the location is out of place + */ + public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { + if (str == null) { + return; + } + if (offs < typed.length()) { + typed = typed.substring(0, offs) + str + typed.substring(offs, typed.length()); + } else { + typed = typed + str; + } + + super.remove(0, super.getLength()); + typed = autocomplete(typed); + super.insertString(0, typed, a); + field.setCaretPosition(offs + str.length()); + field.setSelectionStart(offs + str.length()); + field.setSelectionEnd(typed.length()); + } + + /** + * Autocomplete the given string + * @param string The string to autocomplete + * @return The result of the completion that is the given string if no completion + */ + public String autocomplete(String string) { + if (!string.equalsIgnoreCase("")) { + Vector cl = parent.getChildren(); + Vector sort = new Vector(); + boolean children = false; + Iterator it = cl.iterator(); + while (it.hasNext()) { + Classification current = (Classification) it.next(); + sort.add(current.toString()); + if (current.getChildren() != null) { + children = true; + } + if (children) { + Iterator subit = current.getChildren().iterator(); + while (subit.hasNext()) { + String conc = ""; + conc = current.toString() + "." + ((Classification) subit.next()).toString(); + sort.add(conc); + } + } + } + + LinkedList matches = new LinkedList(); + Iterator sortit = sort.iterator(); + while (sortit.hasNext()) { + String name = (String) sortit.next(); + if (name.startsWith(string)) { + matches.add(name); + return name; + } + } + } + return string; + } + + /** + * @param offs the ofset to remove from + * @param amount The number of characters to remove + * @throws BadLocationException if characters that do not exist is beeing removed + */ + public void remove(int offs, int amount) throws BadLocationException { + //FIXME + String typed1 = typed.substring(0, offs); + String typed2 = typed.substring(offs + amount, typed.length()); + typed = typed1.concat(typed2); + //String test = autocomplete(typed); + super.remove(offs, amount); + } + + } } Index: LinkAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/LinkAttribute.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** LinkAttribute.java 20 Oct 2006 17:04:50 -0000 1.14 --- LinkAttribute.java 10 Nov 2006 13:47:41 -0000 1.15 *************** *** 251,256 **** if (val instanceof String || val instanceof Entity) { attribute.setValue(editor.getText()); - } else if (val instanceof Double) { - attribute.setValue(Double.valueOf(editor.getText())); } component.remove(editor); --- 251,254 ---- *************** *** 422,426 **** } }; - LinkedList sort = new LinkedList(Project.getInstance().getSpaces()); Collections.sort(sort, alpha); --- 420,423 ---- Index: ClassificationIdAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationIdAttribute.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassificationIdAttribute.java 30 Oct 2006 00:00:02 -0000 1.1 --- ClassificationIdAttribute.java 10 Nov 2006 13:47:41 -0000 1.2 *************** *** 63,67 **** label = createLabel("Classification"); component = Box.createHorizontalBox(); ! if (!attribute.getClassification().getName().equalsIgnoreCase("Classification")) { component.add(createValueLabel(attribute.getClassification().getFullId())); } --- 63,68 ---- label = createLabel("Classification"); component = Box.createHorizontalBox(); ! if (!attribute.getClassification().getName().equalsIgnoreCase("Classification") && ! attribute.getClassification().getId().intValue() != -1) { component.add(createValueLabel(attribute.getClassification().getFullId())); } |
From: rimestad <rim...@us...> - 2006-11-07 10:51:39
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31939/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java CameraTreeView.java Log Message: changes to clippingplane tool and visualization Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** GenericTreeView.java 20 Oct 2006 17:04:50 -0000 1.60 --- GenericTreeView.java 7 Nov 2006 10:51:28 -0000 1.61 *************** *** 1212,1216 **** * Selection Listener */ ! private class SelectionListener implements TreeSelectionListener { /** * ValueChanged --- 1212,1216 ---- * Selection Listener */ ! protected class SelectionListener implements TreeSelectionListener { /** * ValueChanged *************** *** 1257,1261 **** * GenericMouseAdapter */ ! private class GenericMouseAdapter extends MouseAdapter { /** * Mouse pressed --- 1257,1261 ---- * GenericMouseAdapter */ ! protected class GenericMouseAdapter extends MouseAdapter { /** * Mouse pressed Index: CameraTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/CameraTreeView.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CameraTreeView.java 1 Nov 2006 14:32:48 -0000 1.10 --- CameraTreeView.java 7 Nov 2006 10:51:28 -0000 1.11 *************** *** 8,12 **** package net.sourceforge.bprocessor.gui.treeview; - import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; --- 8,11 ---- *************** *** 15,20 **** import java.util.Set; - import javax.swing.event.TreeSelectionEvent; - import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeSelectionModel; --- 14,17 ---- *************** *** 38,45 **** getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); this.addTreeSelectionListener(new SelectionListener()); ! Collection c = new ArrayList(); ! c.add(Project.getInstance().getCurrentCamera()); ! c.addAll(Project.getInstance().getCameras()); ! update(c, root); model.nodeStructureChanged(root); } --- 35,39 ---- getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); this.addTreeSelectionListener(new SelectionListener()); ! update(Project.getInstance().getCameras(), root); model.nodeStructureChanged(root); } *************** *** 119,151 **** */ public void update() { ! Collection c = new ArrayList(); ! c.add(Project.getInstance().getCurrentCamera()); ! c.addAll(Project.getInstance().getCameras()); ! update(c, root); ! } ! ! /** ! * Selection Listener ! */ ! private class SelectionListener implements TreeSelectionListener { ! /** ! * ValueChanged ! * @param event The Event ! */ ! public void valueChanged(TreeSelectionEvent event) { ! if (event.isAddedPath()) { ! Object object = event.getPath().getLastPathComponent(); ! if (object instanceof DefaultMutableTreeNode) { ! DefaultMutableTreeNode node = (DefaultMutableTreeNode) object; ! Object target = node.getUserObject(); ! if (target instanceof Camera) { ! if (Project.getInstance().getCurrentCamera() != target) { ! Camera c = new Camera((Camera)target, "(Current)"); ! Project.getInstance().setCurrentCamera(c); ! } ! Project.getInstance().changed(Project.getInstance()); ! } ! } ! } } } --- 113,120 ---- */ public void update() { ! int cc = root.getChildCount(); ! update(Project.getInstance().getCameras(), root); ! if (cc == 0) { ! model.nodeStructureChanged(root); } } |
From: rimestad <rim...@us...> - 2006-11-07 10:51:26
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31928/src/net/sourceforge/bprocessor/model Modified Files: Edge.java ClippingPlane.java Camera.java Plane.java Log Message: changes to clippingplane tool and visualization Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ClippingPlane.java 30 Oct 2006 10:42:17 -0000 1.12 --- ClippingPlane.java 7 Nov 2006 10:51:24 -0000 1.13 *************** *** 8,11 **** --- 8,12 ---- import java.util.Collection; + import java.util.HashMap; import java.util.Iterator; import java.util.ArrayList; *************** *** 19,23 **** * The Clippingplane */ ! public class ClippingPlane extends Geometric implements Parametric { /** * --- 20,24 ---- * The Clippingplane */ ! public class ClippingPlane extends Geometric implements Parametric, Observer { /** * *************** *** 39,42 **** --- 40,46 ---- /** The silluet */ private ArrayList silluet; + + /** The edge map */ + private HashMap toModel; /** The plane of the clipingplane */ *************** *** 46,54 **** private boolean isActive; ! /** The depth of the cut, if 0 the cut is infinit */ ! private double clipdepth = 0; ! ! /** The joined clippingplane */ ! private ClippingPlane friend; /** --- 50,55 ---- private boolean isActive; ! /** To make a visual slice */ ! private boolean slice = false; /** *************** *** 62,65 **** --- 63,68 ---- this.silluet = new ArrayList(); this.corners = new ArrayList(); + this.toModel = new HashMap(); + Project.getInstance().addObserver(this); update(); } *************** *** 71,75 **** public Plane getPlane() { if (plane == null) { ! plane = cs.plane(); } return plane; --- 74,83 ---- public Plane getPlane() { if (plane == null) { ! CoordinateSystem c = cs.copy(); ! Vertex n = c.getN().copy(); ! n.normalize(); ! n.scale(0.01); ! c.move(n.getX(), n.getY(), n.getZ()); ! plane = c.plane(); } return plane; *************** *** 137,143 **** Camera c = Project.getInstance().getCurrentCamera(); c.removeClipplane(this); - if (friend != null) { - c.removeClipplane(friend); - } } --- 145,148 ---- *************** *** 167,178 **** */ public Collection findIntersections() { Space space = Project.getInstance().getActiveSpace(); Collection edges = Geometry.getActiveEdges(space); ! ArrayList silluet = new ArrayList(); Collection res = new ArrayList(); Iterator it = edges.iterator(); while (it.hasNext()) { Edge e = (Edge)it.next(); ! Vertex v = getPlane().intersection(e); if (v != null) { res.add(v); --- 172,185 ---- */ public Collection findIntersections() { + toModel.clear(); Space space = Project.getInstance().getActiveSpace(); Collection edges = Geometry.getActiveEdges(space); ! silluet.clear(); Collection res = new ArrayList(); + Plane plan = cs.plane(); Iterator it = edges.iterator(); while (it.hasNext()) { Edge e = (Edge)it.next(); ! Vertex v = plan.intersection(e); if (v != null) { res.add(v); *************** *** 180,189 **** Vertex transTo = cs.translate(e.getTo()); Vertex transFrom = cs.translate(e.getFrom()); ! if (Math.abs(transTo.getZ()) < 0.01 && ! Math.abs(transFrom.getZ()) < 0.01) { res.add(e.getTo().copy()); res.add(e.getFrom().copy()); Edge eCopy = e.copy(); ! eCopy.setStrippled(true); silluet.add(eCopy); } --- 187,198 ---- Vertex transTo = cs.translate(e.getTo()); Vertex transFrom = cs.translate(e.getFrom()); ! if (Math.abs(transTo.getZ()) < 0.00001 && ! Math.abs(transFrom.getZ()) < 0.00001) { res.add(e.getTo().copy()); res.add(e.getFrom().copy()); Edge eCopy = e.copy(); ! // edges should be solid ! eCopy.setStrippled(false); ! toModel.put(eCopy, e); silluet.add(eCopy); } *************** *** 198,202 **** while (iter.hasNext()) { Edge e = (Edge)iter.next(); ! Vertex v = getPlane().intersection(e); if (v != null) { if (first == null) { --- 207,211 ---- while (iter.hasNext()) { Edge e = (Edge)iter.next(); ! Vertex v = plan.intersection(e); if (v != null) { if (first == null) { *************** *** 207,210 **** --- 216,220 ---- first = null; silluet.add(newE); + toModel.put(newE, newE); break; } *************** *** 212,218 **** } } - if (silluet.size() > 0) { - this.silluet = silluet; - } return res; } --- 222,225 ---- *************** *** 291,297 **** public void setActive(boolean isActive) { this.isActive = isActive; - if (friend != null) { - friend.isActive = isActive; - } } --- 298,301 ---- *************** *** 299,305 **** public void move(double x, double y, double z) { center().move(x, y, z); ! if (friend != null) { ! friend.center().move(x, y, z); ! } } --- 303,307 ---- public void move(double x, double y, double z) { center().move(x, y, z); ! update(); } *************** *** 313,319 **** */ public List getAttributes() { - if (friend != null && clipdepth == 0) { - return friend.getAttributes(); - } ArrayList res = new ArrayList(); if (isActive()) { --- 315,318 ---- *************** *** 322,327 **** res.add(new Attribute("isActive", Boolean.FALSE)); } ! res.add(new Attribute("Clip depth", new Double(clipdepth))); ! res.add(new Attribute("Friend", friend, false)); return res; } --- 321,330 ---- res.add(new Attribute("isActive", Boolean.FALSE)); } ! if (isSlice()) { ! res.add(new Attribute("isSlice", Boolean.TRUE)); ! } else { ! res.add(new Attribute("isSlice", Boolean.FALSE)); ! } ! res.add(new Attribute("Flip", Boolean.FALSE)); return res; } *************** *** 339,345 **** */ public void setAttributes(List attributes) { - if (friend != null && clipdepth == 0) { - friend.setAttributes(attributes); - } Iterator iter = attributes.iterator(); while (iter.hasNext()) { --- 342,345 ---- *************** *** 347,392 **** if (a.getName().equals("isActive")) { setActive(((Boolean)a.getValue()).booleanValue()); ! } else if (a.getName().equals("Clip depth")) { ! setClipdepth(((Double)a.getValue()).doubleValue()); } else { log.warn("Don't know attribute " + a.getName()); } } } /** ! * Return the clipdepth ! * @return the clipdepth */ ! public double getClipdepth() { ! return clipdepth; } /** ! * Setter for the clipdepth ! * @param clipdepth the new clipdepth */ ! public void setClipdepth(double clipdepth) { ! this.clipdepth = Math.abs(clipdepth); ! if (clipdepth != 0) { ! if (friend != null) { ! Project.getInstance().getCurrentCamera().removeClipplane(friend); ! } ! //make a new friend ! CoordinateSystem newcs = cs.copy(); ! newcs.flip(); ! Vertex move = newcs.n.copy(); ! move.scale(-clipdepth); ! newcs.move(move.getX(), move.getY(), move.getZ()); ! ClippingPlane cp = new ClippingPlane(newcs); ! Project.getInstance().getCurrentCamera().addClipplane(cp); ! cp.friend = this; ! this.friend = cp; ! } else { ! if (friend != null) { ! Project.getInstance().getCurrentCamera().removeClipplane(friend); } - friend = null; } } } --- 347,398 ---- if (a.getName().equals("isActive")) { setActive(((Boolean)a.getValue()).booleanValue()); ! } else if (a.getName().equals("isSlice")) { ! setSlice(((Boolean)a.getValue()).booleanValue()); ! } else if (a.getName().equals("Flip")) { ! if ((Boolean)a.getValue() == Boolean.TRUE) { ! cs.flip(); ! } } else { log.warn("Don't know attribute " + a.getName()); } } + update(); } /** ! * @return Returns the slice. */ ! public boolean isSlice() { ! return slice; } /** ! * @param slice The slice to set. */ ! public void setSlice(boolean slice) { ! this.slice = slice; ! } ! ! /** ! * Find the edge or surface the given edge corrospond to in the model ! * @param e the Edge in the conture ! * @return The geometry in the model or null if none ! */ ! public Geometric toModel(Edge e) { ! if (toModel != null) { ! Object o = toModel.get(e); ! if (o != null) { ! return (Geometric)o; } } + return null; + } + + /** + * Update + * @param entity Changed entity + */ + public void update(Object entity) { + update(); } } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Edge.java 2 Nov 2006 14:45:38 -0000 1.64 --- Edge.java 7 Nov 2006 10:51:24 -0000 1.65 *************** *** 310,314 **** */ public Edge intersection(Edge other) { ! Vertex p1 = this.getFrom(); Vertex p2 = this.getTo(); --- 310,325 ---- */ public Edge intersection(Edge other) { ! if (this.getLength() < 0.0000001) { ! if (other.getLength() < 0.0000001) { ! return new Edge(this.getFrom(), other.getFrom()); ! } else { ! //have to find the sortest edge from this (point) to other (edge) ! //by use of projection ! Vertex v1 = other.getDirection(); ! Vertex v2 = new Edge(other.getFrom(), this.getFrom()).getDirection(); ! Vertex proj = v2.projectOnto(v1); ! return new Edge(other.getFrom().add(proj), this.getFrom()); ! } ! } Vertex p1 = this.getFrom(); Vertex p2 = this.getTo(); Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Camera.java 31 Oct 2006 14:22:51 -0000 1.25 --- Camera.java 7 Nov 2006 10:51:24 -0000 1.26 *************** *** 16,19 **** --- 16,21 ---- import org.apache.log4j.Logger; + import net.java.games.jogl.GL; + /** * Camera for view placement in the model have a center and at camera position *************** *** 564,571 **** */ public void addClipplane(ClippingPlane cp) { ! clipplanes.add(cp); ! int num = clipplanes.indexOf(cp); ! log.info("Got number " + num); ! cp.setNumber(num); } --- 566,574 ---- */ public void addClipplane(ClippingPlane cp) { ! if (clipplanes.size() < GL.GL_MAX_CLIP_PLANES - 1) { ! clipplanes.add(cp); ! int num = clipplanes.indexOf(cp); ! cp.setNumber(num); ! } } *************** *** 577,579 **** --- 580,626 ---- clipplanes.remove(cp); } + + /** + * Static modification of the camera to point down on the current center + * @param currentCamera The camera to change + */ + public static void makeTop(Camera currentCamera) { + double[] center = currentCamera.getCenter(); + double dist = currentCamera.dist(); + currentCamera.camera = new double[]{center[0], center[1], center[2] + dist}; + currentCamera.roll = new double[]{0, 1, 0}; + } + + /** + * Static modification of the camera + * @param currentCamera The camera to change + */ + public static void makeButtom(Camera currentCamera) { + double[] center = currentCamera.getCenter(); + double dist = currentCamera.dist(); + currentCamera.camera = new double[]{center[0], center[1], center[2] - dist}; + currentCamera.roll = new double[]{0, 1, 0}; + } + + /** + * Static modification of the camera + * @param currentCamera The camera to change + */ + public static void makeLeft(Camera currentCamera) { + double[] center = currentCamera.getCenter(); + double dist = currentCamera.dist(); + currentCamera.camera = new double[]{center[0], center[1] - dist, center[2]}; + currentCamera.roll = new double[]{0, 0, 1}; + } + + /** + * Static modification of the camera + * @param currentCamera The camera to change + */ + public static void makeRight(Camera currentCamera) { + double[] center = currentCamera.getCenter(); + double dist = currentCamera.dist(); + currentCamera.camera = new double[]{center[0], center[1] + dist, center[2]}; + currentCamera.roll = new double[]{0, 0, 1}; + } } Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Plane.java 21 Aug 2006 20:32:17 -0000 1.25 --- Plane.java 7 Nov 2006 10:51:24 -0000 1.26 *************** *** 189,193 **** double v0 = -(a * x0 + b * y0 + c * z0 + d); double t = v0 / vd; ! if (!endless && (t < -0.001 || t > 1.001)) { return null; } --- 189,193 ---- double v0 = -(a * x0 + b * y0 + c * z0 + d); double t = v0 / vd; ! if (!endless && (t < 0.001 || t > 1.001)) { return null; } |
From: rimestad <rim...@us...> - 2006-11-07 10:51:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31909/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java ClipplaneTool.java Log Message: changes to clippingplane tool and visualization Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** ToolFactory.java 31 Oct 2006 14:22:46 -0000 1.63 --- ToolFactory.java 7 Nov 2006 10:51:19 -0000 1.64 *************** *** 236,262 **** tb.addSeparator(10); ! Action orthoAction = new ToolAction(glv, 0, "Borto.gif") { ! public void actionPerformed(ActionEvent agr0) { ! Project.getInstance().getCurrentCamera().setType(Camera.ORTHOGRAPHIC); ! glv.repaint(); ! } ! }; ! Action perspAction = new ToolAction(glv, 0, "Bpers.gif") { ! public void actionPerformed(ActionEvent agr0) { ! Project.getInstance().getCurrentCamera().setType(Camera.PERSPECTIVE); ! glv.repaint(); ! } ! }; ButtonGroup viewGroup = new ButtonGroup(); JToggleButton perspBut = Toolbar.getInstance().registerAction(perspAction); perspBut.setToolTipText("Perspective"); ! perspBut.setMnemonic(KeyEvent.VK_J); viewGroup.add(perspBut); JToggleButton orthoBut = Toolbar.getInstance().registerAction(orthoAction); orthoBut.setToolTipText("Orthographic"); ! orthoBut.setMnemonic(KeyEvent.VK_K); viewGroup.add(orthoBut); perspBut.setSelected(true); --- 236,291 ---- tb.addSeparator(10); ! Action orthoAction = new ToolAction(glv, 0, "Borto.gif") { ! public void actionPerformed(ActionEvent agr0) { ! Project.getInstance().getCurrentCamera().setType(Camera.ORTHOGRAPHIC); ! glv.repaint(); ! } ! }; ! Action perspAction = new ToolAction(glv, 0, "Bpers.gif") { ! public void actionPerformed(ActionEvent agr0) { ! Project.getInstance().getCurrentCamera().setType(Camera.PERSPECTIVE); ! glv.repaint(); ! } ! }; ! ! Action topAction = new ToolAction(glv, 0, "xyicon.png") { ! public void actionPerformed(ActionEvent arg0) { ! Camera.makeTop(Project.getInstance().getCurrentCamera()); ! glv.repaint(); ! } ! }; ! Action butAction = new ToolAction(glv, 0, "xyicon.png") { ! public void actionPerformed(ActionEvent arg0) { ! Camera.makeButtom(Project.getInstance().getCurrentCamera()); ! glv.repaint(); ! } ! }; ! Action leftAction = new ToolAction(glv, 0, "xzicon.png") { ! public void actionPerformed(ActionEvent arg0) { ! Camera.makeLeft(Project.getInstance().getCurrentCamera()); ! glv.repaint(); ! } ! }; ! Action rightAction = new ToolAction(glv, 0, "xzicon.png") { ! public void actionPerformed(ActionEvent arg0) { ! Camera.makeRight(Project.getInstance().getCurrentCamera()); ! glv.repaint(); ! } ! }; ! Toolbar.getInstance().registerPushButtonAction(topAction, "See from above"); ! Toolbar.getInstance().registerPushButtonAction(butAction, "See from below"); ! Toolbar.getInstance().registerPushButtonAction(leftAction, "See from left"); ! Toolbar.getInstance().registerPushButtonAction(rightAction, "See from right"); ButtonGroup viewGroup = new ButtonGroup(); JToggleButton perspBut = Toolbar.getInstance().registerAction(perspAction); perspBut.setToolTipText("Perspective"); ! perspBut.setMnemonic(KeyEvent.VK_P); viewGroup.add(perspBut); JToggleButton orthoBut = Toolbar.getInstance().registerAction(orthoAction); orthoBut.setToolTipText("Orthographic"); ! orthoBut.setMnemonic(KeyEvent.VK_O); viewGroup.add(orthoBut); perspBut.setSelected(true); Index: ClipplaneTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ClipplaneTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ClipplaneTool.java 4 Jul 2006 09:37:00 -0000 1.9 --- ClipplaneTool.java 7 Nov 2006 10:51:19 -0000 1.10 *************** *** 49,60 **** Vertex i = system.getI(); Vertex j = system.getJ(); ! Vertex o = system.getOrigin(); boolean front = glv.getView().facingFront(system); if (front) { n.scale(-1); } - Vertex v = n.copy(); - v.scale(0.001); - o = o.add(v); system = new CoordinateSystem(i, j, n, o); --- 49,57 ---- Vertex i = system.getI(); Vertex j = system.getJ(); ! Vertex o = system.getOrigin().copy(); boolean front = glv.getView().facingFront(system); if (front) { n.scale(-1); } system = new CoordinateSystem(i, j, n, o); |
From: rimestad <rim...@us...> - 2006-11-07 10:51:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31909/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: changes to clippingplane tool and visualization Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.159 retrieving revision 1.160 diff -C2 -d -r1.159 -r1.160 *** View.java 30 Oct 2006 10:31:51 -0000 1.159 --- View.java 7 Nov 2006 10:51:19 -0000 1.160 *************** *** 669,673 **** if (cp.isActive()) { gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); ! if (cp.getClipdepth() != 0) { gl.glDisable(GL.GL_CLIP_PLANE5); } --- 669,673 ---- if (cp.isActive()) { gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); ! if (cp.isSlice()) { gl.glDisable(GL.GL_CLIP_PLANE5); } *************** *** 686,689 **** --- 686,694 ---- gl.glClipPlane(GL.GL_CLIP_PLANE0 + cp.getNumber(), cp.getPlane().getDoublev()); gl.glEnable(GL.GL_CLIP_PLANE0 + cp.getNumber()); + if (cp.isSlice()) { + gl.glClipPlane(GL.GL_CLIP_PLANE5, cp.getPlane().negate().getDoublev()); + gl.glEnable(GL.GL_CLIP_PLANE5); + cp.getPlane().negate(); + } } } *************** *** 940,950 **** gl.glColor3fv(targetColor); gl.glLineWidth(1.5f); drawGeometric((Geometric) target); } - - CoordinateSystem cs = Project.getInstance().getActiveCoordinateSystem(); - //grid(cs); - drawConstructorPlanes(); --- 945,960 ---- gl.glColor3fv(targetColor); gl.glLineWidth(1.5f); + // If target is a snap vertex it should be shown regardless of the clip + if (target instanceof Vertex) { + disableClipplanes(); + } + drawGeometric((Geometric) target); + // remember to enable clip again + if (target instanceof Vertex) { + enableClipplanes(); + } } drawConstructorPlanes(); *************** *** 1167,1171 **** --- 1177,1183 ---- */ private void drawEdges(GLDrawable gld) { + disableClipplanes(); drawGeneralEdges(gld, tempEdges); + enableClipplanes(); Space active = Project.getInstance().getActiveSpace(); if (active != Project.getInstance().world()) { *************** *** 1197,1200 **** --- 1209,1213 ---- */ private void drawConstructors() { + disableClipplanes(); Space active = Project.getInstance().getActiveSpace(); Camera camera = Project.getInstance().getCurrentCamera(); *************** *** 1203,1208 **** double dist = v.minus(new Vertex(camera.getCenter())).length() * scale; if (active != null) { - // Should be drawn regardless of clipplanes - disableClipplanes(); gl.glPushMatrix(); transformTo(active); --- 1216,1219 ---- *************** *** 1211,1215 **** grid(Project.getInstance().getActiveCoordinateSystem()); gl.glPopMatrix(); - enableClipplanes(); } while (true) { --- 1222,1225 ---- *************** *** 1245,1248 **** --- 1255,1259 ---- drawGeneralConstructor(c, dist, true, OBJECTS); } + enableClipplanes(); } *************** *** 1997,2015 **** gl.glPopMatrix(); } ! { ! Iterator it = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); ! while (it.hasNext()) { ! ClippingPlane cp = (ClippingPlane)it.next(); ! gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); ! } ! } if (selectMode == CLIPPLANES || selectMode == ALL) { { Iterator it = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); ! while (it.hasNext()) { ! ClippingPlane cp = (ClippingPlane)it.next(); ! pushName(gl, cp); ! drawClipplane(cp); ! popName(gl); } } --- 2008,2027 ---- gl.glPopMatrix(); } ! disableClipplanes(); if (selectMode == CLIPPLANES || selectMode == ALL) { { Iterator it = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); ! if (selectionMode == INTERSECTIONS) { ! while (it.hasNext()) { ! ClippingPlane cp = (ClippingPlane)it.next(); ! drawClipplaneIntersection(cp); ! } ! } else { ! while (it.hasNext()) { ! ClippingPlane cp = (ClippingPlane)it.next(); ! pushName(gl, cp); ! drawClipplane(cp); ! popName(gl); ! } } } *************** *** 2101,2128 **** } } } ! /** ! * Draw the frame of a clippingplane ! * @param clipplane The clippingplane */ ! private void drawClipplaneFrame(ClippingPlane clipplane) { { - Collection corners = clipplane.getCorners(); - gl.glColor3fv(CLIP_PLANE_COLOR); gl.glLineWidth(2.0f); ! gl.glBegin(GL.GL_LINE_STRIP); Iterator it = corners.iterator(); while (it.hasNext()) { Vertex v = (Vertex)it.next(); gl.glVertex3d(v.getX(), ! v.getY(), ! v.getZ()); } - Vertex v = (Vertex) corners.iterator().next(); - gl.glVertex3d(v.getX(), - v.getY(), - v.getZ()); gl.glEnd(); } } --- 2113,2153 ---- } } + enableClipplanes(); } ! /** ! * Draw a clippingPlane ! * @param clipplane The clipplane to draw */ ! private void drawClipplaneIntersection(ClippingPlane clipplane) { ! Collection corners = clipplane.getCorners(); { gl.glLineWidth(2.0f); ! pushName(gl, clipplane); ! gl.glBegin(GL.GL_LINE_LOOP); Iterator it = corners.iterator(); while (it.hasNext()) { Vertex v = (Vertex)it.next(); gl.glVertex3d(v.getX(), ! v.getY(), ! v.getZ()); } gl.glEnd(); + popName(gl); + } + if (clipplane.isActive()) { + Collection lines = clipplane.getLines(); + Iterator it = lines.iterator(); + while (it.hasNext()) { + Edge e = (Edge)it.next(); + Geometric g = clipplane.toModel(e); + pushName(gl, g); + if (e.getStrippled()) { + drawConstructor(e); + } else { + drawEdge(e); + } + popName(gl); + } } } *************** *** 2132,2136 **** * @param clipplane The clipplane to draw */ ! private void drawClipplane(ClippingPlane clipplane) { Collection corners = clipplane.getCorners(); { --- 2157,2161 ---- * @param clipplane The clipplane to draw */ ! private void drawClipplane(ClippingPlane clipplane) { Collection corners = clipplane.getCorners(); { *************** *** 2141,2163 **** Vertex v = (Vertex)it.next(); gl.glVertex3d(v.getX(), ! v.getY(), ! v.getZ()); } gl.glEnd(); } ! Collection lines = clipplane.getLines(); ! Iterator it = lines.iterator(); ! if (clipplane.getClipdepth() == 0) { ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! drawConstructor(e); ! } ! } else { while (it.hasNext()) { Edge e = (Edge)it.next(); ! drawEdge(e); } } - } --- 2166,2186 ---- Vertex v = (Vertex)it.next(); gl.glVertex3d(v.getX(), ! v.getY(), ! v.getZ()); } gl.glEnd(); } ! if (clipplane.isActive()) { ! Collection lines = clipplane.getLines(); ! Iterator it = lines.iterator(); while (it.hasNext()) { Edge e = (Edge)it.next(); ! if (e.getStrippled()) { ! drawConstructor(e); ! } else { ! drawEdge(e); ! } } } } *************** *** 2478,2482 **** // If an construction edge is hit, see if there is a real edge // coincident with the construction-edge. - if (edge != null) { edges.remove(edge); --- 2501,2504 ---- *************** *** 2495,2499 **** } } - if (intersections) { Transformation transformation = this.transformation(); --- 2517,2520 ---- *************** *** 2575,2578 **** --- 2596,2606 ---- Vertex intersection = plane.intersection(ray); return new Intersection(intersection, Intersection.SURFACE, surface); + } else if (object instanceof ClippingPlane) { + // find out what is intersected + Plane p = ((ClippingPlane)object).getPlane(); + Vertex intersection = p.intersection(ray); + if (intersection != null) { + return new Intersection(intersection, Intersection.PLANE_INTERSECTION, xy); + } } else { Vertex intersection = xy.intersection(ray); |
From: rimestad <rim...@us...> - 2006-11-07 10:45:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29556/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: the clipplane take care of removeing itself Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** SpaceTool.java 7 Nov 2006 09:54:11 -0000 1.64 --- SpaceTool.java 7 Nov 2006 10:45:12 -0000 1.65 *************** *** 699,703 **** vertices.add((Vertex) selected); } else if (selected instanceof ClippingPlane) { ! Project.getInstance().getCurrentCamera().removeClipplane((ClippingPlane)selected); } else if (selected instanceof Constructor) { ((Constructor)selected).delete(); --- 699,703 ---- vertices.add((Vertex) selected); } else if (selected instanceof ClippingPlane) { ! ((ClippingPlane)selected).delete(); } else if (selected instanceof Constructor) { ((Constructor)selected).delete(); |
From: Michael L. <he...@us...> - 2006-11-07 09:54:15
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9417/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java SpaceTool.java Log Message: Ids reset during extrusion Background menu introduced Envelope can be propageted to space-level Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** SpaceTool.java 31 Oct 2006 10:29:56 -0000 1.63 --- SpaceTool.java 7 Nov 2006 09:54:11 -0000 1.64 *************** *** 163,167 **** return PopupMenu.getEntityMenu((Entity) target); } else { ! return null; } } else { --- 163,167 ---- return PopupMenu.getEntityMenu((Entity) target); } else { ! return PopupMenu.getBackgroundMenu(); } } else { Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ExtrusionTool.java 23 Oct 2006 06:48:50 -0000 1.41 --- ExtrusionTool.java 7 Nov 2006 09:54:11 -0000 1.42 *************** *** 77,80 **** --- 77,81 ---- space.insert(surface); } + space.changed(); } *************** *** 89,92 **** --- 90,94 ---- if (extrusion != null) { space.removeProtected(extrusion); + space.computeNextId(); extrusion = null; } *************** *** 105,108 **** --- 107,111 ---- if (finish) { insert(space, extrusion); + } else { space.addProtected(extrusion); *************** *** 218,221 **** --- 221,226 ---- if (extrusion != null) { Project.getInstance().getActiveSpace().removeProtected(extrusion); + Project.getInstance().getActiveSpace().computeNextId(); + Project.getInstance().getActiveSpace().changed(); extrusion = null; } |
From: Michael L. <he...@us...> - 2006-11-07 09:54:07
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9104/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Ids reset during extrusion Background menu introduced Envelope can be propageted to space-level Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PopupMenu.java 6 Nov 2006 16:19:00 -0000 1.16 --- PopupMenu.java 7 Nov 2006 09:54:04 -0000 1.17 *************** *** 412,414 **** --- 412,433 ---- return menu; } + + /** + * Get background menu + * @return Background menu + */ + public static JPopupMenu getBackgroundMenu() { + JPopupMenu menu = new JPopupMenu(); + AbstractAction copyEnvelope = new AbstractAction("Copy Envelope of Owner") { + public void actionPerformed(ActionEvent arg0) { + Space space = Project.getInstance().getActiveSpace(); + if (space != Project.getInstance().world()) { + space.copyOwnerEnvelope(); + space.changed(); + } + } + }; + menu.add(copyEnvelope); + return menu; + } } |
From: Michael L. <he...@us...> - 2006-11-07 09:54:01
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9062/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Ids reset during extrusion Background menu introduced Envelope can be propageted to space-level Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** Space.java 6 Nov 2006 16:19:03 -0000 1.96 --- Space.java 7 Nov 2006 09:53:59 -0000 1.97 *************** *** 1205,1208 **** --- 1205,1220 ---- } + + /** + * Compute next id + * + */ + public void computeNextId() { + nextVertexId = Entity.maxId(vertices.values()) + 1; + nextEdgeId = Entity.maxId(edges.values()) + 1; + nextSurfaceId = Entity.maxId(surfaces.values()) + 1; + nextElementId = Entity.maxId(elements.values()) + 1; + } + /** * Add a surface to the envelope *************** *** 1605,1608 **** --- 1617,1633 ---- /** + * Copy the envelope of the owner + * + */ + public void copyOwnerEnvelope() { + Collection envelope = getEnvelope(); + Iterator iter = envelope.iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + current.copyall(this); + } + } + + /** * Copy this space and return the copy * @param copiedVertices map of vertices and their copies. |
From: Nordholt <nor...@us...> - 2006-11-06 16:28:03
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30287/src/net/sourceforge/bprocessor/gui/actions Modified Files: CreateNetActionListener.java Log Message: style error fix Index: CreateNetActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateNetActionListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CreateNetActionListener.java 6 Nov 2006 16:19:00 -0000 1.1 --- CreateNetActionListener.java 6 Nov 2006 16:27:57 -0000 1.2 *************** *** 1,2 **** --- 1,8 ---- + //--------------------------------------------------------------------------------- + // $Id$ + // + // 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; *************** *** 9,12 **** --- 15,21 ---- import org.apache.log4j.Logger; + /** + * Listener to create new B-nets + */ public class CreateNetActionListener implements ActionListener { *************** *** 14,17 **** --- 23,30 ---- private static Logger log = Logger.getLogger(CreateNetActionListener.class); + /** + * Action performed + * @param arg0 the action event + */ public void actionPerformed(ActionEvent arg0) { Space net = new Space("B-net", Space.CONSTRUCTION, Space.NET_LEVEL, true); |
From: Nordholt <nor...@us...> - 2006-11-06 16:19:23
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26409/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: starting to implement B-nets Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** Space.java 6 Nov 2006 14:04:27 -0000 1.95 --- Space.java 6 Nov 2006 16:19:03 -0000 1.96 *************** *** 56,59 **** --- 56,62 ---- public static final int PART_LEVEL = 5; + /** B-net level */ + public static final int NET_LEVEL = 6; + /** part Functional Type */ private boolean isUnion = false; *************** *** 305,309 **** } ! /** --- 308,317 ---- } ! /** ! * pop transformation ! */ ! public void popTransform() { ! this.transform.pop(); ! } /** *************** *** 592,595 **** --- 600,606 ---- } edges.put(id, edge); + if (level == NET_LEVEL) { + edge.setStrippled(true); + } edge.setOwner(this); } else { *************** *** 1493,1500 **** res = res.concat("Part"); break; } if (isUnion()) { res = res.concat("(Union)"); ! } return res; } --- 1504,1514 ---- res = res.concat("Part"); break; + case NET_LEVEL: + res = "B-net"; + break; } if (isUnion()) { res = res.concat("(Union)"); ! } return res; } |
From: Nordholt <nor...@us...> - 2006-11-06 16:19:15
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26158/src/net/sourceforge/bprocessor/gui/actions Added Files: CreateNetActionListener.java Log Message: starting to implement B-nets --- NEW FILE: CreateNetActionListener.java --- package net.sourceforge.bprocessor.gui.actions; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import org.apache.log4j.Logger; public class CreateNetActionListener implements ActionListener { /** The logger */ private static Logger log = Logger.getLogger(CreateNetActionListener.class); public void actionPerformed(ActionEvent arg0) { Space net = new Space("B-net", Space.CONSTRUCTION, Space.NET_LEVEL, true); Space active = Project.getInstance().getActiveSpace(); active.add(net); active.changed(); Project.getInstance().checkpoint(); } } |
From: Nordholt <nor...@us...> - 2006-11-06 16:19:11
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26158/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java GUI.java Log Message: starting to implement B-nets Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PopupMenu.java 31 Oct 2006 14:22:54 -0000 1.15 --- PopupMenu.java 6 Nov 2006 16:19:00 -0000 1.16 *************** *** 175,179 **** }; pm.add(scalelocal); - return pm; } --- 175,178 ---- *************** *** 265,269 **** // Some options do only apply to one space Space sp = (Space)s.iterator().next(); ! if (((Space)s.iterator().next()).getLevel() < Space.PART_LEVEL) { AbstractAction edit = new SpaceMenuAction(sp, "Edit") { public void actionPerformed(ActionEvent arg0) { --- 264,268 ---- // Some options do only apply to one space Space sp = (Space)s.iterator().next(); ! if (((Space)s.iterator().next()).getLevel() != Space.PART_LEVEL) { AbstractAction edit = new SpaceMenuAction(sp, "Edit") { public void actionPerformed(ActionEvent arg0) { Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** GUI.java 4 Nov 2006 12:27:31 -0000 1.48 --- GUI.java 6 Nov 2006 16:19:00 -0000 1.49 *************** *** 10,13 **** --- 10,14 ---- import net.sourceforge.bprocessor.gui.actions.CreateConstructorActionListener; import net.sourceforge.bprocessor.gui.actions.CreateFunctionalSpaceActionListener; + import net.sourceforge.bprocessor.gui.actions.CreateNetActionListener; import net.sourceforge.bprocessor.gui.actions.FileCloseActionListener; import net.sourceforge.bprocessor.gui.actions.FileExitActionListener; *************** *** 294,297 **** --- 295,302 ---- createConstructionSpace.addActionListener(new CreateConstructionSpaceActionListener()); create.add(createConstructionSpace); + + JMenuItem createNet = new JMenuItem("B-net"); + createNet.addActionListener(new CreateNetActionListener()); + create.add(createNet); /*JMenuItem createElement = new JMenuItem("Element"); |
From: Michael L. <he...@us...> - 2006-11-06 14:04:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4003/src/net/sourceforge/bprocessor/model Modified Files: Space.java Persistence.java Log Message: More refactoring of persistence Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Persistence.java 6 Nov 2006 11:47:06 -0000 1.18 --- Persistence.java 6 Nov 2006 14:04:27 -0000 1.19 *************** *** 168,194 **** mapper.put(new Long(xml.getId()), space); - Collection elements = new LinkedList(); - xmls.add(xml); { Iterator iter = xml.getSpace().iterator(); while (iter.hasNext()) { SpaceType current = (SpaceType) iter.next(); ! Space element = internalizeSpace(null, current, mapper, xmls); ! elements.add(element); } } - Space e = (Space) mapper.get(new Long(empty)); if (empty != 0) { ! space.setEmpty(e); ! } ! { ! Iterator iter = elements.iterator(); ! while (iter.hasNext()) { ! Space current = (Space) iter.next(); ! if (current != e) { ! space.add(current); ! } ! } } { --- 168,184 ---- mapper.put(new Long(xml.getId()), space); xmls.add(xml); { + HashMap elements = new HashMap(); Iterator iter = xml.getSpace().iterator(); while (iter.hasNext()) { SpaceType current = (SpaceType) iter.next(); ! Space element = internalizeSpace(space, current, mapper, xmls); ! elements.put(element.getId(), element); } + space.setElements(elements); } if (empty != 0) { ! space.setEmpty((Space) mapper.get(new Long(empty))); } { Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** Space.java 6 Nov 2006 11:47:06 -0000 1.94 --- Space.java 6 Nov 2006 14:04:27 -0000 1.95 *************** *** 361,371 **** */ public void setEmpty(Space element) { - if (empty != null) { - remove(empty); - } empty = element; - if (empty != null) { - add(empty); - } } --- 361,365 ---- *************** *** 1197,1201 **** public void setElements(HashMap elements) { this.elements = elements; ! nextElementId = Entity.maxId(elements.values()); } --- 1191,1195 ---- public void setElements(HashMap elements) { this.elements = elements; ! nextElementId = Entity.maxId(elements.values()) + 1; } |
From: Michael L. <he...@us...> - 2006-11-06 11:47:09
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13091/src/net/sourceforge/bprocessor/model Modified Files: Space.java Persistence.java Log Message: Fixed a bug in persistence Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Persistence.java 6 Nov 2006 11:00:54 -0000 1.17 --- Persistence.java 6 Nov 2006 11:47:06 -0000 1.18 *************** *** 168,184 **** mapper.put(new Long(xml.getId()), space); xmls.add(xml); { - HashMap elements = new HashMap(); Iterator iter = xml.getSpace().iterator(); while (iter.hasNext()) { SpaceType current = (SpaceType) iter.next(); ! Space element = internalizeSpace(space, current, mapper, xmls); ! elements.put(element.getId(), element); } - space.setElements(elements); } if (empty != 0) { ! space.setEmpty((Space) mapper.get(new Long(empty))); } { --- 168,194 ---- mapper.put(new Long(xml.getId()), space); + Collection elements = new LinkedList(); + xmls.add(xml); { Iterator iter = xml.getSpace().iterator(); while (iter.hasNext()) { SpaceType current = (SpaceType) iter.next(); ! Space element = internalizeSpace(null, current, mapper, xmls); ! elements.add(element); } } + Space e = (Space) mapper.get(new Long(empty)); if (empty != 0) { ! space.setEmpty(e); ! } ! { ! Iterator iter = elements.iterator(); ! while (iter.hasNext()) { ! Space current = (Space) iter.next(); ! if (current != e) { ! space.add(current); ! } ! } } { Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** Space.java 6 Nov 2006 11:00:54 -0000 1.93 --- Space.java 6 Nov 2006 11:47:06 -0000 1.94 *************** *** 361,365 **** --- 361,371 ---- */ public void setEmpty(Space element) { + if (empty != null) { + remove(empty); + } empty = element; + if (empty != null) { + add(empty); + } } |
From: Michael L. <he...@us...> - 2006-11-06 11:01:07
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26880/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: Fixed a few style errors Refactored persistence-code Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** FacadeModellor.java 4 Nov 2006 12:26:31 -0000 1.26 --- FacadeModellor.java 6 Nov 2006 11:01:03 -0000 1.27 *************** *** 119,122 **** --- 119,123 ---- /** The constructor for the modellor * @param s the space this modellor models for. + * @param front Front */ public FacadeModellor(Space s, Surface front) { *************** *** 403,408 **** double lengthH = intervalH; if (type == SINGLE_BAR) { ! intervalV = intervalV - ((frameWidth * 2) + vertPosts * vertPostWidth)/ (vertPosts + 1); ! intervalH = intervalH - ((frameWidth * 2) + horPosts * horPostWidth)/ (horPosts + 1); intervalV += vertPostWidth; intervalH += horPostWidth; --- 404,409 ---- double lengthH = intervalH; if (type == SINGLE_BAR) { ! intervalV = intervalV - ((frameWidth * 2) + vertPosts * vertPostWidth) / (vertPosts + 1); ! intervalH = intervalH - ((frameWidth * 2) + horPosts * horPostWidth) / (horPosts + 1); intervalV += vertPostWidth; intervalH += horPostWidth; |
From: Michael L. <he...@us...> - 2006-11-06 11:01:06
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26753/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java Log Message: Fixed a few style errors Refactored persistence-code Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** GenericPanel.java 4 Nov 2006 16:54:53 -0000 1.24 --- GenericPanel.java 6 Nov 2006 11:00:58 -0000 1.25 *************** *** 12,19 **** import java.awt.event.MouseListener; import java.util.ArrayList; - import java.util.HashMap; import java.util.Iterator; import java.util.List; - import java.util.Map; import javax.swing.BorderFactory; --- 12,17 ---- |