bprocessor-commit Mailing List for B-processor (Page 80)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
| 2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
| 2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
| 2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
| 2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
| 2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
| 2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Michael L. <he...@us...> - 2007-01-25 10:20:56
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11947/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: Hit-detection improved Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Persistence.java 20 Jan 2007 21:24:44 -0000 1.32 --- Persistence.java 25 Jan 2007 10:20:55 -0000 1.33 *************** *** 206,209 **** --- 206,210 ---- space.setId(new Long(xml.getProgid())); space.setDescription(xml.getDescription()); + space.setUnion(xml.isUnion()); if (!xml.getClassification().equalsIgnoreCase("unassigned")) { if (type == 0) { *************** *** 821,824 **** --- 822,826 ---- xml.setTransparent(space.isTransparent()); xml.setDescription(space.getDescription().toString()); + xml.setUnion(space.isUnion()); if (space.getClassification() != null) { if (space.getClassification().getId().equalsIgnoreCase("-1")) { |
|
From: Michael L. <he...@us...> - 2007-01-25 10:20:56
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11932/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: Hit-detection improved Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** AbstractTool.java 14 Jan 2007 23:33:28 -0000 1.106 --- AbstractTool.java 25 Jan 2007 10:20:52 -0000 1.107 *************** *** 360,364 **** previousPos[0] = pressPos[0]; previousPos[1] = pressPos[1]; - Object o = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); if (e.getButton() == MouseEvent.BUTTON2) { glv.setCursor(dragCursor); --- 360,363 ---- *************** *** 367,372 **** if (cameraMode) { orbit.pressed(e); - } else if (o instanceof Space) { - Project.getInstance().setActiveSpace((Space)o); } else { pressed(e); --- 366,369 ---- |
|
From: Michael L. <he...@us...> - 2007-01-25 10:20:53
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11932/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Hit-detection improved Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.173 retrieving revision 1.174 diff -C2 -d -r1.173 -r1.174 *** View.java 24 Jan 2007 22:42:58 -0000 1.173 --- View.java 25 Jan 2007 10:20:52 -0000 1.174 *************** *** 924,937 **** invisibles = new HashSet(); highligts = new HashSet(); { ! Iterator iter = selection.iterator(); ! while (iter.hasNext()) { ! Object object = iter.next(); if (object instanceof Space) { Space space = (Space) object; ! Collection envelope = space.getEnvelope(); ! Iterator i = envelope.iterator(); ! while (i.hasNext()) { ! Surface surface = (Surface) i.next(); highligts.addAll(surface.getEdges()); invisibles.add(surface); --- 924,934 ---- invisibles = new HashSet(); highligts = new HashSet(); + { ! for (Geometric object : (Collection<Geometric>) selection) { if (object instanceof Space) { Space space = (Space) object; ! Collection<Surface> envelope = space.getEnvelope(); ! for (Surface surface : envelope) { highligts.addAll(surface.getEdges()); invisibles.add(surface); *************** *** 2013,2018 **** ! Collection edges = new LinkedList(); edges.addAll(space.getEdges()); edges.addAll(tempEdges); Collection vertices = new LinkedList(); --- 2010,2016 ---- ! Collection<Edge> edges = new HashSet<Edge>(); edges.addAll(space.getEdges()); + edges.addAll(Surface.edges(surfaces)); edges.addAll(tempEdges); Collection vertices = new LinkedList(); *************** *** 2758,2761 **** --- 2756,2772 ---- Object object = processSelect(unWantedEntities, mode == INTERSECTIONS, xy); clearNames(); + + if (mode == View.OBJECTS) { + if (object instanceof Geometric) { + Geometric current = (Geometric) object; + Space active = Project.getInstance().getActiveSpace(); + while (current != null && current.getOwner() != active) { + current = current.getOwner(); + } + if (current != null) { + object = current; + } + } + } return object; } |
|
From: Michael L. <he...@us...> - 2007-01-24 22:43:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25423/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Improvements to hit-detection Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.172 retrieving revision 1.173 diff -C2 -d -r1.172 -r1.173 *** View.java 20 Jan 2007 21:24:56 -0000 1.172 --- View.java 24 Jan 2007 22:42:58 -0000 1.173 *************** *** 850,854 **** Space current = active; while (current != null) { ! edges.addAll(current.getEdges()); current = current.getOwner(); } --- 850,860 ---- Space current = active; while (current != null) { ! if (current.isUnion()) { ! Collection<Surface> surfaces = new LinkedList<Surface>(); ! current.collectSurfaces(surfaces); ! edges.addAll(Surface.edges(surfaces)); ! } else { ! edges.addAll(current.getEdges()); ! } current = current.getOwner(); } *************** *** 1997,2000 **** --- 2003,2013 ---- surfaces.addAll(space.getSurfaces()); + + Collection<Space> elements = space.getElements(); + for (Space element : elements) { + if (element.isUnion()) { + surfaces.addAll(element.getSurfaces()); + } + } surfaces.addAll(tempSurfaces); |
|
From: Michael L. <he...@us...> - 2007-01-24 15:18:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1156/src/net/sourceforge/bprocessor/model Modified Files: Selection.java Log Message: Trhows an error when adding null to selection Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Selection.java 3 Dec 2006 17:48:20 -0000 1.16 --- Selection.java 24 Jan 2007 15:17:50 -0000 1.17 *************** *** 71,75 **** public boolean add(Object object) { if (object == null) { ! return false; } if (!(object instanceof Geometric)) { --- 71,75 ---- public boolean add(Object object) { if (object == null) { ! throw new Error("Null object added to selection"); } if (!(object instanceof Geometric)) { |
|
From: Michael L. <he...@us...> - 2007-01-24 12:08:45
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21540/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Space.java Log Message: Uses Collections.EMPTY_LIST to represent empty collections. Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** Surface.java 23 Jan 2007 14:31:26 -0000 1.130 --- Surface.java 24 Jan 2007 12:08:32 -0000 1.131 *************** *** 9,12 **** --- 9,13 ---- import java.util.ArrayList; import java.util.Collection; + import java.util.Collections; import java.util.HashMap; import java.util.Iterator; *************** *** 489,493 **** public Collection getHoles() { if (holes == null) { ! return Space.EMPTY; } else { return holes; --- 490,494 ---- public Collection getHoles() { if (holes == null) { ! return Collections.EMPTY_LIST; } else { return holes; Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** Space.java 24 Jan 2007 10:23:11 -0000 1.112 --- Space.java 24 Jan 2007 12:08:32 -0000 1.113 *************** *** 32,41 **** */ public class Space extends Geometric implements Parametric { ! /** Default */ ! private static final long serialVersionUID = 1L; ! ! /** An empty collection */ ! protected static final Collection EMPTY = new LinkedList(); ! /** Construction Type */ public static final int CONSTRUCTION = 0; --- 32,36 ---- */ public class Space extends Geometric implements Parametric { ! private static Logger log = Logger.getLogger(Space.class); /** Construction Type */ public static final int CONSTRUCTION = 0; *************** *** 62,67 **** private boolean isUnion = false; ! /** The logger */ ! private static Logger log = Logger.getLogger(Space.class); /** The name */ private String name; --- 57,61 ---- private boolean isUnion = false; ! /** The name */ private String name; *************** *** 523,527 **** return constructors.values(); } else { ! return EMPTY; } } --- 517,521 ---- return constructors.values(); } else { ! return Collections.EMPTY_LIST; } } *************** *** 646,650 **** return proto.getVertices(); } else { ! return EMPTY; } } --- 640,644 ---- return proto.getVertices(); } else { ! return Collections.EMPTY_LIST; } } *************** *** 868,872 **** return proto.getEdges(); } else { ! return EMPTY; } } --- 862,866 ---- return proto.getEdges(); } else { ! return Collections.EMPTY_LIST; } } *************** *** 1054,1058 **** return proto.getSurfaces(); } else { ! return EMPTY; } } --- 1048,1052 ---- return proto.getSurfaces(); } else { ! return Collections.EMPTY_LIST; } } *************** *** 1117,1121 **** return materials.values(); } else { ! return EMPTY; } } --- 1111,1115 ---- return materials.values(); } else { ! return Collections.EMPTY_LIST; } } *************** *** 1423,1427 **** return proto.getElements(); } else { ! return EMPTY; } } --- 1417,1421 ---- return proto.getElements(); } else { ! return Collections.EMPTY_LIST; } } |
|
From: Nikolaj B. <nbr...@us...> - 2007-01-24 10:25:22
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11260/src/net/sourceforge/bprocessor/gui/attrview Modified Files: ClassificationIdAttribute.java ClassificationTextAttribute.java Log Message: Changed a few of the labels in the classification to the new names agreed upon with KA Index: ClassificationTextAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationTextAttribute.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ClassificationTextAttribute.java 17 Dec 2006 20:24:12 -0000 1.4 --- ClassificationTextAttribute.java 24 Jan 2007 10:25:14 -0000 1.5 *************** *** 74,78 **** public ClassificationTextAttribute(Attribute attribute) { super(BoxLayout.X_AXIS); ! label = new JLabel(attribute.getName() + ": "); this.attribute = attribute; this.listeners = new LinkedList(); --- 74,83 ---- public ClassificationTextAttribute(Attribute attribute) { super(BoxLayout.X_AXIS); ! if (attribute.getName().equalsIgnoreCase("Classification")) { ! label = new JLabel("Reference: "); ! } else { ! label = new JLabel("Type: "); ! } ! this.attribute = attribute; this.listeners = new LinkedList(); *************** *** 84,88 **** component.add(cur); } else { ! JLabel cur = new JLabel("unassigned"); cur.setFont(AttributeView.FONT_PLAIN); component.add(cur); --- 89,93 ---- component.add(cur); } else { ! JLabel cur = new JLabel("none"); cur.setFont(AttributeView.FONT_PLAIN); component.add(cur); Index: ClassificationIdAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationIdAttribute.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ClassificationIdAttribute.java 6 Jan 2007 21:10:46 -0000 1.4 --- ClassificationIdAttribute.java 24 Jan 2007 10:25:14 -0000 1.5 *************** *** 61,65 **** this.listeners = new LinkedList(); Box column = Box.createVerticalBox(); ! label = createLabel("Classification"); component = Box.createHorizontalBox(); if (!attribute.getClassification().getName().equalsIgnoreCase("Classification") && --- 61,65 ---- this.listeners = new LinkedList(); Box column = Box.createVerticalBox(); ! label = createLabel("Code"); component = Box.createHorizontalBox(); if (!attribute.getClassification().getName().equalsIgnoreCase("Classification") && |
|
From: Nikolaj B. <nbr...@us...> - 2007-01-24 10:23:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10418/src/net/sourceforge/bprocessor/model Modified Files: EnergyCalc.java Space.java Log Message: Fixed the energy calculation to work with the DBK classification system, also added new attributes to functional spaces: building, apartment, floor and room Index: EnergyCalc.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EnergyCalc.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EnergyCalc.java 24 Oct 2006 20:40:48 -0000 1.3 --- EnergyCalc.java 24 Jan 2007 10:23:11 -0000 1.4 *************** *** 21,39 **** Iterator it = Project.getInstance().world().getSurfaces().iterator(); double totalloss = 0; ! while (it.hasNext()) { Surface current = (Surface) it.next(); ! if (current.getFrontDomain().getClassification().getName().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getBackDomain(), current); ! } ! if (current.getFrontDomain().getClassification().getName(). ! equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getBackDomain(), current); ! } ! if (current.getBackDomain().getClassification().getName().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getFrontDomain(), current); } ! if (current.getBackDomain().getClassification().getName().equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getFrontDomain(), current); } } --- 21,44 ---- Iterator it = Project.getInstance().world().getSurfaces().iterator(); double totalloss = 0; ! while (it.hasNext()) { Surface current = (Surface) it.next(); ! if (current.getFrontDomain().getClassification() != null) { ! if (current.getFrontDomain().getClassification().getName().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getBackDomain(), current); ! } ! if (current.getFrontDomain().getClassification().getName(). ! equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getBackDomain(), current); ! } } ! if (current.getBackDomain().getClassification() != null) { ! if (current.getBackDomain().getClassification().getName().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getFrontDomain(), current); ! } ! if (current.getBackDomain().getClassification().getName() ! .equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getFrontDomain(), current); ! } } } *************** *** 63,75 **** return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Tagkonstruktion")) { loss = 0.15 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Loft")) { loss = 0.15 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Ydervæg")) { loss = 0.25 * current.getArea(); return loss; --- 68,82 ---- return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Tagkonstruktion") || ! classification.getClassification().getName().equalsIgnoreCase("Tagsystem")) { loss = 0.15 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Loftkonstruktion")) { loss = 0.15 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Vægsystem") || ! classification.getClassification().getName().equalsIgnoreCase("Vægkonstruktion")) { loss = 0.25 * current.getArea(); return loss; *************** *** 86,95 **** if (classification.getClassification(). ! getName().equalsIgnoreCase("3-lags lavenergivindue")) { loss = 0.8 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Dør")) { loss = 1.5 * current.getArea(); return loss; --- 93,102 ---- if (classification.getClassification(). ! getName().equalsIgnoreCase("Vinduesparti")) { loss = 0.8 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Dørparti")) { loss = 1.5 * current.getArea(); return loss; *************** *** 148,157 **** } ! if (spa != null && ! (spa.getClassification().getName().equalsIgnoreCase("Stue") || ! spa.getClassification().getName().equalsIgnoreCase("Badeværelse") || ! spa.getClassification().getName().equalsIgnoreCase("Opvarmet rum"))) { ! relevant = true; ! } --- 155,167 ---- } ! if (spa.getClassification() != null) { ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getName().equalsIgnoreCase("Beboelse og ophold")) { ! relevant = true; ! } ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getParent().getName().equalsIgnoreCase("Beboelse og ophold")) { ! relevant = true; ! } } *************** *** 173,190 **** if (current.normal().getZ() >= 0.99) { spa = current.getFrontDomain(); ! if (spa.getClassification() != null && ! (spa.getClassification().getName().equalsIgnoreCase("Stue") || ! spa.getClassification().getName().equalsIgnoreCase("Badeværelse") || ! spa.getClassification().getName().equalsIgnoreCase("Opvarmet rum"))) { ! tha = tha + current.getArea(); } } if (current.normal().getZ() <= -0.99) { spa = current.getBackDomain(); ! if (spa.getClassification() != null && ! (spa.getClassification().getName().equalsIgnoreCase("Stue") || ! spa.getClassification().getName().equalsIgnoreCase("Badeværelse") || ! spa.getClassification().getName().equalsIgnoreCase("Opvarmet rum"))) { ! tha = tha + current.getArea(); } } --- 183,208 ---- if (current.normal().getZ() >= 0.99) { spa = current.getFrontDomain(); ! if (spa.getClassification() != null) { ! if (spa.getClassification().getName().equalsIgnoreCase("Beboelse og ophold")) { ! tha = tha + current.getArea(); ! } ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getParent().getName() ! .equalsIgnoreCase("Beboelse og ophold")) { ! tha = tha + current.getArea(); ! } } } if (current.normal().getZ() <= -0.99) { spa = current.getBackDomain(); ! if (spa.getClassification() != null) { ! if (spa.getClassification().getName().equalsIgnoreCase("Beboelse og ophold")) { ! tha = tha + current.getArea(); ! } ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getParent().getName() ! .equalsIgnoreCase("Beboelse og ophold")) { ! tha = tha + current.getArea(); ! } } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** Space.java 23 Jan 2007 14:31:27 -0000 1.111 --- Space.java 24 Jan 2007 10:23:11 -0000 1.112 *************** *** 144,148 **** --- 144,159 ---- private int level; + /** the building the space belongs to */ + private String building = "0"; + + /** the floor the space belongs to */ + private String floor = "0"; + + /** the apartment the space belongs to */ + private String apartment = "0"; + /** the room the space belongs to */ + private String room = "0"; + /** * Constructor for persistence layer *************** *** 1499,1502 **** --- 1510,1521 ---- } else if (a.getName().equals("Type")) { setTypeClassification((((Classification)a.getClassification()))); + } else if (a.getName().equals("Building")) { + setBuilding(((String)a.getValue().toString())); + } else if (a.getName().equals("Apartment")) { + setApartment(((String)a.getValue().toString())); + } else if (a.getName().equals("Floor")) { + setFloor(((String)a.getValue().toString())); + } else if (a.getName().equals("Room")) { + setRoom(((String)a.getValue().toString())); } else if (a.getName().equals("Transparent")) { setTransparent((((Boolean)a.getValue()).booleanValue())); *************** *** 1566,1569 **** --- 1585,1594 ---- getType(getClassification().getName()), getTypeClassification(), this)); } + if (isFunctionalSpace()) { + res.add(new Attribute("Building", getBuilding(), true)); + res.add(new Attribute("Floor", getFloor(), true)); + res.add(new Attribute("Apartment", getApartment(), true)); + res.add(new Attribute("Room", getRoom(), true)); + } res.add(new Attribute("ID", getId().toString(), false)); res.add(new Attribute("Owner", getOwner(), false)); *************** *** 2526,2528 **** --- 2551,2624 ---- this.level = level; } + + + /** + * Get the apartment + * @return The apartment + * @hibernate.property + */ + public String getApartment() { + return apartment; + } + + /** + * Set the apartment + * @param apartment The apartment + */ + public void setApartment(String apartment) { + this.apartment = apartment; + } + + /** + * Get the building + * @return The building + * @hibernate.property + */ + public String getBuilding() { + return building; + } + + /** + * Set the building + * @param building The building + */ + public void setBuilding(String building) { + this.building = building; + } + + /** + * Get the floor + * @return The floor + * @hibernate.property + */ + public String getFloor() { + return floor; + } + + /** + * Set the floor + * @param floor The floor + */ + public void setFloor(String floor) { + this.floor = floor; + } + + /** + * Get the room + * @return The room + * @hibernate.property + */ + public String getRoom() { + return room; + } + + /** + * Set the room + * @param room The room + */ + public void setRoom(String room) { + this.room = room; + } + + } |
|
From: Michael L. <he...@us...> - 2007-01-23 14:31:49
|
Update of /cvsroot/bprocessor/gui/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18026/src Modified Files: build.xml Log Message: Build errors and style-check errors fixed Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/gui/src/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build.xml 28 Apr 2006 11:29:06 -0000 1.2 --- build.xml 23 Jan 2007 14:31:33 -0000 1.3 *************** *** 14,18 **** <target name="compile" depends="dep"> <javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="yes" ! debug="yes" target="1.2" source="1.3" includes="net/**"> <classpath refid="build.path"/> --- 14,18 ---- <target name="compile" depends="dep"> <javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="yes" ! debug="yes" target="1.5" source="1.5" includes="net/**"> <classpath refid="build.path"/> |
|
From: Michael L. <he...@us...> - 2007-01-23 14:31:38
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18026/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Build errors and style-check errors fixed Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PopupMenu.java 23 Jan 2007 10:51:55 -0000 1.21 --- PopupMenu.java 23 Jan 2007 14:31:33 -0000 1.22 *************** *** 390,394 **** Collection<Surface> surfaces = new HashSet<Surface>(); Collection<Geometric> geometrics = (Collection<Geometric>) entities; ! for (Geometric geometric: geometrics) { if (geometric instanceof Surface) { surfaces.add((Surface) geometric); --- 390,394 ---- Collection<Surface> surfaces = new HashSet<Surface>(); Collection<Geometric> geometrics = (Collection<Geometric>) entities; ! for (Geometric geometric : geometrics) { if (geometric instanceof Surface) { surfaces.add((Surface) geometric); *************** *** 397,401 **** Collection<Space> spaces = new HashSet<Space>(); Space owner = null; ! for (Surface surface: surfaces) { owner = surface.getOwner(); Space empty = owner.getEmpty(); --- 397,401 ---- Collection<Space> spaces = new HashSet<Space>(); Space owner = null; ! for (Surface surface : surfaces) { owner = surface.getOwner(); Space empty = owner.getEmpty(); *************** *** 408,420 **** } Collection<Space> interior = new HashSet<Space>(); ! for (Space space: spaces) { interior.add(space); } ! for (Space space: interior) { surfaces.addAll(space.getEnvelope()); } Collection<Surface> inside = new LinkedList<Surface>(); Collection<Surface> border = new LinkedList<Surface>(); ! for (Surface surface: surfaces) { if (interior.contains(surface.getFrontDomain()) && interior.contains(surface.getBackDomain())) { --- 408,420 ---- } Collection<Space> interior = new HashSet<Space>(); ! for (Space space : spaces) { interior.add(space); } ! for (Space space : interior) { surfaces.addAll(space.getEnvelope()); } Collection<Surface> inside = new LinkedList<Surface>(); Collection<Surface> border = new LinkedList<Surface>(); ! for (Surface surface : surfaces) { if (interior.contains(surface.getFrontDomain()) && interior.contains(surface.getBackDomain())) { *************** *** 429,433 **** Map<Geometric, Geometric> map = new HashMap<Geometric, Geometric>(); ! for(Space space:interior) { Space copy = space.simpleCopy(); map.put(space, copy); --- 429,433 ---- Map<Geometric, Geometric> map = new HashMap<Geometric, Geometric>(); ! for (Space space : interior) { Space copy = space.simpleCopy(); map.put(space, copy); *************** *** 438,442 **** Collection<Surface> deletion = new LinkedList<Surface>(); ! for(Surface surface:inside) { Surface copy = surface.copy(map); Space front = surface.getFrontDomain(); --- 438,442 ---- Collection<Surface> deletion = new LinkedList<Surface>(); ! for (Surface surface : inside) { Surface copy = surface.copy(map); Space front = surface.getFrontDomain(); *************** *** 457,461 **** deletion.add(surface); } ! for(Surface surface:border) { Surface copy = surface.copy(map); Space front = surface.getFrontDomain(); --- 457,461 ---- deletion.add(surface); } ! for (Surface surface : border) { Surface copy = surface.copy(map); Space front = surface.getFrontDomain(); *************** *** 479,486 **** } union.addAll(all); ! for(Geometric geometric:deletion) { geometric.delete(); } ! for(Space space:interior) { space.delete(); } --- 479,486 ---- } union.addAll(all); ! for (Geometric geometric : deletion) { geometric.delete(); } ! for (Space space : interior) { space.delete(); } |
|
From: Michael L. <he...@us...> - 2007-01-23 14:31:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18006/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Space.java Project.java Log Message: Build errors and style-check errors fixed Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** Surface.java 5 Jan 2007 13:54:47 -0000 1.129 --- Surface.java 23 Jan 2007 14:31:26 -0000 1.130 *************** *** 1397,1401 **** public Vertex normal() { ! return Geometry.normal(getVertices()); } --- 1397,1402 ---- public Vertex normal() { ! return normal0(); ! //return Geometry.normal(getVertices()); } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** Space.java 23 Jan 2007 10:51:51 -0000 1.110 --- Space.java 23 Jan 2007 14:31:27 -0000 1.111 *************** *** 208,212 **** * @param name The name * @return The space - * @throws Exception If a part is being extended */ public Space createConstructionSpace(String name) { --- 208,211 ---- *************** *** 682,685 **** --- 681,697 ---- /** + * Inserts a list of edges into this space. + * The vertices of the edges are also inserted. + * Analysis is performed that ensure no duplicate + * vertices and edges. + * @param edges List of edges + */ + public void insert(List<Edge> edges) { + for (Edge edge : edges) { + insert(edge); + } + } + + /** * Insert a edge * @param edge The edge Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** Project.java 9 Jan 2007 10:12:09 -0000 1.109 --- Project.java 23 Jan 2007 14:31:27 -0000 1.110 *************** *** 1182,1188 **** current = bf.readLine(); } ! for (Edge e : newEdges) { ! Project.getInstance().world().insert(e); ! } } --- 1182,1186 ---- current = bf.readLine(); } ! Project.getInstance().world().insert(newEdges); } |
|
From: Michael L. <he...@us...> - 2007-01-23 14:31:22
|
Update of /cvsroot/bprocessor/test/input In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17994/input Added Files: model6.xml model5.xml Log Message: Build errors and style-check errors fixed --- NEW FILE: model6.xml --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bmodel> <active>1</active> <cs>218</cs> <name>new project</name> <space voidref="2" type="1" transparent="false" level="2" name="Project" progid="0" id="1"> <description/> <Classification>unassigned</Classification> <constructor xsi:type="CoordinateSystemType" onlyplane="false" active="true" editable="true" progid="1" id="218" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex y="0.0" x="0.0" z="0.0" id="219"/> <ijn> <vertex y="0.0" x="1.0" z="0.0" id="215"/> <vertex y="1.0" x="0.0" z="0.0" id="216"/> <vertex y="0.0" x="0.0" z="1.0" id="217"/> </ijn> </constructor> <space type="1" transparent="false" level="3" name="Void" progid="1" id="2"> <description/> <Classification>unassigned</Classification> [...1074 lines suppressed...] <vertex y="4.0" x="9.12" z="3.0" progid="48" id="198"/> <vertex y="5.0" x="5.0" z="3.0" progid="49" id="199"/> <vertex y="9.12" x="6.12" z="3.0" progid="50" id="200"/> <vertex y="9.52" x="9.52" z="3.0" progid="51" id="201"/> <vertex y="1.0" x="5.12" z="3.0" progid="52" id="202"/> <vertex y="9.52" x="0.6" z="3.0" progid="53" id="203"/> <vertex y="3.88" x="7.42" z="3.0" progid="54" id="204"/> <vertex y="3.88" x="9.12" z="3.0" progid="55" id="205"/> <vertex y="9.12" x="9.12" z="3.0" progid="56" id="206"/> <vertex y="0.6" x="2.25" z="0.8" progid="57" id="207"/> <vertex y="0.6" x="2.25" z="2.3" progid="58" id="208"/> <vertex y="0.6" x="3.75" z="2.3" progid="59" id="209"/> <vertex y="0.6" x="3.75" z="0.8" progid="60" id="210"/> <vertex y="1.0" x="2.25" z="0.8" progid="61" id="211"/> <vertex y="1.0" x="3.75" z="0.8" progid="62" id="212"/> <vertex y="1.0" x="3.75" z="2.3" progid="63" id="213"/> <vertex y="1.0" x="2.25" z="2.3" progid="64" id="214"/> </space> </bmodel> --- NEW FILE: model5.xml --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bmodel> <active>1</active> <cs>17</cs> <name>new project</name> <space voidref="2" type="1" transparent="false" level="2" name="Project" progid="0" id="1"> <description/> <Classification>unassigned</Classification> <constructor xsi:type="CoordinateSystemType" onlyplane="false" active="true" editable="true" progid="1" id="17" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex y="0.0" x="0.0" z="0.0" id="18"/> <ijn> <vertex y="0.0" x="1.0" z="0.0" id="14"/> <vertex y="1.0" x="0.0" z="0.0" id="15"/> <vertex y="0.0" x="0.0" z="1.0" id="16"/> </ijn> </constructor> <space type="1" transparent="false" level="3" name="Void" progid="1" id="2"> <description/> <Classification>unassigned</Classification> </space> <edge constructor="false" progid="6" id="3"> <from>8</from> <to>9</to> </edge> <edge constructor="false" progid="7" id="4"> <from>9</from> <to>10</to> </edge> <edge constructor="false" progid="8" id="5"> <from>10</from> <to>11</to> </edge> <edge constructor="false" progid="9" id="6"> <from>11</from> <to>8</to> </edge> <edge constructor="false" progid="10" id="7"> <from>12</from> <to>13</to> </edge> <vertex y="1.0" x="1.0" z="0.0" progid="7" id="8"/> <vertex y="6.0" x="1.0" z="0.0" progid="8" id="9"/> <vertex y="6.0" x="6.0" z="0.0" progid="9" id="10"/> <vertex y="1.0" x="6.0" z="0.0" progid="10" id="11"/> <vertex y="3.5" x="3.5" z="0.0" progid="11" id="12"/> <vertex y="3.5" x="3.5" z="4.0" progid="12" id="13"/> </space> </bmodel> |
|
From: Michael L. <he...@us...> - 2007-01-23 10:51:57
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25933/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Union progress Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PopupMenu.java 22 Jan 2007 15:40:22 -0000 1.20 --- PopupMenu.java 23 Jan 2007 10:51:55 -0000 1.21 *************** *** 9,15 **** --- 9,17 ---- import java.awt.event.ActionEvent; import java.util.Collection; + import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; + import java.util.Map; import java.util.Set; *************** *** 394,399 **** } Collection<Space> spaces = new HashSet<Space>(); for (Surface surface: surfaces) { ! Space empty = surface.getOwner().getEmpty(); if (surface.getFrontDomain() != empty) { spaces.add(surface.getFrontDomain()); --- 396,403 ---- } Collection<Space> spaces = new HashSet<Space>(); + Space owner = null; for (Surface surface: surfaces) { ! owner = surface.getOwner(); ! Space empty = owner.getEmpty(); if (surface.getFrontDomain() != empty) { spaces.add(surface.getFrontDomain()); *************** *** 420,425 **** } } Selection.primary().clear(); ! Selection.primary().addAll(border); } }; --- 424,492 ---- } } + Space union = owner.createConstructionSpace("Union"); + union.setUnion(true); + + Map<Geometric, Geometric> map = new HashMap<Geometric, Geometric>(); + + for(Space space:interior) { + Space copy = space.simpleCopy(); + map.put(space, copy); + union.add(copy); + } + + Collection<Surface> all = new LinkedList<Surface>(); + Collection<Surface> deletion = new LinkedList<Surface>(); + + for(Surface surface:inside) { + Surface copy = surface.copy(map); + Space front = surface.getFrontDomain(); + if (front != owner.getEmpty()) { + Space newFront = (Space) map.get(front); + if (newFront != null) { + copy.setFrontDomain(newFront); + } + } + Space back = surface.getBackDomain(); + if (back != owner.getEmpty()) { + Space newBack = (Space) map.get(back); + if (newBack != null) { + copy.setBackDomain(newBack); + } + } + all.add(copy); + deletion.add(surface); + } + for(Surface surface:border) { + Surface copy = surface.copy(map); + Space front = surface.getFrontDomain(); + if (front != owner.getEmpty()) { + Space newFront = (Space) map.get(front); + if (newFront != null) { + copy.setFrontDomain(newFront); + } + } + Space back = surface.getBackDomain(); + if (back != owner.getEmpty()) { + Space newBack = (Space) map.get(back); + if (newBack != null) { + copy.setBackDomain(newBack); + } + } + all.add(copy); + if (front == owner.getEmpty() || back == owner.getEmpty()) { + deletion.add(surface); + } + } + union.addAll(all); + for(Geometric geometric:deletion) { + geometric.delete(); + } + for(Space space:interior) { + space.delete(); + } + owner.add(union); + Project.getInstance().changed(owner); Selection.primary().clear(); ! Selection.primary().add(union); } }; |
|
From: Michael L. <he...@us...> - 2007-01-23 10:51:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25924/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Union progress Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** Space.java 6 Jan 2007 21:06:59 -0000 1.109 --- Space.java 23 Jan 2007 10:51:51 -0000 1.110 *************** *** 148,152 **** * Constructor for persistence layer */ ! Space() { envelope = new HashSet(); transform = new TransformStack(); --- 148,152 ---- * Constructor for persistence layer */ ! protected Space() { envelope = new HashSet(); transform = new TransformStack(); *************** *** 210,216 **** * @throws Exception If a part is being extended */ ! public Space createConstructionSpace(String name) throws Exception { 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) { --- 210,216 ---- * @throws Exception If a part is being extended */ ! public Space createConstructionSpace(String name) { if (this.level == PART_LEVEL) { ! throw new Error("Not legal to make further levels of detail, max level is PART"); } if (this.level == ELEMENT_LEVEL) { *************** *** 236,240 **** 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) { --- 236,240 ---- Space cur; if (this.level == PART_LEVEL) { ! throw new Exception("Not legal to make further levels of detail, max level is PART"); } if (this.level == ELEMENT_LEVEL) { *************** *** 1731,1734 **** --- 1731,1748 ---- /** + * + * @return new space + */ + public Space simpleCopy() { + Space copy = new Space(); + copy.classification = classification; + copy.container = container; + copy.description = description; + copy.level = level; + copy.name = name; + return copy; + } + + /** * Copy the envelope of the owner * |
|
From: Michael L. <he...@us...> - 2007-01-22 15:40:30
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17140/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Union started Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PopupMenu.java 29 Dec 2006 13:32:57 -0000 1.19 --- PopupMenu.java 22 Jan 2007 15:40:22 -0000 1.20 *************** *** 31,34 **** --- 31,35 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Project; *************** *** 383,386 **** --- 384,428 ---- }; menu.add(allConnected); + AbstractAction makeUnion = new EntitiesMenuAction(entities, "Make Union") { + public void actionPerformed(ActionEvent e) { + Collection<Surface> surfaces = new HashSet<Surface>(); + Collection<Geometric> geometrics = (Collection<Geometric>) entities; + for (Geometric geometric: geometrics) { + if (geometric instanceof Surface) { + surfaces.add((Surface) geometric); + } + } + Collection<Space> spaces = new HashSet<Space>(); + for (Surface surface: surfaces) { + Space empty = surface.getOwner().getEmpty(); + if (surface.getFrontDomain() != empty) { + spaces.add(surface.getFrontDomain()); + } + if (surface.getBackDomain() != empty) { + spaces.add(surface.getBackDomain()); + } + } + Collection<Space> interior = new HashSet<Space>(); + for (Space space: spaces) { + interior.add(space); + } + for (Space space: interior) { + surfaces.addAll(space.getEnvelope()); + } + Collection<Surface> inside = new LinkedList<Surface>(); + Collection<Surface> border = new LinkedList<Surface>(); + for (Surface surface: surfaces) { + if (interior.contains(surface.getFrontDomain()) && + interior.contains(surface.getBackDomain())) { + inside.add(surface); + } else { + border.add(surface); + } + } + Selection.primary().clear(); + Selection.primary().addAll(border); + } + }; + menu.add(makeUnion); return menu; } |
|
From: Michael L. <he...@us...> - 2007-01-22 15:40:30
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17105/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: Union started Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Edge.java 5 Jan 2007 13:54:47 -0000 1.70 --- Edge.java 22 Jan 2007 15:40:16 -0000 1.71 *************** *** 617,622 **** * @return Surfaces */ ! public static Set surfaces(Collection edges) { ! Set surfaces = new HashSet(); Iterator iter = edges.iterator(); while (iter.hasNext()) { --- 617,622 ---- * @return Surfaces */ ! public static Set<Surface> surfaces(Collection edges) { ! Set surfaces = new HashSet<Surface>(); Iterator iter = edges.iterator(); while (iter.hasNext()) { |
|
From: rimestad <rim...@us...> - 2007-01-20 21:24:57
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23448/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: made several smaller fixes to the scalefactor for cameras, including saving of it and visualization in attribute view... This alongside with better feedback when altering the current cam and copying cameras... Index: View.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.171 retrieving revision 1.172 diff -C2 -d -r1.171 -r1.172 *** View.java 12 Jan 2007 17:52:27 -0000 1.171 --- View.java 20 Jan 2007 21:24:56 -0000 1.172 *************** *** 76,84 **** */ public class View implements GLEventListener { - /** - * - */ - private static final int CONVETIONAL_WINDOW_HEIGHT = 600; - /** The logger */ private static Logger log = Logger.getLogger(View.class); --- 76,79 ---- *************** *** 748,752 **** far = far < 20 ? 20 : far; double focalwidth = camera.getFocalwidth(); ! double d = View.height / CONVETIONAL_WINDOW_HEIGHT; if (camera.getType() == Camera.ORTHOGRAPHIC) { int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); --- 743,747 ---- far = far < 20 ? 20 : far; double focalwidth = camera.getFocalwidth(); ! double d = View.height / Camera.CONVETIONAL_WINDOW_HEIGHT; if (camera.getType() == Camera.ORTHOGRAPHIC) { int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); *************** *** 783,787 **** protected void grid(CoordinateSystem cs) { double size = View.gridSize(); ! gl.glLineWidth(0.5f); gl.glColor4fv(gridColor, 0); //gl.glDisable(GL.GL_DEPTH_TEST); --- 778,782 ---- protected void grid(CoordinateSystem cs) { double size = View.gridSize(); ! gl.glLineWidth(1.0f); gl.glColor4fv(gridColor, 0); //gl.glDisable(GL.GL_DEPTH_TEST); *************** *** 812,816 **** protected void coords() { double size = View.gridSize(); ! gl.glLineWidth(0.5f); gl.glBegin(GL.GL_LINES); gl.glDisable(GL.GL_DEPTH_TEST); --- 807,811 ---- protected void coords() { double size = View.gridSize(); ! gl.glLineWidth(1.0f); gl.glBegin(GL.GL_LINES); gl.glDisable(GL.GL_DEPTH_TEST); *************** *** 1548,1552 **** */ private void drawConstructorLine(Vertex from, Vertex direction, double dist) { ! gl.glLineWidth(0.5f); gl.glEnable(GL.GL_LINE_STIPPLE); drawConstructorLineGeometry(from, direction, dist); --- 1543,1547 ---- */ private void drawConstructorLine(Vertex from, Vertex direction, double dist) { ! gl.glLineWidth(1.0f); gl.glEnable(GL.GL_LINE_STIPPLE); drawConstructorLineGeometry(from, direction, dist); *************** *** 2279,2285 **** private void drawConstructor(Edge e) { gl.glEnable(GL.GL_LINE_STIPPLE); - gl.glLineWidth(0.5f); drawEdge(e); - gl.glLineWidth(1.0f); gl.glDisable(GL.GL_LINE_STIPPLE); } --- 2274,2278 ---- *************** *** 3359,3399 **** this.glObjects3D.add(glo); } - - /** - * Calculate the 1 : factor ralationship with reality - * @return The to reality factor for the camera - */ - public double calcFactor() { - Camera current = Project.getInstance().getCurrentCamera(); - double[] camera = current.getCamera(); - double[] center = current.getCenter(); - double length = Math.sqrt((camera[0] - center[0]) * (camera[0] - center[0]) + - (camera[1] - center[1]) * (camera[1] - center[1]) + - (camera[2] - center[2]) * (camera[2] - center[2])); - double tal = Math.tan(Math.toRadians(current.getFocalwidth())) * length; - int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); - double dpm = (dpi / 2.54) * 100; - double windowheight = CONVETIONAL_WINDOW_HEIGHT / dpm; - log.info("factor " + (tal / windowheight)); - return tal / windowheight; - } - - /** - * Calc position for the camera based on the given to reality factor - */ - public void invertFactor() { - Camera current = Project.getInstance().getCurrentCamera(); - int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); - double dpm = (dpi / 2.54) * 100; - double window = CONVETIONAL_WINDOW_HEIGHT / dpm; - double length = current.getFactor() * window; - length /= Math.tan(Math.toRadians(current.getFocalwidth())); - double[] camera = current.getCamera(); - double[] center = current.getCenter(); - Vertex back = new Vertex(camera).minus(new Vertex(center)); - back.scale(length / back.length()); - camera[0] = center[0] + back.getX(); - camera[1] = center[1] + back.getY(); - camera[2] = center[2] + back.getZ(); - } } --- 3352,3354 ---- |
|
From: rimestad <rim...@us...> - 2007-01-20 21:24:57
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23448/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java Log Message: made several smaller fixes to the scalefactor for cameras, including saving of it and visualization in attribute view... This alongside with better feedback when altering the current cam and copying cameras... Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** ToolFactory.java 14 Jan 2007 23:33:28 -0000 1.72 --- ToolFactory.java 20 Jan 2007 21:24:56 -0000 1.73 *************** *** 268,274 **** Action orthoAction = new ToolAction(glv, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { ! if (Project.getInstance().getCurrentCamera().getType() != Camera.ORTHOGRAPHIC) { ! Project.getInstance().getCurrentCamera().setType(Camera.ORTHOGRAPHIC); ! int fac = (int)glv.getView().calcFactor(); Project.getInstance().getCurrentCamera().setFactor(fac); glv.setFactor(fac); --- 268,275 ---- Action orthoAction = new ToolAction(glv, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { ! Camera cam = Project.getInstance().getCurrentCamera(); ! if (cam.getType() != Camera.ORTHOGRAPHIC) { ! cam.setType(Camera.ORTHOGRAPHIC); ! int fac = (int)cam.calcFactor(); Project.getInstance().getCurrentCamera().setFactor(fac); glv.setFactor(fac); *************** *** 281,288 **** Action perspAction = new ToolAction(glv, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { ! if (Project.getInstance().getCurrentCamera().getType() != Camera.PERSPECTIVE) { ! Project.getInstance().getCurrentCamera().setType(Camera.PERSPECTIVE); glv.disableFactor(); ! glv.getView().invertFactor(); glv.repaint(); } --- 282,290 ---- Action perspAction = new ToolAction(glv, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { ! Camera cam = Project.getInstance().getCurrentCamera(); ! if (cam.getType() != Camera.PERSPECTIVE) { ! cam.setType(Camera.PERSPECTIVE); glv.disableFactor(); ! cam.invertFactor(); glv.repaint(); } |
|
From: rimestad <rim...@us...> - 2007-01-20 21:24:57
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23448/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: made several smaller fixes to the scalefactor for cameras, including saving of it and visualization in attribute view... This alongside with better feedback when altering the current cam and copying cameras... Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** GLView.java 19 Jan 2007 14:18:32 -0000 1.49 --- GLView.java 20 Jan 2007 21:24:56 -0000 1.50 *************** *** 10,13 **** --- 10,14 ---- import net.sourceforge.bprocessor.gl.tool.ToolFactory; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Project; *************** *** 188,191 **** --- 189,198 ---- */ public void repaint() { + if (Project.getInstance().getCurrentCamera().getType() == Camera.PERSPECTIVE) { + disableFactor(); + } else { + setFactor((int)Project.getInstance().getCurrentCamera().getFactor()); + enableFactor(); + } repaint(false); } *************** *** 314,318 **** label = new JLabel("Scale factor:"); this.add(label); ! items = new String[]{"1:1", "1:2","1:5", "1:10", "1:50", "1:100", "1:500", "1:1000"}; choices = new JComboBox(items); choices.setEditable(true); --- 321,325 ---- label = new JLabel("Scale factor:"); this.add(label); ! items = new String[]{"1:1", "1:2", "1:5", "1:10", "1:50", "1:100", "1:500", "1:1000"}; choices = new JComboBox(items); choices.setEditable(true); |
|
From: rimestad <rim...@us...> - 2007-01-20 21:24:56
|
Update of /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23440/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: made several smaller fixes to the scalefactor for cameras, including saving of it and visualization in attribute view... This alongside with better feedback when altering the current cam and copying cameras... Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** GUI.java 8 Jan 2007 12:31:48 -0000 1.57 --- GUI.java 20 Jan 2007 21:24:49 -0000 1.58 *************** *** 111,115 **** instance = this; Thread sc = new SpaceChecker(); ! //sc.start(); } --- 111,115 ---- instance = this; Thread sc = new SpaceChecker(); ! sc.start(); } |
|
From: rimestad <rim...@us...> - 2007-01-20 21:24:52
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23425/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Persistence.java Log Message: made several smaller fixes to the scalefactor for cameras, including saving of it and visualization in attribute view... This alongside with better feedback when altering the current cam and copying cameras... Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Persistence.java 6 Jan 2007 21:06:59 -0000 1.31 --- Persistence.java 20 Jan 2007 21:24:44 -0000 1.32 *************** *** 137,140 **** --- 137,141 ---- TripletType up = ct.getRoll(); cam.setRoll(new double[]{up.getX(), up.getY(), up.getZ()}); + cam.setFactor(ct.getScalefactor()); Collection clips = ct.getClipplanes(); Iterator clipit = clips.iterator(); *************** *** 727,730 **** --- 728,732 ---- up.setZ(c.getRoll()[2]); cam.setRoll(up); + cam.setScalefactor((int)c.getFactor()); Collection clips = c.getClipplanes(); Iterator clipit = clips.iterator(); Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Camera.java 12 Jan 2007 17:52:32 -0000 1.34 --- Camera.java 20 Jan 2007 21:24:44 -0000 1.35 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.model; + import java.awt.Toolkit; import java.util.ArrayList; import java.util.Collection; *************** *** 40,43 **** --- 41,47 ---- public static final int PERSPECTIVE = 6; + /** The standard window height */ + public static final int CONVETIONAL_WINDOW_HEIGHT = 600; + /** The logger */ private static Logger log = Logger.getLogger(Camera.class); *************** *** 123,128 **** this.setCamera(new double[]{other.camera[0], other.camera[1], other.camera[2]}); this.setRoll(new double[]{other.roll[0], other.roll[1], other.roll[2]}); - this.setType(other.getType()); this.factor = other.factor; this.setFocalwidth(other.getFocalwidth()); Iterator clips = other.getClipplanes().iterator(); --- 127,132 ---- this.setCamera(new double[]{other.camera[0], other.camera[1], other.camera[2]}); this.setRoll(new double[]{other.roll[0], other.roll[1], other.roll[2]}); this.factor = other.factor; + this.setType(other.getType()); this.setFocalwidth(other.getFocalwidth()); Iterator clips = other.getClipplanes().iterator(); *************** *** 327,330 **** --- 331,335 ---- } else { factor /= 2; + invertFactor(); } } *************** *** 340,343 **** --- 345,349 ---- } else { factor *= 2; + invertFactor(); } } *************** *** 545,548 **** --- 551,556 ---- } else if (a.getName().equals("FOW")) { setFocalwidth(((Double)a.getValue()).doubleValue()); + } else if (a.getName().equals("Scale factor")) { + setFactor(((Double)a.getValue()).intValue()); } else { log.error("Wrong attribute for the object " + a); *************** *** 561,565 **** a.setEditable(false); res.add(a); ! ArrayList<Attribute> cam = new ArrayList<Attribute>(3); cam.add(new Attribute("X", new Double(getCamera()[0]))); --- 569,575 ---- a.setEditable(false); res.add(a); ! if (this.type == ORTHOGRAPHIC) { ! res.add(new Attribute("Scale factor", getFactor())); ! } ArrayList<Attribute> cam = new ArrayList<Attribute>(3); cam.add(new Attribute("X", new Double(getCamera()[0]))); *************** *** 676,679 **** public void setFactor(double factor) { this.factor = factor; ! } } --- 686,727 ---- public void setFactor(double factor) { this.factor = factor; ! } ! ! ! /** ! * Calculate the 1 : factor ralationship with reality ! * @return The to reality factor for the camera ! */ ! public double calcFactor() { ! Camera current = this; ! double[] camera = current.getCamera(); ! double[] center = current.getCenter(); ! double length = Math.sqrt((camera[0] - center[0]) * (camera[0] - center[0]) + ! (camera[1] - center[1]) * (camera[1] - center[1]) + ! (camera[2] - center[2]) * (camera[2] - center[2])); ! double tal = Math.tan(Math.toRadians(current.getFocalwidth())) * length; ! int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); ! double dpm = (dpi / 2.54) * 100; ! double windowheight = CONVETIONAL_WINDOW_HEIGHT / dpm; ! return tal / windowheight; ! } ! ! /** ! * Calc position for the camera based on the given to reality factor ! */ ! public void invertFactor() { ! Camera current = this; ! int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); ! double dpm = (dpi / 2.54) * 100; ! double window = CONVETIONAL_WINDOW_HEIGHT / dpm; ! double length = current.getFactor() * window; ! length /= Math.tan(Math.toRadians(current.getFocalwidth())); ! double[] camera = current.getCamera(); ! double[] center = current.getCenter(); ! Vertex back = new Vertex(camera).minus(new Vertex(center)); ! back.scale(length / back.length()); ! camera[0] = center[0] + back.getX(); ! camera[1] = center[1] + back.getY(); ! camera[2] = center[2] + back.getZ(); ! } } |
|
From: rimestad <rim...@us...> - 2007-01-20 21:24:52
|
Update of /cvsroot/bprocessor//model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23425/src/etc Modified Files: bprocessor.xsd Log Message: made several smaller fixes to the scalefactor for cameras, including saving of it and visualization in attribute view... This alongside with better feedback when altering the current cam and copying cameras... Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor//model/src/etc/bprocessor.xsd,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** bprocessor.xsd 18 Dec 2006 09:11:47 -0000 1.25 --- bprocessor.xsd 20 Jan 2007 21:24:45 -0000 1.26 *************** *** 66,71 **** <xsd:complexType name="CameraType"> <xsd:complexContent> ! <xsd:extension base="EntityType"> ! <xsd:sequence> <xsd:element name="camera" type="TripletType" maxOccurs="1" minOccurs="1"/> <xsd:element name="center" type="TripletType" maxOccurs="1" minOccurs="1"/> --- 66,72 ---- <xsd:complexType name="CameraType"> <xsd:complexContent> ! <xsd:extension base="EntityType"> ! <xsd:sequence> ! <xsd:element name="scalefactor" type="xsd:int" maxOccurs="1" minOccurs="0"/> <xsd:element name="camera" type="TripletType" maxOccurs="1" minOccurs="1"/> <xsd:element name="center" type="TripletType" maxOccurs="1" minOccurs="1"/> |
|
From: rimestad <rim...@us...> - 2007-01-19 14:18:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9817/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: minor changes to factor choser Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** GLView.java 14 Jan 2007 23:33:28 -0000 1.48 --- GLView.java 19 Jan 2007 14:18:32 -0000 1.49 *************** *** 62,65 **** --- 62,67 ---- private FactorBox factor; + private JPanel lengthPanel; + /** * Constuctor *************** *** 83,87 **** GUI.getInstance().incrementPB(); ! JPanel lengthPanel = new JPanel(); lengthPanel.setLayout(new BorderLayout()); lengthPanel.add(new JLabel("Length: "), BorderLayout.WEST); --- 85,89 ---- GUI.getInstance().incrementPB(); ! lengthPanel = new JPanel(); lengthPanel.setLayout(new BorderLayout()); lengthPanel.add(new JLabel("Length: "), BorderLayout.WEST); *************** *** 89,98 **** lengthPanel.add(lengthField, BorderLayout.CENTER); factor = new FactorBox(); ! disableFactor(); ! lengthPanel.add(factor, BorderLayout.EAST); ! jp.add(lengthPanel, BorderLayout.SOUTH); GUI.getInstance().incrementPB(); ! tool = ToolFactory.getFactory(this).getDefault(); --- 91,99 ---- lengthPanel.add(lengthField, BorderLayout.CENTER); factor = new FactorBox(); ! //lengthPanel.add(factor, BorderLayout.EAST); ! GUI.getInstance().incrementPB(); jp.add(lengthPanel, BorderLayout.SOUTH); GUI.getInstance().incrementPB(); ! tool = ToolFactory.getFactory(this).getDefault(); *************** *** 274,278 **** */ public void disableFactor() { ! factor.disable(); } --- 275,280 ---- */ public void disableFactor() { ! lengthPanel.remove(factor); ! lengthPanel.revalidate(); } *************** *** 281,285 **** */ public void enableFactor() { ! factor.enable(); } --- 283,288 ---- */ public void enableFactor() { ! lengthPanel.add(factor, BorderLayout.EAST); ! lengthPanel.revalidate(); } *************** *** 309,315 **** public FactorBox() { super(); ! label = new JLabel("Factor:"); this.add(label); ! items = new String[]{"1:1", "1:50", "1:100", "1:500", "1:1000"}; choices = new JComboBox(items); choices.setEditable(true); --- 312,318 ---- public FactorBox() { super(); ! label = new JLabel("Scale factor:"); this.add(label); ! items = new String[]{"1:1", "1:2","1:5", "1:10", "1:50", "1:100", "1:500", "1:1000"}; choices = new JComboBox(items); choices.setEditable(true); *************** *** 324,371 **** public void setFactor(int i) { String item = "1:" + i; - //Uncomment if the element should be inserted into menu - /*int where = contains(item); - if (where != -1) { - choices.insertItemAt(item, where); - }*/ choices.setSelectedItem(item); } - - /** - * Check if the item is allready there or it should be addded - * @param item The item to check for - * @return The position to add the element if it's not there otherwise -1 - */ - private int contains(String item) { - int val = choices.getItemCount(); - int itemval = Integer.parseInt(item.substring(2)); - for (int i = 0; i < choices.getItemCount(); i++) { - int cur = Integer.parseInt(((String)choices.getItemAt(i)).substring(2)); - if (itemval == cur) { - return -1; - } else if (itemval > cur) { - val = i + 1; - } else { - return val; - } - } - return val; - } - - /** - * Enable the box - */ - public void disable() { - label.setEnabled(false); - choices.setEnabled(false); - } - - /** - * Disable the box - */ - public void enable() { - label.setEnabled(true); - choices.setEnabled(true); - } /** --- 327,332 ---- |
|
From: rimestad <rim...@us...> - 2007-01-15 21:45:18
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28162/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Made some minor changes and fixes to the factor chooser Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** GLView.java 12 Jan 2007 17:52:27 -0000 1.47 --- GLView.java 14 Jan 2007 23:33:28 -0000 1.48 *************** *** 19,22 **** --- 19,23 ---- import java.awt.Dimension; import java.awt.BorderLayout; + import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; *************** *** 58,61 **** --- 59,65 ---- private LengthField lengthField; + /** The label and combobox for the reality factor */ + private FactorBox factor; + /** * Constuctor *************** *** 84,95 **** lengthField = new LengthField(); lengthPanel.add(lengthField, BorderLayout.CENTER); ! String init = "-"; ! String s1 = "1:1"; ! String s2 = "1:10"; ! String s3 = "1:100"; ! String s4 = "1:250"; ! String s5 = "1:500"; ! String s6 = "1:1000"; ! lengthPanel.add(new JComboBox(new Object[]{init, s1, s2, s3, s4, s5, s6}), BorderLayout.EAST); jp.add(lengthPanel, BorderLayout.SOUTH); GUI.getInstance().incrementPB(); --- 88,95 ---- lengthField = new LengthField(); lengthPanel.add(lengthField, BorderLayout.CENTER); ! factor = new FactorBox(); ! disableFactor(); ! lengthPanel.add(factor, BorderLayout.EAST); ! jp.add(lengthPanel, BorderLayout.SOUTH); GUI.getInstance().incrementPB(); *************** *** 263,266 **** --- 263,288 ---- /** + * The factor + * @param i The size of the factor + */ + public void setFactor(int i) { + factor.setFactor(i); + } + + /** + * Disable the factor field + */ + public void disableFactor() { + factor.disable(); + } + + /** + * Enable the factor field + */ + public void enableFactor() { + factor.enable(); + } + + /** * Displays the popup menu at the given coordinates * @param pp the popup menu *************** *** 275,278 **** --- 297,388 ---- /** + * Panel for the label and JComboBox representing the size factor + */ + class FactorBox extends JPanel implements ActionListener { + private JComboBox choices; + private JLabel label; + private String[] items; + + /** + * The Constructor construct both the label and combobox + */ + public FactorBox() { + super(); + label = new JLabel("Factor:"); + this.add(label); + items = new String[]{"1:1", "1:50", "1:100", "1:500", "1:1000"}; + choices = new JComboBox(items); + choices.setEditable(true); + choices.addActionListener(this); + this.add(choices); + } + + /** + * Set the factor + * @param i the value for the factor + */ + public void setFactor(int i) { + String item = "1:" + i; + //Uncomment if the element should be inserted into menu + /*int where = contains(item); + if (where != -1) { + choices.insertItemAt(item, where); + }*/ + choices.setSelectedItem(item); + } + + /** + * Check if the item is allready there or it should be addded + * @param item The item to check for + * @return The position to add the element if it's not there otherwise -1 + */ + private int contains(String item) { + int val = choices.getItemCount(); + int itemval = Integer.parseInt(item.substring(2)); + for (int i = 0; i < choices.getItemCount(); i++) { + int cur = Integer.parseInt(((String)choices.getItemAt(i)).substring(2)); + if (itemval == cur) { + return -1; + } else if (itemval > cur) { + val = i + 1; + } else { + return val; + } + } + return val; + } + + /** + * Enable the box + */ + public void disable() { + label.setEnabled(false); + choices.setEnabled(false); + } + + /** + * Disable the box + */ + public void enable() { + label.setEnabled(true); + choices.setEnabled(true); + } + + /** + * Handle the event of the combobox + * @param The ActionEvent for the action + */ + public void actionPerformed(ActionEvent event) { + String what = (String)choices.getSelectedItem(); + if (what.matches("1:[\\d]+")) { + choices.setSelectedItem(what); + int fac = Integer.parseInt(what.substring(2)); + Project.getInstance().getCurrentCamera().setFactor(fac); + Project.getInstance().changed(Project.getInstance().getCurrentCamera()); + } + } + } + + /** * The length field class */ |
|
From: rimestad <rim...@us...> - 2007-01-15 18:43:12
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28162/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java ToolFactory.java Log Message: Made some minor changes and fixes to the factor chooser Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** ToolFactory.java 12 Jan 2007 17:52:27 -0000 1.71 --- ToolFactory.java 14 Jan 2007 23:33:28 -0000 1.72 *************** *** 268,282 **** Action orthoAction = new ToolAction(glv, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { ! Project.getInstance().getCurrentCamera().setType(Camera.ORTHOGRAPHIC); ! Project.getInstance().getCurrentCamera().setFactor(glv.getView().calcFactor()); ! glv.repaint(); } }; ! Action perspAction = new ToolAction(glv, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { ! Project.getInstance().getCurrentCamera().setType(Camera.PERSPECTIVE); ! glv.getView().invertFactor(); ! glv.repaint(); } }; --- 268,290 ---- Action orthoAction = new ToolAction(glv, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { ! if (Project.getInstance().getCurrentCamera().getType() != Camera.ORTHOGRAPHIC) { ! Project.getInstance().getCurrentCamera().setType(Camera.ORTHOGRAPHIC); ! int fac = (int)glv.getView().calcFactor(); ! Project.getInstance().getCurrentCamera().setFactor(fac); ! glv.setFactor(fac); ! glv.enableFactor(); ! glv.repaint(); ! } } }; ! Action perspAction = new ToolAction(glv, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { ! if (Project.getInstance().getCurrentCamera().getType() != Camera.PERSPECTIVE) { ! Project.getInstance().getCurrentCamera().setType(Camera.PERSPECTIVE); ! glv.disableFactor(); ! glv.getView().invertFactor(); ! glv.repaint(); ! } } }; Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** AbstractTool.java 26 Nov 2006 22:15:15 -0000 1.105 --- AbstractTool.java 14 Jan 2007 23:33:28 -0000 1.106 *************** *** 159,162 **** --- 159,163 ---- cam.zoomin(); } + glv.setFactor((int)cam.getFactor()); glv.repaint(false); } |