bprocessor-commit Mailing List for B-processor (Page 125)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2006-04-28 11:29:10
|
Update of /cvsroot/bprocessor/gui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30985/src Modified Files: build.xml Log Message: Changed all build.xml files to compile using options -source 1.3 -target 1.2 to ensure that the compiled code can execute in 1.4.2 runtime environment Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/gui/src/build.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** build.xml 27 Jun 2005 09:32:23 -0000 1.1.1.1 --- build.xml 28 Apr 2006 11:29:06 -0000 1.2 *************** *** 14,18 **** <target name="compile" depends="dep"> <javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="yes" ! debug="yes" includes="net/**"> <classpath refid="build.path"/> --- 14,18 ---- <target name="compile" depends="dep"> <javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="yes" ! debug="yes" target="1.2" source="1.3" includes="net/**"> <classpath refid="build.path"/> |
From: Michael L. <he...@us...> - 2006-04-28 11:29:10
|
Update of /cvsroot/bprocessor/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30799 Modified Files: build.xml Log Message: Changed all build.xml files to compile using options -source 1.3 -target 1.2 to ensure that the compiled code can execute in 1.4.2 runtime environment Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/kernel/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build.xml 18 Oct 2005 08:16:01 -0000 1.2 --- build.xml 28 Apr 2006 11:29:02 -0000 1.3 *************** *** 90,94 **** </xjc> <javac srcdir="${build.dir}" destdir="${build.dir}" deprecation="yes" ! debug="yes" includes="net/**"> <classpath> --- 90,94 ---- </xjc> <javac srcdir="${build.dir}" destdir="${build.dir}" deprecation="yes" ! debug="yes" target="1.2" source="1.3" includes="net/**"> <classpath> |
From: Michael L. <he...@us...> - 2006-04-28 11:29:10
|
Update of /cvsroot/bprocessor/kernel/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30799/src Modified Files: build.xml Log Message: Changed all build.xml files to compile using options -source 1.3 -target 1.2 to ensure that the compiled code can execute in 1.4.2 runtime environment Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/kernel/src/build.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** build.xml 27 Jun 2005 09:12:30 -0000 1.1.1.1 --- build.xml 28 Apr 2006 11:29:02 -0000 1.2 *************** *** 22,26 **** <target name="compile" depends="dep"> <javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="yes" ! debug="yes" includes="net/**"> <classpath refid="build.path"/> --- 22,26 ---- <target name="compile" depends="dep"> <javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="yes" ! debug="yes" target="1.2" source="1.3" includes="net/**"> <classpath refid="build.path"/> |
From: Nordholt <nor...@us...> - 2006-04-26 15:30:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13536/tool Modified Files: ToolFactory.java Log Message: cleaning up leftover from alternatives ways of moving Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ToolFactory.java 5 Apr 2006 09:36:16 -0000 1.41 --- ToolFactory.java 26 Apr 2006 15:29:56 -0000 1.42 *************** *** 50,55 **** /** button group */ private ButtonGroup group; ! ! /** The factory */ private static ToolFactory factory; --- 50,54 ---- /** button group */ private ButtonGroup group; ! /** The factory */ private static ToolFactory factory; *************** *** 262,267 **** buttons.put(tool, button); return button; ! } ! /** --- 261,265 ---- buttons.put(tool, button); return button; ! } /** *************** *** 345,355 **** JPopupMenu pm = new JPopupMenu(); MovePopupActionListener mpal = new MovePopupActionListener(); ! JMenuItem mi = new JMenuItem("Axis restricted"); ! mi.addActionListener(mpal); ! pm.add(mi); ! mi = new JMenuItem("Free plane"); ! mi.addActionListener(mpal); ! pm.add(mi); ! mi = new JMenuItem("Vector"); mi.addActionListener(mpal); pm.add(mi); --- 343,347 ---- JPopupMenu pm = new JPopupMenu(); MovePopupActionListener mpal = new MovePopupActionListener(); ! JMenuItem mi = new JMenuItem("Vector"); mi.addActionListener(mpal); pm.add(mi); *************** *** 372,379 **** public void actionPerformed(ActionEvent actionEvent) { if (actionEvent.getActionCommand().equals("Vector")) { - log.info("vector bruges nu"); move.setStrategy(vectorStrategy); } else if (actionEvent.getActionCommand().equals("Controlled")) { - log.info("controlled bruges nu"); move.setStrategy(controlledStrategy); } --- 364,369 ---- |
From: Nordholt <nor...@us...> - 2006-04-26 15:29:12
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13035/tool Modified Files: MoveTool.java Log Message: fixed so clippingplanes can be moved aswell Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** MoveTool.java 21 Apr 2006 15:05:00 -0000 1.54 --- MoveTool.java 26 Apr 2006 15:29:07 -0000 1.55 *************** *** 12,16 **** import net.sourceforge.bprocessor.model.Edge; - import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; --- 12,15 ---- *************** *** 71,75 **** /** ! * Update selection */ protected void update() { --- 70,74 ---- /** ! * Updating after a move. */ protected void update() { *************** *** 80,87 **** ClippingPlane plane = (ClippingPlane) o; plane.update(); - } else { - if (o instanceof Entity) { - //Project.getInstance().updateConstraints((Entity) o); - } } } --- 79,82 ---- *************** *** 160,163 **** --- 155,159 ---- moveEntities != null) { move(vertices, current.vertex().minus(from)); + update(); } } *************** *** 165,172 **** } } ! ! ! ! /** * Invoked when the mouse is held pressed and moved --- 161,165 ---- } } ! /** * Invoked when the mouse is held pressed and moved *************** *** 293,297 **** super.cleanUp(); } ! } ! } --- 286,289 ---- super.cleanUp(); } ! } } |
From: Nikolaj B. <nbr...@us...> - 2006-04-26 10:38:57
|
Update of /cvsroot/bprocessor/gui/src/gfx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10971/src/gfx Added Files: Biconlink.gif Log Message: the link icon --- NEW FILE: Biconlink.gif --- (This appears to be a binary file; contents omitted.) |
From: Nikolaj B. <nbr...@us...> - 2006-04-24 08:45:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12564/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Surface is now using the new link functionality. Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** Surface.java 13 Apr 2006 14:01:16 -0000 1.92 --- Surface.java 24 Apr 2006 08:45:48 -0000 1.93 *************** *** 965,968 **** --- 965,984 ---- } else if (a.getName().equals("Exterior")) { continue; + } else if (a.getName().equals("Space1")) { + Iterator it = Project.getInstance().getSpaces().iterator(); + while (it.hasNext()) { + Space current = (Space) it.next(); + if (current.getName().equals(a.getValue())) { + setFrontDomain(current); + } + } + } else if (a.getName().equals("Space2")) { + Iterator it = Project.getInstance().getSpaces().iterator(); + while (it.hasNext()) { + Space current = (Space) it.next(); + if (current.getName().equals(a.getValue())) { + setBackDomain(current); + } + } } else if (a.getName().equals("Front Material")) { setFrontMaterial((Material) a.getValue()); *************** *** 977,980 **** --- 993,997 ---- } } + changed(); } *************** *** 987,993 **** res.add(new Attribute("Name", getName(), false)); if (getFrontDomain() != null) { ! res.add(new Attribute("Space", getFrontDomain(), false)); } else { ! res.add(new Attribute("Space", "None", false)); } --- 1004,1010 ---- res.add(new Attribute("Name", getName(), false)); if (getFrontDomain() != null) { ! res.add(new Attribute("Space1", getFrontDomain(), true)); } else { ! res.add(new Attribute("Space1", "None", true)); } *************** *** 1005,1011 **** if (getBackDomain() != null) { ! res.add(new Attribute("Space", getBackDomain(), false)); } else { ! res.add(new Attribute("Space", "None", false)); } --- 1022,1028 ---- if (getBackDomain() != null) { ! res.add(new Attribute("Space2", getBackDomain(), true)); } else { ! res.add(new Attribute("Space2", "None", true)); } |
From: Nikolaj B. <nbr...@us...> - 2006-04-24 08:45:17
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12251/src/net/sourceforge/bprocessor/gui/attrview Modified Files: StringAttribute.java LinkAttribute.java GenericPanel.java Log Message: Implemented the new link functionality. Links can now be links, but at the same time you can change the link if wanted. Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** StringAttribute.java 16 Mar 2006 10:16:55 -0000 1.10 --- StringAttribute.java 24 Apr 2006 08:45:10 -0000 1.11 *************** *** 24,28 **** import net.sourceforge.bprocessor.model.Attribute; - import net.sourceforge.bprocessor.model.Entity; /** --- 24,27 ---- *************** *** 151,171 **** String s = ""; JLabel valueLabel; ! if (value instanceof Entity) { ! s = ((Entity)value).getName(); ! valueLabel = new JLabel(s); ! valueLabel.setFont(AttributeView.FONT_ITALIC); } else { ! if (value instanceof String) { ! s = (String)value; ! } else if (value instanceof Double) { ! double rounded = round(((Double) value).doubleValue()); ! s = Double.toString(rounded); ! } ! valueLabel = new JLabel(s); ! if (attribute.isEditable()) { ! valueLabel.setFont(AttributeView.FONT_PLAIN); ! } else { ! valueLabel.setFont(AttributeView.FONT_ITALIC); ! } } return valueLabel; --- 150,164 ---- String s = ""; JLabel valueLabel; ! if (value instanceof String) { ! s = (String)value; ! } else if (value instanceof Double) { ! double rounded = round(((Double) value).doubleValue()); ! s = Double.toString(rounded); ! } ! valueLabel = new JLabel(s); ! if (attribute.isEditable()) { ! valueLabel.setFont(AttributeView.FONT_PLAIN); } else { ! valueLabel.setFont(AttributeView.FONT_ITALIC); } return valueLabel; Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GenericPanel.java 10 Apr 2006 11:54:39 -0000 1.16 --- GenericPanel.java 24 Apr 2006 08:45:10 -0000 1.17 *************** *** 32,36 **** import net.sourceforge.bprocessor.model.Parametric; import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.Selection; /** --- 32,35 ---- *************** *** 190,199 **** stopEditing(); current = ga; ! if (ga instanceof LinkAttribute) { ! Selection.primary().set(ga.attribute().getValue()); ! } else { ! if (current != null) { ! current.startEditing(); ! } } } --- 189,194 ---- stopEditing(); current = ga; ! if (current != null) { ! current.startEditing(); } } Index: LinkAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/LinkAttribute.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LinkAttribute.java 16 Mar 2006 10:16:55 -0000 1.5 --- LinkAttribute.java 24 Apr 2006 08:45:10 -0000 1.6 *************** *** 6,27 **** //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.attrview; ! import net.sourceforge.bprocessor.model.Attribute; /** * The LinkAttributeView */ ! public class LinkAttribute extends StringAttribute { /** ! * Constructor * @param attribute The attribute */ public LinkAttribute(Attribute attribute) { ! super(attribute); } } --- 6,316 ---- //--------------------------------------------------------------------------------- + package net.sourceforge.bprocessor.gui.attrview; ! import java.awt.Dimension; ! 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 javax.swing.Box; + import javax.swing.BoxLayout; + import javax.swing.ImageIcon; + import javax.swing.JComponent; + import javax.swing.JLabel; + import javax.swing.JTextField; + + import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Selection; /** * The LinkAttributeView */ ! public class LinkAttribute extends GenericAttribute implements KeyListener, MouseListener { + /** The listeners */ + private List listeners; + + /** The attribute this gui represents */ + private Attribute attribute; + + /** The component */ + private JComponent component; + + /** The Label */ + private JLabel label; + + /** The link icon */ + private JLabel icon; + + /** The editor, when this EditableAttribute is being edited */ + private JTextField editor; + + + + /** ! * Constructor for StringAttribute * @param attribute The attribute */ public LinkAttribute(Attribute attribute) { ! super(BoxLayout.X_AXIS); ! ! this.attribute = attribute; ! this.listeners = new LinkedList(); ! ! label = createLabel(attribute.getName()); ! ! Box header = Box.createHorizontalBox(); ! Box column = Box.createVerticalBox(); ! header.add(Box.createHorizontalStrut(7)); ! header.add(label); ! header.add(Box.createHorizontalGlue()); ! column.add(Box.createRigidArea(new Dimension(70, 3))); ! column.add(header); ! column.add(Box.createRigidArea(new Dimension(70, 3))); ! column.setMaximumSize(new Dimension(60, Short.MAX_VALUE)); ! this.add(column); ! component = Box.createHorizontalBox(); ! component.add(createValueLabel(attribute.getValue())); ! ClassLoader classloader = Thread.currentThread().getContextClassLoader(); ! URL url = classloader.getResource("Biconlink.gif"); ! icon = new JLabel(new ImageIcon(url)); ! this.add(component); ! this.add(icon); ! this.add(Box.createHorizontalGlue()); ! } + /** + * Round + * @param value The value + * @return The rounded value + */ + protected double round(double value) { + int i = (int) (value * 100000); + return ((double) i) / 100000.0; + } + + /** + * Create a label for the + * @param key The key + * @return A JLabel + */ + private JLabel createLabel(String key) { + JLabel keyLabel = new JLabel(key + " :"); + keyLabel.setFont(AttributeView.FONT_BOLD); + return keyLabel; + } + + /** + * Add a mouselisterner to the active elements in the LinkAttribute + * @param mouseListener the mouselistener + */ + public void addMouseListener(MouseListener mouseListener) { + label.addMouseListener(mouseListener); + component.addMouseListener(mouseListener); + icon.addMouseListener(this); + } + + /** + * Remove a mouselisterner to the active elements in the LinkAttribute + * @param mouseListener the mouselistener + */ + public void removeMouseListener(MouseListener mouseListener) { + label.removeMouseListener(mouseListener); + component.removeMouseListener(mouseListener); + } + + /** + * Add a listener that are notified when the value is changed + * @param listener The listener + */ + public void addStringAttributeListener(AttributeListener listener) { + listeners.add(listener); + } + + /** + * Remove a listener + * @param listener The listener + */ + public void removeStringAttributeListener(AttributeListener listener) { + listeners.remove(listener); + } + + /** + * Send valueChanged to all listeners + */ + protected void valueChanged() { + Iterator iter = listeners.iterator(); + while (iter.hasNext()) { + AttributeListener current = (AttributeListener) iter.next(); + current.valueChanged(attribute); + } + } + + /** + * Create a value label + * @param value The value + * @return The label + */ + private JComponent createValueLabel(Object value) { + String s = ""; + JLabel valueLabel; + if (value instanceof Entity) { + s = ((Entity)value).getName(); + valueLabel = new JLabel(s); + } else { + if (value instanceof String) { + s = (String)value; + } else if (value instanceof Double) { + double rounded = round(((Double) value).doubleValue()); + s = Double.toString(rounded); + } + valueLabel = new JLabel(s); + } + if (attribute.isEditable()) { + valueLabel.setFont(AttributeView.FONT_PLAIN); + } else { + valueLabel.setFont(AttributeView.FONT_ITALIC); + } + return valueLabel; + } + + /** + * Create a value editor + * @param value The value + * @return The editor + */ + private JComponent createValueEditor(Object value) { + String s = ""; + if (value instanceof String) { + s = (String)value; + } else if (value instanceof Double) { + double rounded = round(((Double) value).doubleValue()); + s = Double.toString(rounded); + } + JTextField valueEditor = new JTextField(s); + valueEditor.setFont(AttributeView.FONT_PLAIN); + + return valueEditor; + } + + + /** + * Return the attribute + * @return The attribute + */ + public Attribute attribute() { + return attribute; + } + + /** + * Start editing the value by replacing the label with an editor + */ + public void startEditing() { + if (attribute.isEditable()) { + if (editor == null) { + component.remove(0); + editor = (JTextField) createValueEditor(attribute.getValue()); + editor.addKeyListener(this); + component.add(editor); + component.revalidate(); + } + editor.requestFocus(); + editor.selectAll(); + } + } + + /** + * Stop editing the value by replacing the editor with an label, + * and sending valueChanged to all listeners. + */ + public void stopEditing() { + if (editor != null && attribute.isEditable()) { + Object val = attribute.getValue(); + 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); + editor.removeKeyListener(this); + editor = null; + component.add(createValueLabel(attribute.getValue())); + component.revalidate(); + valueChanged(); + } + } + + /** + * Cancels editing the value by replacing the editor with an label, + * without sending any events to listeners. + */ + public void cancelEditing() { + if (editor != null) { + component.remove(editor); + editor.removeKeyListener(this); + editor = null; + component.add(createValueLabel(attribute.getValue())); + component.revalidate(); + } + } + + /** + * 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 + */ + public void mouseClicked(MouseEvent event) { + Selection.primary().set(attribute().getValue()); } + /** + * Not in use + * @param event The MouseEvent + */ + public void mousePressed(MouseEvent event) { } + /** + * 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) { } } |
From: Nikolaj B. <nbr...@us...> - 2006-04-24 08:43:08
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10596/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Added shortcuts to load, save and open Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** GUI.java 23 Mar 2006 10:43:54 -0000 1.32 --- GUI.java 24 Apr 2006 08:43:02 -0000 1.33 *************** *** 121,124 **** --- 121,126 ---- fileNew.addActionListener(new FileNewActionListener()); fileNew.setMnemonic(KeyEvent.VK_N); + fileNew.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, + Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); fileNew.setEnabled(true); file.add(fileNew); *************** *** 127,130 **** --- 129,134 ---- fileLoad.addActionListener(new FileLoadActionListener()); fileLoad.setMnemonic(KeyEvent.VK_L); + fileLoad.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, + Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); fileLoad.setEnabled(true); file.add(fileLoad); *************** *** 141,144 **** --- 145,150 ---- fileSave.addActionListener(new FileSaveActionListener()); fileSave.setMnemonic(KeyEvent.VK_S); + fileSave.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, + Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); fileSave.setEnabled(true); file.add(fileSave); |
From: Nordholt <nor...@us...> - 2006-04-21 15:24:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23370 Modified Files: Space.java Log Message: Fixed some of the blue-surface bugs, and made so we can delete Spaces from the treeview Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Space.java 13 Apr 2006 14:00:44 -0000 1.26 --- Space.java 21 Apr 2006 15:24:28 -0000 1.27 *************** *** 81,85 **** private long nextSurfaceId; - /** The modellor */ private Modellor modellor; --- 81,84 ---- *************** *** 522,531 **** if (back != null) { back.removeSurface(surface); ! surface.setBackDomain(null); } Space front = surface.getFrontDomain(); if (front != null) { front.removeSurface(surface); ! surface.setFrontDomain(null); } surfaces.remove(surface.getId()); --- 521,530 ---- if (back != null) { back.removeSurface(surface); ! surface.setBackDomain(empty); } Space front = surface.getFrontDomain(); if (front != null) { front.removeSurface(surface); ! surface.setFrontDomain(empty); } surfaces.remove(surface.getId()); *************** *** 705,730 **** */ public void remove(Space element) { ! Set surfaces = element.getEnvelope(); ! if (surfaces != null) { ! Iterator iter = surfaces.iterator(); while (iter.hasNext()) { Surface current = (Surface)iter.next(); Space back = current.getBackDomain(); if (back == element) { ! current.setBackDomain(null); ! } else { ! Space front = current.getFrontDomain(); ! if (front == element) { ! current.setFrontDomain(null); ! } } } } ! ! elements.remove(element.getId()); element.setId(null); } /** * Get elements * @return Elements --- 704,752 ---- */ public void remove(Space element) { ! Set surfs = element.getEnvelope(); ! element.setEnvelope(new HashSet()); ! if (surfs != null) { ! Iterator iter = surfs.iterator(); while (iter.hasNext()) { Surface current = (Surface)iter.next(); Space back = current.getBackDomain(); + Space front = current.getFrontDomain(); if (back == element) { ! current.setBackDomain(empty); ! } ! if (front == element) { ! current.setFrontDomain(empty); } } } ! Space superSpace = findElement(element); ! superSpace.elements.remove(element.getId()); element.setId(null); } /** + * Finds an element contained in this space or some subspace of this space. + * @param element the element to be found. + * @return the space that directly contains the element in its elements set + * that space maybe a subspace of this space. If the element is not found null + * is returned. + */ + private Space findElement(Space element) { + if (elements.get(element.getId()) == element) { + return this; + } else { + Iterator it = elements.values().iterator(); + while (it.hasNext()) { + Space space = (Space)it.next(); + Space result = space.findElement(element); + if (result != null) { + return result; + } + } + } + return null; + } + + /** * Get elements * @return Elements *************** *** 841,845 **** /** ! * Collects the set of vertices in this space * @return the set of vertices */ --- 863,867 ---- /** ! * collects the set of vertices in this space * @return the set of vertices */ |
From: Nordholt <nor...@us...> - 2006-04-21 15:23:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22764 Modified Files: Project.java Log Message: small change so we can remove spaces Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Project.java 5 Apr 2006 09:35:58 -0000 1.54 --- Project.java 21 Apr 2006 15:23:06 -0000 1.55 *************** *** 187,190 **** --- 187,192 ---- } else if (next instanceof Vertex) { world.delete((Vertex)next); + } else if (next instanceof Space) { + remove((Space)next); } } |
From: Nordholt <nor...@us...> - 2006-04-21 15:22:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21927 Modified Files: Plane.java Log Message: fixed project method Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Plane.java 5 Apr 2006 09:35:58 -0000 1.17 --- Plane.java 21 Apr 2006 15:21:59 -0000 1.18 *************** *** 261,264 **** --- 261,265 ---- public Vertex project(Vertex vector) { double t = a * vector.getX() + b * vector.getY() + c * vector.getZ(); + t = t / (a * a + b * b + c * c); Vertex n = new Vertex(t * a, t * b, t * c); return vector.minus(n); |
From: Nordholt <nor...@us...> - 2006-04-21 15:16:41
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18968 Modified Files: GenericTreeView.java Log Message: added popup-menu in the treeview to delete elements Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** GenericTreeView.java 12 Apr 2006 14:27:54 -0000 1.22 --- GenericTreeView.java 21 Apr 2006 15:16:38 -0000 1.23 *************** *** 19,26 **** --- 19,29 ---- import java.util.Set; + import java.awt.event.ActionEvent; + import javax.swing.ImageIcon; import javax.swing.JPopupMenu; import javax.swing.JTree; import javax.swing.SwingUtilities; + import javax.swing.AbstractAction; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; *************** *** 344,350 **** --- 347,395 ---- } } + + /** + * Context menu for this EntityNode + * @return the menu + */ + public JPopupMenu menu() { + JPopupMenu pm = new JPopupMenu(); + Object object = this.getUserObject(); + if (object instanceof Entity) { + pm.add(new EntityDeleteAction((Entity)object)); + } + return pm; + } } /** + * The Entity delete action + */ + public class EntityDeleteAction extends AbstractAction { + + /** + * The entity + */ + private Entity entity; + + /** + * The constructor + * @param ent the entity + */ + public EntityDeleteAction(Entity ent) { + super("Delte"); + this.entity = ent; + } + + /** + * Invoked when a action is performed + * @param event ActionEvent + */ + public void actionPerformed(ActionEvent event) { + info("deleting: " + entity); + entity.delete(); + } + } + + /** * SpaceNode */ |
From: Nordholt <nor...@us...> - 2006-04-21 15:08:28
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14183 Modified Files: TapeMeasureTool.java Log Message: rewrite to be a abstractpencil tool Index: TapeMeasureTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasureTool.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TapeMeasureTool.java 27 Mar 2006 14:43:48 -0000 1.13 --- TapeMeasureTool.java 21 Apr 2006 15:08:25 -0000 1.14 *************** *** 7,10 **** --- 7,13 ---- package net.sourceforge.bprocessor.gl.tool; + import java.util.LinkedList; + import java.util.Collection; + import java.awt.Cursor; import java.awt.event.MouseEvent; *************** *** 14,22 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; - import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Plane; - import net.sourceforge.bprocessor.gl.view.Transformation; - import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.gl.GLView; --- 17,22 ---- *************** *** 26,36 **** * The TapeMeasureTool */ ! public class TapeMeasureTool extends AbstractTool { /** The logger */ private static Logger log = Logger.getLogger(TapeMeasureTool.class); - /** Angle mode on/off */ - private static boolean angleMode = false; - /** The x axis */ private Edge xAxis = new Edge(new Vertex(-50, 0, 0), new Vertex(50, 0, 0)); --- 26,33 ---- * The TapeMeasureTool */ ! public class TapeMeasureTool extends AbstractPencil { /** The logger */ private static Logger log = Logger.getLogger(TapeMeasureTool.class); /** The x axis */ private Edge xAxis = new Edge(new Vertex(-50, 0, 0), new Vertex(50, 0, 0)); *************** *** 48,75 **** private Edge currentConstruction; - /** The edge point */ - private Vertex edgePoint; - /** The construction edge point */ private Vertex constructionPoint; - /** The the edge between the current edge and the construction edge */ - private Edge edgeToConstruction; - - /** The plane we are moving in */ - private Plane movePlane; - - /** The edge normal */ - private Vertex edgeNormal; - - /** The current number in the length field */ - private String number; - - /** Tells if the tool is currently measuring or not */ - private boolean measuring; - - /** Tells if the tool is taking its angel or not */ - private boolean angling; - /** * Constructor --- 45,51 ---- *************** *** 79,84 **** public TapeMeasureTool(GLView glv, Cursor cursor) { super(glv, cursor); - measuring = false; - angling = false; } --- 55,58 ---- *************** *** 88,176 **** */ protected void moved(MouseEvent e) { ! if (currentEdge != null) { ! if (movePlane == null) { ! if (currentEdge.equals(xAxis)) { ! movePlane = new Plane(0, 0, 1, 0); ! edgeNormal = new Vertex(0, 1, 0); ! move(e); ! } else if (currentEdge.equals(yAxis)) { ! movePlane = new Plane(0, 0, 1, 0); ! edgeNormal = new Vertex(1, 0, 0); ! move(e); ! } else if (currentEdge.equals(zAxis)) { ! movePlane = new Plane(0, 1, 0, 0); ! edgeNormal = new Vertex(1, 0, 0); ! move(e); ! } else { ! findTarget(e); ! if (target instanceof Surface) { ! Surface targetSurface = (Surface)target; ! if (currentEdge.getSurfaces().contains(targetSurface)) { ! number = ""; ! glv.getView().makeTarget(target); ! movePlane = targetSurface.plane(); ! Vertex edgeDirection = currentEdge.getDirection(); ! Vertex surfaceNormal = targetSurface.normal(); ! edgeNormal = edgeDirection.cross(surfaceNormal); ! } ! } ! } ! } else if (angling) { ! findTarget(e); ! glv.getView().makeTarget(target); ! moveAngel(e); ! } else if (measuring) { ! findTarget(e); ! glv.getView().makeTarget(target); ! move(e); ! } ! } else { ! findTarget(e); ! glv.getView().makeTarget(target); } } /** - * Moves the angelsetting constructors. - * @param e the mouseevent - */ - private void moveAngel(MouseEvent e) { - Vertex moveTo = glv.getView().toPlaneCoords(new double[]{e.getX(), - e.getY()}, - movePlane); - Vertex delta = moveTo.minus(constructionPoint); - constructionPoint.move(delta.getX(), delta.getY(), delta.getZ()); - double degrees; - Vertex angelDir = edgeToConstruction.getDirection(); - Vertex edgeDir = currentEdge.getDirection(); - degrees = Math.acos((angelDir.dot(edgeDir) / (angelDir.length() * edgeDir.length()))); - degrees *= (180 / Math.PI); - glv.setLength(degrees / 1000); - } - - - /** * moves the construction line. - * @param e the mouseevent. */ ! private void move(MouseEvent e) { ! edgeNormal.scale(1 / edgeNormal.length()); ! Vertex moveVertex = edgeNormal.copy(); ! double x = e.getX(); ! double y = View.getHeight() - e.getY(); ! View v = glv.getView(); ! Transformation transformation = v.transformation(); ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! ray = transformation.unProject(ray); ! Vertex intersect = movePlane.intersection(ray); ! Vertex delta = intersect.minus(constructionPoint); ! moveVertex.scale(moveVertex.dot(delta) / (moveVertex.length() * ! moveVertex.length())); ! currentConstruction.move(moveVertex.getX(), moveVertex.getY(), moveVertex.getZ()); ! constructionPoint.move(moveVertex.getX(), moveVertex.getY(), moveVertex.getZ()); ! number = ""; ! glv.setLength(edgeToConstruction.getLength()); } --- 62,92 ---- */ protected void moved(MouseEvent e) { ! current = findIntersection(e); ! makeTarget(current); ! if (current != null) { ! move(); } + updateConstructors(); } /** * moves the construction line. */ ! private void move() { ! if (start != null) { ! Vertex direction = currentEdge.getDirection(); ! Vertex origin = start.vertex(); ! Plane plane = new Plane (direction.getX(), direction.getY(), direction.getZ(), ! -(direction.getX() * origin.getX() + ! direction.getY() * origin.getY() + ! direction.getZ() * origin.getZ())); ! Vertex currentPos = plane.project(current.vertex()); ! direction.scale(origin.dot(direction) / (direction.length() * direction.length())); ! currentPos = currentPos.add(direction); ! Vertex move = currentPos.minus(constructionPoint); ! ! currentConstruction.move(move.getX(), move.getY(), move.getZ()); ! constructionPoint.move(move.getX(), move.getY(), move.getZ()); ! } } *************** *** 187,244 **** */ protected void pressed(MouseEvent e) { ! View v = glv.getView(); ! v.addTempEdge(xAxis); ! v.addTempEdge(yAxis); ! v.addTempEdge(zAxis); ! findTarget(e); ! if (!measuring && !angling) { ! if (target instanceof Edge) { ! currentEdge = (Edge)target; ! angling = false; ! measuring = true; Vertex minus = currentEdge.getDirection(); minus.scale(1 / minus.length()); ! Vertex constructionFrom = createVertex(new double[] {(currentEdge.getFrom().getX() + ! minus.getX() * -50), ! (currentEdge.getFrom().getY() + ! minus.getY() * -50), ! (currentEdge.getFrom().getZ() + ! minus.getZ() * -50)}); ! Vertex constructionTo = createVertex(new double[] {(currentEdge.getTo().getX() + ! minus.getX() * 50), ! (currentEdge.getTo().getY() + ! minus.getY() * 50), ! (currentEdge.getTo().getZ() + ! minus.getZ() * 50)}); ! currentConstruction = createEdge(constructionFrom, constructionTo); currentConstruction.setConstructor(true); ! ! double x = e.getX(); ! double y = View.getHeight() - e.getY(); ! Transformation transformation = v.transformation(); ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! ray = transformation.unProject(ray); ! Edge intersection = currentEdge.intersection(ray); ! edgePoint = intersection.getFrom(); ! constructionPoint = edgePoint.copy(); ! edgeToConstruction = new Edge(edgePoint, constructionPoint); ! edgeToConstruction.setConstructor(true); ! v.addTempEdge(edgeToConstruction); ! v.addTempVertex(edgePoint); ! v.addTempVertex(constructionPoint); } - } else if (angling) { - endAngeling(); } else { endTapeMeasure(); } - v.removeTempEdge(xAxis); - v.removeTempEdge(yAxis); - v.removeTempEdge(zAxis); } /** * Invoked when a mouse button has been released on a component. * @param e The MouseEvent --- 103,153 ---- */ protected void pressed(MouseEvent e) { ! if (start == null) { ! if (current != null && current.object() instanceof Edge) { ! start = current; ! currentEdge = (Edge)current.object(); Vertex minus = currentEdge.getDirection(); minus.scale(1 / minus.length()); ! Vertex constructionFrom = new Vertex ((currentEdge.getFrom().getX() + ! minus.getX() * -50), ! (currentEdge.getFrom().getY() + ! minus.getY() * -50), ! (currentEdge.getFrom().getZ() + ! minus.getZ() * -50)); ! Vertex constructionTo = new Vertex((currentEdge.getTo().getX() + ! minus.getX() * 50), ! (currentEdge.getTo().getY() + ! minus.getY() * 50), ! (currentEdge.getTo().getZ() + ! minus.getZ() * 50)); ! currentConstruction = new Edge(constructionFrom, constructionTo); currentConstruction.setConstructor(true); ! constructionPoint = start.vertex().copy(); } } else { + start = null; endTapeMeasure(); } } /** + * Update constructors based on start, current and incident. + */ + protected void updateConstructors() { + if (start != null) { + Collection consts = new LinkedList(); + consts.add(currentConstruction); + Edge edge = new Edge(start.vertex(), constructionPoint); + edge.setConstructor(true); + glv.setLength(edge.getFrom().minus(edge.getTo()).length()); + consts.add(edge); + constructors(consts); + excluded(consts); + } else { + super.updateConstructors(); + } + } + + /** * Invoked when a mouse button has been released on a component. * @param e The MouseEvent *************** *** 252,322 **** */ public void keyPressed(KeyEvent e) { - /*a length can only be typed in if some surface is selected - for extrusion, and if the "number"-variable has been initialised - */ - super.keyPressed(e); - if (currentEdge != null && number != null) { - if (e.getKeyCode() == KeyEvent.VK_1) { - number += "1"; - } else if (e.getKeyCode() == KeyEvent.VK_2) { - number += "2"; - } else if (e.getKeyCode() == KeyEvent.VK_3) { - number += "3"; - } else if (e.getKeyCode() == KeyEvent.VK_4) { - number += "4"; - } else if (e.getKeyCode() == KeyEvent.VK_5) { - number += "5"; - } else if (e.getKeyCode() == KeyEvent.VK_6) { - number += "6"; - } else if (e.getKeyCode() == KeyEvent.VK_7) { - number += "7"; - } else if (e.getKeyCode() == KeyEvent.VK_8) { - number += "8"; - } else if (e.getKeyCode() == KeyEvent.VK_9) { - number += "9"; - } else if (e.getKeyCode() == KeyEvent.VK_0) { - number += "0"; - } else if (e.getKeyCode() == KeyEvent.VK_ENTER) { - if (!number.equals("")) { - if (measuring) { - double length = glv.getLength(); - double currentLength = edgeToConstruction.getLength(); - Vertex minus = edgeToConstruction.getTo().minus(edgeToConstruction.getFrom()); - edgeNormal.scale(1 / edgeNormal.length()); - minus.scale(1 / minus.length()); - double delta; - if (minus.dot(edgeNormal) > 0) { - delta = length - currentLength; - } else { - delta = -(length - currentLength); - } - constructionPoint.move(edgeNormal.getX() * delta, - edgeNormal.getY() * delta, - edgeNormal.getZ() * delta); - currentConstruction.move(edgeNormal.getX() * delta, - edgeNormal.getY() * delta, - edgeNormal.getZ() * delta); - endTapeMeasure(); - } - glv.repaint(); - } - } else if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) { - int length = number.length(); - if (length > 0) { - number = number.substring(0, length - 1); - } - } - if (number.equals("")) { - glv.setLength(0); - } else { - try { - double d = Double.parseDouble(number); - glv.setLength(d / 1000); - } catch (NumberFormatException exp) { - log.warn(exp); - } - } - } super.keyPressed(e); } --- 161,166 ---- */ public void keyPressed(KeyEvent e) { super.keyPressed(e); + move(); } *************** *** 325,367 **** */ private void endTapeMeasure() { ! if (measuring) { ! View v = glv.getView(); ! v.removeTempEdge(edgeToConstruction); ! v.removeTempVertex(edgePoint); ! v.removeTempVertex(constructionPoint); currentEdge = null; ! currentConstruction = null; ! movePlane = null; ! edgeToConstruction = null; ! Project.getInstance().remove(edgePoint); ! Project.getInstance().remove(constructionPoint); ! measuring = false; Project.getInstance().checkpoint(); } } - /** - * Ends the angeling - */ - private void endAngeling() { - if (movePlane != null) { - Vertex angelDir = edgeToConstruction.getDirection(); - Vertex to = angelDir.copy(); - Vertex from = angelDir.copy(); - to.scale(50); - to = to.add(edgePoint); - from.scale(-50); - from = from.add(edgePoint); - currentConstruction.setTo(to); - currentConstruction.setFrom(from); - Vertex planeNormal = movePlane.normal(); - Vertex constructionDir = currentConstruction.getDirection(); - edgeNormal = constructionDir.cross(planeNormal); - - constructionPoint = edgePoint.copy(); - edgeToConstruction.setTo(constructionPoint); - glv.getView().makeTarget(constructionPoint); - } - angling = false; - measuring = true; - } } --- 169,180 ---- */ private void endTapeMeasure() { ! if (currentConstruction != null) { ! insertEdge(currentConstruction, false); ! createEdge(currentConstruction.getFrom(), currentConstruction.getFrom()); currentEdge = null; ! constructors(new LinkedList()); ! excluded(new LinkedList()); Project.getInstance().checkpoint(); } } } |
From: Nordholt <nor...@us...> - 2006-04-21 15:06:48
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13055 Modified Files: RectTool.java Log Message: corrected error that made the program crash Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RectTool.java 21 Apr 2006 14:56:06 -0000 1.7 --- RectTool.java 21 Apr 2006 15:06:38 -0000 1.8 *************** *** 50,53 **** --- 50,59 ---- Vertex d = start.minus(end); + /* So no edges are created with null vertices */ + if (Math.abs(d.getX()) < 0.00001 && + Math.abs(d.getY()) < 0.00001 && + Math.abs(d.getZ()) < 0.00001) { + return edges; + } Vertex v1 = null; Vertex v3 = null; |
From: Nordholt <nor...@us...> - 2006-04-21 15:05:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11866 Modified Files: MoveTool.java Log Message: added checkpoint Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** MoveTool.java 13 Apr 2006 13:43:26 -0000 1.53 --- MoveTool.java 21 Apr 2006 15:05:00 -0000 1.54 *************** *** 125,128 **** --- 125,129 ---- vertices = null; excluded(new HashSet()); + Project.getInstance().checkpoint(); } } |
From: rimestad <rim...@us...> - 2006-04-21 14:56:17
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6100/src/net/sourceforge/bprocessor/gl/tool Modified Files: RectTool.java Log Message: Repaired the tool so that it is leagal to make infinite narrow boxes and so that it uses AbstractPencil.cleanUp() instead of RectTool.cleanUp() Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RectTool.java 10 Apr 2006 07:11:19 -0000 1.6 --- RectTool.java 21 Apr 2006 14:56:06 -0000 1.7 *************** *** 13,17 **** --- 13,20 ---- import java.util.List; + import org.apache.log4j.Logger; + import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Vertex; *************** *** 24,27 **** --- 27,33 ---- private Edge e1, e2, e3, e4; + /** The logger */ + private static Logger log = Logger.getLogger(RectTool.class); + /** * Constructor *************** *** 38,42 **** * @param start Start point * @param end End point ! * @return List of edges forming a rectangle */ List createRect(Vertex start, Vertex end) { --- 44,48 ---- * @param start Start point * @param end End point ! * @return List of edges forming a rectangle, null if the edges only form a line */ List createRect(Vertex start, Vertex end) { *************** *** 65,68 **** --- 71,80 ---- v4 = new Vertex(v3.getX(), v3.getY(), v1.getZ()); } + if ((Math.abs(d.getX()) < 0.00001 && Math.abs(d.getY()) < 0.00001) || + (Math.abs(d.getX()) < 0.00001 && Math.abs(d.getZ()) < 0.00001) || + (Math.abs(d.getZ()) < 0.00001 && Math.abs(d.getY()) < 0.00001)) { + // The box is only in one direction and therefor just an edge + return null; + } if (v1 != null) { e1 = new Edge(v1, v2); *************** *** 88,92 **** edge.setConstructor(true); edges.add(edge); ! edges.addAll(createRect(start.vertex(), current.vertex())); feedback(edges); } else { --- 100,109 ---- edge.setConstructor(true); edges.add(edge); ! List l = createRect(start.vertex(), current.vertex()); ! if (l != null) { ! edges.addAll(l); ! } else { ! edge.setConstructor(false); ! } feedback(edges); } else { *************** *** 124,132 **** if (start == null) { start = current; ! cleanUp(); } else { ! insertEdges(createRect(start.vertex(), current.vertex())); ! start = null; ! incident = null; } updateFeedback(); --- 141,158 ---- if (start == null) { start = current; ! e1 = null; ! e2 = null; ! e3 = null; ! e4 = null; } else { ! List edges = createRect(start.vertex(), current.vertex()); ! if (edges != null) { ! insertEdges(edges); ! } else { ! boolean split = (start.type() == Intersection.EDGE_INTERSECTION || ! current.type() == Intersection.EDGE_INTERSECTION); ! insertEdge(new Edge(start.vertex(), current.vertex()), split); ! } ! cleanUp(); } updateFeedback(); *************** *** 155,158 **** --- 181,185 ---- e3 = null; e4 = null; + super.cleanUp(); } } |
From: rimestad <rim...@us...> - 2006-04-19 16:16:30
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19195/src/net/sourceforge/bprocessor/gl/tool Modified Files: MultiExtrudeTool.java Log Message: Repaired the tool to assign the spaces correct and use negative extrusions in one of the directions.... Index: MultiExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MultiExtrudeTool.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** MultiExtrudeTool.java 5 Apr 2006 10:23:27 -0000 1.15 --- MultiExtrudeTool.java 19 Apr 2006 16:16:25 -0000 1.16 *************** *** 21,25 **** import net.sourceforge.bprocessor.gl.GLView; - import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; --- 21,24 ---- *************** *** 39,45 **** private static Logger log = Logger.getLogger(MultiExtrudeTool.class); - /** Point based snapping? */ - private static final boolean SNAPPING = false; - /** The dragSurface and extrudeSurface */ private Surface top, extrudeSurface; --- 38,41 ---- *************** *** 68,71 **** --- 64,70 ---- /** The length of the extrusion */ private String number; + + /** The normal to drag along */ + private Vertex normal; /** *************** *** 85,95 **** protected void pressed(MouseEvent e) { findTarget(e); - extrudeSurface = null; - top = null; t = 0; - v2dir = null; - elements = new HashSet(); number = ""; ! if (target instanceof Surface) { if (Selection.primary().isEmpty() || Selection.primary().contains(target)) { --- 84,93 ---- protected void pressed(MouseEvent e) { findTarget(e); t = 0; number = ""; ! extrudeSurface = null; ! direction = 0.0; ! normal = null; ! cleanUp(); if (target instanceof Surface) { if (Selection.primary().isEmpty() || Selection.primary().contains(target)) { *************** *** 108,111 **** --- 106,111 ---- ray = trans.unProject(ray); dragPlane = extrudeSurface.plane().orthogonalPlane(ray); + normal = extrudeSurface.normal().copy(); + normal.scale(-1); } } *************** *** 119,199 **** if (extrudeSurface != null) { // it is possible to make an extrusion find the direction - Vertex normal; - if (top == null) { - normal = extrudeSurface.normal(); - } else { - normal = top.normal(); - } View view = glv.getView(); Vertex from = view.toPlaneCoords(new double[] {pressX, pressY}, dragPlane); ! Vertex to; ! if (SNAPPING) { ! Set ignore = new HashSet(); ! if (elements != null) { ! ignore.addAll(elements); ! } ! ignore.add(extrudeSurface); ! ignore.addAll(extrudeSurface.getEdges()); ! Intersection intersection = ! (Intersection) view.getObjectAtPoint(e.getX(), e.getY(), ignore, true, dragPlane); ! if (intersection == null || intersection.type() == Intersection.SURFACE) { ! to = view.toPlaneCoords(new double[] {e.getX(), e.getY()}, dragPlane); ! } else { ! to = intersection.vertex(); ! } ! } else { ! to = view.toPlaneCoords(new double[] {e.getX(), e.getY()}, dragPlane); ! } ! Vertex delta = to.minus(from); ! double normDotDelta = normal.dot(delta); ! if (Math.abs(normDotDelta) < 0.000001) { ! normDotDelta = 0; } ! ! if (direction == 0) { ! //we have never set the direction; direction = normDotDelta; } ! if (top == null) { ! // there are no extrusion make one if we move the mouse ! if ((e.getX() - pressX) * (e.getX() - pressX) + ! (e.getY() - pressY) * (e.getY() - pressY) > 16) { ! direction = normDotDelta; ! elements = makeExtrusion(); ! } ! } ! if (!SNAPPING && v2dir != null) { // The extrusion were succesfull move it // Find the move direction ! findTarget(e, elements); ! if (target != null && target instanceof Surface) { ! //If there are a target that is a surface drag to that surface ! Vertex origin = extrudeSurface.getFirstVertex(); ! Surface current = (Surface) target; ! if (current != extrudeSurface && current != top && !elements.contains(current)) { ! Vertex n = current.normal(); ! Vertex cross = normal.cross(n); ! if (cross.isZero()) { ! Vertex cur = current.getFirstVertex(); ! Vertex vector = cur.minus(origin); ! double d = vector.dot(normal); ! if (Math.abs(d) > 0.0000001) { moveTo(v2dir.values(), d); - return; } } } - } - // otherwise do a normal extrude - if (direction * normDotDelta > 0) { - // the extrusion is still in the same direction - moveTo(v2dir.values(), normDotDelta); } else { ! // we have to remove the extrusion and make a new one ! remove(elements); ! elements = makeExtrusion(); ! direction = normDotDelta; ! if (v2dir != null) { moveTo(v2dir.values(), normDotDelta); } } --- 119,187 ---- if (extrudeSurface != null) { // it is possible to make an extrusion find the direction View view = glv.getView(); Vertex from = view.toPlaneCoords(new double[] {pressX, pressY}, dragPlane); ! Vertex to = view.toPlaneCoords(new double[] {e.getX(), e.getY()}, dragPlane); ! double normDotDelta = 0.0; ! if (to != null && from != null) { ! Vertex delta = to.minus(from); ! normDotDelta = normal.dot(delta); } ! if (v2dir == null) { direction = normDotDelta; + elements = makeExtrusion(); } ! if (v2dir != null) { // The extrusion were succesfull move it // Find the move direction ! Set ignore = new HashSet(); ! if (elements != null) { ! ignore.addAll(elements); ! Iterator iter = elements.iterator(); ! while (iter.hasNext()) { ! Surface sur = (Surface)iter.next(); ! ignore.addAll(sur.getEdges()); ! } ! } ! ignore.add(extrudeSurface); ! ignore.removeAll(extrudeSurface.getEdges()); ! findTarget(e, ignore); ! if (target != null) { ! if (target instanceof Surface) { ! //If there are a target that is a surface drag to that surface ! Vertex origin = extrudeSurface.getFirstVertex(); ! Surface current = (Surface) target; ! if (current != top && !elements.contains(current)) { ! Vertex n = current.normal(); ! Vertex cross = normal.cross(n); ! if (cross.isZero()) { ! Vertex cur = current.getFirstVertex(); ! Vertex vector = cur.minus(origin); ! double d = vector.dot(normal); moveTo(v2dir.values(), d); } } + } else if (target instanceof Edge) { + Edge tar = (Edge)target; + Vertex ver = (tar).center(); + Vertex origin = extrudeSurface.getFirstVertex(); + if (!ignore.contains(tar)) { + Vertex vector = ver.minus(origin); + double d = vector.dot(normal); + moveTo(v2dir.values(), d); + } } } else { ! // otherwise do a normal extrude ! if (direction * normDotDelta > 0) { ! // the extrusion is still in the same direction moveTo(v2dir.values(), normDotDelta); + } else { + // we have to remove the extrusion and make a new one + direction = normDotDelta; + remove(elements); + elements = makeExtrusion(); + if (v2dir != null) { + moveTo(v2dir.values(), normDotDelta); + } } } *************** *** 215,221 **** } } } } ! /** * Move a collection of vertex, direction pairs --- 203,233 ---- } } + cleanUp(); } } ! ! /** ! * Clean up after use ! */ ! public void cleanUp() { ! top = null; ! v2dir = null; ! elements = new HashSet(); ! surfaces = new HashSet(); ! } ! ! /** ! * Finish of the extrusion ! */ ! private void finishExtrusion() { ! Iterator iter = elements.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! holeAnalysis(current); ! } ! Project.getInstance().changed(Project.getInstance()); ! Project.getInstance().checkpoint(); ! } ! /** * Move a collection of vertex, direction pairs *************** *** 234,238 **** } t = to; ! glv.setLength(Math.abs(t)); } --- 246,250 ---- } t = to; ! glv.setLength(t); } *************** *** 247,260 **** return; } else if (v2dir != null) { ! Iterator iter = elements.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! holeAnalysis(current); ! } ! Project.getInstance().changed(Project.getInstance()); ! Project.getInstance().checkpoint(); } } ! /** * Make the extrusion from either a set of surfaces --- 259,266 ---- return; } else if (v2dir != null) { ! finishExtrusion(); } } ! /** * Make the extrusion from either a set of surfaces *************** *** 285,289 **** while (iter.hasNext()) { Surface cur = (Surface)iter.next(); ! Surface s = cur.extrude(direction, elements, e2e, v2e, e2s, v2dir); if (cur == extrudeSurface) { // Set the top to the extruded surface of target --- 291,295 ---- while (iter.hasNext()) { Surface cur = (Surface)iter.next(); ! Surface s = cur.extrude(-direction, elements, e2e, v2e, e2s, v2dir); if (cur == extrudeSurface) { // Set the top to the extruded surface of target *************** *** 321,333 **** */ private void apply(double length) { ! if (v2dir != null) { ! moveTo(v2dir.values(), length); } else { ! makeExtrusion(); ! moveTo(v2dir.values(), length); ! } ! Iterator iter = elements.iterator(); ! while (iter.hasNext()) { ! holeAnalysis((Surface)(iter.next())); } } --- 327,347 ---- */ private void apply(double length) { ! if (length != 0.0 && extrudeSurface != null) { ! if (direction * length <= 0.0) { ! direction = length; ! log.info("Changed dir to: " + direction); ! remove(elements); ! cleanUp(); ! } ! if (v2dir != null) { ! moveTo(v2dir.values(), length); ! } else { ! elements = makeExtrusion(); ! moveTo(v2dir.values(), length); ! } ! finishExtrusion(); } else { ! remove(elements); ! cleanUp(); } } *************** *** 363,366 **** --- 377,384 ---- } else if (e.getKeyCode() == KeyEvent.VK_0) { number += "0"; + } else if (e.getKeyCode() == KeyEvent.VK_MINUS) { + if (number.equals("")) { + number += "-"; + } } else if (e.getKeyCode() == KeyEvent.VK_ENTER) { if (!number.equals("")) { *************** *** 368,371 **** --- 386,390 ---- apply(length); glv.repaint(); + number = ""; } } else if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) { |
From: rimestad <rim...@us...> - 2006-04-19 16:13:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17096/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java SpaceTool.java AbstractPencil.java Log Message: NONE space removed from space assign menu and Void added instead. Therefore mesh method is moved from ab. pencil til abstractTool Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** SpaceTool.java 13 Apr 2006 13:45:03 -0000 1.17 --- SpaceTool.java 19 Apr 2006 16:13:54 -0000 1.18 *************** *** 408,416 **** } ! JMenuItem noneItem = new JMenuItem("NONE"); ! ActionListener noneListener = new DomainPopupListener(null, ! surface, ! side.equals("front")); ! noneItem.addActionListener(noneListener); Collection domains = null; --- 408,418 ---- } ! JMenuItem voidItem = new JMenuItem("Void"); ! Space sp = mesh(); ! ActionListener voidListener = ! new DomainPopupListener(sp.getEmpty(), ! surface, ! side.equals("front")); ! voidItem.addActionListener(voidListener); Collection domains = null; *************** *** 479,483 **** menu.add(constMenu); menu.addSeparator(); ! menu.add(noneItem); menu.add(editSpaceItem); menu.addPopupMenuListener(spl); --- 481,485 ---- menu.add(constMenu); menu.addSeparator(); ! menu.add(voidItem); menu.add(editSpaceItem); menu.addPopupMenuListener(spl); Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** AbstractPencil.java 13 Apr 2006 13:34:56 -0000 1.23 --- AbstractPencil.java 19 Apr 2006 16:13:54 -0000 1.24 *************** *** 89,104 **** plane = new Plane (0, 0, 1, 0); } - - /** - * Get the mesh - * @return The mesh - */ - public Space mesh() { - if (Project.getInstance().getActiveSpace() != null) { - return Project.getInstance().getActiveSpace(); - } else { - return Project.getInstance().world(); - } - } /** --- 89,92 ---- Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** AbstractTool.java 5 Apr 2006 10:26:40 -0000 1.68 --- AbstractTool.java 19 Apr 2006 16:13:54 -0000 1.69 *************** *** 15,18 **** --- 15,19 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 109,112 **** --- 110,125 ---- Toolkit.getDefaultToolkit().createCustomCursor(dragImage, new Point(7, 8), "Drag"); } + + /** + * Get the mesh + * @return The mesh + */ + public Space mesh() { + if (Project.getInstance().getActiveSpace() != null) { + return Project.getInstance().getActiveSpace(); + } else { + return Project.getInstance().world(); + } + } /** |
From: Nordholt <nor...@us...> - 2006-04-13 14:01:18
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17304 Modified Files: Surface.java Log Message: corrected documentation Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** Surface.java 10 Apr 2006 14:57:19 -0000 1.91 --- Surface.java 13 Apr 2006 14:01:16 -0000 1.92 *************** *** 42,46 **** private List edges; ! /** The holdes of this surface */ private Set holes; --- 42,46 ---- private List edges; ! /** The holes of this surface */ private Set holes; |
From: Nordholt <nor...@us...> - 2006-04-13 14:00:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16789 Modified Files: Space.java Log Message: made Space inherit from geometric and implemented the collect method Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Space.java 12 Apr 2006 14:29:27 -0000 1.25 --- Space.java 13 Apr 2006 14:00:44 -0000 1.26 *************** *** 28,32 **** * column="DOMAIN_ID" */ ! public class Space extends Entity implements Parametric { /** Default */ private static final long serialVersionUID = 1L; --- 28,32 ---- * column="DOMAIN_ID" */ ! public class Space extends Geometric implements Parametric { /** Default */ private static final long serialVersionUID = 1L; *************** *** 767,771 **** */ public Vertex center() { ! return null; } --- 767,780 ---- */ public Vertex center() { ! Vertex average = new Vertex(0, 0, 0); ! Set verts = collect(); ! if (!verts.isEmpty()) { ! Iterator it = verts.iterator(); ! while (it.hasNext()) { ! average.add((Vertex)it.next()); ! } ! average.scale(1.0 / (double)verts.size()); ! } ! return average; } *************** *** 831,834 **** --- 840,874 ---- } + /** + * Collects the set of vertices in this space + * @return the set of vertices + */ + public Set collect() { + Set result = new HashSet(); + Iterator it = envelope.iterator(); + while (it.hasNext()) { + result.addAll(((Geometric)it.next()).collect()); + } + if (container) { + it = elements.values().iterator(); + while (it.hasNext()) { + result.addAll(((Geometric)it.next()).collect()); + } + it = surfaces.values().iterator(); + while (it.hasNext()) { + result.addAll(((Geometric)it.next()).collect()); + } + it = edges.values().iterator(); + while (it.hasNext()) { + result.addAll(((Geometric)it.next()).collect()); + } + it = vertices.values().iterator(); + while (it.hasNext()) { + result.addAll(((Geometric)it.next()).collect()); + } + } + return result; + } + /** * Delete the entity |
From: Nordholt <nor...@us...> - 2006-04-13 13:55:30
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12158 Modified Files: View.java Log Message: removed this code, I honestly do not know what its intention was but it messed things up when interested in other planes than the XY Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** View.java 10 Apr 2006 11:55:43 -0000 1.77 --- View.java 13 Apr 2006 13:55:23 -0000 1.78 *************** *** 1971,1980 **** Vertex intersection = xy.intersection(ray); if (intersection != null) { - // FIXME The plane intersection should take care - // of the following round off - double values[] = xy.getDoublev(); - if (values[3] == 0) { - intersection.setZ(0.0); - } return new Intersection(intersection, Intersection.PLANE_INTERSECTION, xy); } --- 1971,1974 ---- |
From: Nordholt <nor...@us...> - 2006-04-13 13:52:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9513 Modified Files: ClippingPlane.java Log Message: Implemented the collect method but move still does not work because the clipping plane is not defined by its vertices. Added delete hack to make compile Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/ClippingPlane.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ClippingPlane.java 11 Feb 2006 18:14:15 -0000 1.7 --- ClippingPlane.java 13 Apr 2006 13:52:26 -0000 1.8 *************** *** 10,13 **** --- 10,15 ---- import java.util.Iterator; import java.util.ArrayList; + import java.util.Set; + import java.util.HashSet; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 16,19 **** --- 18,22 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Geometric; import org.apache.log4j.Logger; *************** *** 21,25 **** * The Clippingplane */ ! public class ClippingPlane { /** The logger */ private static Logger log = Logger.getLogger(ClippingPlane.class); --- 24,28 ---- * The Clippingplane */ ! public class ClippingPlane extends Geometric { /** The logger */ private static Logger log = Logger.getLogger(ClippingPlane.class); *************** *** 72,75 **** --- 75,86 ---- /** + * gets the center + * @return center + */ + public Vertex center() { + return origin(); + } + + /** * Update this clipping from the defining coordinatesystem attribute * *************** *** 182,185 **** --- 193,214 ---- return corners; } + + /** + * collects the vertices for this clipplane + * @return the set of vertices + */ + public Set collect() { + Set result = new HashSet(); + result.add(origin()); + return result; + } + + /** + * FIXME: empty implementation to make compile + * (pfff make sure stuff compiles before you check in please) + */ + public void delete() { + return; + } /** |
From: Nordholt <nor...@us...> - 2006-04-13 13:45:18
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2965 Modified Files: SpaceTool.java Log Message: hack to make compile Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** SpaceTool.java 5 Apr 2006 09:36:16 -0000 1.16 --- SpaceTool.java 13 Apr 2006 13:45:03 -0000 1.17 *************** *** 312,315 **** --- 312,323 ---- return null; } + + /** + * FIXME: empty implementation to make compile + * (pfff make sure stuff compiles before you check in please) + */ + public void delete() { + return; + } } |
From: Nordholt <nor...@us...> - 2006-04-13 13:43:38
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1718 Modified Files: MoveTool.java Log Message: remembering to clean up (should remove flickering target). Making move specified by lengthfield work. Small change to getaffected method to make movement of spaces work. Now works both as drag and click-click tool. Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** MoveTool.java 5 Apr 2006 10:24:56 -0000 1.52 --- MoveTool.java 13 Apr 2006 13:43:26 -0000 1.53 *************** *** 54,57 **** --- 54,60 ---- protected Edge moveConstructor; + /** Dragging flag */ + protected boolean dragFlag = false; + /** * The Constructor *************** *** 132,139 **** protected void released(MouseEvent e) { if (strategy != null) { ! strategy.released(e); } else { - findTarget(e); - number = ""; Project.getInstance().checkpoint(); } --- 135,143 ---- protected void released(MouseEvent e) { if (strategy != null) { ! if (dragFlag) { ! dragFlag = false; ! strategy.pressed(e); ! } } else { Project.getInstance().checkpoint(); } *************** *** 150,161 **** Intersection oldCurrent = current; current = findIntersection(e); ! if (current != null && ! from != null && ! moveEntities != null) { ! move(vertices, current.vertex().minus(from)); } updateConstructors(); } } --- 154,169 ---- Intersection oldCurrent = current; current = findIntersection(e); ! if (current != null) { ! makeTarget(current); ! if (from != null && ! moveEntities != null) { ! move(vertices, current.vertex().minus(from)); ! } } updateConstructors(); } } + + *************** *** 166,170 **** protected void dragged(MouseEvent e) { if (strategy != null) { ! strategy.dragged(e); } } --- 174,179 ---- protected void dragged(MouseEvent e) { if (strategy != null) { ! dragFlag = true; ! strategy.moved(e); } } *************** *** 199,269 **** */ public void keyPressed(KeyEvent e) { - /* if (strategy != null) { strategy.keyPressed(e); } else { ! if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { ! move(vertices, initial.minus(from)); ! } else if (lastMoveDirection != null && ! initial != null && ! from != null && ! vertices != null && ! number != null) { ! if (e.getKeyCode() == KeyEvent.VK_1) { ! number += "1"; ! } else if (e.getKeyCode() == KeyEvent.VK_2) { ! number += "2"; ! } else if (e.getKeyCode() == KeyEvent.VK_3) { ! number += "3"; ! } else if (e.getKeyCode() == KeyEvent.VK_4) { ! number += "4"; ! } else if (e.getKeyCode() == KeyEvent.VK_5) { ! number += "5"; ! } else if (e.getKeyCode() == KeyEvent.VK_6) { ! number += "6"; ! } else if (e.getKeyCode() == KeyEvent.VK_7) { ! number += "7"; ! } else if (e.getKeyCode() == KeyEvent.VK_8) { ! number += "8"; ! } else if (e.getKeyCode() == KeyEvent.VK_9) { ! number += "9"; ! } else if (e.getKeyCode() == KeyEvent.VK_0) { ! number += "0"; ! } else if (e.getKeyCode() == KeyEvent.VK_ENTER) { ! if (!number.equals("")) { ! double length = glv.getLength(); ! Vertex delta = initial.minus(from); ! if (delta.length( 0) { ! delta.scale((delta.length() - length) / delta.length()); ! } else { ! delta = lastMoveDirection.copy(); ! delta.scale(length / delta.length()); ! } ! move(vertices, delta); ! update(); ! glv.repaint(); ! } ! } else if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) { ! int length = number.length(); ! if (length > 0) { ! number = number.substring(0, length - 1); ! } ! } ! if (number.equals("") || number.equals("-")) { ! glv.setLength(0); ! } else { ! try { ! double d = Double.parseDouble(number); ! glv.setLength(d / 1000); ! } catch (NumberFormatException exp) { ! System.out.println(exp); ! } ! } ! } else { ! super.keyPressed(e); } - glv.repaint(true); } - */ } --- 208,230 ---- */ public void keyPressed(KeyEvent e) { if (strategy != null) { strategy.keyPressed(e); } else { ! super.keyPressed(e); ! if (current != null && ! moveEntities != null && ! from != null && ! (from.getX() != current.vertex().getX() || ! from.getY() != current.vertex().getY() || ! from.getZ() != current.vertex().getZ())) { ! move(vertices, current.vertex().minus(from)); ! start = null; ! moveEntities = null; ! incident = null; ! vertices = null; ! excluded(new HashSet()); ! glv.repaint(true); } } } *************** *** 273,276 **** --- 234,238 ---- */ public void setStrategy(MoveTool strategy) { + timer.stop(); this.strategy = strategy; } *************** *** 293,302 **** excopy.addAll(excluded); excluded(excopy); - glv.setLength(moveConstructor.getLength()); } else { constructors(new LinkedList()); feedback(new LinkedList()); } - makeTarget(current); } --- 255,262 ---- *************** *** 311,315 **** HashSet affectedEdges = new HashSet(); HashSet affectedSurfaces = new HashSet(); ! collect(moveElements, affected); Iterator it = affected.iterator(); while (it.hasNext()) { --- 271,275 ---- HashSet affectedEdges = new HashSet(); HashSet affectedSurfaces = new HashSet(); ! affected.addAll(collect(moveElements)); Iterator it = affected.iterator(); while (it.hasNext()) { *************** *** 322,324 **** --- 282,296 ---- return affected; } + + /** + * Clean up + */ + public void cleanUp() { + if (strategy != null) { + strategy.cleanUp(); + } else { + super.cleanUp(); + } + } + } |