[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Defaults.java,NONE,1.1 Surface.java,1
Status: Pre-Alpha
Brought to you by:
henryml
From: Nikolaj B. <nbr...@us...> - 2006-04-10 11:54:09
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15648/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Added Files: Defaults.java Log Message: Materials are now handled correct when displayed in attribute view: Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** Surface.java 10 Apr 2006 07:14:35 -0000 1.89 --- Surface.java 10 Apr 2006 11:53:51 -0000 1.90 *************** *** 16,19 **** --- 16,21 ---- import java.util.Set; import java.util.HashSet; + + import org.apache.log4j.Logger; *************** *** 963,967 **** } else if (a.getName().equals("Exterior")) { continue; ! } else if (a.getName().equals("Holes")) { continue; } else if (a.getName().equals("Space")) { --- 965,973 ---- } else if (a.getName().equals("Exterior")) { continue; ! } else if (a.getName().equals("Front Material")) { ! setFrontMaterial((Material) a.getValue()); ! } else if (a.getName().equals("Back Material")) { ! setBackMaterial((Material) a.getValue()); ! } else if (a.getName().equals("Holes")) { continue; } else if (a.getName().equals("Space")) { *************** *** 987,992 **** // FIXME The material attribute should be ... a material! // The id does not work if this is not a toplevel surface. ! if (getOwner() == Project.getInstance().world()) { ! res.add(new Attribute("Front Material", getId())); } --- 993,1006 ---- // FIXME The material attribute should be ... a material! // The id does not work if this is not a toplevel surface. ! if (getFrontMaterial() != null) { ! res.add(new Attribute("Front Material", getFrontMaterial())); ! } else { ! if (getFrontDomain().isConstructionSpace()) { ! res.add(new Attribute("Front Material", new Material("", Defaults.getFrontColor()))); ! } else if (getFrontDomain().isFunctionalSpace()) { ! res.add(new Attribute("Front Material", new Material("", Defaults.getBackColor()))); ! } else { ! res.add(new Attribute("Front Material", new Material("", Defaults.getNoneColor()))); ! } } *************** *** 996,1003 **** res.add(new Attribute("Space", "None", false)); } // FIXME The material attribute should be ... a material! // The id does not work if this is not a toplevel surface. ! if (getOwner() == Project.getInstance().world()) { ! res.add(new Attribute("Back Material", getId())); } if (isInner()) { --- 1010,1026 ---- res.add(new Attribute("Space", "None", false)); } + // FIXME The material attribute should be ... a material! // The id does not work if this is not a toplevel surface. ! if (getBackMaterial() != null) { ! res.add(new Attribute("Back Material", getBackMaterial())); ! } else { ! if (getBackDomain().isConstructionSpace()) { ! res.add(new Attribute("Back Material", new Material("", Defaults.getFrontColor()))); ! } else if (getBackDomain().isFunctionalSpace()) { ! res.add(new Attribute("Back Material", new Material("", Defaults.getBackColor()))); ! } else { ! res.add(new Attribute("Back Material", new Material("", Defaults.getNoneColor()))); ! } } if (isInner()) { --- NEW FILE: Defaults.java --- //--------------------------------------------------------------------------------- // $Id: Defaults.java,v 1.1 2006/04/10 11:53:51 nbramsen Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; /** * 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(); } } |