bprocessor-commit Mailing List for B-processor (Page 59)
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-07-16 12:23:05
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3682/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Small changes.. Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** GUI.java 19 Jun 2007 13:46:14 -0000 1.70 --- GUI.java 16 Jul 2007 12:22:47 -0000 1.71 *************** *** 427,435 **** editDelete.addActionListener(new EditAction() { public void actionPerformed(ActionEvent arg0) { ! Collection c = Selection.primary(); ! Iterator iter = c.iterator(); ! while (iter.hasNext()) { ! Geometric g = (Geometric)iter.next(); ! g.delete(); } } --- 427,433 ---- editDelete.addActionListener(new EditAction() { public void actionPerformed(ActionEvent arg0) { ! Collection<Geometric> selection = Selection.primary(); ! for (Geometric current : selection) { ! current.delete(); } } |
From: Michael L. <he...@us...> - 2007-07-16 12:22:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3696/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Small changes.. Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** Space.java 11 Jul 2007 13:02:51 -0000 1.156 --- Space.java 16 Jul 2007 12:22:52 -0000 1.157 *************** *** 782,785 **** --- 782,786 ---- for (Surface surface : surfaces) { + // Here the surface need to be unlinked remove(surface); } |
From: Michael L. <he...@us...> - 2007-07-16 12:22:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3661/src/net/sourceforge/bprocessor/gl/tool Modified Files: EraserTool.java Log Message: Small changes.. Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EraserTool.java 20 Jun 2007 13:17:55 -0000 1.7 --- EraserTool.java 16 Jul 2007 12:22:40 -0000 1.8 *************** *** 17,21 **** import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.Vertex; /** --- 17,20 ---- *************** *** 48,52 **** protected void pressed(MouseEvent e) { findTarget(e); ! if (target instanceof Edge || target instanceof ClippingPlane || target instanceof Vertex) { ((Geometric) target).delete(); Project.getInstance().changed(target); --- 47,51 ---- protected void pressed(MouseEvent e) { findTarget(e); ! if (target instanceof Edge || target instanceof ClippingPlane) { ((Geometric) target).delete(); Project.getInstance().changed(target); |
From: Michael L. <he...@us...> - 2007-07-11 13:02:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4004/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Removed unecessary code in Space.delete(edge) Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.155 retrieving revision 1.156 diff -C2 -d -r1.155 -r1.156 *** Space.java 11 Jul 2007 11:25:29 -0000 1.155 --- Space.java 11 Jul 2007 13:02:51 -0000 1.156 *************** *** 781,822 **** } - - // Remove adjacant surfaces - // FIXME unclear what goes on. for (Surface surface : surfaces) { ! List<Edge> edges = surface.getEdges(); ! int firstIndex = edges.indexOf(edge); ! int lastIndex = edges.lastIndexOf(edge); ! if (firstIndex == lastIndex) { ! remove(surface); ! } else { ! int size = edges.size(); ! int gapSize = lastIndex - firstIndex; ! if ((gapSize == 1) || gapSize == size - 1) { ! edges.remove(lastIndex); ! edges.remove(firstIndex); ! surface.setEdges(edges); ! } else { ! List<Edge> head = new LinkedList<Edge>(edges.subList(0, firstIndex)); ! List<Edge> middel = new LinkedList<Edge>(edges.subList(firstIndex + 1, lastIndex)); ! List<Edge> tail = new LinkedList<Edge>(edges.subList(lastIndex, size)); ! tail.remove(edge); ! head.addAll(tail); ! Surface s1 = new Surface(head); ! Surface s2 = new Surface(middel); ! if (s1.surrounds(s2, true)) { ! surface.setEdges(head); ! add(s2); ! surface.addHole(s2); ! } else { ! surface.setEdges(middel); ! add(s1); ! surface.addHole(s1); ! } ! } ! } } - // Remove empty endpoints if (to.getOwner() != null) { if (to.getEdges().size() == 0) { --- 781,788 ---- } for (Surface surface : surfaces) { ! remove(surface); } if (to.getOwner() != null) { if (to.getEdges().size() == 0) { |
From: Michael L. <he...@us...> - 2007-07-11 11:25:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27095/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Comments Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -d -r1.154 -r1.155 *** Space.java 27 Jun 2007 08:41:24 -0000 1.154 --- Space.java 11 Jul 2007 11:25:29 -0000 1.155 *************** *** 745,748 **** --- 745,752 ---- Vertex from = edge.getFrom(); remove(edge); + + + // Merge two adjacant surface. + // FIXME Replace with surface-analysis { if (surfaces.size() == 2) { *************** *** 776,779 **** --- 780,787 ---- } } + + + // Remove adjacant surfaces + // FIXME unclear what goes on. for (Surface surface : surfaces) { List<Edge> edges = surface.getEdges(); *************** *** 809,812 **** --- 817,822 ---- } } + + // Remove empty endpoints if (to.getOwner() != null) { if (to.getEdges().size() == 0) { |
From: Michael L. <he...@us...> - 2007-07-09 13:34:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31443/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Delay to allow double clicking a surface Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.221 retrieving revision 1.222 diff -C2 -d -r1.221 -r1.222 *** View.java 28 Jun 2007 00:04:59 -0000 1.221 --- View.java 9 Jul 2007 13:30:40 -0000 1.222 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.tool.AbstractTool; import net.sourceforge.bprocessor.gl.tool.SpaceTool; import net.sourceforge.bprocessor.gl.model.EdgeAttributes; *************** *** 52,55 **** --- 53,58 ---- import java.awt.Toolkit; + import java.awt.event.ActionEvent; + import java.awt.event.ActionListener; import java.nio.IntBuffer; *************** *** 63,66 **** --- 66,70 ---- import javax.media.opengl.glu.GLUtessellatorCallback; import javax.media.opengl.glu.GLUtessellatorCallbackAdapter; + import javax.swing.Timer; import org.apache.log4j.Logger; *************** *** 301,304 **** --- 305,314 ---- private EdgeAttributes currentEdgeAttributes; + + /** + * Currently labeled surface + */ + private Surface labelSurface; + /** * Keeps track of the current stippling *************** *** 378,381 **** --- 388,393 ---- private List<Integer> deletedLists = new LinkedList<Integer>(); + + private Timer tickler; private boolean debug = false; *************** *** 492,496 **** edgeStyleMap = new HashMap<Edge, EdgeAttributes>(); glObjects3D = new HashSet<GlObject>(); ! widgets = new LinkedList<Widget>(); } --- 504,514 ---- edgeStyleMap = new HashMap<Edge, EdgeAttributes>(); glObjects3D = new HashSet<GlObject>(); ! widgets = new LinkedList<Widget>(); ! tickler = new Timer(300, new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! View.this.glv.repaint(); ! } ! }); ! tickler.setRepeats(false); } *************** *** 1914,1926 **** */ void labelSelection(boolean clickable) { ! Collection selection = Selection.primary(); if (selection.size() == 1) { ! Iterator iter = selection.iterator(); ! while (iter.hasNext()) { ! Object current = iter.next(); ! if (current instanceof Surface) { ! labelSurface((Surface) current, clickable); } } } } --- 1932,1959 ---- */ void labelSelection(boolean clickable) { ! Collection<Geometric> selection = Selection.primary(); if (selection.size() == 1) { ! Geometric candidate = selection.iterator().next(); ! if (candidate instanceof Surface) { ! long time = System.currentTimeMillis(); ! long elapsed = time - AbstractTool.getPressedTime(); ! long delay = 0; ! if (labelSurface == null) { ! delay = 120; } + if (elapsed >= delay) { + labelSurface = (Surface) candidate; + labelSurface(labelSurface, clickable); + } else { + int when = (int) (delay - elapsed); + tickler.stop(); + tickler.setDelay(when); + tickler.start(); + } + } else { + labelSurface = null; } + } else { + labelSurface = null; } } |
From: Michael L. <he...@us...> - 2007-07-09 13:34:04
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31443/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: Delay to allow double clicking a surface Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** AbstractTool.java 9 Jul 2007 11:05:51 -0000 1.126 --- AbstractTool.java 9 Jul 2007 13:30:40 -0000 1.127 *************** *** 162,166 **** /** The time at wich the last mouse press accured */ ! protected long pressedTime; /** --- 162,175 ---- /** The time at wich the last mouse press accured */ ! private static long pressedTime; ! ! ! /** ! * ! * @return pressed time ! */ ! public static long getPressedTime() { ! return pressedTime; ! } /** |
From: Michael L. <he...@us...> - 2007-07-09 11:05:58
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6763/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: Indention Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** AbstractTool.java 19 Jun 2007 20:10:23 -0000 1.125 --- AbstractTool.java 9 Jul 2007 11:05:51 -0000 1.126 *************** *** 121,133 **** /** The mouse position last time the mouse was pressed initializes to (0,0) */ protected static int[] pressPos = new int[2]; - /** The mouse position last time there was a mouse event */ protected static int[] previousPos = new int[2]; - /** The mouse movement in x axis since press */ ! private static int dx = 0; ! /** The mouse movement in y axis since press */ ! private static int dy = 0; /** The snap variable */ --- 121,130 ---- /** The mouse position last time the mouse was pressed initializes to (0,0) */ protected static int[] pressPos = new int[2]; /** The mouse position last time there was a mouse event */ protected static int[] previousPos = new int[2]; /** The mouse movement in x axis since press */ ! protected static int dx = 0; /** The mouse movement in y axis since press */ ! protected static int dy = 0; /** The snap variable */ *************** *** 165,169 **** /** The time at wich the last mouse press accured */ ! private long pressedTime; /** --- 162,166 ---- /** The time at wich the last mouse press accured */ ! protected long pressedTime; /** *************** *** 924,926 **** --- 921,931 ---- return "No initial-tip has been written for this tool"; } + + /** + * + * @param object Object + */ + public static void info(Object object) { + log.info(object); + } } |
From: Michael L. <he...@us...> - 2007-07-06 10:37:39
|
Update of /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30014/src/net/sourceforge/bprocessor/test Modified Files: SurfaceDirection.java SurfaceAngles.java LoadSave.java SurfaceNormal.java HandedNess.java Log Message: * Copied Classification.xml * Initializes log4j Index: SurfaceNormal.java =================================================================== RCS file: /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test/SurfaceNormal.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SurfaceNormal.java 25 Jan 2007 10:21:04 -0000 1.2 --- SurfaceNormal.java 6 Jul 2007 09:50:39 -0000 1.3 *************** *** 14,17 **** --- 14,19 ---- import java.util.List; + import org.apache.log4j.PropertyConfigurator; + import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Persistence; *************** *** 28,31 **** --- 30,34 ---- */ public static void main(String[] args) { + PropertyConfigurator.configure("log4j.properties"); File input = new File(args[0]); try { Index: LoadSave.java =================================================================== RCS file: /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test/LoadSave.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LoadSave.java 4 Dec 2006 14:45:53 -0000 1.1 --- LoadSave.java 6 Jul 2007 09:50:39 -0000 1.2 *************** *** 10,13 **** --- 10,15 ---- import java.io.File; + import org.apache.log4j.PropertyConfigurator; + import net.sourceforge.bprocessor.model.Persistence; *************** *** 28,31 **** --- 30,34 ---- */ public static void main(String[] args) { + PropertyConfigurator.configure("log4j.properties"); File input = new File(args[0]); File output = new File(args[1]); Index: SurfaceAngles.java =================================================================== RCS file: /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test/SurfaceAngles.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SurfaceAngles.java 7 May 2007 09:48:47 -0000 1.2 --- SurfaceAngles.java 6 Jul 2007 09:50:39 -0000 1.3 *************** *** 14,17 **** --- 14,19 ---- import java.util.List; + import org.apache.log4j.PropertyConfigurator; + import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; *************** *** 30,33 **** --- 32,36 ---- */ public static void main(String[] args) { + PropertyConfigurator.configure("log4j.properties"); File input = new File(args[0]); try { Index: HandedNess.java =================================================================== RCS file: /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test/HandedNess.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HandedNess.java 8 Dec 2006 13:37:05 -0000 1.1 --- HandedNess.java 6 Jul 2007 09:50:39 -0000 1.2 *************** *** 14,17 **** --- 14,19 ---- import java.util.List; + import org.apache.log4j.PropertyConfigurator; + import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Entity; *************** *** 30,33 **** --- 32,36 ---- */ public static void main(String[] args) { + PropertyConfigurator.configure("log4j.properties"); File input = new File(args[0]); try { Index: SurfaceDirection.java =================================================================== RCS file: /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test/SurfaceDirection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceDirection.java 8 Dec 2006 10:55:20 -0000 1.1 --- SurfaceDirection.java 6 Jul 2007 09:50:39 -0000 1.2 *************** *** 14,17 **** --- 14,19 ---- import java.util.List; + import org.apache.log4j.PropertyConfigurator; + import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Entity; *************** *** 30,33 **** --- 32,36 ---- */ public static void main(String[] args) { + PropertyConfigurator.configure("log4j.properties"); File input = new File(args[0]); try { |
From: Michael L. <he...@us...> - 2007-07-06 10:37:39
|
Update of /cvsroot/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30014 Added Files: log4j.properties Classification.xml Log Message: * Copied Classification.xml * Initializes log4j --- NEW FILE: log4j.properties --- # Setup the root category log4j.rootCategory=INFO, Console #log4j.category.net.sourceforge.bprocessor=INFO #log4j.category.net.sourceforge.bprocessor.gl=DEBUG ### The server.log file appender log4j.appender.Default=org.apache.log4j.RollingFileAppender log4j.appender.Default.File=kernel.log log4j.appender.Default.MaxFileSize=20000KB log4j.appender.Default.MaxBackupIndex=1 log4j.appender.Default.layout=org.apache.log4j.PatternLayout # Truncate if it aleady exists. log4j.appender.Default.Append=false # Console log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.Threshold=DEBUG log4j.appender.Console.layout=org.apache.log4j.PatternLayout # The pattern: Date Priority [Category] (Thread) Message\n log4j.appender.Default.layout.ConversionPattern=%d %-5p [%c] (%t) %m%n log4j.appender.Console.layout.ConversionPattern=%d %-5p [%c] (%t) %m%n --- NEW FILE: Classification.xml --- (This appears to be a binary file; contents omitted.) |
From: Michael L. <he...@us...> - 2007-06-28 13:03:45
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18013/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: Refactored a bit Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Persistence.java 28 Jun 2007 12:36:07 -0000 1.42 --- Persistence.java 28 Jun 2007 13:03:42 -0000 1.43 *************** *** 236,247 **** ! private static Space internalizeElement(Space owner, SpaceType xml, Map mapper, Collection xmls) { ! if (xml instanceof NetType) { ! return internalizeNet(owner, xml, mapper, xmls); ! } else if (xml instanceof SpaceType) { ! return internalizeSpace(owner, xml, mapper, xmls); } else { ! return null; } } --- 236,247 ---- ! private static Space internalizeElement(Space owner, ! net.sourceforge.bprocessor.model.xml.Space xml, Map mapper, Collection xmls) { ! SpaceType type = xml.getValueObject(); ! if (type instanceof NetType) { ! return internalizeNet(owner, type, mapper, xmls); } else { ! return internalizeSpace(owner, type, mapper, xmls); } } *************** *** 279,287 **** Iterator iter = xml.getSpace().iterator(); while (iter.hasNext()) { ! Object current = iter.next(); ! if (current instanceof net.sourceforge.bprocessor.model.xml.Space) { ! current = ((net.sourceforge.bprocessor.model.xml.Space)current).getValueObject(); ! } ! Space element = internalizeElement(space, (SpaceType) current, mapper, xmls); elements.put(element.getId(), element); } --- 279,285 ---- Iterator iter = xml.getSpace().iterator(); while (iter.hasNext()) { ! net.sourceforge.bprocessor.model.xml.Space current = ! (net.sourceforge.bprocessor.model.xml.Space) iter.next(); ! Space element = internalizeElement(space, current, mapper, xmls); elements.put(element.getId(), element); } |
From: Michael L. <he...@us...> - 2007-06-28 12:36:12
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7132/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: Refactored a bit Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Persistence.java 28 Jun 2007 12:18:57 -0000 1.41 --- Persistence.java 28 Jun 2007 12:36:07 -0000 1.42 *************** *** 235,238 **** --- 235,250 ---- } + + private static Space internalizeElement(Space owner, SpaceType xml, + Map mapper, Collection xmls) { + if (xml instanceof NetType) { + return internalizeNet(owner, xml, mapper, xmls); + } else if (xml instanceof SpaceType) { + return internalizeSpace(owner, xml, mapper, xmls); + } else { + return null; + } + } + /** * @param owner Space *************** *** 271,282 **** current = ((net.sourceforge.bprocessor.model.xml.Space)current).getValueObject(); } ! Space element = null; ! if (current instanceof NetType) { ! element = internalizeNet(space, (SpaceType)current, mapper, xmls); ! } else if (current instanceof SpaceType) { ! element = internalizeSpace(space, (SpaceType)current, mapper, xmls); ! } else { ! log.error("unsupported spacetype"); ! } elements.put(element.getId(), element); } --- 283,287 ---- current = ((net.sourceforge.bprocessor.model.xml.Space)current).getValueObject(); } ! Space element = internalizeElement(space, (SpaceType) current, mapper, xmls); elements.put(element.getId(), element); } |
From: Michael L. <he...@us...> - 2007-06-28 12:19:07
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32197/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: Refactored a bit Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Persistence.java 26 Jun 2007 10:56:54 -0000 1.40 --- Persistence.java 28 Jun 2007 12:18:57 -0000 1.41 *************** *** 211,214 **** --- 211,237 ---- + private static Classification internalizeClassifaction(String string, int type) { + Classification classification = null; + if (!string.equalsIgnoreCase("unassigned")) { + if (type == Space.CONSTRUCTION) { + if (string.startsWith("-")) { + classification = Project.getInstance().getClassification(string, 0); + } else { + Classification owner = Project.getInstance().getClassification("-99", 0); + classification = new Classification("-1", string, owner, 0); + owner.addChild(classification); + } + } else { + if (string.startsWith("-")) { + classification = Project.getInstance().getClassification(string, 1); + } else { + Classification owner = Project.getInstance().getClassification("-99", 1); + classification = new Classification("-1", string, owner, 1); + owner.addChild(classification); + } + } + } + return classification; + } /** *************** *** 235,262 **** space.setDescription(xml.getDescription()); space.setUnion(xml.isUnion()); ! if (!xml.getClassification().equalsIgnoreCase("unassigned")) { ! if (type == Space.CONSTRUCTION) { ! if (xml.getClassification().startsWith("-")) { ! space.setClassification(Project.getInstance(). ! getClassification(xml.getClassification(), 0)); ! } else { ! Classification newclas = new Classification("-1", xml.getClassification(), ! Project.getInstance().getClassification("-99", 0), 0); ! Project.getInstance().getClassification("-99", 0).addChild(newclas); ! space.setClassification(newclas); ! } ! } else { ! if (xml.getClassification().startsWith("-")) { ! space.setClassification(Project.getInstance(). ! getClassification(xml.getClassification(), 1)); ! } else { ! Classification newclas = new Classification("-1", xml.getClassification(), ! Project.getInstance().getClassification("-99", 1), 1); ! Project.getInstance().getClassification("-99", 1).addChild(newclas); ! space.setClassification(newclas); ! } ! ! } ! } mapper.put(new Long(xml.getId()), space); --- 258,263 ---- space.setDescription(xml.getDescription()); space.setUnion(xml.isUnion()); ! space.setClassification(internalizeClassifaction(xml.getClassification(), type)); ! mapper.put(new Long(xml.getId()), space); |
From: Nordholt <nor...@us...> - 2007-06-28 00:37:55
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2353/src/net/sourceforge/bprocessor/gl/tool Modified Files: SelectStrategy.java Log Message: Made the active coordinatesystem unselectable when using multiselection. Made multiselection sensitive to the direction in which the box was dragged. Index: SelectStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SelectStrategy.java 19 Jun 2007 16:11:06 -0000 1.14 --- SelectStrategy.java 28 Jun 2007 00:37:48 -0000 1.15 *************** *** 12,15 **** --- 12,16 ---- import java.util.Iterator; import java.util.List; + import java.util.Set; import org.apache.log4j.Logger; *************** *** 52,56 **** /** The drag box */ ! protected HashSet box; /** The target */ --- 53,57 ---- /** The drag box */ ! protected HashSet<Edge> box; /** The target */ *************** *** 82,86 **** e4.setStrippled(true); ! box = new HashSet(); box.add(e1); box.add(e2); --- 83,87 ---- e4.setStrippled(true); ! box = new HashSet<Edge>(); box.add(e1); box.add(e2); *************** *** 223,228 **** --- 224,244 ---- glv.getView().removeTempEdge(constructor); } + int newX = e.getX(); List l = glv.getView().getObjectInArea(x, y, e.getX(), e.getY()); + l.remove(Project.getInstance().getActiveCoordinateSystem()); + if (newX > x) { + Set<Geometric> remove = new HashSet<Geometric>(); + for (Object o : l) { + if (o instanceof Geometric) { + Geometric geo = (Geometric)o; + Set<Vertex> vertices = geo.collect(); + if (!l.containsAll(vertices)) { + remove.add(geo); + } + } + } + l.removeAll(remove); + } glv.getView().makeTarget(null); selection.addAll(l); |
From: Nordholt <nor...@us...> - 2007-06-28 00:13:30
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25379/src/net/sourceforge/bprocessor/gl/view Modified Files: ViewToolbarFactory.java Log Message: corrected style errors Index: ViewToolbarFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewToolbarFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ViewToolbarFactory.java 28 Jun 2007 00:04:59 -0000 1.1 --- ViewToolbarFactory.java 28 Jun 2007 00:13:31 -0000 1.2 *************** *** 1,2 **** --- 1,8 ---- + //--------------------------------------------------------------------------------- + // $Id$ + // + // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) + // Released under the Lesser GNU Public License v2.1 + //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.view; *************** *** 16,23 **** --- 22,36 ---- import net.sourceforge.bprocessor.gui.Toolbar; + /** + * This class generates buttons relating to the view and puts them in the toolbar. + */ public class ViewToolbarFactory { /** The logger */ private static Logger log = Logger.getLogger(ViewToolbarFactory.class); + /** + * Registers the buttons in the toolbar + * @param glv the GLView object the buttons should have effect on + */ public void registerToolbar(GLView glv) { Toolbar tb = Toolbar.getInstance(); |
From: Nordholt <nor...@us...> - 2007-06-28 00:05:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21825/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Extracted code generating the view part of the toolbar into a new class. Added a new drawmode similar to the shading mode but where surfaces that would otherwise be rasterized-seethrough now are invisible and unselectable. Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** GLView.java 19 Jun 2007 16:09:36 -0000 1.61 --- GLView.java 28 Jun 2007 00:04:59 -0000 1.62 *************** *** 10,13 **** --- 10,14 ---- import net.sourceforge.bprocessor.gl.tool.ToolFactory; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.gl.view.ViewToolbarFactory; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Observer; *************** *** 121,124 **** --- 122,126 ---- view = new View(this); + (new ViewToolbarFactory()).registerToolbar(this); glc.addGLEventListener(view); GUI.getInstance().incrementPB(); |
From: Nordholt <nor...@us...> - 2007-06-28 00:04:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21825/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Added Files: ViewToolbarFactory.java Log Message: Extracted code generating the view part of the toolbar into a new class. Added a new drawmode similar to the shading mode but where surfaces that would otherwise be rasterized-seethrough now are invisible and unselectable. --- NEW FILE: ViewToolbarFactory.java --- package net.sourceforge.bprocessor.gl.view; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.net.URL; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.ButtonGroup; import javax.swing.ImageIcon; import javax.swing.JToggleButton; import org.apache.log4j.Logger; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gui.Toolbar; public class ViewToolbarFactory { /** The logger */ private static Logger log = Logger.getLogger(ViewToolbarFactory.class); public void registerToolbar(GLView glv) { Toolbar tb = Toolbar.getInstance(); tb.addSeparator(3); ButtonGroup bg = new ButtonGroup(); JToggleButton but = tb.registerAction(new ViewLighting(glv)); bg.add(but); but.setToolTipText("Shading"); but.setMnemonic(KeyEvent.VK_F5); but.setSelected(true); but = tb.registerAction(new ViewNoRaster(glv)); bg.add(but); but.setToolTipText("Shading no raster"); but.setMnemonic(KeyEvent.VK_F6); but = tb.registerAction(new ViewSolid(glv)); bg.add(but); but.setToolTipText("Solid"); but.setMnemonic(KeyEvent.VK_F7); but = tb.registerAction(new ViewWireframe(glv)); bg.add(but); but.setToolTipText("Wireframe"); but.setMnemonic(KeyEvent.VK_F8); } /** * The viewwireframe inner class */ class ViewWireframe extends AbstractAction { /** */ private static final long serialVersionUID = 1L; /** The GLView */ private GLView glv = null; /** * Constructor * @param glv TheGLView */ ViewWireframe(GLView glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconwire.gif"); ImageIcon im = new ImageIcon(url); putValue(Action.SMALL_ICON, im); } /** * Called when the button is pressed * @param e The ActionEvent */ public void actionPerformed(ActionEvent e) { glv.getView().changeDrawMode(View.WIREFRAME_MODE); glv.repaint(true); } } /** * The "no raster" inner class */ class ViewNoRaster extends AbstractAction { /** */ private static final long serialVersionUID = 1L; /** The GLView */ private GLView glv = null; /** * Constructor * @param glv TheGLView */ ViewNoRaster(GLView glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconlight.gif"); ImageIcon im = new ImageIcon(url); putValue(Action.SMALL_ICON, im); } /** * Called when the button is pressed * @param e The ActionEvent */ public void actionPerformed(ActionEvent e) { glv.getView().changeDrawMode(View.SPACE_ASSGN_MODE); glv.repaint(true); } } /** * The viewSolid inner class */ class ViewSolid extends AbstractAction { /** */ private static final long serialVersionUID = 1L; /** The GLView */ private GLView glv = null; /** * Constructor * @param glv TheGLView */ ViewSolid(GLView glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconsolid.gif"); ImageIcon im = new ImageIcon(url); putValue(Action.SMALL_ICON, im); } /** * Called when the button is pressed * @param e The ActionEvent */ public void actionPerformed(ActionEvent e) { glv.getView().changeDrawMode(View.SOLID_MODE); glv.repaint(true); } } /** * The viewlighting inner class */ class ViewLighting extends AbstractAction { /** */ private static final long serialVersionUID = 1L; /** The GLView */ private GLView glv = null; /** * Constructor * @param glv TheGLView */ ViewLighting(GLView glv) { this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconlight.gif"); ImageIcon im = new ImageIcon(url); putValue(Action.SMALL_ICON, im); } /** * Called when the button is pressed * @param e The ActionEvent */ public void actionPerformed(ActionEvent e) { glv.getView().changeDrawMode(View.LIGHTING_MODE); glv.repaint(true); } } } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.220 retrieving revision 1.221 diff -C2 -d -r1.220 -r1.221 *** View.java 27 Jun 2007 22:08:13 -0000 1.220 --- View.java 28 Jun 2007 00:04:59 -0000 1.221 *************** *** 15,19 **** import net.sourceforge.bprocessor.gl.model.SpaceBox; import net.sourceforge.bprocessor.gl.model.Widget; - import net.sourceforge.bprocessor.gui.Toolbar; import net.sourceforge.bprocessor.model.ClippingPlane; --- 15,18 ---- *************** *** 53,59 **** import java.awt.Toolkit; - import java.awt.event.ActionEvent; - import java.awt.event.KeyEvent; - import java.net.URL; import java.nio.IntBuffer; --- 52,55 ---- *************** *** 67,75 **** import javax.media.opengl.glu.GLUtessellatorCallback; import javax.media.opengl.glu.GLUtessellatorCallbackAdapter; - import javax.swing.AbstractAction; - import javax.swing.Action; - import javax.swing.ImageIcon; - import javax.swing.JToggleButton; - import javax.swing.ButtonGroup; import org.apache.log4j.Logger; --- 63,66 ---- *************** *** 209,218 **** /** The last touched surface */ protected static Surface lastSurface; ! /** */ public static final int WIREFRAME_MODE = 2; ! /** */ public static final int SOLID_MODE = 1; ! /** */ public static final int LIGHTING_MODE = 0; --- 200,215 ---- /** The last touched surface */ protected static Surface lastSurface; + + /** Flag for the "space assignmened only" style of view. + * This style of view will only show those surfaces that + * have some space assignment*/ + public static final int SPACE_ASSGN_MODE = 3; ! /** Flag for the wireframe style of view */ public static final int WIREFRAME_MODE = 2; ! ! /** Flag for the solid style of view (no lighting) */ public static final int SOLID_MODE = 1; ! /** Flag for the lighted style of view (this is the default) */ public static final int LIGHTING_MODE = 0; *************** *** 493,516 **** tempVertices = new HashSet<Vertex>(); colorMap = new HashMap(); ! edgeStyleMap = new HashMap(); glObjects3D = new HashSet<GlObject>(); ! widgets = new LinkedList<Widget>(); ! ! Toolbar tb = Toolbar.getInstance(); ! tb.addSeparator(3); ! ButtonGroup bg = new ButtonGroup(); ! JToggleButton but = tb.registerAction(new ViewLighting(glv)); ! bg.add(but); ! but.setToolTipText("Shading"); ! but.setMnemonic(KeyEvent.VK_F5); ! but.setSelected(true); ! but = tb.registerAction(new ViewSolid(glv)); ! bg.add(but); ! but.setToolTipText("Solid"); ! but.setMnemonic(KeyEvent.VK_F6); ! but = tb.registerAction(new ViewWireframe(glv)); ! bg.add(but); ! but.setToolTipText("Wireframe"); ! but.setMnemonic(KeyEvent.VK_F7); } --- 490,496 ---- tempVertices = new HashSet<Vertex>(); colorMap = new HashMap(); ! edgeStyleMap = new HashMap<Edge, EdgeAttributes>(); glObjects3D = new HashSet<GlObject>(); ! widgets = new LinkedList<Widget>(); } *************** *** 1121,1126 **** transform(space.getTransformations()); if (active) { ! Collection surfaces = space.getSurfaces(); switch (drawMode) { case LIGHTING_MODE: { gl.glEnable(GL.GL_LIGHTING); --- 1101,1115 ---- transform(space.getTransformations()); if (active) { ! Collection<Surface> surfaces = space.getSurfaces(); switch (drawMode) { + case SPACE_ASSGN_MODE: { + Collection<Surface> temp = new HashSet<Surface>(); + for (Surface s : surfaces) { + if (isVisible(s)) { + temp.add(s); + } + } + surfaces = temp; + } case LIGHTING_MODE: { gl.glEnable(GL.GL_LIGHTING); *************** *** 1988,1996 **** if (selectMode == VERTICES || selectMode == ALL) { - Iterator iter = vertices.iterator(); gl.glPushMatrix(); Space owner = null; ! while (iter.hasNext()) { ! Vertex v = (Vertex)iter.next(); pushName(gl, v); if (v.getOwner() != owner) { --- 1977,1983 ---- if (selectMode == VERTICES || selectMode == ALL) { gl.glPushMatrix(); Space owner = null; ! for (Vertex v : vertices) { pushName(gl, v); if (v.getOwner() != owner) { *************** *** 2006,2014 **** } if (selectMode == EDGES || selectMode == ALL) { - Iterator iter = edges.iterator(); gl.glPushMatrix(); Space owner = null; ! while (iter.hasNext()) { ! Edge e = (Edge)iter.next(); pushName(gl, e); if (e.getOwner() != owner) { --- 1993,1999 ---- } if (selectMode == EDGES || selectMode == ALL) { gl.glPushMatrix(); Space owner = null; ! for (Edge e : edges) { pushName(gl, e); if (e.getOwner() != owner) { *************** *** 2023,2033 **** gl.glPopMatrix(); } ! if ((selectMode == SURFACES || selectMode == ALL) && ! drawMode != WIREFRAME_MODE) { ! Iterator it = surfaces.iterator(); gl.glPushMatrix(); Space owner = null; ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); pushName(gl, s); if (s.getOwner() != owner) { --- 2008,2028 ---- gl.glPopMatrix(); } ! ! if (drawMode == WIREFRAME_MODE) { ! surfaces = new HashSet<Surface>(); ! } else if (drawMode == SPACE_ASSGN_MODE) { ! Collection<Surface> temp = new LinkedList<Surface>(); ! for (Surface s : surfaces) { ! if (isVisible(s)) { ! temp.add(s); ! } ! } ! surfaces = temp; ! } ! ! if (selectMode == SURFACES || selectMode == ALL) { gl.glPushMatrix(); Space owner = null; ! for (Surface s : surfaces) { pushName(gl, s); if (s.getOwner() != owner) { *************** *** 2802,2807 **** */ public void changeDrawMode(int mode) { ! if (mode <= 2 && mode >= 0) { drawMode = mode; } } --- 2797,2803 ---- */ public void changeDrawMode(int mode) { ! if (mode <= 3 && mode >= 0) { drawMode = mode; + log.info("drawmode:" + mode); } } *************** *** 3117,3216 **** /** - * The viewwireframe inner class - */ - class ViewWireframe extends AbstractAction { - /** */ - private static final long serialVersionUID = 1L; - - /** The GLView */ - private GLView glv = null; - - /** - * Constructor - * @param glv TheGLView - */ - ViewWireframe(GLView glv) { - this.glv = glv; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL url = cl.getResource("Biconwire.gif"); - ImageIcon im = new ImageIcon(url); - putValue(Action.SMALL_ICON, im); - } - - /** - * Called when the button is pressed - * @param e The ActionEvent - */ - public void actionPerformed(ActionEvent e) { - glv.getView().changeDrawMode(View.WIREFRAME_MODE); - glv.repaint(true); - } - } - - /** - * The viewSolid inner class - */ - class ViewSolid extends AbstractAction { - /** */ - private static final long serialVersionUID = 1L; - - /** The GLView */ - private GLView glv = null; - - /** - * Constructor - * @param glv TheGLView - */ - ViewSolid(GLView glv) { - this.glv = glv; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL url = cl.getResource("Biconsolid.gif"); - ImageIcon im = new ImageIcon(url); - putValue(Action.SMALL_ICON, im); - } - - /** - * Called when the button is pressed - * @param e The ActionEvent - */ - public void actionPerformed(ActionEvent e) { - glv.getView().changeDrawMode(View.SOLID_MODE); - glv.repaint(true); - } - } - - /** - * The viewlighting inner class - */ - class ViewLighting extends AbstractAction { - /** */ - private static final long serialVersionUID = 1L; - - /** The GLView */ - private GLView glv = null; - - /** - * Constructor - * @param glv TheGLView - */ - ViewLighting(GLView glv) { - this.glv = glv; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL url = cl.getResource("Biconlight.gif"); - ImageIcon im = new ImageIcon(url); - putValue(Action.SMALL_ICON, im); - } - - /** - * Called when the button is pressed - * @param e The ActionEvent - */ - public void actionPerformed(ActionEvent e) { - glv.getView().changeDrawMode(View.LIGHTING_MODE); - glv.repaint(true); - } - } - - /** * @return Returns the bgColor. */ --- 3113,3116 ---- |
From: Nordholt <nor...@us...> - 2007-06-27 22:08:12
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10380/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Made surfaces unselectable when in wireframemode Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.219 retrieving revision 1.220 diff -C2 -d -r1.219 -r1.220 *** View.java 27 Jun 2007 00:33:53 -0000 1.219 --- View.java 27 Jun 2007 22:08:13 -0000 1.220 *************** *** 2023,2027 **** gl.glPopMatrix(); } ! if (selectMode == SURFACES || selectMode == ALL) { Iterator it = surfaces.iterator(); gl.glPushMatrix(); --- 2023,2028 ---- gl.glPopMatrix(); } ! if ((selectMode == SURFACES || selectMode == ALL) && ! drawMode != WIREFRAME_MODE) { Iterator it = surfaces.iterator(); gl.glPushMatrix(); |
From: Michael L. <he...@us...> - 2007-06-27 08:41:25
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10935/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Small cosmetic changes to source Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** Space.java 27 Jun 2007 08:34:26 -0000 1.153 --- Space.java 27 Jun 2007 08:41:24 -0000 1.154 *************** *** 60,63 **** --- 60,72 ---- private Set<Surface> envelope; + /** type */ + private int type; + + /** level Space element or part */ + private int level; + + /** If the constructionspace is transparent */ + private boolean transparent; + /** * The next boolean specifies wether or not *************** *** 68,71 **** --- 77,87 ---- private boolean container; + /** The classification */ + private Classification classification; + + /** The classification */ + private ClassificationType productType; + + /** * If proto points to another space, this space *************** *** 111,145 **** private long nextMaterialId; - /** The classification */ - private Classification classification; - - /** The classification */ - private ClassificationType productType; - - /** If the constructionspace is transparent */ - private boolean transparent; - /** The transformation */ private TransformStack transform; - /** The modellor */ private Modellor modellor; - /** type */ - private int type; - - /** level Space element or part */ - 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"; --- 127,142 ---- |
From: Michael L. <he...@us...> - 2007-06-27 08:34:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8147/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Small cosmetic changes to source Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** Space.java 26 Jun 2007 10:56:54 -0000 1.152 --- Space.java 27 Jun 2007 08:34:26 -0000 1.153 *************** *** 33,44 **** */ public class Space extends Geometric implements Parametric { - private static final long serialVersionUID = 1L; - - private static final boolean DELETE_EDGES = true; - private static Logger log = Logger.getLogger(Space.class); /** Construction Type */ public static final int CONSTRUCTION = 0; - /** functional Type */ public static final int FUNCTIONAL = 1; --- 33,40 ---- */ public class Space extends Geometric implements Parametric { private static Logger log = Logger.getLogger(Space.class); + /** Construction Type */ public static final int CONSTRUCTION = 0; /** functional Type */ public static final int FUNCTIONAL = 1; *************** *** 46,59 **** /** project level */ public static final int PROJECT_LEVEL = 2; - /** Space level */ public static final int SPACE_LEVEL = 3; - /** Element level */ public static final int ELEMENT_LEVEL = 4; - /** part level */ public static final int PART_LEVEL = 5; - /** B-net level */ public static final int NET_LEVEL = 6; --- 42,51 ---- *************** *** 61,66 **** /** part Functional Type */ private boolean isUnion = false; - - /** The name */ private String name; --- 53,56 ---- *************** *** 976,984 **** public void delete(Surface surface) { remove(surface); ! if (DELETE_EDGES) { ! for (Edge edge : surface.getEdges()) { ! if (edge.getSurfaces().size() < 1) { ! delete(edge); ! } } } --- 966,972 ---- public void delete(Surface surface) { remove(surface); ! for (Edge edge : surface.getEdges()) { ! if (edge.getSurfaces().size() < 1) { ! delete(edge); } } |
From: Nordholt <nor...@us...> - 2007-06-27 00:33:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17700/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Added feedback when locked to an edge. Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.218 retrieving revision 1.219 diff -C2 -d -r1.218 -r1.219 *** View.java 26 Jun 2007 02:04:17 -0000 1.218 --- View.java 27 Jun 2007 00:33:53 -0000 1.219 *************** *** 353,356 **** --- 353,359 ---- /** Maps entities to a color */ private Map colorMap; + + /** Maps edges to a set of attributes */ + private Map<Edge, EdgeAttributes> edgeStyleMap; /** Contains invisible entities during drawing */ *************** *** 380,385 **** private boolean debug = false; - - private Edge lockingEdge; static { --- 383,386 ---- *************** *** 492,495 **** --- 493,497 ---- tempVertices = new HashSet<Vertex>(); colorMap = new HashMap(); + edgeStyleMap = new HashMap(); glObjects3D = new HashSet<GlObject>(); widgets = new LinkedList<Widget>(); *************** *** 997,1001 **** } } - { Iterator it = glObjects3D.iterator(); --- 999,1002 ---- *************** *** 1547,1550 **** --- 1548,1553 ---- style.setStipple(true); style.setDrawVertices(true); + } else if (edgeStyleMap.get(current) != null) { + style = edgeStyleMap.get(current); } else { float[] individualColor = (float[])colorMap.get(current); *************** *** 3047,3051 **** */ public void changeColor(Entity e, float[] color) { ! colorMap.put(e, color); } --- 3050,3054 ---- */ public void changeColor(Entity e, float[] color) { ! colorMap.put(e, color); } *************** *** 3056,3061 **** --- 3059,3081 ---- public void clearColor(Entity e) { colorMap.remove(e); + } + + /** + * Sets a new style for a given edge + * @param e the edge + * @param attributes the attributes for the edge's style + */ + public void changeEdgeStyle(Edge e, EdgeAttributes attributes) { + edgeStyleMap.put(e, attributes); } + /** + * Clears the custom style of an edge + * @param e the edge + */ + public void clearStyle(Edge e) { + edgeStyleMap.remove(e); + } + /** {@inheritDoc} */ public Vertex toModelCoords(double x, double y) { *************** *** 3350,3360 **** } } - - /** - * Sets the current locking edge - * @param lockingEdge the new locking edge - */ - public void setLockingEdge(Edge lockingEdge) { - this.lockingEdge = lockingEdge; - } } --- 3370,3372 ---- |
From: Nordholt <nor...@us...> - 2007-06-27 00:33:52
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17700/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Added feedback when locked to an edge. Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** AbstractPencil.java 26 Jun 2007 00:40:11 -0000 1.83 --- AbstractPencil.java 27 Jun 2007 00:33:53 -0000 1.84 *************** *** 23,26 **** --- 23,27 ---- import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.model.EdgeAttributes; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; *************** *** 124,127 **** --- 125,135 ---- protected boolean dragging; + /** An extension of the locking edge when moving + * outside the lockingedge */ + private Edge lockEdgeExtention; + + /** A highlight for the lockingedge */ + private Edge lockHighlightEdge; + /** * Constructor *************** *** 264,268 **** /** ! * Hide feedback */ protected void hideFeedback() { --- 272,276 ---- /** ! * Removes all feedback elements from the view */ protected void hideFeedback() { *************** *** 279,284 **** /** ! * Give feedback ! * @param feed Collection of edges */ protected void feedback(Collection feed) { --- 287,292 ---- /** ! * Sets the collection of feedback elements ! * @param feed Collection feedback elements (edges and constructors) */ protected void feedback(Collection feed) { *************** *** 569,575 **** --- 577,587 ---- Intersection actual = intersection; target = intersection.vertex(); + Vertex targetVertex = intersection.vertex(); float[] targetColor = targetColor(intersection); glv.getView().removeTempVertex(lockSnapVertex); glv.getView().clearColor(lockSnapVertex); + glv.getView().removeTempEdge(lockEdgeExtention); + glv.getView().removeTempEdge(lockHighlightEdge); + glv.getView().clearStyle(lockHighlightEdge); if (intersection.type() == Intersection.LOCK_INTERSECTION) { actual = (Intersection)actual.object(); *************** *** 578,581 **** --- 590,613 ---- glv.getView().addTempVertex(lockSnapVertex); glv.getView().changeColor(lockSnapVertex, targetColor); + if (lockingEdge != null) { + EdgeAttributes ea = new EdgeAttributes(); + ea.setColor(glv.getView().TARGET_COLOR); + ea.setLineWidth(ea.getLineWidth() * 2); + lockHighlightEdge = lockingEdge; + glv.getView().addTempEdge(lockHighlightEdge); + glv.getView().changeEdgeStyle(lockHighlightEdge, ea); + if (!lockingEdge.coincides(targetVertex)) { + Vertex to = lockingEdge.getTo(); + Vertex from = lockingEdge.getFrom(); + if (to.minus(targetVertex).length() < + from.minus(targetVertex).length()) { + lockEdgeExtention = new Edge(targetVertex, to); + } else { + lockEdgeExtention = new Edge(targetVertex, from); + } + lockEdgeExtention.setStrippled(true); + glv.getView().addTempEdge(lockEdgeExtention); + } + } } if (actual.type() == Intersection.PLANE_INTERSECTION) { |
From: rimestad <rim...@us...> - 2007-06-26 10:57:23
|
Update of /cvsroot/bprocessor/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9780 Added Files: Classification.xml Log Message: Maded the readin of classification xml and made classificationType be only a container holding a list of parameters. Made all classes using classificationType reflect that. Now Classification only know of its possible ClassificationTypes and Space know which one is chosen --- NEW FILE: Classification.xml --- (This appears to be a binary file; contents omitted.) |
From: rimestad <rim...@us...> - 2007-06-26 10:57:07
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9759/src/net/sourceforge/bprocessor/model Modified Files: Space.java Persistence.java Classification.java ClassificationType.java EnergyCalc.java Project.java ClassificationFileReader.java Log Message: Maded the readin of classification xml and made classificationType be only a container holding a list of parameters. Made all classes using classificationType reflect that. Now Classification only know of its possible ClassificationTypes and Space know which one is chosen Index: ClassificationFileReader.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClassificationFileReader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassificationFileReader.java 25 Jun 2007 10:26:46 -0000 1.1 --- ClassificationFileReader.java 26 Jun 2007 10:56:54 -0000 1.2 *************** *** 37,42 **** } else { PropertyConfigurator.configure(args[1]); ! Classification construction = ClassificationFileReader.loadClassification(true, args[0]); ! Persistence.saveClassification(construction, new File(args[0] + "Construction.xml")); } } catch (Exception e) { --- 37,52 ---- } else { PropertyConfigurator.configure(args[1]); ! Map<String, ClassificationType> typeMap = loadTypes(args[0]); ! Classification construction = ! ClassificationFileReader.loadClassification(true, args[0], typeMap); ! Classification functional = ! ClassificationFileReader.loadClassification(false, args[0], typeMap); ! Persistence.saveDBK(construction, functional, typeMap.values(), ! new File(args[0] + "Classification.xml")); ! log.info("Wrote XML"); ! Classification[] loaded = Persistence.loadDBK(new File(args[0] + "Classification.xml")); ! construction = loaded[0]; ! functional = loaded[1]; ! log.info("Read XML"); } } catch (Exception e) { *************** *** 63,69 **** ClassificationType currentClassificationType = null; ClassificationType superClassificationType = null; - ClassificationType defaultType = - new ClassificationType("default", 0.0, 0.0, 0.0); - res.put("default", defaultType); while ((currentLine = bf.readLine()) != null) { lineNumber++; --- 73,76 ---- *************** *** 109,117 **** * @param locationPrefix The folder location for the files * @param construction true if its construction space classification, false if functional * @return The loaded classification */ ! public static Classification loadClassification(boolean construction, String locationPrefix) throws IOException { - Map<String, ClassificationType> typeMap = loadTypes(locationPrefix); Classification clas; String current = ""; --- 116,125 ---- * @param locationPrefix The folder location for the files * @param construction true if its construction space classification, false if functional + * @param typeMap A map from name to type * @return The loaded classification */ ! public static Classification loadClassification( ! boolean construction, String locationPrefix, Map<String, ClassificationType> typeMap) throws IOException { Classification clas; String current = ""; *************** *** 129,138 **** new InputStreamReader( new FileInputStream(locationPrefix + "construction2.txt"), "ISO-8859-1")); ! clas = new Classification("-1", "Constructional", null, Classification.CONSTRUCTION); } else { bf = new BufferedReader( new InputStreamReader( new FileInputStream(locationPrefix + "functionals.txt"), "ISO-8859-1")); ! clas = new Classification("-1", "Functional", null, Classification.FUNCTIONAL); } current = bf.readLine(); --- 137,146 ---- new InputStreamReader( new FileInputStream(locationPrefix + "construction2.txt"), "ISO-8859-1")); ! clas = new Classification("-1", "Constructional", null, Space.CONSTRUCTION); } else { bf = new BufferedReader( new InputStreamReader( new FileInputStream(locationPrefix + "functionals.txt"), "ISO-8859-1")); ! clas = new Classification("-1", "Functional", null, Space.FUNCTIONAL); } current = bf.readLine(); *************** *** 151,155 **** ClassificationType typesForCur = typeMap.get(curname); if (typesForCur == null) { ! typesForCur = typeMap.get("default"); } curclas.setPossibleTypes(typesForCur); --- 159,165 ---- ClassificationType typesForCur = typeMap.get(curname); if (typesForCur == null) { ! //If type is not there make a new one for it ! typesForCur = new ClassificationType(curname, 0, 0, 0); ! typeMap.put(curname, typesForCur); } curclas.setPossibleTypes(typesForCur); Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Classification.java 25 Jun 2007 10:26:45 -0000 1.18 --- Classification.java 26 Jun 2007 10:56:54 -0000 1.19 *************** *** 28,51 **** /** The children of this classification */ ! private Vector<Classification> children = new Vector<Classification>(); /** The parent of this classification */ private Classification parent; - /** The type of this classification */ - private ClassificationType classificationType; - /** The classification */ private ClassificationType possibleTypes; - /** Construction Type */ - public static final int CONSTRUCTION = 0; - - /** functional Type */ - public static final int FUNCTIONAL = 1; - - /** functional Type */ - public static final int TYPES = 2; - /** type */ private int type; --- 28,39 ---- /** The children of this classification */ ! private Vector<Classification> children; /** The parent of this classification */ private Classification parent; /** The classification */ private ClassificationType possibleTypes; /** type */ private int type; *************** *** 59,62 **** --- 47,51 ---- */ public Classification(String id, String name, Classification parent, int type) { + this(); setName(name); setId(id); *************** *** 83,86 **** --- 72,82 ---- /** + * Persistence constructor + */ + public Classification() { + children = new Vector<Classification>(); + } + + /** * Get the vector containing this classifications children * @return the children *************** *** 233,241 **** res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Code", getFullId(null), false)); ! res.add(new Attribute("U-value", getUvalue(), true)); ! res.add(new Attribute("Density", getDensity(), true)); ! if (classificationType != null) { ! res.add(new Attribute("Type", classificationType)); ! } return res; } --- 229,233 ---- res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Code", getFullId(null), false)); ! res.add(new Attribute("Type link", possibleTypes)); return res; } *************** *** 254,293 **** while (iter.hasNext()) { Attribute a = (Attribute)iter.next(); - if (a.getName().equals("Type")) { - setClassificationType((ClassificationType)a.getValue()); - } } } - - - /** - * Get the U-value for this classification - * @return uvalue the U-value - */ - public Double getUvalue() { - return getClassificationType().getUvalue(); - } - - /** - * Get the density for this classification - * @return density the density - */ - public Double getDensity() { - return getClassificationType().getDensity(); - } - - /** - * Return the product type - * @return The product type - */ - public ClassificationType getClassificationType() { - return classificationType; - } - /** - * Set the product type - * @param productType The product type - */ - public void setClassificationType(ClassificationType productType) { - this.classificationType = productType; - } } --- 246,250 ---- Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Persistence.java 25 Jun 2007 10:26:46 -0000 1.39 --- Persistence.java 26 Jun 2007 10:56:54 -0000 1.40 *************** *** 1,1490 **** ! //--------------------------------------------------------------------------------- ! // $Id$ ! // ! // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) ! // Released under the Lesser GNU Public License v2.1 ! //--------------------------------------------------------------------------------- ! package net.sourceforge.bprocessor.model; ! ! import net.sourceforge.bprocessor.model.modellor.Modellor; ! import net.sourceforge.bprocessor.model.xml.AxisRotateType; [...3035 lines suppressed...] ! } else if (val instanceof BooleanType) { ! content.add(new Attribute(elem.getKey(), ((BooleanType)val).isBoolean())); ! } else if (val instanceof DoubleType) { ! content.add(new Attribute(elem.getKey(), new Double(((DoubleType)val).getDouble()))); ! } else if (val instanceof RefType) { ! content.add(new Attribute(elem.getKey(), get(((RefType)val).getRef(), map))); ! } else { ! log.warn("Non supported type"); ! } ! } ! res.setAttributes(content); ! ! for (XMLSpecificTypeType subType : (List<XMLSpecificTypeType>)type.getXMLSpecificType()) { ! ClassificationType out = internalizeTypes(subType, map); ! res.addSubType(out); ! } ! map.put(res.getId(), res); ! return res; ! } ! } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** Project.java 25 Jun 2007 10:26:45 -0000 1.129 --- Project.java 26 Jun 2007 10:56:54 -0000 1.130 *************** *** 1,934 **** ! //--------------------------------------------------------------------------------- ! // $Id$ ! // ! // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) ! // Released under the Lesser GNU Public License v2.1 ! //--------------------------------------------------------------------------------- ! ! package net.sourceforge.bprocessor.model; ! ! import java.io.File; [...1843 lines suppressed...] ! Iterator it = cl.getChildren().iterator(); ! while (it.hasNext()) { ! Classification current = (Classification) it.next(); ! if (curid.equalsIgnoreCase(current.getId())) { ! cl = current; ! } ! } ! } ! } ! return cl; ! } ! ! /** ! * getter for the copy buffer ! * @return The copyBuffer ! */ ! public Collection<Geometric> getCopyBuffer() { ! return copyBuffer; ! } ! } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** Space.java 25 Jun 2007 10:26:45 -0000 1.151 --- Space.java 26 Jun 2007 10:56:54 -0000 1.152 *************** *** 154,158 **** /** the room the space belongs to */ private String room = "0"; ! /** * Constructor for persistence layer --- 154,158 ---- /** the room the space belongs to */ private String room = "0"; ! /** * Constructor for persistence layer *************** *** 1566,1570 **** } } ! if (getClassification() != null && getClassification().getClassificationType() != null) { //TODO make classificationType attribute //res.add(new Attribute("Type", getClassification().getClassificationType(), --- 1566,1570 ---- } } ! if (getClassification() != null && getClassificationType() != null) { //TODO make classificationType attribute //res.add(new Attribute("Type", getClassification().getClassificationType(), *************** *** 2984,2986 **** --- 2984,2997 ---- return res; } + + /** + * Find the parameter relating to the given string in first the space if it in not there + * then the classification is asked for it + * @param string The string representation of the wanted parameter + * @return The resulting parameter + */ + public Attribute getParameter(String string) { + //TODO make space hold own parameters + return getClassificationType().getParameter(string); + } } Index: EnergyCalc.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EnergyCalc.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EnergyCalc.java 29 Mar 2007 22:00:12 -0000 1.8 --- EnergyCalc.java 26 Jun 2007 10:56:54 -0000 1.9 *************** *** 65,69 **** if (classification.getClassification().getFullId(null).equalsIgnoreCase("-210.01")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); //loss = 0.15 * current.getArea(); return loss; --- 65,69 ---- if (classification.getClassification().getFullId(null).equalsIgnoreCase("-210.01")) { ! loss = (Double)classification.getParameter("uvalue").getValue() * current.getArea(); //loss = 0.15 * current.getArea(); return loss; *************** *** 71,90 **** if (classification.getClassification().getFullId(null).equalsIgnoreCase("-215.01") || classification.getClassification().getFullId(null).equalsIgnoreCase("-215")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); //loss = 0.15 * current.getArea(); return loss; } if (classification.getClassification().getFullId(null).equalsIgnoreCase("-215.04")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); //loss = 0.15 * current.getArea(); return loss; } if (classification.getClassification().getFullId(null).equalsIgnoreCase("-205")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); //loss = 0.25 * current.getArea(); return loss; } if (classification.getClassification().getFullId(null).equalsIgnoreCase("-205.01")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); return loss; } --- 71,90 ---- if (classification.getClassification().getFullId(null).equalsIgnoreCase("-215.01") || classification.getClassification().getFullId(null).equalsIgnoreCase("-215")) { ! loss = (Double)classification.getParameter("uvalue").getValue() * current.getArea(); //loss = 0.15 * current.getArea(); return loss; } if (classification.getClassification().getFullId(null).equalsIgnoreCase("-215.04")) { ! loss = (Double)classification.getParameter("uvalue").getValue() * current.getArea(); //loss = 0.15 * current.getArea(); return loss; } if (classification.getClassification().getFullId(null).equalsIgnoreCase("-205")) { ! loss = (Double)classification.getParameter("uvalue").getValue() * current.getArea(); //loss = 0.25 * current.getArea(); return loss; } if (classification.getClassification().getFullId(null).equalsIgnoreCase("-205.01")) { ! loss = (Double)classification.getParameter("uvalue").getValue() * current.getArea(); return loss; } *************** *** 101,105 **** if (classification.getClassification(). getFullId(null).equalsIgnoreCase("-205.02")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); //loss = 0.8 * current.getArea(); return loss; --- 101,105 ---- if (classification.getClassification(). getFullId(null).equalsIgnoreCase("-205.02")) { ! loss = (Double)classification.getParameter("uvalue").getValue() * current.getArea(); //loss = 0.8 * current.getArea(); return loss; Index: ClassificationType.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClassificationType.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassificationType.java 25 Jun 2007 10:26:45 -0000 1.1 --- ClassificationType.java 26 Jun 2007 10:56:54 -0000 1.2 *************** *** 1,173 **** ! //--------------------------------------------------------------------------------- ! // $Id$ ! // ! // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) ! // Released under the Lesser GNU Public License v2.1 ! //--------------------------------------------------------------------------------- ! package net.sourceforge.bprocessor.model; ! ! import java.util.ArrayList; ! import java.util.LinkedList; ! import java.util.List; ! ! /** ! * A placeholder for the different kind of types that can be ! * associated with the classifications ! * @author Rimestad ! */ ! public class ClassificationType { ! private String name; ! private double uvalue; ! private double density; ! private double cost; ! private List<ClassificationType> subTypes; ! private int index; ! ! /** ! * constructor ! * @param name The name for the type ! * @param uvalue the heatloss value ! * @param density the density ! * @param cost the cost pr m2 ! */ ! public ClassificationType(String name, double uvalue, double density, double cost) { ! this.name = name; ! this.uvalue = uvalue; ! this.density = density; ! this.cost = cost; ! ! subTypes = new LinkedList<ClassificationType>(); ! } ! ! /** ! * Add a type as subtype to this ! * @param subType the type to add ! */ ! public void addSubType(ClassificationType subType) { ! subTypes.add(subType); ! subType.setIndex(subTypes.size() - 1); ! } ! ! /** ! * Set the index of the classificationType ! * @param i The index ! */ ! private void setIndex(int i) { ! this.index = i; ! } ! ! /** ! * Return the index of the classificationType ! * @return The index ! */ ! public int getIndex() { ! return this.index; ! } ! ! /** ! * Return the cost value for the type ! * @return the cost ! */ ! public double getCost() { ! return cost; ! } ! ! /** ! * Set the cost for the type ! * @param cost the cost to set ! */ ! public void setCost(double cost) { ! this.cost = cost; ! } ! ! /** ! * Return the density of the type ! * @return the density ! */ ! public double getDensity() { ! return density; ! } ! ! /** ! * Set the density ! * @param density the density to set ! */ ! public void setDensity(double density) { ! this.density = density; ! } ! ! /** ! * Return the name ! * @return the name ! */ ! public String getName() { ! return name; ! } ! ! /** ! * @param name the name to set ! */ ! public void setName(String name) { ! this.name = name; ! } ! ! /** ! * @return the uvalue ! */ ! public double getUvalue() { ! return uvalue; ! } ! ! /** ! * @param uvalue the uvalue to set ! */ ! public void setUvalue(double uvalue) { ! this.uvalue = uvalue; ! } ! ! /** ! * @return the subTypes ! */ ! public List<ClassificationType> getSubTypes() { ! return subTypes; ! } ! ! /** ! * Getter for object attributes ! * @return the attributes associated with this object ! */ ! public List<Attribute> getAttributes() { ! List<Attribute> res = new ArrayList<Attribute>(); ! res.add(new Attribute("U-value", uvalue, true)); ! res.add(new Attribute("Density", density, true)); ! res.add(new Attribute("Cost", cost, true)); ! return res; ! } ! ! /** ! * Set the attribute values ! * @param attributes The new attribute values ! */ ! public void setAttributes(List<Attribute> attributes) { ! for (Attribute a : attributes) { ! if (a.getName().equals("U-value")) { ! uvalue = (Double)a.getValue(); ! continue; ! } ! if (a.getName().equals("Density")) { ! density = (Double)a.getValue(); ! continue; ! } ! if (a.getName().equals("Cost")) { ! cost = (Double)a.getValue(); ! } ! } ! } ! ! /** ! * {@inheritDoc} ! */ ! public String toString() { ! return name; ! } ! } --- 1,182 ---- ! //--------------------------------------------------------------------------------- ! // $Id$ ! // ! // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) ! // Released under the Lesser GNU Public License v2.1 ! //--------------------------------------------------------------------------------- ! package net.sourceforge.bprocessor.model; ! ! import java.util.ArrayList; ! import java.util.LinkedList; ! import java.util.List; ! ! /** ! * A placeholder for the different kind of types that can be ! * associated with the classifications ! * @author Rimestad ! */ ! public class ClassificationType { ! private static int nextClassificationId = 0; ! private String name; ! private List<Attribute> parameter; ! private List<ClassificationType> subTypes; ! private int index; ! private long id; ! ! /** ! * constructor ! * @param name The name for the type ! * @param uvalue the heatloss value ! * @param density the density ! * @param cost the cost pr m2 ! */ ! public ClassificationType(String name, double uvalue, double density, double cost) { ! this(); ! setId(nextClassificationId); ! nextClassificationId++; ! this.name = name; ! addParameter("uvalue", uvalue); ! addParameter("density", density); ! addParameter("cost", cost); ! } ! ! /** ! * A constructor for the persistencs ! */ ! public ClassificationType() { ! subTypes = new LinkedList<ClassificationType>(); ! parameter = new LinkedList<Attribute>(); ! } ! ! /** ! * Add a type as subtype to this ! * @param subType the type to add ! */ ! public void addSubType(ClassificationType subType) { ! subTypes.add(subType); ! subType.setIndex(subTypes.size() - 1); ! } ! ! /** ! * Set the index of the classificationType ! * @param i The index ! */ ! private void setIndex(int i) { ! this.index = i; ! } ! ! /** ! * Return the index of the classificationType ! * @return The index ! */ ! public int getIndex() { ! return this.index; ! } ! ! /** ! * Return the name ! * @return the name ! */ ! public String getName() { ! return name; ! } ! ! /** ! * @param name the name to set ! */ ! public void setName(String name) { ! this.name = name; ! } ! ! /** ! * @return the subTypes ! */ ! public List<ClassificationType> getSubTypes() { ! return subTypes; ! } ! ! /** ! * Getter for object attributes ! * @return the attributes associated with this object ! */ ! public List<Attribute> getAttributes() { ! List<Attribute> res = new ArrayList<Attribute>(); ! res.add(new Attribute("Name", name)); ! res.add(new Attribute("Letter", (char)(index + 'A'))); ! res.addAll(getParameters()); ! return res; ! } ! ! /** ! * Set the attribute values ! * @param attributes The new attribute values ! */ ! public void setAttributes(List<Attribute> attributes) { ! for (Attribute a : attributes) { ! parameter.clear(); ! if (a.getName().equals("Name")) { ! continue; ! } ! if (a.getName().equals("Letter")) { ! continue; ! } ! parameter.add(a); ! } ! } ! ! /** ! * Getter for parameters ! * @return the parameters ! */ ! public List<Attribute> getParameters() { ! return parameter; ! } ! ! /** ! * Add a parameter to the Classification ! * @param name The name of the paramter ! * @param o The object linked to the name ! */ ! private void addParameter(String name, Object o) { ! parameter.add(new Attribute(name, o, true)); ! } ! ! /** ! * Find the parameter relating to the given string in first the space if it in not there ! * then the classification is asked for it ! * @param string The string representation of the wanted parameter ! * @return The resulting parameter ! */ ! public Attribute getParameter(String string) { ! //TODO make space hold own parameters ! for (Attribute a : getAttributes()) { ! if (a.getName().equalsIgnoreCase(string)) { ! return a; ! } ! } ! return null; ! } ! ! /** ! * {@inheritDoc} ! */ ! public String toString() { ! return name; ! } ! ! /** ! * Getter for id ! * @return the id ! */ ! public long getId() { ! return id; ! } ! ! /** ! * Setter for id ! * @param id The new id ! */ ! public void setId(long id) { ! this.id = id; ! } ! } |
From: rimestad <rim...@us...> - 2007-06-26 10:57:06
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9759/src/etc Modified Files: classification.xsd Log Message: Maded the readin of classification xml and made classificationType be only a container holding a list of parameters. Made all classes using classificationType reflect that. Now Classification only know of its possible ClassificationTypes and Space know which one is chosen Index: classification.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/classification.xsd,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** classification.xsd 25 Jun 2007 09:02:45 -0000 1.4 --- classification.xsd 26 Jun 2007 10:56:55 -0000 1.5 *************** *** 19,22 **** --- 19,23 ---- <xsd:element name="attributes" type="MapElementType" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> + <xsd:attribute name="id" type="xsd:long" use="required"/> <xsd:attribute name="index" type="xsd:int" use="required"/> <xsd:attribute name="name" type="xsd:string" use="required"/> *************** *** 28,33 **** <xsd:sequence> <xsd:element ref="cns:XMLClassification" maxOccurs="unbounded" minOccurs="0"/> - <xsd:element ref="cns:XMLSpecificType" maxOccurs="1" minOccurs="0"/> </xsd:sequence> <xsd:attribute name="id" type="xsd:string" use="required"/> <xsd:attribute name="name" type="xsd:string" use="required"/> --- 29,34 ---- <xsd:sequence> <xsd:element ref="cns:XMLClassification" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> + <xsd:attribute name="typeId" type="xsd:long" use="required"/> <xsd:attribute name="id" type="xsd:string" use="required"/> <xsd:attribute name="name" type="xsd:string" use="required"/> *************** *** 39,43 **** <xsd:complexType> <xsd:sequence> ! <xsd:element ref="cns:XMLClassification" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> --- 40,45 ---- <xsd:complexType> <xsd:sequence> ! <xsd:element ref="cns:XMLClassification" maxOccurs="2" minOccurs="2"/> ! <xsd:element ref="cns:XMLSpecificType" maxOccurs="1" minOccurs="1"/> </xsd:sequence> </xsd:complexType> |