bprocessor-commit Mailing List for B-processor (Page 58)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: rimestad <rim...@us...> - 2007-08-06 12:07:48
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26323 Modified Files: build.xml Log Message: fixed compilation so that the missing xml file are found and the refelction arn't told that the private methods in gui are public Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** build.xml 11 Jun 2007 06:57:22 -0000 1.30 --- build.xml 6 Aug 2007 12:07:43 -0000 1.31 *************** *** 53,57 **** <copy todir="${release.dir}"> <fileset dir="${bproc.dir}"> ! <include name="*.txt"/> </fileset> </copy> --- 53,57 ---- <copy todir="${release.dir}"> <fileset dir="${bproc.dir}"> ! <include name="*.xml"/> </fileset> </copy> *************** *** 60,70 **** <include name="**/*"/> </fileset> - </copy> - <copy todir="${release.dir}"> <fileset dir="${kernel.dir}/dist"> <include name="**/*"/> </fileset> - </copy> - <copy todir="${release.dir}"> <fileset dir="${rdoc.dir}"> <include name="**/*"/> --- 60,66 ---- |
From: rimestad <rim...@us...> - 2007-08-06 12:07:48
|
Update of /cvsroot/bprocessor/gui/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26334/src/etc Modified Files: plugin.xml Log Message: fixed compilation so that the missing xml file are found and the refelction arn't told that the private methods in gui are public Index: plugin.xml =================================================================== RCS file: /cvsroot/bprocessor/gui/src/etc/plugin.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** plugin.xml 27 Jun 2005 09:32:23 -0000 1.1.1.1 --- plugin.xml 6 Aug 2007 12:07:47 -0000 1.2 *************** *** 2,13 **** <plugin> <main-class>net.sourceforge.bprocessor.gui.GUI</main-class> - <method> - <name>createMenus</name> - </method> - <method> - <name>createMainView</name> - </method> - <method> - <name>start</name> - </method> </plugin> --- 2,4 ---- |
From: rimestad <rim...@us...> - 2007-08-06 12:07:45
|
Update of /cvsroot/bprocessor/kernel/src/net/sourceforge/bprocessor/kernel In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26305/src/net/sourceforge/bprocessor/kernel Modified Files: Main.java Log Message: fixed compilation so that the missing xml file are found and the refelction arn't told that the private methods in gui are public Index: Main.java =================================================================== RCS file: /cvsroot/bprocessor/kernel/src/net/sourceforge/bprocessor/kernel/Main.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Main.java 31 Aug 2006 13:01:43 -0000 1.2 --- Main.java 6 Aug 2007 12:07:39 -0000 1.3 *************** *** 215,227 **** PropertyConfigurator.configure("log4j.properties"); } log.info("Kernel starting."); String version = System.getProperty("java.version"); ! if (version.compareTo("1.4") >= 0) { Main main = new Main(); main.loadConfiguration(); } else { ! log.fatal("Kernel requires Java Runtime Environment 1.4 or greater to run."); } } --- 215,229 ---- PropertyConfigurator.configure("log4j.properties"); + } else { + System.out.println("log4j configuration file missing"); } log.info("Kernel starting."); String version = System.getProperty("java.version"); ! if (version.compareTo("1.5") >= 0) { Main main = new Main(); main.loadConfiguration(); } else { ! log.fatal("Kernel requires Java Runtime Environment 1.5 or greater to run."); } } |
From: rimestad <rim...@us...> - 2007-08-06 12:07:45
|
Update of /cvsroot/bprocessor/kernel In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26305 Modified Files: build.xml Log Message: fixed compilation so that the missing xml file are found and the refelction arn't told that the private methods in gui are public Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/kernel/build.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** build.xml 2 Jan 2007 17:27:17 -0000 1.6 --- build.xml 6 Aug 2007 12:07:39 -0000 1.7 *************** *** 138,141 **** --- 138,144 ---- <include name="**/*.jar"/> </fileset> + <fileset dir="${conf.dir}"> + <include name="log4j.properties"/> + </fileset> </copy> </target> |
From: Michael L. <he...@us...> - 2007-07-26 09:52:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9000/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java Log Message: Bugfix: surface-analysis should delete instead of remove surfaces Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** ExtrusionTool.java 25 Jul 2007 12:44:29 -0000 1.62 --- ExtrusionTool.java 26 Jul 2007 09:52:27 -0000 1.63 *************** *** 105,109 **** Space space = Project.getInstance().getActiveSpace(); if (extrusion != null) { - space.removeProtected(extrusion); space.computeNextId(); --- 105,108 ---- *************** *** 114,117 **** --- 113,117 ---- Set<Surface> tops = new HashSet<Surface>(); Surface top = null; + if (plane == null) { if (all) { *************** *** 307,311 **** --- 307,313 ---- } + if (start == null) { + if (!Selection.primary().isEmpty()) { extrudeEdges = new ArrayList<Edge>(); |
From: Michael L. <he...@us...> - 2007-07-26 09:52:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9013/src/net/sourceforge/bprocessor/model Modified Files: SurfaceAnalysis.java Space.java Log Message: Bugfix: surface-analysis should delete instead of remove surfaces Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** Space.java 25 Jul 2007 12:44:33 -0000 1.164 --- Space.java 26 Jul 2007 09:52:32 -0000 1.165 *************** *** 2829,2831 **** --- 2829,2844 ---- return a; } + + /** + * Verify that everything is OK + */ + public void verify() { + for (Space space : getElements()) { + for (Surface surface : space.getEnvelope()) { + if (surface.getOwner() == null) { + System.out.println(" NOT OK"); + } + } + } + } } Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SurfaceAnalysis.java 2 May 2007 11:39:50 -0000 1.9 --- SurfaceAnalysis.java 26 Jul 2007 09:52:32 -0000 1.10 *************** *** 159,163 **** Collection<Surface> surfaces = new LinkedList(space.getSurfaces()); for (Surface current : surfaces) { ! space.remove(current); } } --- 159,163 ---- Collection<Surface> surfaces = new LinkedList(space.getSurfaces()); for (Surface current : surfaces) { ! current.delete(); } } *************** *** 274,278 **** } for (Surface current : removed) { ! space.remove(current); } for (Surface current : added) { --- 274,278 ---- } for (Surface current : removed) { ! current.delete(); } for (Surface current : added) { |
From: Michael L. <he...@us...> - 2007-07-25 12:44:38
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21756/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Fors¿g p bugfix Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -d -r1.163 -r1.164 *** Space.java 23 Jul 2007 13:58:10 -0000 1.163 --- Space.java 25 Jul 2007 12:44:33 -0000 1.164 *************** *** 2235,2238 **** --- 2235,2246 ---- if (surface.getOwner() == this) { if (surface.protect()) { + Space back = surface.getBackDomain(); + if (back != null) { + back.removeSurface(surface); + } + Space front = surface.getFrontDomain(); + if (front != null) { + front.removeSurface(surface); + } remove(surface); } |
From: Michael L. <he...@us...> - 2007-07-25 12:44:35
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21748/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java Log Message: Fors¿g p bugfix Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** ExtrusionTool.java 21 Jun 2007 10:01:06 -0000 1.61 --- ExtrusionTool.java 25 Jul 2007 12:44:29 -0000 1.62 *************** *** 105,108 **** --- 105,109 ---- Space space = Project.getInstance().getActiveSpace(); if (extrusion != null) { + space.removeProtected(extrusion); space.computeNextId(); |
From: Michael L. <he...@us...> - 2007-07-24 10:37:57
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv731/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Removed delay when selecting surface Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.222 retrieving revision 1.223 diff -C2 -d -r1.222 -r1.223 *** View.java 9 Jul 2007 13:30:40 -0000 1.222 --- View.java 24 Jul 2007 09:46:42 -0000 1.223 *************** *** 390,393 **** --- 390,394 ---- private Timer tickler; + private static final boolean TICKLE = false; private boolean debug = false; *************** *** 1936,1953 **** Geometric candidate = selection.iterator().next(); if (candidate instanceof Surface) { ! long time = System.currentTimeMillis(); ! long elapsed = time - AbstractTool.getPressedTime(); ! long delay = 0; ! if (labelSurface == null) { ! delay = 120; ! } ! if (elapsed >= delay) { labelSurface = (Surface) candidate; labelSurface(labelSurface, clickable); - } else { - int when = (int) (delay - elapsed); - tickler.stop(); - tickler.setDelay(when); - tickler.start(); } } else { --- 1937,1959 ---- Geometric candidate = selection.iterator().next(); if (candidate instanceof Surface) { ! if (TICKLE) { ! long time = System.currentTimeMillis(); ! long elapsed = time - AbstractTool.getPressedTime(); ! long delay = 0; ! if (labelSurface == null) { ! delay = 120; ! } ! if (elapsed >= delay) { ! labelSurface = (Surface) candidate; ! labelSurface(labelSurface, clickable); ! } else { ! int when = (int) (delay - elapsed); ! tickler.stop(); ! tickler.setDelay(when); ! tickler.start(); ! } ! } else { labelSurface = (Surface) candidate; labelSurface(labelSurface, clickable); } } else { |
From: rimestad <rim...@us...> - 2007-07-23 14:37:30
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18117/src/net/sourceforge/bprocessor/model Modified Files: Space.java Attribute.java Persistence.java Classification.java ClassificationType.java Project.java ClassificationFileReader.java Added Files: Structure.java Log Message: Made a superclass to Classification and ClassificationType called Structure and made all uses reflect that... Index: ClassificationFileReader.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClassificationFileReader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClassificationFileReader.java 26 Jun 2007 10:56:54 -0000 1.2 --- ClassificationFileReader.java 23 Jul 2007 13:58:13 -0000 1.3 *************** *** 90,94 **** //classificationTypes currentClassificationType = new ClassificationType(tokens[4], 0.0, 0.0, 0.0); ! superClassificationType.addSubType(currentClassificationType); continue; } --- 90,94 ---- //classificationTypes currentClassificationType = new ClassificationType(tokens[4], 0.0, 0.0, 0.0); ! superClassificationType.addChild(currentClassificationType); continue; } *************** *** 99,103 **** //subtypes if (currentClassificationType != null) { ! currentClassificationType.addSubType( new ClassificationType(tokens[5], 0.0, 0.0, 0.0)); } else { --- 99,103 ---- //subtypes if (currentClassificationType != null) { ! currentClassificationType.addChild( new ClassificationType(tokens[5], 0.0, 0.0, 0.0)); } else { Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Classification.java 26 Jun 2007 10:56:54 -0000 1.19 --- Classification.java 23 Jul 2007 13:58:13 -0000 1.20 *************** *** 10,14 **** import java.util.Iterator; import java.util.List; - import java.util.Vector; import org.apache.log4j.Logger; --- 10,13 ---- *************** *** 17,36 **** * This class persist the model from/to an XML document */ ! public class Classification implements Parametric { /** The logger */ private static Logger log = Logger.getLogger(Classification.class); - /** The name of the classification */ - private String name; - /** The id of the classification */ private String id; - /** The children of this classification */ - private Vector<Classification> children; - - /** The parent of this classification */ - private Classification parent; - /** The classification */ private ClassificationType possibleTypes; --- 16,26 ---- * This class persist the model from/to an XML document */ ! public class Classification extends Structure<Classification> implements Parametric { /** The logger */ private static Logger log = Logger.getLogger(Classification.class); /** The id of the classification */ private String id; /** The classification */ private ClassificationType possibleTypes; *************** *** 75,103 **** */ public Classification() { ! children = new Vector<Classification>(); ! } ! ! /** ! * Get the vector containing this classifications children ! * @return the children ! */ ! public Vector<Classification> getChildren() { ! return children; ! } ! ! /** ! * Get the name of this classification ! * @return the name ! */ ! public String getName() { ! return name; ! } ! ! /** ! * Sets the name of the classification ! * @param name the new name for the classification ! */ ! public void setName (String name) { ! this.name = name; } --- 65,69 ---- */ public Classification() { ! super(); } *************** *** 119,147 **** /** - * Adds a child to the classification - * @param child the child to be added - */ - public void addChild(Classification child) { - children.add(child); - } - - /** - * Returns the parent of this classification - * @return the parent - */ - public Classification getParent() { - return parent; - } - - /** - * Set the parent of this classification - * @param parent the new parent - */ - public void setParent(Classification parent) { - this.parent = parent; - } - - - /** * Generates the full id for this classification * @param cur the Space that the full id is generated for --- 85,88 ---- *************** *** 152,162 **** String fullId = id; if (current != null && current.getClassificationType() != null) { ! if (!("" + fullId.charAt(0)).equalsIgnoreCase("-")) { ! fullId = current.getClassificationType().getName(); } else { ! fullId = "-" + current.getClassificationType().getName() + fullId.replaceFirst("-", ""); ! } } ! Classification par = parent; if (par != null) { if (cur != null && cur.getOwner().getLevel() != Space.PROJECT_LEVEL) { --- 93,104 ---- String fullId = id; if (current != null && current.getClassificationType() != null) { ! /*if (!("" + fullId.charAt(0)).equalsIgnoreCase("-")) { ! fullId = current.getClassificationType().getPrefix(); } else { ! fullId = "-" + current.getClassificationType().getPrefix() + fullId.replaceFirst("-", ""); ! }*/ ! fullId = "-" + current.getClassificationType().getPrefix() + fullId.replaceFirst("-", ""); } ! Classification par = getParent(); if (par != null) { if (cur != null && cur.getOwner().getLevel() != Space.PROJECT_LEVEL) { *************** *** 185,189 **** */ public String toString() { ! return name; } --- 127,131 ---- */ public String toString() { ! return getName(); } *************** *** 229,233 **** res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Code", getFullId(null), false)); ! res.add(new Attribute("Type link", possibleTypes)); return res; } --- 171,175 ---- res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Code", getFullId(null), false)); ! res.add(new Attribute("Type link", possibleTypes, possibleTypes)); return res; } Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Persistence.java 28 Jun 2007 13:03:42 -0000 1.43 --- Persistence.java 23 Jul 2007 13:58:13 -0000 1.44 *************** *** 271,275 **** space.setUnion(xml.isUnion()); space.setClassification(internalizeClassifaction(xml.getClassification(), type)); ! mapper.put(new Long(xml.getId()), space); --- 271,278 ---- space.setUnion(xml.isUnion()); space.setClassification(internalizeClassifaction(xml.getClassification(), type)); ! ClassificationType classType = internalizeClassificationType(xml.getClassification(), type); ! if (classType != null) { ! space.setClassificationType(classType); ! } mapper.put(new Long(xml.getId()), space); *************** *** 370,373 **** --- 373,384 ---- } + private static ClassificationType internalizeClassificationType(String string, int type) { + if (type == Space.CONSTRUCTION) { + ClassificationType classType = Project.getInstance().findClassificationType(string, 0); + return classType; + } + return null; + } + /** * create model object of the xml *************** *** 1479,1486 **** private static XMLSpecificType externalizeClassificationType(ClassificationType type) { XMLSpecificType xml = new XMLSpecificTypeImpl(); - xml.setIndex(type.getIndex()); xml.setName(type.getName()); xml.setId(type.getId()); ! for (ClassificationType clasType : type.getSubTypes()) { if (clasType != null) { xml.getXMLSpecificType().add(Persistence.externalizeClassificationType(clasType)); --- 1490,1497 ---- private static XMLSpecificType externalizeClassificationType(ClassificationType type) { XMLSpecificType xml = new XMLSpecificTypeImpl(); xml.setName(type.getName()); xml.setId(type.getId()); ! xml.setIndex(type.getIndex()); ! for (ClassificationType clasType : type.getChildren()) { if (clasType != null) { xml.getXMLSpecificType().add(Persistence.externalizeClassificationType(clasType)); *************** *** 1490,1494 **** } Map map = new HashMap(); ! for (Attribute a : type.getParameters()) { xml.getAttributes().add(externalizeKeyValue(a.getName(), a.getValue(), map)); } --- 1501,1505 ---- } Map map = new HashMap(); ! for (Attribute a : type.getAllParameters().values()) { xml.getAttributes().add(externalizeKeyValue(a.getName(), a.getValue(), map)); } *************** *** 1508,1512 **** XMLSpecificTypeType rootType = xml.getXMLSpecificType(); Map<Long, ClassificationType> typeMap = new HashMap<Long, ClassificationType>(); ! internalizeTypes(rootType, typeMap); Classification construction = internalizeClassification( (XMLClassificationType)xml.getXMLClassification().get(0), typeMap, Space.CONSTRUCTION); --- 1519,1525 ---- XMLSpecificTypeType rootType = xml.getXMLSpecificType(); Map<Long, ClassificationType> typeMap = new HashMap<Long, ClassificationType>(); ! for (XMLSpecificTypeType specType : (List<XMLSpecificTypeType>)rootType.getXMLSpecificType()) { ! internalizeTypes(specType, typeMap); ! } Classification construction = internalizeClassification( (XMLClassificationType)xml.getXMLClassification().get(0), typeMap, Space.CONSTRUCTION); *************** *** 1533,1538 **** if (classiType != null) { res.setPossibleTypes(classiType); - } else { - log.error("There were no classificationType associated with " + res + " in the XML"); } for (XMLClassificationType subType : --- 1546,1549 ---- *************** *** 1571,1575 **** for (XMLSpecificTypeType subType : (List<XMLSpecificTypeType>)type.getXMLSpecificType()) { ClassificationType out = internalizeTypes(subType, map); ! res.addSubType(out); } map.put(res.getId(), res); --- 1582,1587 ---- for (XMLSpecificTypeType subType : (List<XMLSpecificTypeType>)type.getXMLSpecificType()) { ClassificationType out = internalizeTypes(subType, map); ! res.addChild(out); ! res.setParent(res); } map.put(res.getId(), res); --- NEW FILE: Structure.java --- //--------------------------------------------------------------------------------- // $Id: Structure.java,v 1.1 2007/07/23 13:58:13 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; import java.util.Vector; /** * A super class for classes that need to point to others of itself * @param <Type> The class type that should be pointet to */ public class Structure <Type> { /** The children of this classification */ private Vector<Type> children; /** The parent of this classification */ private Type parent; private String name; /** * The constructor */ public Structure() { children = new Vector<Type>(); parent = null; } /** * @return the children */ public Vector<Type> getChildren() { return children; } /** * @param child the child to add */ public void addChild(Type child) { this.children.add(child); ((Structure<Type>)child).setParent((Type)this); } /** * @return the parent */ public Type getParent() { return parent; } /** * @param parent the parent to set */ public void setParent(Type parent) { this.parent = parent; } /** * Get the name of this classification * @return the name */ public String getName() { return name; } /** * Sets the name of the classification * @param name the new name for the classification */ 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.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** Project.java 26 Jun 2007 10:56:54 -0000 1.130 --- Project.java 23 Jul 2007 13:58:13 -0000 1.131 *************** *** 871,875 **** StringTokenizer st = new StringTokenizer(id, "."); Classification cl; ! if (type == 0) { cl = constructionClas; --- 871,875 ---- StringTokenizer st = new StringTokenizer(id, "."); Classification cl; ! if (type == Space.CONSTRUCTION) { cl = constructionClas; *************** *** 929,932 **** --- 929,990 ---- } + /** + * + * @param id The string to find the ClassificationType in + * @param type The Space type + * @return The found classification Type could be null (then it is just default) + */ + public ClassificationType findClassificationType(String id, int type) { + StringTokenizer st = new StringTokenizer(id, "."); + ClassificationType res = null; + Classification cl; + if (type == Space.CONSTRUCTION) { + cl = constructionClas; + + String curid; + while (st.hasMoreTokens()) { + curid = st.nextToken(); + if (("" + curid.charAt(0)).equalsIgnoreCase("-")) { + if (!Character.isDigit(curid.charAt(1))) { + if (cl.getPossibleTypes() != null && cl.getPossibleTypes().getChildren() != null) { + res = cl.getPossibleTypes().getChildren().get((int)'A' - (int)curid.charAt(1)); + } + if (!Character.isDigit(curid.charAt(2))) { + if (cl.getPossibleTypes() != null && cl.getPossibleTypes().getChildren() != null) { + res = res.getChildren().get((int)'A' - (int)curid.charAt(2)); + } + curid = "-" + curid.substring(3); + } else { + curid = "-" + curid.substring(2); + } + } + } else { + if (!Character.isDigit(curid.charAt(0))) { + if (cl.getPossibleTypes() != null && cl.getPossibleTypes().getChildren() != null) { + res = cl.getPossibleTypes().getChildren().get((int)'A' - (int)curid.charAt(1)); + } + if (!Character.isDigit(curid.charAt(1))) { + if (cl.getPossibleTypes() != null && cl.getPossibleTypes().getChildren() != null) { + res = res.getChildren().get((int)'A' - (int)curid.charAt(2)); + } + curid = curid.substring(2); + } else { + curid = curid.substring(1); + } + } + } + + Iterator it = cl.getChildren().iterator(); + while (it.hasNext()) { + Classification current = (Classification) it.next(); + if (curid.equalsIgnoreCase(current.getId())) { + cl = current; + } + } + } + } + return res; + } + /** * getter for the copy buffer Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Attribute.java 8 May 2007 12:35:38 -0000 1.20 --- Attribute.java 23 Jul 2007 13:58:11 -0000 1.21 *************** *** 25,34 **** private Object value; /** The name */ private String name; - /** The classification */ - private Classification classification; - /** The space the classification is for */ private Space level; --- 25,34 ---- private Object value; + /** The 2nd value object */ + private Object the2ndValue; + /** The name */ private String name; /** The space the classification is for */ private Space level; *************** *** 101,105 **** setName(name); setValue(value); ! setClassification(classification); setLevel(level); editable = true; --- 101,105 ---- setName(name); setValue(value); ! setThe2ndValue(classification); setLevel(level); editable = true; *************** *** 107,110 **** --- 107,125 ---- /** + * Constructor for Classification Attribute + * @param name The name + * @param rootClassification The outermost possible type + * @param selectedClassification The chosen type (can be null) + */ + public Attribute(String name, + ClassificationType rootClassification, + ClassificationType selectedClassification) { + setName(name); + setThe2ndValue(selectedClassification); + setValue(rootClassification); + editable = true; + } + + /** * @return Returns the name. */ *************** *** 133,150 **** this.precision = precision; } - - /** - * @return Returns the classification. - */ - public Classification getClassification() { - return classification; - } - - /** - * @param classification The classification to set. - */ - public void setClassification(Classification classification) { - this.classification = classification; - } /** --- 148,151 ---- *************** *** 237,239 **** --- 238,256 ---- public void delete() { } + + /** + * Getter for the2ndValue + * @return The the2ndValue + */ + public Object getThe2ndValue() { + return the2ndValue; + } + + /** + * Set the the2ndValue to the given object + * @param the2ndValue The 2nd value + */ + public void setThe2ndValue(Object the2ndValue) { + this.the2ndValue = the2ndValue; + } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** Space.java 20 Jul 2007 13:33:26 -0000 1.162 --- Space.java 23 Jul 2007 13:58:10 -0000 1.163 *************** *** 14,17 **** --- 14,18 ---- import java.util.HashSet; import java.util.Iterator; + import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; *************** *** 39,43 **** /** functional Type */ public static final int FUNCTIONAL = 1; - /** project level */ public static final int PROJECT_LEVEL = 2; --- 40,43 ---- *************** *** 60,64 **** private Set<Surface> envelope; ! /** type */ private int type; --- 60,64 ---- private Set<Surface> envelope; ! /** type of space */ private int type; *************** *** 80,84 **** private Classification classification; ! /** The classification */ private ClassificationType productType; --- 80,84 ---- private Classification classification; ! /** The classification type*/ private ClassificationType productType; *************** *** 142,145 **** --- 142,147 ---- private String room = "0"; + private Map<String, Attribute> ownParameters = new HashMap<String, Attribute>(); + /** * Constructor for persistence layer *************** *** 943,947 **** */ public void setClassification(Classification classification) { ! this.classification = classification; } --- 945,952 ---- */ public void setClassification(Classification classification) { ! if (classification != null) { ! this.classification = classification; ! setClassificationType(classification.getPossibleTypes()); ! } } *************** *** 1302,1316 **** setName((String)a.getValue()); } else if (a.getName().equals("Classification")) { ! if (getOwner() == Project.getInstance().world()) { ! setClassification(((Classification)a.getClassification())); ! } ! if (getLevel() == Space.ELEMENT_LEVEL) { ! setClassification(((Classification)a.getClassification())); ! } ! if (getLevel() == Space.PART_LEVEL) { ! setClassification(((Classification)a.getClassification())); ! } } else if (a.getName().equals("Type")) { ! //TODO make ClassificationType attributes } else if (a.getName().equals("Building")) { setBuilding(((String)a.getValue().toString())); --- 1307,1316 ---- setName((String)a.getValue()); } else if (a.getName().equals("Classification")) { ! setClassification(((Classification)a.getThe2ndValue())); } else if (a.getName().equals("Type")) { ! ClassificationType cst = (ClassificationType)a.getThe2ndValue(); ! if (getClassification().getPossibleTypes().isPossibleSubtype(cst)) { ! setClassificationType(cst); ! } } else if (a.getName().equals("Building")) { setBuilding(((String)a.getValue().toString())); *************** *** 1345,1391 **** } } else { ! ! if (getLevel() == Space.ELEMENT_LEVEL) { ! if (isConstructionSpace()) { ! if (getOwner().getClassification() != null) { ! res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification(), this)); ! } else { ! res.add(new Attribute("Classification", ! Project.getInstance().getConstructionClas(), getClassification(), this)); ! } } else { ! if (getOwner().getClassification() != null) { ! res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification(), this)); ! } else { ! res.add(new Attribute("Classification", ! Project.getInstance().getFunctionalClas(), getClassification(), this)); ! } } ! } else if (getLevel() == Space.PART_LEVEL) { ! if (isConstructionSpace()) { ! if (getOwner().getClassification() != null) { ! res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification(), this)); ! } else { ! res.add(new Attribute("Classification", ! Project.getInstance().getConstructionClas(), getClassification(), this)); ! } } else { ! if (getOwner().getClassification() != null) { ! res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification(), this)); ! } else { ! res.add(new Attribute("Classification", ! Project.getInstance().getFunctionalClas(), getClassification(), this)); ! } } } } if (getClassification() != null && getClassificationType() != null) { ! //TODO make classificationType attribute ! //res.add(new Attribute("Type", getClassification().getClassificationType(), ! // getClassificationType(), this)); } if (isFunctionalSpace()) { --- 1345,1370 ---- } } else { ! if (isConstructionSpace()) { ! if (getOwner().getClassification() != null) { ! res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification(), this)); } else { ! res.add(new Attribute("Classification", ! Project.getInstance().getConstructionClas(), getClassification(), this)); } ! } else { ! if (getOwner().getClassification() != null) { ! res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification(), this)); } else { ! res.add(new Attribute("Classification", ! Project.getInstance().getFunctionalClas(), getClassification(), this)); } } } if (getClassification() != null && getClassificationType() != null) { ! res.add(new Attribute("Type", getClassification().getPossibleTypes(), ! getClassificationType())); ! res.addAll(getOwnParameters().values()); } if (isFunctionalSpace()) { *************** *** 2817,2820 **** --- 2796,2812 ---- /** + * Get all own parameters (along with those implied by the classification type + * @return A linkedHashMap with alle the parameters + */ + public LinkedHashMap<String, Attribute> getOwnParameters() { + LinkedHashMap<String, Attribute> res = new LinkedHashMap<String, Attribute>(); + if (getClassificationType() != null) { + res.putAll(getClassificationType().getAllParameters()); + } + res.putAll(ownParameters); + return res; + } + + /** * Find the parameter relating to the given string in first the space if it in not there * then the classification is asked for it *************** *** 2823,2828 **** */ public Attribute getParameter(String string) { ! //TODO make space hold own parameters ! return getClassificationType().getParameter(string); } } --- 2815,2823 ---- */ public Attribute getParameter(String string) { ! Attribute a = ownParameters.get(string); ! if (a == null) { ! a = getClassificationType().getParameter(string); ! } ! return a; } } Index: ClassificationType.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClassificationType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClassificationType.java 26 Jun 2007 10:56:54 -0000 1.2 --- ClassificationType.java 23 Jul 2007 13:58:13 -0000 1.3 *************** *** 8,12 **** import java.util.ArrayList; ! import java.util.LinkedList; import java.util.List; --- 8,12 ---- import java.util.ArrayList; ! import java.util.LinkedHashMap; import java.util.List; *************** *** 16,26 **** * @author Rimestad */ ! public class ClassificationType { private static int nextClassificationId = 0; ! private String name; ! private List<Attribute> parameter; ! private List<ClassificationType> subTypes; ! private int index; private long id; /** --- 16,24 ---- * @author Rimestad */ ! public class ClassificationType extends Structure<ClassificationType> implements Parametric { private static int nextClassificationId = 0; ! private LinkedHashMap<String, Attribute> parameter; private long id; + private int index; /** *************** *** 33,39 **** public ClassificationType(String name, double uvalue, double density, double cost) { this(); setId(nextClassificationId); nextClassificationId++; ! this.name = name; addParameter("uvalue", uvalue); addParameter("density", density); --- 31,38 ---- public ClassificationType(String name, double uvalue, double density, double cost) { this(); + setIndex(-1); setId(nextClassificationId); nextClassificationId++; ! setName(name); addParameter("uvalue", uvalue); addParameter("density", density); *************** *** 45,97 **** */ public ClassificationType() { ! subTypes = new LinkedList<ClassificationType>(); ! parameter = new LinkedList<Attribute>(); ! } ! ! /** ! * Add a type as subtype to this ! * @param subType the type to add ! */ ! public void addSubType(ClassificationType subType) { ! subTypes.add(subType); ! subType.setIndex(subTypes.size() - 1); ! } ! ! /** ! * Set the index of the classificationType ! * @param i The index ! */ ! private void setIndex(int i) { ! this.index = i; ! } ! ! /** ! * Return the index of the classificationType ! * @return The index ! */ ! public int getIndex() { ! return this.index; ! } ! ! /** ! * Return the name ! * @return the name ! */ ! public String getName() { ! return name; ! } ! ! /** ! * @param name the name to set ! */ ! public void setName(String name) { ! this.name = name; } /** ! * @return the subTypes */ ! public List<ClassificationType> getSubTypes() { ! return subTypes; } --- 44,58 ---- */ public ClassificationType() { ! super(); ! parameter = new LinkedHashMap<String, Attribute>(); } /** ! * {@inheritDoc} */ ! @Override ! public void addChild(ClassificationType child) { ! super.addChild(child); ! child.setIndex(getChildren().size() - 1); } *************** *** 102,108 **** public List<Attribute> getAttributes() { List<Attribute> res = new ArrayList<Attribute>(); ! res.add(new Attribute("Name", name)); ! res.add(new Attribute("Letter", (char)(index + 'A'))); ! res.addAll(getParameters()); return res; } --- 63,68 ---- public List<Attribute> getAttributes() { List<Attribute> res = new ArrayList<Attribute>(); ! res.add(new Attribute("Name", getName())); ! res.addAll(getAllParameters().values()); return res; } *************** *** 113,118 **** */ public void setAttributes(List<Attribute> attributes) { for (Attribute a : attributes) { - parameter.clear(); if (a.getName().equals("Name")) { continue; --- 73,78 ---- */ public void setAttributes(List<Attribute> attributes) { + parameter.clear(); for (Attribute a : attributes) { if (a.getName().equals("Name")) { continue; *************** *** 121,125 **** continue; } ! parameter.add(a); } } --- 81,85 ---- continue; } ! addParameter(a.getName(), a.getValue()); } } *************** *** 129,133 **** * @return the parameters */ ! public List<Attribute> getParameters() { return parameter; } --- 89,93 ---- * @return the parameters */ ! public LinkedHashMap<String, Attribute> getAllParameters() { return parameter; } *************** *** 139,143 **** */ private void addParameter(String name, Object o) { ! parameter.add(new Attribute(name, o, true)); } --- 99,103 ---- */ private void addParameter(String name, Object o) { ! parameter.put(name, new Attribute(name, o, true)); } *************** *** 149,159 **** */ public Attribute getParameter(String string) { ! //TODO make space hold own parameters ! for (Attribute a : getAttributes()) { ! if (a.getName().equalsIgnoreCase(string)) { ! return a; ! } ! } ! return null; } --- 109,114 ---- */ public Attribute getParameter(String string) { ! Attribute a = parameter.get(string); ! return a; } *************** *** 162,166 **** */ public String toString() { ! return name; } --- 117,121 ---- */ public String toString() { ! return getName(); } *************** *** 180,182 **** --- 135,188 ---- this.id = id; } + + /** + * {@inheritDoc} + */ + public String getGeneralName() { + return "Classification Type"; + } + + /** + * @return the index + */ + public int getIndex() { + return index; + } + + /** + * @param index the index to set + */ + public void setIndex(int index) { + this.index = index; + } + + /** + * A sptring prefix for the type + * @return The prefix + */ + public String getPrefix() { + String res = ""; + if (getParent() == null || getParent() == this) { + return res; + } + res = getParent().getPrefix() + String.valueOf((char)('A' + index)); + return res; + } + + /** + * Check if a ClassificationType is one of the given subtypes + * @param cst The classificationType + * @return Wether or not it is a usable type + */ + public boolean isPossibleSubtype(ClassificationType cst) { + if (this == cst) { + return true; + } + for (ClassificationType c : getChildren()) { + if (c.isPossibleSubtype(cst)) { + return true; + } + } + return false; + } } |
From: rimestad <rim...@us...> - 2007-07-23 14:36:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17744/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java ClassificationTextAttribute.java ClassificationIdAttribute.java Log Message: Made a superclass to Classification and ClassificationType called Structure and made all uses reflect that... Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** GenericPanel.java 24 May 2007 21:43:07 -0000 1.38 --- GenericPanel.java 23 Jul 2007 13:57:39 -0000 1.39 *************** *** 36,39 **** --- 36,40 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selector; + import net.sourceforge.bprocessor.model.Structure; /** *************** *** 154,158 **** genAttributes.add(da); where.add(new AttributeRow(da)); ! } else if (a.getValue() instanceof Parametric && !(a.getValue() instanceof Classification)) { // Handles the links LinkAttribute la = new LinkAttribute(a); --- 155,159 ---- genAttributes.add(da); where.add(new AttributeRow(da)); ! } else if (a.getValue() instanceof Parametric && !(a.getValue() instanceof Structure)) { // Handles the links LinkAttribute la = new LinkAttribute(a); *************** *** 202,206 **** genAttributes.add(ba); where.add(new AttributeRow(ba)); ! } else if (a.getValue() instanceof Classification) { // Handles the text part classification ClassificationTextAttribute catext = new ClassificationTextAttribute(a); --- 203,207 ---- genAttributes.add(ba); where.add(new AttributeRow(ba)); ! } else if (a.getValue() instanceof Structure) { // Handles the text part classification ClassificationTextAttribute catext = new ClassificationTextAttribute(a); *************** *** 218,244 **** genAttributes.add(catext); where.add(new AttributeRow(catext)); ! if (a.getClassification() != null && ! !a.getClassification().getId().equalsIgnoreCase("-1") && ! !a.getName().equalsIgnoreCase("Type")) { ! // Handles the id part of classification ! ClassificationIdAttribute caid = new ClassificationIdAttribute(a); ! caid.addClassificationAttributeListener(new AttributeListener() { ! public void valueChanged(Attribute a) { ! obj.setAttributes(attributes); ! if (obj instanceof Entity) { ! simpleUpdate = true; ! ((Entity)obj).changed(); ! } else if (obj instanceof Camera) { ! Project.getInstance().changed((Camera)obj); } ! } ! }); ! genAttributes.add(caid); ! where.add(new AttributeRow(caid)); } } else if (a.getValue() instanceof Selector) { Selector s = (Selector)a.getValue(); SelectorAttribute satt = new SelectorAttribute(a); - satt.addItemListener(new SelectorListener(s) { public void itemStateChanged(ItemEvent e) { --- 219,246 ---- genAttributes.add(catext); where.add(new AttributeRow(catext)); ! if (a.getThe2ndValue() instanceof Classification) { ! Classification c = (Classification)a.getThe2ndValue(); ! if (c != null && !c.getId().equalsIgnoreCase("-1") && ! a.getName().equalsIgnoreCase("Classification")) { ! // Handles the id part of classification ! ClassificationIdAttribute caid = new ClassificationIdAttribute(a); ! caid.addClassificationAttributeListener(new AttributeListener() { ! public void valueChanged(Attribute a) { ! obj.setAttributes(attributes); ! if (obj instanceof Entity) { ! simpleUpdate = true; ! ((Entity)obj).changed(); ! } else if (obj instanceof Camera) { ! Project.getInstance().changed((Camera)obj); ! } } ! }); ! genAttributes.add(caid); ! where.add(new AttributeRow(caid)); ! } } } else if (a.getValue() instanceof Selector) { Selector s = (Selector)a.getValue(); SelectorAttribute satt = new SelectorAttribute(a); satt.addItemListener(new SelectorListener(s) { public void itemStateChanged(ItemEvent e) { Index: ClassificationTextAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationTextAttribute.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ClassificationTextAttribute.java 8 May 2007 12:34:06 -0000 1.8 --- ClassificationTextAttribute.java 23 Jul 2007 13:57:39 -0000 1.9 *************** *** 40,43 **** --- 40,45 ---- import net.sourceforge.bprocessor.model.Classification; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Space; + import net.sourceforge.bprocessor.model.Structure; /** *************** *** 45,49 **** */ public class ClassificationTextAttribute extends GenericAttribute ! implements ActionListener, MouseListener, KeyListener { /** The logger */ private static Logger log = Logger.getLogger(ClassificationTextAttribute.class); --- 47,51 ---- */ public class ClassificationTextAttribute extends GenericAttribute ! implements MouseListener, KeyListener { /** The logger */ private static Logger log = Logger.getLogger(ClassificationTextAttribute.class); *************** *** 65,70 **** /** The popup menu */ ! private JPopupMenu classification; ! /** The editor, when this EditableAttribute is being edited */ --- 67,71 ---- /** The popup menu */ ! private JPopupMenu popupChoices; /** The editor, when this EditableAttribute is being edited */ *************** *** 78,86 **** public ClassificationTextAttribute(Attribute attribute) { super(BoxLayout.X_AXIS); ! if (attribute.getName().equalsIgnoreCase("Classification")) { ! label = new JLabel("Classification: "); ! } else { ! label = new JLabel("Type: "); ! } label.setFont(AttributeView.FONT_BOLD); this.attribute = attribute; --- 79,83 ---- public ClassificationTextAttribute(Attribute attribute) { super(BoxLayout.X_AXIS); ! label = new JLabel(attribute.getName() + ": "); label.setFont(AttributeView.FONT_BOLD); this.attribute = attribute; *************** *** 88,93 **** Box column = Box.createVerticalBox(); component = Box.createHorizontalBox(); ! if (attribute.getClassification() != null) { ! JLabel cur = (JLabel) createValueLabel(attribute.getClassification()); cur.setFont(AttributeView.FONT_PLAIN); component.add(cur); --- 85,90 ---- Box column = Box.createVerticalBox(); component = Box.createHorizontalBox(); ! if (attribute.getThe2ndValue() != null) { ! JLabel cur = (JLabel) createValueLabel((Structure)attribute.getThe2ndValue()); cur.setFont(AttributeView.FONT_PLAIN); component.add(cur); *************** *** 97,101 **** component.add(cur); } ! createMenu(attribute.getValue()); Box header = Box.createHorizontalBox(); header.add(Box.createHorizontalStrut(7)); --- 94,98 ---- component.add(cur); } ! createMenu((Structure)attribute.getValue()); Box header = Box.createHorizontalBox(); header.add(Box.createHorizontalStrut(7)); *************** *** 166,202 **** * @param value The value */ ! private void createMenu(Object value) { ! classification = new JPopupMenu(); ! JMenu subMenu; ! MyMenuItem mi, submi; ! boolean hasChildren = false; ! Iterator it = ((Classification) value).getChildren().iterator(); ! while (it.hasNext()) { ! Classification current = (Classification) it.next(); ! if (current.getChildren() != null) { ! hasChildren = true; ! } ! if (hasChildren) { ! Iterator subit = current.getChildren().iterator(); ! subMenu = new JMenu(current.getName()); ! submi = new MyMenuItem(current); ! submi.addActionListener(this); ! if (!current.getId().equalsIgnoreCase("-99")) { ! subMenu.add(submi); ! } ! while (subit.hasNext()) { ! Classification subcur = (Classification) subit.next(); ! submi = new MyMenuItem(subcur); ! submi.addActionListener(this); subMenu.add(submi); } ! classification.add(subMenu); } else { ! mi = new MyMenuItem(current); ! mi.addActionListener(this); ! classification.add(mi); } } - } --- 163,189 ---- * @param value The value */ ! private void createMenu(Structure value) { ! popupChoices = new JPopupMenu(); ! MyMenuItem mi = new MyMenuItem(value); ! mi.addActionListener(new MyMenuItemListener()); ! popupChoices.add(mi); ! for (Structure s : (Vector<Structure>)value.getChildren()) { ! if (s.getChildren().size() > 0) { ! JMenu subMenu = new JMenu(s.getName()); ! mi = new MyMenuItem(s); ! mi.addActionListener(new MyMenuItemListener()); ! subMenu.add(mi); ! for (Structure child : (Vector<Structure>)s.getChildren()) { ! MyMenuItem submi = new MyMenuItem(child); ! submi.addActionListener(new MyMenuItemListener()); subMenu.add(submi); } ! popupChoices.add(subMenu); } else { ! mi = new MyMenuItem(s); ! mi.addActionListener(new MyMenuItemListener()); ! popupChoices.add(mi); } } } *************** *** 206,212 **** * @return The label */ ! private JComponent createValueLabel(Classification value) { ! JLabel valueLabel; ! if (attribute.getClassification().getId().equalsIgnoreCase("-1")) { valueLabel = new JLabel(value.getName()); } else { --- 193,200 ---- * @return The label */ ! private JComponent createValueLabel(Structure value) { ! JLabel valueLabel = new JLabel(value.getName()); ! valueLabel.setFont(AttributeView.FONT_PLAIN); ! /*if (attribute.getClassification().getId().equalsIgnoreCase("-1")) { valueLabel = new JLabel(value.getName()); } else { *************** *** 219,223 **** valueLabel = new JLabel(value.getName()); } ! } return valueLabel; } --- 207,211 ---- valueLabel = new JLabel(value.getName()); } ! }*/ return valueLabel; } *************** *** 225,238 **** /** * Create a value editor - * @param value The value * @param name the current name * @return The value editor */ ! private JComponent createValueEditor(String name, Classification value) { String s = ""; if (!name.equalsIgnoreCase("Classification")) { s = name; ! } ! AutoCompleteField valueEditor = new AutoCompleteField(s, (Classification) attribute.getValue()); valueEditor.setFont(AttributeView.FONT_PLAIN); return valueEditor; --- 213,225 ---- /** * Create a value editor * @param name the current name * @return The value editor */ ! private JComponent createValueEditor(String name) { String s = ""; if (!name.equalsIgnoreCase("Classification")) { s = name; ! } ! AutoCompleteField valueEditor = new AutoCompleteField(s, (Structure) attribute.getValue()); valueEditor.setFont(AttributeView.FONT_PLAIN); return valueEditor; *************** *** 246,262 **** return attribute; } - - /** - * Handles the event from the classification menu - * @param e is the action event - */ - public void actionPerformed(ActionEvent e) { - MyMenuItem source = (MyMenuItem)(e.getSource()); - attribute.setClassification(source.getClassification()); - component.remove(0); - component.add(createValueLabel(attribute.getClassification())); - component.revalidate(); - valueChanged(); - } /** --- 233,236 ---- *************** *** 264,297 **** */ class MyMenuItem extends JMenuItem { - /** the classification */ ! private Classification cla; /** * Constructor for a new MyMenuItem ! * @param classification the classification */ ! MyMenuItem(Classification classification) { ! super(classification.getName()); ! setClassification(classification); } /** ! * return the classification for the current menu item ! * @return the classification */ ! public Classification getClassification() { ! return cla; } /** * Sets the classification for a menu item ! * @param cla the classification */ ! public void setClassification(Classification cla) { ! this.cla = cla; } } ! /** * Start editing --- 238,290 ---- */ class MyMenuItem extends JMenuItem { /** the classification */ ! private Structure structure; /** * Constructor for a new MyMenuItem ! * @param struc the classification */ ! MyMenuItem(Structure struc) { ! super(struc.getName()); ! setClassification(struc); } /** ! * return the structure for the current menu item ! * @return the structure */ ! public Structure getClassification() { ! return this.structure; } /** * Sets the classification for a menu item ! * @param cla the structure */ ! public void setClassification(Structure cla) { ! this.structure = cla; } } ! ! /** ! * MenuItem action listener ! */ ! class MyMenuItemListener implements ActionListener { ! /** ! * Handles the event from the classification menu ! * @param e is the action event ! */ ! public void actionPerformed(ActionEvent e) { ! if (e.getSource() instanceof MyMenuItem) { ! MyMenuItem source = (MyMenuItem)(e.getSource()); ! attribute.setThe2ndValue(source.getClassification()); ! component.remove(0); ! component.add(createValueLabel((Structure)attribute.getThe2ndValue())); ! component.revalidate(); ! valueChanged(); ! } ! } ! } ! /** * Start editing *************** *** 299,304 **** public void startEditing() { if (editor == null) { ! editor = (AutoCompleteField) createValueEditor(((JLabel)component.getComponent(0)) ! .getText(), attribute.getClassification()); component.remove(0); editor.addKeyListener(this); --- 292,296 ---- public void startEditing() { if (editor == null) { ! editor = (AutoCompleteField)createValueEditor(((JLabel)component.getComponent(0)).getText()); component.remove(0); editor.addKeyListener(this); *************** *** 312,327 **** /** * Stop editing */ public void stopEditing() { if (editor != null && attribute.isEditable()) { ! Vector cur = ((Classification) attribute.getValue()).getChildren(); ! if (((Classification) attribute.getValue()).getType() == 0) { ! cur.addAll(Project.getInstance().getClassification("-99", 0).getChildren()); ! } ! if (((Classification) attribute.getValue()).getType() == 0) { ! cur.addAll(Project.getInstance().getClassification("-99", 1).getChildren()); } ! Classification current; ! Classification entered = null; StringTokenizer st = new StringTokenizer(editor.getText(), "."); while (st.hasMoreTokens()) { --- 304,327 ---- /** * Stop editing + * Should be able to handle two different strings + * 1. A . separated integer string + * 2. A */ public void stopEditing() { if (editor != null && attribute.isEditable()) { ! Vector cur = ((Structure) attribute.getValue()).getChildren(); ! if (attribute.getValue() instanceof Classification) { ! if (((Classification) attribute.getValue()).getType() == Space.CONSTRUCTION) { ! cur.addAll(Project.getInstance().getClassification("-99", ! Space.CONSTRUCTION).getChildren()); ! } else if (((Classification) attribute.getValue()).getType() == Space.FUNCTIONAL) { ! cur.addAll(Project.getInstance().getClassification("-99", ! Space.FUNCTIONAL).getChildren()); ! } else { ! log.warn(((Classification) attribute.getValue()).getType() + " is a unknown type"); ! } } ! Structure current; ! Structure entered = null; StringTokenizer st = new StringTokenizer(editor.getText(), "."); while (st.hasMoreTokens()) { *************** *** 329,333 **** Iterator it = cur.iterator(); while (it.hasNext()) { ! current = (Classification) it.next(); if (current.getName().equalsIgnoreCase(name)) { cur = current.getChildren(); --- 329,333 ---- Iterator it = cur.iterator(); while (it.hasNext()) { ! current = (Structure) it.next(); if (current.getName().equalsIgnoreCase(name)) { cur = current.getChildren(); *************** *** 337,342 **** } if (entered != null) { ! attribute.setClassification(entered); ! } else { Classification newclas, egne; if (((Classification) attribute.getValue()).getType() == 0) { --- 337,342 ---- } if (entered != null) { ! attribute.setThe2ndValue(entered); ! } /*else { Classification newclas, egne; if (((Classification) attribute.getValue()).getType() == 0) { *************** *** 353,362 **** } ! attribute.setClassification(newclas); ! } component.remove(editor); editor.removeKeyListener(this); editor = null; ! component.add(createValueLabel((Classification) attribute.getClassification())); component.revalidate(); valueChanged(); --- 353,362 ---- } ! attribute.setThe2ndValue(newclas); ! }*/ component.remove(editor); editor.removeKeyListener(this); editor = null; ! component.add(createValueLabel((Structure) attribute.getThe2ndValue())); component.revalidate(); valueChanged(); *************** *** 372,376 **** editor.removeKeyListener(this); editor = null; ! component.add(createValueLabel((Classification) attribute.getValue())); component.revalidate(); } --- 372,376 ---- editor.removeKeyListener(this); editor = null; ! component.add(createValueLabel((Structure) attribute.getValue())); component.revalidate(); } *************** *** 388,392 **** */ public void mousePressed(MouseEvent event) { ! classification.show(event.getComponent(), event.getX(), event.getY()); --- 388,392 ---- */ public void mousePressed(MouseEvent event) { ! popupChoices.show(event.getComponent(), event.getX(), event.getY()); *************** *** 444,450 **** */ public class AutoCompleteField extends JTextField { - /** The parent classification */ - private Classification parent; - /** * constructor of autocomplete field --- 444,447 ---- *************** *** 452,457 **** * @param parent the parent to the classification */ ! public AutoCompleteField(String string, Classification parent) { ! super(string); this.setDocument(new AutoCompleteDocument(this, parent)); this.setText(string); --- 449,454 ---- * @param parent the parent to the classification */ ! public AutoCompleteField(String string, Structure parent) { ! super(); this.setDocument(new AutoCompleteDocument(this, parent)); this.setText(string); *************** *** 465,474 **** /** The typed text */ private String typed; - /** The textfield */ private JTextField field; ! ! /** The parent classification */ ! private Classification parent; /** --- 462,469 ---- /** The typed text */ private String typed; /** The textfield */ private JTextField field; ! /** The possible strings */ ! private LinkedList<String> possibillities = new LinkedList<String>(); /** *************** *** 477,484 **** * @param parent the parent to the classification */ ! public AutoCompleteDocument(JTextField field, Classification parent) { this.field = field; - this.parent = parent; typed = ""; } --- 472,494 ---- * @param parent the parent to the classification */ ! public AutoCompleteDocument(JTextField field, Structure<? extends Structure> parent) { this.field = field; typed = ""; + findPossibillities("", parent, 1); + } + + private void findPossibillities(String prefix, Structure s, int lvl) { + String str = prefix + s.getName().toLowerCase(); + if (str.equalsIgnoreCase("constructional") || str.equalsIgnoreCase("functional")) { + str = ""; + } else { + possibillities.add(str); + str += "."; + } + if (lvl < 3) { + for (Structure struc : (Vector<Structure>)s.getChildren()) { + findPossibillities(str, struc, lvl + 1); + } + } } *************** *** 497,509 **** typed = typed.substring(0, offs) + str + typed.substring(offs, typed.length()); } else { ! typed = typed + str; } super.remove(0, super.getLength()); typed = autocomplete(typed); super.insertString(0, typed, a); ! field.setCaretPosition(offs + str.length()); ! field.setSelectionStart(offs + str.length()); ! field.setSelectionEnd(typed.length()); } --- 507,532 ---- typed = typed.substring(0, offs) + str + typed.substring(offs, typed.length()); } else { ! if (!str.equalsIgnoreCase(".")) { ! typed = typed + str; ! } } super.remove(0, super.getLength()); typed = autocomplete(typed); + if (str.equalsIgnoreCase(".")) { + offs = typed.length(); + typed = autocomplete(typed + "."); + } super.insertString(0, typed, a); ! try { ! field.setCaretPosition(offs + str.length()); ! field.setSelectionStart(offs + str.length()); ! field.setSelectionEnd(typed.length()); ! } catch (Exception e) { ! log.error("Catched thrown error" + e.getMessage()); ! field.setCaretPosition(0); ! field.setScrollOffset(0); ! field.setSelectionEnd(field.getText().length()); ! } } *************** *** 514,552 **** */ public String autocomplete(String string) { ! if (!string.equalsIgnoreCase("")) { ! Vector cl = parent.getChildren(); ! Vector sort = new Vector(); ! boolean children = false; ! Iterator it = cl.iterator(); ! while (it.hasNext()) { ! Classification current = (Classification) it.next(); ! if (!current.getId().equalsIgnoreCase("-99")) { ! sort.add(current.toString()); ! } ! if (current.getChildren() != null) { ! children = true; ! } ! if (children) { ! Iterator subit = current.getChildren().iterator(); ! while (subit.hasNext()) { ! String conc = ""; ! if (!current.getId().equalsIgnoreCase("-99")) { ! conc = current.toString() + "." + ((Classification) subit.next()).toString(); ! } else { ! conc = ((Classification) subit.next()).toString(); ! } ! sort.add(conc); ! } } } ! ! LinkedList matches = new LinkedList(); ! Iterator sortit = sort.iterator(); ! while (sortit.hasNext()) { ! String name = (String) sortit.next(); ! if (name.startsWith(string)) { ! matches.add(name); ! return name; ! } } } --- 537,552 ---- */ public String autocomplete(String string) { ! string = string.toLowerCase(); ! if (!string.equalsIgnoreCase("")) { ! LinkedList<String> matches = new LinkedList<String>(); ! for (String s : possibillities) { ! if (s.startsWith(string)) { ! matches.add(s); } } ! if (!matches.isEmpty()) { ! return matches.get(0); ! } else { ! return "Non existing"; } } Index: ClassificationIdAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationIdAttribute.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ClassificationIdAttribute.java 24 Jan 2007 10:25:14 -0000 1.5 --- ClassificationIdAttribute.java 23 Jul 2007 13:57:39 -0000 1.6 *************** *** 63,70 **** label = createLabel("Code"); component = Box.createHorizontalBox(); ! if (!attribute.getClassification().getName().equalsIgnoreCase("Classification") && ! !attribute.getClassification().getId().equalsIgnoreCase("-1")) { ! component.add(createValueLabel(attribute.getClassification() ! .getFullId(attribute.getLevel()))); } Box header = Box.createHorizontalBox(); --- 63,70 ---- label = createLabel("Code"); component = Box.createHorizontalBox(); ! Classification c = (Classification)attribute.getThe2ndValue(); ! if (!c.getName().equalsIgnoreCase("Classification") && ! !c.getId().equalsIgnoreCase("-1")) { ! component.add(createValueLabel(c.getFullId(attribute.getLevel()))); } Box header = Box.createHorizontalBox(); *************** *** 189,196 **** if (editor == null) { component.remove(0); ! if (attribute.getClassification() != null ! && !attribute.getClassification().getName().equalsIgnoreCase("Classification")) { ! editor = (JTextField) createValueEditor(attribute.getClassification() ! .getFullId(attribute.getLevel())); } else { editor = (JTextField) createValueEditor(""); --- 189,196 ---- if (editor == null) { component.remove(0); ! Classification c = (Classification)attribute.getThe2ndValue(); ! if (c != null ! && !c.getName().equalsIgnoreCase("Classification")) { ! editor = (JTextField) createValueEditor(c.getFullId(attribute.getLevel())); } else { editor = (JTextField) createValueEditor(""); *************** *** 231,235 **** } } ! attribute.setClassification(clas); component.remove(editor); --- 231,235 ---- } } ! attribute.setThe2ndValue(clas); component.remove(editor); |
From: rimestad <rim...@us...> - 2007-07-23 14:36:28
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17755/src/net/sourceforge/bprocessor/gl/tool Modified Files: CreateSpaceActionListener.java Log Message: Made a superclass to Classification and ClassificationType called Structure and made all uses reflect that... Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CreateSpaceActionListener.java 10 Apr 2007 20:57:44 -0000 1.17 --- CreateSpaceActionListener.java 23 Jul 2007 13:57:42 -0000 1.18 *************** *** 19,22 **** --- 19,23 ---- import java.awt.event.MouseEvent; + import net.sourceforge.bprocessor.model.Classification; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; *************** *** 108,121 **** String name = ((JButton) e.getSource()).getText(); if (name.equalsIgnoreCase("Ok")) { ! if (cta.attribute().getClassification() != null) { Space owner = surface.getOwner(); ! if (cta.attribute().getClassification() != null) { try { Space space; if (functional) { ! space = owner.createFunctionalSpace(cta.attribute().getClassification()); } else { ! space = owner.createConstructionSpace(cta.attribute().getClassification()); } owner.add(space); --- 109,124 ---- String name = ((JButton) e.getSource()).getText(); if (name.equalsIgnoreCase("Ok")) { ! if (cta.attribute().getThe2ndValue() != null) { Space owner = surface.getOwner(); ! if (cta.attribute().getThe2ndValue() != null) { try { Space space; if (functional) { ! space = owner.createFunctionalSpace( ! (Classification)cta.attribute().getThe2ndValue()); } else { ! space = owner.createConstructionSpace( ! (Classification)cta.attribute().getThe2ndValue()); } owner.add(space); |
From: rimestad <rim...@us...> - 2007-07-23 14:36:28
|
Update of /cvsroot/bprocessor/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17763 Modified Files: Classification.xml Log Message: Made a superclass to Classification and ClassificationType called Structure and made all uses reflect that... Index: Classification.xml =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/Classification.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Classification.xml 26 Jun 2007 10:57:18 -0000 1.1 --- Classification.xml 23 Jul 2007 13:58:03 -0000 1.2 *************** *** 1,429 **** <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <DBK xmlns="classificationNS"> ! <XMLClassification name="Constructional" typeId="-1" id="-1"> ! <XMLClassification name="Terræn" typeId="1189" id="-100"> ! <XMLClassification name="Jordprofil" typeId="599" id="01"> ! <XMLClassification name="Udgravninger" typeId="-1" id="01"/> ! <XMLClassification name="Fyldtyper" typeId="486" id="02"/> ! <XMLClassification name="Sænkninger" typeId="1090" id="03"/> ! <XMLClassification name="Hævninger" typeId="538" id="04"/> ! <XMLClassification name="Dræn" typeId="403" id="05"/> [...19668 lines suppressed...] <key>uvalue</key> --- 29787,29791 ---- </attributes> </XMLSpecificType> ! <XMLSpecificType name="Trafiklys" id="1043" index="8"> <attributes xmlns=""> <key>uvalue</key> *************** *** 29807,29811 **** </attributes> </XMLSpecificType> ! <XMLSpecificType index="9" name="Klokker" id="1044"> <attributes xmlns=""> <key>uvalue</key> --- 29807,29811 ---- </attributes> </XMLSpecificType> ! <XMLSpecificType name="Klokker" id="1044" index="9"> <attributes xmlns=""> <key>uvalue</key> |
From: rimestad <rim...@us...> - 2007-07-23 14:35:48
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18117/src/net/sourceforge/bprocessor/model/modellor Modified Files: InnerWallModellor.java Log Message: Made a superclass to Classification and ClassificationType called Structure and made all uses reflect that... Index: InnerWallModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/InnerWallModellor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** InnerWallModellor.java 18 Jul 2007 12:24:05 -0000 1.6 --- InnerWallModellor.java 23 Jul 2007 13:58:13 -0000 1.7 *************** *** 219,223 **** Space joist = new Space("joist", Space.CONSTRUCTION, space.getLevel() + 1, true); Classification c = Project.getInstance().getClassification("-1.-205.01.01", 0); ! joist.setClassificationType(c.getPossibleTypes().getSubTypes().get(0)); space.add(joist); Vertex dir = e.getDirection(); --- 219,223 ---- Space joist = new Space("joist", Space.CONSTRUCTION, space.getLevel() + 1, true); Classification c = Project.getInstance().getClassification("-1.-205.01.01", 0); ! joist.setClassificationType(c.getPossibleTypes().getChildren().get(0)); space.add(joist); Vertex dir = e.getDirection(); |
From: Michael L. <he...@us...> - 2007-07-20 13:33:33
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3924/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Surface.java Space.java Log Message: Refactored Surface erase/delete/remove Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.170 retrieving revision 1.171 diff -C2 -d -r1.170 -r1.171 *** Surface.java 18 Jul 2007 14:03:38 -0000 1.170 --- Surface.java 20 Jul 2007 13:33:26 -0000 1.171 *************** *** 321,333 **** public void delete() { if (getOwner() != null) { ! for (Edge edge : getEdges()) { ! if (edge.getSurfaces().size() < 1) { ! edge.delete(); ! } ! } getOwner().remove(this); } } /** * Remove references to this Surface in the rest of the model --- 321,340 ---- public void delete() { if (getOwner() != null) { ! unlink(); getOwner().remove(this); } } + /** {@inheritDoc} */ + @Override + public void erase() { + delete(); + for (Edge edge : getEdges()) { + if (edge.getSurfaces().size() < 1) { + edge.delete(); + } + } + } + /** * Remove references to this Surface in the rest of the model Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.161 retrieving revision 1.162 diff -C2 -d -r1.161 -r1.162 *** Space.java 18 Jul 2007 14:07:57 -0000 1.161 --- Space.java 20 Jul 2007 13:33:26 -0000 1.162 *************** *** 799,803 **** */ public void remove(Surface surface) { - surface.unlink(); surfaces.remove(surface.getId()); surface.setId(null); --- 799,802 ---- Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** Edge.java 18 Jul 2007 14:03:37 -0000 1.93 --- Edge.java 20 Jul 2007 13:33:26 -0000 1.94 *************** *** 202,208 **** public void delete() { if (getOwner() != null) { Set<Surface> surfaces = getSurfaces(); Vertex to = getTo(); ! Vertex from = getFrom(); // Merge two adjacant surface. --- 202,214 ---- public void delete() { if (getOwner() != null) { + Space owner = getOwner(); + Set<Surface> surfaces = getSurfaces(); Vertex to = getTo(); ! Vertex from = getFrom(); ! ! owner.remove(this); ! ! // Merge two adjacant surface. *************** *** 223,227 **** edges1.addAll(edges2); Surface surface = new Surface(edges1); ! getOwner().add(surface); if (s1.getExterior() != null) { s1.getExterior().addHole(surface); --- 229,233 ---- edges1.addAll(edges2); Surface surface = new Surface(edges1); ! owner.add(surface); if (s1.getExterior() != null) { s1.getExterior().addHole(surface); *************** *** 241,259 **** for (Surface surface : surfaces) { ! // Here the surface need to be unlinked ! getOwner().remove(surface); } if (to.getOwner() != null) { if (to.getEdges().size() == 0) { ! getOwner().remove(to); } } if (from.getOwner() != null) { if (from.getEdges().size() == 0) { ! getOwner().remove(from); } } - getOwner().remove(this); } } --- 247,263 ---- for (Surface surface : surfaces) { ! surface.delete(); } if (to.getOwner() != null) { if (to.getEdges().size() == 0) { ! owner.remove(to); } } if (from.getOwner() != null) { if (from.getEdges().size() == 0) { ! owner.remove(from); } } } } |
From: Michael L. <he...@us...> - 2007-07-19 12:23:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26555/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Geometric.java Log Message: Introduced an erase operation performs a delete + some extra stuff Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Geometric.java 14 Jun 2007 09:36:13 -0000 1.18 --- Geometric.java 19 Jul 2007 12:23:39 -0000 1.19 *************** *** 175,178 **** --- 175,187 ---- /** + * Erases this Geometric object by deleting this + * object as well as merging/deleting neighbouring + * objects. + */ + public void erase() { + delete(); + } + + /** * Update after move */ Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Geometry.java 31 May 2007 12:41:55 -0000 1.59 --- Geometry.java 19 Jul 2007 12:23:38 -0000 1.60 *************** *** 287,293 **** Collection<Surface> candidates = new LinkedList<Surface>(); Collection<Surface> surfaces = surface.getOwner().getSurfaces(); - Collection<Surface> envelope = surface.getOwner().getEnvelope(); - candidates.addAll(envelope); candidates.addAll(surfaces); for (Surface current : candidates) { --- 287,300 ---- Collection<Surface> candidates = new LinkedList<Surface>(); Collection<Surface> surfaces = surface.getOwner().getSurfaces(); candidates.addAll(surfaces); + if (surface.getOwner().isUnion()) { + Collection<Surface> surrounding = surface.getOwner().getOwner().getSurfaces(); + candidates.addAll(surrounding); + } else { + Collection<Surface> envelope = surface.getOwner().getEnvelope(); + candidates.addAll(envelope); + } + + for (Surface current : candidates) { |
From: Michael L. <he...@us...> - 2007-07-19 12:23:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26541/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java EraserTool.java Log Message: Introduced an erase operation performs a delete + some extra stuff Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** SpaceTool.java 17 Jul 2007 12:13:46 -0000 1.82 --- SpaceTool.java 19 Jul 2007 12:23:32 -0000 1.83 *************** *** 397,401 **** public void remove() { for (Geometric current : Selection.primary()) { ! current.delete(); } Selection.primary().clear(); --- 397,401 ---- public void remove() { for (Geometric current : Selection.primary()) { ! current.erase(); } Selection.primary().clear(); Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EraserTool.java 16 Jul 2007 12:22:40 -0000 1.8 --- EraserTool.java 19 Jul 2007 12:23:32 -0000 1.9 *************** *** 48,52 **** findTarget(e); if (target instanceof Edge || target instanceof ClippingPlane) { ! ((Geometric) target).delete(); Project.getInstance().changed(target); target = null; --- 48,52 ---- findTarget(e); if (target instanceof Edge || target instanceof ClippingPlane) { ! ((Geometric) target).erase(); Project.getInstance().changed(target); target = null; |
From: Michael L. <he...@us...> - 2007-07-19 12:23:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26524/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java GUI.java Log Message: Introduced an erase operation performs a delete + some extra stuff Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** PopupMenu.java 17 Jul 2007 12:13:50 -0000 1.38 --- PopupMenu.java 19 Jul 2007 12:23:23 -0000 1.39 *************** *** 82,85 **** --- 82,92 ---- }; jm.add(focus); + AbstractAction holeanalysis = new EntityMenuAction(s, "Hole analysis") { + public void actionPerformed(ActionEvent arg0) { + Surface surface = (Surface)entity; + Geometry.holeAnalysis(surface); + } + }; + jm.add(holeanalysis); } if (c.size() == 2) { *************** *** 384,388 **** Selection.primary().clear(); for (Entity current : entities) { ! current.delete(); Project.getInstance().changed(current); } --- 391,395 ---- Selection.primary().clear(); for (Entity current : entities) { ! ((Geometric) current).erase(); Project.getInstance().changed(current); } Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** GUI.java 16 Jul 2007 12:22:47 -0000 1.71 --- GUI.java 19 Jul 2007 12:23:23 -0000 1.72 *************** *** 429,433 **** Collection<Geometric> selection = Selection.primary(); for (Geometric current : selection) { ! current.delete(); } } --- 429,433 ---- Collection<Geometric> selection = Selection.primary(); for (Geometric current : selection) { ! current.erase(); } } |
From: Michael L. <he...@us...> - 2007-07-18 14:08:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32197/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Removed unused code Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** Space.java 18 Jul 2007 14:03:38 -0000 1.160 --- Space.java 18 Jul 2007 14:07:57 -0000 1.161 *************** *** 903,924 **** /** - * Insert a material - * @param material The material - * @return The material - */ - public Material insert(Material material) { - add(material); - return material; - } - - /** - * Delete a material - * @param material The material - */ - public void delete(Material material) { - remove(material); - } - - /** * Return the materials * @return The materials --- 903,906 ---- |
From: Michael L. <he...@us...> - 2007-07-18 14:03:43
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27905/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Space.java Log Message: Refactored delete Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.169 retrieving revision 1.170 diff -C2 -d -r1.169 -r1.170 *** Surface.java 18 Jul 2007 12:24:04 -0000 1.169 --- Surface.java 18 Jul 2007 14:03:38 -0000 1.170 *************** *** 321,325 **** public void delete() { if (getOwner() != null) { ! getOwner().delete(this); } } --- 321,330 ---- public void delete() { if (getOwner() != null) { ! for (Edge edge : getEdges()) { ! if (edge.getSurfaces().size() < 1) { ! edge.delete(); ! } ! } ! getOwner().remove(this); } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.159 retrieving revision 1.160 diff -C2 -d -r1.159 -r1.160 *** Space.java 18 Jul 2007 13:35:38 -0000 1.159 --- Space.java 18 Jul 2007 14:03:38 -0000 1.160 *************** *** 612,631 **** /** - * Delete a vertex - * @param vertex The vertex - */ - public void delete(Vertex vertex) { - if (vertex.getId() != null) { - Set edges = vertex.getEdges(); - remove(vertex); - Iterator iter = edges.iterator(); - while (iter.hasNext()) { - Edge current = (Edge) iter.next(); - delete(current); - } - } - } - - /** * Return the vertices * @return The vertices --- 612,615 ---- *************** *** 736,811 **** /** - * Delete a edge - * @param edge The edge - */ - public void delete(Edge edge) { - if (edge.getId() != null) { - Set<Surface> surfaces = edge.getSurfaces(); - Vertex to = edge.getTo(); - Vertex from = edge.getFrom(); - remove(edge); - - - // Merge two adjacant surface. - // FIXME Replace with surface-analysis - { - if (surfaces.size() == 2) { - Iterator<Surface> it = surfaces.iterator(); - Surface s1 = it.next(); - Surface s2 = it.next(); - if (s1.plane().contains(s2)) { - List<Edge> edges1 = edgeFirst(s1, edge); - List<Edge> edges2 = edgeFirst(s2, edge); - edges1.remove(edge); - edges2.remove(edge); - if (Edge.first(edges1) == Edge.first(edges2)) { - Collections.reverse(edges2); - } - edges1.addAll(edges2); - Surface surface = new Surface(edges1); - add(surface); - if (s1.getExterior() != null) { - s1.getExterior().addHole(surface); - } else if (s2.getExterior() != null) { - s2.getExterior().addHole(surface); - } - Set<Surface> holes = new HashSet<Surface>(); - holes.addAll(s1.getHoles()); - holes.addAll(s2.getHoles()); - for (Surface hole : holes) { - surface.addHole(hole); - } - Surface.mergeSpaceAssign(s1, s2, surface); - } - } - } - - for (Surface surface : surfaces) { - // Here the surface need to be unlinked - remove(surface); - } - - if (to.getOwner() != null) { - if (to.getEdges().size() == 0) { - remove(to); - } - } - if (from.getOwner() != null) { - if (from.getEdges().size() == 0) { - remove(from); - } - } - } - } - - /** * Takes a surface and arranges its edgelist so that * the a specified edge in the list is the first edge in the list ! * @param surface the surface * @param first the edge that should be first in the edgelist * @return a list of the surfaces edges arranged correctly, returns * unaltered edgelist if the edge is not in the surface. */ ! private static List<Edge> edgeFirst(Surface s, Edge first) { List<Edge> edges = new LinkedList<Edge>(s.getEdges()); int index = edges.indexOf(first); --- 720,731 ---- /** * Takes a surface and arranges its edgelist so that * the a specified edge in the list is the first edge in the list ! * @param s the surface * @param first the edge that should be first in the edgelist * @return a list of the surfaces edges arranged correctly, returns * unaltered edgelist if the edge is not in the surface. */ ! public static List<Edge> edgeFirst(Surface s, Edge first) { List<Edge> edges = new LinkedList<Edge>(s.getEdges()); int index = edges.indexOf(first); *************** *** 935,983 **** /** - * Delete a surface - * @param surface The surface - */ - public void delete(Surface surface) { - remove(surface); - for (Edge edge : surface.getEdges()) { - if (edge.getSurfaces().size() < 1) { - delete(edge); - } - } - } - - /** - * Delete the space and delete envelope surfaces not part of - * another space. - * @param space Space - */ - public void delete(Space space) { - List<Surface> deletion = new LinkedList<Surface>(); - { - Iterator iter = space.getEnvelope().iterator(); - while (iter.hasNext()) { - Surface current = (Surface) iter.next(); - Space other; - if (current.getFrontDomain() == space) { - other = current.getBackDomain(); - } else { - other = current.getFrontDomain(); - } - if (other == space || other == empty) { - deletion.add(current); - } - } - } - { - Iterator<Surface> iter = deletion.iterator(); - while (iter.hasNext()) { - Surface current = iter.next(); - delete(current); - } - } - remove(space); - } - - /** * Return the surfaces * @return The surfaces --- 855,858 ---- *************** *** 1690,1695 **** // FIXME should we clear this Space? clear(); ! Space owner = this.getOwner(); ! owner.delete(this); } --- 1565,1584 ---- // FIXME should we clear this Space? clear(); ! List<Surface> deletion = new LinkedList<Surface>(); ! for (Surface current : getEnvelope()) { ! Space other; ! if (current.getFrontDomain() == this) { ! other = current.getBackDomain(); ! } else { ! other = current.getFrontDomain(); ! } ! if (other == this || other == getOwner().empty) { ! deletion.add(current); ! } ! } ! for (Surface current : deletion) { ! current.delete(); ! } ! getOwner().remove(this); } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Vertex.java 18 Jul 2007 12:24:04 -0000 1.62 --- Vertex.java 18 Jul 2007 14:03:37 -0000 1.63 *************** *** 501,505 **** public void delete() { if (getOwner() != null) { ! getOwner().delete(this); } } --- 501,509 ---- public void delete() { if (getOwner() != null) { ! Set<Edge> edges = getEdges(); ! getOwner().remove(this); ! for (Edge current : edges) { ! current.delete(); ! } } } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** Edge.java 18 Jul 2007 12:24:04 -0000 1.92 --- Edge.java 18 Jul 2007 14:03:37 -0000 1.93 *************** *** 202,206 **** public void delete() { if (getOwner() != null) { ! getOwner().delete(this); } } --- 202,259 ---- public void delete() { if (getOwner() != null) { ! Set<Surface> surfaces = getSurfaces(); ! Vertex to = getTo(); ! Vertex from = getFrom(); ! ! // Merge two adjacant surface. ! // FIXME Replace with surface-analysis ! { ! if (surfaces.size() == 2) { ! Iterator<Surface> it = surfaces.iterator(); ! Surface s1 = it.next(); ! Surface s2 = it.next(); ! if (s1.plane().contains(s2)) { ! List<Edge> edges1 = Space.edgeFirst(s1, this); ! List<Edge> edges2 = Space.edgeFirst(s2, this); ! edges1.remove(this); ! edges2.remove(this); ! if (Edge.first(edges1) == Edge.first(edges2)) { ! Collections.reverse(edges2); ! } ! edges1.addAll(edges2); ! Surface surface = new Surface(edges1); ! getOwner().add(surface); ! if (s1.getExterior() != null) { ! s1.getExterior().addHole(surface); ! } else if (s2.getExterior() != null) { ! s2.getExterior().addHole(surface); ! } ! Set<Surface> holes = new HashSet<Surface>(); ! holes.addAll(s1.getHoles()); ! holes.addAll(s2.getHoles()); ! for (Surface hole : holes) { ! surface.addHole(hole); ! } ! Surface.mergeSpaceAssign(s1, s2, surface); ! } ! } ! } ! ! for (Surface surface : surfaces) { ! // Here the surface need to be unlinked ! getOwner().remove(surface); ! } ! ! if (to.getOwner() != null) { ! if (to.getEdges().size() == 0) { ! getOwner().remove(to); ! } ! } ! if (from.getOwner() != null) { ! if (from.getEdges().size() == 0) { ! getOwner().remove(from); ! } ! } ! getOwner().remove(this); } } |
From: Michael L. <he...@us...> - 2007-07-18 13:35:48
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13397/src/net/sourceforge/bprocessor/model Modified Files: Line.java Space.java Point.java CoordinateSystem.java Constructor.java Log Message: Refactoring of delete Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Constructor.java 18 Jul 2007 12:24:05 -0000 1.20 --- Constructor.java 18 Jul 2007 13:35:39 -0000 1.21 *************** *** 119,126 **** return origin; } - - /** {@inheritDoc} */ - @Override - public abstract void delete(); /** --- 119,122 ---- Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** CoordinateSystem.java 18 Jul 2007 12:24:04 -0000 1.53 --- CoordinateSystem.java 18 Jul 2007 13:35:39 -0000 1.54 *************** *** 515,518 **** --- 515,521 ---- @Override public void delete() { + // FIXME other coordinatesystems may refer to this + // CoordinateSystem. These references should be + // cleared. getOwner().remove(this); } Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Point.java 18 Jul 2007 12:24:05 -0000 1.17 --- Point.java 18 Jul 2007 13:35:38 -0000 1.18 *************** *** 41,44 **** --- 41,45 ---- public void delete() { getOwner().remove(this); + // FIXME could other objects refer to this Point? } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** Space.java 18 Jul 2007 12:24:04 -0000 1.158 --- Space.java 18 Jul 2007 13:35:38 -0000 1.159 *************** *** 1688,1691 **** --- 1688,1692 ---- @Override public void delete() { + // FIXME should we clear this Space? clear(); Space owner = this.getOwner(); Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Line.java 18 Jul 2007 12:24:04 -0000 1.33 --- Line.java 18 Jul 2007 13:35:38 -0000 1.34 *************** *** 106,109 **** --- 106,110 ---- @Override public void delete() { + // FIXME can other objects in the model refer to this Line? getOwner().remove(this); } |
From: Michael L. <he...@us...> - 2007-07-18 12:24:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26099/src/net/sourceforge/bprocessor/model Modified Files: Constraint.java Line.java CoordinateSystem.java Entity.java Edge.java Vertex.java ClippingPlane.java Surface.java Space.java Point.java Constructor.java Log Message: Fixed a bunch of comments Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Constructor.java 13 Mar 2007 15:21:24 -0000 1.19 --- Constructor.java 18 Jul 2007 12:24:05 -0000 1.20 *************** *** 121,124 **** --- 121,125 ---- /** {@inheritDoc} */ + @Override public abstract void delete(); Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** CoordinateSystem.java 30 May 2007 17:27:22 -0000 1.52 --- CoordinateSystem.java 18 Jul 2007 12:24:04 -0000 1.53 *************** *** 513,516 **** --- 513,517 ---- /** {@inheritDoc} */ + @Override public void delete() { getOwner().remove(this); Index: Constraint.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constraint.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Constraint.java 29 Sep 2006 14:57:24 -0000 1.4 --- Constraint.java 18 Jul 2007 12:24:04 -0000 1.5 *************** *** 117,123 **** } ! /** ! * Delete the entity */ public void delete() { Project.getInstance().delete(this); --- 117,124 ---- } ! /** ! * {@inheritDoc} */ + @Override public void delete() { Project.getInstance().delete(this); Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.168 retrieving revision 1.169 diff -C2 -d -r1.168 -r1.169 *** Surface.java 7 Jun 2007 07:04:40 -0000 1.168 --- Surface.java 18 Jul 2007 12:24:04 -0000 1.169 *************** *** 317,324 **** } ! /** ! * Delete surface ! * ! */ public void delete() { if (getOwner() != null) { --- 317,322 ---- } ! /** {@inheritDoc} */ ! @Override public void delete() { if (getOwner() != null) { Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** Edge.java 29 May 2007 11:49:22 -0000 1.91 --- Edge.java 18 Jul 2007 12:24:04 -0000 1.92 *************** *** 198,204 **** } ! /** ! * Delete ! */ public void delete() { if (getOwner() != null) { --- 198,203 ---- } ! /** {@inheritDoc} */ ! @Override public void delete() { if (getOwner() != null) { Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ClippingPlane.java 7 May 2007 13:31:09 -0000 1.20 --- ClippingPlane.java 18 Jul 2007 12:24:04 -0000 1.21 *************** *** 156,163 **** } /** ! * FIXME: empty implementation to make compile ! * (pfff make sure stuff compiles before you check in please) */ public void delete() { Camera c = Project.getInstance().getCurrentCamera(); --- 156,164 ---- } + /** ! * {@inheritDoc} */ + @Override public void delete() { Camera c = Project.getInstance().getCurrentCamera(); Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Point.java 16 Apr 2007 15:55:22 -0000 1.16 --- Point.java 18 Jul 2007 12:24:05 -0000 1.17 *************** *** 37,43 **** } ! /** ! * Delete the entity from the model ! */ public void delete() { getOwner().remove(this); --- 37,42 ---- } ! /** {@inheritDoc} */ ! @Override public void delete() { getOwner().remove(this); Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Entity.java 8 May 2007 11:08:11 -0000 1.18 --- Entity.java 18 Jul 2007 12:24:04 -0000 1.19 *************** *** 117,121 **** /** ! * Delete the entity from the model */ public abstract void delete(); --- 117,124 ---- /** ! * Deletes this Entity from the model by removing ! * it from the owning object and clearing all ! * references from other objects. Other objects may be ! * deleted as a consequence of deleting this Entity. */ public abstract void delete(); Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.157 retrieving revision 1.158 diff -C2 -d -r1.157 -r1.158 *** Space.java 16 Jul 2007 12:22:52 -0000 1.157 --- Space.java 18 Jul 2007 12:24:04 -0000 1.158 *************** *** 1685,1691 **** } ! /** ! * Delete the entity ! */ @Override public void delete() { --- 1685,1689 ---- } ! /** {@inheritDoc} */ @Override public void delete() { Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Line.java 16 Apr 2007 15:55:22 -0000 1.32 --- Line.java 18 Jul 2007 12:24:04 -0000 1.33 *************** *** 103,109 **** } ! /** ! * Delete the entity from the model ! */ public void delete() { getOwner().remove(this); --- 103,108 ---- } ! /** {@inheritDoc} */ ! @Override public void delete() { getOwner().remove(this); Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Vertex.java 29 May 2007 11:49:22 -0000 1.61 --- Vertex.java 18 Jul 2007 12:24:04 -0000 1.62 *************** *** 497,503 **** } ! /** ! * Remove the entity ! */ public void delete() { if (getOwner() != null) { --- 497,502 ---- } ! /** {@inheritDoc} */ ! @Override public void delete() { if (getOwner() != null) { |
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26099/src/net/sourceforge/bprocessor/model/modellor Modified Files: InnerWallModellor.java LayerModellor.java TileModellor.java Cylinder.java ModelBathModellor.java Log Message: Fixed a bunch of comments Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TileModellor.java 30 May 2007 17:28:58 -0000 1.16 --- TileModellor.java 18 Jul 2007 12:24:09 -0000 1.17 *************** *** 486,492 **** } ! /** ! * {@inheritDoc} ! */ @Override public void delete() { --- 486,490 ---- } ! /** {@inheritDoc} */ @Override public void delete() { Index: ModelBathModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ModelBathModellor.java 9 May 2007 09:33:03 -0000 1.4 --- ModelBathModellor.java 18 Jul 2007 12:24:09 -0000 1.5 *************** *** 206,209 **** --- 206,210 ---- /** {@inheritDoc} */ + @Override public void delete() { space.setModellor(null); Index: LayerModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/LayerModellor.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** LayerModellor.java 16 Apr 2007 15:54:42 -0000 1.12 --- LayerModellor.java 18 Jul 2007 12:24:06 -0000 1.13 *************** *** 163,169 **** } ! /** ! * Delete the entity ! */ public void delete() { space.clear(); --- 163,168 ---- } ! /** {@inheritDoc} */ ! @Override public void delete() { space.clear(); Index: Cylinder.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/Cylinder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Cylinder.java 17 Apr 2007 13:04:44 -0000 1.3 --- Cylinder.java 18 Jul 2007 12:24:09 -0000 1.4 *************** *** 134,140 **** } ! /** ! * {@inheritDoc} ! */ public void delete() { space = null; --- 134,139 ---- } ! /** {@inheritDoc} */ ! @Override public void delete() { space = null; Index: InnerWallModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/InnerWallModellor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** InnerWallModellor.java 25 Jun 2007 10:26:46 -0000 1.5 --- InnerWallModellor.java 18 Jul 2007 12:24:05 -0000 1.6 *************** *** 579,585 **** ! /** ! * {@inheritDoc} ! */ @Override public void delete() { --- 579,583 ---- ! /** {@inheritDoc} */ @Override public void delete() { |
From: Michael L. <he...@us...> - 2007-07-17 12:13:50
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30906/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Smalltime stuff Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** PopupMenu.java 21 Jun 2007 09:29:11 -0000 1.37 --- PopupMenu.java 17 Jul 2007 12:13:50 -0000 1.38 *************** *** 379,398 **** public static JPopupMenu getEntiesMenu(Collection<Geometric> entities) { JPopupMenu menu = new JPopupMenu(); ! AbstractAction delete = new EntitiesMenuAction(entities, "Delete") { public void actionPerformed(ActionEvent arg0) { if (entities != null) { - Collection c = new LinkedList(); - c.addAll(entities); - Iterator iter = c.iterator(); - Project p = Project.getInstance(); Selection.primary().clear(); ! while (iter.hasNext()) { ! Entity e = (Entity)iter.next(); ! e.delete(); ! p.changed(e); } ! p.changed(Geometry.collect(c)); ! p.checkpoint(); ! } } --- 379,392 ---- public static JPopupMenu getEntiesMenu(Collection<Geometric> entities) { JPopupMenu menu = new JPopupMenu(); ! AbstractAction delete = new EntitiesMenuAction(entities, "Delete Entities") { public void actionPerformed(ActionEvent arg0) { if (entities != null) { Selection.primary().clear(); ! for (Entity current : entities) { ! current.delete(); ! Project.getInstance().changed(current); } ! Project.getInstance().changed(Geometry.collect(entities)); ! Project.getInstance().checkpoint(); } } |
From: Michael L. <he...@us...> - 2007-07-17 12:13:45
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30898/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Smalltime stuff Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** SpaceTool.java 15 Jun 2007 11:57:06 -0000 1.81 --- SpaceTool.java 17 Jul 2007 12:13:46 -0000 1.82 *************** *** 119,123 **** continue; } else { ! return PopupMenu.getEntiesMenu(Selection.primary()); } } --- 119,123 ---- continue; } else { ! return PopupMenu.getEntiesMenu(new LinkedList(Selection.primary())); } } *************** *** 127,131 **** return PopupMenu.getSurfaceMenu(Selection.primary()); } else { ! return PopupMenu.getEntiesMenu(Selection.primary()); } } --- 127,131 ---- return PopupMenu.getSurfaceMenu(Selection.primary()); } else { ! return PopupMenu.getEntiesMenu(new LinkedList(Selection.primary())); } } |