bprocessor-commit Mailing List for B-processor (Page 90)
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: Nikolaj B. <nbr...@us...> - 2006-11-16 23:20:43
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21757/src/net/sourceforge/bprocessor/model Modified Files: Classification.java Space.java Project.java Persistence.java Log Message: Name is now almost gone from spaces, both functional and construction are giving classification when created. And fixed and improved some things with the classification. Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Persistence.java 13 Nov 2006 12:20:52 -0000 1.21 --- Persistence.java 16 Nov 2006 23:20:39 -0000 1.22 *************** *** 166,170 **** space.setDescription(xml.getDescription()); if (!xml.getClassification().equalsIgnoreCase("unassigned")) { ! space.setClassification(Project.getInstance().getClassification(xml.getClassification())); } mapper.put(new Long(xml.getId()), space); --- 166,176 ---- space.setDescription(xml.getDescription()); if (!xml.getClassification().equalsIgnoreCase("unassigned")) { ! if (type == 0) { ! space.setClassification(Project.getInstance(). ! getClassification(xml.getClassification(), 0)); ! } else { ! space.setClassification(Project.getInstance(). ! getClassification(xml.getClassification(), 1)); ! } } mapper.put(new Long(xml.getId()), space); Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** Space.java 13 Nov 2006 12:25:33 -0000 1.100 --- Space.java 16 Nov 2006 23:20:39 -0000 1.101 *************** *** 224,227 **** --- 224,229 ---- } + + /** * Create a Construction Space *************** *** 246,249 **** --- 248,281 ---- } + + /** + * Create a Construction Space + * @param cl The classification + * @return The space + * @throws Exception If a part is being extended + */ + public Space createConstructionSpace(Classification cl) throws Exception { + Space cur; + if (this.level == PART_LEVEL) { + throw new Exception("Not leagal to make further levels of detail, max level is PART"); + } + if (this.level == ELEMENT_LEVEL) { + cur = new Space("", Space.CONSTRUCTION, PART_LEVEL, false); + cur.setClassification(cl); + return cur; + } + if (this.level == SPACE_LEVEL) { + cur = new Space("", Space.CONSTRUCTION, ELEMENT_LEVEL, false); + cur.setClassification(cl); + return cur; + } + if (this.level == PROJECT_LEVEL) { + cur = new Space("", Space.CONSTRUCTION, SPACE_LEVEL, false); + cur.setClassification(cl); + return cur; + } + return null; + } + /** * Create a Functional Space *************** *** 269,272 **** --- 301,333 ---- /** + * Create a Functional Space + * @param cl The classification + * @return The space + * @throws Exception If a part is being extended + */ + public Space createFunctionalSpace(Classification cl) throws Exception { + Space cur; + if (this.level == PART_LEVEL) { + throw new Exception("Not leagal to make further levels of detail, max level is PART"); + } + if (this.level == ELEMENT_LEVEL) { + cur = new Space("", Space.FUNCTIONAL , PART_LEVEL, false); + cur.setClassification(cl); + return cur; + } + if (this.level == SPACE_LEVEL) { + cur = new Space("", Space.FUNCTIONAL, ELEMENT_LEVEL, false); + cur.setClassification(cl); + return cur; + } + if (this.level == PROJECT_LEVEL) { + cur = new Space("", Space.FUNCTIONAL, SPACE_LEVEL, false); + cur.setClassification(cl); + return cur; + } + return null; + } + + /** * Get type * @return type *************** *** 353,357 **** */ public String getName() { ! return name; } --- 414,422 ---- */ public String getName() { ! if (getClassification() != null) { ! return getClassification().toString(); ! } else { ! return name; ! } } *************** *** 1429,1435 **** if (isConstructionSpace()) { res.add(new Attribute("Classification", ! Project.getInstance().getClassification(), getClassification(), 1)); } else { ! //res.add(new Attribute("Classification", functionalOptions, getClassification())); } } else { --- 1494,1501 ---- if (isConstructionSpace()) { res.add(new Attribute("Classification", ! Project.getInstance().getConstructionClas(), getClassification(), 1)); } else { ! res.add(new Attribute("Classification", ! Project.getInstance().getFunctionalClas(), getClassification(), 1)); } } else { *************** *** 1442,1449 **** } else { res.add(new Attribute("Classification", ! Project.getInstance().getClassification(), getClassification(), 2)); } } else { ! //res.add(new Attribute("Classification", elementFunctionalOptions, getClassification())); } } else if (getLevel() == Space.PART_LEVEL) { --- 1508,1521 ---- } else { res.add(new Attribute("Classification", ! Project.getInstance().getConstructionClas(), getClassification(), 2)); } } else { ! if (getOwner().getClassification() != null) { ! res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification(), 2)); ! } else { ! res.add(new Attribute("Classification", ! Project.getInstance().getFunctionalClas(), getClassification(), 2)); ! } } } else if (getLevel() == Space.PART_LEVEL) { *************** *** 1454,1461 **** } else { res.add(new Attribute("Classification", ! Project.getInstance().getClassification(), getClassification(), 3)); } } else { ! //res.add(new Attribute("Classification", partFunctionalOptions, getClassification())); } } --- 1526,1539 ---- } else { res.add(new Attribute("Classification", ! Project.getInstance().getConstructionClas(), getClassification(), 3)); } } else { ! if (getOwner().getClassification() != null) { ! res.add(new Attribute("Classification", ! getOwner().getClassification(), getClassification(), 3)); ! } else { ! res.add(new Attribute("Classification", ! Project.getInstance().getFunctionalClas(), getClassification(), 3)); ! } } } *************** *** 1546,1550 **** break; } ! return name + " - " + res + id; } --- 1624,1632 ---- break; } ! if (getClassification() != null) { ! return getClassification().toString() + " - " + res + id; ! } else { ! return name + " - " + res + id; ! } } Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Classification.java 10 Nov 2006 13:48:44 -0000 1.3 --- Classification.java 16 Nov 2006 23:20:39 -0000 1.4 *************** *** 22,26 **** /** The id of the classification */ ! private Integer id; /** The children of this classification */ --- 22,26 ---- /** The id of the classification */ ! private String id; /** The children of this classification */ *************** *** 30,42 **** private Classification parent; /** * The constructor for a new classification * @param id the id * @param name the name * @param parent the parent */ ! public Classification(Integer id, String name, Classification parent) { setName(name); setId(id); setParent(parent); } --- 30,53 ---- private Classification parent; + /** Construction Type */ + public static final int CONSTRUCTION = 0; + + /** functional Type */ + public static final int FUNCTIONAL = 1; + + /** type */ + private int type; + /** * The constructor for a new classification * @param id the id * @param name the name + * @param type the type * @param parent the parent */ ! public Classification(String id, String name, Classification parent, int type) { setName(name); setId(id); + setType(type); setParent(parent); } *************** *** 45,60 **** * Constructor for a custom name element * @param name the name */ ! public Classification(String name) { setName(name); ! setId(new Integer(-1)); } /** * Constructor for base element */ ! public Classification() { setName("Classification"); ! setId(new Integer(0)); } --- 56,75 ---- * Constructor for a custom name element * @param name the name + * @param type the type */ ! public Classification(String name, int type) { setName(name); ! setType(type); ! setId(new String("-1")); } /** * Constructor for base element + * @param type the type */ ! public Classification(int type) { setName("Classification"); ! setId(new String("0")); ! setType(type); } *************** *** 87,91 **** * @return the id */ ! public Integer getId () { return id; } --- 102,106 ---- * @return the id */ ! public String getId () { return id; } *************** *** 95,99 **** * @param id the id to be set */ ! public void setId (Integer id) { this.id = id; } --- 110,114 ---- * @param id the id to be set */ ! public void setId (String id) { this.id = id; } *************** *** 131,137 **** String fullId = id.toString(); Classification par = parent; ! while (!par.getName().equalsIgnoreCase("Classification")) { ! fullId = par.getId() + "." + fullId; ! par = par.getParent(); } return fullId; --- 146,154 ---- String fullId = id.toString(); Classification par = parent; ! if (par != null) { ! while (!par.getName().equalsIgnoreCase("Classification")) { ! fullId = par.getId() + "." + fullId; ! par = par.getParent(); ! } } return fullId; *************** *** 146,149 **** --- 163,182 ---- } + /** + * Return the type of this classification + * @return type the type + */ + public int getType() { + return type; + } + + /** + * Set the type of this classification + * @param type the type + */ + public void setType(int type) { + this.type = type; + } + Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** Project.java 13 Nov 2006 12:20:52 -0000 1.91 --- Project.java 16 Nov 2006 23:20:39 -0000 1.92 *************** *** 47,51 **** /** The classification */ ! private Classification clas = new Classification(); /** The cameras */ --- 47,54 ---- /** The classification */ ! private Classification constructionClas = new Classification(0); ! ! /** The classification */ ! private Classification functionalClas = new Classification(1); /** The cameras */ *************** *** 130,134 **** Modellor.registerModellor(new LayerModellor()); try { ! loadClassification(); } catch (Exception e) { System.out.println("loading classification"); --- 133,138 ---- Modellor.registerModellor(new LayerModellor()); try { ! loadClassification(true); ! loadClassification(false); } catch (Exception e) { System.out.println("loading classification"); *************** *** 777,791 **** * This method loads the classification document from a file * @exception Exception Thrown if an exception occurs */ ! public void loadClassification() throws Exception { String current = ""; String token = ""; String curname = ""; ! Integer curid; ! Classification parent = new Classification(); ! Classification last = new Classification(); int depth = 0; int lastdepth = 0; ! BufferedReader bf = new BufferedReader(new FileReader("classification.csv")); current = bf.readLine(); while (!current.equalsIgnoreCase("--stop--")) { --- 781,808 ---- * This method loads the classification document from a file * @exception Exception Thrown if an exception occurs + * @param construction true if its construction space classification, false if functional */ ! public void loadClassification(boolean construction) throws Exception { ! Classification clas; String current = ""; String token = ""; String curname = ""; ! String curid; ! Classification parent; ! Classification last; int depth = 0; int lastdepth = 0; ! BufferedReader bf; ! if (construction) { ! bf = new BufferedReader(new FileReader("classification.csv")); ! clas = new Classification(0); ! parent = new Classification(0); ! last = new Classification(0); ! } else { ! bf = new BufferedReader(new FileReader("funcClassification.csv")); ! clas = new Classification(1); ! parent = new Classification(1); ! last = new Classification(1); ! } current = bf.readLine(); while (!current.equalsIgnoreCase("--stop--")) { *************** *** 794,801 **** token = st.nextToken(); if (depth == 0 && !token.equalsIgnoreCase(";")) { ! curid = new Integer(token); st.nextToken(); curname = st.nextToken(); ! Classification curclas = new Classification(curid, curname, clas); parent = curclas; clas.addChild(curclas); --- 811,823 ---- token = st.nextToken(); if (depth == 0 && !token.equalsIgnoreCase(";")) { ! curid = new String(token); st.nextToken(); curname = st.nextToken(); ! Classification curclas; ! if (construction) { ! curclas = new Classification(curid, curname, clas, 0); ! } else { ! curclas = new Classification(curid, curname, clas, 1); ! } parent = curclas; clas.addChild(curclas); *************** *** 805,809 **** depth++; } else if (depth != 0 && !token.equalsIgnoreCase(";")) { ! curid = new Integer(token); st.nextToken(); curname = st.nextToken(); --- 827,831 ---- depth++; } else if (depth != 0 && !token.equalsIgnoreCase(";")) { ! curid = new String(token); st.nextToken(); curname = st.nextToken(); *************** *** 814,818 **** parent = parent.getParent(); } ! Classification curclas = new Classification(curid, curname, parent); parent.addChild(curclas); last = curclas; --- 836,845 ---- parent = parent.getParent(); } ! Classification curclas; ! if (construction) { ! curclas = new Classification(curid, curname, parent, 0); ! } else { ! curclas = new Classification(curid, curname, parent, 1); ! } parent.addChild(curclas); last = curclas; *************** *** 823,834 **** current = bf.readLine(); } } /** ! * this method returns the classification ! * @return Classification the classification * */ ! public Classification getClassification () { ! return clas; } --- 850,878 ---- current = bf.readLine(); } + if (construction) { + constructionClas = clas; + constructionClas.addChild( + new Classification("-99", "Egne klassifikationer", constructionClas, 0)); + } else { + functionalClas = clas; + functionalClas.addChild( + new Classification("-99", "Egne klassifikationer", functionalClas, 1)); + } } /** ! * this method returns the construction space classification ! * @return Classification the construction space classification * */ ! public Classification getConstructionClas () { ! return constructionClas; ! } ! ! /** ! * this method returns the funcational space classification ! * @return Classification the funcational space classification ! * */ ! public Classification getFunctionalClas () { ! return functionalClas; } *************** *** 836,844 **** * this method returns the classification * @param id the id of the classification wanted * @return Classification the classification * */ ! public Classification getClassification(String id) { StringTokenizer st = new StringTokenizer(id, "."); ! Classification cl = clas; String curid; while (st.hasMoreTokens()) { --- 880,894 ---- * this method returns the classification * @param id the id of the classification wanted + * @param type 0 if its construction space classification, 1 if functional * @return Classification the classification * */ ! public Classification getClassification(String id, int type) { StringTokenizer st = new StringTokenizer(id, "."); ! Classification cl; ! if (type == 0) { ! cl = constructionClas; ! } else { ! cl = functionalClas; ! } String curid; while (st.hasMoreTokens()) { *************** *** 847,851 **** while (it.hasNext()) { Classification current = (Classification) it.next(); ! if (curid.equalsIgnoreCase(current.getId().toString())) { cl = current; } --- 897,901 ---- while (it.hasNext()) { Classification current = (Classification) it.next(); ! if (curid.equalsIgnoreCase(current.getId())) { cl = current; } |
From: Nikolaj B. <nbr...@us...> - 2006-11-16 23:20:14
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21442/src/net/sourceforge/bprocessor/gui/attrview Modified Files: ClassificationIdAttribute.java ClassificationTextAttribute.java GenericPanel.java Log Message: Name is now almost gone from spaces, both functional and construction are giving classification when created. And fixed and improved some things with the classification. Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** GenericPanel.java 13 Nov 2006 13:22:26 -0000 1.27 --- GenericPanel.java 16 Nov 2006 23:20:04 -0000 1.28 *************** *** 208,212 **** genAttributes.add(catext);; where.add(new AttributeRow(catext)); ! if (a.getClassification() != null && a.getClassification().getId().intValue() != -1) { // Handles the id part of classification ClassificationIdAttribute caid = new ClassificationIdAttribute(a); --- 208,213 ---- genAttributes.add(catext);; where.add(new AttributeRow(catext)); ! if (a.getClassification() != null && ! !a.getClassification().getId().equalsIgnoreCase("-1")) { // Handles the id part of classification ClassificationIdAttribute caid = new ClassificationIdAttribute(a); Index: ClassificationTextAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationTextAttribute.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClassificationTextAttribute.java 10 Nov 2006 13:47:41 -0000 1.2 --- ClassificationTextAttribute.java 16 Nov 2006 23:20:04 -0000 1.3 *************** *** 163,167 **** submi = new MyMenuItem(current); submi.addActionListener(this); ! subMenu.add(submi); while (subit.hasNext()) { Classification subcur = (Classification) subit.next(); --- 163,169 ---- submi = new MyMenuItem(current); submi.addActionListener(this); ! if (!current.getId().equalsIgnoreCase("-99")) { ! subMenu.add(submi); ! } while (subit.hasNext()) { Classification subcur = (Classification) subit.next(); *************** *** 187,191 **** private JComponent createValueLabel(Classification value) { JLabel valueLabel; ! if (attribute.getClassification().getId().intValue() == -1) { valueLabel = new JLabel(value.getName()); } else { --- 189,193 ---- private JComponent createValueLabel(Classification value) { JLabel valueLabel; ! if (attribute.getClassification().getId().equalsIgnoreCase("-1")) { valueLabel = new JLabel(value.getName()); } else { *************** *** 233,236 **** --- 235,241 ---- MyMenuItem source = (MyMenuItem)(e.getSource()); attribute.setClassification(source.getClassification()); + component.remove(0); + component.add(createValueLabel(attribute.getClassification())); + component.revalidate(); valueChanged(); } *************** *** 292,295 **** --- 297,305 ---- 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()); + } else { + cur.addAll(Project.getInstance().getClassification("-99", 1).getChildren()); + } Classification current; Classification entered = null; *************** *** 308,314 **** if (entered != null) { attribute.setClassification(entered); ! } else { ! Classification newclas = new Classification(editor.getText()); ! Project.getInstance().getClassification().addChild(newclas); attribute.setClassification(newclas); } --- 318,333 ---- if (entered != null) { attribute.setClassification(entered); ! } else { ! Classification newclas; ! if (((Classification) attribute.getValue()).getType() == 0) { ! newclas = new Classification("-1", editor.getText(), ! Project.getInstance().getClassification("-99", 0), 0); ! Project.getInstance().getClassification("-99", 0).addChild(newclas); ! } else { ! newclas = new Classification("-1", editor.getText(), ! Project.getInstance().getClassification("-99", 1), 1); ! Project.getInstance().getClassification("-99", 1).addChild(newclas); ! } ! attribute.setClassification(newclas); } *************** *** 323,327 **** /** ! * Not in use */ public void cancelEditing() { --- 342,346 ---- /** ! * Cancel editing */ public void cancelEditing() { *************** *** 340,346 **** */ public void mouseClicked(MouseEvent event) { } ! /** ! * Not in use * @param event The MouseEvent */ --- 359,365 ---- */ public void mouseClicked(MouseEvent event) { } ! /** ! * Shows the classification * @param event The MouseEvent */ *************** *** 348,352 **** classification.show(event.getComponent(), event.getX(), event.getY()); ! } --- 367,371 ---- classification.show(event.getComponent(), event.getX(), event.getY()); ! } *************** *** 368,372 **** */ public void mouseExited(MouseEvent event) { } ! /** * Respond to the enter key by stopping editing. --- 387,391 ---- */ public void mouseExited(MouseEvent event) { } ! /** * Respond to the enter key by stopping editing. *************** *** 397,401 **** */ ! /** * Autocomplete textfield --- 416,420 ---- */ ! /** * Autocomplete textfield *************** *** 429,433 **** /** The parent classification */ private Classification parent; ! /** * The AutoCompleteDocoment constructor --- 448,452 ---- /** The parent classification */ private Classification parent; ! /** * The AutoCompleteDocoment constructor *************** *** 479,483 **** while (it.hasNext()) { Classification current = (Classification) it.next(); ! sort.add(current.toString()); if (current.getChildren() != null) { children = true; --- 498,504 ---- while (it.hasNext()) { Classification current = (Classification) it.next(); ! if (!current.getId().equalsIgnoreCase("-99")) { ! sort.add(current.toString()); ! } if (current.getChildren() != null) { children = true; *************** *** 487,491 **** while (subit.hasNext()) { String conc = ""; ! conc = current.toString() + "." + ((Classification) subit.next()).toString(); sort.add(conc); } --- 508,516 ---- 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); } Index: ClassificationIdAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationIdAttribute.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClassificationIdAttribute.java 10 Nov 2006 13:47:41 -0000 1.2 --- ClassificationIdAttribute.java 16 Nov 2006 23:20:04 -0000 1.3 *************** *** 64,68 **** component = Box.createHorizontalBox(); if (!attribute.getClassification().getName().equalsIgnoreCase("Classification") && ! attribute.getClassification().getId().intValue() != -1) { component.add(createValueLabel(attribute.getClassification().getFullId())); } --- 64,68 ---- component = Box.createHorizontalBox(); if (!attribute.getClassification().getName().equalsIgnoreCase("Classification") && ! !attribute.getClassification().getId().equalsIgnoreCase("-1")) { component.add(createValueLabel(attribute.getClassification().getFullId())); } *************** *** 209,216 **** public void stopEditing() { if (editor != null) { ! Object val = attribute.getValue(); String id = editor.getText(); StringTokenizer st = new StringTokenizer(id, "."); ! Classification clas = Project.getInstance().getClassification(); String curid; while (st.hasMoreTokens()) { --- 209,221 ---- public void stopEditing() { if (editor != null) { ! //Object val = attribute.getValue(); String id = editor.getText(); StringTokenizer st = new StringTokenizer(id, "."); ! Classification clas; ! if (((Classification) attribute.getValue()).getType() == 0) { ! clas = Project.getInstance().getConstructionClas(); ! } else { ! clas = Project.getInstance().getFunctionalClas(); ! } String curid; while (st.hasMoreTokens()) { *************** *** 219,223 **** while (it.hasNext()) { Classification current = (Classification) it.next(); ! if (curid.equalsIgnoreCase(current.getId().toString())) { clas = current; } --- 224,228 ---- while (it.hasNext()) { Classification current = (Classification) it.next(); ! if (curid.equalsIgnoreCase(current.getId())) { clas = current; } |
From: Nikolaj B. <nbr...@us...> - 2006-11-16 23:20:14
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21442/src/net/sourceforge/bprocessor/gui/actions Modified Files: CreateConstructionSpaceActionListener.java Log Message: Name is now almost gone from spaces, both functional and construction are giving classification when created. And fixed and improved some things with the classification. Index: CreateConstructionSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateConstructionSpaceActionListener.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CreateConstructionSpaceActionListener.java 4 Oct 2006 14:43:24 -0000 1.11 --- CreateConstructionSpaceActionListener.java 16 Nov 2006 23:20:04 -0000 1.12 *************** *** 13,16 **** --- 13,17 ---- import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import javax.swing.JOptionPane; *************** *** 24,27 **** --- 25,29 ---- private static Logger log = Logger.getLogger(CreateConstructionSpaceActionListener.class); + /** * CreateConstructionSpaceActionListener *************** *** 39,42 **** --- 41,47 ---- "Create Construction Space", JOptionPane.QUESTION_MESSAGE); + + + if (log.isDebugEnabled()) { log.debug("Input: " + result); *************** *** 53,56 **** --- 58,64 ---- } } + + } + } |
From: Nikolaj B. <nbr...@us...> - 2006-11-16 23:19:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21296/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Name is now almost gone from spaces, both functional and construction are giving classification when created. And fixed and improved some things with the classification. Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.161 retrieving revision 1.162 diff -C2 -d -r1.161 -r1.162 *** View.java 13 Nov 2006 14:56:11 -0000 1.161 --- View.java 16 Nov 2006 23:19:32 -0000 1.162 *************** *** 985,989 **** if (it.hasNext()) { Space sp = (Space)it.next(); ! name = sp.getName(); int sepLength = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_10, " >> ");; int length = 0; --- 985,993 ---- if (it.hasNext()) { Space sp = (Space)it.next(); ! if (sp.getClassification() != null) { ! name = sp.getClassification().toString(); ! } else { ! name = sp.getName(); ! } int sepLength = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_10, " >> ");; int length = 0; *************** *** 996,1000 **** while (it.hasNext()) { sp = (Space)it.next(); ! name = name + " >> " + sp.getName(); length += sepLength; nameLength = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_10, sp.getName()); --- 1000,1008 ---- while (it.hasNext()) { sp = (Space)it.next(); ! if (sp.getClassification() != null) { ! name = name + " >> " + sp.getClassification().toString(); ! } else { ! name = name + " >> " + sp.getName(); ! } length += sepLength; nameLength = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_10, sp.getName()); |
From: Nikolaj B. <nbr...@us...> - 2006-11-16 23:19:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21296/src/net/sourceforge/bprocessor/gl/tool Modified Files: CreateSpaceActionListener.java Log Message: Name is now almost gone from spaces, both functional and construction are giving classification when created. And fixed and improved some things with the classification. Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CreateSpaceActionListener.java 14 Oct 2006 23:40:49 -0000 1.11 --- CreateSpaceActionListener.java 16 Nov 2006 23:19:32 -0000 1.12 *************** *** 8,19 **** import net.sourceforge.bprocessor.gui.GUI; ! import javax.swing.JOptionPane; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; ! import java.util.Iterator; ! import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; --- 8,25 ---- import net.sourceforge.bprocessor.gui.GUI; + import net.sourceforge.bprocessor.gui.attrview.ClassificationTextAttribute; ! import javax.swing.Box; ! import javax.swing.JButton; ! import javax.swing.JDialog; + import java.awt.Component; + import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; ! import java.awt.event.MouseEvent; ! import java.awt.event.MouseListener; + import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; *************** *** 25,29 **** * The create functional space action listener for the domain popupmenu. */ ! public class CreateSpaceActionListener implements ActionListener { /** The logger */ private static Logger log = Logger.getLogger(CreateSpaceActionListener.class); --- 31,35 ---- * The create functional space action listener for the domain popupmenu. */ ! public class CreateSpaceActionListener implements ActionListener, MouseListener { /** The logger */ private static Logger log = Logger.getLogger(CreateSpaceActionListener.class); *************** *** 41,44 **** --- 47,56 ---- private String category; + /** The classification attribute */ + private ClassificationTextAttribute cta; + + /** The dialog window */ + private JDialog dialog; + /** * CreateSpaceActionListener *************** *** 71,141 **** } if (functional) { ! result = JOptionPane.showInputDialog(GUI.getInstance(), ! "Name", ! "Create Functional " + category, ! JOptionPane.QUESTION_MESSAGE); ! } else { ! result = JOptionPane.showInputDialog(GUI.getInstance(), ! "Name", ! "Create Construction " + category, ! JOptionPane.QUESTION_MESSAGE); } if (log.isDebugEnabled()) { log.debug("Input: " + result); } ! Space owner = surface.getOwner(); - if (result != null && !result.trim().equals("")) { - try { - Space space; - if (functional) { - space = owner.createFunctionalSpace(result.trim()); - } else { - space = owner.createConstructionSpace(result.trim()); - } - owner.add(space); - if (front) { - surface.setFrontDomain(space); - } else { - surface.setBackDomain(space); - } - surface.changed(); - Project.getInstance().checkpoint(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } } /** ! * checkName checks if the name entered is not used ! * @param result the name to check for uniqueness ! * @return res a unique and verified name */ ! private String checkName(String result) { ! String res = result; ! boolean used = false; ! Iterator it = Project.getInstance().getSpaces().iterator(); ! while (it.hasNext()) { ! Space current = (Space) it.next(); ! if (current.getName().equals(result)) { ! res = JOptionPane.showInputDialog(GUI.getInstance(), ! "Please enter a unique name", ! "Create Functional " + category, ! JOptionPane.QUESTION_MESSAGE); ! used = true; ! } ! } ! if (used) { ! res = checkName(res); ! } ! return res; } ! } --- 83,212 ---- } + + result = ""; if (functional) { ! dialog = new JDialog(GUI.getInstance(), "Create Functional Space", true); ! cta = new ClassificationTextAttribute( ! new Attribute("Classification", Project.getInstance().getFunctionalClas(), null, 1)); } else { ! dialog = new JDialog(GUI.getInstance(), "Create Construction Space", true); ! cta = new ClassificationTextAttribute( ! new Attribute("Classification", Project.getInstance().getConstructionClas(), null, 1)); } + Container dialogContent = dialog.getContentPane(); + cta.addMouseListener(this); + Box content = Box.createVerticalBox(); + Box fr = Box.createHorizontalBox(); + Box sr = Box.createHorizontalBox(); + fr.add(cta); + JButton ok = new JButton("Ok"); + ok.addActionListener(new MyActionListener()); + JButton cancel = new JButton("Cancel"); + cancel.addActionListener(new MyActionListener()); + sr.add(ok); + sr.add(cancel); + content.add(fr); + content.add(sr); + dialogContent.add(content); + dialog.setSize(200, 80); + dialog.setLocationRelativeTo((Component)e.getSource()); + dialog.show(); + if (log.isDebugEnabled()) { log.debug("Input: " + result); } + } + + /** + * Start editing + * @param event The MouseEvent + */ + public void mouseClicked(MouseEvent event) { + cta.startEditing(); ! } ! ! ! /** ! * Not in use ! * @param event The MouseEvent ! */ ! public void mouseEntered(MouseEvent event) { ! // TODO Auto-generated method stub } /** ! * Not in use ! * @param event The MouseEvent */ ! public void mouseExited(MouseEvent event) { ! // TODO Auto-generated method stub ! } + /** + * Not in use + * @param event The MouseEvent + */ + public void mousePressed(MouseEvent event) { + // TODO Auto-generated method stub + + } + /** + * Not in use + * @param event The MouseEvent + */ + public void mouseReleased(MouseEvent event) { + // TODO Auto-generated method stub + + } ! /** ! * My action listener ! */ ! class MyActionListener implements ActionListener { ! ! /** ! * the action performed event handling ! * @param e is the action event ! */ ! public void actionPerformed(ActionEvent e) { ! String name = ((JButton) e.getSource()).getLabel(); ! 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); ! if (front) { ! surface.setFrontDomain(space); ! } else { ! surface.setBackDomain(space); ! } ! surface.changed(); ! Project.getInstance().checkpoint(); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } ! } ! dialog.show(false); ! } ! } ! ! if (name.equalsIgnoreCase("Cancel")) { ! dialog.show(false); ! ! } ! } ! ! } } |
From: Nikolaj B. <nbr...@us...> - 2006-11-16 23:18:06
|
Update of /cvsroot/bprocessor/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20542 Added Files: funcClassification.csv Log Message: classification for functional spaces --- NEW FILE: funcClassification.csv --- (This appears to be a binary file; contents omitted.) |
From: Nordholt <nor...@us...> - 2006-11-16 14:28:34
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30479/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: fixing depth and frame thickness Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** FacadeModellor.java 12 Nov 2006 23:02:46 -0000 1.28 --- FacadeModellor.java 16 Nov 2006 14:28:32 -0000 1.29 *************** *** 274,277 **** --- 274,278 ---- if (n != frameWidth) { frameWidth = n; + changeCons = true; changeFacade = true; } *************** *** 687,693 **** FacadeModellor wm = new FacadeModellor(w, s); w.setModellor(wm); - //wm.setFront(s); wm.setFrameWidth(0.1); ! wm.setDepth(0.2); wm.setHorPosts(0); wm.setVertPosts(0); --- 688,693 ---- FacadeModellor wm = new FacadeModellor(w, s); w.setModellor(wm); wm.setFrameWidth(0.1); ! wm.setDepth(depth); wm.setHorPosts(0); wm.setVertPosts(0); |
From: Nordholt <nor...@us...> - 2006-11-16 14:27:05
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29665/src/net/sourceforge/bprocessor/facade Modified Files: FacadeMain.java Log Message: removed the window modellor Index: FacadeMain.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/FacadeMain.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FacadeMain.java 21 Aug 2006 14:17:56 -0000 1.3 --- FacadeMain.java 16 Nov 2006 14:26:57 -0000 1.4 *************** *** 8,12 **** import net.sourceforge.bprocessor.facade.modellor.FacadeModellor; - import net.sourceforge.bprocessor.facade.modellor.WindowModellor; import net.sourceforge.bprocessor.model.modellor.Modellor; --- 8,11 ---- *************** *** 25,29 **** public FacadeMain () { Modellor.registerModellor(new FacadeModellor()); - Modellor.registerModellor(new WindowModellor()); } } --- 24,27 ---- |
From: Nordholt <nor...@us...> - 2006-11-16 14:25:54
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29229/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: making getSurfaces more stable Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Edge.java 7 Nov 2006 10:51:24 -0000 1.65 --- Edge.java 16 Nov 2006 14:25:42 -0000 1.66 *************** *** 449,458 **** public Set getSurfaces() { Set result = new HashSet(); ! Collection surfaces = getOwner().getSurfaces(); ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! if (current.contains(this)) { ! result.add(current); } } --- 449,460 ---- public Set getSurfaces() { Set result = new HashSet(); ! if (getOwner() != null) { ! Collection surfaces = getOwner().getSurfaces(); ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! if (current.contains(this)) { ! result.add(current); ! } } } |
From: Michael L. <he...@us...> - 2006-11-15 13:47:57
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19547/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Camera activation Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** GenericTreeView.java 15 Nov 2006 10:30:58 -0000 1.62 --- GenericTreeView.java 15 Nov 2006 13:47:52 -0000 1.63 *************** *** 1327,1330 **** --- 1327,1339 ---- } } + } else { + Object object = path.getLastPathComponent(); + if (object instanceof GenericNode) { + GenericNode node = (GenericNode) object; + Object target = node.getUserObject(); + if (target instanceof Camera) { + Project.getInstance().setCurrentCamera((Camera) target); + } + } } } |
From: rimestad <rim...@us...> - 2006-11-15 10:31:11
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5850/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: made some fixes to the tree view Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** GenericTreeView.java 7 Nov 2006 10:51:28 -0000 1.61 --- GenericTreeView.java 15 Nov 2006 10:30:58 -0000 1.62 *************** *** 16,22 **** --- 16,24 ---- import java.util.Comparator; import java.util.Enumeration; + import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; + import java.util.Map; import java.util.Set; *************** *** 40,44 **** import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; - import net.sourceforge.bprocessor.model.Constraint; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.Edge; --- 42,45 ---- *************** *** 130,133 **** --- 131,137 ---- private boolean isChanged; + /** The object udpated on a update call */ + private Object updated = null; + /** * Renderer *************** *** 203,207 **** this.addTreeSelectionListener(new SelectionListener()); this.addMouseListener(new GenericMouseAdapter()); - //this.addKeyListener(new GenericKeyListener()); model = (DefaultTreeModel) getModel(); root = (DefaultMutableTreeNode) model.getRoot(); --- 207,210 ---- *************** *** 210,214 **** isChanged = false; setCellRenderer(new Renderer()); ! changed(); } --- 213,217 ---- isChanged = false; setCellRenderer(new Renderer()); ! //changed(); } *************** *** 312,315 **** --- 315,321 ---- if (o != null) { this.userObject = o; + if (o == updated) { + model.nodeChanged(this); + } } else { log.warn("Tried to update with null on " + this); *************** *** 330,344 **** */ public class ContainerNode extends GenericNode { ! /** ! * ! */ private static final long serialVersionUID = 1L; ! /** * Constructor for ContainerNode ! * @param object User object */ ! public ContainerNode(Object object) { ! super(object); } --- 336,352 ---- */ public class ContainerNode extends GenericNode { ! /** */ private static final long serialVersionUID = 1L; ! /** The content for the container for the node */ ! protected Object content; ! /** * Constructor for ContainerNode ! * @param object User collection to put in ! * @param label The label for the container node */ ! public ContainerNode(Object label, Object object) { ! super(label); ! this.content = object; } *************** *** 347,354 **** */ public String toString() { ! if (SHOW_COUNTERS) { ! return (this.getUserObject().toString() + " #" + this.getChildCount()); } else { ! return this.getUserObject().toString(); } } --- 355,362 ---- */ public String toString() { ! if (userObject instanceof Entity) { ! return ((Entity)userObject).getName(); } else { ! return userObject.toString(); } } *************** *** 399,411 **** public void update(Object o) { if (o instanceof Collection) { ! Set elem = new HashSet((Collection)o); Set children = new HashSet(); Enumeration e = this.children(); while (e.hasMoreElements()) { GenericNode sn = (GenericNode)e.nextElement(); ! if (elem.contains(sn.getUserObject())) { //If the node is allready there then just update it ! sn.update(sn.getUserObject()); ! elem.remove(sn.getUserObject()); } else { children.add(sn); --- 407,428 ---- public void update(Object o) { if (o instanceof Collection) { ! content = (Collection) o; ! //to make sure undo and redo keep nodes ! Map elem = new HashMap(); ! Iterator iter = ((Collection)o).iterator(); ! while (iter.hasNext()) { ! Entity e = (Entity)iter.next(); ! elem.put(e.getId(), e); ! } ! //Set elem = new HashSet((Collection)o); Set children = new HashSet(); Enumeration e = this.children(); while (e.hasMoreElements()) { GenericNode sn = (GenericNode)e.nextElement(); ! Long id = ((Entity)sn.getUserObject()).getId(); ! if (elem.containsKey(id)) { //If the node is allready there then just update it ! sn.update(elem.get(id)); ! elem.remove(id); } else { children.add(sn); *************** *** 413,417 **** } if (elem.size() > 0) { ! this.insertChildren(elem); } if (children.size() > 0) { --- 430,434 ---- } if (elem.size() > 0) { ! this.insertChildren(elem.values()); } if (children.size() > 0) { *************** *** 419,423 **** } } else { ! log.warn("Were called with " + o + " and not a list"); } } --- 436,440 ---- } } else { ! log.warn(userObject + " were called with " + o + " and not a list"); } } *************** *** 428,434 **** */ public void insertChildren(Collection elem) { ! int[] ins = new int[elem.size()]; int i = 0; ! Iterator iter = elem.iterator(); while (iter.hasNext()) { this.add(new EntityNode(iter.next())); --- 445,460 ---- */ public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Entity) s1).getId().compareTo(((Entity) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! //insert ! int[] ins = new int[sort.size()]; int i = 0; ! Iterator iter = sort.iterator(); while (iter.hasNext()) { this.add(new EntityNode(iter.next())); *************** *** 483,500 **** return pm; } - - - /** - * Update the node with the given object - * @param o The object - */ - public void update(Object o) { - if (o instanceof Entity || o instanceof Attribute) { - if (userObject != o) { - userObject = o; - model.nodeChanged(this); - } - } - } } --- 509,512 ---- *************** *** 522,525 **** --- 534,541 ---- add(new ElementContainer("Elements", space.getElements())); add(new GeometryContainer("Geometry", space)); + if (space.isContainer()) { + ContainerNode cn = new ConstructorContainer("Constructors", space.getConstructors()); + add(cn); + } if (space.getModellor() != null) { add(new ModellorNode(space.getModellor())); *************** *** 534,552 **** if (o instanceof Space) { Space s = (Space)o; ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ((GenericNode)getChildAt(1)).update(s.getElements()); ((GenericNode)getChildAt(2)).update(s); if (s.getModellor() != null) { ! if (getChildCount() == 4) { ! ((GenericNode)getChildAt(3)).update(s.getModellor()); } else { add(new ModellorNode(s.getModellor())); ! model.nodesWereInserted(this, new int[]{3}); } } else { ! if (getChildCount() == 4) { ! TreeNode node = getChildAt(3); ! remove(3); ! model.nodesWereRemoved(this, new int[]{3}, new Object[]{node}); } } --- 550,575 ---- if (o instanceof Space) { Space s = (Space)o; + current = s; + if (updated == current) { + model.nodeChanged(this); + } ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ((GenericNode)getChildAt(1)).update(s.getElements()); ((GenericNode)getChildAt(2)).update(s); + if (s.isContainer()) { + ((GenericNode)getChildAt(3)).update(s.getConstructors()); + } if (s.getModellor() != null) { ! if (getChildCount() == 5) { ! ((GenericNode)getChildAt(4)).update(s.getModellor()); } else { add(new ModellorNode(s.getModellor())); ! model.nodesWereInserted(this, new int[]{4}); } } else { ! if (getChildCount() == 5) { ! TreeNode node = getChildAt(4); ! remove(4); ! model.nodesWereRemoved(this, new int[]{4}, new Object[]{node}); } } *************** *** 621,626 **** */ public void update(Object o) { if (o instanceof Surface) { - userObject = (Surface)o; ((GenericNode)getChildAt(0)).update(((Surface)o).getEdges()); } --- 644,649 ---- */ public void update(Object o) { + super.update(o); if (o instanceof Surface) { ((GenericNode)getChildAt(0)).update(((Surface)o).getEdges()); } *************** *** 687,692 **** public void update(Object o) { if (o instanceof Edge) { Edge e = (Edge)o; - userObject = e; ((EntityNode)this.getChildAt(0)).update(e.getFrom()); ((EntityNode)this.getChildAt(1)).update(e.getTo()); --- 710,715 ---- public void update(Object o) { if (o instanceof Edge) { + super.update(o); Edge e = (Edge)o; ((EntityNode)this.getChildAt(0)).update(e.getFrom()); ((EntityNode)this.getChildAt(1)).update(e.getTo()); *************** *** 746,752 **** */ public class SurfaceContainer extends ContainerNode { ! /** ! * ! */ private static final long serialVersionUID = 1L; --- 769,773 ---- */ public class SurfaceContainer extends ContainerNode { ! /** */ private static final long serialVersionUID = 1L; *************** *** 757,774 **** */ public SurfaceContainer(String name, Collection surfaces) { ! super(name); ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Surface) s1).getId().compareTo(((Surface) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(surfaces); ! Collections.sort(sort, num); ! Iterator iter = sort.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! add(new SurfaceNode(current)); ! } } --- 778,783 ---- */ public SurfaceContainer(String name, Collection surfaces) { ! super(name, surfaces); ! insertChildren(surfaces); } *************** *** 778,784 **** */ public void insertChildren(Collection elem) { ! int[] ins = new int[elem.size()]; int i = 0; ! Iterator iter = elem.iterator(); while (iter.hasNext()) { Surface s = (Surface)iter.next(); --- 787,802 ---- */ public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Surface) s1).getId().compareTo(((Surface) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! //insert ! int[] ins = new int[sort.size()]; int i = 0; ! Iterator iter = sort.iterator(); while (iter.hasNext()) { Surface s = (Surface)iter.next(); *************** *** 815,824 **** */ public ElementContainer(String name, Collection elements) { ! super(name); ! Iterator iter = elements.iterator(); ! while (iter.hasNext()) { ! Space current = (Space) iter.next(); ! add(new SpaceNode(current)); ! } } --- 833,838 ---- */ public ElementContainer(String name, Collection elements) { ! super(name, elements); ! insertChildren(elements); } *************** *** 828,834 **** */ public void insertChildren(Collection elem) { ! int[] ins = new int[elem.size()]; int i = 0; ! Iterator iter = elem.iterator(); while (iter.hasNext()) { Space s = (Space)iter.next(); --- 842,857 ---- */ public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Space) s1).getId().compareTo(((Space) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! ! int[] ins = new int[sort.size()]; int i = 0; ! Iterator iter = sort.iterator(); while (iter.hasNext()) { Space s = (Space)iter.next(); *************** *** 863,867 **** */ public GeometryContainer(String name, Space space) { ! super(name); add(new SurfaceContainer("Surfaces", space.getSurfaces())); add(new EdgeContainer("Edges", space.getEdges())); --- 886,890 ---- */ public GeometryContainer(String name, Space space) { ! super(name, null); add(new SurfaceContainer("Surfaces", space.getSurfaces())); add(new EdgeContainer("Edges", space.getEdges())); *************** *** 876,879 **** --- 899,906 ---- if (o instanceof Space) { Space s = (Space)o; + if (s == updated) { + userObject = s; + model.nodeChanged(this); + } ((SurfaceContainer)this.getChildAt(0)).update(s.getSurfaces()); ((EdgeContainer)this.getChildAt(1)).update(s.getEdges()); *************** *** 901,910 **** */ public ConstructorContainer(String name, Collection constructors) { ! super(name); ! Iterator iter = constructors.iterator(); ! while (iter.hasNext()) { ! Constructor current = (Constructor) iter.next(); ! add(new ConstructorNode(current)); ! } } --- 928,933 ---- */ public ConstructorContainer(String name, Collection constructors) { ! super(name, constructors); ! insertChildren(constructors); } *************** *** 922,928 **** */ public void insertChildren(Collection elem) { ! int[] ins = new int[elem.size()]; int i = 0; ! Iterator iter = elem.iterator(); while (iter.hasNext()) { Constructor s = (Constructor)iter.next(); --- 945,959 ---- */ public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Constructor) s1).getId().compareTo(((Constructor) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! int[] ins = new int[sort.size()]; int i = 0; ! Iterator iter = sort.iterator(); while (iter.hasNext()) { Constructor s = (Constructor)iter.next(); *************** *** 948,957 **** */ public EdgeContainer(String name, Collection edges) { ! super(name); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! add(new EdgeNode(current)); ! } } --- 979,984 ---- */ public EdgeContainer(String name, Collection edges) { ! super(name, edges); ! insertChildren(edges); } *************** *** 961,967 **** */ public void insertChildren(Collection elem) { ! int[] ins = new int[elem.size()]; int i = 0; ! Iterator iter = elem.iterator(); while (iter.hasNext()) { Edge s = (Edge)iter.next(); --- 988,1002 ---- */ public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Edge) s1).getId().compareTo(((Edge) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! int[] ins = new int[sort.size()]; int i = 0; ! Iterator iter = sort.iterator(); while (iter.hasNext()) { Edge s = (Edge)iter.next(); *************** *** 994,998 **** */ public ProjectNode(Project p) { ! super(p); } --- 1029,1034 ---- */ public ProjectNode(Project p) { ! super(p, p.getSpaces()); ! insertChildren(p.getSpaces()); } *************** *** 1004,1007 **** --- 1040,1047 ---- if (o instanceof Project) { Project proj = (Project)o; + if (proj == updated) { + userObject = proj; + model.nodeChanged(this); + } super.update(proj.getSpaces()); } else { *************** *** 1015,1021 **** */ public void insertChildren(Collection elem) { ! int[] ins = new int[elem.size()]; int i = 0; ! Iterator iter = elem.iterator(); while (iter.hasNext()) { Space s = (Space)iter.next(); --- 1055,1070 ---- */ public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Space) s1).getId().compareTo(((Space) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! ! int[] ins = new int[sort.size()]; int i = 0; ! Iterator iter = sort.iterator(); while (iter.hasNext()) { Space s = (Space)iter.next(); *************** *** 1040,1044 **** */ public CameraNode(Camera c) { ! super(c); update(c); } --- 1089,1093 ---- */ public CameraNode(Camera c) { ! super(c, c.getClipplanes()); update(c); } *************** *** 1050,1053 **** --- 1099,1106 ---- public void update(Object o) { if (o instanceof Camera) { + userObject = o; + if (o == updated) { + model.nodeChanged(this); + } super.update(((Camera)o).getClipplanes()); } else { *************** *** 1070,1079 **** */ public VertexContainer(String name, Collection vertices) { ! super(name); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! add(new VertexNode(current)); ! } } --- 1123,1128 ---- */ public VertexContainer(String name, Collection vertices) { ! super(name, vertices); ! insertChildren(vertices); } *************** *** 1092,1098 **** */ public void insertChildren(Collection elem) { ! int[] ins = new int[elem.size()]; int i = 0; ! Iterator iter = elem.iterator(); while (iter.hasNext()) { Vertex s = (Vertex)iter.next(); --- 1141,1156 ---- */ public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Vertex) s1).getId().compareTo(((Vertex) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! ! int[] ins = new int[sort.size()]; int i = 0; ! Iterator iter = sort.iterator(); while (iter.hasNext()) { Vertex s = (Vertex)iter.next(); *************** *** 1112,1118 **** private static final long serialVersionUID = 1L; - /** name */ - private String name; - /** * Constructor --- 1170,1173 ---- *************** *** 1121,1152 **** */ public ParameterBlockNode(String name, ParameterBlock object) { ! super(object); ! this.name = name; ! Iterator iter = object.getAttributes().iterator(); ! while (iter.hasNext()) { ! Attribute current = (Attribute) iter.next(); ! add(new EntityNode(current)); ! } } ! /** ! * Update the node with the given object ! * @param o The object */ public void update(Object o) { if (o instanceof ParameterBlock) { ! super.update(((ParameterBlock)o).getAttributes()); } } /** - * Name - * @return String - */ - public String toString() { - return name; - } - - /** * Context menu for ParameterBlockNode * @return the menu --- 1176,1193 ---- */ public ParameterBlockNode(String name, ParameterBlock object) { ! super(name, object); ! insertChildren(object.getAttributes()); } ! /** ! * @param o the object to update with */ public void update(Object o) { if (o instanceof ParameterBlock) { ! update(((ParameterBlock)o).getAttributes()); } } /** * Context menu for ParameterBlockNode * @return the menu *************** *** 1200,1209 **** */ public ConstraintContainer(String name, Collection constraints) { ! super(name); ! Iterator iter = constraints.iterator(); ! while (iter.hasNext()) { ! Constraint current = (Constraint) iter.next(); ! add(new EntityNode(current)); ! } } } --- 1241,1246 ---- */ public ConstraintContainer(String name, Collection constraints) { ! super(name, constraints); ! update(constraints); } } *************** *** 1300,1305 **** */ public void update(Object object) { ! changed(); } - } --- 1337,1344 ---- */ public void update(Object object) { ! updated = object; ! update(); ! updated = null; ! //changed(); } } |
From: rimestad <rim...@us...> - 2006-11-15 10:28:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4965/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java CameraView.java Log Message: added nessesary change events Index: CameraView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/CameraView.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CameraView.java 1 Nov 2006 14:32:48 -0000 1.8 --- CameraView.java 15 Nov 2006 10:28:18 -0000 1.9 *************** *** 70,73 **** --- 70,74 ---- p.add(c); c.setName("View " + c.getId()); + p.changed(c); } else if (which == remove) { TreePath tp = ctv.getSelectionPath(); *************** *** 76,79 **** --- 77,81 ---- if (node instanceof CameraNode && node != p.getCurrentCamera()) { p.remove((Camera)((CameraNode)node).getUserObject()); + p.changed(p); } } Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PopupMenu.java 7 Nov 2006 09:54:04 -0000 1.17 --- PopupMenu.java 15 Nov 2006 10:28:18 -0000 1.18 *************** *** 268,272 **** public void actionPerformed(ActionEvent arg0) { Selection.primary().clear(); ! Project.getInstance().setActiveSpace(space); } }; --- 268,274 ---- public void actionPerformed(ActionEvent arg0) { Selection.primary().clear(); ! Project p = Project.getInstance(); ! p.setActiveSpace(space); ! p.changed(p); } }; |
From: Michael L. <he...@us...> - 2006-11-15 09:53:29
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23519/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java MoveTool.java ExtrusionTool.java ConstructorTool.java TapeMeasure.java Log Message: Lengthfield should now work in all geometric tools Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** MoveTool.java 22 Oct 2006 14:32:55 -0000 1.72 --- MoveTool.java 15 Nov 2006 09:53:17 -0000 1.73 *************** *** 143,155 **** current = findIntersection(e); if (current != null) { ! current = current.copy(); ! to = current.vertex(); ! if (Selection.primary().size() < 2) { ! last = move(entities, to.minus(last)).add(last); ! } else { ! last = move(vertices, to.minus(last)).add(last); ! } ! update(); ! updateFeedback(); } } --- 143,147 ---- current = findIntersection(e); if (current != null) { ! move(); } } *************** *** 158,161 **** --- 150,185 ---- /** + * Move + * + */ + private void move() { + current = current.copy(); + to = current.vertex(); + if (Selection.primary().size() < 2) { + last = move(entities, to.minus(last)).add(last); + } else { + last = move(vertices, to.minus(last)).add(last); + } + update(); + updateFeedback(); + } + + /** + * Finish + * + */ + private void finish() { + Collection surfaces = Edge.surfaces(Vertex.edges(vertices)); + Iterator iter = surfaces.iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + holeAnalysis(current); + } + Project.getInstance().changed(vertices); + Project.getInstance().checkpoint(); + cleanUp(); + } + + /** * @see net.sourceforge.bprocessor.gl.tool.AbstractTool#pressed() */ *************** *** 192,204 **** } } else { ! Collection surfaces = Edge.surfaces(Vertex.edges(vertices)); ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! holeAnalysis(current); ! } ! Project.getInstance().changed(vertices); ! Project.getInstance().checkpoint(); ! cleanUp(); moved(e); } --- 216,220 ---- } } else { ! finish(); moved(e); } *************** *** 206,209 **** --- 222,235 ---- /** + * + */ + public void onVertex() { + if (active) { + move(); + finish(); + } + } + + /** * @see net.sourceforge.bprocessor.gl.tool.AbstractPencil#cleanUp() */ Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ConstructorTool.java 10 Oct 2006 15:00:43 -0000 1.12 --- ConstructorTool.java 15 Nov 2006 09:53:17 -0000 1.13 *************** *** 136,143 **** } /** * @param e MouseEvent */ ! protected void pressed(MouseEvent e) { if (p1 == null) { p1 = current; --- 136,145 ---- } + /** + * Process click * @param e MouseEvent */ ! private void process(MouseEvent e) { if (p1 == null) { p1 = current; *************** *** 148,152 **** insertPoint(current.vertex().copy()); cleanUp(); ! moved(e); return; } else if (p2 == null) { --- 150,156 ---- insertPoint(current.vertex().copy()); cleanUp(); ! if (e != null) { ! moved(e); ! } return; } else if (p2 == null) { *************** *** 156,165 **** insertLine(p1.vertex().copy(), p2.vertex().copy()); cleanUp(); ! moved(e); return; } else { insertPlane(p1.vertex().copy(), p2.vertex().copy(), current.vertex().copy()); cleanUp(); ! moved(e); return; } --- 160,173 ---- insertLine(p1.vertex().copy(), p2.vertex().copy()); cleanUp(); ! if (e != null) { ! moved(e); ! } return; } else { insertPlane(p1.vertex().copy(), p2.vertex().copy(), current.vertex().copy()); cleanUp(); ! if (e != null) { ! moved(e); ! } return; } *************** *** 168,170 **** --- 176,192 ---- updateFeedback(); } + + /** + * @param e MouseEvent + */ + protected void pressed(MouseEvent e) { + process(e); + } + + /** + * On Vertex + */ + public void onVertex() { + process(null); + } } Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** OffsetTool.java 16 Oct 2006 15:07:00 -0000 1.12 --- OffsetTool.java 15 Nov 2006 09:53:17 -0000 1.13 *************** *** 132,135 **** --- 132,136 ---- feedback(feedback); } + updateLength(); makeTarget(current); timer.stop(); Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** ExtrusionTool.java 7 Nov 2006 09:54:11 -0000 1.42 --- ExtrusionTool.java 15 Nov 2006 09:53:17 -0000 1.43 *************** *** 159,162 **** --- 159,163 ---- extrude(distance, all, false); } + updateLength(); } *************** *** 211,214 **** --- 212,231 ---- } } + + /** + * Update length + */ + public void updateLength() { + if (extrudesurface == null) { + glv.setLengthValue(""); + } else { + double value = distance; + if (value < 0) { + value = -value; + } + this.setLength(value); + } + } + /** * Index: TapeMeasure.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasure.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TapeMeasure.java 14 Nov 2006 15:10:05 -0000 1.1 --- TapeMeasure.java 15 Nov 2006 09:53:17 -0000 1.2 *************** *** 17,20 **** --- 17,21 ---- import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; *************** *** 98,101 **** --- 99,111 ---- } } + + /** + * Insert a line + * @param line Line + */ + private void insert(Line line) { + Geometry.insertConstructor(line); + Project.getInstance().checkpoint(); + } /** *************** *** 111,119 **** if (originalEdge != null) { Line line = new Line(current.vertex(), originalEdge.getDirection(), true, false); ! Geometry.insertConstructor(line); } else { if (lengthEdge != null) { Line line = new Line(start.vertex(), lengthEdge.getDirection(), true, false); ! Geometry.insertConstructor(line); } } --- 121,129 ---- if (originalEdge != null) { Line line = new Line(current.vertex(), originalEdge.getDirection(), true, false); ! insert(line); } else { if (lengthEdge != null) { Line line = new Line(start.vertex(), lengthEdge.getDirection(), true, false); ! insert(line); } } *************** *** 145,152 **** Vertex origin = start.vertex().add(direction); Line line = new Line(origin, originalEdge.getDirection(), true, false); ! Geometry.insertConstructor(line); } else { Line line = new Line(start.vertex(), lengthEdge.getDirection(), true, false); ! Geometry.insertConstructor(line); } cleanUp(); --- 155,162 ---- Vertex origin = start.vertex().add(direction); Line line = new Line(origin, originalEdge.getDirection(), true, false); ! insert(line); } else { Line line = new Line(start.vertex(), lengthEdge.getDirection(), true, false); ! insert(line); } cleanUp(); |
From: Michael L. <he...@us...> - 2006-11-14 15:10:35
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29896/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java AbstractPencil.java Added Files: TapeMeasure.java Log Message: New implementation of TapeMeasureTool: - A constructionline can be created just be specifying two points (with starting on an edge. - A constructionline can be created by clicking at an existing line - The constructionline are not restricted to an adjacant surface Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** ToolFactory.java 13 Nov 2006 12:22:30 -0000 1.65 --- ToolFactory.java 14 Nov 2006 15:10:05 -0000 1.66 *************** *** 89,93 **** /** Tape measure tool */ ! private TapeMeasureTool tapeMeasure; /** Constructor tool */ --- 89,93 ---- /** Tape measure tool */ ! private AbstractPencil tapeMeasure; /** Constructor tool */ *************** *** 179,183 **** extrude = new ExtrusionTool(glv, pencilcursor); clipplane = new ClipplaneTool(glv, pencilcursor); ! tapeMeasure = new TapeMeasureTool(glv, pencilcursor); camera = new CameraTool(glv, rotationCursor); fly = new CameraFlyTool(glv, flyCursor); --- 179,183 ---- extrude = new ExtrusionTool(glv, pencilcursor); clipplane = new ClipplaneTool(glv, pencilcursor); ! tapeMeasure = new TapeMeasure(glv, pencilcursor); camera = new CameraTool(glv, rotationCursor); fly = new CameraFlyTool(glv, flyCursor); Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** AbstractPencil.java 22 Oct 2006 14:32:55 -0000 1.71 --- AbstractPencil.java 14 Nov 2006 15:10:05 -0000 1.72 *************** *** 467,471 **** setLength(edge.getLength()); } else { ! setLength(0); } } --- 467,471 ---- setLength(edge.getLength()); } else { ! glv.setLengthValue(""); } } --- NEW FILE: TapeMeasure.java --- //--------------------------------------------------------------------------------- // $Id: TapeMeasure.java,v 1.1 2006/11/14 15:10:05 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import java.awt.Cursor; import java.awt.event.MouseEvent; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Vertex; /** * TapeMeasure */ public class TapeMeasure extends AbstractPencil { /** * Original edge */ private Edge originalEdge; /** * Length edge */ private Edge lengthEdge; /** * Constructor * @param glv GLView * @param cursor Cursor */ public TapeMeasure(GLView glv, Cursor cursor) { super(glv, cursor); } /** * * Update feedback */ public void updateFeedback() { if (start != null) { List edges = new LinkedList(); if (originalEdge != null) { Line line = new Line(current.vertex(), originalEdge.getDirection(), true, false); edges.add(line); Vertex normal = originalEdge.getDirection(); normal.normalize(); Vertex origin = start.vertex().copy(); Vertex projected = current.vertex().minus(origin); double t = normal.dot(projected); normal.scale(t); projected = projected.minus(normal); Edge ortho = new Edge(origin, origin.add(projected)); ortho.setStrippled(true); edges.add(ortho); lengthEdge = ortho; } else { Edge edge = new Edge(start.vertex(), current.vertex()); edge.setStrippled(true); edges.add(edge); lengthEdge = edge; } feedback(edges); } else { lengthEdge = null; constructors(new LinkedList()); feedback(new LinkedList()); } makeTarget(current); updateConstructors(); } /** * @param e MouseEvent */ protected void moved(MouseEvent e) { current = findIntersection(e); if (current != null) { updateFeedback(); } } /** * @param e MouseEvent */ protected void pressed(MouseEvent e) { current = findIntersection(e); if (current != null) { onVertex(); } } /** * */ public void onVertex() { if (start == null) { start = current; if (current.object() instanceof Edge) { originalEdge = (Edge) current.object(); } } else { if (originalEdge != null) { Line line = new Line(current.vertex(), originalEdge.getDirection(), true, false); Geometry.insertConstructor(line); } else { if (lengthEdge != null) { Line line = new Line(start.vertex(), lengthEdge.getDirection(), true, false); Geometry.insertConstructor(line); } } cleanUp(); } updateFeedback(); } /** * Update length */ protected void updateLength() { if (lengthEdge != null) { setLength(lengthEdge.getLength()); } else { super.updateLength(); } } /** * @param value Length */ public void apply(double value) { if (lengthEdge != null) { if (originalEdge != null) { Vertex direction = lengthEdge.getDirection(); direction.normalize(); direction.scale(value); Vertex origin = start.vertex().add(direction); Line line = new Line(origin, originalEdge.getDirection(), true, false); Geometry.insertConstructor(line); } else { Line line = new Line(start.vertex(), lengthEdge.getDirection(), true, false); Geometry.insertConstructor(line); } cleanUp(); } else { super.apply(value); } } /** * Cleanup */ public void cleanUp() { originalEdge = null; lengthEdge = null; super.cleanUp(); } } |
From: Michael L. <he...@us...> - 2006-11-14 10:04:18
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5572/src/net/sourceforge/bprocessor/gl/tool Removed Files: ExtrudeTool.java Log Message: Removed old ExtrudeTool --- ExtrudeTool.java DELETED --- |
From: rimestad <rim...@us...> - 2006-11-13 14:56:16
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3621/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Geometry.java Log Message: made clipplanes more visible and changed the way edges and surfaces crossing the plane is found Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Geometry.java 30 Oct 2006 10:42:17 -0000 1.35 --- Geometry.java 13 Nov 2006 14:56:15 -0000 1.36 *************** *** 34,48 **** */ public static Collection getActiveEdges(Space s) { ! if (s.getElements().isEmpty()) { ! Collection c = s.getEdges(); ! if (c.isEmpty()) { ! Collection e = new ArrayList(); ! Iterator iter = s.getEnvelope().iterator(); ! while (iter.hasNext()) { ! e.addAll(((Surface)iter.next()).getEdges()); ! } ! return e; } ! return c; } else { ArrayList edges = new ArrayList(); --- 34,45 ---- */ public static Collection getActiveEdges(Space s) { ! if (s.getElements().size() == 1) { ! Collection e = new ArrayList(); ! e.addAll(s.getEdges()); ! Iterator iter = s.getEnvelope().iterator(); ! while (iter.hasNext()) { ! e.addAll(((Surface)iter.next()).getEdges()); } ! return e; } else { ArrayList edges = new ArrayList(); *************** *** 50,56 **** while (iter.hasNext()) { Space cur = (Space)iter.next(); ! Collection c = getActiveEdges(cur); ! edges.addAll(c); } return edges; } --- 47,56 ---- while (iter.hasNext()) { Space cur = (Space)iter.next(); ! if (cur != s.getEmpty()) { ! Collection c = getActiveEdges(cur); ! edges.addAll(c); ! } } + edges.addAll(s.getEdges()); return edges; } *************** *** 64,87 **** */ public static Collection getActiveSurfaces(Space s) { ! if (s.getElements().isEmpty()) { ! Collection c = s.getSurfaces(); ! if (c.isEmpty()) { ! return s.getEnvelope(); ! } else { ! return c; ! } } else { ArrayList surfaces = new ArrayList(); Iterator iter = s.getElements().iterator(); while (iter.hasNext()) { ! try { ! Space cur = (Space)iter.next(); surfaces.addAll(getActiveSurfaces(cur)); - } catch (ClassCastException e) { - log.info("Elements in " + s + " were not only spaces"); - e.printStackTrace(); - break; } } return surfaces; } --- 64,84 ---- */ public static Collection getActiveSurfaces(Space s) { ! if (s.getElements().size() == 1) { ! //If void is the only space add all surfaces in the space and the envelope ! Collection c = new ArrayList(); ! c.addAll(s.getSurfaces()); ! c.addAll(s.getEnvelope()); ! return c; } else { + //If there are elements call recursive on elements and add envelope ArrayList surfaces = new ArrayList(); Iterator iter = s.getElements().iterator(); while (iter.hasNext()) { ! Space cur = (Space)iter.next(); ! if (cur != s.getEmpty()) { surfaces.addAll(getActiveSurfaces(cur)); } } + surfaces.addAll(s.getSurfaces()); return surfaces; } Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ClippingPlane.java 7 Nov 2006 10:51:24 -0000 1.13 --- ClippingPlane.java 13 Nov 2006 14:56:14 -0000 1.14 *************** *** 77,81 **** Vertex n = c.getN().copy(); n.normalize(); ! n.scale(0.01); c.move(n.getX(), n.getY(), n.getZ()); plane = c.plane(); --- 77,81 ---- Vertex n = c.getN().copy(); n.normalize(); ! n.scale(0.00001); c.move(n.getX(), n.getY(), n.getZ()); plane = c.plane(); |
From: rimestad <rim...@us...> - 2006-11-13 14:56:14
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3596/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: made clipplanes more visible and changed the way edges and surfaces crossing the plane is found Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** View.java 7 Nov 2006 10:51:19 -0000 1.160 --- View.java 13 Nov 2006 14:56:11 -0000 1.161 *************** *** 2160,2164 **** Collection corners = clipplane.getCorners(); { ! gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINE_LOOP); Iterator it = corners.iterator(); --- 2160,2164 ---- Collection corners = clipplane.getCorners(); { ! gl.glLineWidth(3.0f); gl.glBegin(GL.GL_LINE_LOOP); Iterator it = corners.iterator(); *************** *** 2171,2174 **** --- 2171,2175 ---- gl.glEnd(); } + gl.glLineWidth(1.5f); if (clipplane.isActive()) { Collection lines = clipplane.getLines(); *************** *** 2177,2181 **** Edge e = (Edge)it.next(); if (e.getStrippled()) { ! drawConstructor(e); } else { drawEdge(e); --- 2178,2184 ---- Edge e = (Edge)it.next(); if (e.getStrippled()) { ! gl.glEnable(GL.GL_LINE_STIPPLE); ! drawEdge(e); ! gl.glDisable(GL.GL_LINE_STIPPLE); } else { drawEdge(e); |
From: rimestad <rim...@us...> - 2006-11-13 14:54:48
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2830/src/net/sourceforge/bprocessor/gl/tool Modified Files: EraserTool.java Log Message: fixed some null pointer mistakes Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EraserTool.java 13 Nov 2006 14:00:31 -0000 1.4 --- EraserTool.java 13 Nov 2006 14:54:45 -0000 1.5 *************** *** 45,52 **** protected void pressed(MouseEvent e) { findTarget(e); ! ((Geometric) target).delete(); ! target = null; ! glv.getView().makeTarget(null); ! Project.getInstance().checkpoint(); } --- 45,55 ---- protected void pressed(MouseEvent e) { findTarget(e); ! if (target instanceof Geometric) { ! ((Geometric) target).delete(); ! Project.getInstance().changed(target); ! target = null; ! glv.getView().makeTarget(null); ! Project.getInstance().checkpoint(); ! } } |
From: rimestad <rim...@us...> - 2006-11-13 14:00:48
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13549/src/net/sourceforge/bprocessor/gl/tool Modified Files: EraserTool.java Log Message: Made the eraser delete all geometrics entities Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EraserTool.java 21 Mar 2006 22:33:36 -0000 1.3 --- EraserTool.java 13 Nov 2006 14:00:31 -0000 1.4 *************** *** 13,17 **** import net.sourceforge.bprocessor.gl.GLView; ! import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Project; --- 13,17 ---- import net.sourceforge.bprocessor.gl.GLView; ! import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Project; *************** *** 36,44 **** protected void moved(MouseEvent e) { findTarget(e); ! if (target instanceof Edge) { ! glv.getView().makeTarget(target); ! } else { ! glv.getView().makeTarget(null); ! } } --- 36,40 ---- protected void moved(MouseEvent e) { findTarget(e); ! glv.getView().makeTarget(target); } *************** *** 49,58 **** protected void pressed(MouseEvent e) { findTarget(e); ! if (target instanceof Edge) { ! ((Edge) target).delete(); ! Project.getInstance().checkpoint(); ! } else { ! glv.getView().makeTarget(null); ! } } --- 45,52 ---- protected void pressed(MouseEvent e) { findTarget(e); ! ((Geometric) target).delete(); ! target = null; ! glv.getView().makeTarget(null); ! Project.getInstance().checkpoint(); } |
From: rimestad <rim...@us...> - 2006-11-13 13:23:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30786/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: removes unused code Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Camera.java 13 Nov 2006 12:24:50 -0000 1.27 --- Camera.java 13 Nov 2006 13:23:33 -0000 1.28 *************** *** 587,622 **** currentCamera.roll = new double[]{0, 1, 0}; } - - /** - * Static modification of the camera - * @param currentCamera The camera to change - */ - public static void makeButtom(Camera currentCamera) { - double[] center = currentCamera.getCenter(); - double dist = currentCamera.dist(); - currentCamera.camera = new double[]{center[0], center[1], center[2] - dist}; - currentCamera.roll = new double[]{0, 1, 0}; - } - - /** - * Static modification of the camera - * @param currentCamera The camera to change - */ - public static void makeLeft(Camera currentCamera) { - double[] center = currentCamera.getCenter(); - double dist = currentCamera.dist(); - currentCamera.camera = new double[]{center[0], center[1] - dist, center[2]}; - currentCamera.roll = new double[]{0, 0, 1}; - } - - /** - * Static modification of the camera - * @param currentCamera The camera to change - */ - public static void makeRight(Camera currentCamera) { - double[] center = currentCamera.getCenter(); - double dist = currentCamera.dist(); - currentCamera.camera = new double[]{center[0], center[1] + dist, center[2]}; - currentCamera.roll = new double[]{0, 0, 1}; - } } --- 587,589 ---- |
From: rimestad <rim...@us...> - 2006-11-13 13:22:32
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30374/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java Log Message: made all attributes clickable when list attributes are used Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** GenericPanel.java 10 Nov 2006 13:48:12 -0000 1.26 --- GenericPanel.java 13 Nov 2006 13:22:26 -0000 1.27 *************** *** 95,99 **** */ private void generateContent(List what, JComponent where) { - genAttributes.clear(); Iterator iter = what.iterator(); while (iter.hasNext()) { --- 95,98 ---- *************** *** 363,366 **** --- 362,366 ---- content.removeAll(); attributes = obj.getAttributes(); + genAttributes.clear(); generateContent(attributes, content); revalidate(); |
From: rimestad <rim...@us...> - 2006-11-13 12:25:41
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7267/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: letters in front of space names Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** Space.java 12 Nov 2006 22:59:03 -0000 1.99 --- Space.java 13 Nov 2006 12:25:33 -0000 1.100 *************** *** 1531,1535 **** */ public String getDisplayName() { ! return name + " - " + id; } --- 1531,1550 ---- */ public String getDisplayName() { ! String res = ""; ! switch (level) { ! case ELEMENT_LEVEL: ! res = "EL" + res; ! break; ! case PART_LEVEL: ! res = "PT" + res; ! break; ! case SPACE_LEVEL: ! res = "SP" + res; ! break; ! case NET_LEVEL: ! res = "NET" + res; ! break; ! } ! return name + " - " + res + id; } |
From: Michael L. <he...@us...> - 2006-11-13 12:24:59
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6867/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: Removed dependency on jogl Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Camera.java 7 Nov 2006 10:51:24 -0000 1.26 --- Camera.java 13 Nov 2006 12:24:50 -0000 1.27 *************** *** 16,21 **** import org.apache.log4j.Logger; - import net.java.games.jogl.GL; - /** * Camera for view placement in the model have a center and at camera position --- 16,19 ---- *************** *** 566,574 **** */ public void addClipplane(ClippingPlane cp) { ! if (clipplanes.size() < GL.GL_MAX_CLIP_PLANES - 1) { ! clipplanes.add(cp); ! int num = clipplanes.indexOf(cp); ! cp.setNumber(num); ! } } --- 564,570 ---- */ public void addClipplane(ClippingPlane cp) { ! clipplanes.add(cp); ! int num = clipplanes.indexOf(cp); ! cp.setNumber(num); } |
From: rimestad <rim...@us...> - 2006-11-13 12:22:38
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6046/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java SpaceTool.java Log Message: disable instead of removinf menu parts, removed left, right and below buttons Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** SpaceTool.java 7 Nov 2006 10:45:12 -0000 1.65 --- SpaceTool.java 13 Nov 2006 12:22:30 -0000 1.66 *************** *** 314,330 **** createConstItem.addActionListener(constListener); ! JMenuItem editSpaceItem = null; ! if (space.isContainer()) { ! editSpaceItem = new JMenuItem("Edit " + category); ! editSpaceItem.addActionListener(new SpaceMenuAction(space, "Edit") { ! public void actionPerformed(ActionEvent arg0) { ! if (space != null) { ! Selection.primary().clear(); ! glv.getView().makeTarget(null); ! Project.getInstance().setActiveSpace(space); ! } } ! }); ! } JMenuItem copySpaceItem = new JMenuItem("Duplicate " + category); copySpaceItem.addActionListener(new SpaceMenuAction(space, "Duplicate") { --- 314,327 ---- createConstItem.addActionListener(constListener); ! JMenuItem editSpaceItem = new JMenuItem("Edit " + category); ! editSpaceItem.addActionListener(new SpaceMenuAction(space, "Edit") { ! public void actionPerformed(ActionEvent arg0) { ! if (space != null) { ! Selection.primary().clear(); ! glv.getView().makeTarget(null); ! Project.getInstance().setActiveSpace(space); } ! } ! }); JMenuItem copySpaceItem = new JMenuItem("Duplicate " + category); copySpaceItem.addActionListener(new SpaceMenuAction(space, "Duplicate") { *************** *** 354,357 **** --- 351,359 ---- } }); + if (!space.isContainer()) { + editSpaceItem.setEnabled(false); + copySpaceItem.setEnabled(false); + flipSpaceItem.setEnabled(false); + } JMenu funcMenu = new JMenu("Functional " + category + "s"); *************** *** 383,394 **** menu.add(constMenu); menu.addSeparator(); ! if (space != ((Space)space.parent()).getEmpty()) { ! menu.add(voidItem); ! menu.add(copySpaceItem); ! if (editSpaceItem != null) { ! menu.add(editSpaceItem); ! } ! menu.add(flipSpaceItem); ! } menu.addPopupMenuListener(spl); menu.pack(); --- 385,392 ---- menu.add(constMenu); menu.addSeparator(); ! menu.add(voidItem); ! menu.add(copySpaceItem); ! menu.add(editSpaceItem); ! menu.add(flipSpaceItem); menu.addPopupMenuListener(spl); menu.pack(); Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** ToolFactory.java 7 Nov 2006 10:51:19 -0000 1.64 --- ToolFactory.java 13 Nov 2006 12:22:30 -0000 1.65 *************** *** 257,282 **** } }; - Action butAction = new ToolAction(glv, 0, "xyicon.png") { - public void actionPerformed(ActionEvent arg0) { - Camera.makeButtom(Project.getInstance().getCurrentCamera()); - glv.repaint(); - } - }; - Action leftAction = new ToolAction(glv, 0, "xzicon.png") { - public void actionPerformed(ActionEvent arg0) { - Camera.makeLeft(Project.getInstance().getCurrentCamera()); - glv.repaint(); - } - }; - Action rightAction = new ToolAction(glv, 0, "xzicon.png") { - public void actionPerformed(ActionEvent arg0) { - Camera.makeRight(Project.getInstance().getCurrentCamera()); - glv.repaint(); - } - }; Toolbar.getInstance().registerPushButtonAction(topAction, "See from above"); - Toolbar.getInstance().registerPushButtonAction(butAction, "See from below"); - Toolbar.getInstance().registerPushButtonAction(leftAction, "See from left"); - Toolbar.getInstance().registerPushButtonAction(rightAction, "See from right"); ButtonGroup viewGroup = new ButtonGroup(); --- 257,261 ---- |
From: Nikolaj B. <nbr...@us...> - 2006-11-13 12:21:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5233/src/net/sourceforge/bprocessor/model Modified Files: Project.java Persistence.java Log Message: Persistance works for classification Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Persistence.java 12 Nov 2006 22:58:29 -0000 1.20 --- Persistence.java 13 Nov 2006 12:20:52 -0000 1.21 *************** *** 165,169 **** space.setId(new Long(xml.getProgid())); space.setDescription(xml.getDescription()); ! //space.setClassification(xml.getClassification()); mapper.put(new Long(xml.getId()), space); --- 165,171 ---- space.setId(new Long(xml.getProgid())); space.setDescription(xml.getDescription()); ! if (!xml.getClassification().equalsIgnoreCase("unassigned")) { ! space.setClassification(Project.getInstance().getClassification(xml.getClassification())); ! } mapper.put(new Long(xml.getId()), space); *************** *** 701,705 **** xml.setTransparent(space.isTransparent()); xml.setDescription(space.getDescription().toString()); ! //xml.setClassification(space.getClassification().toString()); map.put(space, xml); if (!space.isInstance()) { --- 703,711 ---- xml.setTransparent(space.isTransparent()); xml.setDescription(space.getDescription().toString()); ! if (space.getClassification() != null) { ! xml.setClassification(space.getClassification().getFullId()); ! } else { ! xml.setClassification("unassigned"); ! } map.put(space, xml); if (!space.isInstance()) { Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** Project.java 1 Nov 2006 14:32:45 -0000 1.90 --- Project.java 13 Nov 2006 12:20:52 -0000 1.91 *************** *** 833,835 **** --- 833,857 ---- } + /** + * this method returns the classification + * @param id the id of the classification wanted + * @return Classification the classification + * */ + public Classification getClassification(String id) { + StringTokenizer st = new StringTokenizer(id, "."); + Classification cl = clas; + String curid; + while (st.hasMoreTokens()) { + curid = st.nextToken(); + Iterator it = cl.getChildren().iterator(); + while (it.hasNext()) { + Classification current = (Classification) it.next(); + if (curid.equalsIgnoreCase(current.getId().toString())) { + cl = current; + } + } + } + return cl; + } + } |