[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Attribute.java,1.4,1.5 Camera.java,1.
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-02-02 10:55:26
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14866/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Added Files: Attribute.java Log Message: Changed Attributes to Attribute and made the AttributeView show Parametric objects by the GenericPanel --- NEW FILE: Attribute.java --- //--------------------------------------------------------------------------------- // $Id: Attribute.java,v 1.5 2006/02/02 10:55:14 rimestad 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; import org.apache.log4j.Logger; /** * A class for holding the info for objects in the model so that it can be * shown in the attributeview in the gui */ public class Attribute { /** The logger */ private static Logger log = Logger.getLogger(Attribute.class); /** The value object */ private Object value; /** The name */ private String name; /** The precision of the object */ private int precision; /** * Constructor * @param name The name * @param value The value * @param precision The precision */ public Attribute(String name, Object value, int precision) { setName(name); setValue(value); setPrecision(precision); } /** * Constructor * @param name The name * @param value The value */ public Attribute(String name, Object value) { this(name, value, 0); } /** * @return Returns the name. */ public String getName() { return name; } /** * @param name The name to set. */ public void setName(String name) { this.name = name; } /** * @return Returns the precision. */ public int getPrecision() { return precision; } /** * @param precision The precision to set. */ public void setPrecision(int precision) { this.precision = precision; } /** * @return Returns the value. */ public Object getValue() { return value; } /** * @param value The value to set. */ public void setValue(Object value) { this.value = value; } } Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Camera.java 30 Jan 2006 14:45:36 -0000 1.9 --- Camera.java 2 Feb 2006 10:55:14 -0000 1.10 *************** *** 402,406 **** Iterator iter = attributes.iterator(); while (iter.hasNext()) { ! Attributes a = (Attributes)iter.next(); if (a.getName().equals("Name")) { setName((String)a.getValue()); --- 402,406 ---- Iterator iter = attributes.iterator(); while (iter.hasNext()) { ! Attribute a = (Attribute)iter.next(); if (a.getName().equals("Name")) { setName((String)a.getValue()); *************** *** 436,454 **** public List getAttributes() { ArrayList res = new ArrayList(); ! res.add(new Attributes("Name", getName())); ! res.add(new Attributes("Type", type == ORTHOGRAPHIC ? "Orthographic" : "Perspective")); ! res.add(new Attributes("Camera", null)); ! res.add(new Attributes("X", new Double(getCamera()[0]))); ! res.add(new Attributes("Y", new Double(getCamera()[1]))); ! res.add(new Attributes("Z", new Double(getCamera()[2]))); ! res.add(new Attributes("Center", null)); ! res.add(new Attributes("X", new Double(getCenter()[0]))); ! res.add(new Attributes("Y", new Double(getCenter()[1]))); ! res.add(new Attributes("Z", new Double(getCenter()[2]))); ! res.add(new Attributes("Roll", null)); ! res.add(new Attributes("X", new Double(getRoll()[0]))); ! res.add(new Attributes("Y", new Double(getRoll()[1]))); ! res.add(new Attributes("Z", new Double(getRoll()[2]))); ! res.add(new Attributes("Focalwidth", new Double(getFocalwidth()))); return res; } --- 436,454 ---- public List getAttributes() { ArrayList res = new ArrayList(); ! res.add(new Attribute("Name", getName())); ! res.add(new Attribute("Type", type == ORTHOGRAPHIC ? "Orthographic" : "Perspective")); ! res.add(new Attribute("Camera", null)); ! res.add(new Attribute("X", new Double(getCamera()[0]))); ! res.add(new Attribute("Y", new Double(getCamera()[1]))); ! res.add(new Attribute("Z", new Double(getCamera()[2]))); ! res.add(new Attribute("Center", null)); ! res.add(new Attribute("X", new Double(getCenter()[0]))); ! res.add(new Attribute("Y", new Double(getCenter()[1]))); ! res.add(new Attribute("Z", new Double(getCenter()[2]))); ! res.add(new Attribute("Roll", null)); ! res.add(new Attribute("X", new Double(getRoll()[0]))); ! res.add(new Attribute("Y", new Double(getRoll()[1]))); ! res.add(new Attribute("Z", new Double(getRoll()[2]))); ! res.add(new Attribute("Focalwidth", new Double(getFocalwidth()))); return res; } |