bprocessor-commit Mailing List for B-processor (Page 39)
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...> - 2007-11-19 10:51:38
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28510/src/net/sourceforge/bprocessor/model Modified Files: Component.java Log Message: Improvement to components Index: Component.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Component.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Component.java 19 Nov 2007 09:33:20 -0000 1.2 --- Component.java 19 Nov 2007 10:51:41 -0000 1.3 *************** *** 35,38 **** --- 35,47 ---- name = s.getName(); } + + /** + * Constructs a component for specified union + * @param union Union + */ + public Component(Space union) { + this.space = union; + name = union.getName(); + } /** *************** *** 139,143 **** */ public void setAttributes(List<Attribute> attributes) { ! } --- 148,156 ---- */ public void setAttributes(List<Attribute> attributes) { ! for (Attribute current : attributes) { ! if (current.getName().equals("name")) { ! setName((String) current.getValue()); ! } ! } } |
From: Michael L. <he...@us...> - 2007-11-19 10:51:34
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28490/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Improvement to components Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** GenericTreeView.java 19 Nov 2007 09:33:17 -0000 1.124 --- GenericTreeView.java 19 Nov 2007 10:51:38 -0000 1.125 *************** *** 514,557 **** public void update(Object object) { if (object instanceof Collection) { ! if (sort) { ! content = (Collection) object; ! Set<Entity> elements = new HashSet<Entity>(); ! elements.addAll(content); ! Set<GenericNode> children = new HashSet<GenericNode>(); ! Enumeration enumeration = this.children(); ! while (enumeration.hasMoreElements()) { ! GenericNode node = (GenericNode)enumeration.nextElement(); ! Entity entity = (Entity)node.getUserObject(); ! if (elements.contains(entity)) { ! node.update(entity); ! elements.remove(entity); ! } else { ! children.add(node); ! } ! } ! if (elements.size() > 0) { ! this.insertChildren(elements); ! } ! if (children.size() > 0) { ! this.removeChildren(children); ! } ! } else { ! boolean insert = false; ! Collection c = (Collection) object; ! HashSet set = new HashSet(c); ! Enumeration children = this.children(); ! while (children.hasMoreElements()) { ! GenericNode node = (GenericNode)children.nextElement(); ! if (!set.contains(node.getUserObject())) { ! this.removeAllChildren(); ! insert = true; ! break; ! } ! } ! if (insert) { ! this.insertChildren(c); ! model.nodeStructureChanged(this); } } } else { log.warn(userObject + " were called with " + object + " and not a collection"); --- 514,538 ---- public void update(Object object) { if (object instanceof Collection) { ! content = (Collection) object; ! Set<Entity> elements = new HashSet<Entity>(); ! elements.addAll(content); ! Set<GenericNode> children = new HashSet<GenericNode>(); ! Enumeration enumeration = this.children(); ! while (enumeration.hasMoreElements()) { ! GenericNode node = (GenericNode)enumeration.nextElement(); ! Entity entity = (Entity)node.getUserObject(); ! if (elements.contains(entity)) { ! node.update(entity); ! elements.remove(entity); ! } else { ! children.add(node); } } + if (elements.size() > 0) { + this.insertChildren(elements); + } + if (children.size() > 0) { + this.removeChildren(children); + } } else { log.warn(userObject + " were called with " + object + " and not a collection"); *************** *** 1231,1234 **** --- 1212,1227 ---- return menu; } + + /** + * Return icon + * @return icon + */ + public ImageIcon icon() { + if (((Component)userObject).getSpace().isConstructionSpace()) { + return constructionspaceicon; + } else { + return functionalspaceicon; + } + } } |
From: Michael L. <he...@us...> - 2007-11-19 10:51:34
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28490/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Improvement to components Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** PopupMenu.java 18 Nov 2007 19:14:36 -0000 1.73 --- PopupMenu.java 19 Nov 2007 10:51:38 -0000 1.74 *************** *** 29,32 **** --- 29,33 ---- import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Command; + import net.sourceforge.bprocessor.model.Component; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; *************** *** 305,308 **** --- 306,320 ---- menu.add(action); } + { + AbstractAction action = new SpaceMenuAction(sp, "Make Component") { + public void actionPerformed(ActionEvent event) { + Component component = new Component(space); + Project.getInstance().addCalalogObject(component); + Project.getInstance().changed(Project.getInstance()); + Project.getInstance().checkpoint(); + } + }; + menu.add(action); + } if (CHECKS) { |
From: Michael L. <he...@us...> - 2007-11-19 09:33:18
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30835/src/net/sourceforge/bprocessor/model Modified Files: Component.java Log Message: Made component extend entity Index: Component.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Component.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Component.java 19 Nov 2007 09:20:41 -0000 1.1 --- Component.java 19 Nov 2007 09:33:20 -0000 1.2 *************** *** 14,18 **** * A object pointing to a lib file */ ! public class Component implements Parametric { private File file; private Space space = null; --- 14,18 ---- * A object pointing to a lib file */ ! public class Component extends Entity implements Parametric { private File file; private Space space = null; *************** *** 190,192 **** --- 190,197 ---- this.name = name; } + + /** {@inheritDoc} */ + @Override + public void delete() { + } } |
From: Michael L. <he...@us...> - 2007-11-19 09:33:15
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30827/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Made component extend entity Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** GenericTreeView.java 19 Nov 2007 09:27:00 -0000 1.123 --- GenericTreeView.java 19 Nov 2007 09:33:17 -0000 1.124 *************** *** 1160,1164 **** * Component Container */ ! public class ComponentContainer extends GenericNode { /** * Constructor for Catalog objects --- 1160,1164 ---- * Component Container */ ! public class ComponentContainer extends ContainerNode { /** * Constructor for Catalog objects *************** *** 1167,1188 **** */ public ComponentContainer(String name, Collection<Component> content) { ! super(name); ! for (Component l : content) { ! this.add(new ComponentNode(l)); ! } } ! /** ! * Update the node with the given object ! * @param o The object ! */ ! public void update(Object o) { ! if (o instanceof Collection) { ! this.removeAllChildren(); ! for (Component l : (Collection<Component>)o) { ! this.add(new ComponentNode(l)); ! } ! model.nodeStructureChanged(this); ! } } } --- 1167,1176 ---- */ public ComponentContainer(String name, Collection<Component> content) { ! super(name, content, false); } ! /** {@inheritDoc} */ ! public EntityNode nodeFor(Object entity) { ! return new ComponentNode((Component) entity); } } *************** *** 1191,1195 **** * Component Node */ ! public class ComponentNode extends GenericNode { /** * Constructor --- 1179,1183 ---- * Component Node */ ! public class ComponentNode extends EntityNode { /** * Constructor |
From: Michael L. <he...@us...> - 2007-11-19 09:26:57
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28141/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java LibraryTreeView.java Log Message: Renamed CatalogNode to ComponentNode and CatalogContainer to ComponentContainer Index: LibraryTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/LibraryTreeView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LibraryTreeView.java 12 Nov 2007 19:20:57 -0000 1.3 --- LibraryTreeView.java 19 Nov 2007 09:27:00 -0000 1.4 *************** *** 20,24 **** super(); root.removeAllChildren(); ! root.add(new CatalogContainer("Unions", Project.getLibraryObjects())); model.nodeStructureChanged(root); } --- 20,24 ---- super(); root.removeAllChildren(); ! root.add(new ComponentContainer("Unions", Project.getLibraryObjects())); model.nodeStructureChanged(root); } Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** GenericTreeView.java 19 Nov 2007 09:14:22 -0000 1.122 --- GenericTreeView.java 19 Nov 2007 09:27:00 -0000 1.123 *************** *** 1158,1164 **** /** ! * Catalog Container */ ! public class CatalogContainer extends GenericNode { /** * Constructor for Catalog objects --- 1158,1164 ---- /** ! * Component Container */ ! public class ComponentContainer extends GenericNode { /** * Constructor for Catalog objects *************** *** 1166,1173 **** * @param content the children for the node */ ! public CatalogContainer(String name, Collection<Component> content) { super(name); for (Component l : content) { ! this.add(new CatalogNode(l)); } } --- 1166,1173 ---- * @param content the children for the node */ ! public ComponentContainer(String name, Collection<Component> content) { super(name); for (Component l : content) { ! this.add(new ComponentNode(l)); } } *************** *** 1181,1185 **** this.removeAllChildren(); for (Component l : (Collection<Component>)o) { ! this.add(new CatalogNode(l)); } model.nodeStructureChanged(this); --- 1181,1185 ---- this.removeAllChildren(); for (Component l : (Collection<Component>)o) { ! this.add(new ComponentNode(l)); } model.nodeStructureChanged(this); *************** *** 1189,1201 **** /** ! * A container for catalog items */ ! public class CatalogNode extends GenericNode { /** * Constructor ! * @param l The lib obj */ ! public CatalogNode(Component l) { ! super(l); } --- 1189,1201 ---- /** ! * Component Node */ ! public class ComponentNode extends GenericNode { /** * Constructor ! * @param component Component */ ! public ComponentNode(Component component) { ! super(component); } Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** SpaceTreeView.java 12 Nov 2007 14:15:28 -0000 1.27 --- SpaceTreeView.java 19 Nov 2007 09:27:00 -0000 1.28 *************** *** 38,42 **** root.add(new ParameterBlockNode("Globals", p.getGlobals())); root.add(new ConstructorContainer("Constructors", p.getConstructors())); ! root.add(new CatalogContainer("Catalog", p.getCatalogObjects())); model.nodeStructureChanged(root); --- 38,42 ---- root.add(new ParameterBlockNode("Globals", p.getGlobals())); root.add(new ConstructorContainer("Constructors", p.getConstructors())); ! root.add(new ComponentContainer("Catalog", p.getCatalogObjects())); model.nodeStructureChanged(root); |
From: Michael L. <he...@us...> - 2007-11-19 09:20:38
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25825/src/net/sourceforge/bprocessor/model Modified Files: Project.java Persistence.java Added Files: Component.java Removed Files: LibraryObj.java Log Message: Renamed LibraryObj to Component --- LibraryObj.java DELETED --- Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Persistence.java 19 Nov 2007 08:43:43 -0000 1.59 --- Persistence.java 19 Nov 2007 09:20:41 -0000 1.60 *************** *** 158,162 **** for (Object o : document.getCatalogObjects()) { LibObjType lot = (LibObjType)o; ! LibraryObj lo = internalizeLibraryObj(lot, mapper, xmls); p.addCalalogObject(lo); } --- 158,162 ---- for (Object o : document.getCatalogObjects()) { LibObjType lot = (LibObjType)o; ! Component lo = internalizeLibraryObj(lot, mapper, xmls); p.addCalalogObject(lo); } *************** *** 798,802 **** { Collection libObjs = document.getCatalogObjects(); ! for (LibraryObj lo : Project.getInstance().getCatalogObjects()) { libObjs.add(externalizeLibObj(lo, mapper)); } --- 798,802 ---- { Collection libObjs = document.getCatalogObjects(); ! for (Component lo : Project.getInstance().getCatalogObjects()) { libObjs.add(externalizeLibObj(lo, mapper)); } *************** *** 1619,1626 **** * @throws Exception a exception */ ! public static Collection<LibraryObj> loadLibrary() throws Exception { Map<Integer, Object> map = new HashMap<Integer, Object>(); Collection<Object> xmls = new LinkedList<Object>(); ! Collection<LibraryObj> library = new LinkedList<LibraryObj>(); File libdir = new File("Library/"); if (!libdir.exists()) { --- 1619,1626 ---- * @throws Exception a exception */ ! public static Collection<Component> loadLibrary() throws Exception { Map<Integer, Object> map = new HashMap<Integer, Object>(); Collection<Object> xmls = new LinkedList<Object>(); ! Collection<Component> library = new LinkedList<Component>(); File libdir = new File("Library/"); if (!libdir.exists()) { *************** *** 1647,1653 **** } ! private static List<LibraryObj> internalizeLibObjs(File f, Map map, Collection xmls) throws Exception { ! List<LibraryObj> res = new LinkedList<LibraryObj>(); if (f.exists() && f.canRead()) { FileInputStream is = new FileInputStream(f); --- 1647,1653 ---- } ! private static List<Component> internalizeLibObjs(File f, Map map, Collection xmls) throws Exception { ! List<Component> res = new LinkedList<Component>(); if (f.exists() && f.canRead()) { FileInputStream is = new FileInputStream(f); *************** *** 1655,1659 **** for (Object lo : lib.getLibObj()) { LibObjType lot = (LibObjType)lo; ! LibraryObj libo = internalizeLibraryObj(lot, map, xmls); libo.setFile(f); res.add(libo); --- 1655,1659 ---- for (Object lo : lib.getLibObj()) { LibObjType lot = (LibObjType)lo; ! Component libo = internalizeLibraryObj(lot, map, xmls); libo.setFile(f); res.add(libo); *************** *** 1664,1669 **** } ! private static LibraryObj internalizeLibraryObj(LibObjType lot, Map map, Collection xmls) { ! LibraryObj lo = new LibraryObj(); lo.setAuthor(lot.getAuthor()); lo.setVersion(lot.getVersion()); --- 1664,1669 ---- } ! private static Component internalizeLibraryObj(LibObjType lot, Map map, Collection xmls) { ! Component lo = new Component(); lo.setAuthor(lot.getAuthor()); lo.setVersion(lot.getVersion()); *************** *** 1689,1697 **** } ! private static Library externalizeLibrary(Collection<LibraryObj> catalogObjects) { HashMap<Long, Object> map = new HashMap<Long, Object>(); Library lib = new LibraryImpl(); List libobjs = lib.getLibObj(); ! for (LibraryObj libo : catalogObjects) { libobjs.add(externalizeLibObj(libo, map)); } --- 1689,1697 ---- } ! private static Library externalizeLibrary(Collection<Component> catalogObjects) { HashMap<Long, Object> map = new HashMap<Long, Object>(); Library lib = new LibraryImpl(); List libobjs = lib.getLibObj(); ! for (Component libo : catalogObjects) { libobjs.add(externalizeLibObj(libo, map)); } *************** *** 1709,1713 **** } ! private static LibObjType externalizeLibObj(LibraryObj libo, HashMap<Long, Object> map) { LibObjType libobj = new LibObjTypeImpl(); libobj.setLocked(libo.isLocked()); --- 1709,1713 ---- } ! private static LibObjType externalizeLibObj(Component libo, HashMap<Long, Object> map) { LibObjType libobj = new LibObjTypeImpl(); libobj.setLocked(libo.isLocked()); --- NEW FILE: Component.java --- //--------------------------------------------------------------------------------- // $Id: Component.java,v 1.1 2007/11/19 09:20:41 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; import java.io.File; import java.util.LinkedList; import java.util.List; /** * A object pointing to a lib file */ public class Component implements Parametric { private File file; private Space space = null; private byte useableLevels = 0; private boolean isLocked = false; private String name; private String author; private String version; /** * The default constructor * @param usableLvls the levels where obj can be used incoded into a byte * @param f the file that represents this library object * @param s the space (union) this lib obj encapsulate */ public Component(byte usableLvls, File f, Space s) { file = f; useableLevels = usableLvls; space = s; name = s.getName(); } /** * Constructor for persistence */ public Component() { } /** * Get the file this lib obj represents * @return the file */ public File getFile() { return file; } /** * Set the file this lib obj points to * @param f The file */ void setFile(File f) { file = f; } /** * Return a byte with the usable levelnumber bit set * @return a byte with some set bits */ public byte getUseLevel() { return useableLevels; } /** * A getter for the space (union) this lib obj points to * @return The Space */ public Space getSpace() { return space; } /** * A setter for space in this lib obj * @param s the space */ void setSpace(Space s) { space = s; name = s.getName(); } /** * @return the isLocked */ public boolean isLocked() { return isLocked; } /** * @param isLocked the isLocked to set */ public void setLocked(boolean isLocked) { this.isLocked = isLocked; } /** * {@inheritDoc} */ public String getGeneralName() { return "Library Object"; } /** * {@inheritDoc} */ public List<Attribute> getAttributes() { List<Attribute> att = new LinkedList<Attribute>(); att.add(new Attribute("name", getName())); att.add(new Attribute("levels", new Selector<String>(getLevelStrings()))); att.add(new Attribute("geometry", getSpace())); att.add(new Attribute("Locked", isLocked())); String fileStr = "n/a"; if (getFile() != null) { fileStr = getFile().getAbsolutePath(); } att.add(new Attribute("File", fileStr)); att.add(new Attribute("Author", getAuthor())); att.add(new Attribute("Version", getVersion())); return att; } private List<String> getLevelStrings() { List<String> strings = new LinkedList<String>(); int lvl = Space.SPACE_LEVEL; for (int i = 0; i < Space.PART_LEVEL; i++) { if ((useableLevels & (1 >> i)) == (1 >> i)) { strings.add(Space.levelToString(lvl)); } lvl++; } return strings; } /** * {@inheritDoc} */ public void setAttributes(List<Attribute> attributes) { } /** * Getter for name * @return The name */ public String getName() { return name; } /** * @return the author */ public String getAuthor() { if (author == null) { author = "n/a"; } return author; } /** * @param author the author to set */ public void setAuthor(String author) { this.author = author; } /** * @return the version */ public String getVersion() { if (version == null) { version = "n/a"; } return version; } /** * @param version the version to set */ public void setVersion(String version) { this.version = version; } /** * @param name the name to set */ public void setName(String name) { this.name = name; } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** Project.java 12 Nov 2007 21:16:22 -0000 1.142 --- Project.java 19 Nov 2007 09:20:41 -0000 1.143 *************** *** 64,68 **** private static Collection<ClassificationType> classificationTypes; ! private static Collection<LibraryObj> library; /** The cameras */ --- 64,68 ---- private static Collection<ClassificationType> classificationTypes; ! private static Collection<Component> library; /** The cameras */ *************** *** 121,125 **** private long nextMaterialId; ! private List<LibraryObj> catalog; /** --- 121,125 ---- private long nextMaterialId; ! private List<Component> catalog; /** *************** *** 158,162 **** redoStack = new Stack(); copyBuffer = new LinkedList(); ! catalog = new LinkedList<LibraryObj>(); resetCam(); observers = new LinkedList(); --- 158,162 ---- redoStack = new Stack(); copyBuffer = new LinkedList(); ! catalog = new LinkedList<Component>(); resetCam(); observers = new LinkedList(); *************** *** 1046,1050 **** * @return the list of spaces */ ! public List<LibraryObj> getCatalogObjects() { return catalog; } --- 1046,1050 ---- * @return the list of spaces */ ! public List<Component> getCatalogObjects() { return catalog; } *************** *** 1054,1058 **** * @param lo the library object to add */ ! public void addCalalogObject(LibraryObj lo) { if (!catalog.contains(lo)) { catalog.add(lo); --- 1054,1058 ---- * @param lo the library object to add */ ! public void addCalalogObject(Component lo) { if (!catalog.contains(lo)) { catalog.add(lo); *************** *** 1065,1069 **** * @return the lib objs */ ! public static Collection<LibraryObj> getLibraryObjects() { return library; } --- 1065,1069 ---- * @return the lib objs */ ! public static Collection<Component> getLibraryObjects() { return library; } |
From: Michael L. <he...@us...> - 2007-11-19 09:14:22
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23479/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Renamed LibraryObj to Component Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** GenericTreeView.java 12 Nov 2007 19:21:01 -0000 1.121 --- GenericTreeView.java 19 Nov 2007 09:14:22 -0000 1.122 *************** *** 7,11 **** package net.sourceforge.bprocessor.gui.treeview; - import java.awt.Component; import java.awt.Dimension; import java.awt.Event; --- 7,10 ---- *************** *** 49,53 **** import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Geometric; ! import net.sourceforge.bprocessor.model.LibraryObj; import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Observer; --- 48,52 ---- import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Geometric; ! import net.sourceforge.bprocessor.model.Component; import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Observer; *************** *** 212,216 **** * @return Component */ ! public Component getTreeCellRendererComponent( JTree tree, Object value, --- 211,215 ---- * @return Component */ ! public java.awt.Component getTreeCellRendererComponent( JTree tree, Object value, *************** *** 1159,1163 **** /** ! * CameraNode */ public class CatalogContainer extends GenericNode { --- 1158,1162 ---- /** ! * Catalog Container */ public class CatalogContainer extends GenericNode { *************** *** 1167,1173 **** * @param content the children for the node */ ! public CatalogContainer(String name, Collection<LibraryObj> content) { super(name); ! for (LibraryObj l : content) { this.add(new CatalogNode(l)); } --- 1166,1172 ---- * @param content the children for the node */ ! public CatalogContainer(String name, Collection<Component> content) { super(name); ! for (Component l : content) { this.add(new CatalogNode(l)); } *************** *** 1181,1185 **** if (o instanceof Collection) { this.removeAllChildren(); ! for (LibraryObj l : (Collection<LibraryObj>)o) { this.add(new CatalogNode(l)); } --- 1180,1184 ---- if (o instanceof Collection) { this.removeAllChildren(); ! for (Component l : (Collection<Component>)o) { this.add(new CatalogNode(l)); } *************** *** 1191,1195 **** /** * A container for catalog items - * @author rimestad */ public class CatalogNode extends GenericNode { --- 1190,1193 ---- *************** *** 1198,1204 **** * @param l The lib obj */ ! public CatalogNode(LibraryObj l) { super(l); - Space s = l.getSpace(); } --- 1196,1201 ---- * @param l The lib obj */ ! public CatalogNode(Component l) { super(l); } *************** *** 1206,1210 **** @Override public String toString() { ! return ((LibraryObj)getUserObject()).getName(); } --- 1203,1207 ---- @Override public String toString() { ! return ((Component)getUserObject()).getName(); } *************** *** 1212,1217 **** @Override public void update(Object o) { ! if (o instanceof LibraryObj) { ! LibraryObj lo = (LibraryObj)o; if (lo != userObject) { userObject = lo; --- 1209,1214 ---- @Override public void update(Object o) { ! if (o instanceof Component) { ! Component lo = (Component)o; if (lo != userObject) { userObject = lo; *************** *** 1225,1236 **** public JPopupMenu menu() { JPopupMenu menu = new JPopupMenu(); ! Collection<LibraryObj> spaces = new LinkedList<LibraryObj>(); ! spaces.add((LibraryObj)getUserObject()); ! menu.add(new CollectionMenuAction(spaces, "Instanciate") { public void actionPerformed(ActionEvent e) { Project proj = Project.getInstance(); Space world = proj.getActiveSpace(); for (Object o : col) { ! LibraryObj lo = (LibraryObj)o; Space space = lo.getSpace(); Space instance = new Space(space.getName() + " instance ", space.getType(), false); --- 1222,1233 ---- public JPopupMenu menu() { JPopupMenu menu = new JPopupMenu(); ! Collection<Component> spaces = new LinkedList<Component>(); ! spaces.add((Component)getUserObject()); ! menu.add(new CollectionMenuAction(spaces, "Make Instance") { public void actionPerformed(ActionEvent e) { Project proj = Project.getInstance(); Space world = proj.getActiveSpace(); for (Object o : col) { ! Component lo = (Component)o; Space space = lo.getSpace(); Space instance = new Space(space.getName() + " instance ", space.getType(), false); |
From: Michael L. <he...@us...> - 2007-11-19 09:14:22
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23479/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileImportActionListener.java Log Message: Renamed LibraryObj to Component Index: FileImportActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileImportActionListener.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FileImportActionListener.java 12 Nov 2007 19:18:07 -0000 1.15 --- FileImportActionListener.java 19 Nov 2007 09:14:22 -0000 1.16 *************** *** 26,30 **** import net.sourceforge.bprocessor.gui.GUI; ! import net.sourceforge.bprocessor.model.LibraryObj; import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; --- 26,30 ---- import net.sourceforge.bprocessor.gui.GUI; ! import net.sourceforge.bprocessor.model.Component; import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; *************** *** 111,115 **** Space s = new Space(lfile.getName(), Space.CONSTRUCTION, true); s.setUnion(true); ! LibraryObj lo = new LibraryObj(Byte.MAX_VALUE, lfile, s); Project.getLibraryObjects().add(lo); ImportFileReader.importObjFile(lfile, s, info.objPanel.getScale(), --- 111,115 ---- Space s = new Space(lfile.getName(), Space.CONSTRUCTION, true); s.setUnion(true); ! Component lo = new Component(Byte.MAX_VALUE, lfile, s); Project.getLibraryObjects().add(lo); ImportFileReader.importObjFile(lfile, s, info.objPanel.getScale(), |
From: rimestad <rim...@us...> - 2007-11-19 08:43:46
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11577/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: some fixes to lib readin Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Persistence.java 13 Nov 2007 08:47:09 -0000 1.58 --- Persistence.java 19 Nov 2007 08:43:43 -0000 1.59 *************** *** 1623,1627 **** Collection<Object> xmls = new LinkedList<Object>(); Collection<LibraryObj> library = new LinkedList<LibraryObj>(); ! File libdir = new File("Library"); if (libdir.isDirectory()) { File[] libs = libdir.listFiles(); --- 1623,1630 ---- Collection<Object> xmls = new LinkedList<Object>(); Collection<LibraryObj> library = new LinkedList<LibraryObj>(); ! File libdir = new File("Library/"); ! if (!libdir.exists()) { ! libdir.createNewFile(); ! } if (libdir.isDirectory()) { File[] libs = libdir.listFiles(); *************** *** 1633,1636 **** --- 1636,1647 ---- } } + { + Iterator iter = xmls.iterator(); + while (iter.hasNext()) { + EntityType external = (EntityType) iter.next(); + Object object = map.get(new Long(external.getId())); + internalizeReferences(object, external, map); + } + } return library; } *************** *** 1668,1672 **** */ public static void saveLibrary() throws Exception { ! FileOutputStream fos = new FileOutputStream(new File("library\\lib.bpl")); Library lib = externalizeLibrary(Project.getLibraryObjects()); --- 1679,1684 ---- */ public static void saveLibrary() throws Exception { ! File fout = new File("library/lib.bpl"); ! FileOutputStream fos = new FileOutputStream(fout); Library lib = externalizeLibrary(Project.getLibraryObjects()); *************** *** 1684,1687 **** --- 1696,1709 ---- libobjs.add(externalizeLibObj(libo, map)); } + { + Set entries = map.entrySet(); + Iterator iter = entries.iterator(); + while (iter.hasNext()) { + Entry current = (Entry) iter.next(); + Object object = current.getKey(); + EntityType external = (EntityType) current.getValue(); + externalizeReferences(object, external, map); + } + } return lib; } |
From: Michael L. <he...@us...> - 2007-11-18 21:30:41
|
Update of /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16086/src/net/sourceforge/bprocessor Modified Files: Application.java Log Message: Renamed GLView to Editor Index: Application.java =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor/Application.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Application.java 18 Nov 2007 20:33:08 -0000 1.5 --- Application.java 18 Nov 2007 21:30:41 -0000 1.6 *************** *** 21,25 **** } GUI gui = new GUI(); ! Editor gl = new Editor(); FacadeMain fm = new FacadeMain(); } --- 21,25 ---- } GUI gui = new GUI(); ! Editor editor = new Editor(); FacadeMain fm = new FacadeMain(); } |
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16012/src/net/sourceforge/bprocessor/gl/tool Modified Files: ZoomTool.java FocusTool.java RelationTool.java ExtrusionTool.java ConstructorTool.java AbstractPencil.java OrbitStrategy.java PanTool.java CameraFlyTool.java ToolFactory.java SelectStrategy.java RotationTool.java RectTool.java EraserTool.java Pencil.java SelectTool.java CameraWalkTool.java ControlledMoveTool.java PanStrategy.java MoveTool.java OffsetTool.java SpaceTool.java EdgeMoveTool.java ClipplaneTool.java FinalMoveTool.java TapeMeasure.java CameraTool.java ControlledExtrudeTool.java AbstractTool.java Protractor.java ArcTool.java AltMoveTool.java Log Message: Renamed GLView to Editor Index: PanTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PanTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PanTool.java 18 Nov 2007 20:32:47 -0000 1.2 --- PanTool.java 18 Nov 2007 21:30:17 -0000 1.3 *************** *** 22,30 **** /** * The constructor ! * @param glv The 3D canvas * @param cursor The cursor */ ! public PanTool(Editor glv, Cursor cursor) { ! super(glv, cursor); dragDelay = 0; } --- 22,30 ---- /** * The constructor ! * @param editor The 3D canvas * @param cursor The cursor */ ! public PanTool(Editor editor, Cursor cursor) { ! super(editor, cursor); dragDelay = 0; } Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** OffsetTool.java 18 Nov 2007 20:32:47 -0000 1.24 --- OffsetTool.java 18 Nov 2007 21:30:17 -0000 1.25 *************** *** 72,80 **** /** * Constructor fo OffsetTool ! * @param glv The GLView * @param cursor The Cursor */ ! public OffsetTool(Editor glv, Cursor cursor) { ! super(glv, cursor); guide = new Edge(new Vertex(0, 0, 0), new Vertex(0, 0, 0)); guide.setStrippled(true); --- 72,80 ---- /** * Constructor fo OffsetTool ! * @param editor The GLView * @param cursor The Cursor */ ! public OffsetTool(Editor editor, Cursor cursor) { ! super(editor, cursor); guide = new Edge(new Vertex(0, 0, 0), new Vertex(0, 0, 0)); guide.setStrippled(true); *************** *** 110,114 **** } if (edge != null) { ! glv.setCursor(this.getCursor()); edgePoint = edge.intersection(current.vertex()); Vertex dir = edge.getDirection(); --- 110,114 ---- } if (edge != null) { ! editor.setCursor(this.getCursor()); edgePoint = edge.intersection(current.vertex()); Vertex dir = edge.getDirection(); *************** *** 152,156 **** } else { setTip(errorString()); ! glv.setCursor(ToolFactory.errorCursor); current = null; } --- 152,156 ---- } else { setTip(errorString()); ! editor.setCursor(ToolFactory.errorCursor); current = null; } Index: ClipplaneTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ClipplaneTool.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ClipplaneTool.java 18 Nov 2007 20:32:47 -0000 1.14 --- ClipplaneTool.java 18 Nov 2007 21:30:17 -0000 1.15 *************** *** 36,44 **** /** * The Constructor ! * @param glv The 3D canvas * @param cursor The cursor */ ! public ClipplaneTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 36,44 ---- /** * The Constructor ! * @param editor The 3D canvas * @param cursor The cursor */ ! public ClipplaneTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 57,61 **** Vertex j = system.getJ(); Vertex o = system.getOrigin().copy(); ! boolean front = glv.getView().facingFront(system); if (front) { n.scaleInPlace(-1); --- 57,61 ---- Vertex j = system.getJ(); Vertex o = system.getOrigin().copy(); ! boolean front = editor.getView().facingFront(system); if (front) { n.scaleInPlace(-1); *************** *** 65,74 **** cp = new ClippingPlane(system); if (Project.getInstance().getCurrentCamera().getClipplanes().size() < ! glv.getView().getMaxClipPlanes()) { Project.getInstance().getCurrentCamera().addClipplane(cp); Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } ! View view = glv.getView(); previous = view.toPlaneCoords(e.getX(), e.getY(), cp.getPlane()); Transformation trans = view.transformation(); --- 65,74 ---- cp = new ClippingPlane(system); if (Project.getInstance().getCurrentCamera().getClipplanes().size() < ! editor.getView().getMaxClipPlanes()) { Project.getInstance().getCurrentCamera().addClipplane(cp); Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } ! View view = editor.getView(); previous = view.toPlaneCoords(e.getX(), e.getY(), cp.getPlane()); Transformation trans = view.transformation(); *************** *** 90,96 **** findTarget(e); if (target instanceof Surface) { ! glv.getView().makeTarget(target); } else { ! glv.getView().makeTarget(null); } } --- 90,96 ---- findTarget(e); if (target instanceof Surface) { ! editor.getView().makeTarget(target); } else { ! editor.getView().makeTarget(null); } } *************** *** 101,105 **** protected void dragged(MouseEvent e) { if (cp != null) { ! Vertex to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Vertex delta = to.minus(previous); cp.move(delta.getX(), delta.getY(), delta.getZ()); --- 101,105 ---- protected void dragged(MouseEvent e) { if (cp != null) { ! Vertex to = editor.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Vertex delta = to.minus(previous); cp.move(delta.getX(), delta.getY(), delta.getZ()); Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** ToolFactory.java 18 Nov 2007 20:32:47 -0000 1.91 --- ToolFactory.java 18 Nov 2007 21:30:17 -0000 1.92 *************** *** 42,46 **** /** glv */ ! private Editor glv; /** tools */ --- 42,46 ---- /** glv */ ! private Editor editor; /** tools */ *************** *** 136,146 **** /** * Constructor ! * @param glv the GLView */ ! private ToolFactory(Editor glv) { tools = new HashMap(); buttons = new HashMap(); group = new ButtonGroup(); ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 136,146 ---- /** * Constructor ! * @param editor the GLView */ ! private ToolFactory(Editor editor) { tools = new HashMap(); buttons = new HashMap(); group = new ButtonGroup(); ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); *************** *** 179,201 **** Cursor zoomCursor = Toolkit.getDefaultToolkit().createCustomCursor(zoomImage, new Point(7, 8), "Zoom"); ! select = new SpaceTool(glv, null); ! pencil = new Pencil(glv, pencilcursor); ! eraser = new EraserTool(glv, pencilcursor); ! arc = new ArcTool(glv, pencilcursor); ! rotation = new RotationTool(glv, null); ! extrude = new ExtrusionTool(glv, pencilcursor); ! multiExtrude = new ControlledExtrudeTool(glv, pencilcursor); ! clipplane = new ClipplaneTool(glv, pencilcursor); ! tapeMeasure = new TapeMeasure(glv, pencilcursor); ! protractor = new Protractor(glv, pencilcursor); ! relation = new RelationTool(glv, arrowAddCursor); ! camera = new CameraTool(glv, rotationCursor); ! constructor = new ConstructorTool(glv, pencilcursor); ! offset = new OffsetTool(glv, pencilcursor); ! altRect = new RectTool(glv, pencilcursor); ! focusTool = new FocusTool(glv, null); ! finalMoveTool = new FinalMoveTool(glv, pencilcursor); ! panTool = new PanTool(glv, panCursor); ! zoomTool = new ZoomTool(glv, zoomCursor); Toolbar tb = Toolbar.getInstance(); --- 179,201 ---- Cursor zoomCursor = Toolkit.getDefaultToolkit().createCustomCursor(zoomImage, new Point(7, 8), "Zoom"); ! select = new SpaceTool(editor, null); ! pencil = new Pencil(editor, pencilcursor); ! eraser = new EraserTool(editor, pencilcursor); ! arc = new ArcTool(editor, pencilcursor); ! rotation = new RotationTool(editor, null); ! extrude = new ExtrusionTool(editor, pencilcursor); ! multiExtrude = new ControlledExtrudeTool(editor, pencilcursor); ! clipplane = new ClipplaneTool(editor, pencilcursor); ! tapeMeasure = new TapeMeasure(editor, pencilcursor); ! protractor = new Protractor(editor, pencilcursor); ! relation = new RelationTool(editor, arrowAddCursor); ! camera = new CameraTool(editor, rotationCursor); ! constructor = new ConstructorTool(editor, pencilcursor); ! offset = new OffsetTool(editor, pencilcursor); ! altRect = new RectTool(editor, pencilcursor); ! focusTool = new FocusTool(editor, null); ! finalMoveTool = new FinalMoveTool(editor, pencilcursor); ! panTool = new PanTool(editor, panCursor); ! zoomTool = new ZoomTool(editor, zoomCursor); Toolbar tb = Toolbar.getInstance(); *************** *** 251,255 **** tb.addSeparator(10); ! Action orthoAction = new ToolAction(glv, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); --- 251,255 ---- tb.addSeparator(10); ! Action orthoAction = new ToolAction(editor, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); *************** *** 258,290 **** int fac = (int)cam.calcFactor(); Project.getInstance().getCurrentCamera().setFactor(fac); ! glv.setFactor(fac); ! glv.enableFactor(); ! glv.repaint(); } } }; ! Action perspAction = new ToolAction(glv, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); if (cam.getType() != Camera.PERSPECTIVE) { cam.setType(Camera.PERSPECTIVE); ! glv.disableFactor(); cam.invertFactor(); ! glv.repaint(); } } }; ! Action topAction = new ToolAction(glv, 0, "xyicon.png") { public void actionPerformed(ActionEvent arg0) { Camera.makeTop(Project.getInstance().getCurrentCamera()); ! glv.repaint(); } }; Toolbar.getInstance().registerPushButtonAction(topAction, "See from above"); ! Action zoomAction = new ToolAction(glv, 0, "Biconzomeall.gif") { public void actionPerformed(ActionEvent agr0) { ! double aspect = glv.getView().getAspect(); if (Selection.primary().isEmpty()) { List list = new LinkedList(); --- 258,290 ---- int fac = (int)cam.calcFactor(); Project.getInstance().getCurrentCamera().setFactor(fac); ! editor.setFactor(fac); ! editor.enableFactor(); ! editor.repaint(); } } }; ! Action perspAction = new ToolAction(editor, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); if (cam.getType() != Camera.PERSPECTIVE) { cam.setType(Camera.PERSPECTIVE); ! editor.disableFactor(); cam.invertFactor(); ! editor.repaint(); } } }; ! Action topAction = new ToolAction(editor, 0, "xyicon.png") { public void actionPerformed(ActionEvent arg0) { Camera.makeTop(Project.getInstance().getCurrentCamera()); ! editor.repaint(); } }; Toolbar.getInstance().registerPushButtonAction(topAction, "See from above"); ! Action zoomAction = new ToolAction(editor, 0, "Biconzomeall.gif") { public void actionPerformed(ActionEvent agr0) { ! double aspect = editor.getView().getAspect(); if (Selection.primary().isEmpty()) { List list = new LinkedList(); *************** *** 294,298 **** Project.getInstance().getCurrentCamera().zoomOn(Selection.primary(), aspect); } ! this.glv.repaint(); } }; --- 294,298 ---- Project.getInstance().getCurrentCamera().zoomOn(Selection.primary(), aspect); } ! this.editor.repaint(); } }; *************** *** 315,324 **** /** * Get the factory ! * @param glv The GLView * @return The factory */ ! public static synchronized ToolFactory getFactory(Editor glv) { if (factory == null) { ! factory = new ToolFactory(glv); } return factory; --- 315,324 ---- /** * Get the factory ! * @param editor The GLView * @return The factory */ ! public static synchronized ToolFactory getFactory(Editor editor) { if (factory == null) { ! factory = new ToolFactory(editor); } return factory; *************** *** 358,362 **** public JToggleButton registerTool(int key, Tool tool, String iconname, String tooltip) { tools.put(new Integer(key), tool); ! ToolAction action = new ToolAction(glv, key, iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); button.setToolTipText(tooltip); --- 358,362 ---- public JToggleButton registerTool(int key, Tool tool, String iconname, String tooltip) { tools.put(new Integer(key), tool); ! ToolAction action = new ToolAction(editor, key, iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); button.setToolTipText(tooltip); *************** *** 401,405 **** /** glv */ ! protected Editor glv; /** key */ --- 401,405 ---- /** glv */ ! protected Editor editor; /** key */ *************** *** 408,417 **** /** * Constructor ! * @param glv GLView * @param key Key * @param iconname Iconname */ ! public ToolAction(Editor glv, int key, String iconname) { ! this.glv = glv; this.key = key; ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 408,417 ---- /** * Constructor ! * @param editor GLView * @param key Key * @param iconname Iconname */ ! public ToolAction(Editor editor, int key, String iconname) { ! this.editor = editor; this.key = key; ClassLoader cl = Thread.currentThread().getContextClassLoader(); *************** *** 425,429 **** */ public void actionPerformed(ActionEvent event) { ! glv.changeTool(key); } } --- 425,429 ---- */ public void actionPerformed(ActionEvent event) { ! editor.changeTool(key); } } Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** SelectTool.java 18 Nov 2007 20:32:47 -0000 1.67 --- SelectTool.java 18 Nov 2007 21:30:17 -0000 1.68 *************** *** 11,15 **** import java.awt.Cursor; import java.awt.event.MouseEvent; - import org.apache.log4j.Logger; /** --- 11,14 ---- *************** *** 17,30 **** */ public class SelectTool extends AbstractTool { - /** The logger */ - private static Logger log = Logger.getLogger(SelectTool.class); - /** * The constructor ! * @param glv The 3D canvas * @param cursor The cursor */ ! public SelectTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 16,26 ---- */ public class SelectTool extends AbstractTool { /** * The constructor ! * @param editor The 3D canvas * @param cursor The cursor */ ! public SelectTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** ExtrusionTool.java 18 Nov 2007 20:32:47 -0000 1.71 --- ExtrusionTool.java 18 Nov 2007 21:30:17 -0000 1.72 *************** *** 76,84 **** /** * Constructor ! * @param glv GLVIew * @param cursor Cursor */ ! public ExtrusionTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 76,84 ---- /** * Constructor ! * @param editor GLVIew * @param cursor Cursor */ ! public ExtrusionTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 167,172 **** protected void moved(MouseEvent e) { if (extrudesurface != null) { ! glv.getView().removeTempVertex(to); ! to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Vertex normal = extrudesurface.normal(); ontoPlane = null; --- 167,172 ---- protected void moved(MouseEvent e) { if (extrudesurface != null) { ! editor.getView().removeTempVertex(to); ! to = editor.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Vertex normal = extrudesurface.normal(); ontoPlane = null; *************** *** 190,194 **** Vertex cross = normal.cross(n); if (cross.isZero()) { ! to = glv.getView().toPlaneCoords(e.getX(), e.getY(), surface.plane()); current = new Intersection(to, Intersection.SURFACE, surface); calcDistCallExtrude(to, from, normal); --- 190,194 ---- Vertex cross = normal.cross(n); if (cross.isZero()) { ! to = editor.getView().toPlaneCoords(e.getX(), e.getY(), surface.plane()); current = new Intersection(to, Intersection.SURFACE, surface); calcDistCallExtrude(to, from, normal); *************** *** 199,203 **** calcDistCallExtrude(to, from, normal); } else { ! to = glv.getView().toPlaneCoords(e.getX(), e.getY(), ontoPlane); current = new Intersection(to, Intersection.PLANE_INTERSECTION, ontoPlane); extrudeOnto(ontoPlane, all, false); --- 199,203 ---- calcDistCallExtrude(to, from, normal); } else { ! to = editor.getView().toPlaneCoords(e.getX(), e.getY(), ontoPlane); current = new Intersection(to, Intersection.PLANE_INTERSECTION, ontoPlane); extrudeOnto(ontoPlane, all, false); *************** *** 240,248 **** } float[] color = targetColor(current); ! glv.getView().addTempVertex(to); ! glv.getView().changeColor(to, color); } } else if (extrudeEdges != null) { ! to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Set<Geometric> elements = new HashSet<Geometric>(extrudeEdges); if (extrusion != null) { --- 240,248 ---- } float[] color = targetColor(current); ! editor.getView().addTempVertex(to); ! editor.getView().changeColor(to, color); } } else if (extrudeEdges != null) { ! to = editor.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Set<Geometric> elements = new HashSet<Geometric>(extrudeEdges); if (extrusion != null) { *************** *** 288,294 **** findTarget(e); if (target instanceof Surface) { ! glv.getView().makeTarget(target); } else if (target == null) { ! glv.getView().makeTarget(null); } active = true; --- 288,294 ---- findTarget(e); if (target instanceof Surface) { ! editor.getView().makeTarget(target); } else if (target == null) { ! editor.getView().makeTarget(null); } active = true; *************** *** 363,367 **** startx = e.getX(); starty = e.getY(); ! View view = glv.getView(); Transformation trans = view.transformation(); double x = startx; --- 363,367 ---- startx = e.getX(); starty = e.getY(); ! View view = editor.getView(); Transformation trans = view.transformation(); double x = startx; *************** *** 381,385 **** startx = e.getX(); starty = e.getY(); ! View view = glv.getView(); Transformation trans = view.transformation(); double x = startx; --- 381,385 ---- startx = e.getX(); starty = e.getY(); ! View view = editor.getView(); Transformation trans = view.transformation(); double x = startx; *************** *** 484,488 **** */ public void cleanUp() { ! glv.getView().removeTempVertex(to); all = false; dragplane = null; --- 484,488 ---- */ public void cleanUp() { ! editor.getView().removeTempVertex(to); all = false; dragplane = null; Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** AbstractPencil.java 18 Nov 2007 20:32:47 -0000 1.99 --- AbstractPencil.java 18 Nov 2007 21:30:17 -0000 1.100 *************** *** 134,142 **** /** * Constructor ! * @param glv GLView * @param cursor Cursor */ ! public AbstractPencil(Editor glv, Cursor cursor) { ! super(glv, cursor); timer = new Timer(500, new TargetAction()); timer.setRepeats(false); --- 134,142 ---- /** * Constructor ! * @param editor GLView * @param cursor Cursor */ ! public AbstractPencil(Editor editor, Cursor cursor) { ! super(editor, cursor); timer = new Timer(500, new TargetAction()); timer.setRepeats(false); *************** *** 173,177 **** Intersection intersection = null; ! Transformation transformation = glv.getView().transformation(); double x = e.getX(); double y = View.getHeight() - e.getY(); --- 173,177 ---- Intersection intersection = null; ! Transformation transformation = editor.getView().transformation(); double x = e.getX(); double y = View.getHeight() - e.getY(); *************** *** 233,237 **** intersection = ! (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), unwanted, View.INTERSECTIONS, work); --- 233,237 ---- intersection = ! (Intersection) editor.getView().getObjectAtPoint(e.getX(), e.getY(), unwanted, View.INTERSECTIONS, work); *************** *** 284,290 **** Object o = iter.next(); if (o instanceof Edge) { ! glv.getView().addTempEdge((Edge) o); } else if (o instanceof Constructor) { ! glv.getView().addTempConstructor((Constructor) o); } } --- 284,290 ---- Object o = iter.next(); if (o instanceof Edge) { ! editor.getView().addTempEdge((Edge) o); } else if (o instanceof Constructor) { ! editor.getView().addTempConstructor((Constructor) o); } } *************** *** 299,305 **** Object o = iter.next(); if (o instanceof Edge) { ! glv.getView().removeTempEdge((Edge) o); } else if (o instanceof Constructor) { ! glv.getView().removeTempConstructor((Constructor) o); } } --- 299,305 ---- Object o = iter.next(); if (o instanceof Edge) { ! editor.getView().removeTempEdge((Edge) o); } else if (o instanceof Constructor) { ! editor.getView().removeTempConstructor((Constructor) o); } } *************** *** 325,331 **** Object o = iter.next(); if (o instanceof Edge) { ! glv.getView().addTempEdge((Edge) o); } else if (o instanceof Constructor) { ! glv.getView().addTempConstructor((Constructor) o); } } --- 325,331 ---- Object o = iter.next(); if (o instanceof Edge) { ! editor.getView().addTempEdge((Edge) o); } else if (o instanceof Constructor) { ! editor.getView().addTempConstructor((Constructor) o); } } *************** *** 340,346 **** Object o = iter.next(); if (o instanceof Edge) { ! glv.getView().removeTempEdge((Edge) o); } else if (o instanceof Constructor) { ! glv.getView().removeTempConstructor((Constructor) o); } } --- 340,346 ---- Object o = iter.next(); if (o instanceof Edge) { ! editor.getView().removeTempEdge((Edge) o); } else if (o instanceof Constructor) { ! editor.getView().removeTempConstructor((Constructor) o); } } *************** *** 365,369 **** while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); ! glv.getView().addTempVertex(current); } } --- 365,369 ---- while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); ! editor.getView().addTempVertex(current); } } *************** *** 376,380 **** while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); ! glv.getView().removeTempVertex(current); } } --- 376,380 ---- while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); ! editor.getView().removeTempVertex(current); } } *************** *** 609,613 **** } updateConstructors(); ! glv.repaint(); } --- 609,613 ---- } updateConstructors(); ! editor.repaint(); } *************** *** 623,637 **** Vertex targetVertex = intersection.vertex(); float[] targetColor = targetColor(intersection); ! glv.getView().removeTempVertex(lockSnapVertex); ! glv.getView().clearColor(lockSnapVertex); ! glv.getView().removeTempEdge(lockEdgeExtention); ! glv.getView().removeTempEdge(lockHighlightEdge); ! glv.getView().clearStyle(lockHighlightEdge); if (intersection.type() == Intersection.LOCK_INTERSECTION) { actual = (Intersection)actual.object(); lockSnapVertex = actual.vertex().copy(); targetColor = targetColor(actual); ! glv.getView().addTempVertex(lockSnapVertex); ! glv.getView().changeColor(lockSnapVertex, targetColor); if (lockingEdge != null) { EdgeAttributes ea = new EdgeAttributes(); --- 623,637 ---- Vertex targetVertex = intersection.vertex(); float[] targetColor = targetColor(intersection); ! editor.getView().removeTempVertex(lockSnapVertex); ! editor.getView().clearColor(lockSnapVertex); ! editor.getView().removeTempEdge(lockEdgeExtention); ! editor.getView().removeTempEdge(lockHighlightEdge); ! editor.getView().clearStyle(lockHighlightEdge); if (intersection.type() == Intersection.LOCK_INTERSECTION) { actual = (Intersection)actual.object(); lockSnapVertex = actual.vertex().copy(); targetColor = targetColor(actual); ! editor.getView().addTempVertex(lockSnapVertex); ! editor.getView().changeColor(lockSnapVertex, targetColor); if (lockingEdge != null) { EdgeAttributes ea = new EdgeAttributes(); *************** *** 641,646 **** if (FALSE) { ! glv.getView().addTempEdge(lockHighlightEdge); ! glv.getView().changeEdgeStyle(lockHighlightEdge, ea); } --- 641,646 ---- if (FALSE) { ! editor.getView().addTempEdge(lockHighlightEdge); ! editor.getView().changeEdgeStyle(lockHighlightEdge, ea); } *************** *** 655,659 **** } lockEdgeExtention.setStrippled(true); ! glv.getView().addTempEdge(lockEdgeExtention); } } --- 655,659 ---- } lockEdgeExtention.setStrippled(true); ! editor.getView().addTempEdge(lockEdgeExtention); } } *************** *** 661,668 **** if (actual.type() == Intersection.PLANE_INTERSECTION) { target = null; ! glv.getView().removeTempVertex(lockSnapVertex); ! glv.getView().clearColor(lockSnapVertex); } ! glv.getView().makeTarget(target, targetColor); } } --- 661,668 ---- if (actual.type() == Intersection.PLANE_INTERSECTION) { target = null; ! editor.getView().removeTempVertex(lockSnapVertex); ! editor.getView().clearColor(lockSnapVertex); } ! editor.getView().makeTarget(target, targetColor); } } *************** *** 795,800 **** lockingEdge = null; lockingPlane = null; ! glv.getView().removeTempVertex(lockSnapVertex); ! glv.getView().clearColor(lockSnapVertex); lockSnapVertex = null; constructors(new LinkedList()); --- 795,800 ---- lockingEdge = null; lockingPlane = null; ! editor.getView().removeTempVertex(lockSnapVertex); ! editor.getView().clearColor(lockSnapVertex); lockSnapVertex = null; constructors(new LinkedList()); *************** *** 807,811 **** dragging = false; setTip(initialTip()); ! glv.repaint(); super.cleanUp(); } --- 807,811 ---- dragging = false; setTip(initialTip()); ! editor.repaint(); super.cleanUp(); } Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** EraserTool.java 18 Nov 2007 20:32:47 -0000 1.11 --- EraserTool.java 18 Nov 2007 21:30:17 -0000 1.12 *************** *** 27,35 **** /** * Constructor fo EraserTool ! * @param glv The GLView * @param cursor The Cursor */ ! public EraserTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 27,35 ---- /** * Constructor fo EraserTool ! * @param editor The GLView * @param cursor The Cursor */ ! public EraserTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 41,47 **** findTarget(e); if (relevant(target)) { ! glv.getView().makeTarget(target); } else { ! glv.getView().makeTarget(null); } } --- 41,47 ---- findTarget(e); if (relevant(target)) { ! editor.getView().makeTarget(target); } else { ! editor.getView().makeTarget(null); } } *************** *** 64,68 **** Project.getInstance().changed(target); target = null; ! glv.getView().makeTarget(null); Project.getInstance().checkpoint(); } --- 64,68 ---- Project.getInstance().changed(target); target = null; ! editor.getView().makeTarget(null); Project.getInstance().checkpoint(); } Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** MoveTool.java 18 Nov 2007 20:32:47 -0000 1.75 --- MoveTool.java 18 Nov 2007 21:30:17 -0000 1.76 *************** *** 53,61 **** /** * Constructor for MoveTool ! * @param glv The GLView * @param cursor The Cursor */ ! public MoveTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 53,61 ---- /** * Constructor for MoveTool ! * @param editor The GLView * @param cursor The Cursor */ ! public MoveTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 125,129 **** if (Selection.primary().isEmpty()) { findTarget(e, View.HANDLES); ! glv.getView().makeTarget(target); } else { current = findIntersection(e); --- 125,129 ---- if (Selection.primary().isEmpty()) { findTarget(e, View.HANDLES); ! editor.getView().makeTarget(target); } else { current = findIntersection(e); Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** RotationTool.java 18 Nov 2007 20:32:47 -0000 1.31 --- RotationTool.java 18 Nov 2007 21:30:17 -0000 1.32 *************** *** 65,73 **** /** * The Constructor ! * @param glv The 3D canvas * @param cursor The cursor */ ! public RotationTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 65,73 ---- /** * The Constructor ! * @param editor The 3D canvas * @param cursor The cursor */ ! public RotationTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 118,122 **** if (p1 != null && p2 != null && from != null && current != null) { angle = Math.toDegrees(totalAngle); ! glv.setLengthValue(MessageFormat.format("{0,number,###.##}", new Object[]{new Double(Math.round(angle * 100.0) / 100.0)})); } --- 118,122 ---- if (p1 != null && p2 != null && from != null && current != null) { angle = Math.toDegrees(totalAngle); ! editor.setLengthValue(MessageFormat.format("{0,number,###.##}", new Object[]{new Double(Math.round(angle * 100.0) / 100.0)})); } *************** *** 185,189 **** log.info("Disk were: " + onto); pro = new GlProtractor(onto, p1); ! glv.getView().addGlObjects3D(pro); setTip(thirdClickTip()); } --- 185,189 ---- log.info("Disk were: " + onto); pro = new GlProtractor(onto, p1); ! editor.getView().addGlObjects3D(pro); setTip(thirdClickTip()); } *************** *** 277,281 **** from = null; onto = null; ! glv.getView().removeGlObjects3D(pro); pro = null; previous = null; --- 277,281 ---- from = null; onto = null; ! editor.getView().removeGlObjects3D(pro); pro = null; previous = null; Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ArcTool.java 18 Nov 2007 20:32:47 -0000 1.21 --- ArcTool.java 18 Nov 2007 21:30:17 -0000 1.22 *************** *** 167,175 **** /** * Constructor ! * @param glv GLView * @param cursor Cursor */ ! public ArcTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 167,175 ---- /** * Constructor ! * @param editor GLView * @param cursor Cursor */ ! public ArcTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } Index: ControlledMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledMoveTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ControlledMoveTool.java 18 Nov 2007 20:32:47 -0000 1.11 --- ControlledMoveTool.java 18 Nov 2007 21:30:17 -0000 1.12 *************** *** 44,52 **** /** * ControlledMoveTool ! * @param glv GLView * @param cursor Cursor */ ! public ControlledMoveTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 44,52 ---- /** * ControlledMoveTool ! * @param editor GLView * @param cursor Cursor */ ! public ControlledMoveTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 213,217 **** double startx = e.getX(); double starty = e.getY(); ! View view = glv.getView(); Transformation trans = view.transformation(); double x = startx; --- 213,217 ---- double startx = e.getX(); double starty = e.getY(); ! View view = editor.getView(); Transformation trans = view.transformation(); double x = startx; Index: TapeMeasure.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasure.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TapeMeasure.java 18 Nov 2007 20:32:47 -0000 1.6 --- TapeMeasure.java 18 Nov 2007 21:30:17 -0000 1.7 *************** *** 37,45 **** /** * Constructor ! * @param glv GLView * @param cursor Cursor */ ! public TapeMeasure(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 37,45 ---- /** * Constructor ! * @param editor GLView * @param cursor Cursor */ ! public TapeMeasure(Editor editor, Cursor cursor) { ! super(editor, cursor); } Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** SpaceTool.java 18 Nov 2007 20:32:47 -0000 1.92 --- SpaceTool.java 18 Nov 2007 21:30:17 -0000 1.93 *************** *** 47,55 **** /** * Construct the SpaceTool ! * @param glv The GLView * @param cursor The cursor */ ! public SpaceTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 47,55 ---- /** * Construct the SpaceTool ! * @param editor The GLView * @param cursor The cursor */ ! public SpaceTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 60,64 **** @Override protected void pressed(MouseEvent e) { ! glv.setLengthValue(""); typing = false; boolean done = false; --- 60,64 ---- @Override protected void pressed(MouseEvent e) { ! editor.setLengthValue(""); typing = false; boolean done = false; *************** *** 80,84 **** } if (menu != null) { ! glv.popup(menu, e.getX(), e.getY()); } done = true; --- 80,84 ---- } if (menu != null) { ! editor.popup(menu, e.getX(), e.getY()); } done = true; *************** *** 89,93 **** if (target instanceof String) { String side = (String)target; ! glv.popup(makeSpaceMenu(side), e.getX(), e.getY()); } --- 89,93 ---- if (target instanceof String) { String side = (String)target; ! editor.popup(makeSpaceMenu(side), e.getX(), e.getY()); } *************** *** 136,143 **** shift.addActionListener(shiftListener); JMenuItem copy = new JMenuItem("Copy space assignment"); ! ActionListener copyListener = new CopyActionListener(surface, glv.getView()); copy.addActionListener(copyListener); JMenuItem paste = new JMenuItem("Paste space assignment"); ! ActionListener pasteListener = new PasteActionListener(surface, glv.getView()); paste.addActionListener(pasteListener); --- 136,143 ---- shift.addActionListener(shiftListener); JMenuItem copy = new JMenuItem("Copy space assignment"); ! ActionListener copyListener = new CopyActionListener(surface, editor.getView()); copy.addActionListener(copyListener); JMenuItem paste = new JMenuItem("Paste space assignment"); ! ActionListener pasteListener = new PasteActionListener(surface, editor.getView()); paste.addActionListener(pasteListener); *************** *** 160,164 **** private JPopupMenu spacePopup(String side) { JPopupMenu menu = new JPopupMenu(side); ! SpacePopupListener spl = new SpacePopupListener(side.equals("front"), glv.getView()); --- 160,164 ---- private JPopupMenu spacePopup(String side) { JPopupMenu menu = new JPopupMenu(side); ! SpacePopupListener spl = new SpacePopupListener(side.equals("front"), editor.getView()); *************** *** 230,234 **** public void actionPerformed(ActionEvent arg0) { if (space != null) { ! glv.getView().makeTarget(null); Selection.primary().set(space); } --- 230,234 ---- public void actionPerformed(ActionEvent arg0) { if (space != null) { ! editor.getView().makeTarget(null); Selection.primary().set(space); } *************** *** 241,245 **** if (space != null) { Selection.primary().clear(); ! glv.getView().makeTarget(null); space.edit(); } --- 241,245 ---- if (space != null) { Selection.primary().clear(); ! editor.getView().makeTarget(null); space.edit(); } *************** *** 319,323 **** Selection.primary().add(s); } else { ! glv.setLengthValue(result.toString()); } } --- 319,323 ---- Selection.primary().add(s); } else { ! editor.setLengthValue(result.toString()); } } Index: CameraFlyTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraFlyTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CameraFlyTool.java 18 Nov 2007 20:32:47 -0000 1.12 --- CameraFlyTool.java 18 Nov 2007 21:30:17 -0000 1.13 *************** *** 27,35 **** /** * Constructor ! * @param glv The 3D canvas * @param cursor the cursor */ ! public CameraFlyTool(Editor glv, Cursor cursor) { ! super(glv, cursor); dragDelay = 0; } --- 27,35 ---- /** * Constructor ! * @param editor The 3D canvas * @param cursor the cursor */ ! public CameraFlyTool(Editor editor, Cursor cursor) { ! super(editor, cursor); dragDelay = 0; } Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AltMoveTool.java 18 Nov 2007 20:32:47 -0000 1.14 --- AltMoveTool.java 18 Nov 2007 21:30:17 -0000 1.15 *************** *** 43,51 **** /** ! * @param glv GLView * @param cursor Cursor */ ! public AltMoveTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 43,51 ---- /** ! * @param editor GLView * @param cursor Cursor */ ! public AltMoveTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 84,90 **** if (system == null) { findTarget(e, View.OBJECTS); ! glv.getView().makeTarget(target); } else { ! Vertex hit = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); current = new Intersection(hit, Intersection.SURFACE, null); Vertex from = start.vertex(); --- 84,90 ---- if (system == null) { findTarget(e, View.OBJECTS); ! editor.getView().makeTarget(target); } else { ! Vertex hit = editor.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); current = new Intersection(hit, Intersection.SURFACE, null); Vertex from = start.vertex(); *************** *** 108,112 **** if (system == null) { findTarget(e, View.OBJECTS); ! glv.getView().makeTarget(target); if (target instanceof Surface) { surface = (Surface) target; --- 108,112 ---- if (system == null) { findTarget(e, View.OBJECTS); ! editor.getView().makeTarget(target); if (target instanceof Surface) { surface = (Surface) target; *************** *** 136,141 **** start = new Intersection(origin, Intersection.SURFACE, null); makeTarget(start); ! glv.getView().addTempConstructor(system); ! View view = glv.getView(); Transformation trans = view.transformation(); double x = e.getX(); --- 136,141 ---- start = new Intersection(origin, Intersection.SURFACE, null); makeTarget(start); ! editor.getView().addTempConstructor(system); ! View view = editor.getView(); Transformation trans = view.transformation(); double x = e.getX(); *************** *** 161,165 **** move(origin); } ! glv.getView().removeTempConstructor(system); surface = null; system = null; --- 161,165 ---- move(origin); } ! editor.getView().removeTempConstructor(system); surface = null; system = null; Index: RelationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RelationTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RelationTool.java 18 Nov 2007 20:32:47 -0000 1.6 --- RelationTool.java 18 Nov 2007 21:30:17 -0000 1.7 *************** *** 35,43 **** /** * Constructor for Pencil ! * @param glv GLView * @param cursor Cursor */ ! public RelationTool(Editor glv, Cursor cursor) { ! super(glv, cursor); ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Bcursorremove.gif"); --- 35,43 ---- /** * Constructor for Pencil ! * @param editor GLView * @param cursor Cursor */ ! public RelationTool(Editor editor, Cursor cursor) { ! super(editor, cursor); ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Bcursorremove.gif"); *************** *** 71,75 **** current = findIntersection(e); findTarget(e, elements); ! glv.getView().makeTarget(target); if (current != null) { updateFeedback(); --- 71,75 ---- current = findIntersection(e); findTarget(e, elements); ! editor.getView().makeTarget(target); if (current != null) { updateFeedback(); *************** *** 123,127 **** } updateFeedback(); ! glv.repaint(); } } --- 123,127 ---- } updateFeedback(); ! editor.repaint(); } } Index: PanStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PanStrategy.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PanStrategy.java 18 Nov 2007 20:32:47 -0000 1.4 --- PanStrategy.java 18 Nov 2007 21:30:17 -0000 1.5 *************** *** 23,27 **** /** The GLView */ ! private Editor glv; /** The x */ --- 23,27 ---- /** The GLView */ ! private Editor editor; /** The x */ *************** *** 34,41 **** /** * Constructor ! * @param glv GLView */ ! public PanStrategy(Editor glv) { ! this.glv = glv; } --- 34,41 ---- /** * Constructor ! * @param editor GLView */ ! public PanStrategy(Editor editor) { ! this.editor = editor; } *************** *** 61,65 **** */ public void dragged(MouseEvent e) { ! View view = glv.getView(); Camera c = Project.getInstance().getCurrentCamera(); double[] center = c.getCenter(); --- 61,65 ---- */ public void dragged(MouseEvent e) { ! View view = editor.getView(); Camera c = Project.getInstance().getCurrentCamera(); double[] center = c.getCenter(); Index: ControlledExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledExtrudeTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ControlledExtrudeTool.java 18 Nov 2007 20:32:47 -0000 1.9 --- ControlledExtrudeTool.java 18 Nov 2007 21:30:17 -0000 1.10 *************** *** 56,64 **** /** * Tool constructor ! * @param glv The view to work in * @param cursor The cursor to use */ ! public ControlledExtrudeTool(Editor glv, Cursor cursor) { ! super(glv, cursor); extrusion = new HashSet<Surface>(); affected = new HashSet<Surface>(); --- 56,64 ---- /** * Tool constructor ! * @param editor The view to work in * @param cursor The cursor to use */ ! public ControlledExtrudeTool(Editor editor, Cursor cursor) { ! super(editor, cursor); extrusion = new HashSet<Surface>(); affected = new HashSet<Surface>(); *************** *** 79,83 **** @Override protected void moved(MouseEvent e) { ! glv.getView().makeTarget(null); ArrayList<Surface> starter = new ArrayList<Surface>(); if (topSurface != pressedSurface) { --- 79,83 ---- @Override protected void moved(MouseEvent e) { ! editor.getView().makeTarget(null); ArrayList<Surface> starter = new ArrayList<Surface>(); if (topSurface != pressedSurface) { *************** *** 90,94 **** Vertex far = new Vertex(x, y, 1.0); Edge ray = new Edge(near, far); ! Transformation transformation = glv.getView().transformation(); ray = transformation.unProject(ray); --- 90,94 ---- Vertex far = new Vertex(x, y, 1.0); Edge ray = new Edge(near, far); ! Transformation transformation = editor.getView().transformation(); ray = transformation.unProject(ray); *************** *** 96,100 **** // If the extrusion havn't started yet if (target instanceof Surface) { ! glv.getView().makeTarget(target); current = new Intersection(((Surface)target).intersection(ray), Intersection.SURFACE, target); --- 96,100 ---- // If the extrusion havn't started yet if (target instanceof Surface) { ! editor.getView().makeTarget(target); current = new Intersection(((Surface)target).intersection(ray), Intersection.SURFACE, target); *************** *** 199,203 **** start = current; pressedSurface = (Surface)target; ! Transformation transformation = glv.getView().transformation(); double x = e.getX(); double y = View.getHeight() - e.getY(); --- 199,203 ---- start = current; pressedSurface = (Surface)target; ! Transformation transformation = editor.getView().transformation(); double x = e.getX(); double y = View.getHeight() - e.getY(); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** AbstractTool.java 18 Nov 2007 20:32:47 -0000 1.137 --- AbstractTool.java 18 Nov 2007 21:30:17 -0000 1.138 *************** *** 123,127 **** /** The 3DView */ ! protected Editor glv = null; /** the object corresponding to the mouse */ --- 123,127 ---- /** The 3DView */ ! protected Editor editor = null; /** the object corresponding to the mouse */ *************** *** 160,178 **** /** * KeyListener for the GL Canvas ! * @param glv The 3D canvas * @param cursor The cursor */ ! public AbstractTool(Editor glv, Cursor cursor) { ! this.glv = glv; this.cursor = cursor; if (pan == null) { ! pan = new PanStrategy(glv); } if (select == null) { ! select = new SelectStrategy(glv); } if (orbit == null) { ! orbit = new OrbitStrategy(glv); } } --- 160,178 ---- /** * KeyListener for the GL Canvas ! * @param editor The 3D canvas * @param cursor The cursor */ ! public AbstractTool(Editor editor, Cursor cursor) { ! this.editor = editor; this.cursor = cursor; if (pan == null) { ! pan = new PanStrategy(editor); } if (select == null) { ! select = new SelectStrategy(editor); } if (orbit == null) { ! orbit = new OrbitStrategy(editor); } } *************** *** 183,187 **** protected void setActiveStrategy(Strategy which) { Tool tool = null; ! ToolFactory factory = ToolFactory.getFactory(glv); if (which == AbstractTool.pan) { tool = factory.get(Tool.PAN_TOOL); --- 183,187 ---- protected void setActiveStrategy(Strategy which) { Tool tool = null; ! ToolFactory factory = ToolFactory.getFactory(editor); if (which == AbstractTool.pan) { tool = factory.get(Tool.PAN_TOOL); *************** *** 200,204 **** tool = this; } ! glv.setCursor(tool.getCursor()); activeStrategy = which; } --- 200,204 ---- tool = this; } ! editor.setCursor(tool.getCursor()); activeStrategy = which; } *************** *** 224,229 **** cam.zoomin(); } ! glv.setFactor((int)cam.getFactor()); ! glv.repaint(false); } --- 224,229 ---- cam.zoomin(); } ! editor.setFactor((int)cam.getFactor()); ! editor.repaint(false); } *************** *** 251,255 **** */ public void setTip(String tip) { ! glv.setTip(tip); } --- 251,255 ---- */ public void setTip(String tip) { ! editor.setTip(tip); } *************** *** 260,264 **** public void setLength(double value) { int mm = (int) (value * 1000.0); ! glv.setLengthValue(Integer.toString(mm)); typing = false; } --- 260,264 ---- public void setLength(double value) { int mm = (int) (value * 1000.0); ! editor.setLengthValue(Integer.toString(mm)); typing = false; } *************** *** 268,272 **** */ public void clearLength() { ! glv.setLengthValue(""); } --- 268,272 ---- */ public void clearLength() { ! editor.setLengthValue(""); } *************** *** 275,279 **** */ public void clearTip() { ! glv.setTip(""); } --- 275,279 ---- */ public void clearTip() { ! editor.setTip(""); } *************** *** 306,316 **** if (e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = true; ! glv.setCursor(metaCursor); return; } if (e.getKeyCode() == KeyEvent.VK_CONTROL || e.getKeyCode() == KeyEvent.VK_META) { setActiveStrategy(AbstractTool.select); ! glv.getView().makeTarget(null); ! glv.repaint(); return; } --- 306,316 ---- if (e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = true; ! editor.setCursor(metaCursor); return; } if (e.getKeyCode() == KeyEvent.VK_CONTROL || e.getKeyCode() == KeyEvent.VK_META) { setActiveStrategy(AbstractTool.select); ! editor.getView().makeTarget(null); ! editor.repaint(); return; } *************** *** 343,354 **** Collection cams = Project.getInstance().getCameras(); Iterator it = cams.iterator(); ! glv.getView().removeGlObjects3D(glCams); glCams.clear(); while (it.hasNext()) { glCams.add(new GlCamera((Camera)it.next())); } ! glv.getView().addGlObjects3D(glCams); } ! glv.repaint(true); } --- 343,354 ---- Collection cams = Project.getInstance().getCameras(); Iterator it = cams.iterator(); ! editor.getView().removeGlObjects3D(glCams); glCams.clear(); while (it.hasNext()) { glCams.add(new GlCamera((Camera)it.next())); } ! editor.getView().addGlObjects3D(glCams); } ! editor.repaint(true); } *************** *** 363,370 **** if (e.getKeyCode() == KeyEvent.VK_META || e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = false; ! glv.setCursor(cursor); } if (e.getKeyCode() == KeyEvent.VK_S) { ! glv.getView().removeGlObjects3D(glCams); glCams.clear(); } --- 363,370 ---- if (e.getKeyCode() == KeyEvent.VK_META || e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = false; ! editor.setCursor(cursor); } if (e.getKeyCode() == KeyEvent.VK_S) { ! editor.getView().removeGlObjects3D(glCams); glCams.clear(); } *************** *** 404,408 **** previousPos[0] = x; previousPos[1] = y; ! glv.repaint(true); } --- 404,408 ---- previousPos[0] = x; previousPos[1] = y; ! editor.repaint(true); } *************** *** 424,428 **** previousPos[0] = x; previousPos[1] = y; ! glv.repaint(true); } --- 424,428 ---- previousPos[0] = x; previousPos[1] = y; ! editor.repaint(true); } *************** *** 462,466 **** previousPos[0] = pressPos[0]; previousPos[1] = pressPos[1]; ! target = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); if (e.getButton() == MouseEvent.BUTTON2) { setActiveStrategy(AbstractTool.pan); --- 462,466 ---- previousPos[0] = pressPos[0]; previousPos[1] = pressPos[1]; ! target = editor.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); if (e.getButton() == MouseEvent.BUTTON2) { setActiveStrategy(AbstractTool.pan); *************** *** 479,483 **** } } ! glv.repaint(true); } --- 479,483 ---- } } ! editor.repaint(true); } *************** *** 496,500 **** setActiveStrategy(null); } ! glv.repaint(true); } --- 496,500 ---- setActiveStrategy(null); } ! editor.repaint(true); } *************** *** 508,512 **** while (it.hasNext()) { Edge constructor = (Edge)it.next(); ! glv.getView().addTempEdge(constructor); } } --- 508,512 ---- while (it.hasNext()) { Edge constructor = (Edge)it.next(); ! editor.getView().addTempEdge(constructor); } } *************** *** 522,526 **** while (it.hasNext()) { Edge constructor = (Edge)it.next(); ! glv.getView().removeTempEdge(constructor); } } --- 522,526 ---- while (it.hasNext()) { Edge constructor = (Edge)it.next(); ! editor.getView().removeTempEdge(constructor); } } *************** *** 567,571 **** String value; if (typing) { ! value = glv.getLengthValue(); } else { value = ""; --- 567,571 ---- String value; if (typing... [truncated message content] |
From: Michael L. <he...@us...> - 2007-11-18 21:30:14
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16012/src/net/sourceforge/bprocessor/gl/view Modified Files: ViewToolbarFactory.java View.java Log Message: Renamed GLView to Editor Index: ViewToolbarFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewToolbarFactory.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ViewToolbarFactory.java 18 Nov 2007 20:32:47 -0000 1.6 --- ViewToolbarFactory.java 18 Nov 2007 21:30:16 -0000 1.7 *************** *** 17,22 **** import javax.swing.JToggleButton; - import org.apache.log4j.Logger; - import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gui.Toolbar; --- 17,20 ---- *************** *** 26,42 **** */ public class ViewToolbarFactory { - /** The logger */ - private static Logger log = Logger.getLogger(ViewToolbarFactory.class); - /** * Registers the buttons in the toolbar ! * @param glv the GLView object the buttons should have effect on */ ! public void registerToolbar(Editor glv) { Toolbar tb = Toolbar.getInstance(); tb.addSeparator(5); ButtonGroup bg = new ButtonGroup(); ! JToggleButton but = tb.registerAction(new ViewLighting(glv)); bg.add(but); but.setToolTipText("Shading"); --- 24,37 ---- */ public class ViewToolbarFactory { /** * Registers the buttons in the toolbar ! * @param editor the GLView object the buttons should have effect on */ ! public void registerToolbar(Editor editor) { Toolbar tb = Toolbar.getInstance(); tb.addSeparator(5); ButtonGroup bg = new ButtonGroup(); ! JToggleButton but = tb.registerAction(new ViewLighting(editor)); bg.add(but); but.setToolTipText("Shading"); *************** *** 44,53 **** but.setSelected(true); ! but = tb.registerAction(new ViewSolid(glv)); bg.add(but); but.setToolTipText("Solid"); but.setMnemonic(KeyEvent.VK_F7); ! but = tb.registerAction(new ViewWireframe(glv)); bg.add(but); but.setToolTipText("Wireframe"); --- 39,48 ---- but.setSelected(true); ! but = tb.registerAction(new ViewSolid(editor)); bg.add(but); but.setToolTipText("Solid"); but.setMnemonic(KeyEvent.VK_F7); ! but = tb.registerAction(new ViewWireframe(editor)); bg.add(but); but.setToolTipText("Wireframe"); *************** *** 56,70 **** tb.addSeparator(5); ! but = tb.registerAction(new ViewNoRaster(glv)); but.setSelected(true); but.setToolTipText("Shading no raster"); but.setMnemonic(KeyEvent.VK_F6); ! but = tb.registerAction(new ViewGrid(glv)); but.setToolTipText("Grid"); but.setSelected(true); ! but = tb.registerAction(new ViewEdges(glv)); but.setToolTipText("Edges"); but.setSelected(true); --- 51,65 ---- tb.addSeparator(5); ! but = tb.registerAction(new ViewNoRaster(editor)); but.setSelected(true); but.setToolTipText("Shading no raster"); but.setMnemonic(KeyEvent.VK_F6); ! but = tb.registerAction(new ViewGrid(editor)); but.setToolTipText("Grid"); but.setSelected(true); ! but = tb.registerAction(new ViewEdges(editor)); but.setToolTipText("Edges"); but.setSelected(true); *************** *** 73,80 **** class ViewEdges extends AbstractAction { ! private Editor glv; ! ViewEdges(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconedges.gif"); --- 68,75 ---- class ViewEdges extends AbstractAction { ! private Editor editor; ! ViewEdges(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconedges.gif"); *************** *** 87,103 **** JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! glv.getView().enableEdges(); } else { ! glv.getView().disableEdges(); } ! glv.repaint(); } } class ViewGrid extends AbstractAction { ! private Editor glv; ! ViewGrid(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Bgrid.gif"); --- 82,98 ---- JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! editor.getView().enableEdges(); } else { ! editor.getView().disableEdges(); } ! editor.repaint(); } } class ViewGrid extends AbstractAction { ! private Editor editor; ! ViewGrid(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Bgrid.gif"); *************** *** 110,118 **** JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! glv.getView().enableGrid(); } else { ! glv.getView().disableGrid(); } ! glv.repaint(); } } --- 105,113 ---- JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! editor.getView().enableGrid(); } else { ! editor.getView().disableGrid(); } ! editor.repaint(); } } *************** *** 122,137 **** */ class ViewWireframe extends AbstractAction { - /** */ - private static final long serialVersionUID = 1L; - /** The GLView */ ! private Editor glv = null; /** * Constructor ! * @param glv TheGLView */ ! ViewWireframe(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconwire.gif"); --- 117,129 ---- */ class ViewWireframe extends AbstractAction { /** The GLView */ ! private Editor editor = null; /** * Constructor ! * @param editor TheGLView */ ! ViewWireframe(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconwire.gif"); *************** *** 145,150 **** */ public void actionPerformed(ActionEvent e) { ! glv.getView().changeDrawMode(View.WIREFRAME_MODE); ! glv.repaint(true); } } --- 137,142 ---- */ public void actionPerformed(ActionEvent e) { ! editor.getView().changeDrawMode(View.WIREFRAME_MODE); ! editor.repaint(true); } } *************** *** 158,169 **** /** The GLView */ ! private Editor glv = null; /** * Constructor ! * @param glv TheGLView */ ! ViewNoRaster(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconlight.gif"); --- 150,161 ---- /** The GLView */ ! private Editor editor = null; /** * Constructor ! * @param editor TheGLView */ ! ViewNoRaster(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconlight.gif"); *************** *** 177,188 **** */ public void actionPerformed(ActionEvent event) { - //glv.getView().changeDrawMode(View.SPACE_ASSGN_MODE); JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! glv.getView().showTransparent(); } else { ! glv.getView().hideTransparent(); } ! glv.repaint(true); } } --- 169,179 ---- */ public void actionPerformed(ActionEvent event) { JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! editor.getView().showTransparent(); } else { ! editor.getView().hideTransparent(); } ! editor.repaint(true); } } *************** *** 196,207 **** /** The GLView */ ! private Editor glv = null; /** * Constructor ! * @param glv TheGLView */ ! ViewSolid(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconsolid.gif"); --- 187,198 ---- /** The GLView */ ! private Editor editor = null; /** * Constructor ! * @param editor TheGLView */ ! ViewSolid(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconsolid.gif"); *************** *** 215,220 **** */ public void actionPerformed(ActionEvent e) { ! glv.getView().changeDrawMode(View.SOLID_MODE); ! glv.repaint(true); } } --- 206,211 ---- */ public void actionPerformed(ActionEvent e) { ! editor.getView().changeDrawMode(View.SOLID_MODE); ! editor.repaint(true); } } *************** *** 228,239 **** /** The GLView */ ! private Editor glv = null; /** * Constructor ! * @param glv TheGLView */ ! ViewLighting(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconlight.gif"); --- 219,230 ---- /** The GLView */ ! private Editor editor = null; /** * Constructor ! * @param editor TheGLView */ ! ViewLighting(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconlight.gif"); *************** *** 247,252 **** */ public void actionPerformed(ActionEvent e) { ! glv.getView().changeDrawMode(View.LIGHTING_MODE); ! glv.repaint(true); } } --- 238,243 ---- */ public void actionPerformed(ActionEvent e) { ! editor.getView().changeDrawMode(View.LIGHTING_MODE); ! editor.repaint(true); } } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.261 retrieving revision 1.262 diff -C2 -d -r1.261 -r1.262 *** View.java 18 Nov 2007 20:32:47 -0000 1.261 --- View.java 18 Nov 2007 21:30:17 -0000 1.262 *************** *** 220,224 **** /** The GLView */ ! protected Editor glv = null; /** Flag for when to use SELECT render mode */ --- 220,224 ---- /** The GLView */ ! protected Editor editor = null; /** Flag for when to use SELECT render mode */ *************** *** 394,398 **** byte b3 = (byte) 0x00; for (int i = 0; i < highlight.length; i++) { ! int d = ((int)(i / 4)) % 4; if (d == 0) { --- 394,398 ---- byte b3 = (byte) 0x00; for (int i = 0; i < highlight.length; i++) { ! int d = ((i / 4)) % 4; if (d == 0) { *************** *** 432,439 **** /** * The constructor ! * @param glv The glview */ ! public View(Editor glv) { ! this.glv = glv; bgColor = BACKGROUND_COLOR; lineColor = STD_LINE_COLOR; --- 432,439 ---- /** * The constructor ! * @param editor The glview */ ! public View(Editor editor) { ! this.editor = editor; bgColor = BACKGROUND_COLOR; lineColor = STD_LINE_COLOR; *************** *** 453,457 **** tickler = new Timer(300, new ActionListener() { public void actionPerformed(ActionEvent e) { ! View.this.glv.repaint(); } }); --- 453,457 ---- tickler = new Timer(300, new ActionListener() { public void actionPerformed(ActionEvent e) { ! View.this.editor.repaint(); } }); *************** *** 703,707 **** gl.glLoadIdentity(); ! if (glv.getTool() instanceof SpaceTool) { labelSelection(hitdetection); } --- 703,707 ---- gl.glLoadIdentity(); ! if (editor.getTool() instanceof SpaceTool) { labelSelection(hitdetection); } *************** *** 1561,1565 **** excluded = unWantedEntities; ! glv.repaint(true); Object object = processSelect(unWantedEntities, mode == INTERSECTIONS, xy); --- 1561,1565 ---- excluded = unWantedEntities; ! editor.repaint(true); Object object = processSelect(unWantedEntities, mode == INTERSECTIONS, xy); *************** *** 1637,1641 **** int lengthTemp = selectionLength; selectionLength = 2056; ! glv.repaint(true); List selection = getAllGeometryInSelection(); selectionLength = lengthTemp; --- 1637,1641 ---- int lengthTemp = selectionLength; selectionLength = 2056; ! editor.repaint(true); List selection = getAllGeometryInSelection(); selectionLength = lengthTemp; |
From: Michael L. <he...@us...> - 2007-11-18 20:33:06
|
Update of /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25904/src/net/sourceforge/bprocessor Modified Files: Application.java Log Message: Renamed GLView to Editor Index: Application.java =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor/Application.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Application.java 11 Apr 2007 09:09:31 -0000 1.4 --- Application.java 18 Nov 2007 20:33:08 -0000 1.5 *************** *** 2,6 **** import net.sourceforge.bprocessor.facade.FacadeMain; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gui.GUI; import org.apache.log4j.PropertyConfigurator; --- 2,6 ---- import net.sourceforge.bprocessor.facade.FacadeMain; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gui.GUI; import org.apache.log4j.PropertyConfigurator; *************** *** 21,25 **** } GUI gui = new GUI(); ! GLView gl = new GLView(); FacadeMain fm = new FacadeMain(); } --- 21,25 ---- } GUI gui = new GUI(); ! Editor gl = new Editor(); FacadeMain fm = new FacadeMain(); } |
From: Michael L. <he...@us...> - 2007-11-18 20:32:52
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25490/src/net/sourceforge/bprocessor/gl/view Modified Files: ViewToolbarFactory.java View.java Log Message: Renamed GLView to Editor Index: ViewToolbarFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewToolbarFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ViewToolbarFactory.java 9 Nov 2007 12:23:29 -0000 1.5 --- ViewToolbarFactory.java 18 Nov 2007 20:32:47 -0000 1.6 *************** *** 19,23 **** import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gui.Toolbar; --- 19,23 ---- import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gui.Toolbar; *************** *** 33,37 **** * @param glv the GLView object the buttons should have effect on */ ! public void registerToolbar(GLView glv) { Toolbar tb = Toolbar.getInstance(); tb.addSeparator(5); --- 33,37 ---- * @param glv the GLView object the buttons should have effect on */ ! public void registerToolbar(Editor glv) { Toolbar tb = Toolbar.getInstance(); tb.addSeparator(5); *************** *** 73,79 **** class ViewEdges extends AbstractAction { ! private GLView glv; ! ViewEdges(GLView glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 73,79 ---- class ViewEdges extends AbstractAction { ! private Editor glv; ! ViewEdges(Editor glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); *************** *** 96,102 **** class ViewGrid extends AbstractAction { ! private GLView glv; ! ViewGrid(GLView glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 96,102 ---- class ViewGrid extends AbstractAction { ! private Editor glv; ! ViewGrid(Editor glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); *************** *** 126,130 **** /** The GLView */ ! private GLView glv = null; /** --- 126,130 ---- /** The GLView */ ! private Editor glv = null; /** *************** *** 132,136 **** * @param glv TheGLView */ ! ViewWireframe(GLView glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 132,136 ---- * @param glv TheGLView */ ! ViewWireframe(Editor glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); *************** *** 158,162 **** /** The GLView */ ! private GLView glv = null; /** --- 158,162 ---- /** The GLView */ ! private Editor glv = null; /** *************** *** 164,168 **** * @param glv TheGLView */ ! ViewNoRaster(GLView glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 164,168 ---- * @param glv TheGLView */ ! ViewNoRaster(Editor glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); *************** *** 196,200 **** /** The GLView */ ! private GLView glv = null; /** --- 196,200 ---- /** The GLView */ ! private Editor glv = null; /** *************** *** 202,206 **** * @param glv TheGLView */ ! ViewSolid(GLView glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 202,206 ---- * @param glv TheGLView */ ! ViewSolid(Editor glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); *************** *** 228,232 **** /** The GLView */ ! private GLView glv = null; /** --- 228,232 ---- /** The GLView */ ! private Editor glv = null; /** *************** *** 234,238 **** * @param glv TheGLView */ ! ViewLighting(GLView glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 234,238 ---- * @param glv TheGLView */ ! ViewLighting(Editor glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.260 retrieving revision 1.261 diff -C2 -d -r1.260 -r1.261 *** View.java 15 Nov 2007 10:41:53 -0000 1.260 --- View.java 18 Nov 2007 20:32:47 -0000 1.261 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.view; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.tool.AbstractTool; import net.sourceforge.bprocessor.gl.tool.SpaceTool; --- 7,11 ---- package net.sourceforge.bprocessor.gl.view; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.tool.AbstractTool; import net.sourceforge.bprocessor.gl.tool.SpaceTool; *************** *** 220,224 **** /** The GLView */ ! protected GLView glv = null; /** Flag for when to use SELECT render mode */ --- 220,224 ---- /** The GLView */ ! protected Editor glv = null; /** Flag for when to use SELECT render mode */ *************** *** 434,438 **** * @param glv The glview */ ! public View(GLView glv) { this.glv = glv; bgColor = BACKGROUND_COLOR; --- 434,438 ---- * @param glv The glview */ ! public View(Editor glv) { this.glv = glv; bgColor = BACKGROUND_COLOR; |
From: Michael L. <he...@us...> - 2007-11-18 20:32:47
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25490/src/net/sourceforge/bprocessor/gl Added Files: Editor.java Removed Files: GLView.java Log Message: Renamed GLView to Editor --- GLView.java DELETED --- --- NEW FILE: Editor.java --- //--------------------------------------------------------------------------------- // $Id: Editor.java,v 1.1 2007/11/18 20:32:48 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl; import net.sourceforge.bprocessor.gl.tool.Tool; import net.sourceforge.bprocessor.gl.tool.ToolFactory; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.gl.view.ViewToolbarFactory; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.gui.GUI; import java.awt.Color; import java.awt.Cursor; import java.awt.Dimension; import java.awt.BorderLayout; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.ActionListener; import javax.media.opengl.GLCanvas; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLDrawable; import javax.media.opengl.GLException; import javax.swing.BorderFactory; import javax.swing.JColorChooser; import javax.swing.JComboBox; import javax.swing.JSeparator; import javax.swing.JTextField; import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; import org.apache.log4j.Logger; /** * The 3D display */ public class Editor implements MouseListener, Observer { /** The logger */ private static Logger log = Logger.getLogger(Editor.class); /** GL canvas */ private GLCanvas glc; /** current event listener */ private View view; /** current working tool */ private Tool tool; /** the length parameter */ private LengthField lengthField; /** The label and combobox for the reality factor */ private FactorBox factor; private JPanel lengthPanel; private JLabel tipLabel; /** * Constuctor */ public Editor() { GLCapabilities glCap = new GLCapabilities(); glCap.setDoubleBuffered(true); glCap.setHardwareAccelerated(true); ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); glc = new GLCanvas(glCap); log.info("Using JOGL version official"); Selection.primary().addObserver(this); Project.getInstance().addStaticObserver(this); GUI.getInstance().incrementPB(); JPanel jp = new JPanel(); jp.setLayout(new BorderLayout()); jp.add(glc, BorderLayout.CENTER); jp.setMinimumSize(new Dimension(320, 240)); jp.setPreferredSize(new Dimension(640, 480)); GUI.getInstance().incrementPB(); lengthPanel = new JPanel(); lengthPanel.setLayout(new BorderLayout()); lengthPanel.add(new JLabel("Length: "), BorderLayout.WEST); lengthField = new LengthField(); lengthPanel.add(lengthField, BorderLayout.CENTER); factor = new FactorBox(); //lengthPanel.add(factor, BorderLayout.EAST); JPanel tipPanel = new JPanel(); tipPanel.setLayout(new BorderLayout()); tipPanel.add(new JLabel("Tip: "), BorderLayout.WEST); tipLabel = new JLabel("Hello World!"); Font basicFont = tipLabel.getFont(); tipLabel.setFont(new Font(basicFont.getName(), Font.PLAIN, basicFont.getSize())); tipPanel.add(tipLabel, BorderLayout.CENTER); JPanel bottomPanel = new JPanel(); bottomPanel.setLayout(new BorderLayout()); bottomPanel.setBorder(BorderFactory.createEtchedBorder()); bottomPanel.add(lengthPanel, BorderLayout.NORTH); bottomPanel.add(new JSeparator(), BorderLayout.CENTER); bottomPanel.add(tipPanel, BorderLayout.SOUTH); jp.add(bottomPanel, BorderLayout.SOUTH); GUI.getInstance().incrementPB(); tool = ToolFactory.getFactory(this).getDefault(); setTip(tool.initialTip()); view = new View(this); (new ViewToolbarFactory()).registerToolbar(this); glc.addGLEventListener(view); GUI.getInstance().incrementPB(); glc.addMouseListener(tool); glc.addMouseMotionListener(tool); glc.addMouseWheelListener(tool); glc.addKeyListener(tool); glc.addMouseListener(this); GUI.getInstance().registerPanel(jp, GUI.SPLIT_MIDDLE); GUI.getInstance().incrementPB(); JMenu colorMenu = new JMenu("GL Colors"); ActionListener colorMenuListener = new ActionListener() { public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Grid Color")) { Color newColor = JColorChooser.showDialog(GUI.getInstance(), "Grid Color", new Color(View.getGridColor()[0], View.getGridColor()[1], View.getGridColor()[2])); if (newColor != null) { View.setGridColor(newColor.getRGBComponents(null)); } } else if (e.getActionCommand().equals("Line Color")) { Color newColor = JColorChooser.showDialog(GUI.getInstance(), "Line Color", new Color(View.getLineColor()[0], View.getLineColor()[1], View.getLineColor()[2])); if (newColor != null) { View.setLineColor(newColor.getRGBComponents(null)); } } else if (e.getActionCommand().equals("Constructor Line Color")) { Color newColor = JColorChooser.showDialog(GUI.getInstance(), "Constructor Line Color", new Color(View.getConstructorColor()[0], View.getConstructorColor()[1], View.getConstructorColor()[2])); if (newColor != null) { View.setConstructorColor(newColor.getRGBComponents(null)); } } else if (e.getActionCommand().equals("Background Color")) { Color newColor = JColorChooser.showDialog(GUI.getInstance(), "Background Color", new Color(View.getBgColor()[0], View.getBgColor()[1], View.getBgColor()[2])); if (newColor != null) { View.setBGColor(newColor.getRGBComponents(null)); } } else if (e.getActionCommand().equals("None Color")) { Color newColor = JColorChooser.showDialog(GUI.getInstance(), "None Color", new Color(View.getNoneColor()[0], View.getNoneColor()[1], View.getNoneColor()[2])); if (newColor != null) { View.setNoneColor(newColor.getRGBComponents(null)); } } else if (e.getActionCommand().equals("Default")) { View.setBGColor(View.BACKGROUND_COLOR); View.setGridColor(View.GRID_COLOR); View.setLineColor(View.STD_LINE_COLOR); View.setNoneColor(View.NONE_COLOR); View.setConstructorColor(View.CONSTRUCTOR_COLOR); } } }; JMenuItem gridItem = new JMenuItem("Grid Color"); gridItem.addActionListener(colorMenuListener); JMenuItem lineItem = new JMenuItem("Line Color"); lineItem.addActionListener(colorMenuListener); JMenuItem constructorItem = new JMenuItem("Constructor Line Color"); constructorItem.addActionListener(colorMenuListener); JMenuItem bgItem = new JMenuItem("Background Color"); bgItem.addActionListener(colorMenuListener); JMenuItem noneItem = new JMenuItem("None Color"); noneItem.addActionListener(colorMenuListener); JMenuItem defaultItem = new JMenuItem("Default"); defaultItem.addActionListener(colorMenuListener); GUI.getInstance().incrementPB(); colorMenu.add(gridItem); colorMenu.add(lineItem); colorMenu.add(constructorItem); colorMenu.add(bgItem); colorMenu.add(noneItem); colorMenu.add(defaultItem); GUI.getInstance().incrementPB(); GUI.getInstance().addMenu(colorMenu); GUI.getInstance().incrementPB(); glc.setAutoSwapBufferMode(false); repaint(); GUI.getInstance().incrementPB(); SwingUtilities.invokeLater ( new Runnable() { public void run() { GUI.getInstance().incrementPB(); GUI.getInstance().present(); } } ); } /** * Set cursor * @param cursor The cursor */ public void setCursor(Cursor cursor) { glc.setCursor(cursor); } /** * Change the tool * @param mode The new tool */ public void changeTool(int mode) { tool.cleanUp(); this.repaint(true); glc.removeMouseListener(tool); glc.removeMouseMotionListener(tool); glc.removeKeyListener(tool); if (mode == Tool.PREVIOUS_TOOL) { tool = ToolFactory.getFactory(this).get(Tool.PREVIOUS_TOOL); } else { tool = ToolFactory.getFactory(this).get(mode); } if (tool != null) { glc.addMouseListener(tool); glc.addMouseMotionListener(tool); glc.addKeyListener(tool); setCursor(tool.getCursor()); setTip(tool.initialTip()); tool.prepare(); } else { log.error("[changeMode] tool was null"); } getView().reset(); } /** * Repaint the canvas */ public void repaint() { if (Project.getInstance().getCurrentCamera().getType() == Camera.PERSPECTIVE) { disableFactor(); } else { setFactor((int)Project.getInstance().getCurrentCamera().getFactor()); enableFactor(); } repaint(false); } /** * Repaint the canvas. Will force instant repaint if given true * @param force wether or not to force reapint */ public void repaint(boolean force) { try { if (force) { glc.display(); } else { glc.repaint(); } } catch (GLException gle) { //gle.printStackTrace(); } } /** * Set the value of the length-field * @param value String */ public void setLengthValue(String value) { lengthField.setText(value); } /** * Sets the tip in the tip-panel * @param tip the tip to be displayed */ public void setTip(String tip) { tipLabel.setText(tip); } /** * * @return String */ public String getLengthValue() { return lengthField.getText(); } /** * Return the current used view * @return The current view */ public View getView() { return view; } /** * return the current tool in use * @return the tool */ public Tool getTool() { return tool; } /** * Return the GLDrawable * @return The GlDrawable */ public GLDrawable getGLDrawable() { return glc; } /** * The factor * @param i The size of the factor */ public void setFactor(int i) { factor.setFactor(i); } /** * Disable the factor field */ public void disableFactor() { lengthPanel.remove(factor); lengthPanel.revalidate(); } /** * Enable the factor field */ public void enableFactor() { lengthPanel.add(factor, BorderLayout.EAST); lengthPanel.revalidate(); } /** * Displays the popup menu at the given coordinates * @param pp the popup menu * @param x the x coordinate * @param y the y coordinate */ public void popup(JPopupMenu pp, int x, int y) { if (pp != null) { pp.show(glc, x, y); } } /** * Panel for the label and JComboBox representing the size factor */ class FactorBox extends JPanel implements ActionListener { private JComboBox choices; private JLabel label; private String[] items; /** * The Constructor construct both the label and combobox */ public FactorBox() { super(); label = new JLabel("Scale factor:"); this.add(label); items = new String[]{"1:1", "1:2", "1:5", "1:10", "1:20", "1:50", "1:100", "1:200", "1:500", "1:1000"}; choices = new JComboBox(items); choices.setEditable(true); choices.addActionListener(this); this.add(choices); } /** * Set the factor * @param i the value for the factor */ public void setFactor(int i) { String item = "1:" + i; choices.setSelectedItem(item); } /** * Handle the event of the combobox * @param The ActionEvent for the action */ public void actionPerformed(ActionEvent event) { String what = (String)choices.getSelectedItem(); if (what.matches("1:[\\d]+")) { int fac = Integer.parseInt(what.substring(2)); Project.getInstance().getCurrentCamera().setFactor(fac); } else { GUI.getInstance().alert("Wrong scale format, have to be 1:[integer]"); } } } /** * The length field class */ class LengthField extends JTextField { /** The logger */ private Logger log = Logger.getLogger(LengthField.class); /** * The constructor */ public LengthField() { super(15); } /** * set the text in the length field * do only take integer * @param d The integer */ public void setText(double d) { int mm = (int) (d * 1000.0); super.setText(Integer.toString(mm)); } /** * Set the text in the field to two commaseparated value x and y * @param x the first value * @param y the second value */ public void setText(double x, double y) { int xmm = (int) (x * 1000.0); int ymm = (int) (y * 1000.0); super.setText(Integer.toString(xmm) + ", " + Integer.toString(ymm)); } /** * Return the double in the textfield * @return The double in the field */ public double getDouble() { try { double d = Double.parseDouble(super.getText()); return (d / 1000); } catch (NumberFormatException e) { log.warn(e); } return 0; } } /** * @param arg0 Event */ public void mouseClicked(MouseEvent arg0) { } /** * @param arg0 Event */ public void mousePressed(MouseEvent arg0) { } /** * @param arg0 Event */ public void mouseReleased(MouseEvent arg0) { } /** * @param arg0 Event */ public void mouseEntered(MouseEvent arg0) { glc.requestFocusInWindow(); } /** * @param arg0 Event */ public void mouseExited(MouseEvent arg0) { } /** * Update this view * @param entity The changed entity */ public void update(Object entity) { getView().update(entity); repaint(); } } |
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25490/src/net/sourceforge/bprocessor/gl/tool Modified Files: ZoomTool.java FocusTool.java RelationTool.java ExtrusionTool.java ConstructorTool.java AbstractPencil.java OrbitStrategy.java PanTool.java CameraFlyTool.java ToolFactory.java SelectStrategy.java RotationTool.java RectTool.java EraserTool.java Pencil.java SelectTool.java CameraWalkTool.java ControlledMoveTool.java PanStrategy.java MoveTool.java OffsetTool.java SpaceTool.java ClipplaneTool.java EdgeMoveTool.java FinalMoveTool.java TapeMeasure.java CameraTool.java ControlledExtrudeTool.java AbstractTool.java Protractor.java ArcTool.java AltMoveTool.java Log Message: Renamed GLView to Editor Index: PanTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PanTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PanTool.java 3 Sep 2007 13:36:52 -0000 1.1 --- PanTool.java 18 Nov 2007 20:32:47 -0000 1.2 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.GLView; import java.awt.Cursor; --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.Editor; import java.awt.Cursor; *************** *** 25,29 **** * @param cursor The cursor */ ! public PanTool(GLView glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; --- 25,29 ---- * @param cursor The cursor */ ! public PanTool(Editor glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** OffsetTool.java 13 Nov 2007 12:19:21 -0000 1.23 --- OffsetTool.java 18 Nov 2007 20:32:47 -0000 1.24 *************** *** 21,25 **** import java.util.HashMap; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.CoordinateSystem; --- 21,25 ---- import java.util.HashMap; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 75,79 **** * @param cursor The Cursor */ ! public OffsetTool(GLView glv, Cursor cursor) { super(glv, cursor); guide = new Edge(new Vertex(0, 0, 0), new Vertex(0, 0, 0)); --- 75,79 ---- * @param cursor The Cursor */ ! public OffsetTool(Editor glv, Cursor cursor) { super(glv, cursor); guide = new Edge(new Vertex(0, 0, 0), new Vertex(0, 0, 0)); Index: ClipplaneTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ClipplaneTool.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ClipplaneTool.java 13 Nov 2007 12:19:22 -0000 1.13 --- ClipplaneTool.java 18 Nov 2007 20:32:47 -0000 1.14 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; *************** *** 39,43 **** * @param cursor The cursor */ ! public ClipplaneTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 39,43 ---- * @param cursor The cursor */ ! public ClipplaneTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** ToolFactory.java 14 Nov 2007 10:34:29 -0000 1.90 --- ToolFactory.java 18 Nov 2007 20:32:47 -0000 1.91 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gui.Toolbar; --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gui.Toolbar; *************** *** 42,46 **** /** glv */ ! private GLView glv; /** tools */ --- 42,46 ---- /** glv */ ! private Editor glv; /** tools */ *************** *** 138,142 **** * @param glv the GLView */ ! private ToolFactory(GLView glv) { tools = new HashMap(); buttons = new HashMap(); --- 138,142 ---- * @param glv the GLView */ ! private ToolFactory(Editor glv) { tools = new HashMap(); buttons = new HashMap(); *************** *** 318,322 **** * @return The factory */ ! public static synchronized ToolFactory getFactory(GLView glv) { if (factory == null) { factory = new ToolFactory(glv); --- 318,322 ---- * @return The factory */ ! public static synchronized ToolFactory getFactory(Editor glv) { if (factory == null) { factory = new ToolFactory(glv); *************** *** 401,405 **** /** glv */ ! protected GLView glv; /** key */ --- 401,405 ---- /** glv */ ! protected Editor glv; /** key */ *************** *** 412,416 **** * @param iconname Iconname */ ! public ToolAction(GLView glv, int key, String iconname) { this.glv = glv; this.key = key; --- 412,416 ---- * @param iconname Iconname */ ! public ToolAction(Editor glv, int key, String iconname) { this.glv = glv; this.key = key; Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** SelectTool.java 24 Sep 2007 13:02:17 -0000 1.66 --- SelectTool.java 18 Nov 2007 20:32:47 -0000 1.67 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.GLView; import java.awt.Cursor; --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.Editor; import java.awt.Cursor; *************** *** 25,29 **** * @param cursor The cursor */ ! public SelectTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 25,29 ---- * @param cursor The cursor */ ! public SelectTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** ExtrusionTool.java 13 Nov 2007 12:19:22 -0000 1.70 --- ExtrusionTool.java 18 Nov 2007 20:32:47 -0000 1.71 *************** *** 18,22 **** import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; --- 18,22 ---- import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; *************** *** 79,83 **** * @param cursor Cursor */ ! public ExtrusionTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 79,83 ---- * @param cursor Cursor */ ! public ExtrusionTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** AbstractPencil.java 13 Nov 2007 12:19:22 -0000 1.98 --- AbstractPencil.java 18 Nov 2007 20:32:47 -0000 1.99 *************** *** 22,26 **** import javax.swing.Timer; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.EdgeAttributes; import net.sourceforge.bprocessor.gl.model.Intersection; --- 22,26 ---- import javax.swing.Timer; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.EdgeAttributes; import net.sourceforge.bprocessor.gl.model.Intersection; *************** *** 137,141 **** * @param cursor Cursor */ ! public AbstractPencil(GLView glv, Cursor cursor) { super(glv, cursor); timer = new Timer(500, new TargetAction()); --- 137,141 ---- * @param cursor Cursor */ ! public AbstractPencil(Editor glv, Cursor cursor) { super(glv, cursor); timer = new Timer(500, new TargetAction()); Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** EraserTool.java 31 Aug 2007 12:47:48 -0000 1.10 --- EraserTool.java 18 Nov 2007 20:32:47 -0000 1.11 *************** *** 12,16 **** import java.awt.event.MouseEvent; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.ClippingPlane; import net.sourceforge.bprocessor.model.Constructor; --- 12,16 ---- import java.awt.event.MouseEvent; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.ClippingPlane; import net.sourceforge.bprocessor.model.Constructor; *************** *** 30,34 **** * @param cursor The Cursor */ ! public EraserTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 30,34 ---- * @param cursor The Cursor */ ! public EraserTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** MoveTool.java 28 Nov 2006 10:53:11 -0000 1.74 --- MoveTool.java 18 Nov 2007 20:32:47 -0000 1.75 *************** *** 16,20 **** import java.util.Set; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.View; --- 16,20 ---- import java.util.Set; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.View; *************** *** 56,60 **** * @param cursor The Cursor */ ! public MoveTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 56,60 ---- * @param cursor The Cursor */ ! public MoveTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** RotationTool.java 15 Nov 2007 13:07:41 -0000 1.30 --- RotationTool.java 18 Nov 2007 20:32:47 -0000 1.31 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.GlObject; import net.sourceforge.bprocessor.gl.model.Intersection; --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.GlObject; import net.sourceforge.bprocessor.gl.model.Intersection; *************** *** 68,72 **** * @param cursor The cursor */ ! public RotationTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 68,72 ---- * @param cursor The cursor */ ! public RotationTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ArcTool.java 13 Nov 2007 12:19:22 -0000 1.20 --- ArcTool.java 18 Nov 2007 20:32:47 -0000 1.21 *************** *** 14,18 **** import java.util.List; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.CoordinateSystem; --- 14,18 ---- import java.util.List; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 170,174 **** * @param cursor Cursor */ ! public ArcTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 170,174 ---- * @param cursor Cursor */ ! public ArcTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: ControlledMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledMoveTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ControlledMoveTool.java 13 Nov 2007 12:19:22 -0000 1.10 --- ControlledMoveTool.java 18 Nov 2007 20:32:47 -0000 1.11 *************** *** 18,22 **** import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; --- 18,22 ---- import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; *************** *** 47,51 **** * @param cursor Cursor */ ! public ControlledMoveTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 47,51 ---- * @param cursor Cursor */ ! public ControlledMoveTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: TapeMeasure.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasure.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TapeMeasure.java 13 Nov 2007 12:19:22 -0000 1.5 --- TapeMeasure.java 18 Nov 2007 20:32:47 -0000 1.6 *************** *** 13,17 **** import java.util.List; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; --- 13,17 ---- import java.util.List; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; *************** *** 40,44 **** * @param cursor Cursor */ ! public TapeMeasure(GLView glv, Cursor cursor) { super(glv, cursor); } --- 40,44 ---- * @param cursor Cursor */ ! public TapeMeasure(Editor glv, Cursor cursor) { super(glv, cursor); } Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** SpaceTool.java 12 Nov 2007 08:05:34 -0000 1.91 --- SpaceTool.java 18 Nov 2007 20:32:47 -0000 1.92 *************** *** 24,28 **** import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gui.PopupMenu; import net.sourceforge.bprocessor.gui.actions.SpaceMenuAction; --- 24,28 ---- import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gui.PopupMenu; import net.sourceforge.bprocessor.gui.actions.SpaceMenuAction; *************** *** 50,54 **** * @param cursor The cursor */ ! public SpaceTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 50,54 ---- * @param cursor The cursor */ ! public SpaceTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: CameraFlyTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraFlyTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CameraFlyTool.java 13 Nov 2007 12:19:22 -0000 1.11 --- CameraFlyTool.java 18 Nov 2007 20:32:47 -0000 1.12 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Project; --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Project; *************** *** 30,34 **** * @param cursor the cursor */ ! public CameraFlyTool(GLView glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; --- 30,34 ---- * @param cursor the cursor */ ! public CameraFlyTool(Editor glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AltMoveTool.java 13 Nov 2007 12:19:22 -0000 1.13 --- AltMoveTool.java 18 Nov 2007 20:32:47 -0000 1.14 *************** *** 16,20 **** import java.util.Map; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; --- 16,20 ---- import java.util.Map; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; *************** *** 46,50 **** * @param cursor Cursor */ ! public AltMoveTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 46,50 ---- * @param cursor Cursor */ ! public AltMoveTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: RelationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RelationTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RelationTool.java 7 May 2007 13:29:48 -0000 1.5 --- RelationTool.java 18 Nov 2007 20:32:47 -0000 1.6 *************** *** 18,22 **** import java.util.List; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; --- 18,22 ---- import java.util.List; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 38,42 **** * @param cursor Cursor */ ! public RelationTool(GLView glv, Cursor cursor) { super(glv, cursor); ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 38,42 ---- * @param cursor Cursor */ ! public RelationTool(Editor glv, Cursor cursor) { super(glv, cursor); ClassLoader cl = Thread.currentThread().getContextClassLoader(); Index: PanStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PanStrategy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PanStrategy.java 1 Mar 2007 14:53:56 -0000 1.3 --- PanStrategy.java 18 Nov 2007 20:32:47 -0000 1.4 *************** *** 10,14 **** import java.awt.event.MouseEvent; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Camera; --- 10,14 ---- import java.awt.event.MouseEvent; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Camera; *************** *** 23,27 **** /** The GLView */ ! private GLView glv; /** The x */ --- 23,27 ---- /** The GLView */ ! private Editor glv; /** The x */ *************** *** 36,40 **** * @param glv GLView */ ! public PanStrategy(GLView glv) { this.glv = glv; } --- 36,40 ---- * @param glv GLView */ ! public PanStrategy(Editor glv) { this.glv = glv; } Index: ControlledExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledExtrudeTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ControlledExtrudeTool.java 8 Oct 2007 11:56:27 -0000 1.8 --- ControlledExtrudeTool.java 18 Nov 2007 20:32:47 -0000 1.9 *************** *** 17,21 **** import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; --- 17,21 ---- import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; *************** *** 59,63 **** * @param cursor The cursor to use */ ! public ControlledExtrudeTool(GLView glv, Cursor cursor) { super(glv, cursor); extrusion = new HashSet<Surface>(); --- 59,63 ---- * @param cursor The cursor to use */ ! public ControlledExtrudeTool(Editor glv, Cursor cursor) { super(glv, cursor); extrusion = new HashSet<Surface>(); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** AbstractTool.java 13 Nov 2007 12:19:22 -0000 1.136 --- AbstractTool.java 18 Nov 2007 20:32:47 -0000 1.137 *************** *** 31,35 **** import net.sourceforge.bprocessor.gl.model.Widget; import net.sourceforge.bprocessor.gl.view.View; ! import net.sourceforge.bprocessor.gl.GLView; --- 31,35 ---- import net.sourceforge.bprocessor.gl.model.Widget; import net.sourceforge.bprocessor.gl.view.View; ! import net.sourceforge.bprocessor.gl.Editor; *************** *** 123,127 **** /** The 3DView */ ! protected GLView glv = null; /** the object corresponding to the mouse */ --- 123,127 ---- /** The 3DView */ ! protected Editor glv = null; /** the object corresponding to the mouse */ *************** *** 163,167 **** * @param cursor The cursor */ ! public AbstractTool(GLView glv, Cursor cursor) { this.glv = glv; this.cursor = cursor; --- 163,167 ---- * @param cursor The cursor */ ! public AbstractTool(Editor glv, Cursor cursor) { this.glv = glv; this.cursor = cursor; Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** FinalMoveTool.java 13 Nov 2007 12:19:22 -0000 1.32 --- FinalMoveTool.java 18 Nov 2007 20:32:47 -0000 1.33 *************** *** 18,22 **** import java.util.Stack; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.gui.GUI; --- 18,22 ---- import java.util.Stack; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.gui.GUI; *************** *** 55,59 **** * @param cursor Cursor */ ! public FinalMoveTool(GLView glv, Cursor cursor) { super(glv, cursor); // TODO Auto-generated constructor stub --- 55,59 ---- * @param cursor Cursor */ ! public FinalMoveTool(Editor glv, Cursor cursor) { super(glv, cursor); // TODO Auto-generated constructor stub Index: SelectStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** SelectStrategy.java 5 Nov 2007 09:45:00 -0000 1.20 --- SelectStrategy.java 18 Nov 2007 20:32:47 -0000 1.21 *************** *** 15,19 **** import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.GlCamera; import net.sourceforge.bprocessor.gl.view.Transformation; --- 15,19 ---- import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.GlCamera; import net.sourceforge.bprocessor.gl.view.Transformation; *************** *** 37,41 **** /** The GLView **/ ! private GLView glv; /** Tempoary edges for multiple selection */ --- 37,41 ---- /** The GLView **/ ! private Editor glv; /** Tempoary edges for multiple selection */ *************** *** 72,76 **** * @param glv GLView */ ! public SelectStrategy(GLView glv) { super(); this.glv = glv; --- 72,76 ---- * @param glv GLView */ ! public SelectStrategy(Editor glv) { super(); this.glv = glv; Index: FocusTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FocusTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FocusTool.java 27 Sep 2007 10:39:16 -0000 1.5 --- FocusTool.java 18 Nov 2007 20:32:47 -0000 1.6 *************** *** 10,14 **** import java.awt.event.MouseEvent; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.ClippingPlane; --- 10,14 ---- import java.awt.event.MouseEvent; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.ClippingPlane; *************** *** 26,30 **** * @param cursor Cursor */ ! public FocusTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 26,30 ---- * @param cursor Cursor */ ! public FocusTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** RectTool.java 13 Nov 2007 12:19:22 -0000 1.25 --- RectTool.java 18 Nov 2007 20:32:47 -0000 1.26 *************** *** 16,20 **** import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; --- 16,20 ---- import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; *************** *** 57,61 **** * @param cursor Cursor */ ! public RectTool(GLView glv, Cursor cursor) { super(glv, cursor); rectangle = new LinkedList<Edge>(); --- 57,61 ---- * @param cursor Cursor */ ! public RectTool(Editor glv, Cursor cursor) { super(glv, cursor); rectangle = new LinkedList<Edge>(); Index: EdgeMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EdgeMoveTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EdgeMoveTool.java 13 Nov 2007 12:19:22 -0000 1.4 --- EdgeMoveTool.java 18 Nov 2007 20:32:47 -0000 1.5 *************** *** 18,22 **** import java.util.Set; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; --- 18,22 ---- import java.util.Set; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; *************** *** 52,56 **** * @param cursor Cursor */ ! public EdgeMoveTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 52,56 ---- * @param cursor Cursor */ ! public EdgeMoveTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ConstructorTool.java 20 Jun 2007 13:17:56 -0000 1.15 --- ConstructorTool.java 18 Nov 2007 20:32:47 -0000 1.16 *************** *** 13,17 **** import java.util.List; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.Edge; --- 13,17 ---- import java.util.List; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.Edge; *************** *** 38,42 **** * @param cursor The Cursor */ ! public ConstructorTool(GLView glv, Cursor cursor) { super(glv, cursor); } --- 38,42 ---- * @param cursor The Cursor */ ! public ConstructorTool(Editor glv, Cursor cursor) { super(glv, cursor); } Index: CameraTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraTool.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CameraTool.java 20 Jun 2007 13:17:55 -0000 1.13 --- CameraTool.java 18 Nov 2007 20:32:47 -0000 1.14 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.GLView; //import java.awt.event.KeyEvent; --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.Editor; //import java.awt.event.KeyEvent; *************** *** 39,43 **** * @param cursor1 The Mouse cursor for rotation */ ! public CameraTool(GLView glv, Cursor cursor1) { super(glv, cursor1); orbit = new OrbitStrategy(glv); --- 39,43 ---- * @param cursor1 The Mouse cursor for rotation */ ! public CameraTool(Editor glv, Cursor cursor1) { super(glv, cursor1); orbit = new OrbitStrategy(glv); Index: OrbitStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OrbitStrategy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OrbitStrategy.java 31 Oct 2006 13:30:30 -0000 1.3 --- OrbitStrategy.java 18 Nov 2007 20:32:47 -0000 1.4 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Camera; --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Camera; *************** *** 35,39 **** /** GLView */ ! protected GLView glv; /** The x position */ --- 35,39 ---- /** GLView */ ! protected Editor glv; /** The x position */ *************** *** 47,51 **** * @param glv The 3D canvas */ ! public OrbitStrategy(GLView glv) { this.glv = glv; } --- 47,51 ---- * @param glv The 3D canvas */ ! public OrbitStrategy(Editor glv) { this.glv = glv; } Index: ZoomTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ZoomTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ZoomTool.java 3 Sep 2007 13:36:52 -0000 1.1 --- ZoomTool.java 18 Nov 2007 20:32:47 -0000 1.2 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Project; --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.Project; *************** *** 28,32 **** * @param cursor The cursor */ ! public ZoomTool(GLView glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; --- 28,32 ---- * @param cursor The cursor */ ! public ZoomTool(Editor glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; Index: CameraWalkTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraWalkTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CameraWalkTool.java 13 Nov 2007 12:19:22 -0000 1.9 --- CameraWalkTool.java 18 Nov 2007 20:32:47 -0000 1.10 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Project; --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Project; *************** *** 30,34 **** * @param cursor the cursor */ ! public CameraWalkTool(GLView glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; --- 30,34 ---- * @param cursor the cursor */ ! public CameraWalkTool(Editor glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Pencil.java 9 Nov 2007 09:45:32 -0000 1.20 --- Pencil.java 18 Nov 2007 20:32:47 -0000 1.21 *************** *** 14,18 **** import java.util.List; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.Geometry; --- 14,18 ---- import java.util.List; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.Geometry; *************** *** 31,35 **** * @param cursor Cursor */ ! public Pencil(GLView glv, Cursor cursor) { super(glv, cursor); dragging = false; --- 31,35 ---- * @param cursor Cursor */ ! public Pencil(Editor glv, Cursor cursor) { super(glv, cursor); dragging = false; Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Protractor.java 15 Nov 2007 13:07:41 -0000 1.14 --- Protractor.java 18 Nov 2007 20:32:47 -0000 1.15 *************** *** 15,19 **** import javax.media.opengl.GL; ! import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.GlObject; import net.sourceforge.bprocessor.gl.model.Intersection; --- 15,19 ---- import javax.media.opengl.GL; ! import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.GlObject; import net.sourceforge.bprocessor.gl.model.Intersection; *************** *** 46,50 **** * @param cursor Cursor */ ! public Protractor(GLView glv, Cursor cursor) { super(glv, cursor); } --- 46,50 ---- * @param cursor Cursor */ ! public Protractor(Editor glv, Cursor cursor) { super(glv, cursor); } |
From: Michael L. <he...@us...> - 2007-11-18 20:25:30
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22345/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: some refactoring Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Command.java 18 Nov 2007 19:14:40 -0000 1.31 --- Command.java 18 Nov 2007 20:25:33 -0000 1.32 *************** *** 914,918 **** public static List<Edge> order(List<Edge> edges) { LinkedList<Edge> ordered = new LinkedList(); ! { Set<Edge> mark = new HashSet(); Edge first = edges.get(0); --- 914,918 ---- public static List<Edge> order(List<Edge> edges) { LinkedList<Edge> ordered = new LinkedList(); ! if (edges.size() > 0) { Set<Edge> mark = new HashSet(); Edge first = edges.get(0); *************** *** 1061,1065 **** } ! { List<Vertex> vertices = Offset.vertices(boundary); Vertex normal = Surface.normalOf(boundary); --- 1061,1065 ---- } ! if (boundary.size() > 0) { List<Vertex> vertices = Offset.vertices(boundary); Vertex normal = Surface.normalOf(boundary); *************** *** 1073,1084 **** Space union = new Space("Union", Space.CONSTRUCTION, true); - List<Edge> offset = Offset.offset(boundary, inside + outside - (delta / 2)); ! Surface exterior = new Surface(offset); List<Surface> interior = new LinkedList(); for (Surface current : surfaces) { interior.add(new Surface(Offset.offset(current.getEdges(), -delta / 2))); } ! union.insert(exterior); for (Surface current : interior) { union.insert(current); --- 1073,1088 ---- Space union = new Space("Union", Space.CONSTRUCTION, true); ! if (boundary.size() > 0) { ! List<Edge> offset = Offset.offset(boundary, inside + outside - (delta / 2)); ! Surface exterior = new Surface(offset); ! union.insert(exterior); ! } ! List<Surface> interior = new LinkedList(); for (Surface current : surfaces) { interior.add(new Surface(Offset.offset(current.getEdges(), -delta / 2))); } ! for (Surface current : interior) { union.insert(current); |
From: Michael L. <he...@us...> - 2007-11-18 20:25:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22311/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Removed Files: GLColorMenuActionListener.java Log Message: some refactoring Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** GLView.java 27 Sep 2007 10:48:53 -0000 1.65 --- GLView.java 18 Nov 2007 20:25:27 -0000 1.66 *************** *** 17,21 **** import net.sourceforge.bprocessor.gui.GUI; ! import java.awt.Component; import java.awt.Cursor; import java.awt.Dimension; --- 17,21 ---- import net.sourceforge.bprocessor.gui.GUI; ! import java.awt.Color; import java.awt.Cursor; import java.awt.Dimension; *************** *** 34,37 **** --- 34,38 ---- import javax.swing.BorderFactory; + import javax.swing.JColorChooser; import javax.swing.JComboBox; import javax.swing.JSeparator; *************** *** 90,94 **** JPanel jp = new JPanel(); jp.setLayout(new BorderLayout()); ! jp.add((Component) glc, BorderLayout.CENTER); jp.setMinimumSize(new Dimension(320, 240)); jp.setPreferredSize(new Dimension(640, 480)); --- 91,95 ---- JPanel jp = new JPanel(); jp.setLayout(new BorderLayout()); ! jp.add(glc, BorderLayout.CENTER); jp.setMinimumSize(new Dimension(320, 240)); jp.setPreferredSize(new Dimension(640, 480)); *************** *** 137,141 **** JMenu colorMenu = new JMenu("GL Colors"); ! ActionListener colorMenuListener = new GLColorMenuActionListener(view); JMenuItem gridItem = new JMenuItem("Grid Color"); gridItem.addActionListener(colorMenuListener); --- 138,199 ---- JMenu colorMenu = new JMenu("GL Colors"); ! ActionListener colorMenuListener = new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! if (e.getActionCommand().equals("Grid Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Grid Color", ! new Color(View.getGridColor()[0], ! View.getGridColor()[1], ! View.getGridColor()[2])); ! if (newColor != null) { ! View.setGridColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Line Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Line Color", ! new Color(View.getLineColor()[0], ! View.getLineColor()[1], ! View.getLineColor()[2])); ! if (newColor != null) { ! View.setLineColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Constructor Line Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Constructor Line Color", ! new Color(View.getConstructorColor()[0], ! View.getConstructorColor()[1], ! View.getConstructorColor()[2])); ! if (newColor != null) { ! View.setConstructorColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Background Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Background Color", ! new Color(View.getBgColor()[0], ! View.getBgColor()[1], ! View.getBgColor()[2])); ! if (newColor != null) { ! View.setBGColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("None Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "None Color", ! new Color(View.getNoneColor()[0], ! View.getNoneColor()[1], ! View.getNoneColor()[2])); ! if (newColor != null) { ! View.setNoneColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Default")) { ! View.setBGColor(View.BACKGROUND_COLOR); ! View.setGridColor(View.GRID_COLOR); ! View.setLineColor(View.STD_LINE_COLOR); ! View.setNoneColor(View.NONE_COLOR); ! View.setConstructorColor(View.CONSTRUCTOR_COLOR); ! } ! ! } ! ! }; JMenuItem gridItem = new JMenuItem("Grid Color"); gridItem.addActionListener(colorMenuListener); *************** *** 321,325 **** public void popup(JPopupMenu pp, int x, int y) { if (pp != null) { ! pp.show((Component) glc, x, y); } } --- 379,383 ---- public void popup(JPopupMenu pp, int x, int y) { if (pp != null) { ! pp.show(glc, x, y); } } --- GLColorMenuActionListener.java DELETED --- |
From: Michael L. <he...@us...> - 2007-11-18 19:14:44
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23509/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: frame command Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Command.java 16 Nov 2007 14:26:29 -0000 1.30 --- Command.java 18 Nov 2007 19:14:40 -0000 1.31 *************** *** 668,677 **** Collection<Surface> sides = new LinkedList(); Surface top = s0.extrusion(d, sides); ! Space world = Project.getInstance().world(); ! world.insert(s0); ! for (Surface current : sides) { ! world.insert(current); } ! world.insert(top); } } --- 668,694 ---- Collection<Surface> sides = new LinkedList(); Surface top = s0.extrusion(d, sides); ! ! Space union = new Space("Union", Space.CONSTRUCTION, true); ! Collection<Surface> surfaces = new LinkedList(); ! surfaces.add(s0); ! surfaces.addAll(sides); ! surfaces.add(top); ! ! Collection<Edge> edges = Surface.edges(surfaces); ! Collection<Vertex> vertices = Edge.vertices(edges); ! ! for (Vertex current : vertices) { ! union.add(current); } ! ! for (Edge current : edges) { ! union.add(current); ! } ! ! for (Surface current : surfaces) { ! union.add(current); ! } ! ! Project.getInstance().getActiveSpace().add(union); } } *************** *** 825,829 **** ! private List<Vertex> offset(List<Vertex> vertices, Vertex normal, double distance) { List<Vertex> result = new LinkedList(); int n = vertices.size(); --- 842,846 ---- ! private static List<Vertex> offset(List<Vertex> vertices, Vertex normal, double distance) { List<Vertex> result = new LinkedList(); int n = vertices.size(); *************** *** 867,871 **** } ! private List<Vertex> vertices(List<Edge> edges) { List<Vertex> vertices = new ArrayList(); if (edges.size() > 1) { --- 884,888 ---- } ! private static List<Vertex> vertices(List<Edge> edges) { List<Vertex> vertices = new ArrayList(); if (edges.size() > 1) { *************** *** 948,952 **** } ! private List<Edge> offset(List<Edge> edges, double distance) { List<Edge> contour = new LinkedList(); { --- 965,975 ---- } ! /** ! * ! * @param edges edges ! * @param distance distance ! * @return list of edges ! */ ! public static List<Edge> offset(List<Edge> edges, double distance) { List<Edge> contour = new LinkedList(); { *************** *** 988,990 **** --- 1011,1089 ---- } } + + /** + * + */ + public static class Frame extends Command { + private Space net; + + /** + * Constructs a frame command + * @param net Space + */ + public Frame(Space net) { + this.net = net; + parameters.put("outside-frame", 1.0); + parameters.put("inside-frame", 1.0); + parameters.put("interior", 1.0); + parameters.put("depth", 1.0); + } + + /** {@inheritDoc} */ + @Override + public void evaluate() { + double outside = parameters.getDouble("outside-frame"); + double inside = parameters.getDouble("inside-frame"); + double delta = parameters.getDouble("interior"); + + + List<Surface> surfaces = new LinkedList(); + + { + HashMap map = new HashMap(); + for (Surface current : net.getSurfaces()) { + surfaces.add((Surface) current.copy(map)); + } + } + List<Edge> boundary = new LinkedList(); + + { + Inverse inv = new Inverse(surfaces); + + for (Edge current : inv.edges()) { + Collection<Surface> adjacant = inv.surfaces(current); + if (adjacant.size() == 1) { + boundary.add(current); + } + } + + boundary = Offset.order(boundary); + } + + { + List<Vertex> vertices = Offset.vertices(boundary); + Vertex normal = Surface.normalOf(boundary); + List<Vertex> offset = Offset.offset(vertices, normal, -inside + (delta / 2)); + for (int i = 0; i < vertices.size(); i++) { + Vertex original = vertices.get(i); + Vertex other = offset.get(i); + original.set(other); + } + } + + Space union = new Space("Union", Space.CONSTRUCTION, true); + List<Edge> offset = Offset.offset(boundary, inside + outside - (delta / 2)); + + Surface exterior = new Surface(offset); + List<Surface> interior = new LinkedList(); + for (Surface current : surfaces) { + interior.add(new Surface(Offset.offset(current.getEdges(), -delta / 2))); + } + union.insert(exterior); + for (Surface current : interior) { + union.insert(current); + } + net.getOwner().add(union); + } + } } |
From: Michael L. <he...@us...> - 2007-11-18 19:14:40
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23501/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: frame command Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** PopupMenu.java 16 Nov 2007 14:26:26 -0000 1.72 --- PopupMenu.java 18 Nov 2007 19:14:36 -0000 1.73 *************** *** 199,203 **** menu.addSeparator(); ! AbstractAction copy = new CollectionMenuAction(s, "Duplicate") { public void actionPerformed(ActionEvent arg0) { --- 199,239 ---- menu.addSeparator(); ! ! { ! AbstractAction action = new CollectionMenuAction(s, "Dissolve") { ! public void actionPerformed(ActionEvent event) { ! List<Space> spaces = new LinkedList(col); ! for (Space space : spaces) { ! Collection<Vertex> vertices = new LinkedList(space.getVertices()); ! Collection<Edge> edges = new LinkedList(space.getEdges()); ! Collection<Surface> surfaces = new LinkedList(space.getSurfaces()); ! ! for (Vertex current : vertices) { ! space.remove(current); ! } ! for (Vertex current : vertices) { ! space.getOwner().insert(current); ! } ! for (Edge current : edges) { ! space.remove(current); ! } ! for (Edge current : edges) { ! space.getOwner().insert(current); ! } ! ! for (Surface current : surfaces) { ! space.remove(current); ! current.setBackDomain(null); ! current.setFrontDomain(null); ! } ! for (Surface current : surfaces) { ! space.getOwner().insert(current); ! } ! ! } ! } ! }; ! menu.add(action); ! } AbstractAction copy = new CollectionMenuAction(s, "Duplicate") { public void actionPerformed(ActionEvent arg0) { *************** *** 260,263 **** --- 296,309 ---- menu.add(action); } + { + AbstractAction action = new SpaceMenuAction(sp, "Frame..") { + public void actionPerformed(ActionEvent event) { + Command command = new Command.Frame(space); + AttributeView.instance().display(command); + } + }; + menu.add(action); + } + if (CHECKS) { AbstractAction envelope = new SpaceMenuAction(sp, "Compute Envelope") { |
From: Michael L. <he...@us...> - 2007-11-16 14:26:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10679/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: offset command improved Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Command.java 16 Nov 2007 13:15:08 -0000 1.29 --- Command.java 16 Nov 2007 14:26:29 -0000 1.30 *************** *** 882,894 **** } } } return vertices; } private List<Edge> offset(List<Edge> edges, double distance) { List<Edge> contour = new LinkedList(); { List<Vertex> vertices = vertices(edges); ! Vertex normal = Surface.normalOf(edges); if (vertices.size() > 2) { List<Vertex> result = offset(vertices, normal, distance); --- 882,962 ---- } } + } else { + Edge e0 = edges.get(0); + vertices.add(e0.from); + vertices.add(e0.to); } return vertices; } + /** + * Order a list of edges + * @param edges list of edges + * @return orderd list of edges + */ + public static List<Edge> order(List<Edge> edges) { + LinkedList<Edge> ordered = new LinkedList(); + { + Set<Edge> mark = new HashSet(); + Edge first = edges.get(0); + ordered.add(first); + mark.add(first); + + { + Vertex to = first.getTo(); + boolean working = true; + while (working) { + search: + for (Edge current : edges) { + working = false; + if (!mark.contains(current)) { + if (current.contains(to)) { + ordered.addLast(current); + mark.add(current); + to = current.otherVertex(to); + working = true; + break search; + } + } + } + } + } + { + Vertex from = first.getFrom(); + boolean working = true; + while (working) { + search: + for (Edge current : edges) { + working = false; + if (!mark.contains(current)) { + if (current.contains(from)) { + ordered.addFirst(current); + mark.add(current); + from = current.otherVertex(from); + working = true; + break search; + } + } + } + } + } + if (mark.size() < edges.size()) { + return null; + } + } + return ordered; + } + private List<Edge> offset(List<Edge> edges, double distance) { List<Edge> contour = new LinkedList(); { List<Vertex> vertices = vertices(edges); ! Vertex normal; ! if (edges.size() > 1) { ! normal = Surface.normalOf(edges); ! } else { ! normal = Project.getInstance().getActiveCoordinateSystem().getN(); ! } ! if (vertices.size() > 2) { List<Vertex> result = offset(vertices, normal, distance); *************** *** 913,918 **** public void evaluate() { double distance = parameters.getDouble("distance"); ! List<Edge> contour = offset(edges, distance); ! Geometry.insertEdges(contour); } } --- 981,989 ---- public void evaluate() { double distance = parameters.getDouble("distance"); ! List<Edge> ordered = order(edges); ! if (ordered != null) { ! List<Edge> contour = offset(ordered, distance); ! Geometry.insertEdges(contour); ! } } } |
From: Michael L. <he...@us...> - 2007-11-16 14:26:31
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10665/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: offset command improved Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** PopupMenu.java 16 Nov 2007 13:15:04 -0000 1.71 --- PopupMenu.java 16 Nov 2007 14:26:26 -0000 1.72 *************** *** 12,15 **** --- 12,16 ---- import java.util.Iterator; import java.util.LinkedList; + import java.util.List; import java.util.Set; *************** *** 125,135 **** public static JPopupMenu getEdgeMenu(Collection edges) { JPopupMenu menu = getGeometricMenu(edges); ! AbstractAction action = new GeometricMenuAction(edges, "Split...") { ! public void actionPerformed(ActionEvent event) { ! Command command = new Command.Split((Edge) entities.iterator().next()); ! AttributeView.instance().display(command); ! } ! }; ! menu.add(action); return menu; } --- 126,157 ---- public static JPopupMenu getEdgeMenu(Collection edges) { JPopupMenu menu = getGeometricMenu(edges); ! { ! AbstractAction action = new GeometricMenuAction(edges, "Split...") { ! public void actionPerformed(ActionEvent event) { ! Command command = new Command.Split((Edge) entities.iterator().next()); ! AttributeView.instance().display(command); ! } ! }; ! menu.add(action); ! } ! { ! AbstractAction action = new GeometricMenuAction(edges, "Offset...") { ! public void actionPerformed(ActionEvent event) { ! LinkedList<Edge> edges = new LinkedList(entities); ! if (edges.size() > 1) { ! List<Edge> ordered = Command.Offset.order(edges); ! if (ordered != null) { ! Command command = new Command.Offset(ordered); ! AttributeView.instance().display(command); ! } else { ! GUI.getInstance().alert("Select a connected set of edges"); ! } ! } else { ! GUI.getInstance().alert("Select more than one edge"); ! } ! } ! }; ! menu.add(action); ! } return menu; } |
From: Michael L. <he...@us...> - 2007-11-16 13:15:14
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15238/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: offset command Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Command.java 13 Nov 2007 12:19:29 -0000 1.28 --- Command.java 16 Nov 2007 13:15:08 -0000 1.29 *************** *** 331,335 **** } ! private Vertex average(Collection<Vertex> vertices) { double x = 0; double y = 0; --- 331,340 ---- } ! /** ! * Compute the average of a collection of vertices ! * @param vertices collection of vertices ! * @return average ! */ ! public static Vertex average(Collection<Vertex> vertices) { double x = 0; double y = 0; *************** *** 803,805 **** --- 808,919 ---- } } + + /** + * Offset command + */ + public static class Offset extends Command { + private List<Edge> edges; + + /** + * Constructs an Offset command + * @param edges list of edges + */ + public Offset(List<Edge> edges) { + this.edges = edges; + parameters.put("distance", 1.0); + } + + + private List<Vertex> offset(List<Vertex> vertices, Vertex normal, double distance) { + List<Vertex> result = new LinkedList(); + int n = vertices.size(); + for (int i = 0; i < n; i++) { + Vertex current = vertices.get(i); + Vertex p; + Vertex q; + if (i == 0) { + p = vertices.get(n - 1); + } else { + p = vertices.get(i - 1); + } + if (i == n - 1) { + q = vertices.get(0); + } else { + q = vertices.get(i + 1); + } + + Vertex u = p.minus(current); + u.normalize(); + Vertex v = q.minus(current); + v.normalize(); + + Vertex direction = u.add(v); + if (direction.isZero()) { + direction = normal.cross(u); + } else { + Vertex cross = u.cross(direction); + double sign = normal.dot(cross); + if (sign < 0) { + sign = -1; + } else { + sign = 1; + } + direction = direction.scale(sign / cross.length()); + } + + result.add(current.add(direction.scale(distance))); + } + return result; + } + + private List<Vertex> vertices(List<Edge> edges) { + List<Vertex> vertices = new ArrayList(); + if (edges.size() > 1) { + Edge e0 = edges.get(0); + Edge e1 = edges.get(1); + Vertex v1 = Edge.commonVertex(e0, e1); + Vertex v0 = e0.otherVertex(v1); + Vertex vertex = v0; + vertices.add(vertex); + for (Edge current : edges) { + vertex = current.otherVertex(vertex); + if (vertex != v0) { + vertices.add(vertex); + } + } + } + return vertices; + } + + private List<Edge> offset(List<Edge> edges, double distance) { + List<Edge> contour = new LinkedList(); + { + List<Vertex> vertices = vertices(edges); + Vertex normal = Surface.normalOf(edges); + if (vertices.size() > 2) { + List<Vertex> result = offset(vertices, normal, distance); + Map<Vertex, Vertex> vmap = new HashMap(); + for (int i = 0; i < vertices.size(); i++) { + Vertex original = vertices.get(i); + Vertex offset = result.get(i); + vmap.put(original, offset); + } + for (Edge current : edges) { + Vertex from = vmap.get(current.from); + Vertex to = vmap.get(current.to); + contour.add(new Edge(from, to)); + } + } + } + return contour; + } + + /** {@inheritDoc} */ + @Override + public void evaluate() { + double distance = parameters.getDouble("distance"); + List<Edge> contour = offset(edges, distance); + Geometry.insertEdges(contour); + } + } } |
From: Michael L. <he...@us...> - 2007-11-16 13:15:13
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15113/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: offset command Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** PopupMenu.java 12 Nov 2007 08:05:30 -0000 1.70 --- PopupMenu.java 16 Nov 2007 13:15:04 -0000 1.71 *************** *** 95,105 **** menu.add(flip); ! AbstractAction action = new GeometricMenuAction(surfaces, "Smooth...") { ! public void actionPerformed(ActionEvent event) { ! Command command = new Command.Smooth((Surface) entities.iterator().next()); ! AttributeView.instance().display(command); ! } ! }; ! menu.add(action); } return menu; --- 95,117 ---- menu.add(flip); ! { ! AbstractAction action = new GeometricMenuAction(surfaces, "Smooth...") { ! public void actionPerformed(ActionEvent event) { ! Command command = new Command.Smooth((Surface) entities.iterator().next()); ! AttributeView.instance().display(command); ! } ! }; ! menu.add(action); ! } ! { ! AbstractAction action = new GeometricMenuAction(surfaces, "Offset...") { ! public void actionPerformed(ActionEvent event) { ! Surface surface = (Surface) entities.iterator().next(); ! Command command = new Command.Offset(surface.getEdges()); ! AttributeView.instance().display(command); ! } ! }; ! menu.add(action); ! } } return menu; |