bprocessor-commit Mailing List for B-processor (Page 141)
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...> - 2006-01-16 10:07:40
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19555/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Some name cleanup Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Project.java 4 Jan 2006 14:30:07 -0000 1.15 --- Project.java 16 Jan 2006 10:07:32 -0000 1.16 *************** *** 86,114 **** changed(this); } - /** - * Intern an attribute - * @param a The attribute - */ - public void intern(Attribute a) { - DatabaseFacade.getInstance().intern((Object) a); - } - - /** - * Remove an attribute - * @param a The attribute - */ - public void remove(Attribute a) { - DatabaseFacade.getInstance().remove(a); - } - - /** - * Find a attribute by id - * @param id The id - * @return The attribute - */ - public Attribute findAttributeById(Long id) { - return DatabaseFacade.getInstance().findAttributeById(id); - } /** * Create a space --- 86,91 ---- changed(this); } + /** * Create a space *************** *** 116,158 **** */ public void intern(Space space) { ! if (space.isConstructionSpace()) { ! intern((ConstructionSpace) space); ! } ! if (space.isFunctionalSpace()) { ! intern((FunctionalSpace) space); ! } ! } ! ! /** ! * Create a construction space ! * @param c The construction space ! */ ! public void intern(ConstructionSpace c) { ! DatabaseFacade.getInstance().intern((Object) c); ! changed(this); ! } ! ! /** ! * Remove a construction space ! * @param c The construction space ! */ ! public void remove(ConstructionSpace c) { ! Set surfaces = c.getSurfaces(); ! if (surfaces != null) { ! Iterator surfIt = surfaces.iterator(); ! while (surfIt.hasNext()) { ! Surface surface = (Surface)surfIt.next(); ! Space back = surface.getBackDomain(); ! if (back == c) { ! surface.setBackDomain(null); ! } else { ! Space front = surface.getFrontDomain(); ! if (front == c) { ! surface.setFrontDomain(null); ! } ! } ! } ! } ! DatabaseFacade.getInstance().remove(c); changed(this); } --- 93,97 ---- */ public void intern(Space space) { ! DatabaseFacade.getInstance().intern((Object) space); changed(this); } *************** *** 167,183 **** /** - * Find a construction space by id - * @param id The id - * @return The construction space - */ - public ConstructionSpace findConstructionSpaceById(Long id) { - return DatabaseFacade.getInstance().findConstructionSpaceById(id); - } - - /** * Find all domains * @return the set of all domains */ ! public Set getDomains() { return DatabaseFacade.getInstance().getDomains(); } --- 106,113 ---- /** * Find all domains * @return the set of all domains */ ! public Set getSpaces() { return DatabaseFacade.getInstance().getDomains(); } *************** *** 188,192 **** * @return The domain */ ! public Space findDomainById(Long id) { return DatabaseFacade.getInstance().findDomainById(id); } --- 118,122 ---- * @return The domain */ ! public Space findSpaceById(Long id) { return DatabaseFacade.getInstance().findDomainById(id); } *************** *** 228,240 **** /** - * Intern a functional space - * @param f The functional space - */ - public void intern(FunctionalSpace f) { - DatabaseFacade.getInstance().intern((Object) f); - changed(this); - } - - /** * Remove a space * @param space The space to remove --- 158,161 ---- *************** *** 262,293 **** changed(this); } ! ! /** ! * Remove a functional space ! * @param f The functional space ! */ ! public void remove(FunctionalSpace f) { ! Set surfaces = f.getSurfaces(); ! if (surfaces != null) { ! Iterator surfIt = surfaces.iterator(); ! while (surfIt.hasNext()) { ! Surface surface = (Surface)surfIt.next(); ! Space back = surface.getBackDomain(); ! if (back == f) { ! surface.setBackDomain(null); ! DatabaseFacade.getInstance().update(surface); ! } else { ! Space front = surface.getFrontDomain(); ! if (front == f) { ! surface.setFrontDomain(null); ! DatabaseFacade.getInstance().update(surface); ! } ! } ! } ! } ! DatabaseFacade.getInstance().remove(f); ! changed(this); ! } ! /** * Find all functional spaces --- 183,187 ---- changed(this); } ! /** * Find all functional spaces *************** *** 297,309 **** return DatabaseFacade.getInstance().getFunctionalSpaces(); } - - /** - * Find a functional space by id - * @param id The id - * @return The functional space - */ - public FunctionalSpace findFunctionalSpaceById(Long id) { - return DatabaseFacade.getInstance().findFunctionalSpaceById(id); - } /** --- 191,194 ---- |
From: Michael L. <he...@us...> - 2006-01-16 10:07:40
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19555/src/net/sourceforge/bprocessor/model/xml Modified Files: PersistenceManager.java Log Message: Some name cleanup Index: PersistenceManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml/PersistenceManager.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PersistenceManager.java 13 Jan 2006 11:29:25 -0000 1.18 --- PersistenceManager.java 16 Jan 2006 10:07:32 -0000 1.19 *************** *** 122,127 **** new net.sourceforge.bprocessor.model.Attribute(a.getName(), a.getType(), a.getValue()); - Project.getInstance().intern(am); - mapper.put(new Long(a.getId()), am.getId()); --- 122,125 ---- *************** *** 244,249 **** Long id = (Long)mapper.get(new Long(cs.getId())); ! ConstructionSpace csm = ! Project.getInstance().findConstructionSpaceById(id); List as = cs.getAttributeref(); --- 242,247 ---- Long id = (Long)mapper.get(new Long(cs.getId())); ! Space csm = ! Project.getInstance().findSpaceById(id); List as = cs.getAttributeref(); *************** *** 285,290 **** Long id = (Long)mapper.get(new Long(fs.getId())); ! FunctionalSpace fsm = ! Project.getInstance().findFunctionalSpaceById(id); List as = fs.getAttributeref(); --- 283,288 ---- Long id = (Long)mapper.get(new Long(fs.getId())); ! Space fsm = ! Project.getInstance().findSpaceById(id); List as = fs.getAttributeref(); *************** *** 357,365 **** Long bid = (Long)(mapper.get(new Long(s.getBackdomainref()))); if (bid != null) { ! sm.setBackDomain((Space) Project.getInstance().findDomainById(bid)); } Long fid = (Long)(mapper.get(new Long(s.getFrontdomainref()))); if (fid != null) { ! sm.setFrontDomain((Space) Project.getInstance().findDomainById(fid)); } Long eid = (Long)(mapper.get(new Long(s.getExteriorref()))); --- 355,363 ---- Long bid = (Long)(mapper.get(new Long(s.getBackdomainref()))); if (bid != null) { ! sm.setBackDomain((Space) Project.getInstance().findSpaceById(bid)); } Long fid = (Long)(mapper.get(new Long(s.getFrontdomainref()))); if (fid != null) { ! sm.setFrontDomain((Space) Project.getInstance().findSpaceById(fid)); } Long eid = (Long)(mapper.get(new Long(s.getExteriorref()))); |
From: Michael L. <he...@us...> - 2006-01-16 10:07:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19529/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Some name cleanup Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SpaceTool.java 11 Jan 2006 14:42:38 -0000 1.5 --- SpaceTool.java 16 Jan 2006 10:07:28 -0000 1.6 *************** *** 250,254 **** JPopupMenu pp = new JPopupMenu(side); SpacePopupListener spl = new SpacePopupListener(side.equals("front"), glv.getView()); ! Set domains = Project.getInstance().getDomains(); Iterator domIt = domains.iterator(); Iterator selIt = new HashSet(selection).iterator(); --- 250,254 ---- JPopupMenu pp = new JPopupMenu(side); SpacePopupListener spl = new SpacePopupListener(side.equals("front"), glv.getView()); ! Set domains = Project.getInstance().getSpaces(); Iterator domIt = domains.iterator(); Iterator selIt = new HashSet(selection).iterator(); |
From: Michael L. <he...@us...> - 2006-01-16 10:07:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19529/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Some name cleanup Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** View.java 15 Jan 2006 14:03:51 -0000 1.46 --- View.java 16 Jan 2006 10:07:28 -0000 1.47 *************** *** 1466,1470 **** */ private void drawSpaces(GLDrawable gld) { ! Set spaces = Project.getInstance().getDomains(); Iterator spaceIter = spaces.iterator(); --- 1466,1470 ---- */ private void drawSpaces(GLDrawable gld) { ! Set spaces = Project.getInstance().getSpaces(); Iterator spaceIter = spaces.iterator(); |
From: Michael L. <he...@us...> - 2006-01-16 09:01:30
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7014/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AttributeView.java 15 Jan 2006 14:03:56 -0000 1.22 --- AttributeView.java 16 Jan 2006 09:01:21 -0000 1.23 *************** *** 280,284 **** displaySurface((Surface) current); } else { ! log.info("display " + current); } revalidate(); --- 280,286 ---- displaySurface((Surface) current); } else { ! if (current != null) { ! log.info("display " + current); ! } } revalidate(); |
From: Michael L. <he...@us...> - 2006-01-15 14:04:10
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12868/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Moved default colors to Defaults class in the GUI package Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** AttributeView.java 13 Jan 2006 11:03:35 -0000 1.21 --- AttributeView.java 15 Jan 2006 14:03:56 -0000 1.22 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.gui.attrview; + import net.sourceforge.bprocessor.gui.Defaults; import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Observer; *************** *** 121,124 **** --- 122,133 ---- } + /** + * Make AWT color from the components + * @param rgb Array of floats + * @return AWT Color + */ + private Color makeAWTColor(float[] rgb) { + return new Color(rgb[0], rgb[1], rgb[2]); + } /** *************** *** 132,135 **** --- 141,192 ---- } + /** + * Return front color for surface + * @param surface The surface + * @return The color + */ + private float[] getFrontColor(Surface surface) { + if (surface.getFrontDomain() == null) { + return Defaults.getNoneColor(); + } else { + if (surface.getFrontMaterial() == null) { + Space space = surface.getFrontDomain(); + if (space.isConstructionSpace()) { + return Defaults.getFrontColor(); + } + if (space.isFunctionalSpace()) { + return Defaults.getBackColor(); + } + return Defaults.getNoneColor(); + } else { + return surface.getFrontMaterial().getColor(); + } + } + } + + /** + * Return back color for surface + * @param surface The surface + * @return The color + */ + private float[] getBackColor(Surface surface) { + if (surface.getBackDomain() == null) { + return Defaults.getNoneColor(); + } else { + if (surface.getBackMaterial() == null) { + Space space = surface.getBackDomain(); + if (space.isConstructionSpace()) { + return Defaults.getFrontColor(); + } + if (space.isFunctionalSpace()) { + return Defaults.getBackColor(); + } + return Defaults.getNoneColor(); + } else { + return surface.getBackMaterial().getColor(); + } + } + } + /** *************** *** 165,188 **** add(fcolor); ! ! if (o.getFrontMaterial() == null) { ! JPanel front = new JPanel(); ! front.setOpaque(true); ! Border blackline = BorderFactory.createLineBorder(Color.black); ! front.setBorder(blackline); ! front.setBackground(Color.white); ! con.weightx = 1.0; ! con.fill = GridBagConstraints.HORIZONTAL; ! con.gridwidth = GridBagConstraints.REMAINDER; ! layout.setConstraints(front, con); ! add(front); ! front.addMouseListener(new MyMouseListener(o, true)); //true = front color to be changed ! } else { JPanel front = new JPanel(); front.setOpaque(true); Border blackline = BorderFactory.createLineBorder(Color.black); front.setBorder(blackline); ! Color frontColor = getMaterialColor(o.getFrontMaterial()); ! front.setBackground(frontColor); con.weightx = 1.0; con.fill = GridBagConstraints.HORIZONTAL; --- 222,232 ---- add(fcolor); ! { ! float[] frontColor = getFrontColor(o); JPanel front = new JPanel(); front.setOpaque(true); Border blackline = BorderFactory.createLineBorder(Color.black); front.setBorder(blackline); ! front.setBackground(makeAWTColor(frontColor)); con.weightx = 1.0; con.fill = GridBagConstraints.HORIZONTAL; *************** *** 192,197 **** front.addMouseListener(new MyMouseListener(o, true)); //true = front color to be changed } ! ! JLabel bcolor = new JLabel("Back: "); con.weightx = 0; --- 236,240 ---- front.addMouseListener(new MyMouseListener(o, true)); //true = front color to be changed } ! JLabel bcolor = new JLabel("Back: "); con.weightx = 0; *************** *** 200,223 **** layout.setConstraints(bcolor, con); add(bcolor); ! ! if (o.getBackMaterial() == null) { ! JPanel back = new JPanel(); ! back.setOpaque(true); ! Border blackline = BorderFactory.createLineBorder(Color.black); ! back.setBorder(blackline); ! back.setBackground(Color.white); ! con.weightx = 1.0; ! con.fill = GridBagConstraints.HORIZONTAL; ! con.gridwidth = GridBagConstraints.REMAINDER; ! layout.setConstraints(back, con); ! add(back); ! back.addMouseListener(new MyMouseListener(o, false)); //false = back color to be changed ! } else { JPanel back = new JPanel(); back.setOpaque(true); Border blackline = BorderFactory.createLineBorder(Color.black); back.setBorder(blackline); ! Color backColor = getMaterialColor(o.getBackMaterial()); ! back.setBackground(backColor); con.weightx = 1.0; con.fill = GridBagConstraints.HORIZONTAL; --- 243,254 ---- layout.setConstraints(bcolor, con); add(bcolor); ! ! { ! float[] backColor = getBackColor(o); JPanel back = new JPanel(); back.setOpaque(true); Border blackline = BorderFactory.createLineBorder(Color.black); back.setBorder(blackline); ! back.setBackground(makeAWTColor(backColor)); con.weightx = 1.0; con.fill = GridBagConstraints.HORIZONTAL; *************** *** 226,232 **** add(back); back.addMouseListener(new MyMouseListener(o, false)); //false = back color to be changed - } ! JPanel vfiller = new JPanel(); vfiller.setOpaque(true); --- 257,262 ---- add(back); back.addMouseListener(new MyMouseListener(o, false)); //false = back color to be changed } ! JPanel vfiller = new JPanel(); vfiller.setOpaque(true); |
From: Michael L. <he...@us...> - 2006-01-15 14:04:10
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12868/src/net/sourceforge/bprocessor/gui Added Files: Defaults.java Log Message: Moved default colors to Defaults class in the GUI package --- NEW FILE: Defaults.java --- //--------------------------------------------------------------------------------- // $Id: Defaults.java,v 1.1 2006/01/15 14:03:56 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui; /** * The Defaults */ public class Defaults { /** Front color for surfaces */ private static float[] frontColor = new float[] {0.90f, 0.90f, 0.90f}; /** NONE color for surfaces */ private static float[] noneColor = new float[] {0.40f, 0.58f, 0.93f}; /** Back color for surfaces */ private static float[] backColor = new float[] {0.96f, 0.87f, 0.70f}; /** * Return front color * @return The front color */ public static float[] getFrontColor() { return frontColor; } /** * Return back color * @return The back color */ public static float[] getBackColor() { return backColor; } /** * Return none color * @return The none color */ public static float[] getNoneColor() { return noneColor; } /** * Constructor for Defaults */ public Defaults() { super(); } } |
From: Michael L. <he...@us...> - 2006-01-15 14:04:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12800/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Moved default colors to Defaults class in the GUI package Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** View.java 13 Jan 2006 10:24:54 -0000 1.45 --- View.java 15 Jan 2006 14:03:51 -0000 1.46 *************** *** 10,13 **** --- 10,14 ---- import net.sourceforge.bprocessor.gl.tool.SpaceTool; import net.sourceforge.bprocessor.gl.model.ClippingPlane; + import net.sourceforge.bprocessor.gui.Defaults; import net.sourceforge.bprocessor.gui.Toolbar; *************** *** 865,873 **** gl.glCullFace(GL.GL_BACK); ! gl.glColor3fv(frontColor); drawSurfaces(gld, FRONT); gl.glCullFace(GL.GL_FRONT); ! gl.glColor3fv(backColor); drawSurfaces(gld, BACK); --- 866,874 ---- gl.glCullFace(GL.GL_BACK); ! gl.glColor3fv(Defaults.getFrontColor()); drawSurfaces(gld, FRONT); gl.glCullFace(GL.GL_FRONT); ! gl.glColor3fv(Defaults.getBackColor()); drawSurfaces(gld, BACK); *************** *** 1371,1381 **** if (space.isConstructionSpace()) { // We are looking at a construction space ! return frontColor; } if (space.isFunctionalSpace()) { // We are looking at a functional space ! return backColor; } ! return noneColor; } } --- 1372,1382 ---- if (space.isConstructionSpace()) { // We are looking at a construction space ! return Defaults.getFrontColor(); } if (space.isFunctionalSpace()) { // We are looking at a functional space ! return Defaults.getBackColor(); } ! return Defaults.getNoneColor(); } } |
From: Nordholt <nor...@us...> - 2006-01-13 15:59:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29407 Modified Files: Plane.java Log Message: added to comments Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Plane.java 26 Dec 2005 15:13:02 -0000 1.12 --- Plane.java 13 Jan 2006 15:59:31 -0000 1.13 *************** *** 13,16 **** --- 13,19 ---- * A Plane is defined by the equation * Ax + By + Cz + D = 0 + * A plane with normal (a,b,c) contaning + * the point (h,i,j) corresponds to the equation: + * ax + by + cz - (ah + bi + cj) = 0 */ public class Plane { |
From: Nordholt <nor...@us...> - 2006-01-13 15:57:43
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28897/tool Modified Files: AbstractTool.java Log Message: new kind of constructors to get Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** AbstractTool.java 10 Jan 2006 14:01:48 -0000 1.48 --- AbstractTool.java 13 Jan 2006 15:57:32 -0000 1.49 *************** *** 601,604 **** --- 601,639 ---- } + /** + * Makes constructors parralel to the x y and z-axis, originating + * from a vertex. + * @param v the vertex + * @return a set of XYZ constructors. + */ + protected Set makeXYZConerConstructors(Vertex v) { + if (v != null) { + Edge x = new Edge(xAxis.getFrom().add(v), + xAxis.getTo().add(v)); + x.getFrom().move(50, 0, 0); + x.getTo().move(50, 0, 0); + x.setConstructor(true); + Edge y = new Edge(yAxis.getFrom().add(v), + yAxis.getTo().add(v)); + y.getFrom().move(0, 50, 0); + y.getTo().move(0, 50, 0); + y.setConstructor(true); + Edge z = new Edge(zAxis.getFrom().add(v), + zAxis.getTo().add(v)); + z.getFrom().move(0, 0, 50); + z.getTo().move(0, 0, 50); + z.setConstructor(true); + Set constructors = new HashSet(); + constructors.add(x); + constructors.add(y); + constructors.add(z); + if (showConstructors) { + displayConstructors(constructors); + } + return constructors; + } + return null; + } + /** * Makes constructors parrallel to the edges connected to a vertex. |
From: Nordholt <nor...@us...> - 2006-01-13 15:56:44
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28428/tool Modified Files: MoveTool.java Log Message: made new free movemode, movemodes can be changed using the M key. (still needs adjustments) Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** MoveTool.java 11 Jan 2006 13:55:28 -0000 1.23 --- MoveTool.java 13 Jan 2006 15:56:34 -0000 1.24 *************** *** 10,14 **** import net.sourceforge.bprocessor.gl.model.ClippingPlane; - import net.sourceforge.bprocessor.model.Constraints; import net.sourceforge.bprocessor.model.Edge; --- 10,13 ---- *************** *** 19,22 **** --- 18,24 ---- import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.gl.view.Transformation; + import net.sourceforge.bprocessor.gl.view.View; + import java.awt.Cursor; import java.awt.event.MouseEvent; *************** *** 28,31 **** --- 30,34 ---- import java.util.Set; import java.util.List; + import java.util.LinkedList; import org.apache.log4j.Logger; *************** *** 38,65 **** private static Logger log = Logger.getLogger(MoveTool.class); ! /** XY move mode for 3D view */ ! private static final int XY = 0; ! ! /** XZ move mode for 3D view */ ! private static final int XZ = 1; ! ! /** The the moving mode in 3D view */ ! private int moveMode = XY; /** The initial movepoint */ private Vertex initial; - /** The parent location (total drag) */ - private Vertex parentPos; - /** The location to move from */ private Vertex from; - /** The previous X coordinate */ - private double previousX = 0; - - /** The previous Y cordinate */ - private double previousY = 0; - /** The plane to drag according to */ private Plane dragPlane; --- 41,56 ---- private static Logger log = Logger.getLogger(MoveTool.class); ! /** The axis restricted movement mode */ ! private static final int AXIS_RESTRICTED = 0; + /** The free snap movement mode */ + private static final int FREE_SNAP = 1; + /** The initial movepoint */ private Vertex initial; /** The location to move from */ private Vertex from; /** The plane to drag according to */ private Plane dragPlane; *************** *** 80,83 **** --- 71,77 ---- private String number; + /** The mode of moving */ + private int moveMode; + /** * The Constructor *************** *** 89,92 **** --- 83,87 ---- moveConstructors = null; restrictionVector = null; + moveMode = FREE_SNAP; } *************** *** 143,162 **** protected void pressed(MouseEvent e) { super.pressed(e); ! previousX = e.getX(); ! previousY = e.getY(); ! clearConstructors(moveConstructors); if (target != null) { ! dragPlane = findMovePlane(target); ! initial = glv.getView().toPlaneCoords(new double[] {previousX, previousY}, dragPlane); ! parentPos = new Vertex(initial.getX(), initial.getY(), initial.getZ()); ! from = new Vertex(initial.getX(), initial.getY(), initial.getZ()); ! ! moveConstructors = new HashSet(); ! if (target instanceof Vertex) { ! moveConstructors.addAll(makeEdgeConstructors((Vertex)target)); ! } else { ! moveConstructors.addAll(makeXYZConstructors(initial)); ! } displayConstructors(moveConstructors); --- 138,148 ---- protected void pressed(MouseEvent e) { super.pressed(e); ! clearConstructors(moveConstructors); if (target != null) { ! initial = findInitial((Entity)target, e); ! from = initial.copy(); ! ! setupConstructors(); displayConstructors(moveConstructors); *************** *** 173,214 **** } } ! /** ! * Finds the plan to move the element on ! * @param o The object to find a plane for ! * @return The movement plane */ ! protected Plane findMovePlane(Object o) { ! Plane temp = null; ! if (o instanceof Vertex) { ! temp = new Plane(0, 0, 1, -((Vertex)o).getZ()); ! } else if (o instanceof Edge) { ! temp = new Plane(0, 0, 1, -((Edge)o).getTo().getZ()); ! } else if (o instanceof Surface) { ! Surface sel = (Surface)o; ! temp = sel.plane(); ! } else if (o instanceof ClippingPlane) { ! ClippingPlane clippingplane = (ClippingPlane) o; ! temp = clippingplane.getPlane(); ! } ! return temp; } ! /** ! * Finds an appropriate dragPlane that contains the ! * restrictionvector. */ ! protected void findRestrictionPlane() { ! Camera camera = glv.getView().getCamera(); ! double[] centerPoint = camera.getCenter(); ! double[] cameraPoint = camera.getCamera(); ! Vertex eyeVector = new Vertex(cameraPoint[0] - centerPoint[0], ! cameraPoint[1] - centerPoint[1], ! cameraPoint[2] - centerPoint[2]); ! Vertex planeNormal = (restrictionVector.cross(eyeVector)).cross(restrictionVector); ! dragPlane = new Plane(planeNormal.getX(), planeNormal.getY(), planeNormal.getZ(), ! -planeNormal.dot(initial)); } ! /** * Invoked when a mouse button has been released on a component. --- 159,208 ---- } } ! /** ! * Sets the move constructors appropriate for the ! * movement mode. */ ! private void setupConstructors() { ! if (moveMode == AXIS_RESTRICTED) { ! if (target instanceof Vertex && !((Vertex)target).getEdges().isEmpty()) { ! moveConstructors = makeEdgeConstructors((Vertex)target); ! } else { ! moveConstructors = makeXYZConstructors(initial); ! } ! } else if (moveMode == FREE_SNAP) { ! moveConstructors = makeXYZConerConstructors(initial); ! } } ! /** ! * Finds the initial point clicked for movement. ! * @param ent the entity initialy clicked ! * @param e the mouse event associated with the click. ! * @return the initial point of movement. */ ! protected Vertex findInitial(Entity ent, MouseEvent e) { ! double x = e.getX(); ! double y = View.getHeight() - e.getY(); ! View v = glv.getView(); ! Transformation transformation = v.transformation(); ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! ray = transformation.unProject(ray); ! if (ent instanceof Vertex) { ! return ((Vertex)ent).copy(); ! } else if (ent instanceof Surface) { ! Plane surfacePlane = ((Surface)ent).plane(); ! return surfacePlane.intersection(ray); ! } else if (ent instanceof Edge) { ! Edge edge = (Edge) ent; ! Edge intersection = edge.intersection(ray); ! return intersection.getFrom(); ! } ! log.warn("The clicked object is not an Entity"); ! return null; } ! /** * Invoked when a mouse button has been released on a component. *************** *** 235,277 **** return; } ! ! if (restrictionVector == null) { ! boolean found = findRestriction(e); ! if (found) { ! findRestrictionPlane(); ! } ! } if (dragPlane != null && restrictionVector != null) { int x = e.getX(); int y = e.getY(); ! ! parentPos = glv.getView().toPlaneCoords(new double[] {x, y}, dragPlane); Vertex delta = parentPos.minus(from); ! ! //Restricting movement align with restriction vector ! Vertex restrictCopy = restrictionVector.copy(); ! restrictCopy.scale(1 / restrictCopy.length()); ! restrictCopy.scale(delta.dot(restrictCopy)); ! delta = restrictCopy; ! parentPos = from.add(delta); ! if (log.isDebugEnabled()) { log.debug("from " + from.getX() + ", " + from.getY() + ", " + from.getZ()); log.debug("delta " + delta.getX() + ", " + delta.getY() + ", " + delta.getZ()); - } - - //snapping to initial position - Vertex v = initial.minus(parentPos); - Vertex appr = initial.minus(from); - if (Math.abs(v.getX()) < .25) { - delta.setX(appr.getX()); - } - if (Math.abs(v.getY()) < .25) { - delta.setY(appr.getY()); - } - if (Math.abs(v.getZ()) < .25) { - delta.setZ(appr.getZ()); } move(vertices, delta); from.move(delta.getX(), delta.getY(), delta.getZ()); --- 229,247 ---- return; } ! findRestrictions(e); if (dragPlane != null && restrictionVector != null) { int x = e.getX(); int y = e.getY(); ! Vertex parentPos = glv.getView().toPlaneCoords(new double[] {x, y}, dragPlane); Vertex delta = parentPos.minus(from); ! //Restricting movement to fit movement mode. ! delta = restrict(delta); ! if (log.isDebugEnabled()) { log.debug("from " + from.getX() + ", " + from.getY() + ", " + from.getZ()); log.debug("delta " + delta.getX() + ", " + delta.getY() + ", " + delta.getZ()); } + delta = snapToInitial(delta); move(vertices, delta); from.move(delta.getX(), delta.getY(), delta.getZ()); *************** *** 279,289 **** update(); } - - previousX = e.getX(); - previousY = e.getY(); } /** * Finds the current restriction vector. * There must be some number of moveconstructors find a --- 249,370 ---- update(); } } + /** + * Corrects a movement vector to make the + * movement snap to the initial position of + * the moved object(s). + * @param delta the movement vector. + * @return the corrected movement vector. + */ + private Vertex snapToInitial(Vertex delta) { + Vertex parentPos = from.add(delta); + Vertex v = initial.minus(parentPos); + Vertex appr = initial.minus(from); + if (Math.abs(v.getX()) < .25) { + delta.setX(appr.getX()); + } + if (Math.abs(v.getY()) < .25) { + delta.setY(appr.getY()); + } + if (Math.abs(v.getZ()) < .25) { + delta.setZ(appr.getZ()); + } + return delta; + } + + /** + * Restricts the movement to fit the movement mode, + * given a desired movement vector. + * @param delta the movement vector. + * @return the restricted movement vector. + */ + private Vertex restrict(Vertex delta) { + if (moveMode == AXIS_RESTRICTED) { + Vertex restrictCopy = restrictionVector.copy(); + restrictCopy.scale(1 / restrictCopy.length()); + restrictCopy.scale(delta.dot(restrictCopy)); + delta = restrictCopy; + } + return delta; + } /** + * Set up the restriction depending on the + * movement mode. + * @param e a mouse event. + */ + private void findRestrictions(MouseEvent e) { + if (moveMode == AXIS_RESTRICTED) { + if (restrictionVector == null) { + boolean found = findRestrictionVector(e); + if (found) { + findRestrictionPlane(); + } + } + } else if (moveMode == FREE_SNAP) { + if (dragPlane == null) { + Vertex upper = new Vertex(0, 0, 50); + upper = upper.add(initial); + Vertex upperX = new Vertex(50, 0, 50); + upperX = upperX.add(initial); + Vertex upperY = new Vertex(0, 50, 50); + upperY = upperY.add(initial); + Vertex lowerX = new Vertex(50, 0, 0); + lowerX = lowerX.add(initial); + Vertex lowerY = new Vertex(0, 50, 0); + lowerY = lowerY.add(initial); + Vertex lowerXY = new Vertex(50, 50, 0); + lowerXY = lowerXY.add(initial); + + List xzEdges = new LinkedList(); + xzEdges.add(new Edge(initial, upper)); + xzEdges.add(new Edge(upper, upperX)); + xzEdges.add(new Edge(upperX, lowerX)); + xzEdges.add(new Edge(lowerX, initial)); + + List yzEdges = new LinkedList(); + yzEdges.add(new Edge(initial, upper)); + yzEdges.add(new Edge(upper, upperY)); + yzEdges.add(new Edge(upperY, lowerY)); + yzEdges.add(new Edge(lowerY, initial)); + + List xyEdges = new LinkedList(); + xyEdges.add(new Edge(initial, lowerX)); + xyEdges.add(new Edge(lowerX, lowerXY)); + xyEdges.add(new Edge(lowerXY, lowerY)); + xyEdges.add(new Edge(lowerY, initial)); + + Surface xzSurface = new Surface(xzEdges); + Surface yzSurface = new Surface(yzEdges); + Surface xySurface = new Surface(xyEdges); + glv.getView().addTempSurface(xzSurface); + glv.getView().addTempSurface(yzSurface); + glv.getView().addTempSurface(xySurface); + + List objects = glv.getView().getObjectAtPoint(e.getX(), e.getY()); + + Iterator it = objects.iterator(); + while (it.hasNext()) { + Object ob = it.next(); + if (ob instanceof Surface) { + Surface surface = (Surface)ob; + if (surface.equals(xzSurface) || + surface.equals(yzSurface) || + surface.equals(xySurface)) { + dragPlane = surface.plane(); + restrictionVector = new Vertex(0, 0, 0); + } + } + } + glv.getView().removeTempSurface(xzSurface); + glv.getView().removeTempSurface(xySurface); + glv.getView().removeTempSurface(yzSurface); + clearConstructors(moveConstructors); + } + } + } + + /** * Finds the current restriction vector. * There must be some number of moveconstructors find a *************** *** 292,296 **** * @return wherther or not a vector was found. */ ! private boolean findRestriction(MouseEvent e) { if (moveConstructors != null) { List hitEdges = glv.getView().getEdgeAtPoint(e.getX(), e.getY()); --- 373,377 ---- * @return wherther or not a vector was found. */ ! private boolean findRestrictionVector(MouseEvent e) { if (moveConstructors != null) { List hitEdges = glv.getView().getEdgeAtPoint(e.getX(), e.getY()); *************** *** 310,314 **** restrictionVector = axis.getFrom().minus(axis.getTo()); lastRestriction = restrictionVector.copy(); - //when a moveconstructor is selected it is the //only one shown. --- 391,394 ---- *************** *** 322,325 **** --- 402,430 ---- return false; } + + /** + * Sets an appropriate dragPlane that aligned with the + * restrictionvector and containing a specified point to + * make reasonable movements. + */ + protected void findRestrictionPlane() { + Camera camera = glv.getView().getCamera(); + double[] centerPoint = camera.getCenter(); + double[] cameraPoint = camera.getCamera(); + + Vertex eyeVector = new Vertex(cameraPoint[0] - centerPoint[0], + cameraPoint[1] - centerPoint[1], + cameraPoint[2] - centerPoint[2]); + Vertex cross = restrictionVector.cross(eyeVector); + Vertex planeNormal; + if (cross.isZero()) { + double[] rollVector = camera.getRoll(); + planeNormal = new Vertex(rollVector[0], rollVector[1], rollVector[2]); + } else { + planeNormal = (restrictionVector.cross(eyeVector)).cross(restrictionVector); + } + dragPlane = new Plane(planeNormal.getX(), planeNormal.getY(), planeNormal.getZ(), + -planeNormal.dot(initial)); + } /** *************** *** 344,348 **** /** * Invoked when a key has been pressed. Lets user control the mode of movement. ! * ESCAPE - cancel movement * @param e The KeyEvent */ --- 449,457 ---- /** * Invoked when a key has been pressed. Lets user control the mode of movement. ! * After movement in one direction a length can be typed in to adjust the movement ! * to a specific length. ! * ESCAPE - cancel movement. ! * 0-9 - type length in length field. ! * ENTER - perform move of the specified length. * @param e The KeyEvent */ *************** *** 353,360 **** move(vertices, initial.minus(from)); } } else if (lastRestriction != null && initial != null && from != null && ! vertices != null) { if (e.getKeyCode() == KeyEvent.VK_1) { number += "1"; --- 462,478 ---- move(vertices, initial.minus(from)); } + } else if (e.getKeyCode() == KeyEvent.VK_M) { + if (dragPlane == null) { + if (moveMode == AXIS_RESTRICTED) { + moveMode = FREE_SNAP; + } else { + moveMode = AXIS_RESTRICTED; + } + } } else if (lastRestriction != null && initial != null && from != null && ! vertices != null && ! number != null) { if (e.getKeyCode() == KeyEvent.VK_1) { number += "1"; |
From: Michael L. <he...@us...> - 2006-01-13 13:23:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26794/src/net/sourceforge/bprocessor/model Modified Files: Selection.java Log Message: Selection rembers the order in which objects were selected Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Selection.java 13 Jan 2006 09:38:55 -0000 1.5 --- Selection.java 13 Jan 2006 13:22:53 -0000 1.6 *************** *** 21,27 **** */ public class Selection implements Collection { ! /** The collection of objects */ private Set mark; /** The observers */ --- 21,29 ---- */ public class Selection implements Collection { ! /** The collection of objects mark is used to test for membership */ private Set mark; + /** The order of the objects */ + private List selection; /** The observers */ *************** *** 45,48 **** --- 47,51 ---- super(); mark = new HashSet(); + selection = new LinkedList(); observers = new LinkedList(); } *************** *** 64,67 **** --- 67,71 ---- public boolean add(Object object) { if (mark.add(object)) { + selection.add(object); changed(); return true; *************** *** 78,81 **** --- 82,86 ---- public boolean remove(Object object) { if (mark.remove(object)) { + selection.remove(object); changed(); return true; *************** *** 90,93 **** --- 95,99 ---- public void clear() { mark.clear(); + selection.clear(); changed(); } *************** *** 108,112 **** */ public Iterator iterator() { ! return mark.iterator(); } --- 114,118 ---- */ public Iterator iterator() { ! return selection.iterator(); } *************** *** 143,147 **** */ public int size() { ! return mark.size(); } --- 149,153 ---- */ public int size() { ! return selection.size(); } *************** *** 151,155 **** */ public boolean isEmpty() { ! return mark.isEmpty(); } --- 157,161 ---- */ public boolean isEmpty() { ! return selection.isEmpty(); } *************** *** 159,163 **** */ public Object[] toArray() { ! return mark.toArray(); } --- 165,169 ---- */ public Object[] toArray() { ! return selection.toArray(); } *************** *** 168,172 **** */ public Object[] toArray(Object[] array) { ! return mark.toArray(array); } --- 174,178 ---- */ public Object[] toArray(Object[] array) { ! return selection.toArray(array); } *************** *** 186,190 **** */ public boolean addAll(Collection objects) { ! if (mark.addAll(objects)) { changed(); return true; --- 192,205 ---- */ public boolean addAll(Collection objects) { ! boolean touched = false; ! Iterator iter = objects.iterator(); ! while (iter.hasNext()) { ! Object current = iter.next(); ! if (mark.add(current)) { ! selection.add(current); ! touched = true; ! } ! } ! if (touched) { changed(); return true; *************** *** 200,204 **** */ public boolean removeAll(Collection objects) { ! if (mark.removeAll(objects)) { changed(); return true; --- 215,228 ---- */ public boolean removeAll(Collection objects) { ! boolean touched = false; ! Iterator iter = objects.iterator(); ! while (iter.hasNext()) { ! Object current = iter.next(); ! if (mark.remove(current)) { ! selection.remove(current); ! touched = true; ! } ! } ! if (touched) { changed(); return true; *************** *** 214,223 **** */ public boolean retainAll(Collection objects) { ! if (mark.retainAll(objects)) { ! changed(); ! return true; ! } else { ! return false; ! } } } --- 238,245 ---- */ public boolean retainAll(Collection objects) { ! clear(); ! addAll(objects); ! changed(); ! return true; } } |
From: Michael L. <he...@us...> - 2006-01-13 11:29:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31920/src/net/sourceforge/bprocessor/model/xml Modified Files: PersistenceManager.java Log Message: Saves description in xml Index: PersistenceManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml/PersistenceManager.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PersistenceManager.java 4 Jan 2006 14:30:07 -0000 1.17 --- PersistenceManager.java 13 Jan 2006 11:29:25 -0000 1.18 *************** *** 140,143 **** --- 140,144 ---- ConstructionSpace csm = new ConstructionSpace(cs.getName()); + csm.setDescription(cs.getDescription()); Project.getInstance().intern(csm); *************** *** 157,161 **** FunctionalSpace fsm = new FunctionalSpace(fs.getName()); ! Project.getInstance().intern(fsm); --- 158,163 ---- FunctionalSpace fsm = new FunctionalSpace(fs.getName()); ! fsm.setDescription(fs.getDescription()); ! Project.getInstance().intern(fsm); *************** *** 495,498 **** --- 497,501 ---- csx.setId(counter++); csx.setName(cs.getName()); + csx.setDescription(cs.getDescription()); Set data = cs.getAttributes(); *************** *** 528,531 **** --- 531,535 ---- fsx.setId(counter++); fsx.setName(fs.getName()); + fsx.setDescription(fs.getDescription()); Set data = fs.getAttributes(); |
From: Michael L. <he...@us...> - 2006-01-13 11:29:34
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31920/src/etc Modified Files: bprocessor.xsd Log Message: Saves description in xml Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** bprocessor.xsd 20 Dec 2005 13:54:53 -0000 1.7 --- bprocessor.xsd 13 Jan 2006 11:29:26 -0000 1.8 *************** *** 21,24 **** --- 21,25 ---- <xsd:element name="id" type="xsd:long"/> <xsd:element name="name" type="xsd:string"/> + <xsd:element name="description" type="xsd:string"/> <xsd:element name="attributeref" type="xsd:long" maxOccurs="unbounded" minOccurs="0"/> <xsd:element name="surfaceref" type="xsd:long" maxOccurs="unbounded" minOccurs="0"/> |
From: Michael L. <he...@us...> - 2006-01-13 11:29:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31920/src/net/sourceforge/bprocessor/model Modified Files: ConstructionSpace.java FunctionalSpace.java Log Message: Saves description in xml Index: ConstructionSpace.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ConstructionSpace.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConstructionSpace.java 11 Dec 2005 17:50:30 -0000 1.3 --- ConstructionSpace.java 13 Jan 2006 11:29:26 -0000 1.4 *************** *** 37,40 **** --- 37,41 ---- super(); setName(name); + setDescription(""); } Index: FunctionalSpace.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/FunctionalSpace.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FunctionalSpace.java 11 Dec 2005 17:50:30 -0000 1.3 --- FunctionalSpace.java 13 Jan 2006 11:29:26 -0000 1.4 *************** *** 37,40 **** --- 37,41 ---- super(); setName(name); + setDescription(""); } |
From: Michael L. <he...@us...> - 2006-01-13 11:03:44
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26468/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java MyMouseListener.java Log Message: Some refactoring Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** AttributeView.java 13 Jan 2006 10:24:59 -0000 1.20 --- AttributeView.java 13 Jan 2006 11:03:35 -0000 1.21 *************** *** 15,22 **** import java.awt.Color; import java.awt.Dimension; - import java.awt.GridLayout; - import java.lang.reflect.Method; - import java.util.ArrayList; - import java.util.List; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; --- 15,18 ---- *************** *** 28,32 **** import javax.swing.JTextArea; import javax.swing.JTextField; - import javax.swing.JComboBox; import javax.swing.border.Border; --- 24,27 ---- *************** *** 64,81 **** if (object == selection) { if (selection.size() == 1) { ! Object target = selection.iterator().next(); ! if (target instanceof Space) { ! Space space = (Space) target; ! if (space.isConstructionSpace()) { ! ap.displayConsSpace(space); ! } ! if (space.isFunctionalSpace()) { ! ap.displayFuncSpace(space); ! } ! } else if (target instanceof Surface) { ! ap.displaySurface((Surface) target); ! } else { ! ap.display(null); ! } } else { ap.display(null); --- 59,63 ---- if (object == selection) { if (selection.size() == 1) { ! ap.display(selection.iterator().next()); } else { ap.display(null); *************** *** 105,148 **** current = null; } - - /** - * Display the functional space - * @param o The object - */ - void displayFuncSpace(Space o) { - removeAll(); - - GridBagLayout layout = new GridBagLayout(); - GridBagConstraints con = new GridBagConstraints(); - setLayout(layout); - - JLabel name = new JLabel("Name:"); - con.anchor = GridBagConstraints.NORTHEAST; - layout.setConstraints(name, con); - add(name); - - JTextField nameEdit = new JTextField(o.getName()); - con.gridwidth = GridBagConstraints.REMAINDER; - con.weightx = 1.0; - con.fill = GridBagConstraints.HORIZONTAL; - layout.setConstraints(nameEdit, con); - add(nameEdit); - nameEdit.addKeyListener(new MyKeyListener(o, TFIELD)); - - Object[] options = {"Arbejdsværelse", "Badeværelse", "Gang", "Køkken", "Stue", "Værelse"}; - JComboBox klassifikation = new JComboBox(options); - layout.setConstraints(klassifikation, con); - add(klassifikation); - - JTextArea funcSpaceDescripton = new JTextArea(o.getDescription()); - funcSpaceDescripton.setWrapStyleWord(true); - funcSpaceDescripton.setLineWrap(true); - con.weighty = 1.0; - con.fill = GridBagConstraints.BOTH; - layout.setConstraints(funcSpaceDescripton, con); - funcSpaceDescripton.addFocusListener(new MyFocusListener(o)); - add(funcSpaceDescripton); - revalidate(); - } /** --- 87,90 ---- *************** *** 150,156 **** * @param o The object */ ! void displayConsSpace(Space o) { ! removeAll(); ! GridBagLayout layout = new GridBagLayout(); GridBagConstraints con = new GridBagConstraints(); --- 92,96 ---- * @param o The object */ ! void displaySpace(Space o) { GridBagLayout layout = new GridBagLayout(); GridBagConstraints con = new GridBagConstraints(); *************** *** 161,167 **** con.weightx = 0; layout.setConstraints(name, con); ! add(name); ! ! JTextField nameEdit = new JTextField(o.getName()); --- 101,105 ---- con.weightx = 0; layout.setConstraints(name, con); ! add(name); JTextField nameEdit = new JTextField(o.getName()); *************** *** 173,192 **** nameEdit.addKeyListener(new MyKeyListener(o, TFIELD)); ! Object[] options = {"Arbejdsværelse", "Badeværelse", "Gang", "Køkken", "Stue", "Værelse"}; ! JComboBox klassifikation = new JComboBox(options); ! layout.setConstraints(klassifikation, con); ! add(klassifikation); ! ! JTextArea consSpaceDescripton = new JTextArea(o.getDescription()); ! consSpaceDescripton.setLineWrap(true); ! consSpaceDescripton.setWrapStyleWord(true); con.weighty = 1.0; con.fill = GridBagConstraints.BOTH; ! layout.setConstraints(consSpaceDescripton, con); ! consSpaceDescripton.addFocusListener(new MyFocusListener(o)); ! add(consSpaceDescripton); ! revalidate(); ! ! revalidate(); } --- 111,122 ---- nameEdit.addKeyListener(new MyKeyListener(o, TFIELD)); ! JTextArea descriptionEditor = new JTextArea(o.getDescription()); ! descriptionEditor.setLineWrap(true); ! descriptionEditor.setWrapStyleWord(true); con.weighty = 1.0; con.fill = GridBagConstraints.BOTH; ! layout.setConstraints(descriptionEditor, con); ! descriptionEditor.addFocusListener(new MyFocusListener(o)); ! add(descriptionEditor); } *************** *** 208,213 **** */ void displaySurface(Surface o) { - removeAll(); - GridBagLayout layout = new GridBagLayout(); GridBagConstraints con = new GridBagConstraints(); --- 138,141 ---- *************** *** 307,311 **** layout.setConstraints(vfiller, con); add(vfiller); - revalidate(); } --- 235,238 ---- *************** *** 316,383 **** void display(Object o) { current = o; - - List names = new ArrayList(); - List components = new ArrayList(); - - if (current != null) { - Method[] methods = current.getClass().getMethods(); - for (int i = 0; i < methods.length; i++) { - Method m = methods[i]; - String name = m.getName(); - if (name.startsWith("get")) { - if (!name.endsWith("Id") && !name.endsWith("Class")) { - if (returnTypeSupported(m.getReturnType())) { - try { - components.add(new JLabel(m.invoke(current, (Object[])null).toString())); - if (name.length() > 4) { - names.add(new JLabel(name.substring(3, 4).toUpperCase() + name.substring(4))); - } else { - names.add(new JLabel(name.substring(3, 4).toUpperCase())); - } - } catch (Exception e) { - // Cant be accessed - } - } - } - } - } - } - removeAll(); ! ! setLayout(new GridLayout(names.size(), 2)); ! for (int i = 0; i < names.size(); i++) { ! add((JLabel)names.get(i)); ! add((JLabel)components.get(i)); } revalidate(); } - - /** - * Return type supported - * @param c The class for the return type - * @return True if supported; otherwise false - */ - private boolean returnTypeSupported(Class c) { - String n = c.getName(); - if (n.equals("java.lang.String") || - n.equals("java.lang.Integer") || - n.equals("java.lang.Double") || - n.equals("java.lang.Float") || - n.equals("java.lang.Short") || - n.equals("java.lang.Boolean") || - n.equals("java.lang.Byte") || - n.equals("java.lang.Long") || - n.equals(Integer.TYPE.getName()) || - n.equals(Double.TYPE.getName()) || - n.equals(Float.TYPE.getName()) || - n.equals(Short.TYPE.getName()) || - n.equals(Boolean.TYPE.getName()) || - n.equals(Byte.TYPE.getName()) || - n.equals(Long.TYPE.getName())) { - return true; - } - return false; - } } } --- 243,257 ---- void display(Object o) { current = o; removeAll(); ! if (current instanceof Space) { ! Space space = (Space) current; ! displaySpace(space); ! } else if (current instanceof Surface) { ! displaySurface((Surface) current); ! } else { ! log.info("display " + current); } revalidate(); } } } Index: MyMouseListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/MyMouseListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MyMouseListener.java 13 Jan 2006 10:24:59 -0000 1.4 --- MyMouseListener.java 13 Jan 2006 11:03:35 -0000 1.5 *************** *** 22,28 **** */ public class MyMouseListener implements MouseListener { - /** The current Surface */ ! private Surface currentSurface; /** The current Side */ --- 22,27 ---- */ public class MyMouseListener implements MouseListener { /** The current Surface */ ! private Surface surface; /** The current Side */ *************** *** 31,41 **** /** * The constructor ! * @param o the event * @param side shows if its the front or back of the surface. True = front, False = Back. */ ! public MyMouseListener (Surface o, boolean side) { ! currentSurface = o; currentSide = side; - } --- 30,39 ---- /** * The constructor ! * @param surface The surface * @param side shows if its the front or back of the surface. True = front, False = Back. */ ! public MyMouseListener (Surface surface, boolean side) { ! this.surface = surface; currentSide = side; } *************** *** 52,88 **** /** * Handles mouse event ! * @param arg0 the event */ ! public void mouseClicked(MouseEvent arg0) { Color defaultColor = Color.white; Material newMaterial; if (currentSide) { ! if (currentSurface.getFrontMaterial() != null) { ! defaultColor = getMaterialColor(currentSurface.getFrontMaterial()); } Color frontColor = JColorChooser.showDialog(GUI.getInstance(), ! "Constructor Line Color", defaultColor); if (frontColor != null) { newMaterial = new Material("temp", frontColor.getRGBColorComponents(null)); ! } else { ! newMaterial = new Material("temp", defaultColor.getRGBColorComponents(null)); } - currentSurface.setFrontMaterial(newMaterial); - currentSurface.changed(); } else { ! if (currentSurface.getBackMaterial() != null) { ! defaultColor = getMaterialColor(currentSurface.getBackMaterial()); } Color backColor = JColorChooser.showDialog(GUI.getInstance(), ! "Constructor Line Color", defaultColor); if (backColor != null) { newMaterial = new Material("temp", backColor.getRGBColorComponents(null)); ! } else { ! newMaterial = new Material("temp", defaultColor.getRGBColorComponents(null)); } - currentSurface.setBackMaterial(newMaterial); - currentSurface.changed(); } } --- 50,82 ---- /** * Handles mouse event ! * @param event the event */ ! public void mouseClicked(MouseEvent event) { Color defaultColor = Color.white; Material newMaterial; if (currentSide) { ! if (surface.getFrontMaterial() != null) { ! defaultColor = getMaterialColor(surface.getFrontMaterial()); } Color frontColor = JColorChooser.showDialog(GUI.getInstance(), ! "Surface Color", defaultColor); if (frontColor != null) { newMaterial = new Material("temp", frontColor.getRGBColorComponents(null)); ! surface.setFrontMaterial(newMaterial); ! surface.changed(); } } else { ! if (surface.getBackMaterial() != null) { ! defaultColor = getMaterialColor(surface.getBackMaterial()); } Color backColor = JColorChooser.showDialog(GUI.getInstance(), ! "Surface Color", defaultColor); if (backColor != null) { newMaterial = new Material("temp", backColor.getRGBColorComponents(null)); ! surface.setBackMaterial(newMaterial); ! surface.changed(); } } } *************** *** 90,126 **** /** * Handles mouse event ! * @param arg0 the event */ ! public void mouseEntered(MouseEvent arg0) { ! ! } /** * Handles mouse event ! * @param arg0 the event */ ! public void mouseExited(MouseEvent arg0) { ! ! } /** * Handles mouse event ! * @param arg0 the event */ ! public void mousePressed(MouseEvent arg0) { ! ! } /** * Handles mouse event ! * @param arg0 the event */ ! public void mouseReleased(MouseEvent arg0) { ! ! } ! ! ! ! } --- 84,108 ---- /** * Handles mouse event ! * @param event the event */ ! public void mouseEntered(MouseEvent event) { } /** * Handles mouse event ! * @param event the event */ ! public void mouseExited(MouseEvent event) { } /** * Handles mouse event ! * @param event the event */ ! public void mousePressed(MouseEvent event) { } /** * Handles mouse event ! * @param event the event */ ! public void mouseReleased(MouseEvent event) { } } |
From: Michael L. <he...@us...> - 2006-01-13 10:25:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17299/src/net/sourceforge/bprocessor/model Modified Files: Material.java Log Message: Renamed Material.getColor3fv to just getColor/setColor Index: Material.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Material.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Material.java 13 Jan 2006 10:19:44 -0000 1.6 --- Material.java 13 Jan 2006 10:25:02 -0000 1.7 *************** *** 16,20 **** /** The color of the material */ ! private float[] color3fv; /** --- 16,20 ---- /** The color of the material */ ! private float[] color; /** *************** *** 31,35 **** public Material(String name, float[] color3fv) { setName(name); ! setColor3fv(color3fv); } --- 31,35 ---- public Material(String name, float[] color3fv) { setName(name); ! setColor(color3fv); } *************** *** 55,60 **** * @param color3fv Array of 3 floats */ ! public void setColor3fv(float[] color3fv) { ! this.color3fv = color3fv; } --- 55,60 ---- * @param color3fv Array of 3 floats */ ! public void setColor(float[] color3fv) { ! this.color = color3fv; } *************** *** 64,69 **** * @return The color components */ ! public float[] getColor3fv() { ! return color3fv; } } --- 64,69 ---- * @return The color components */ ! public float[] getColor() { ! return color; } } |
From: Michael L. <he...@us...> - 2006-01-13 10:25:09
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17270/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java MyMouseListener.java Log Message: Renamed Material.getColor3fv to just getColor/setColor Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AttributeView.java 13 Jan 2006 10:19:41 -0000 1.19 --- AttributeView.java 13 Jan 2006 10:24:59 -0000 1.20 *************** *** 198,202 **** */ private Color getMaterialColor(Material material) { ! float[] rgb = material.getColor3fv(); return new Color(rgb[0], rgb[1], rgb[2]); } --- 198,202 ---- */ private Color getMaterialColor(Material material) { ! float[] rgb = material.getColor(); return new Color(rgb[0], rgb[1], rgb[2]); } Index: MyMouseListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/MyMouseListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MyMouseListener.java 13 Jan 2006 10:19:41 -0000 1.3 --- MyMouseListener.java 13 Jan 2006 10:24:59 -0000 1.4 *************** *** 46,50 **** */ private Color getMaterialColor(Material material) { ! float[] rgb = material.getColor3fv(); return new Color(rgb[0], rgb[1], rgb[2]); } --- 46,50 ---- */ private Color getMaterialColor(Material material) { ! float[] rgb = material.getColor(); return new Color(rgb[0], rgb[1], rgb[2]); } |
From: Michael L. <he...@us...> - 2006-01-13 10:25:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17233/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Renamed Material.getColor3fv to just getColor/setColor Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** View.java 10 Jan 2006 14:57:06 -0000 1.44 --- View.java 13 Jan 2006 10:24:54 -0000 1.45 *************** *** 1405,1409 **** gl.glColor3fv(getSpaceColor(back)); } else { ! gl.glColor3fv(s.getFrontMaterial().getColor3fv()); } } --- 1405,1409 ---- gl.glColor3fv(getSpaceColor(back)); } else { ! gl.glColor3fv(s.getFrontMaterial().getColor()); } } *************** *** 1413,1417 **** gl.glColor3fv(getSpaceColor(front)); } else { ! gl.glColor3fv(s.getBackMaterial().getColor3fv()); } } --- 1413,1417 ---- gl.glColor3fv(getSpaceColor(front)); } else { ! gl.glColor3fv(s.getBackMaterial().getColor()); } } |
From: Michael L. <he...@us...> - 2006-01-13 10:19:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16113/src/net/sourceforge/bprocessor/model Modified Files: Material.java Log Message: Removed dependency of awt.Color from Material Index: Material.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Material.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Material.java 13 Jan 2006 10:06:13 -0000 1.5 --- Material.java 13 Jan 2006 10:19:44 -0000 1.6 *************** *** 7,13 **** package net.sourceforge.bprocessor.model; - import java.awt.Color; - - /** * The Material of a Surface --- 7,10 ---- *************** *** 17,24 **** /** The name of the material */ private String name; - - /** The color of the material */ - private Color color; /** --- 14,20 ---- /** The name of the material */ private String name; + /** The color of the material */ + private float[] color3fv; /** *************** *** 29,42 **** /** - * Constructor for Material - * @param name The name of the material - * @param color The color of the material - */ - public Material(String name, Color color) { - setName(name); - setColor(color); - } - - /** * Constructor for Material * @param name The name of the material --- 25,28 ---- *************** *** 64,84 **** this.name = name; } - - /** - * Get the color - * @return The color - * @hibernate.property - */ - public Color getColor() { - return color; - } - - /** - * Set the color - * @param color The color - */ - public void setColor(Color color) { - this.color = color; - } /** --- 50,53 ---- *************** *** 87,91 **** */ public void setColor3fv(float[] color3fv) { ! color = new Color(color3fv[0], color3fv[1], color3fv[2]); } --- 56,60 ---- */ public void setColor3fv(float[] color3fv) { ! this.color3fv = color3fv; } *************** *** 96,100 **** */ public float[] getColor3fv() { ! return color.getRGBColorComponents(null); } } --- 65,69 ---- */ public float[] getColor3fv() { ! return color3fv; } } |
From: Michael L. <he...@us...> - 2006-01-13 10:19:50
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16094/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java MyMouseListener.java Log Message: Removed dependency of awt.Color from Material Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** AttributeView.java 13 Jan 2006 09:29:29 -0000 1.18 --- AttributeView.java 13 Jan 2006 10:19:41 -0000 1.19 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.gui.attrview; + import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Selection; *************** *** 190,193 **** --- 191,206 ---- } + + /** + * Get AWT color for material + * @param material The material + * @return The AWT color + */ + private Color getMaterialColor(Material material) { + float[] rgb = material.getColor3fv(); + return new Color(rgb[0], rgb[1], rgb[2]); + } + + /** * Display the surface *************** *** 242,246 **** Border blackline = BorderFactory.createLineBorder(Color.black); front.setBorder(blackline); ! Color frontColor = o.getFrontMaterial().getColor(); front.setBackground(frontColor); con.weightx = 1.0; --- 255,259 ---- Border blackline = BorderFactory.createLineBorder(Color.black); front.setBorder(blackline); ! Color frontColor = getMaterialColor(o.getFrontMaterial()); front.setBackground(frontColor); con.weightx = 1.0; *************** *** 277,281 **** Border blackline = BorderFactory.createLineBorder(Color.black); back.setBorder(blackline); ! Color backColor = o.getBackMaterial().getColor(); back.setBackground(backColor); con.weightx = 1.0; --- 290,294 ---- Border blackline = BorderFactory.createLineBorder(Color.black); back.setBorder(blackline); ! Color backColor = getMaterialColor(o.getBackMaterial()); back.setBackground(backColor); con.weightx = 1.0; Index: MyMouseListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/MyMouseListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MyMouseListener.java 13 Jan 2006 10:10:07 -0000 1.2 --- MyMouseListener.java 13 Jan 2006 10:19:41 -0000 1.3 *************** *** 40,44 **** } ! /** * Handles mouse event --- 40,53 ---- } ! /** ! * Get AWT color for material ! * @param material The material ! * @return The AWT color ! */ ! private Color getMaterialColor(Material material) { ! float[] rgb = material.getColor3fv(); ! return new Color(rgb[0], rgb[1], rgb[2]); ! } ! /** * Handles mouse event *************** *** 50,54 **** if (currentSide) { if (currentSurface.getFrontMaterial() != null) { ! defaultColor = currentSurface.getFrontMaterial().getColor(); } Color frontColor = JColorChooser.showDialog(GUI.getInstance(), --- 59,63 ---- if (currentSide) { if (currentSurface.getFrontMaterial() != null) { ! defaultColor = getMaterialColor(currentSurface.getFrontMaterial()); } Color frontColor = JColorChooser.showDialog(GUI.getInstance(), *************** *** 64,68 **** } else { if (currentSurface.getBackMaterial() != null) { ! defaultColor = currentSurface.getBackMaterial().getColor(); } Color backColor = JColorChooser.showDialog(GUI.getInstance(), --- 73,77 ---- } else { if (currentSurface.getBackMaterial() != null) { ! defaultColor = getMaterialColor(currentSurface.getBackMaterial()); } Color backColor = JColorChooser.showDialog(GUI.getInstance(), |
From: Michael L. <he...@us...> - 2006-01-13 10:10:15
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14484/src/net/sourceforge/bprocessor/gui/attrview Modified Files: MyMouseListener.java Log Message: Uses color3fv in Material instead of Color Index: MyMouseListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/MyMouseListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MyMouseListener.java 10 Jan 2006 13:39:49 -0000 1.1 --- MyMouseListener.java 13 Jan 2006 10:10:07 -0000 1.2 *************** *** 56,62 **** defaultColor); if (frontColor != null) { ! newMaterial = new Material("temp", frontColor); } else { ! newMaterial = new Material("temp", defaultColor); } currentSurface.setFrontMaterial(newMaterial); --- 56,62 ---- defaultColor); if (frontColor != null) { ! newMaterial = new Material("temp", frontColor.getRGBColorComponents(null)); } else { ! newMaterial = new Material("temp", defaultColor.getRGBColorComponents(null)); } currentSurface.setFrontMaterial(newMaterial); *************** *** 70,76 **** defaultColor); if (backColor != null) { ! newMaterial = new Material("temp", backColor); } else { ! newMaterial = new Material("temp", defaultColor); } currentSurface.setBackMaterial(newMaterial); --- 70,76 ---- defaultColor); if (backColor != null) { ! newMaterial = new Material("temp", backColor.getRGBColorComponents(null)); } else { ! newMaterial = new Material("temp", defaultColor.getRGBColorComponents(null)); } currentSurface.setBackMaterial(newMaterial); |
From: Michael L. <he...@us...> - 2006-01-13 10:06:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13785/src/net/sourceforge/bprocessor/model Modified Files: Material.java Log Message: New constructor in Material Index: Material.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Material.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Material.java 13 Jan 2006 10:01:28 -0000 1.4 --- Material.java 13 Jan 2006 10:06:13 -0000 1.5 *************** *** 23,27 **** /** ! * Default Constructor for space */ public Material() { --- 23,27 ---- /** ! * Default Constructor for Material */ public Material() { *************** *** 29,33 **** /** ! * Constructor for space * @param name The name of the material * @param color The color of the material --- 29,33 ---- /** ! * Constructor for Material * @param name The name of the material * @param color The color of the material *************** *** 39,42 **** --- 39,52 ---- /** + * Constructor for Material + * @param name The name of the material + * @param color3fv The color of the material specified as array of float + */ + public Material(String name, float[] color3fv) { + setName(name); + setColor3fv(color3fv); + } + + /** * Get the name * @return The name |
From: Michael L. <he...@us...> - 2006-01-13 10:01:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12812/src/net/sourceforge/bprocessor/model Modified Files: Material.java Log Message: Material.setColor3fv() defined Index: Material.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Material.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Material.java 10 Jan 2006 14:42:24 -0000 1.3 --- Material.java 13 Jan 2006 10:01:28 -0000 1.4 *************** *** 73,76 **** --- 73,84 ---- /** + * Set color as array of 3 floats. + * @param color3fv Array of 3 floats + */ + public void setColor3fv(float[] color3fv) { + color = new Color(color3fv[0], color3fv[1], color3fv[2]); + } + + /** * Return The color components as array of 3 floating * point values |
From: Michael L. <he...@us...> - 2006-01-13 09:39:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8784/src/net/sourceforge/bprocessor/model Modified Files: Selection.java Log Message: Renamed some private attributes in Selection Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Selection.java 6 Jan 2006 14:13:45 -0000 1.4 --- Selection.java 13 Jan 2006 09:38:55 -0000 1.5 *************** *** 13,16 **** --- 13,17 ---- import java.util.LinkedList; import java.util.List; + import java.util.Set; /** *************** *** 21,25 **** public class Selection implements Collection { /** The collection of objects */ ! private Collection selection; /** The observers */ --- 22,27 ---- public class Selection implements Collection { /** The collection of objects */ ! private Set mark; ! /** The observers */ *************** *** 42,46 **** public Selection() { super(); ! selection = new HashSet(); observers = new LinkedList(); } --- 44,48 ---- public Selection() { super(); ! mark = new HashSet(); observers = new LinkedList(); } *************** *** 52,56 **** */ public boolean contains(Object object) { ! return selection.contains(object); } --- 54,58 ---- */ public boolean contains(Object object) { ! return mark.contains(object); } *************** *** 61,65 **** */ public boolean add(Object object) { ! if (selection.add(object)) { changed(); return true; --- 63,67 ---- */ public boolean add(Object object) { ! if (mark.add(object)) { changed(); return true; *************** *** 75,79 **** */ public boolean remove(Object object) { ! if (selection.remove(object)) { changed(); return true; --- 77,81 ---- */ public boolean remove(Object object) { ! if (mark.remove(object)) { changed(); return true; *************** *** 87,91 **** */ public void clear() { ! selection.clear(); changed(); } --- 89,93 ---- */ public void clear() { ! mark.clear(); changed(); } *************** *** 106,110 **** */ public Iterator iterator() { ! return selection.iterator(); } --- 108,112 ---- */ public Iterator iterator() { ! return mark.iterator(); } *************** *** 141,145 **** */ public int size() { ! return selection.size(); } --- 143,147 ---- */ public int size() { ! return mark.size(); } *************** *** 149,153 **** */ public boolean isEmpty() { ! return selection.isEmpty(); } --- 151,155 ---- */ public boolean isEmpty() { ! return mark.isEmpty(); } *************** *** 157,161 **** */ public Object[] toArray() { ! return selection.toArray(); } --- 159,163 ---- */ public Object[] toArray() { ! return mark.toArray(); } *************** *** 166,170 **** */ public Object[] toArray(Object[] array) { ! return selection.toArray(array); } --- 168,172 ---- */ public Object[] toArray(Object[] array) { ! return mark.toArray(array); } *************** *** 175,179 **** */ public boolean containsAll(Collection objects) { ! return selection.containsAll(objects); } --- 177,181 ---- */ public boolean containsAll(Collection objects) { ! return mark.containsAll(objects); } *************** *** 184,188 **** */ public boolean addAll(Collection objects) { ! if (selection.addAll(objects)) { changed(); return true; --- 186,190 ---- */ public boolean addAll(Collection objects) { ! if (mark.addAll(objects)) { changed(); return true; *************** *** 198,202 **** */ public boolean removeAll(Collection objects) { ! if (selection.removeAll(objects)) { changed(); return true; --- 200,204 ---- */ public boolean removeAll(Collection objects) { ! if (mark.removeAll(objects)) { changed(); return true; *************** *** 212,216 **** */ public boolean retainAll(Collection objects) { ! if (selection.retainAll(objects)) { changed(); return true; --- 214,218 ---- */ public boolean retainAll(Collection objects) { ! if (mark.retainAll(objects)) { changed(); return true; |