You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(116) |
May
(220) |
Jun
(52) |
Jul
(30) |
Aug
(35) |
Sep
(24) |
Oct
(49) |
Nov
(44) |
Dec
(70) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(21) |
Feb
(30) |
Mar
(9) |
Apr
(44) |
May
(2) |
Jun
|
Jul
(10) |
Aug
(20) |
Sep
(25) |
Oct
(12) |
Nov
(16) |
Dec
(4) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
(10) |
2006 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(33) |
2007 |
Jan
(4) |
Feb
(57) |
Mar
(17) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Gerardo H. <ma...@us...> - 2007-03-06 18:43:00
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28800/src/org/jrman/parser/keywords Modified Files: AbstractKeywordParser.java Log Message: Started working on new internal representation for primitive parameters (to handle dicing and splitting for all vertex parameters). Index: AbstractKeywordParser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/AbstractKeywordParser.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** AbstractKeywordParser.java 1 Mar 2007 00:50:29 -0000 1.17 --- AbstractKeywordParser.java 6 Mar 2007 18:42:46 -0000 1.18 *************** *** 34,37 **** --- 34,39 ---- import org.jrman.parameters.Declaration; import org.jrman.parameters.ParameterList; + import org.jrman.parameters.Parameters; + import org.jrman.parameters.ParamInfo; import org.jrman.parser.Global; import org.jrman.parser.Parser; *************** *** 62,65 **** --- 64,85 ---- protected static int arraySize; + private static int floatCount; + + private static int integerCount; + + private static int stringCount; + + private static List<ParamInfo> constantParams = + new ArrayList<ParamInfo>(); + + private static List<ParamInfo> uniformParams = + new ArrayList<ParamInfo>(); + + private static List<ParamInfo> varyingParams = + new ArrayList<ParamInfo>(); + + private static List<ParamInfo> vertexParams = + new ArrayList<ParamInfo>(); + protected Parser parser; *************** *** 367,369 **** --- 387,677 ---- } + private void addFloat(float f) { + if (floatCount == floats.length) { + float[] tmp = new float[floats.length * 2]; + System.arraycopy(floats, 0, tmp, 0, floats.length); + floats = tmp; + } + floats[floatCount++] = f; + } + + private void readFloats(Tokenizer st) throws Exception { + int token = st.nextToken(); + if (token == TK_LBRACE) { + while (st.nextToken() == TK_NUMBER) + addFloat(st.nval); + st.pushBack(); + match(st, TK_RBRACE); + } else { + st.pushBack(); + match(st, TK_NUMBER); + addFloat(st.nval); + } + } + + private void addInteger(int i) { + if (integerCount == integers.length) { + int[] tmp = new int[integers.length * 2]; + System.arraycopy(integers, 0, tmp, 0, integers.length); + integers = tmp; + } + integers[integerCount++] = i; + } + + private void readIntegers(Tokenizer st) throws Exception { + int token = st.nextToken(); + if (token == TK_LBRACE) { + while (st.nextToken() == TK_NUMBER) + addInteger((int) st.nval); + st.pushBack(); + match(st, TK_RBRACE); + } else { + st.pushBack(); + match(st, TK_NUMBER); + addInteger((int) st.nval); + } + } + + private void addString(String s) { + if (stringCount == strings.length) { + String[] tmp = new String[strings.length * 2]; + System.arraycopy(strings, 0, tmp, 0, strings.length); + strings = tmp; + } + strings[stringCount++] = s; + } + + private void readStrings(Tokenizer st) throws Exception { + int token = st.nextToken(); + if (token == TK_LBRACE) { + while (st.nextToken() == TK_NUMBER) + addString(st.sval); + st.pushBack(); + match(st, TK_RBRACE); + } else { + st.pushBack(); + match(st, TK_NUMBER); + addString(st.sval); + } + } + + protected Parameters parseParameters(Tokenizer st) throws Exception { + floatCount = 0; + integerCount = 0; + stringCount = 0; + constantParams.clear(); + uniformParams.clear(); + varyingParams.clear(); + vertexParams.clear(); + // Expect list of key & value pairs + while (st.nextToken() == TK_STRING) { + Declaration declaration = null; + try { + declaration = getDeclaration(st.sval); + } catch (IllegalArgumentException e) { + System.err.println("Unknown type for parameter: " + st.sval); + } + Declaration.Type elementType = declaration.getElementType(); + int offset, count; + if (elementType == Declaration.Type.FLOAT) { + offset = floatCount; + readFloats(st); + count = floatCount - offset; + } else if (elementType == Declaration.Type.INTEGER) { + offset = integerCount; + readIntegers(st); + count = integerCount - offset; + } else { + offset = stringCount; + readStrings(st); + count = stringCount - offset; + } + ParamInfo paramInfo = new ParamInfo(declaration, offset, count); + Declaration.StorageClass storageClass = + declaration.getStorageClass(); + if (storageClass == Declaration.StorageClass.CONSTANT) + constantParams.add(paramInfo); + else if (storageClass == Declaration.StorageClass.UNIFORM) + uniformParams.add(paramInfo); + else if (storageClass == Declaration.StorageClass.VARYING) + varyingParams.add(paramInfo); + else + vertexParams.add(paramInfo); + } + int floatParamsCount = 0; + int integerParamsCount = 0; + int stringParamsCount = 0; + for (ParamInfo paramInfo: constantParams) { + Declaration.Type elementType = + paramInfo.getDeclaration().getElementType(); + if (elementType == Declaration.Type.FLOAT) + floatParamsCount++; + else if (elementType == Declaration.Type.INTEGER) + integerParamsCount++; + else + stringParamsCount++; + } + ParamInfo[] constantParamsInfo = null; + float[] constantFloats = null; + int[] constantIntegers = null; + String[] constantStrings = null; + int floatsOffset = 0; + int integersOffset = 0; + int stringsOffset = 0; + if (constantParams.size() > 0) { + constantParamsInfo = new ParamInfo[constantParams.size()]; + if (floatParamsCount > 0) + constantFloats = new float[floatParamsCount]; + if (integerParamsCount > 0) + constantIntegers = new int[integerParamsCount]; + if (stringParamsCount > 0) + constantStrings = new String[stringParamsCount]; + int index = 0; + for (ParamInfo paramInfo: constantParams) { + Declaration.Type elementType = + paramInfo.getDeclaration().getElementType(); + int count = paramInfo.getDeclaration().getElementCount(); + if (elementType == Declaration.Type.FLOAT) { + System.arraycopy(floats, paramInfo.getOffset(), + constantFloats, floatsOffset, + paramInfo.getCount()); + paramInfo.adjust(floatsOffset); + floatsOffset += paramInfo.getCount(); + } else if (elementType == Declaration.Type.INTEGER) { + System.arraycopy(integers, paramInfo.getOffset(), + constantIntegers, integersOffset, + paramInfo.getCount()); + paramInfo.adjust(integersOffset); + integersOffset += paramInfo.getCount(); + } else { + System.arraycopy(strings, paramInfo.getOffset(), + constantStrings, stringsOffset, + paramInfo.getCount()); + paramInfo.adjust(stringsOffset); + stringsOffset += paramInfo.getCount(); + } + constantParamsInfo[index++] = paramInfo; + } + } + floatParamsCount = 0; + integerParamsCount = 0; + floatParamsCount = 0; + for (ParamInfo paramInfo: uniformParams) { + Declaration.Type elementType = + paramInfo.getDeclaration().getElementType(); + if (elementType == Declaration.Type.FLOAT) + floatParamsCount++; + else if (elementType == Declaration.Type.INTEGER) + integerParamsCount++; + else + stringParamsCount++; + } + ParamInfo[] uniformParamsInfo = null; + float[] uniformFloats = null; + int[] uniformIntegers = null; + String[] uniformStrings = null; + floatsOffset = 0; + integersOffset = 0; + stringsOffset = 0; + if (uniformParams.size() > 0) { + uniformParamsInfo = new ParamInfo[uniformParams.size()]; + if (floatParamsCount > 0) + uniformFloats = new float[floatParamsCount]; + if (integerParamsCount > 0) + uniformIntegers = new int[integerParamsCount]; + if (stringParamsCount > 0) + uniformStrings = new String[stringParamsCount]; + int index = 0; + for (ParamInfo paramInfo: uniformParams) { + Declaration.Type elementType = + paramInfo.getDeclaration().getElementType(); + int count = paramInfo.getDeclaration().getElementCount(); + if (elementType == Declaration.Type.FLOAT) { + System.arraycopy(floats, paramInfo.getOffset(), + uniformFloats, floatsOffset, + paramInfo.getCount()); + paramInfo.adjust(floatsOffset); + floatsOffset += paramInfo.getCount(); + } else if (elementType == Declaration.Type.INTEGER) { + System.arraycopy(integers, paramInfo.getOffset(), + uniformIntegers, integersOffset, + paramInfo.getCount()); + paramInfo.adjust(integersOffset); + integersOffset += paramInfo.getCount(); + } else { + System.arraycopy(strings, paramInfo.getOffset(), + uniformStrings, stringsOffset, + paramInfo.getCount()); + paramInfo.adjust(stringsOffset); + stringsOffset += paramInfo.getCount(); + } + uniformParamsInfo[index++] = paramInfo; + } + } + ParamInfo[] varyingParamsInfo = null; + float[][] varyingFloats = null; + floatsOffset = 0; + if (varyingParams.size() > 0) { + varyingParamsInfo = new ParamInfo[varyingParams.size()]; + ParamInfo pi = varyingParams.get(0); + int numArrays = + pi.getCount() / pi.getDeclaration().getElementCount(); + varyingFloats = new float[numArrays][]; + floatParamsCount = 0; + for (ParamInfo paramInfo: varyingParams) + floatParamsCount += paramInfo.getCount() / numArrays; + for (int i = 0; i < numArrays; i++) + varyingFloats[i] = new float[floatParamsCount]; + int index = 0; + for (ParamInfo paramInfo: varyingParams) { + int offset = paramInfo.getOffset(); + int count = paramInfo.getCount() / numArrays; + for (int i = 0; i < numArrays; i++) { + System.arraycopy(floats, offset, + varyingFloats[i], floatsOffset, + count); + offset += count; + } + paramInfo.adjust(floatsOffset, count); + varyingParamsInfo[index++] = paramInfo; + floatsOffset += count; + } + } + ParamInfo[] vertexParamsInfo = null; + float[][] vertexFloats = null; + floatsOffset = 0; + if (vertexParams.size() > 0) { + vertexParamsInfo = new ParamInfo[vertexParams.size()]; + ParamInfo pi = vertexParams.get(0); + int numArrays = + pi.getCount() / pi.getDeclaration().getElementCount(); + vertexFloats = new float[numArrays][]; + floatParamsCount = 0; + for (ParamInfo paramInfo: vertexParams) + floatParamsCount += paramInfo.getCount() / numArrays; + for (int i = 0; i < numArrays; i++) + vertexFloats[i] = new float[floatParamsCount]; + int index = 0; + for (ParamInfo paramInfo: vertexParams) { + int offset = paramInfo.getOffset(); + int count = paramInfo.getCount() / numArrays; + for (int i = 0; i < numArrays; i++) { + System.arraycopy(floats, offset, + vertexFloats[i], floatsOffset, + count); + offset += count; + } + paramInfo.adjust(floatsOffset, count); + vertexParamsInfo[index++] = paramInfo; + floatsOffset += count; + } + } + return new Parameters(constantParamsInfo, constantFloats, + constantIntegers, constantStrings, + uniformParamsInfo, uniformFloats, + uniformIntegers, uniformStrings, + varyingParamsInfo, varyingFloats, + vertexParamsInfo, vertexFloats); + } + } |
From: Gerardo H. <ma...@us...> - 2007-03-06 18:43:00
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parameters In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28800/src/org/jrman/parameters Modified Files: Declaration.java ParameterList.java Added Files: ParamInfo.java Parameters.java Log Message: Started working on new internal representation for primitive parameters (to handle dicing and splitting for all vertex parameters). --- NEW FILE: ParamInfo.java --- /* ParamInfo.java Copyright (C) 2007 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.parameters; public class ParamInfo { private Declaration declaration; private int offset; private int count; public ParamInfo(Declaration declaration, int offset, int count) { this.declaration = declaration; this.offset = offset; this.count = count; } public void adjust(int offset) { this.offset = offset; } public void adjust(int offset, int count) { this.offset = offset; this.count = count; } public Declaration getDeclaration() { return declaration; } public int getOffset() { return offset; } public int getCount() { return count; } } Index: Declaration.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/Declaration.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Declaration.java 1 Mar 2007 00:50:28 -0000 1.10 --- Declaration.java 6 Mar 2007 18:42:45 -0000 1.11 *************** *** 84,104 **** public static class Type { ! public static final Type FLOAT = new Type("float"); ! public static final Type INTEGER = new Type("integer"); ! public static final Type STRING = new Type("string"); ! public static final Type COLOR = new Type("color"); ! public static final Type POINT = new Type("point"); ! public static final Type VECTOR = new Type("vector"); ! public static final Type NORMAL = new Type("normal"); ! public static final Type MATRIX = new Type("matrix"); ! public static final Type HPOINT = new Type("hpoint"); private final static Map<String, Type> map = --- 84,104 ---- public static class Type { ! public static final Type FLOAT = new Type("float", 1); ! public static final Type INTEGER = new Type("integer", 1); ! public static final Type STRING = new Type("string", 1); ! public static final Type COLOR = new Type("color", 3); ! public static final Type POINT = new Type("point", 3); ! public static final Type VECTOR = new Type("vector", 3); ! public static final Type NORMAL = new Type("normal", 3); ! public static final Type MATRIX = new Type("matrix", 16); ! public static final Type HPOINT = new Type("hpoint", 4); private final static Map<String, Type> map = *************** *** 119,124 **** private String name; ! private Type(String name) { this.name = name; } --- 119,127 ---- private String name; ! private int elementCount; ! ! private Type(String name, int elementCount) { this.name = name; + this.elementCount = elementCount; } *************** *** 131,134 **** --- 134,141 ---- } + public int getElementCount() { + return elementCount; + } + public String toString() { return name; *************** *** 190,197 **** --- 197,216 ---- } + public Type getElementType() { + if (type == Type.INTEGER) + return Type.INTEGER; + if (type == Type.STRING) + return Type.STRING; + return Type.FLOAT; + } + public int getCount() { return count; } + public int getElementCount() { + return type.getElementCount() * count; + } + public boolean equals(Object other) { if (other == null) Index: ParameterList.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/ParameterList.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ParameterList.java 24 Dec 2006 05:25:56 -0000 1.10 --- ParameterList.java 6 Mar 2007 18:42:45 -0000 1.11 *************** *** 20,24 **** package org.jrman.parameters; - public class ParameterList { --- 20,23 ---- --- NEW FILE: Parameters.java --- /* Parameters.java Copyright (C) 2007 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.parameters; public class Parameters { private ParamInfo[] constantParamsInfo; private float[] constantFloats; private int[] constantIntegers; private String[] constantStrings; private ParamInfo[] uniformParamsInfo; private float[] uniformFloats; private int[] uniformIntegers; private String[] uniformStrings; private ParamInfo[] varyingParamsInfo; private float[][] varyingFloats; private ParamInfo[] vertexParamsInfo; private float[][] vertexFloats; public Parameters(ParamInfo[] constantParamsInfo, float[] constantFloats, int[] constantIntegers, String[] constantStrings, ParamInfo[] uniformParamsInfo, float[] uniformFloats, int[] uniformIntegers, String[] uniformStrings, ParamInfo[] varyingParamsInfo, float[][] varyingFloats, ParamInfo[] vertexParamsInfo, float[][] vertexFloats) { this.constantParamsInfo = constantParamsInfo; this.constantFloats = constantFloats; this.constantIntegers = constantIntegers; this.constantStrings = constantStrings; this.uniformParamsInfo = uniformParamsInfo; this.uniformFloats = uniformFloats; this.uniformIntegers = uniformIntegers; this.uniformStrings = uniformStrings; this.varyingParamsInfo = varyingParamsInfo; this.varyingFloats = varyingFloats; this.vertexParamsInfo = vertexParamsInfo; this.vertexFloats = vertexFloats; } } |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:58
|
Update of /cvsroot/jrman/drafts/src/org/jrman/attributes In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/attributes Modified Files: Attributes.java Basis.java GeometricApproximation.java MutableAttributes.java Orientation.java ShadingInterpolation.java SolidOperation.java TextureCoordinates.java TrimCurveSense.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: TrimCurveSense.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/TrimCurveSense.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TrimCurveSense.java 26 Feb 2007 19:35:46 -0000 1.2 --- TrimCurveSense.java 1 Mar 2007 00:50:23 -0000 1.3 *************** *** 29,33 **** public static final TrimCurveSense INSIDE = new TrimCurveSense("inside"); ! private final static Map map = new HashMap(); static { --- 29,34 ---- public static final TrimCurveSense INSIDE = new TrimCurveSense("inside"); ! private final static Map<String, TrimCurveSense> map = ! new HashMap<String, TrimCurveSense>(); static { *************** *** 43,47 **** public static TrimCurveSense getNamed(String name) { ! TrimCurveSense result = (TrimCurveSense) TrimCurveSense.map.get(name); if (result == null) throw new IllegalArgumentException("No such sense: " + name); --- 44,48 ---- public static TrimCurveSense getNamed(String name) { ! TrimCurveSense result = TrimCurveSense.map.get(name); if (result == null) throw new IllegalArgumentException("No such sense: " + name); Index: MutableAttributes.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/MutableAttributes.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MutableAttributes.java 26 Feb 2007 19:35:46 -0000 1.11 --- MutableAttributes.java 1 Mar 2007 00:50:23 -0000 1.12 *************** *** 30,33 **** --- 30,34 ---- import org.jrman.geom.Transform; import org.jrman.shaders.DisplacementShader; + import org.jrman.shaders.LightShader; import org.jrman.shaders.SurfaceShader; import org.jrman.shaders.VolumeShader; *************** *** 37,40 **** --- 38,42 ---- private boolean modified; + @SuppressWarnings("unchecked") public MutableAttributes() { color = new Color3f(1f, 1f, 1f); *************** *** 95,100 **** } ! public void setLightSources(Set lightSources) { ! this.lightSources = new HashSet(lightSources); modified = true; } --- 97,102 ---- } ! public void setLightSources(Set<LightShader> lightSources) { ! this.lightSources = new HashSet<LightShader>(lightSources); modified = true; } Index: SolidOperation.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/SolidOperation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SolidOperation.java 26 Feb 2007 19:35:46 -0000 1.2 --- SolidOperation.java 1 Mar 2007 00:50:23 -0000 1.3 *************** *** 37,41 **** new SolidOperation("difference"); ! private static Map map = new HashMap(); static { --- 37,42 ---- new SolidOperation("difference"); ! private static Map<String, SolidOperation> map = ! new HashMap<String, SolidOperation>(); static { *************** *** 53,57 **** public static SolidOperation getNamed(String name){ ! SolidOperation result = (SolidOperation) map.get(name); if (result == null) throw new IllegalArgumentException("No such solid operation: " + --- 54,58 ---- public static SolidOperation getNamed(String name){ ! SolidOperation result = map.get(name); if (result == null) throw new IllegalArgumentException("No such solid operation: " + Index: Basis.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/Basis.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Basis.java 26 Feb 2007 19:35:46 -0000 1.3 --- Basis.java 1 Mar 2007 00:50:23 -0000 1.4 *************** *** 67,71 **** 0f, 0f, 0f, 1f)); ! private static final Map map = new HashMap(); static { --- 67,71 ---- 0f, 0f, 0f, 1f)); ! private static final Map<String, Basis> map = new HashMap<String, Basis>(); static { *************** *** 86,90 **** public static Basis getNamed(String name) { ! Basis result = (Basis) map.get(name); if (result == null) throw new IllegalArgumentException("No such basis: " + name); --- 86,90 ---- public static Basis getNamed(String name) { ! Basis result = map.get(name); if (result == null) throw new IllegalArgumentException("No such basis: " + name); Index: Attributes.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/Attributes.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Attributes.java 26 Feb 2007 19:35:46 -0000 1.9 --- Attributes.java 1 Mar 2007 00:50:23 -0000 1.10 *************** *** 41,45 **** protected TextureCoordinates textureCoordinates; ! protected Set lightSources; protected LightShader[] lightSourcesArray; --- 41,45 ---- protected TextureCoordinates textureCoordinates; ! protected Set<LightShader> lightSources; protected LightShader[] lightSourcesArray; *************** *** 143,147 **** } ! public Set getLightSources() { // return Collections.unmodifiableSet(lightSources); return lightSources; --- 143,147 ---- } ! public Set<LightShader> getLightSources() { // return Collections.unmodifiableSet(lightSources); return lightSources; Index: GeometricApproximation.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/GeometricApproximation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GeometricApproximation.java 26 Feb 2007 19:35:46 -0000 1.2 --- GeometricApproximation.java 1 Mar 2007 00:50:23 -0000 1.3 *************** *** 34,38 **** new GeometricApproximation.Type("flatness"); ! private final static Map map = new HashMap(); static { --- 34,39 ---- new GeometricApproximation.Type("flatness"); ! private final static Map<String, Type> map = ! new HashMap<String, Type>(); static { *************** *** 47,52 **** public static GeometricApproximation.Type getNamed(String name) { ! GeometricApproximation.Type result = ! (GeometricApproximation.Type) Type.map.get(name); if (result == null) throw new IllegalArgumentException("No such approximation type: " --- 48,52 ---- public static GeometricApproximation.Type getNamed(String name) { ! GeometricApproximation.Type result = Type.map.get(name); if (result == null) throw new IllegalArgumentException("No such approximation type: " Index: TextureCoordinates.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/TextureCoordinates.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TextureCoordinates.java 26 Feb 2007 19:35:46 -0000 1.2 --- TextureCoordinates.java 1 Mar 2007 00:50:23 -0000 1.3 *************** *** 38,49 **** private float t4; ! public TextureCoordinates(float s1, ! float t1, ! float s2, ! float t2, ! float s3, ! float t3, ! float s4, ! float t4) { this.s1 = s1; this.t1 = t1; --- 38,45 ---- private float t4; ! public TextureCoordinates(float s1, float t1, ! float s2, float t2, ! float s3, float t3, ! float s4, float t4) { this.s1 = s1; this.t1 = t1; Index: Orientation.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/Orientation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Orientation.java 26 Feb 2007 19:35:46 -0000 1.2 --- Orientation.java 1 Mar 2007 00:50:23 -0000 1.3 *************** *** 33,37 **** public static final Orientation RH = new Orientation("rh"); ! private final static Map map = new HashMap(); static { --- 33,38 ---- public static final Orientation RH = new Orientation("rh"); ! private final static Map<String, Orientation> map = ! new HashMap<String, Orientation>(); static { *************** *** 49,53 **** public static Orientation getNamed(String name) { ! Orientation result = (Orientation) Orientation.map.get(name); if (result == null) throw new IllegalArgumentException("No such orientation: " + name); --- 50,54 ---- public static Orientation getNamed(String name) { ! Orientation result = Orientation.map.get(name); if (result == null) throw new IllegalArgumentException("No such orientation: " + name); Index: ShadingInterpolation.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/ShadingInterpolation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ShadingInterpolation.java 26 Feb 2007 19:35:46 -0000 1.2 --- ShadingInterpolation.java 1 Mar 2007 00:50:23 -0000 1.3 *************** *** 31,35 **** new ShadingInterpolation("smooth"); ! private final static Map map = new HashMap(); static { --- 31,36 ---- new ShadingInterpolation("smooth"); ! private final static Map<String, ShadingInterpolation> map = ! new HashMap<String, ShadingInterpolation>(); static { *************** *** 45,50 **** public static ShadingInterpolation getNamed(String name) { ! ShadingInterpolation result = (ShadingInterpolation) ! ShadingInterpolation.map.get(name); if (result == null) throw new IllegalArgumentException("No such shading interpolation: " --- 46,50 ---- public static ShadingInterpolation getNamed(String name) { ! ShadingInterpolation result = ShadingInterpolation.map.get(name); if (result == null) throw new IllegalArgumentException("No such shading interpolation: " |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:58
|
Update of /cvsroot/jrman/drafts/src/org/jrman/compiler/preprocessor In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/compiler/preprocessor Modified Files: TokenList.java UnexpectedEndOfFileException.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: TokenList.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/compiler/preprocessor/TokenList.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TokenList.java 26 Feb 2007 19:35:46 -0000 1.2 --- TokenList.java 1 Mar 2007 00:50:24 -0000 1.3 *************** *** 25,29 **** class TokenList { ! private LinkedList tokens = new LinkedList(); void addToken(Token token) { --- 25,29 ---- class TokenList { ! private LinkedList<Token> tokens = new LinkedList<Token>(); void addToken(Token token) { *************** *** 36,40 **** Token nextToken() { ! Token token = (Token) tokens.getFirst(); tokens.removeFirst(); return token; --- 36,40 ---- Token nextToken() { ! Token token = tokens.getFirst(); tokens.removeFirst(); return token; Index: UnexpectedEndOfFileException.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/compiler/preprocessor/UnexpectedEndOfFileException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UnexpectedEndOfFileException.java 26 Feb 2007 19:35:46 -0000 1.2 --- UnexpectedEndOfFileException.java 1 Mar 2007 00:50:24 -0000 1.3 *************** *** 22,25 **** --- 22,26 ---- import java.io.IOException; + @SuppressWarnings("serial") public class UnexpectedEndOfFileException extends IOException { |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:58
|
Update of /cvsroot/jrman/drafts/src/org/jrman/maps In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/maps Modified Files: MipMap.java ShadowMap.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: ShadowMap.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/maps/ShadowMap.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ShadowMap.java 26 Feb 2007 19:35:47 -0000 1.8 --- ShadowMap.java 1 Mar 2007 00:50:24 -0000 1.9 *************** *** 42,46 **** public class ShadowMap { ! private static Map map = new HashMap(); private static String currentDirectory; --- 42,47 ---- public class ShadowMap { ! private static Map<String, ShadowMap> map = ! new HashMap<String, ShadowMap>(); private static String currentDirectory; *************** *** 66,70 **** private String name; ! private static Map map = new HashMap(); static { --- 67,72 ---- private String name; ! private static Map<String, Projection> map = ! new HashMap<String, Projection>(); static { *************** *** 74,78 **** public static Projection getNamed(String name) { ! Projection result = (Projection) map.get(name); if (result == null) throw new IllegalArgumentException("No such ShadowMap projection: " --- 76,80 ---- public static Projection getNamed(String name) { ! Projection result = map.get(name); if (result == null) throw new IllegalArgumentException("No such ShadowMap projection: " *************** *** 139,143 **** public static ShadowMap getShadowMap(String filename) { ! ShadowMap result = (ShadowMap) map.get(filename); if (result == null) try { --- 141,145 ---- public static ShadowMap getShadowMap(String filename) { ! ShadowMap result = map.get(filename); if (result == null) try { Index: MipMap.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/maps/MipMap.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MipMap.java 26 Feb 2007 19:35:47 -0000 1.8 --- MipMap.java 1 Mar 2007 00:50:24 -0000 1.9 *************** *** 54,58 **** private static float[] lh = new float[4]; ! private static Map map = new HashMap(); private static String currentDirectory; --- 54,58 ---- private static float[] lh = new float[4]; ! private static Map<String, MipMap> map = new HashMap<String, MipMap>(); private static String currentDirectory; *************** *** 84,88 **** private String name; ! private static Map map = new HashMap(); static { --- 84,88 ---- private String name; ! private static Map<String, Mode> map = new HashMap<String, Mode>(); static { *************** *** 93,97 **** public static Mode getNamed(String name) { ! Mode result = (Mode) map.get(name); if (result == null) throw new IllegalArgumentException("No such MipMap mode: " + --- 93,97 ---- public static Mode getNamed(String name) { ! Mode result = map.get(name); if (result == null) throw new IllegalArgumentException("No such MipMap mode: " + *************** *** 226,230 **** public static MipMap getMipMap(String filename) { ! MipMap result = (MipMap) map.get(filename); if (result == null) try { --- 226,230 ---- public static MipMap getMipMap(String filename) { ! MipMap result = map.get(filename); if (result == null) try { |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:57
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/geom Modified Files: ClippingVolume.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: ClippingVolume.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/ClippingVolume.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ClippingVolume.java 26 Feb 2007 19:35:46 -0000 1.5 --- ClippingVolume.java 1 Mar 2007 00:50:24 -0000 1.6 *************** *** 26,30 **** public class ClippingVolume { ! private List planes = new ArrayList(); public void addPlane(Plane plane) { --- 26,30 ---- public class ClippingVolume { ! private List<Plane> planes = new ArrayList<Plane>(); public void addPlane(Plane plane) { *************** *** 34,39 **** public Plane.Side whereIs(BoundingVolume v) { boolean bothSides = false; ! for (int i = 0; i < planes.size(); i++) { ! Plane plane = (Plane) planes.get(i); Plane.Side side = v.whichSideOf(plane); if (side == Plane.Side.OUTSIDE) --- 34,38 ---- public Plane.Side whereIs(BoundingVolume v) { boolean bothSides = false; ! for (Plane plane: planes) { Plane.Side side = v.whichSideOf(plane); if (side == Plane.Side.OUTSIDE) |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:57
|
Update of /cvsroot/jrman/drafts/src/net/falappa/imageio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/net/falappa/imageio Modified Files: ImageViewerPanelLoadAction.java ImageViewerPanelSaveAction.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: ImageViewerPanelSaveAction.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/imageio/ImageViewerPanelSaveAction.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ImageViewerPanelSaveAction.java 26 Feb 2007 15:25:14 -0000 1.6 --- ImageViewerPanelSaveAction.java 1 Mar 2007 00:50:23 -0000 1.7 *************** *** 52,55 **** --- 52,56 ---- * @author Alessandro Falappa */ + @SuppressWarnings("serial") public class ImageViewerPanelSaveAction extends AbstractAction { private JImageViewerPanel viewerPanel; Index: ImageViewerPanelLoadAction.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/imageio/ImageViewerPanelLoadAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ImageViewerPanelLoadAction.java 28 Feb 2007 00:02:40 -0000 1.4 --- ImageViewerPanelLoadAction.java 1 Mar 2007 00:50:23 -0000 1.5 *************** *** 50,53 **** --- 50,54 ---- * @author Alessandro Falappa */ + @SuppressWarnings("serial") public class ImageViewerPanelLoadAction extends AbstractAction { private JImageViewerPanel viewerPanel; |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:57
|
Update of /cvsroot/jrman/drafts/src/net/falappa/swing/widgets In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/net/falappa/swing/widgets Modified Files: JImageViewerPanel.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: JImageViewerPanel.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/swing/widgets/JImageViewerPanel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JImageViewerPanel.java 28 Feb 2007 00:02:40 -0000 1.7 --- JImageViewerPanel.java 1 Mar 2007 00:50:23 -0000 1.8 *************** *** 49,52 **** --- 49,53 ---- * @author Alessandro Falappa */ + @SuppressWarnings("serial") public class JImageViewerPanel extends JPanel { private ZoomScrollImageView zoomView= new ZoomScrollImageView(); *************** *** 335,338 **** --- 336,340 ---- * @author Alessandro Falappa */ + @SuppressWarnings("serial") class ZoomToolBar extends JToolBar { private static ResourceBundle res= *************** *** 363,367 **** private ZoomScrollImageView zoomScrollView; private transient JPopupMenu contextMenu= null; ! private Map userActions= new HashMap(5); private static final Insets buttonsInsets= new Insets(1, 1, 1, 1); private transient final ActionListener zoomInActionListener= --- 365,370 ---- private ZoomScrollImageView zoomScrollView; private transient JPopupMenu contextMenu= null; ! private Map<Action, JButton> userActions= ! new HashMap<Action, JButton>(5); private static final Insets buttonsInsets= new Insets(1, 1, 1, 1); private transient final ActionListener zoomInActionListener= *************** *** 675,678 **** --- 678,682 ---- * @version 1.0 */ + @SuppressWarnings("serial") class ZoomScrollImageView extends JComponent |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:57
|
Update of /cvsroot/jrman/drafts In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255 Modified Files: build.xml Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: build.xml =================================================================== RCS file: /cvsroot/jrman/drafts/build.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** build.xml 26 Feb 2007 15:25:14 -0000 1.26 --- build.xml 1 Mar 2007 00:50:23 -0000 1.27 *************** *** 29,32 **** --- 29,33 ---- <javac srcdir="${src}" destdir="${build}" source="1.5" target="1.5" debug="on"> + <compilerarg value="-Xlint"/> <classpath refid="project.class.path"/> </javac> |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:41
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/parser Modified Files: Global.java ObjectInstanceList.java Parser.java Tokenizer.java World.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: World.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/World.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** World.java 26 Feb 2007 19:35:48 -0000 1.4 --- World.java 1 Mar 2007 00:50:28 -0000 1.5 *************** *** 27,38 **** public class World { ! private Map lights; public World() { ! lights = new HashMap(); } public World(World other) { ! lights = new HashMap(other.lights); } --- 27,38 ---- public class World { ! private Map<Integer, LightShader> lights; public World() { ! lights = new HashMap<Integer, LightShader>(); } public World(World other) { ! lights = new HashMap<Integer, LightShader>(other.lights); } *************** *** 42,47 **** public LightShader getLight(int sequenceNumber) { ! LightShader light = (LightShader) ! lights.get(new Integer(sequenceNumber)); if (light == null) throw new IllegalArgumentException("no such light: " + --- 42,46 ---- public LightShader getLight(int sequenceNumber) { ! LightShader light = lights.get(sequenceNumber); if (light == null) throw new IllegalArgumentException("no such light: " + Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** Parser.java 26 Feb 2007 19:35:47 -0000 1.111 --- Parser.java 1 Mar 2007 00:50:28 -0000 1.112 *************** *** 104,108 **** "org.jrman.parser.keywords.Keyword"; ! private final static Map fullFileNames = new HashMap(); private String currentDirectory; --- 104,109 ---- "org.jrman.parser.keywords.Keyword"; ! private final static Map<String, String> fullFileNames = ! new HashMap<String, String>(); private String currentDirectory; *************** *** 118,122 **** private Renderer renderer; ! private Map keywordParsers = new HashMap(); private MutableAttributes currentAttributes; --- 119,124 ---- private Renderer renderer; ! private Map<String, KeywordParser> keywordParsers = ! new HashMap<String, KeywordParser>(); private MutableAttributes currentAttributes; *************** *** 124,136 **** private Attributes currentImmutableAttributes; ! private Stack attributeStack = new Stack(); ! private Stack transformStack = new Stack(); ! private Stack worldStack = new Stack(); ! private Stack frameStack = new Stack(); ! private Stack stateStack = new Stack(); private State state = State.OUTSIDE; --- 126,139 ---- private Attributes currentImmutableAttributes; ! private Stack<MutableAttributes> attributeStack = ! new Stack<MutableAttributes>(); ! private Stack<Transform> transformStack = new Stack<Transform>(); ! private Stack<World> worldStack = new Stack<World>(); ! private Stack<Frame> frameStack = new Stack<Frame>(); ! private Stack<State> stateStack = new Stack<State>(); private State state = State.OUTSIDE; *************** *** 138,142 **** private String currentOperation; // Just now to avoid compiler warnings... ! private Map objectInstanceLists = new HashMap(); private ObjectInstanceList currentObjectInstanceList; --- 141,146 ---- private String currentOperation; // Just now to avoid compiler warnings... ! private Map<Integer, ObjectInstanceList> objectInstanceLists = ! new HashMap<Integer, ObjectInstanceList>(); private ObjectInstanceList currentObjectInstanceList; *************** *** 219,223 **** public void parse(String filename) throws Exception { if (currentDirectory != null) { ! String fullFileName = (String) fullFileNames.get(filename); if (fullFileName == null) { fullFileName = currentDirectory + File.separator + filename; --- 223,227 ---- public void parse(String filename) throws Exception { if (currentDirectory != null) { ! String fullFileName = fullFileNames.get(filename); if (fullFileName == null) { fullFileName = currentDirectory + File.separator + filename; *************** *** 282,288 **** private KeywordParser getKeyWordParser(String keyword) throws Exception { ! KeywordParser kp = (KeywordParser) keywordParsers.get(keyword); if (kp == null) ! kp = (KeywordParser) keywordParsers.get(keyword.toLowerCase()); if (kp == null) { char c = keyword.charAt(0); --- 286,292 ---- private KeywordParser getKeyWordParser(String keyword) throws Exception { ! KeywordParser kp = keywordParsers.get(keyword); if (kp == null) ! kp = keywordParsers.get(keyword.toLowerCase()); if (kp == null) { char c = keyword.charAt(0); *************** *** 304,308 **** private void popState() { ! state = (State) stateStack.pop(); } --- 308,312 ---- private void popState() { ! state = stateStack.pop(); } *************** *** 318,322 **** public void popAttributes() { ! currentAttributes = (MutableAttributes) attributeStack.pop(); currentAttributes.setModified(true); } --- 322,326 ---- public void popAttributes() { ! currentAttributes = attributeStack.pop(); currentAttributes.setModified(true); } *************** *** 333,343 **** private void newObjectInstanceList(int sequenceNumber) { currentObjectInstanceList = new ObjectInstanceList(); ! objectInstanceLists.put(new Integer(sequenceNumber), ! currentObjectInstanceList); } private ObjectInstanceList getObjectInstanceList(int sequenceNumber) { ! ObjectInstanceList result = (ObjectInstanceList) ! objectInstanceLists.get(new Integer(sequenceNumber)); if (result == null) throw new IllegalArgumentException("Unknown instance: " + --- 337,345 ---- private void newObjectInstanceList(int sequenceNumber) { currentObjectInstanceList = new ObjectInstanceList(); ! objectInstanceLists.put(sequenceNumber, currentObjectInstanceList); } private ObjectInstanceList getObjectInstanceList(int sequenceNumber) { ! ObjectInstanceList result = objectInstanceLists.get(sequenceNumber); if (result == null) throw new IllegalArgumentException("Unknown instance: " + *************** *** 363,367 **** public void transformEnd() { ! currentAttributes.setTransform((Transform) transformStack.pop()); popState(); } --- 365,369 ---- public void transformEnd() { ! currentAttributes.setTransform(transformStack.pop()); popState(); } *************** *** 487,492 **** public void frameEnd() { popAttributes(); ! world = (World) worldStack.pop(); ! frame = (Frame) frameStack.pop(); popState(); } --- 489,494 ---- public void frameEnd() { popAttributes(); ! world = worldStack.pop(); ! frame = frameStack.pop(); popState(); } *************** *** 557,562 **** renderer.render(); renderer = null; ! world = (World) worldStack.pop(); ! frame = (Frame) frameStack.pop(); popState(); popAttributes(); --- 559,564 ---- renderer.render(); renderer = null; ! world = worldStack.pop(); ! frame = frameStack.pop(); popState(); popAttributes(); *************** *** 801,805 **** private void turnOnLight(LightShader light) { ! Set lightSources = new HashSet(currentAttributes.getLightSources()); lightSources.add(light); currentAttributes.setLightSources(lightSources); --- 803,808 ---- private void turnOnLight(LightShader light) { ! Set<LightShader> lightSources = ! new HashSet<LightShader>(currentAttributes.getLightSources()); lightSources.add(light); currentAttributes.setLightSources(lightSources); *************** *** 807,811 **** private void turnOffLight(LightShader light) { ! Set lightSources = new HashSet(currentAttributes.getLightSources()); lightSources.remove(light); currentAttributes.setLightSources(lightSources); --- 810,815 ---- private void turnOffLight(LightShader light) { ! Set<LightShader> lightSources = ! new HashSet<LightShader>(currentAttributes.getLightSources()); lightSources.remove(light); currentAttributes.setLightSources(lightSources); Index: Tokenizer.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Tokenizer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Tokenizer.java 26 Feb 2007 19:35:48 -0000 1.6 --- Tokenizer.java 1 Mar 2007 00:50:28 -0000 1.7 *************** *** 72,89 **** } ! /* ! * ! * private static boolean matches(char[] buffer, int pos, String s) { if ! * (s.length() != pos) return false; for (int i = 0; i < pos; i++) if ! * (buffer[i] != s.charAt(i)) return false; return true; } ! * ! * private String bufferToString() { for (int i = 0; i < strings.size(); ! * i++) { String s = (String) strings.get(i); if (matches(buffer, pos, s)) ! * return s; } String s = new String(buffer, 0, pos); strings.add(s); return ! * s; } ! * ! */ ! ! private Comparator comparator = new Comparator() { public int compare(Object o1, Object o2) { String s = (String) o1; --- 72,76 ---- } ! private Comparator<Object> comparator = new Comparator<Object>() { public int compare(Object o1, Object o2) { String s = (String) o1; Index: Global.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Global.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Global.java 26 Feb 2007 19:35:47 -0000 1.14 --- Global.java 1 Mar 2007 00:50:28 -0000 1.15 *************** *** 28,34 **** public class Global { ! private static Map transforms = new HashMap(); ! private static Map declarations = new HashMap(); static { --- 28,36 ---- public class Global { ! private static Map<String, Transform> transforms = ! new HashMap<String, Transform>(); ! private static Map<String, Declaration> declarations = ! new HashMap<String, Declaration>(); static { *************** *** 106,110 **** public static Transform getTransform(String name) { ! Transform result = (Transform) transforms.get(name); if (result == null) throw new IllegalArgumentException("no such coordinate system: " + --- 108,112 ---- public static Transform getTransform(String name) { ! Transform result = transforms.get(name); if (result == null) throw new IllegalArgumentException("no such coordinate system: " + *************** *** 118,122 **** public static Declaration getDeclaration(String name) { ! return (Declaration) declarations.get(name); } --- 120,124 ---- public static Declaration getDeclaration(String name) { ! return declarations.get(name); } Index: ObjectInstanceList.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/ObjectInstanceList.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectInstanceList.java 26 Feb 2007 19:35:47 -0000 1.2 --- ObjectInstanceList.java 1 Mar 2007 00:50:28 -0000 1.3 *************** *** 32,36 **** public class ObjectInstanceList { ! private List primitiveCreators = new ArrayList(); private BoundingVolume boundingVolume; --- 32,37 ---- public class ObjectInstanceList { ! private List<PrimitiveCreator> primitiveCreators = ! new ArrayList<PrimitiveCreator>(); private BoundingVolume boundingVolume; |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:35
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parameters In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/parameters Modified Files: Declaration.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: Declaration.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/Declaration.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Declaration.java 24 Dec 2006 05:25:56 -0000 1.9 --- Declaration.java 1 Mar 2007 00:50:28 -0000 1.10 *************** *** 48,52 **** public static final StorageClass VERTEX = new StorageClass("vertex"); ! private final static Map map = new HashMap(); static { --- 48,53 ---- public static final StorageClass VERTEX = new StorageClass("vertex"); ! private final static Map<String, StorageClass> map = ! new HashMap<String, StorageClass>(); static { *************** *** 64,68 **** public static StorageClass getNamed(String name) { ! StorageClass result = (StorageClass) map.get(name); if (result == null) throw new IllegalArgumentException("No such storage class: " + --- 65,69 ---- public static StorageClass getNamed(String name) { ! StorageClass result = map.get(name); if (result == null) throw new IllegalArgumentException("No such storage class: " + *************** *** 101,105 **** public static final Type HPOINT = new Type("hpoint"); ! private final static Map map = new HashMap(); static { --- 102,107 ---- public static final Type HPOINT = new Type("hpoint"); ! private final static Map<String, Type> map = ! new HashMap<String, Type>(); static { *************** *** 122,126 **** public static Type getNamed(String name) { ! Type result = (Type) map.get(name); if (result == null) throw new IllegalArgumentException("No such data type: " + --- 124,128 ---- public static Type getNamed(String name) { ! Type result = map.get(name); if (result == null) throw new IllegalArgumentException("No such data type: " + |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:35
|
Update of /cvsroot/jrman/drafts/src/org/jrman/util In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/util Modified Files: NullList.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: NullList.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/NullList.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullList.java 28 Feb 2007 00:02:41 -0000 1.2 --- NullList.java 1 Mar 2007 00:50:29 -0000 1.3 *************** *** 22,25 **** --- 22,26 ---- import java.util.ArrayList; + @SuppressWarnings("serial") public class NullList extends ArrayList { |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:35
|
Update of /cvsroot/jrman/drafts/src/org/jrman/ui In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/ui Modified Files: AboutDialog.java BasePanel.java Framebuffer.java MainFrame.java OptionsPanel.java ProgressObservable.java QueuePanel.java RenderPanel.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: Framebuffer.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/Framebuffer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Framebuffer.java 28 Feb 2007 00:02:41 -0000 1.8 --- Framebuffer.java 1 Mar 2007 00:50:29 -0000 1.9 *************** *** 36,39 **** --- 36,40 ---- * @author Alessandro Falappa */ + @SuppressWarnings("serial") public class Framebuffer extends JFrame { private JImageViewerPanel imagePanel = new JImageViewerPanel(); Index: MainFrame.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/MainFrame.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MainFrame.java 28 Feb 2007 00:02:41 -0000 1.6 --- MainFrame.java 1 Mar 2007 00:50:29 -0000 1.7 *************** *** 43,46 **** --- 43,47 ---- * @version $Revision$ */ + @SuppressWarnings("serial") public class MainFrame extends JFrame implements ProgressObserver { // non visual members *************** *** 103,106 **** --- 104,108 ---- } + @SuppressWarnings("serial") private class AboutAction extends AbstractAction { public AboutAction() { *************** *** 120,123 **** --- 122,126 ---- } + @SuppressWarnings("serial") private class PrefsAction extends AbstractAction { public PrefsAction() { Index: RenderPanel.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/RenderPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RenderPanel.java 28 Feb 2007 00:02:41 -0000 1.2 --- RenderPanel.java 1 Mar 2007 00:50:29 -0000 1.3 *************** *** 37,40 **** --- 37,41 ---- * @version $Revision$ */ + @SuppressWarnings("serial") public class RenderPanel extends BasePanel implements ProgressObserver { private RenderRunnable runnable; *************** *** 76,79 **** --- 77,81 ---- } + @SuppressWarnings("serial") private class RenderAction extends AbstractAction { public RenderAction() { *************** *** 90,93 **** --- 92,96 ---- } + @SuppressWarnings("serial") private class CancelRenderAction extends AbstractAction { public CancelRenderAction() { Index: AboutDialog.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/AboutDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AboutDialog.java 28 Feb 2007 00:02:41 -0000 1.2 --- AboutDialog.java 1 Mar 2007 00:50:29 -0000 1.3 *************** *** 40,45 **** --- 40,47 ---- * @version $Revision$ */ + @SuppressWarnings("serial") public class AboutDialog extends JDialog { + @SuppressWarnings("serial") private final class CloseAction extends AbstractAction { public CloseAction(){ Index: OptionsPanel.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/OptionsPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OptionsPanel.java 28 Feb 2007 00:02:41 -0000 1.2 --- OptionsPanel.java 1 Mar 2007 00:50:29 -0000 1.3 *************** *** 38,41 **** --- 38,42 ---- * @version $Revision$ */ + @SuppressWarnings("serial") public class OptionsPanel extends BasePanel { private JTextField tfCustomOpts= new JTextField(); Index: BasePanel.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/BasePanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasePanel.java 28 Feb 2007 00:02:41 -0000 1.2 --- BasePanel.java 1 Mar 2007 00:50:29 -0000 1.3 *************** *** 36,39 **** --- 36,40 ---- * @version $Revision$ */ + @SuppressWarnings("serial") class BasePanel extends JPanel { private static ImageIcon infoIcon= Index: QueuePanel.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/QueuePanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QueuePanel.java 28 Feb 2007 00:02:41 -0000 1.2 --- QueuePanel.java 1 Mar 2007 00:50:29 -0000 1.3 *************** *** 47,50 **** --- 47,51 ---- * @version $Revision$ */ + @SuppressWarnings("serial") public class QueuePanel extends BasePanel { private DefaultListModel dlmQueue= new DefaultListModel(); *************** *** 54,57 **** --- 55,60 ---- private JButton bAdd= new JButton(addAction); private JButton bRemove= new JButton(removeAction); + + @SuppressWarnings("serial") private static final class FileListCellRenderer extends DefaultListCellRenderer { *************** *** 131,134 **** --- 134,139 ---- lQueue.getSelectedIndex() >= 0); } + + @SuppressWarnings("serial") private class AddToQueueAction extends AbstractAction { private JFileChooser chooser; *************** *** 166,169 **** --- 171,175 ---- } + @SuppressWarnings("serial") private class RemoveFromQueueAction extends AbstractAction { public RemoveFromQueueAction() { Index: ProgressObservable.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/ProgressObservable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProgressObservable.java 28 Feb 2007 00:02:41 -0000 1.2 --- ProgressObservable.java 1 Mar 2007 00:50:29 -0000 1.3 *************** *** 33,37 **** */ public class ProgressObservable { ! protected ArrayList observers= new ArrayList(4); public void addProgressObserver(ProgressObserver observer) { --- 33,38 ---- */ public class ProgressObservable { ! protected ArrayList<ProgressObserver> observers= ! new ArrayList<ProgressObserver>(4); public void addProgressObserver(ProgressObserver observer) { *************** *** 50,69 **** protected void fireProgressStart(int startProgressValue, int endProgressValue) { ! Iterator i= observers.iterator(); ! while (i.hasNext()) ! ((ProgressObserver)i.next()).start(startProgressValue, ! endProgressValue); } protected void fireProgress(int progressValue,String message) { ! Iterator i= observers.iterator(); ! while (i.hasNext()) ! ((ProgressObserver)i.next()).setProgress(progressValue,message); } protected void fireProgressEnd() { ! Iterator i= observers.iterator(); ! while (i.hasNext()) ! ((ProgressObserver)i.next()).end(); } } --- 51,66 ---- protected void fireProgressStart(int startProgressValue, int endProgressValue) { ! for (ProgressObserver po: observers) ! po.start(startProgressValue, endProgressValue); } protected void fireProgress(int progressValue,String message) { ! for (ProgressObserver po: observers) ! po.setProgress(progressValue, message); } protected void fireProgressEnd() { ! for (ProgressObserver po: observers) ! po.end(); } } |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:35
|
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/shaders Modified Files: SurfaceShader.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: SurfaceShader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceShader.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** SurfaceShader.java 28 Feb 2007 00:02:41 -0000 1.23 --- SurfaceShader.java 1 Mar 2007 00:50:29 -0000 1.24 *************** *** 60,64 **** static Color3fGrid _cg1 = new Color3fGrid(); ! static Map shaderClassCache = new HashMap(); protected static abstract class Statement { --- 60,64 ---- static Color3fGrid _cg1 = new Color3fGrid(); ! static Map<String, Class> shaderClassCache = new HashMap<String, Class>(); protected static abstract class Statement { *************** *** 149,153 **** public static SurfaceShader createShader(String name, ParameterList parameters, Attributes attributes) { ! Class clazz = (Class) shaderClassCache.get(name); if (clazz == null) { String className = "Surface" + name.substring(0, 1).toUpperCase() --- 149,153 ---- public static SurfaceShader createShader(String name, ParameterList parameters, Attributes attributes) { ! Class clazz = shaderClassCache.get(name); if (clazz == null) { String className = "Surface" + name.substring(0, 1).toUpperCase() *************** *** 215,219 **** protected void specular(ShaderVariables sv, Vector3fGrid Nn, ! Vector3fGrid V, float roughness, Color3fGrid out) { out.set(BLACK); specularStatement.setNn(Nn); --- 215,219 ---- protected void specular(ShaderVariables sv, Vector3fGrid Nn, ! Vector3fGrid V, float roughness, Color3fGrid out) { out.set(BLACK); specularStatement.setNn(Nn); *************** *** 225,229 **** protected void doIlluminance(ShaderVariables sv, LightShader[] lights, ! Point3fGrid P, Vector3fGrid N, float angle, Statement statement) { for (int i = 0; i < lights.length; i++) { LightShader ls = lights[i]; --- 225,230 ---- protected void doIlluminance(ShaderVariables sv, LightShader[] lights, ! Point3fGrid P, Vector3fGrid N, float angle, ! Statement statement) { for (int i = 0; i < lights.length; i++) { LightShader ls = lights[i]; *************** *** 236,240 **** protected void illuminance(ShaderVariables sv, String categoryList, ! Point3fGrid P, Vector3fGrid N, float angle, Statement statement) { LightShader[] selectedLights; if (categoryList == null) --- 237,242 ---- protected void illuminance(ShaderVariables sv, String categoryList, ! Point3fGrid P, Vector3fGrid N, float angle, ! Statement statement) { LightShader[] selectedLights; if (categoryList == null) *************** *** 246,250 **** protected LightShader[] getLightsByCategory(ShaderVariables sv, ! String categoryList) { boolean inverse = false; if (categoryList.startsWith("-")) { --- 248,252 ---- protected LightShader[] getLightsByCategory(ShaderVariables sv, ! String categoryList) { boolean inverse = false; if (categoryList.startsWith("-")) { *************** *** 252,258 **** inverse = true; } ! Set categories = new TreeSet(); categories.addAll(Arrays.asList(SEPARATOR.split(categoryList))); ! List result = new ArrayList(); LightShader[] lights = sv.attributes.getLightSourcesArray(); for (int i = 0; i < lights.length; i++) { --- 254,260 ---- inverse = true; } ! Set<String> categories = new TreeSet<String>(); categories.addAll(Arrays.asList(SEPARATOR.split(categoryList))); ! List<LightShader> result = new ArrayList<LightShader>(); LightShader[] lights = sv.attributes.getLightSourcesArray(); for (int i = 0; i < lights.length; i++) { *************** *** 268,272 **** */ } ! return (LightShader[]) result.toArray(new LightShader[result.size()]); } --- 270,274 ---- */ } ! return result.toArray(new LightShader[result.size()]); } |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:34
|
Update of /cvsroot/jrman/drafts/src/org/jrman/options In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/options Modified Files: CameraProjection.java Display.java Filter.java Hider.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: CameraProjection.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/options/CameraProjection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CameraProjection.java 26 Feb 2007 19:35:47 -0000 1.3 --- CameraProjection.java 1 Mar 2007 00:50:24 -0000 1.4 *************** *** 34,38 **** new CameraProjection("unknown"); ! private static Map map = new HashMap(); static { --- 34,39 ---- new CameraProjection("unknown"); ! private static Map<String, CameraProjection> map = ! new HashMap<String, CameraProjection>(); static { *************** *** 48,52 **** public final static CameraProjection getNamed(String name){ ! CameraProjection result = (CameraProjection) map.get(name); if (result == null) result = UNKNOWN; --- 49,53 ---- public final static CameraProjection getNamed(String name){ ! CameraProjection result = map.get(name); if (result == null) result = UNKNOWN; Index: Hider.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/options/Hider.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Hider.java 26 Feb 2007 19:35:47 -0000 1.3 --- Hider.java 1 Mar 2007 00:50:27 -0000 1.4 *************** *** 33,37 **** private String name; ! private static Map map = new HashMap(); static { --- 33,37 ---- private String name; ! private static Map<String, Hider> map = new HashMap<String, Hider>(); static { *************** *** 46,50 **** public static Hider getNamed(String name) { ! Hider result = (Hider) map.get(name); if (result == null) throw new IllegalArgumentException("no such hider: " + name); --- 46,50 ---- public static Hider getNamed(String name) { ! Hider result = map.get(name); if (result == null) throw new IllegalArgumentException("no such hider: " + name); Index: Display.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/options/Display.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Display.java 26 Feb 2007 19:35:47 -0000 1.3 --- Display.java 1 Mar 2007 00:50:24 -0000 1.4 *************** *** 39,43 **** private String name; ! private static Map map = new HashMap(); static { --- 39,43 ---- private String name; ! private static Map<String, Type> map = new HashMap<String, Type>(); static { *************** *** 55,59 **** public static Type getNamed(String name) { ! Type result = (Type) map.get(name); if (name == null) throw new IllegalArgumentException("no such display type: " --- 55,59 ---- public static Type getNamed(String name) { ! Type result = map.get(name); if (name == null) throw new IllegalArgumentException("no such display type: " *************** *** 73,77 **** public final static Mode A = new Mode("a"); ! private static Map map = new HashMap(); static { --- 73,78 ---- public final static Mode A = new Mode("a"); ! private static Map<String, Mode> map = ! new HashMap<String, Mode>(); static { *************** *** 89,93 **** public static Mode getNamed(String name) { ! Mode result = (Mode) map.get(name); if (result == null) throw new IllegalArgumentException("no such display mode: " --- 90,94 ---- public static Mode getNamed(String name) { ! Mode result = map.get(name); if (result == null) throw new IllegalArgumentException("no such display mode: " Index: Filter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/options/Filter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Filter.java 26 Feb 2007 19:35:47 -0000 1.3 --- Filter.java 1 Mar 2007 00:50:27 -0000 1.4 *************** *** 50,54 **** public final static Type GAUSSIAN = new Type("gaussian"); ! private static Map map = new HashMap(); static { --- 50,54 ---- public final static Type GAUSSIAN = new Type("gaussian"); ! private static Map<String, Type> map = new HashMap<String, Type>(); static { *************** *** 67,71 **** public static Type getNamed(String name) { ! Type result = (Type) map.get(name); if (result == null) throw new IllegalArgumentException("no such filter type: " + --- 67,71 ---- public static Type getNamed(String name) { ! Type result = map.get(name); if (result == null) throw new IllegalArgumentException("no such filter type: " + |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:34
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/render Modified Files: RenderCanvas.java RendererHidden.java ShaderVariables.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** RendererHidden.java 26 Feb 2007 19:35:52 -0000 1.80 --- RendererHidden.java 1 Mar 2007 00:50:29 -0000 1.81 *************** *** 117,121 **** private Point3fGrid pointsTmp; ! public void init(Frame frame, World world, Parser parser) { super.init(frame, world, parser); --- 117,121 ---- private Point3fGrid pointsTmp; ! public void init(Frame frame, World world, Parser parser) { super.init(frame, world, parser); Index: RenderCanvas.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RenderCanvas.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RenderCanvas.java 26 Feb 2007 19:35:52 -0000 1.5 --- RenderCanvas.java 1 Mar 2007 00:50:29 -0000 1.6 *************** *** 26,29 **** --- 26,30 ---- import javax.swing.JComponent; + @SuppressWarnings("serial") public class RenderCanvas extends JComponent { Index: ShaderVariables.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/ShaderVariables.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ShaderVariables.java 26 Feb 2007 19:35:52 -0000 1.15 --- ShaderVariables.java 1 Mar 2007 00:50:29 -0000 1.16 *************** *** 84,88 **** public ParameterList parameters; ! private Map map = new HashMap(); public ShaderVariables(Transform worldToCamera) { --- 84,88 ---- public ParameterList parameters; ! private Map<String, Grid> map = new HashMap<String, Grid>(); public ShaderVariables(Transform worldToCamera) { *************** *** 95,99 **** public Grid get(String name) { ! return (Grid) map.get(name); } --- 95,99 ---- public Grid get(String name) { ! return map.get(name); } |
From: Gerardo H. <ma...@us...> - 2007-03-01 00:50:34
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1255/src/org/jrman/parser/keywords Modified Files: AbstractKeywordParser.java Log Message: Compiles for Java 1.5 with -Xlint without any warning. Index: AbstractKeywordParser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/AbstractKeywordParser.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** AbstractKeywordParser.java 26 Feb 2007 19:35:48 -0000 1.16 --- AbstractKeywordParser.java 1 Mar 2007 00:50:29 -0000 1.17 *************** *** 64,70 **** protected Parser parser; ! protected Set validStates = new HashSet(); ! private Map declarationsCache = new HashMap(); public static void reset() { --- 64,71 ---- protected Parser parser; ! protected Set<Parser.State> validStates = new HashSet<Parser.State>(); ! private Map<String, Declaration> declarationsCache = ! new HashMap<String, Declaration>(); public static void reset() { *************** *** 323,327 **** return declaration; // Check for inline declaration ! declaration = (Declaration) declarationsCache.get(name); if (declaration != null) return declaration; --- 324,328 ---- return declaration; // Check for inline declaration ! declaration = declarationsCache.get(name); if (declaration != null) return declaration; |
From: Gerardo H. <ma...@us...> - 2007-02-28 00:02:56
|
Update of /cvsroot/jrman/drafts/src/net/falappa/imageio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4501/src/net/falappa/imageio Modified Files: ImageViewerPanelLoadAction.java ImageWriterSpiFileFilter.java Log Message: Finished reformatting code :) Code is almost 100% clean (no more hideous Eclipse formatting, no tabs, no line longer than 80 columns, no CR/LF) Index: ImageWriterSpiFileFilter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/imageio/ImageWriterSpiFileFilter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImageWriterSpiFileFilter.java 26 Feb 2007 15:25:14 -0000 1.5 --- ImageWriterSpiFileFilter.java 28 Feb 2007 00:02:40 -0000 1.6 *************** *** 36,100 **** */ public class ImageWriterSpiFileFilter extends FileFilter { ! private String description; ! private String[] suffixes; ! private ImageWriterSpi writer; ! private static final ResourceBundle messagesBundle= ! ResourceBundle.getBundle( ! ImageWriterSpiFileFilter.class.getPackage().getName() ! + ".res.ImageSpiFileFilters"); ! /** ! * Create a file filter based on an image writer. ! * @param writer the ImageWriterSpi object the filter is based on ! */ ! public ImageWriterSpiFileFilter(ImageWriterSpi writer) { ! this.writer= writer; ! StringBuffer sb= new StringBuffer(); ! String template= messagesBundle.getString("ImageSpiFileFilter.image_files"); //$NON-NLS-1$ ! sb.append( ! MessageFormat.format( ! template, ! writer.getFormatNames()[0].toUpperCase())); ! suffixes= writer.getFileSuffixes(); ! sb.append(" (*.").append(suffixes[0]); //$NON-NLS-1$ ! for (int i= 1; i < suffixes.length; i++) ! sb.append(";*.").append(suffixes[i]); //$NON-NLS-1$ ! sb.append(')'); ! description= sb.toString(); ! } ! // implements the method of the abstract base class ! public boolean accept(File f) { ! return f.isDirectory() || hasCorrectSuffix(f.getName()); ! } ! // implements the method of the abstract base class ! public String getDescription() { ! return description; ! } ! /** ! * Tests if a string ends with one of the suffixes accepted by the image writer. ! * @param name the string to test ! * @return true if the string passes the test ! */ ! public boolean hasCorrectSuffix(String name) { ! boolean accepted= false; ! for (int i= 0; !accepted && i < suffixes.length; i++) ! accepted= accepted || name.endsWith(suffixes[i]); ! return accepted; ! } ! /** ! * Appends a suffix accepted by the image writer to the file name passed as argument. ! * @param fileName the file name to modify ! * @return a new file name ! */ ! public String addSuffix(String fileName) { ! return fileName + "." + suffixes[0]; //$NON-NLS-1$ ! } ! /** ! * Returns the imagewriter corresponding to the filter ! * @return a ImageWriterSpi object ! */ ! public ImageWriterSpi getImageWriterSpi() { ! return writer; ! } } --- 36,100 ---- */ public class ImageWriterSpiFileFilter extends FileFilter { ! private String description; ! private String[] suffixes; ! private ImageWriterSpi writer; ! private static final ResourceBundle messagesBundle= ! ResourceBundle.getBundle( ! ImageWriterSpiFileFilter.class.getPackage().getName() ! + ".res.ImageSpiFileFilters"); ! /** ! * Create a file filter based on an image writer. ! * @param writer the ImageWriterSpi object the filter is based on ! */ ! public ImageWriterSpiFileFilter(ImageWriterSpi writer) { ! this.writer= writer; ! StringBuffer sb= new StringBuffer(); ! String template= messagesBundle.getString("ImageSpiFileFilter.image_files"); //$NON-NLS-1$ ! sb.append( ! MessageFormat.format( ! template, ! writer.getFormatNames()[0].toUpperCase())); ! suffixes= writer.getFileSuffixes(); ! sb.append(" (*.").append(suffixes[0]); //$NON-NLS-1$ ! for (int i= 1; i < suffixes.length; i++) ! sb.append(";*.").append(suffixes[i]); //$NON-NLS-1$ ! sb.append(')'); ! description= sb.toString(); ! } ! // implements the method of the abstract base class ! public boolean accept(File f) { ! return f.isDirectory() || hasCorrectSuffix(f.getName()); ! } ! // implements the method of the abstract base class ! public String getDescription() { ! return description; ! } ! /** ! * Tests if a string ends with one of the suffixes accepted by the image writer. ! * @param name the string to test ! * @return true if the string passes the test ! */ ! public boolean hasCorrectSuffix(String name) { ! boolean accepted= false; ! for (int i= 0; !accepted && i < suffixes.length; i++) ! accepted= accepted || name.endsWith(suffixes[i]); ! return accepted; ! } ! /** ! * Appends a suffix accepted by the image writer to the file name passed as argument. ! * @param fileName the file name to modify ! * @return a new file name ! */ ! public String addSuffix(String fileName) { ! return fileName + "." + suffixes[0]; //$NON-NLS-1$ ! } ! /** ! * Returns the imagewriter corresponding to the filter ! * @return a ImageWriterSpi object ! */ ! public ImageWriterSpi getImageWriterSpi() { ! return writer; ! } } Index: ImageViewerPanelLoadAction.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/imageio/ImageViewerPanelLoadAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ImageViewerPanelLoadAction.java 27 Dec 2006 16:30:18 -0000 1.3 --- ImageViewerPanelLoadAction.java 28 Feb 2007 00:02:40 -0000 1.4 *************** *** 51,135 **** */ public class ImageViewerPanelLoadAction extends AbstractAction { ! private JImageViewerPanel viewerPanel; ! private static final ResourceBundle messagesBundle= ! ResourceBundle.getBundle( ! ImageViewerPanelSaveAction.class.getPackage().getName() ! + ".res.ImageViewerPanelActions"); ! private JFileChooser fc; ! /** ! * Constructs and initializes this object ! * @param viewerPanel the <code>JImageViewerPanel</code> this action is linked to ! */ ! public ImageViewerPanelLoadAction(JImageViewerPanel viewerPanel) { ! super(messagesBundle.getString("ImageViewerPanelLoadAction.Load_2")); //$NON-NLS-1$ ! this.viewerPanel= viewerPanel; ! putValue(SHORT_DESCRIPTION, messagesBundle.getString("ImageViewerPanelLoadAction.Load_image_from_file_3")); //$NON-NLS-1$ ! putValue(SMALL_ICON, UIManager.getIcon("Tree.openIcon")); //$NON-NLS-1$ ! } ! /* (non-Javadoc) ! * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) ! */ ! public void actionPerformed(ActionEvent e) { ! if (fc == null) { ! fc= new JFileChooser(); ! fc.setAcceptAllFileFilterUsed(false); ! fc.setFileSelectionMode(JFileChooser.FILES_ONLY); ! fc.setMultiSelectionEnabled(false); ! fc.setDialogTitle(messagesBundle.getString("ImageViewerPanelLoadAction.Choose_filename_to_load_5")); //$NON-NLS-1$ ! // prepare file filters ! IIORegistry theRegistry= IIORegistry.getDefaultInstance(); ! Iterator it= ! theRegistry.getServiceProviders(ImageReaderSpi.class, false); ! while (it.hasNext()) { ! ImageReaderSpi reader= (ImageReaderSpi)it.next(); ! ImageReaderSpiFileFilter ff= ! new ImageReaderSpiFileFilter(reader); ! fc.addChoosableFileFilter(ff); ! } ! } ! if (fc.showOpenDialog(viewerPanel) == JFileChooser.APPROVE_OPTION) { ! File selectedFile= fc.getSelectedFile(); ! if (selectedFile != null && selectedFile.exists()) { ! //String fileName= selectedFile.getAbsolutePath(); ! ImageReaderSpiFileFilter ff= ! (ImageReaderSpiFileFilter)fc.getFileFilter(); ! readFromFile(selectedFile, ff); ! } ! } ! } ! /** ! * @param selectedFile ! * @param ff ! */ ! private void readFromFile(File selectedFile, ImageReaderSpiFileFilter ff) { ! try { ! ImageInputStream iis= ImageIO.createImageInputStream(selectedFile); ! ImageReader ir= ff.getImageReaderSpi().createReaderInstance(); ! ir.setInput(iis); ! // preparing a destination bufferedimage of type INT_RGB will make ! // scrolling and zooming faster (at least on Win2k) ! int idx= ir.getMinIndex(); ! BufferedImage bufferedImage= ! new BufferedImage( ! ir.getWidth(idx), ! ir.getHeight(idx), ! BufferedImage.TYPE_INT_RGB); ! ImageReadParam irp= ir.getDefaultReadParam(); ! irp.setDestination(bufferedImage); ! bufferedImage= ir.read(idx,irp); ! viewerPanel.setImage(bufferedImage); ! ir.dispose(); ! iis.close(); ! } ! catch (IOException ioe) { ! JOptionPane.showMessageDialog(viewerPanel, messagesBundle.getString("ImageViewerPanelLoadAction.Error_during_image_loading_7"), //$NON-NLS-1$ ! messagesBundle.getString("ImageViewerPanelLoadAction.Error_8"), //$NON-NLS-1$ ! JOptionPane.ERROR_MESSAGE); ! ioe.printStackTrace(); ! } ! } } --- 51,135 ---- */ public class ImageViewerPanelLoadAction extends AbstractAction { ! private JImageViewerPanel viewerPanel; ! private static final ResourceBundle messagesBundle= ! ResourceBundle.getBundle( ! ImageViewerPanelSaveAction.class.getPackage().getName() ! + ".res.ImageViewerPanelActions"); ! private JFileChooser fc; ! /** ! * Constructs and initializes this object ! * @param viewerPanel the <code>JImageViewerPanel</code> this action is linked to ! */ ! public ImageViewerPanelLoadAction(JImageViewerPanel viewerPanel) { ! super(messagesBundle.getString("ImageViewerPanelLoadAction.Load_2")); //$NON-NLS-1$ ! this.viewerPanel= viewerPanel; ! putValue(SHORT_DESCRIPTION, messagesBundle.getString("ImageViewerPanelLoadAction.Load_image_from_file_3")); //$NON-NLS-1$ ! putValue(SMALL_ICON, UIManager.getIcon("Tree.openIcon")); //$NON-NLS-1$ ! } ! /* (non-Javadoc) ! * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) ! */ ! public void actionPerformed(ActionEvent e) { ! if (fc == null) { ! fc= new JFileChooser(); ! fc.setAcceptAllFileFilterUsed(false); ! fc.setFileSelectionMode(JFileChooser.FILES_ONLY); ! fc.setMultiSelectionEnabled(false); ! fc.setDialogTitle(messagesBundle.getString("ImageViewerPanelLoadAction.Choose_filename_to_load_5")); //$NON-NLS-1$ ! // prepare file filters ! IIORegistry theRegistry= IIORegistry.getDefaultInstance(); ! Iterator it= ! theRegistry.getServiceProviders(ImageReaderSpi.class, false); ! while (it.hasNext()) { ! ImageReaderSpi reader= (ImageReaderSpi)it.next(); ! ImageReaderSpiFileFilter ff= ! new ImageReaderSpiFileFilter(reader); ! fc.addChoosableFileFilter(ff); ! } ! } ! if (fc.showOpenDialog(viewerPanel) == JFileChooser.APPROVE_OPTION) { ! File selectedFile= fc.getSelectedFile(); ! if (selectedFile != null && selectedFile.exists()) { ! //String fileName= selectedFile.getAbsolutePath(); ! ImageReaderSpiFileFilter ff= ! (ImageReaderSpiFileFilter)fc.getFileFilter(); ! readFromFile(selectedFile, ff); ! } ! } ! } ! /** ! * @param selectedFile ! * @param ff ! */ ! private void readFromFile(File selectedFile, ImageReaderSpiFileFilter ff) { ! try { ! ImageInputStream iis= ImageIO.createImageInputStream(selectedFile); ! ImageReader ir= ff.getImageReaderSpi().createReaderInstance(); ! ir.setInput(iis); ! // preparing a destination bufferedimage of type INT_RGB will make ! // scrolling and zooming faster (at least on Win2k) ! int idx= ir.getMinIndex(); ! BufferedImage bufferedImage= ! new BufferedImage( ! ir.getWidth(idx), ! ir.getHeight(idx), ! BufferedImage.TYPE_INT_RGB); ! ImageReadParam irp= ir.getDefaultReadParam(); ! irp.setDestination(bufferedImage); ! bufferedImage= ir.read(idx,irp); ! viewerPanel.setImage(bufferedImage); ! ir.dispose(); ! iis.close(); ! } ! catch (IOException ioe) { ! JOptionPane.showMessageDialog(viewerPanel, messagesBundle.getString("ImageViewerPanelLoadAction.Error_during_image_loading_7"), //$NON-NLS-1$ ! messagesBundle.getString("ImageViewerPanelLoadAction.Error_8"), //$NON-NLS-1$ ! JOptionPane.ERROR_MESSAGE); ! ioe.printStackTrace(); ! } ! } } |
From: Gerardo H. <ma...@us...> - 2007-02-28 00:02:52
|
Update of /cvsroot/jrman/drafts/src/org/jrman/ui In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4501/src/org/jrman/ui Modified Files: AboutDialog.java BasePanel.java Framebuffer.java MainFrame.java OptionsPanel.java ProgressObservable.java ProgressObserver.java QueuePanel.java RenderPanel.java RenderRunnable.java TextAreaPrintStream.java Log Message: Finished reformatting code :) Code is almost 100% clean (no more hideous Eclipse formatting, no tabs, no line longer than 80 columns, no CR/LF) Index: RenderRunnable.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/RenderRunnable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RenderRunnable.java 11 Sep 2004 18:10:00 -0000 1.2 --- RenderRunnable.java 28 Feb 2007 00:02:41 -0000 1.3 *************** *** 25,78 **** class RenderRunnable extends ProgressObservable implements Runnable { ! private DefaultListModel queue; ! private String optionsString; ! private boolean canceled; ! // (non-Javadoc) ! // @see java.lang.Runnable#run() ! // ! public void run() { ! canceled= false; ! if (queue != null && optionsString != null) { ! // begin rendering of queue ! fireProgressStart(0, queue.size()); ! StringBuffer sb= new StringBuffer(optionsString.length() + 20); ! for (int i= 0; i < queue.size(); i++) { ! // prepare command line arguments ! String fileName= ((File)queue.elementAt(i)).getAbsolutePath(); ! sb.setLength(0); ! sb.append(optionsString).append(' ').append(fileName); ! // launch renderer passing the arguments ! String[] tmp=sb.toString().trim().split("\\s+"); ! JRMan.main(tmp); ! // signal file rendering completion and check for cancellation ! fireProgress(i + 1, fileName); ! if (canceled) ! break; ! } ! fireProgressEnd(); ! } ! } ! /** ! * @param b ! */ ! public void setCanceled(boolean b) { ! canceled= b; ! } ! /** ! * @param model ! */ ! public void setQueue(DefaultListModel model) { ! queue= model; ! } ! /** ! * @param string ! */ ! public void setOptionsString(String string) { ! optionsString= string; ! } } \ No newline at end of file --- 25,78 ---- class RenderRunnable extends ProgressObservable implements Runnable { ! private DefaultListModel queue; ! private String optionsString; ! private boolean canceled; ! // (non-Javadoc) ! // @see java.lang.Runnable#run() ! // ! public void run() { ! canceled= false; ! if (queue != null && optionsString != null) { ! // begin rendering of queue ! fireProgressStart(0, queue.size()); ! StringBuffer sb= new StringBuffer(optionsString.length() + 20); ! for (int i= 0; i < queue.size(); i++) { ! // prepare command line arguments ! String fileName= ((File)queue.elementAt(i)).getAbsolutePath(); ! sb.setLength(0); ! sb.append(optionsString).append(' ').append(fileName); ! // launch renderer passing the arguments ! String[] tmp=sb.toString().trim().split("\\s+"); ! JRMan.main(tmp); ! // signal file rendering completion and check for cancellation ! fireProgress(i + 1, fileName); ! if (canceled) ! break; ! } ! fireProgressEnd(); ! } ! } ! /** ! * @param b ! */ ! public void setCanceled(boolean b) { ! canceled= b; ! } ! /** ! * @param model ! */ ! public void setQueue(DefaultListModel model) { ! queue= model; ! } ! /** ! * @param string ! */ ! public void setOptionsString(String string) { ! optionsString= string; ! } } \ No newline at end of file Index: Framebuffer.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/Framebuffer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Framebuffer.java 8 Feb 2004 08:54:55 -0000 1.7 --- Framebuffer.java 28 Feb 2007 00:02:41 -0000 1.8 *************** *** 1,19 **** /* ! Framebuffer.java ! Copyright (C) 2003 Alessandro Falappa ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.ui; --- 1,19 ---- /* ! Framebuffer.java ! Copyright (C) 2003 Alessandro Falappa ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.ui; *************** *** 65,69 **** } setIconImage( ! new ImageIcon(getClass().getResource("images/framebuffer_icon.png")).getImage()); setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); addWindowListener(new WindowAdapter() { --- 65,70 ---- } setIconImage( ! new ImageIcon( ! getClass().getResource("images/framebuffer_icon.png")).getImage()); setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); addWindowListener(new WindowAdapter() { Index: MainFrame.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/MainFrame.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MainFrame.java 11 Feb 2004 16:16:51 -0000 1.5 --- MainFrame.java 28 Feb 2007 00:02:41 -0000 1.6 *************** *** 60,164 **** */ public MainFrame() throws HeadlessException { ! super("JrManGUI"); ! setIconImage(new ImageIcon(getClass().getResource("images/framebuffer_icon.png")).getImage()); ! setDefaultCloseOperation(EXIT_ON_CLOSE); ! renderRunnable.addProgressObserver(this); ! // assemble panels ! tabbedPane.add(pQueue, pQueue.getTitle()); ! tabbedPane.add(pOptions, pOptions.getTitle()); ! tabbedPane.add(pRender, pRender.getTitle()); ! tabbedPane.setBorder(Borders.TABBED_DIALOG_BORDER); ! getContentPane().add(tabbedPane, BorderLayout.CENTER); ! getContentPane().add(createButtonsBar(), BorderLayout.SOUTH); ! pack(); ! } ! ! private JPanel createButtonsBar() { ! // fill the panel ! ButtonBarBuilder builder= new ButtonBarBuilder(); ! builder.setBorder(Borders.TABBED_DIALOG_BORDER); ! builder.addGridded(bAbout); ! //builder.addGriddedButtons(new JButton[] { bAbout, bSettings }); ! builder.addGlue(); ! builder.addGridded(bExit); ! return builder.getPanel(); ! } ! ! private class ExitAction extends AbstractAction { ! public ExitAction() { ! putValue(Action.NAME, "Exit"); ! putValue(Action.SHORT_DESCRIPTION, "Quits from the application"); ! putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_E)); ! putValue(Action.SMALL_ICON, new ImageIcon(getClass().getResource("images/exit.png"))); ! } ! /* (non-Javadoc) ! * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) ! */ ! public void actionPerformed(ActionEvent e) { ! System.exit(0); ! } ! } ! ! private class AboutAction extends AbstractAction { ! public AboutAction() { ! putValue(Action.NAME, "About..."); ! putValue(Action.SHORT_DESCRIPTION, "Shows some information about this application"); ! putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_B)); ! putValue(Action.SMALL_ICON, new ImageIcon(getClass().getResource("images/info.png"))); ! } ! /* (non-Javadoc) ! * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) ! */ ! public void actionPerformed(ActionEvent e) { ! new AboutDialog(MainFrame.this).setVisible(true); ! } } ! ! private class PrefsAction extends AbstractAction { ! public PrefsAction() { ! putValue(Action.NAME, "Settings..."); ! putValue(Action.SHORT_DESCRIPTION, "Edit application settings"); ! putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_S)); ! putValue(Action.SMALL_ICON, new ImageIcon(getClass().getResource("images/prefs.png"))); ! } ! /* (non-Javadoc) ! * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) ! */ ! public void actionPerformed(ActionEvent e) { new AboutDialog(MainFrame.this).setVisible(true); ! } ! } ! ! /* (non-Javadoc) ! * @see org.jrman.ui.ProgressObserver#start(int, int) ! */ ! public void start(int startProgressValue, int endProgressValue) { ! tabbedPane.setEnabledAt(0, false); ! tabbedPane.setEnabledAt(1, false); ! } ! ! /* (non-Javadoc) ! * @see org.jrman.ui.ProgressObserver#setProgress(int) ! */ ! public void setProgress(int value,String message) { ! //do nothing ! } ! ! /* (non-Javadoc) ! * @see org.jrman.ui.ProgressObserver#end() ! */ ! public void end() { ! tabbedPane.setEnabledAt(0, true); ! tabbedPane.setEnabledAt(1, true); ! } ! ! /** ! * Starts the rendering process ! */ ! public static void startRendering() { ! renderRunnable.setQueue(pQueue.getQueue()); renderRunnable.setOptionsString(pOptions.getOptionsString()); Thread t= new Thread(renderRunnable, "renderthread"); t.start(); ! } } --- 60,163 ---- */ public MainFrame() throws HeadlessException { ! super("JrManGUI"); ! setIconImage(new ImageIcon(getClass() ! .getResource("images/framebuffer_icon.png")).getImage()); ! setDefaultCloseOperation(EXIT_ON_CLOSE); ! renderRunnable.addProgressObserver(this); ! // assemble panels ! tabbedPane.add(pQueue, pQueue.getTitle()); ! tabbedPane.add(pOptions, pOptions.getTitle()); ! tabbedPane.add(pRender, pRender.getTitle()); ! tabbedPane.setBorder(Borders.TABBED_DIALOG_BORDER); ! getContentPane().add(tabbedPane, BorderLayout.CENTER); ! getContentPane().add(createButtonsBar(), BorderLayout.SOUTH); ! pack(); } ! ! private JPanel createButtonsBar() { ! // fill the panel ! ButtonBarBuilder builder= new ButtonBarBuilder(); ! builder.setBorder(Borders.TABBED_DIALOG_BORDER); ! builder.addGridded(bAbout); ! //builder.addGriddedButtons(new JButton[] { bAbout,bSettings }); ! builder.addGlue(); ! builder.addGridded(bExit); ! return builder.getPanel(); ! } ! ! private class ExitAction extends AbstractAction { ! public ExitAction() { ! putValue(Action.NAME, "Exit"); ! putValue(Action.SHORT_DESCRIPTION, ! "Quits from the application"); ! putValue(Action.MNEMONIC_KEY, ! new Integer(KeyEvent.VK_E)); ! putValue(Action.SMALL_ICON, ! new ImageIcon(getClass() ! .getResource("images/exit.png"))); ! } ! ! public void actionPerformed(ActionEvent e) { ! System.exit(0); ! } ! } ! ! private class AboutAction extends AbstractAction { ! public AboutAction() { ! putValue(Action.NAME, "About..."); ! putValue(Action.SHORT_DESCRIPTION, ! "Shows some information about this application"); ! putValue(Action.MNEMONIC_KEY, ! new Integer(KeyEvent.VK_B)); ! putValue(Action.SMALL_ICON, ! new ImageIcon(getClass() ! .getResource("images/info.png"))); ! } ! ! public void actionPerformed(ActionEvent e) { ! new AboutDialog(MainFrame.this).setVisible(true); ! } ! } ! ! private class PrefsAction extends AbstractAction { ! public PrefsAction() { ! putValue(Action.NAME, "Settings..."); ! putValue(Action.SHORT_DESCRIPTION, ! "Edit application settings"); ! putValue(Action.MNEMONIC_KEY, ! new Integer(KeyEvent.VK_S)); ! putValue(Action.SMALL_ICON, ! new ImageIcon(getClass() ! .getResource("images/prefs.png"))); ! } ! ! public void actionPerformed(ActionEvent e) { new AboutDialog(MainFrame.this).setVisible(true); ! } ! } ! ! public void start(int startProgressValue, int endProgressValue) { ! tabbedPane.setEnabledAt(0, false); ! tabbedPane.setEnabledAt(1, false); ! } ! ! public void setProgress(int value,String message) { ! //do nothing ! } ! ! public void end() { ! tabbedPane.setEnabledAt(0, true); ! tabbedPane.setEnabledAt(1, true); ! } ! ! /** ! * Starts the rendering process ! */ ! public static void startRendering() { ! renderRunnable.setQueue(pQueue.getQueue()); renderRunnable.setOptionsString(pOptions.getOptionsString()); Thread t= new Thread(renderRunnable, "renderthread"); t.start(); ! } ! } Index: RenderPanel.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/RenderPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RenderPanel.java 11 Feb 2004 16:16:51 -0000 1.1 --- RenderPanel.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,139 **** ! /* ! * RenderPanel.java Copyright (C) 2004 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! package org.jrman.ui; ! ! import java.awt.Insets; ! import java.awt.event.ActionEvent; ! import java.awt.event.KeyEvent; ! import java.io.PrintStream; ! ! import javax.swing.*; ! ! import com.jgoodies.forms.builder.DefaultFormBuilder; ! import com.jgoodies.forms.factories.Borders; ! import com.jgoodies.forms.layout.CellConstraints; ! import com.jgoodies.forms.layout.FormLayout; ! ! /** ! * Manages start and cancel rendering of queued files and display of ! * rendering messages. ! * ! * @author Alessandro Falappa ! * @version $Revision$ ! */ ! public class RenderPanel extends BasePanel implements ProgressObserver { ! private RenderRunnable runnable; ! private CancelRenderAction cancelRenderAction= new CancelRenderAction(); ! private RenderAction renderAction= new RenderAction(); ! private JButton bRender= new JButton(renderAction); ! private JTextArea taMessages= new JTextArea(10, 40); ! private JProgressBar pbProgress= new JProgressBar(0, 100); ! private PrintStream oldOutStream=System.out; ! private PrintStream oldErrStream=System.err; ! private TextAreaPrintStream outRedirector=new TextAreaPrintStream(taMessages); ! private TextAreaPrintStream errRedirector=new TextAreaPrintStream(taMessages); ! ! /** ! * Constructs and initializes a RenderPanel object. ! */ ! public RenderPanel(RenderRunnable runnable) { ! if (runnable == null) ! throw new NullPointerException("Null RenderRunnable"); ! setTitle("3 - Render"); ! this.runnable= runnable; ! this.runnable.addProgressObserver(this); ! // prepare components ! taMessages.setEditable(false); ! taMessages.setMargin(new Insets(1, 3, 1, 3)); ! // set layout and fill the panel ! FormLayout layout= new FormLayout("fill:60dlu, 3dlu, 240dlu:grow", "pref,3dlu,pref,3dlu,fill:pref:grow"); ! DefaultFormBuilder builder= new DefaultFormBuilder(this, layout); ! builder.setBorder(Borders.TABBED_DIALOG_BORDER); ! CellConstraints cc= new CellConstraints(); ! builder.add(createInfoLabel("Start rendering and monitor progress"), cc.xywh(1, 1, 3, 1)); ! builder.add(bRender, cc.xy(1, 3)); ! builder.add(pbProgress, cc.xy(3, 3)); ! builder.add(new JScrollPane(taMessages), cc.xywh(1, 5, 3, 1)); ! } ! ! private class RenderAction extends AbstractAction { ! public RenderAction() { ! putValue(Action.NAME, "Render"); ! putValue(Action.SHORT_DESCRIPTION, "Starts rendering of the queued rib files"); ! putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_R)); ! } ! /* (non-Javadoc) ! * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) ! */ ! public void actionPerformed(ActionEvent e) { ! MainFrame.startRendering(); ! } ! ! } ! ! private class CancelRenderAction extends AbstractAction { ! public CancelRenderAction() { ! putValue(Action.NAME, "Cancel"); ! putValue(Action.SHORT_DESCRIPTION, "Cancel current rendering"); ! putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_C)); ! } ! /* (non-Javadoc) ! * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) ! */ ! public void actionPerformed(ActionEvent e) { ! runnable.setCanceled(true); ! taMessages.append("Canceling queue rendering..."); ! } ! } ! /* (non-Javadoc) ! * @see org.jrman.ui.ProgressObserver#start(int, int) ! */ ! public void start(int startProgressValue, int endProgressValue) { ! pbProgress.setMinimum(startProgressValue); ! pbProgress.setMaximum(endProgressValue); ! pbProgress.setValue(startProgressValue); ! pbProgress.setStringPainted(true); ! taMessages.setText("Rendering of queued file(s) started.\n\n"); ! bRender.setAction(cancelRenderAction); ! // divert standard streams ! System.setOut(outRedirector); ! System.setErr(errRedirector); ! } ! ! /* (non-Javadoc) ! * @see org.jrman.ui.ProgressObserver#setProgress(int) ! */ ! public void setProgress(int value,String message) { ! pbProgress.setValue(value); ! pbProgress.setString(value + " file(s)"); ! taMessages.append("\n\n"); ! } ! ! /* (non-Javadoc) ! * @see org.jrman.ui.ProgressObserver#end() ! */ ! public void end() { ! bRender.setAction(renderAction); ! pbProgress.setValue(0); ! pbProgress.setStringPainted(false); ! taMessages.append("\nRendering of queued files finished."); ! // restore standard streams ! System.setOut(oldOutStream); ! System.setErr(oldErrStream); ! } ! } --- 1,132 ---- ! /* ! * RenderPanel.java Copyright (C) 2004 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! package org.jrman.ui; ! ! import java.awt.Insets; ! import java.awt.event.ActionEvent; ! import java.awt.event.KeyEvent; ! import java.io.PrintStream; ! ! import javax.swing.*; ! ! import com.jgoodies.forms.builder.DefaultFormBuilder; ! import com.jgoodies.forms.factories.Borders; ! import com.jgoodies.forms.layout.CellConstraints; ! import com.jgoodies.forms.layout.FormLayout; ! ! /** ! * Manages start and cancel rendering of queued files and display of ! * rendering messages. ! * ! * @author Alessandro Falappa ! * @version $Revision$ ! */ ! public class RenderPanel extends BasePanel implements ProgressObserver { ! private RenderRunnable runnable; ! private CancelRenderAction cancelRenderAction= new CancelRenderAction(); ! private RenderAction renderAction= new RenderAction(); ! private JButton bRender= new JButton(renderAction); ! private JTextArea taMessages= new JTextArea(10, 40); ! private JProgressBar pbProgress= new JProgressBar(0, 100); ! private PrintStream oldOutStream=System.out; ! private PrintStream oldErrStream=System.err; ! private TextAreaPrintStream outRedirector= ! new TextAreaPrintStream(taMessages); ! private TextAreaPrintStream errRedirector= ! new TextAreaPrintStream(taMessages); ! ! /** ! * Constructs and initializes a RenderPanel object. ! */ ! public RenderPanel(RenderRunnable runnable) { ! if (runnable == null) ! throw new NullPointerException("Null RenderRunnable"); ! setTitle("3 - Render"); ! this.runnable= runnable; ! this.runnable.addProgressObserver(this); ! // prepare components ! taMessages.setEditable(false); ! taMessages.setMargin(new Insets(1, 3, 1, 3)); ! // set layout and fill the panel ! FormLayout layout= new FormLayout("fill:60dlu, 3dlu, 240dlu:grow", ! "pref,3dlu,pref,3dlu,fill:pref:grow"); ! DefaultFormBuilder builder= new DefaultFormBuilder(this, layout); ! builder.setBorder(Borders.TABBED_DIALOG_BORDER); ! CellConstraints cc= new CellConstraints(); ! builder.add(createInfoLabel("Start rendering and monitor progress"), ! cc.xywh(1, 1, 3, 1)); ! builder.add(bRender, cc.xy(1, 3)); ! builder.add(pbProgress, cc.xy(3, 3)); ! builder.add(new JScrollPane(taMessages), cc.xywh(1, 5, 3, 1)); ! } ! ! private class RenderAction extends AbstractAction { ! public RenderAction() { ! putValue(Action.NAME, "Render"); ! putValue(Action.SHORT_DESCRIPTION, ! "Starts rendering of the queued rib files"); ! putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_R)); ! } ! ! public void actionPerformed(ActionEvent e) { ! MainFrame.startRendering(); ! } ! ! } ! ! private class CancelRenderAction extends AbstractAction { ! public CancelRenderAction() { ! putValue(Action.NAME, "Cancel"); ! putValue(Action.SHORT_DESCRIPTION, "Cancel current rendering"); ! putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_C)); ! } ! ! public void actionPerformed(ActionEvent e) { ! runnable.setCanceled(true); ! taMessages.append("Canceling queue rendering..."); ! } ! } ! ! public void start(int startProgressValue, int endProgressValue) { ! pbProgress.setMinimum(startProgressValue); ! pbProgress.setMaximum(endProgressValue); ! pbProgress.setValue(startProgressValue); ! pbProgress.setStringPainted(true); ! taMessages.setText("Rendering of queued file(s) started.\n\n"); ! bRender.setAction(cancelRenderAction); ! // divert standard streams ! System.setOut(outRedirector); ! System.setErr(errRedirector); ! } ! ! public void setProgress(int value,String message) { ! pbProgress.setValue(value); ! pbProgress.setString(value + " file(s)"); ! taMessages.append("\n\n"); ! } ! ! public void end() { ! bRender.setAction(renderAction); ! pbProgress.setValue(0); ! pbProgress.setStringPainted(false); ! taMessages.append("\nRendering of queued files finished."); ! // restore standard streams ! System.setOut(oldOutStream); ! System.setErr(oldErrStream); ! } ! } Index: TextAreaPrintStream.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/TextAreaPrintStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TextAreaPrintStream.java 11 Feb 2004 16:16:51 -0000 1.1 --- TextAreaPrintStream.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,208 **** ! /* ! * TextAreaPrintStream.java Copyright (C) 2004 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! package org.jrman.ui; ! ! import java.io.IOException; ! import java.io.OutputStream; ! import java.io.PrintStream; ! ! import javax.swing.JTextArea; ! ! /** ! * A <code>PrintStream</code> that prints appending text into a <code>JTextArea</code>. ! * ! * @author Alessandro Falappa ! * @version $Revision$ ! */ ! public class TextAreaPrintStream extends PrintStream{ ! private JTextArea area; ! ! private static class NullOutputStream extends OutputStream{ ! /* (non-Javadoc) ! * @see java.io.OutputStream#write(int) ! */ ! public void write(int b) throws IOException { ! // do nothing ! } ! } ! ! /** ! * Constructs and initializes a TextAreaPrintStream object. ! * @param textArea the <code>JTextArea</code> object this stream will append text to ! */ ! public TextAreaPrintStream(JTextArea textArea) { ! super(new NullOutputStream()); ! if(textArea==null) ! throw new NullPointerException("textArea can't be null!"); ! this.area=textArea; ! } ! /* (non-Javadoc) ! * @see java.io.PrintStream#close() ! */ ! public void close(){ ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#flush() ! */ ! public void flush(){ ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#print(boolean) ! */ ! public void print(boolean b) { ! area.append(String.valueOf(b)); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#print(char) ! */ ! public void print(char c) { ! area.append(String.valueOf(c)); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#print(char[]) ! */ ! public void print(char[] s) { ! area.append(String.valueOf(s)); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#print(double) ! */ ! public void print(double d) { ! area.append(String.valueOf(d)); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#print(float) ! */ ! public void print(float f) { ! area.append(String.valueOf(f)); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#print(int) ! */ ! public void print(int i) { ! area.append(String.valueOf(i)); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#print(java.lang.Object) ! */ ! public void print(Object obj) { ! area.append(String.valueOf(obj)); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#print(java.lang.String) ! */ ! public void print(String s) { ! area.append(s); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#print(long) ! */ ! public void print(long l) { ! area.append(String.valueOf(l)); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#println() ! */ ! public void println() { ! area.append("\n"); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#println(boolean) ! */ ! public void println(boolean x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#println(char) ! */ ! public void println(char x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#println(char[]) ! */ ! public void println(char[] x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#println(double) ! */ ! public void println(double x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#println(float) ! */ ! public void println(float x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#println(int) ! */ ! public void println(int x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#println(java.lang.Object) ! */ ! public void println(Object x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#println(java.lang.String) ! */ ! public void println(String x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! /* (non-Javadoc) ! * @see java.io.PrintStream#println(long) ! */ ! public void println(long x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! } --- 1,147 ---- ! /* ! * TextAreaPrintStream.java Copyright (C) 2004 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! package org.jrman.ui; ! ! import java.io.IOException; ! import java.io.OutputStream; ! import java.io.PrintStream; ! ! import javax.swing.JTextArea; ! ! /** ! * A <code>PrintStream</code> that prints appending text into a <code>JTextArea</code>. ! * ! * @author Alessandro Falappa ! * @version $Revision$ ! */ ! public class TextAreaPrintStream extends PrintStream{ ! private JTextArea area; ! ! private static class NullOutputStream extends OutputStream{ ! /* (non-Javadoc) ! * @see java.io.OutputStream#write(int) ! */ ! public void write(int b) throws IOException { ! // do nothing ! } ! } ! ! /** ! * Constructs and initializes a TextAreaPrintStream object. ! * @param textArea the <code>JTextArea</code> object this stream ! * will append text to ! */ ! public TextAreaPrintStream(JTextArea textArea) { ! super(new NullOutputStream()); ! if(textArea==null) ! throw new NullPointerException("textArea can't be null!"); ! this.area=textArea; ! } ! ! public void close(){ ! } ! ! public void flush(){ ! } ! ! public void print(boolean b) { ! area.append(String.valueOf(b)); ! } ! ! public void print(char c) { ! area.append(String.valueOf(c)); ! } ! ! public void print(char[] s) { ! area.append(String.valueOf(s)); ! } ! ! public void print(double d) { ! area.append(String.valueOf(d)); ! } ! ! public void print(float f) { ! area.append(String.valueOf(f)); ! } ! ! public void print(int i) { ! area.append(String.valueOf(i)); ! } ! ! public void print(Object obj) { ! area.append(String.valueOf(obj)); ! } ! ! public void print(String s) { ! area.append(s); ! } ! ! public void print(long l) { ! area.append(String.valueOf(l)); ! } ! ! public void println() { ! area.append("\n"); ! } ! ! public void println(boolean x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! public void println(char x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! public void println(char[] x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! public void println(double x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! public void println(float x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! public void println(int x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! public void println(Object x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! public void println(String x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! public void println(long x) { ! area.append(String.valueOf(x)); ! area.append("\n"); ! } ! ! } Index: ProgressObserver.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/ProgressObserver.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProgressObserver.java 11 Feb 2004 16:16:51 -0000 1.1 --- ProgressObserver.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,49 **** ! /* ! * ProgressObserver.java Copyright (C) 2004 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! package org.jrman.ui; ! ! /** ! * Identifies an object interested in observing the progress of the ! * computation made by another object. ! * ! * @author Alessandro Falappa ! * @version $Revision$ ! */ ! public interface ProgressObserver { ! /** ! * Called when computation begins ! * @param startProgressValue the initial progress value ! * @param endProgressValue the last progress value ! */ ! void start(int startProgressValue, int endProgressValue); ! /** ! * Called periodically during the computation to indicate ! * the computation progress. ! * @param value the amount of progress, should go from ! * <code>startProgressValue</code> inclusive to <code>endProgressValue</code> ! * inclusive ! * @param message a descriptive message about the current step of the ! * computation, can be <code>null</code> ! * @see #start(int, int) ! */ ! void setProgress(int value,String message); ! /** ! * Called when computation ends ! */ ! void end(); ! } --- 1,50 ---- ! /* ! * ProgressObserver.java Copyright (C) 2004 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! package org.jrman.ui; ! ! /** ! * Identifies an object interested in observing the progress of the ! * computation made by another object. ! * ! * @author Alessandro Falappa ! * @version $Revision$ ! */ ! public interface ProgressObserver { ! /** ! * Called when computation begins ! * @param startProgressValue the initial progress value ! * @param endProgressValue the last progress value ! */ ! void start(int startProgressValue, int endProgressValue); ! /** ! * Called periodically during the computation to indicate ! * the computation progress. ! * @param value the amount of progress, should go from ! * <code>startProgressValue</code> inclusive to ! * <code>endProgressValue</code> ! * inclusive ! * @param message a descriptive message about the current step of the ! * computation, can be <code>null</code> ! * @see #start(int, int) ! */ ! void setProgress(int value,String message); ! /** ! * Called when computation ends ! */ ! void end(); ! } Index: AboutDialog.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/AboutDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AboutDialog.java 11 Feb 2004 16:16:51 -0000 1.1 --- AboutDialog.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,141 **** ! /* ! * AboutDialog.java Copyright (C) 2004 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! package org.jrman.ui; ! ! import java.awt.*; ! import java.awt.event.ActionEvent; ! import java.awt.event.KeyEvent; ! import java.io.IOException; ! import java.io.InputStreamReader; ! ! import javax.swing.*; ! ! import org.jrman.main.JRMan; ! ! import com.jgoodies.forms.builder.DefaultFormBuilder; ! import com.jgoodies.forms.factories.Borders; ! import com.jgoodies.forms.factories.ButtonBarFactory; ! import com.jgoodies.forms.layout.CellConstraints; ! import com.jgoodies.forms.layout.FormLayout; ! ! /** ! * The about dialog. ! * ! * @author Alessandro Falappa ! * @version $Revision$ ! */ ! public class AboutDialog extends JDialog { ! ! private final class CloseAction extends AbstractAction { ! public CloseAction(){ ! putValue(Action.MNEMONIC_KEY,new Integer(KeyEvent.VK_C)); ! putValue(Action.NAME,"Close"); ! putValue(Action.SHORT_DESCRIPTION,"Closes the dialog"); ! } ! public void actionPerformed(ActionEvent e) { ! dispose(); ! } ! }; ! private CloseAction closeAction=new CloseAction(); ! ! /** ! * Constructs and initializes a AboutDialog object. ! * @throws java.awt.HeadlessException ! */ ! public AboutDialog() throws HeadlessException { ! super(); ! commonInit(null); ! } ! ! /** ! * Constructs and initializes a AboutDialog object. ! * @param owner ! * @throws java.awt.HeadlessException ! */ ! public AboutDialog(Dialog owner) throws HeadlessException { ! super(owner); ! commonInit(owner); ! } ! ! /** ! * Constructs and initializes a AboutDialog object. ! * @param owner ! * @throws java.awt.HeadlessException ! */ ! public AboutDialog(Frame owner) throws HeadlessException { ! super(owner); ! commonInit(owner); ! } ! ! private void commonInit(Component parent) { ! setTitle("About"); ! // foremost about panel ! JLabel appName= new JLabel("JrManGUI v" + JRMan.majorNumber + "." + JRMan.minorNumber); ! appName.setFont(new Font("Sans Serif", Font.BOLD, 16)); ! JLabel logo= new JLabel(new ImageIcon(getClass().getResource("images/jrman_logo.png"))); ! logo.setBorder(BorderFactory.createEtchedBorder()); ! FormLayout layout= new FormLayout("pref:grow", "default:grow,pref, 6dlu,pref,default:grow"); ! DefaultFormBuilder builder= new DefaultFormBuilder(layout); ! CellConstraints cc= new CellConstraints(); ! builder.setBorder(Borders.TABBED_DIALOG_BORDER); ! builder.add(appName, cc.xy(1, 2)); ! builder.add(new JLabel("Graphical user interface frontend to JrMan"), cc.xy(1, 4)); ! JPanel pAbout= new JPanel(new BorderLayout()); ! pAbout.add(logo, BorderLayout.WEST); ! pAbout.add(builder.getPanel(), BorderLayout.CENTER); ! // authors panel ! JTextArea taAuthors= new JTextArea(8, 40); ! taAuthors.setEditable(false); ! try { ! taAuthors.read(new InputStreamReader(getClass().getResourceAsStream("texts/authors.txt")), null); ! } ! catch (IOException e1) { ! //ignored ! } ! JPanel pAuthors= new JPanel(new BorderLayout()); ! pAuthors.setBorder(Borders.TABBED_DIALOG_BORDER); ! pAuthors.add(new JScrollPane(taAuthors), BorderLayout.CENTER); ! // license panel ! JTextArea taLicense= new JTextArea(8, 40); ! taLicense.setEditable(false); ! try { ! taLicense.read(new InputStreamReader(getClass().getResourceAsStream("texts/disclaimer.txt")), null); ! } ! catch (IOException e2) { ! // ignored ! } ! JPanel pLicense= new JPanel(new BorderLayout()); ! pLicense.setBorder(Borders.TABBED_DIALOG_BORDER); ! pLicense.add(new JScrollPane(taLicense), BorderLayout.CENTER); ! // assemble ! JButton bClose= new JButton(closeAction); ! JTabbedPane tabbedPane= new JTabbedPane(); ! tabbedPane.setBorder(Borders.TABBED_DIALOG_BORDER); ! tabbedPane.add(pAbout, "About"); ! tabbedPane.add(pAuthors, "Authors"); ! tabbedPane.add(pLicense, "License"); ! setModal(true); ! setResizable(false); ! ((JComponent)getContentPane()).registerKeyboardAction(closeAction, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW); ! getContentPane().add(tabbedPane, BorderLayout.CENTER); ! getContentPane().add(ButtonBarFactory.buildCloseBar(bClose), BorderLayout.SOUTH); ! pack(); ! if (parent != null) ! setLocationRelativeTo(parent); ! } ! } --- 1,155 ---- ! /* ! * AboutDialog.java Copyright (C) 2004 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! package org.jrman.ui; ! ! import java.awt.*; ! import java.awt.event.ActionEvent; ! import java.awt.event.KeyEvent; ! import java.io.IOException; ! import java.io.InputStreamReader; ! ! import javax.swing.*; ! ! import org.jrman.main.JRMan; ! ! import com.jgoodies.forms.builder.DefaultFormBuilder; ! import com.jgoodies.forms.factories.Borders; ! import com.jgoodies.forms.factories.ButtonBarFactory; ! import com.jgoodies.forms.layout.CellConstraints; ! import com.jgoodies.forms.layout.FormLayout; ! ! /** ! * The about dialog. ! * ! * @author Alessandro Falappa ! * @version $Revision$ ! */ ! public class AboutDialog extends JDialog { ! ! private final class CloseAction extends AbstractAction { ! public CloseAction(){ ! putValue(Action.MNEMONIC_KEY,new Integer(KeyEvent.VK_C)); ! putValue(Action.NAME,"Close"); ! putValue(Action.SHORT_DESCRIPTION,"Closes the dialog"); ! } ! public void actionPerformed(ActionEvent e) { ! dispose(); ! } ! }; ! private CloseAction closeAction=new CloseAction(); ! ! /** ! * Constructs and initializes a AboutDialog object. ! * @throws java.awt.HeadlessException ! */ ! public AboutDialog() throws HeadlessException { ! super(); ! commonInit(null); ! } ! ! /** ! * Constructs and initializes a AboutDialog object. ! * @param owner ! * @throws java.awt.HeadlessException ! */ ! public AboutDialog(Dialog owner) throws HeadlessException { ! super(owner); ! commonInit(owner); ! } ! ! /** ! * Constructs and initializes a AboutDialog object. ! * @param owner ! * @throws java.awt.HeadlessException ! */ ! public AboutDialog(Frame owner) throws HeadlessException { ! super(owner); ! commonInit(owner); ! } ! ! private void commonInit(Component parent) { ! setTitle("About"); ! // foremost about panel ! JLabel appName= new JLabel("JrManGUI v" + JRMan.majorNumber + "." + ! JRMan.minorNumber); ! appName.setFont(new Font("Sans Serif", Font.BOLD, 16)); ! JLabel logo= new JLabel( ! new ImageIcon(getClass().getResource("images/jrman_logo.png"))); ! logo.setBorder(BorderFactory.createEtchedBorder()); ! FormLayout layout= ! new FormLayout("pref:grow", ! "default:grow,pref, 6dlu,pref,default:grow"); ! DefaultFormBuilder builder= new DefaultFormBuilder(layout); ! CellConstraints cc= new CellConstraints(); ! builder.setBorder(Borders.TABBED_DIALOG_BORDER); ! builder.add(appName, cc.xy(1, 2)); ! builder.add(new JLabel("Graphical user interface frontend to JrMan"), ! cc.xy(1, 4)); ! JPanel pAbout= new JPanel(new BorderLayout()); ! pAbout.add(logo, BorderLayout.WEST); ! pAbout.add(builder.getPanel(), BorderLayout.CENTER); ! // authors panel ! JTextArea taAuthors= new JTextArea(8, 40); ! taAuthors.setEditable(false); ! try { ! taAuthors.read(new InputStreamReader( ! getClass().getResourceAsStream("texts/authors.txt")), ! null); ! } ! catch (IOException e1) { ! //ignored ! } ! JPanel pAuthors= new JPanel(new BorderLayout()); ! pAuthors.setBorder(Borders.TABBED_DIALOG_BORDER); ! pAuthors.add(new JScrollPane(taAuthors), BorderLayout.CENTER); ! // license panel ! JTextArea taLicense= new JTextArea(8, 40); ! taLicense.setEditable(false); ! try { ! taLicense.read(new InputStreamReader( ! getClass().getResourceAsStream("texts/disclaimer.txt")), ! null); ! } ! catch (IOException e2) { ! // ignored ! } ! JPanel pLicense= new JPanel(new BorderLayout()); ! pLicense.setBorder(Borders.TABBED_DIALOG_BORDER); ! pLicense.add(new JScrollPane(taLicense), BorderLayout.CENTER); ! // assemble ! JButton bClose= new JButton(closeAction); ! JTabbedPane tabbedPane= new JTabbedPane(); ! tabbedPane.setBorder(Borders.TABBED_DIALOG_BORDER); ! tabbedPane.add(pAbout, "About"); ! tabbedPane.add(pAuthors, "Authors"); ! tabbedPane.add(pLicense, "License"); ! setModal(true); ! setResizable(false); ! ((JComponent)getContentPane()) ! .registerKeyboardAction(closeAction, ! KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, ! 0), ! JComponent.WHEN_IN_FOCUSED_WINDOW); ! getContentPane().add(tabbedPane, BorderLayout.CENTER); ! getContentPane().add(ButtonBarFactory.buildCloseBar(bClose), ! BorderLayout.SOUTH); ! pack(); ! if (parent != null) ! setLocationRelativeTo(parent); ! } ! } Index: OptionsPanel.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/OptionsPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OptionsPanel.java 11 Feb 2004 16:16:51 -0000 1.1 --- OptionsPanel.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,128 **** ! /* ! * OptionsPanel.java Copyright (C) 2004 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! package org.jrman.ui; ! ! import java.awt.event.ItemEvent; ! import java.awt.event.ItemListener; ! ! import javax.swing.*; ! ! import org.jrman.main.JRMan; ! ! import com.jgoodies.forms.builder.DefaultFormBuilder; ! import com.jgoodies.forms.factories.Borders; ! import com.jgoodies.forms.layout.FormLayout; ! ! /** ! * Manages a set of jrMan options. ! * <P> ! * Allowed options are those available on the command line. ! * @see org.jrman.main.JRMan ! * ! * @author Alessandro Falappa ! * @version $Revision$ ! */ ! public class OptionsPanel extends BasePanel { ! private JTextField tfCustomOpts= new JTextField(); ! private JCheckBox cbQuality= new JCheckBox(); ! private JCheckBox cbStatistics= new JCheckBox(); ! private JCheckBox cbShowFramebuffer= new JCheckBox(); ! private JCheckBox cbFrameSubset= new JCheckBox(); ! private JSpinner spStartFrame= new JSpinner(); ! private JSpinner spEndFrame= new JSpinner(); ! private JLabel lFrom= new JLabel(); ! private JLabel lTo= new JLabel(); ! ! /** ! * Constructs and initializes a OptionsPanel object. ! * ! */ ! public OptionsPanel() { ! setTitle("2 - Options"); ! // prepare components ! cbShowFramebuffer.setText("Always show a framebuffer display (-d)"); ! cbQuality.setText("Hi quality rendering (-q)"); ! cbStatistics.setText("End of frame statistics (-s)"); ! cbFrameSubset.setText("Render frame subset (-f,-e)"); ! cbFrameSubset.addItemListener(new ItemListener() { ! public void itemStateChanged(ItemEvent e) { ! boolean enabled= (e.getStateChange() == ItemEvent.SELECTED); ! spStartFrame.setEnabled(enabled); ! spEndFrame.setEnabled(enabled); ! lFrom.setEnabled(enabled); ! lTo.setEnabled(enabled); ! } ! }); ! spStartFrame.setModel(new SpinnerNumberModel(1, 1, 9999, 1)); ! ((JSpinner.DefaultEditor)spStartFrame.getEditor()).getTextField().setColumns(4); ! spStartFrame.setEnabled(false); ! spEndFrame.setModel(new SpinnerNumberModel(1, 1, 9999, 1)); ! ((JSpinner.DefaultEditor)spEndFrame.getEditor()).getTextField().setColumns(4); ! spEndFrame.setEnabled(false); ! lFrom.setText("from"); ! lFrom.setEnabled(false); ! lTo.setText("to"); ! lTo.setEnabled(false); ! // set layout and fill the panel ! FormLayout layout= new FormLayout("12dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, pref:grow"); ! DefaultFormBuilder builder= new DefaultFormBuilder(this, layout); ! builder.setBorder(Borders.TABBED_DIALOG_BORDER); ! builder.append(createInfoLabel("Set rendering options"), 9); ! builder.append(cbShowFramebuffer, 9); ! builder.append(cbQuality, 9); ! builder.append(cbStatistics, 9); ! builder.nextLine(); ! builder.appendUnrelatedComponentsGapRow(); ! builder.nextLine(); ! builder.append(cbFrameSubset, 9); ! builder.setLeadingColumnOffset(1); ! builder.append(lFrom); ! builder.append(spStartFrame); ! builder.append(lTo); ! builder.append(spEndFrame); ! builder.nextLine(); ! builder.setLeadingColumnOffset(0); ! builder.appendUnrelatedComponentsGapRow(); ! builder.nextLine(); ! builder.append(new JLabel("Other commandline options:"), 8); ! builder.nextLine(); ! builder.append(tfCustomOpts, 9); ! builder.nextLine(); ! } ! ! /** ! * Builds an options string with the options set by the user in this panel. ! * @return the options string ready to be passed to the command line renderer ! */ ! public String getOptionsString() { ! StringBuffer sb= new StringBuffer(); ! if (cbQuality.isSelected()) ! sb.append('-').append(JRMan.OPTION_QUALITY).append(' '); ! if (cbShowFramebuffer.isSelected()) ! sb.append('-').append(JRMan.OPTION_FRAMEBUFFER).append(' '); ! if (cbStatistics.isSelected()) ! sb.append('-').append(JRMan.OPTION_STATISTICS).append(' '); ! if (cbFrameSubset.isSelected()) { ! sb.append('-').append(JRMan.OPTION_FIRSTFRAME).append(' ').append(spStartFrame.getValue()); ! sb.append(" -").append(JRMan.OPTION_LASTFRAME).append(' ').append(spEndFrame.getValue()); ! } ! if (tfCustomOpts.getText().length() > 0) ! sb.append(' ').append(tfCustomOpts.getText()); ! return sb.toString().trim(); ! } ! } --- 1,135 ---- ! /* ! * OptionsPanel.java Copyright (C) 2004 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! package org.jrman.ui; ! ! import java.awt.event.ItemEvent; ! import java.awt.event.ItemListener; ! ! import javax.swing.*; ! ! import org.jrman.main.JRMan; ! ! import com.jgoodies.forms.builder.DefaultFormBuilder; ! import com.jgoodies.forms.factories.Borders; ! import com.jgoodies.forms.layout.FormLayout; ! ! /** ! * Manages a set of jrMan options. ! * <P> ! * Allowed options are those available on the command line. ! * @see org.jrman.main.JRMan ! * ! * @author Alessandro Falappa ! * @version $Revision$ ! */ ! public class OptionsPanel extends BasePanel { ! private JTextField tfCustomOpts= new JTextField(); ! private JCheckBox cbQuality= new JCheckBox(); ! private JCheckBox cbStatistics= new JCheckBox(); ! private JCheckBox cbShowFramebuffer= new JCheckBox(); ! private JCheckBox cbFrameSubset= new JCheckBox(); ! private JSpinner spStartFrame= new JSpinner(); ! private JSpinner spEndFrame= new JSpinner(); ! private JLabel lFrom= new JLabel(); ! private JLabel lTo= new JLabel(); ! ! /** ! * Constructs and initializes a OptionsPanel object. ! * ! */ ! public OptionsPanel() { ! setTitle("2 - Options"); ! // prepare components ! cbShowFramebuffer.setText("Always show a framebuffer display (-d)"); ! cbQuality.setText("Hi quality rendering (-q)"); ! cbStatistics.setText("End of frame statistics (-s)"); ! cbFrameSubset.setText("Render frame subset (-f,-e)"); ! cbFrameSubset.addItemListener(new ItemListener() { ! public void itemStateChanged(ItemEvent e) { ! boolean enabled= (e.getStateChange() == ItemEvent.SELECTED); ! spStartFrame.setEnabled(enabled); ! spEndFrame.setEnabled(enabled); ! lFrom.setEnabled(enabled); ! lTo.setEnabled(enabled); ! } ! }); ! spStartFrame.setModel(new SpinnerNumberModel(1, 1, 9999, 1)); ! ((JSpinner.DefaultEditor)spStartFrame.getEditor()) ! .getTextField().setColumns(4); ! spStartFrame.setEnabled(false); ! spEndFrame.setModel(new SpinnerNumberModel(1, 1, 9999, 1)); ! ((JSpinner.DefaultEditor)spEndFrame.getEditor()) ! .getTextField().setColumns(4); ! spEndFrame.setEnabled(false); ! lFrom.setText("from"); ! lFrom.setEnabled(false); ! lTo.setText("to"); ! lTo.setEnabled(false); ! // set layout and fill the panel ! FormLayout layout= new ! FormLayout("12dlu, pref, 3dlu, pref, 3dlu, pref," + ! " 3dlu, pref, pref:grow"); ! DefaultFormBuilder builder= new DefaultFormBuilder(this, layout); ! builder.setBorder(Borders.TABBED_DIALOG_BORDER); ! builder.append(createInfoLabel("Set rendering options"), 9); ! builder.append(cbShowFramebuffer, 9); ! builder.append(cbQuality, 9); ! builder.append(cbStatistics, 9); ! builder.nextLine(); ! builder.appendUnrelatedComponentsGapRow(); ! builder.nextLine(); ! builder.append(cbFrameSubset, 9); ! builder.setLeadingColumnOffset(1); ! builder.append(lFrom); ! builder.append(spStartFrame); ! builder.append(lTo); ! builder.append(spEndFrame); ! builder.nextLine(); ! builder.setLeadingColumnOffset(0); ! builder.appendUnrelatedComponentsGapRow(); ! builder.nextLine(); ! builder.append(new JLabel("Other commandline options:"), 8); ! builder.nextLine(); ! builder.append(tfCustomOpts, 9); ! builder.nextLine(); ! } ! ! /** ! * Builds an options string with the options set by the user in this panel. ! * @return the options string ready to be passed to the command line ! * renderer ! */ ! public String getOptionsString() { ! StringBuffer sb= new StringBuffer(); ! if (cbQuality.isSelected()) ! sb.append('-').append(JRMan.OPTION_QUALITY).append(' '); ! if (cbShowFramebuffer.isSelected()) ! ... [truncated message content] |
From: Gerardo H. <ma...@us...> - 2007-02-28 00:02:52
|
Update of /cvsroot/jrman/drafts/src/net/falappa/swing/widgets In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4501/src/net/falappa/swing/widgets Modified Files: JImageViewerPanel.java Log Message: Finished reformatting code :) Code is almost 100% clean (no more hideous Eclipse formatting, no tabs, no line longer than 80 columns, no CR/LF) Index: JImageViewerPanel.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/swing/widgets/JImageViewerPanel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JImageViewerPanel.java 27 Dec 2006 16:30:19 -0000 1.6 --- JImageViewerPanel.java 28 Feb 2007 00:02:40 -0000 1.7 *************** *** 1,908 **** ! //Chicchi ! //Copyright (C) 2003, Alessandro Falappa ! // ! //Contact: ale...@fa... ! // ! //This library is free software; you can redistribute it and/or ! //modify it under the terms of the GNU General Public ! //License as published by the Free Software Foundation; either ! //version 2 of the License, or (at your option) any later version. ! // [...1787 lines suppressed...] ! // method of Scrollable interface ! public boolean getScrollableTracksViewportHeight() { ! return false; ! } ! ! /** ! * @return ! */ ! boolean isShowTransparencyPattern() { ! return showTransparencyPattern; ! } ! ! /** ! * @param b ! */ ! void setShowTransparencyPattern(boolean b) { ! showTransparencyPattern= b; ! } ! ! } |
From: Gerardo H. <ma...@us...> - 2007-02-28 00:02:49
|
Update of /cvsroot/jrman/drafts/src/org/jrman/util In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4501/src/org/jrman/util Modified Files: BoxSamplesFilter.java Calc.java CatmullRomSamplesFilter.java Constants.java Format.java GaussianSamplesFilter.java NullList.java PerlinNoise.java Rand.java SamplesFilter.java SincSamplesFilter.java TriangleSamplesFilter.java Log Message: Finished reformatting code :) Code is almost 100% clean (no more hideous Eclipse formatting, no tabs, no line longer than 80 columns, no CR/LF) Index: Rand.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/Rand.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Rand.java 27 Nov 2003 15:50:34 -0000 1.2 --- Rand.java 28 Feb 2007 00:02:41 -0000 1.3 *************** *** 1,19 **** /* ! Rand.java ! Copyright (C) 1995,1996, 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Rand.java ! Copyright (C) 1995,1996, 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: TriangleSamplesFilter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/TriangleSamplesFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TriangleSamplesFilter.java 26 Jun 2003 04:10:45 -0000 1.1 --- TriangleSamplesFilter.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! TriangleSamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! TriangleSamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 23,27 **** protected float filterFunc(float x, float y, float xWidth, float yWidth) { ! return ((1f - Math.abs(x)) / (xWidth * .5f)) * ((1f - Math.abs(y)) / (yWidth * .5f)); } --- 23,28 ---- protected float filterFunc(float x, float y, float xWidth, float yWidth) { ! return ((1f - Math.abs(x)) / (xWidth * .5f)) * ! ((1f - Math.abs(y)) / (yWidth * .5f)); } Index: Format.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/Format.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Format.java 3 Jun 2003 05:19:08 -0000 1.2 --- Format.java 28 Feb 2007 00:02:41 -0000 1.3 *************** *** 1,19 **** /* ! Format.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Format.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: BoxSamplesFilter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/BoxSamplesFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BoxSamplesFilter.java 26 Jun 2003 04:10:45 -0000 1.1 --- BoxSamplesFilter.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! BoxSamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! BoxSamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: SincSamplesFilter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/SincSamplesFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SincSamplesFilter.java 26 Jun 2003 04:10:45 -0000 1.1 --- SincSamplesFilter.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! SincSamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! SincSamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: NullList.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/NullList.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullList.java 16 Sep 2004 05:07:09 -0000 1.1 --- NullList.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! NullList.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! NullList.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: Constants.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/Constants.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Constants.java 9 Apr 2003 15:50:04 -0000 1.1 --- Constants.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! Constants.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Constants.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: CatmullRomSamplesFilter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/CatmullRomSamplesFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CatmullRomSamplesFilter.java 26 Jun 2003 04:10:45 -0000 1.1 --- CatmullRomSamplesFilter.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! CatmullRomSamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! CatmullRomSamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 25,29 **** float r2 = (x * x + y * y); float r = (float) Math.sqrt(r2); ! return (r >= 2f) ? 0f : (r < 1f) ? (3f * r * r2 - 5f * r2 + 2f) : (-r * r2 + 5f * r2 - 8f * r + 4); } --- 25,30 ---- float r2 = (x * x + y * y); float r = (float) Math.sqrt(r2); ! return (r >= 2f) ? 0f : (r < 1f) ? ! (3f * r * r2 - 5f * r2 + 2f) : (-r * r2 + 5f * r2 - 8f * r + 4); } Index: GaussianSamplesFilter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/GaussianSamplesFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GaussianSamplesFilter.java 25 Jun 2003 17:14:05 -0000 1.1 --- GaussianSamplesFilter.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! GaussianSamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! GaussianSamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: Calc.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/Calc.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Calc.java 8 Apr 2004 21:03:33 -0000 1.17 --- Calc.java 28 Feb 2007 00:02:41 -0000 1.18 *************** *** 1,19 **** /* ! Calc.java ! Copyright (C) 2003, 2004 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Calc.java ! Copyright (C) 2003, 2004 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 119,129 **** } ! public static float interpolate( ! float a00, ! float a10, ! float a01, ! float a11, ! float alphaU, ! float alphaV) { return interpolate( interpolate(a00, a10, alphaU), --- 119,125 ---- } ! public static float interpolate(float a00, float a10, ! float a01, float a11, ! float alphaU, float alphaV) { return interpolate( interpolate(a00, a10, alphaU), *************** *** 132,136 **** } ! public static void interpolate(Tuple3f a, Tuple3f b, float alpha, Tuple3f result) { result.interpolate(a, b, alpha); } --- 128,133 ---- } ! public static void interpolate(Tuple3f a, Tuple3f b, float alpha, ! Tuple3f result) { result.interpolate(a, b, alpha); } *************** *** 156,166 **** } ! public static Matrix4f interpolate( ! Matrix4f a00, ! Matrix4f a10, ! Matrix4f a01, ! Matrix4f a11, ! float alphaU, ! float alphaV) { return interpolate( interpolate(a00, a10, alphaU), --- 153,159 ---- } ! public static Matrix4f interpolate(Matrix4f a00, Matrix4f a10, ! Matrix4f a01, Matrix4f a11, ! float alphaU, float alphaV) { return interpolate( interpolate(a00, a10, alphaU), *************** *** 169,173 **** } ! public static float bezierInterpolate(float p1, float p2, float p3, float p4, float u) { float oneMinusU = 1f - u; return oneMinusU * oneMinusU * oneMinusU * p1 --- 162,167 ---- } ! public static float bezierInterpolate(float p1, float p2, float p3, ! float p4, float u) { float oneMinusU = 1f - u; return oneMinusU * oneMinusU * oneMinusU * p1 *************** *** 178,199 **** public static float bezierInterpolate( ! float p00, ! float p10, ! float p20, ! float p30, ! float p01, ! float p11, ! float p21, ! float p31, ! float p02, ! float p12, ! float p22, ! float p32, ! float p03, ! float p13, ! float p23, ! float p33, ! float u, ! float v) { return bezierInterpolate( bezierInterpolate(p00, p10, p20, p30, u), --- 172,180 ---- public static float bezierInterpolate( ! float p00, float p10, float p20, float p30, ! float p01, float p11, float p21, float p31, ! float p02, float p12, float p22, float p32, ! float p03, float p13, float p23, float p33, ! float u, float v) { return bezierInterpolate( bezierInterpolate(p00, p10, p20, p30, u), *************** *** 204,214 **** } ! public static void bezierInterpolate( ! Tuple3f p1, ! Tuple3f p2, ! Tuple3f p3, ! Tuple3f p4, ! float u, ! Tuple3f result) { result.x = bezierInterpolate(p1.x, p2.x, p3.x, p4.x, u); result.y = bezierInterpolate(p1.y, p2.y, p3.y, p4.y, u); --- 185,191 ---- } ! public static void bezierInterpolate(Tuple3f p1, Tuple3f p2, ! Tuple3f p3, Tuple3f p4, ! float u, Tuple3f result) { result.x = bezierInterpolate(p1.x, p2.x, p3.x, p4.x, u); result.y = bezierInterpolate(p1.y, p2.y, p3.y, p4.y, u); *************** *** 216,226 **** } ! public static void bezierInterpolate( ! Tuple4f p1, ! Tuple4f p2, ! Tuple4f p3, ! Tuple4f p4, ! float u, ! Tuple4f result) { result.x = bezierInterpolate(p1.x, p2.x, p3.x, p4.x, u); result.y = bezierInterpolate(p1.y, p2.y, p3.y, p4.y, u); --- 193,199 ---- } ! public static void bezierInterpolate(Tuple4f p1, Tuple4f p2, ! Tuple4f p3, Tuple4f p4, ! float u, Tuple4f result) { result.x = bezierInterpolate(p1.x, p2.x, p3.x, p4.x, u); result.y = bezierInterpolate(p1.y, p2.y, p3.y, p4.y, u); *************** *** 230,252 **** public static void bezierInterpolate( ! Tuple3f p00, ! Tuple3f p10, ! Tuple3f p20, ! Tuple3f p30, ! Tuple3f p01, ! Tuple3f p11, ! Tuple3f p21, ! Tuple3f p31, ! Tuple3f p02, ! Tuple3f p12, ! Tuple3f p22, ! Tuple3f p32, ! Tuple3f p03, ! Tuple3f p13, ! Tuple3f p23, ! Tuple3f p33, ! float u, ! float v, ! Tuple3f result) { bezierInterpolate(p00, p10, p20, p30, u, tmpP0); bezierInterpolate(p01, p11, p21, p31, u, tmpP1); --- 203,211 ---- public static void bezierInterpolate( ! Tuple3f p00, Tuple3f p10, Tuple3f p20, Tuple3f p30, ! Tuple3f p01, Tuple3f p11, Tuple3f p21, Tuple3f p31, ! Tuple3f p02, Tuple3f p12, Tuple3f p22, Tuple3f p32, ! Tuple3f p03, Tuple3f p13, Tuple3f p23, Tuple3f p33, ! float u, float v, Tuple3f result) { bezierInterpolate(p00, p10, p20, p30, u, tmpP0); bezierInterpolate(p01, p11, p21, p31, u, tmpP1); *************** *** 258,280 **** public static void bezierInterpolate( ! Tuple4f p00, ! Tuple4f p10, ! Tuple4f p20, ! Tuple4f p30, ! Tuple4f p01, ! Tuple4f p11, ! Tuple4f p21, ! Tuple4f p31, ! Tuple4f p02, ! Tuple4f p12, ! Tuple4f p22, ! Tuple4f p32, ! Tuple4f p03, ! Tuple4f p13, ! Tuple4f p23, ! Tuple4f p33, ! float u, ! float v, ! Tuple4f result) { bezierInterpolate(p00, p10, p20, p30, u, tmpHP0); bezierInterpolate(p01, p11, p21, p31, u, tmpHP1); --- 217,225 ---- public static void bezierInterpolate( ! Tuple4f p00, Tuple4f p10, Tuple4f p20, Tuple4f p30, ! Tuple4f p01, Tuple4f p11, Tuple4f p21, Tuple4f p31, ! Tuple4f p02, Tuple4f p12, Tuple4f p22, Tuple4f p32, ! Tuple4f p03, Tuple4f p13, Tuple4f p23, Tuple4f p33, ! float u, float v, Tuple4f result) { bezierInterpolate(p00, p10, p20, p30, u, tmpHP0); bezierInterpolate(p01, p11, p21, p31, u, tmpHP1); Index: SamplesFilter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/SamplesFilter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SamplesFilter.java 6 Jan 2004 10:59:39 -0000 1.3 --- SamplesFilter.java 28 Feb 2007 00:02:41 -0000 1.4 *************** *** 1,19 **** /* ! SamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! SamplesFilter.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 35,39 **** protected float oneOverAmplitudeSum; ! protected abstract float filterFunc(float x, float y, float xWidth, float yWidth); public void init(int width, int height, float xWidth, float yWidth) { --- 35,40 ---- protected float oneOverAmplitudeSum; ! protected abstract float filterFunc(float x, float y, ! float xWidth, float yWidth); public void init(int width, int height, float xWidth, float yWidth) { *************** *** 57,96 **** } - /* - public void doFilter( - float[] src, - int srcOffset, - int srcRowLength, - float[] dst, - int dstOffset, - int dstRowLength, - int colCount, - int rowCount, - int horizontalStep, - int verticalStep, - int bandCount) { - for (int row = 0; row < rowCount; row++) - for (int col = 0; col < colCount; col++) - for (int band = 0; band < bandCount; band++) { - float sum = 0f; - int amplitudeOffset = 0; - for (int sampleRow = 0; sampleRow < height; sampleRow++) - for (int sampleCol = 0; sampleCol < width; sampleCol++) { - int offset = - srcOffset - + (srcRowLength * (row * verticalStep + sampleRow) - + col * horizontalStep - + sampleCol) - * bandCount - + band; - // int amplitudeOffset = sampleRow * width + sampleCol; - sum += src[offset] * amplitude[amplitudeOffset++]; - } - sum /= amplitudeSum; - dst[dstOffset + (dstRowLength * row + col) * bandCount + band] = sum; - } - } - */ - public void doFilter( float[] src, --- 58,61 ---- *************** *** 118,122 **** for (int sampleRow = 0; sampleRow < height; sampleRow++) { int offset = rowOffset; ! for (int sampleCol = 0; sampleCol < width; sampleCol++) { sum += src[offset] * amplitude[amplitudeOffset++]; offset += bandCount; --- 83,88 ---- for (int sampleRow = 0; sampleRow < height; sampleRow++) { int offset = rowOffset; ! for (int sampleCol = 0; sampleCol < width; ! sampleCol++) { sum += src[offset] * amplitude[amplitudeOffset++]; offset += bandCount; *************** *** 125,129 **** } sum *= oneOverAmplitudeSum; ! dst[dstOffset + (dstRowLength * row + col) * bandCount + band] = sum; } colStart += colStartIncr; --- 91,96 ---- } sum *= oneOverAmplitudeSum; ! dst[dstOffset + (dstRowLength * row + col) * bandCount + ! band] = sum; } colStart += colStartIncr; *************** *** 133,137 **** } ! private int getValue(byte[] src, int s, int t, int size, Mode sMode, Mode tMode, int band) { if (s < 0 || s >= size) { if (sMode == MipMap.Mode.BLACK) --- 100,105 ---- } ! private int getValue(byte[] src, int s, int t, int size, ! Mode sMode, Mode tMode, int band) { if (s < 0 || s >= size) { if (sMode == MipMap.Mode.BLACK) *************** *** 169,176 **** float sum = 0f; for (int sampleRow = 0; sampleRow < height; sampleRow++) ! for (int sampleCol = 0; sampleCol < width; sampleCol++) { ! int srcRow = row * verticalStep + sampleRow - height / 2; ! int srcCol = col * horizontalStep + sampleCol - width / 2; ! int value = getValue(src, srcCol, srcRow, srcSize, sMode, tMode, band); int amplitudeOffset = sampleRow * width + sampleCol; sum += value * amplitude[amplitudeOffset]; --- 137,148 ---- float sum = 0f; for (int sampleRow = 0; sampleRow < height; sampleRow++) ! for (int sampleCol = 0; sampleCol < width; ! sampleCol++) { ! int srcRow = row * verticalStep + ! sampleRow - height / 2; ! int srcCol = col * horizontalStep + ! sampleCol - width / 2; ! int value = getValue(src, srcCol, srcRow, ! srcSize, sMode, tMode, band); int amplitudeOffset = sampleRow * width + sampleCol; sum += value * amplitude[amplitudeOffset]; Index: PerlinNoise.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/PerlinNoise.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PerlinNoise.java 13 Jan 2004 09:46:56 -0000 1.3 --- PerlinNoise.java 28 Feb 2007 00:02:41 -0000 1.4 *************** *** 1,547 **** ! /* ! PerlinNoise.java Copyright (C) 2003 Alessandro Falappa ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of [...1035 lines suppressed...] ! 243, ! 141, ! 128, ! 195, ! 78, ! 66, ! 215, ! 61, ! 156, ! 180 }; ! static { ! for (int i= 0; i < 256; i++) ! p[256 + i]= p[i]= permutation[i]; ! } ! ! // prevent instantiation ! private PerlinNoise() { ! } ! ! } |
From: Gerardo H. <ma...@us...> - 2007-02-28 00:02:49
|
Update of /cvsroot/jrman/drafts/src/org/jrman/sl In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4501/src/org/jrman/sl Modified Files: FloatGridValue.java FloatValue.java Tuple3fGridValue.java Tuple3fValue.java Value.java Log Message: Finished reformatting code :) Code is almost 100% clean (no more hideous Eclipse formatting, no tabs, no line longer than 80 columns, no CR/LF) Index: FloatValue.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/sl/FloatValue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FloatValue.java 8 Nov 2003 17:24:39 -0000 1.1 --- FloatValue.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! FloatValue.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! FloatValue.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: Tuple3fGridValue.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/sl/Tuple3fGridValue.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Tuple3fGridValue.java 25 Nov 2003 16:34:08 -0000 1.2 --- Tuple3fGridValue.java 28 Feb 2007 00:02:41 -0000 1.3 *************** *** 1,19 **** /* ! Tuple3fGridValue.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Tuple3fGridValue.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: Value.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/sl/Value.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Value.java 8 Nov 2003 17:24:39 -0000 1.1 --- Value.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! Value.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Value.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: FloatGridValue.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/sl/FloatGridValue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FloatGridValue.java 8 Nov 2003 17:24:39 -0000 1.1 --- FloatGridValue.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! FloatGridValue.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! FloatGridValue.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 64,68 **** return new FloatGridValue(fg); } ! throw new UnsupportedOperationException("reverseAdd: " + other.getClass()); } --- 64,69 ---- return new FloatGridValue(fg); } ! throw new UnsupportedOperationException("reverseAdd: " + ! other.getClass()); } *************** *** 96,100 **** return new FloatGridValue(fg); } ! throw new UnsupportedOperationException("reverseSub: " + other.getClass()); } --- 97,102 ---- return new FloatGridValue(fg); } ! throw new UnsupportedOperationException("reverseSub: " + ! other.getClass()); } *************** *** 128,132 **** return new FloatGridValue(fg); } ! throw new UnsupportedOperationException("reverseMul: " + other.getClass()); } --- 130,135 ---- return new FloatGridValue(fg); } ! throw new UnsupportedOperationException("reverseMul: " + ! other.getClass()); } *************** *** 160,164 **** return new FloatGridValue(fg); } ! throw new UnsupportedOperationException("reverseDiv: " + other.getClass()); } --- 163,168 ---- return new FloatGridValue(fg); } ! throw new UnsupportedOperationException("reverseDiv: " + ! other.getClass()); } Index: Tuple3fValue.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/sl/Tuple3fValue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Tuple3fValue.java 8 Nov 2003 17:24:39 -0000 1.1 --- Tuple3fValue.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! Tuple3fValue.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Tuple3fValue.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 62,66 **** } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseAdd(this, cond); } --- 62,67 ---- } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = ! Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseAdd(this, cond); } *************** *** 83,90 **** } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseAdd(this, cond); } ! throw new UnsupportedOperationException("reverseAdd: " + other.getClass()); } --- 84,93 ---- } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = ! Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseAdd(this, cond); } ! throw new UnsupportedOperationException("reverseAdd: " + ! other.getClass()); } *************** *** 104,108 **** } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseSub(this, cond); } --- 107,112 ---- } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = ! Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseSub(this, cond); } *************** *** 125,132 **** } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.sub(this, cond); } ! throw new UnsupportedOperationException("reverseSub: " + other.getClass()); } --- 129,138 ---- } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = ! Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.sub(this, cond); } ! throw new UnsupportedOperationException("reverseSub: " + ! other.getClass()); } *************** *** 149,153 **** } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseMul(this, cond); } --- 155,160 ---- } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = ! Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseMul(this, cond); } *************** *** 173,180 **** } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseMul(this, cond); } ! throw new UnsupportedOperationException("reverseMul: " + other.getClass()); } --- 180,189 ---- } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = ! Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseMul(this, cond); } ! throw new UnsupportedOperationException("reverseMul: " + ! other.getClass()); } *************** *** 197,201 **** } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseDiv(this, cond); } --- 206,211 ---- } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = ! Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.reverseDiv(this, cond); } *************** *** 221,228 **** } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.div(this, cond); } ! throw new UnsupportedOperationException("reverseDiv: " + other.getClass()); } --- 231,240 ---- } if (other instanceof FloatGridValue) { ! Tuple3fGridValue t3fgv = ! Tuple3fGridValue.cast((FloatGridValue) other); return t3fgv.div(this, cond); } ! throw new UnsupportedOperationException("reverseDiv: " + ! other.getClass()); } |
Update of /cvsroot/jrman/drafts/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4501/src Modified Files: DisplacementBumptest.java DisplacementDented.java DisplacementDisp_textured.java DisplacementNoisetest.java DisplacementTurbulence.java GenCapsules.java GenCubes.java GenPoints.java GenSpheres.java SurfaceAlphaplastic.java SurfaceClouds.java SurfaceConfetti.java SurfaceGlow.java SurfaceNoisetest.java SurfacePnoisetest.java SurfaceRandomcheckers.java SurfaceRandomcolors.java SurfaceTurbulence.java SurfaceUvcheckers.java Log Message: Finished reformatting code :) Code is almost 100% clean (no more hideous Eclipse formatting, no tabs, no line longer than 80 columns, no CR/LF) Index: SurfaceUvcheckers.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceUvcheckers.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceUvcheckers.java 13 Jan 2004 09:49:16 -0000 1.1 --- SurfaceUvcheckers.java 28 Feb 2007 00:02:40 -0000 1.2 *************** *** 1,69 **** ! /* ! * SurfaceRandomcheckers.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.grid.Color3fGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.SurfaceShader; ! ! public class SurfaceUvcheckers extends SurfaceShader { ! private static Vector3fGrid vg1= new Vector3fGrid(); ! private static Color3fGrid cg1= new Color3fGrid(); ! private static Color3fGrid cg2= new Color3fGrid(); ! private static Color3fGrid cg3= new Color3fGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Ka", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Kd", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("usize", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("vsize", "uniform float"), 1f)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKa= (UniformScalarFloat)getParameter(sv, "Ka"); ! final float Ka= paramKa.getValue(); ! UniformScalarFloat paramKd= (UniformScalarFloat)getParameter(sv, "Kd"); ! final float Kd= paramKd.getValue(); ! UniformScalarFloat paramUsize= (UniformScalarFloat)getParameter(sv, "usize"); ! final float usize= paramUsize.getValue(); ! UniformScalarFloat paramVsize= (UniformScalarFloat)getParameter(sv, "vsize"); ! final float vsize= paramVsize.getValue(); ! vg1.normalize(sv.N); ! vg1.faceforward(vg1, sv.I); ! sv.Oi.set(sv.Os); ! ambient(sv, cg1); ! cg3.set(Ka); ! cg1.mul(cg1, cg3); ! diffuse(sv, vg1, cg2); ! cg3.set(Kd); ! cg2.mul(cg2, cg3); ! cg1.add(cg1, cg2); ! ! // if(sv.u) ! // vg1.set(noisescale); ! // vg1.mul(vg1, sv.P); ! // cg3.cellnoise(vg1); ! ! cg1.mul(cg1, cg3); ! sv.Ci.mul(sv.Os, cg1); ! } ! ! } --- 1,81 ---- ! /* ! * SurfaceUvcheckers.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.grid.Color3fGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.SurfaceShader; ! ! public class SurfaceUvcheckers extends SurfaceShader { ! private static Vector3fGrid vg1= new Vector3fGrid(); ! private static Color3fGrid cg1= new Color3fGrid(); ! private static Color3fGrid cg2= new Color3fGrid(); ! private static Color3fGrid cg3= new Color3fGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Ka", "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Kd", "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("usize", ! "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("vsize", ! "uniform float"), ! 1f)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKa= (UniformScalarFloat)getParameter(sv, "Ka"); ! final float Ka= paramKa.getValue(); ! UniformScalarFloat paramKd= (UniformScalarFloat)getParameter(sv, "Kd"); ! final float Kd= paramKd.getValue(); ! UniformScalarFloat paramUsize= ! (UniformScalarFloat)getParameter(sv, "usize"); ! final float usize= paramUsize.getValue(); ! UniformScalarFloat paramVsize= ! (UniformScalarFloat)getParameter(sv, "vsize"); ! final float vsize= paramVsize.getValue(); ! vg1.normalize(sv.N); ! vg1.faceforward(vg1, sv.I); ! sv.Oi.set(sv.Os); ! ambient(sv, cg1); ! cg3.set(Ka); ! cg1.mul(cg1, cg3); ! diffuse(sv, vg1, cg2); ! cg3.set(Kd); ! cg2.mul(cg2, cg3); ! cg1.add(cg1, cg2); ! ! // if(sv.u) ! // vg1.set(noisescale); ! // vg1.mul(vg1, sv.P); ! // cg3.cellnoise(vg1); ! ! cg1.mul(cg1, cg3); ! sv.Ci.mul(sv.Os, cg1); ! } ! ! } Index: GenCapsules.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/GenCapsules.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenCapsules.java 15 May 2003 03:15:32 -0000 1.1 --- GenCapsules.java 28 Feb 2007 00:02:40 -0000 1.2 *************** *** 1,19 **** /* ! GenCapsules.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! GenCapsules.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: GenSpheres.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/GenSpheres.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenSpheres.java 5 May 2003 02:17:40 -0000 1.1 --- GenSpheres.java 28 Feb 2007 00:02:40 -0000 1.2 *************** *** 1,19 **** /* ! GenSpheres.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! GenSpheres.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 28,32 **** for (int j = 0; j < m; j++) { System.out.println("TransformBegin"); ! System.out.println("Color " + Math.random() + " " + Math.random() + " " + Math.random()); System.out.println("Translate " + x + " 0 " + z); System.out.println("Sphere .5 -5 .5 360"); --- 28,33 ---- for (int j = 0; j < m; j++) { System.out.println("TransformBegin"); ! System.out.println("Color " + Math.random() + " " + ! Math.random() + " " + Math.random()); System.out.println("Translate " + x + " 0 " + z); System.out.println("Sphere .5 -5 .5 360"); Index: SurfaceGlow.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceGlow.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SurfaceGlow.java 1 Jun 2003 16:59:50 -0000 1.2 --- SurfaceGlow.java 28 Feb 2007 00:02:40 -0000 1.3 *************** *** 1,10 **** - import javax.vecmath.Color3f; - - import org.jrman.grid.BooleanGrid; - import org.jrman.grid.Color3fGrid; - import org.jrman.grid.FloatGrid; - import org.jrman.render.ShaderVariables; - import org.jrman.shaders.SurfaceShader; - /* SurfaceGlow.java --- 1,2 ---- *************** *** 26,29 **** --- 18,29 ---- */ + import javax.vecmath.Color3f; + + import org.jrman.grid.BooleanGrid; + import org.jrman.grid.Color3fGrid; + import org.jrman.grid.FloatGrid; + import org.jrman.render.ShaderVariables; + import org.jrman.shaders.SurfaceShader; + public class SurfaceGlow extends SurfaceShader { Index: SurfaceConfetti.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceConfetti.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceConfetti.java 11 Dec 2003 15:25:24 -0000 1.1 --- SurfaceConfetti.java 28 Feb 2007 00:02:40 -0000 1.2 *************** *** 1,63 **** ! /* ! * SurfaceConfetti.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.grid.Color3fGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.SurfaceShader; ! ! public class SurfaceConfetti extends SurfaceShader { ! private static Vector3fGrid vg1= new Vector3fGrid(); ! private static Color3fGrid cg1= new Color3fGrid(); ! private static Color3fGrid cg2= new Color3fGrid(); ! private static Color3fGrid cg3= new Color3fGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Ka", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Kd", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("noisescale", "uniform float"), 1f)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKa= (UniformScalarFloat)getParameter(sv, "Ka"); ! final float Ka= paramKa.getValue(); ! UniformScalarFloat paramKd= (UniformScalarFloat)getParameter(sv, "Kd"); ! final float Kd= paramKd.getValue(); ! UniformScalarFloat paramNoisescale= (UniformScalarFloat)getParameter(sv, "noisescale"); ! final float noisescale= paramNoisescale.getValue(); ! vg1.normalize(sv.N); ! vg1.faceforward(vg1, sv.I); ! sv.Oi.set(sv.Os); ! ambient(sv, cg1); ! cg3.set(Ka); ! cg1.mul(cg1, cg3); ! diffuse(sv, vg1, cg2); ! cg3.set(Kd); ! cg2.mul(cg2, cg3); ! cg1.add(cg1, cg2); ! vg1.set(noisescale); ! vg1.mul(vg1, sv.P); ! cg3.noise(vg1); ! cg1.mul(cg1, cg3); ! sv.Ci.mul(sv.Os, cg1); ! } ! ! } --- 1,71 ---- ! /* ! * SurfaceConfetti.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.grid.Color3fGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.SurfaceShader; ! ! public class SurfaceConfetti extends SurfaceShader { ! private static Vector3fGrid vg1= new Vector3fGrid(); ! private static Color3fGrid cg1= new Color3fGrid(); ! private static Color3fGrid cg2= new Color3fGrid(); ! private static Color3fGrid cg3= new Color3fGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Ka", "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Kd", "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("noisescale", ! "uniform float"), ! 1f)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKa= (UniformScalarFloat)getParameter(sv, "Ka"); ! final float Ka= paramKa.getValue(); ! UniformScalarFloat paramKd= (UniformScalarFloat)getParameter(sv, "Kd"); ! final float Kd= paramKd.getValue(); ! UniformScalarFloat paramNoisescale= ! (UniformScalarFloat)getParameter(sv, "noisescale"); ! final float noisescale= paramNoisescale.getValue(); ! vg1.normalize(sv.N); ! vg1.faceforward(vg1, sv.I); ! sv.Oi.set(sv.Os); ! ambient(sv, cg1); ! cg3.set(Ka); ! cg1.mul(cg1, cg3); ! diffuse(sv, vg1, cg2); ! cg3.set(Kd); ! cg2.mul(cg2, cg3); ! cg1.add(cg1, cg2); ! vg1.set(noisescale); ! vg1.mul(vg1, sv.P); ! cg3.noise(vg1); ! cg1.mul(cg1, cg3); ! sv.Ci.mul(sv.Os, cg1); ! } ! ! } Index: DisplacementTurbulence.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/DisplacementTurbulence.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DisplacementTurbulence.java 11 Dec 2003 15:25:24 -0000 1.1 --- DisplacementTurbulence.java 28 Feb 2007 00:02:40 -0000 1.2 *************** *** 1,73 **** ! /* ! * DisplacementNoisetest.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.geom.Transform; ! import org.jrman.grid.FloatGrid; ! import org.jrman.grid.Point3fGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.parameters.UniformScalarInteger; ! import org.jrman.parser.Global; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.DisplacementShader; ! ! public class DisplacementTurbulence extends DisplacementShader { ! private static FloatGrid fg1= new FloatGrid(); ! private static FloatGrid fg2= new FloatGrid(); ! private static Point3fGrid pg1= new Point3fGrid(); ! private static Vector3fGrid Nn= new Vector3fGrid(); ! private static Point3fGrid P2= new Point3fGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Km", "uniform float"), 0.5f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("noisescale", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarInteger(new Declaration("noiseoctaves", "uniform integer"), 1)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKm= (UniformScalarFloat)getParameter(sv, "Km"); ! final float Km= paramKm.getValue(); ! UniformScalarFloat paramNoisescale= (UniformScalarFloat)getParameter(sv, "noisescale"); ! final float noisescale= paramNoisescale.getValue(); ! UniformScalarInteger paramNoiseoctaves= (UniformScalarInteger)getParameter(sv, "noiseoctaves"); ! final int noiseoctaves= paramNoiseoctaves.getValue(); ! P2.set(sv.P); ! Transform transform= Global.getTransform("camera"); ! transform= transform.concat(sv.attributes.getTransform()); ! transform= transform.getInverse(); ! P2.transform(P2, transform); ! Nn.vtransform(sv.N, transform); ! Nn.normalize(Nn); ! pg1.mul(P2, noisescale); ! fg2.set(0f); ! for (int j= 1; j <= noiseoctaves; j++) { ! fg1.snoise(pg1); ! fg1.abs(fg1); ! fg1.mul(fg1, 0.5f / j); ! fg2.add(fg2, fg1); ! pg1.mul(pg1, 2.0123f); ! } ! fg2.mul(fg2, Km); ! P2.set(fg2); ! P2.mul(P2, Nn); ! sv.P.add(P2, sv.P); ! calculatenormal(sv, sv.P, sv.N); ! } } \ No newline at end of file --- 1,83 ---- ! /* ! * DisplacementTurbulence.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.geom.Transform; ! import org.jrman.grid.FloatGrid; ! import org.jrman.grid.Point3fGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.parameters.UniformScalarInteger; ! import org.jrman.parser.Global; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.DisplacementShader; ! ! public class DisplacementTurbulence extends DisplacementShader { ! private static FloatGrid fg1= new FloatGrid(); ! private static FloatGrid fg2= new FloatGrid(); ! private static Point3fGrid pg1= new Point3fGrid(); ! private static Vector3fGrid Nn= new Vector3fGrid(); ! private static Point3fGrid P2= new Point3fGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Km", "uniform float"), ! 0.5f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("noisescale", ! "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarInteger(new Declaration("noiseoctaves", ! "uniform integer"), ! 1)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKm= (UniformScalarFloat)getParameter(sv, "Km"); ! final float Km= paramKm.getValue(); ! UniformScalarFloat paramNoisescale= ! (UniformScalarFloat)getParameter(sv, "noisescale"); ! final float noisescale= paramNoisescale.getValue(); ! UniformScalarInteger paramNoiseoctaves= ! (UniformScalarInteger)getParameter(sv, "noiseoctaves"); ! final int noiseoctaves= paramNoiseoctaves.getValue(); ! P2.set(sv.P); ! Transform transform= Global.getTransform("camera"); ! transform= transform.concat(sv.attributes.getTransform()); ! transform= transform.getInverse(); ! P2.transform(P2, transform); ! Nn.vtransform(sv.N, transform); ! Nn.normalize(Nn); ! pg1.mul(P2, noisescale); ! fg2.set(0f); ! for (int j= 1; j <= noiseoctaves; j++) { ! fg1.snoise(pg1); ! fg1.abs(fg1); ! fg1.mul(fg1, 0.5f / j); ! fg2.add(fg2, fg1); ! pg1.mul(pg1, 2.0123f); ! } ! fg2.mul(fg2, Km); ! P2.set(fg2); ! P2.mul(P2, Nn); ! sv.P.add(P2, sv.P); ! calculatenormal(sv, sv.P, sv.N); ! } } \ No newline at end of file Index: DisplacementDented.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/DisplacementDented.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DisplacementDented.java 11 Dec 2003 15:25:24 -0000 1.1 --- DisplacementDented.java 28 Feb 2007 00:02:40 -0000 1.2 *************** *** 1,75 **** ! /* ! * DisplacementDented.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.geom.Transform; ! import org.jrman.grid.FloatGrid; ! import org.jrman.grid.Point3fGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.parameters.UniformScalarInteger; ! import org.jrman.parser.Global; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.DisplacementShader; ! ! public class DisplacementDented extends DisplacementShader { ! private static FloatGrid fg1= new FloatGrid(); ! private static FloatGrid fg2= new FloatGrid(); ! private static Point3fGrid pg1= new Point3fGrid(); ! private static Vector3fGrid Nn= new Vector3fGrid(); ! private static Point3fGrid P2= new Point3fGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Km", "uniform float"), 0.5f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("noisescale", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarInteger(new Declaration("noiseoctaves", "uniform integer"), 1)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKm= (UniformScalarFloat)getParameter(sv, "Km"); ! final float Km= paramKm.getValue(); ! UniformScalarFloat paramNoisescale= (UniformScalarFloat)getParameter(sv, "noisescale"); ! final float noisescale= paramNoisescale.getValue(); ! UniformScalarInteger paramNoiseoctaves= (UniformScalarInteger)getParameter(sv, "noiseoctaves"); ! final int noiseoctaves= paramNoiseoctaves.getValue(); ! P2.set(sv.P); ! Transform transform= Global.getTransform("camera"); ! transform= transform.concat(sv.attributes.getTransform()); ! transform= transform.getInverse(); ! P2.transform(P2, transform); ! Nn.vtransform(sv.N, transform); ! Nn.normalize(Nn); ! pg1.mul(P2, noisescale); ! fg2.set(0f); ! for (int j= 1; j <= noiseoctaves; j++) { ! fg1.snoise(pg1); ! fg1.abs(fg1); ! fg1.mul(fg1, 0.5f / j); ! fg2.add(fg2, fg1); ! pg1.mul(pg1, 2.0123f); ! } ! fg2.mul(fg2, fg2); ! fg2.mul(fg2, fg2); ! fg2.mul(fg2, -Km); ! P2.set(fg2); ! P2.mul(P2, Nn); ! sv.P.add(P2, sv.P); ! calculatenormal(sv, sv.P, sv.N); ! } } \ No newline at end of file --- 1,85 ---- ! /* ! * DisplacementDented.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.geom.Transform; ! import org.jrman.grid.FloatGrid; ! import org.jrman.grid.Point3fGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.parameters.UniformScalarInteger; ! import org.jrman.parser.Global; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.DisplacementShader; ! ! public class DisplacementDented extends DisplacementShader { ! private static FloatGrid fg1= new FloatGrid(); ! private static FloatGrid fg2= new FloatGrid(); ! private static Point3fGrid pg1= new Point3fGrid(); ! private static Vector3fGrid Nn= new Vector3fGrid(); ! private static Point3fGrid P2= new Point3fGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Km", "uniform float"), ! 0.5f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("noisescale", ! "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarInteger(new Declaration("noiseoctaves", ! "uniform integer"), ! 1)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKm= (UniformScalarFloat)getParameter(sv, "Km"); ! final float Km= paramKm.getValue(); ! UniformScalarFloat paramNoisescale= ! (UniformScalarFloat)getParameter(sv, "noisescale"); ! final float noisescale= paramNoisescale.getValue(); ! UniformScalarInteger paramNoiseoctaves= ! (UniformScalarInteger)getParameter(sv, "noiseoctaves"); ! final int noiseoctaves= paramNoiseoctaves.getValue(); ! P2.set(sv.P); ! Transform transform= Global.getTransform("camera"); ! transform= transform.concat(sv.attributes.getTransform()); ! transform= transform.getInverse(); ! P2.transform(P2, transform); ! Nn.vtransform(sv.N, transform); ! Nn.normalize(Nn); ! pg1.mul(P2, noisescale); ! fg2.set(0f); ! for (int j= 1; j <= noiseoctaves; j++) { ! fg1.snoise(pg1); ! fg1.abs(fg1); ! fg1.mul(fg1, 0.5f / j); ! fg2.add(fg2, fg1); ! pg1.mul(pg1, 2.0123f); ! } ! fg2.mul(fg2, fg2); ! fg2.mul(fg2, fg2); ! fg2.mul(fg2, -Km); ! P2.set(fg2); ! P2.mul(P2, Nn); ! sv.P.add(P2, sv.P); ! calculatenormal(sv, sv.P, sv.N); ! } } \ No newline at end of file Index: DisplacementDisp_textured.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/DisplacementDisp_textured.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DisplacementDisp_textured.java 11 Jan 2006 06:23:23 -0000 1.2 --- DisplacementDisp_textured.java 28 Feb 2007 00:02:40 -0000 1.3 *************** *** 1,19 **** /* ! DisplacementDisp_textured.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! DisplacementDisp_textured.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: SurfaceAlphaplastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceAlphaplastic.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SurfaceAlphaplastic.java 29 Dec 2006 19:45:30 -0000 1.4 --- SurfaceAlphaplastic.java 28 Feb 2007 00:02:40 -0000 1.5 *************** *** 54,58 **** new UniformScalarFloat(new Declaration("Ks", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("roughness", "uniform float"), .1f)); defaultParameters.addParameter( new UniformScalarTuple3f( --- 54,60 ---- new UniformScalarFloat(new Declaration("Ks", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("roughness", ! "uniform float"), ! .1f)); defaultParameters.addParameter( new UniformScalarTuple3f( *************** *** 62,79 **** 1f)); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("texturename", "string"), "")); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("blur", "uniform float"), 0f)); } public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKd = (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); ! UniformScalarFloat paramKs = (UniformScalarFloat) getParameter(sv, "Ks"); final float Ks = paramKs.getValue(); ! UniformScalarFloat paramRoughness = (UniformScalarFloat) getParameter(sv, "roughness"); final float roughness = paramRoughness.getValue(); UniformScalarTuple3f paramSpecularcolor = --- 64,87 ---- 1f)); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("texturename", "string"), ! "")); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("blur", "uniform float"), ! 0f)); } public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = ! (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKd = ! (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); ! UniformScalarFloat paramKs = ! (UniformScalarFloat) getParameter(sv, "Ks"); final float Ks = paramKs.getValue(); ! UniformScalarFloat paramRoughness = ! (UniformScalarFloat) getParameter(sv, "roughness"); final float roughness = paramRoughness.getValue(); UniformScalarTuple3f paramSpecularcolor = *************** *** 83,87 **** (UniformScalarString) getParameter(sv, "texturename"); final String texturename = paramTexturename.getValue(); ! UniformScalarFloat paramBlur = (UniformScalarFloat) getParameter(sv, "blur"); final float blur = paramBlur.getValue(); vg1.normalize(sv.N); --- 91,96 ---- (UniformScalarString) getParameter(sv, "texturename"); final String texturename = paramTexturename.getValue(); ! UniformScalarFloat paramBlur = ! (UniformScalarFloat) getParameter(sv, "blur"); final float blur = paramBlur.getValue(); vg1.normalize(sv.N); Index: SurfaceTurbulence.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceTurbulence.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SurfaceTurbulence.java 2 Feb 2004 19:30:06 -0000 1.2 --- SurfaceTurbulence.java 28 Feb 2007 00:02:40 -0000 1.3 *************** *** 35,42 **** protected void initDefaults() { ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Ka", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Kd", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("noisescale", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarInteger(new Declaration("noiseoctaves", "uniform integer"), 1)); } --- 35,52 ---- protected void initDefaults() { ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Ka", "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Kd", "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("noisescale", ! "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarInteger(new Declaration("noiseoctaves", ! "uniform integer"), ! 1)); } *************** *** 47,53 **** UniformScalarFloat paramKd= (UniformScalarFloat)getParameter(sv, "Kd"); final float Kd= paramKd.getValue(); ! UniformScalarFloat paramNoisescale= (UniformScalarFloat)getParameter(sv, "noisescale"); final float noisescale= paramNoisescale.getValue(); ! UniformScalarInteger paramNoiseoctaves= (UniformScalarInteger)getParameter(sv, "noiseoctaves"); final int noiseoctaves= paramNoiseoctaves.getValue(); vg1.normalize(sv.N); --- 57,65 ---- UniformScalarFloat paramKd= (UniformScalarFloat)getParameter(sv, "Kd"); final float Kd= paramKd.getValue(); ! UniformScalarFloat paramNoisescale= ! (UniformScalarFloat)getParameter(sv, "noisescale"); final float noisescale= paramNoisescale.getValue(); ! UniformScalarInteger paramNoiseoctaves= ! (UniformScalarInteger)getParameter(sv, "noiseoctaves"); final int noiseoctaves= paramNoiseoctaves.getValue(); vg1.normalize(sv.N); Index: SurfaceRandomcheckers.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceRandomcheckers.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceRandomcheckers.java 11 Dec 2003 15:25:24 -0000 1.1 --- SurfaceRandomcheckers.java 28 Feb 2007 00:02:40 -0000 1.2 *************** *** 1,63 **** ! /* ! * SurfaceRandomcheckers.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.grid.Color3fGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.SurfaceShader; ! ! public class SurfaceRandomcheckers extends SurfaceShader { ! private static Vector3fGrid vg1= new Vector3fGrid(); ! private static Color3fGrid cg1= new Color3fGrid(); ! private static Color3fGrid cg2= new Color3fGrid(); ! private static Color3fGrid cg3= new Color3fGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Ka", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Kd", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("noisescale", "uniform float"), 1f)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKa= (UniformScalarFloat)getParameter(sv, "Ka"); ! final float Ka= paramKa.getValue(); ! UniformScalarFloat paramKd= (UniformScalarFloat)getParameter(sv, "Kd"); ! final float Kd= paramKd.getValue(); ! UniformScalarFloat paramNoisescale= (UniformScalarFloat)getParameter(sv, "noisescale"); ! final float noisescale= paramNoisescale.getValue(); ! vg1.normalize(sv.N); ! vg1.faceforward(vg1, sv.I); ! sv.Oi.set(sv.Os); ! ambient(sv, cg1); ! cg3.set(Ka); ! cg1.mul(cg1, cg3); ! diffuse(sv, vg1, cg2); ! cg3.set(Kd); ! cg2.mul(cg2, cg3); ! cg1.add(cg1, cg2); ! vg1.set(noisescale); ! vg1.mul(vg1, sv.P); ! cg3.cellnoise(vg1); ! cg1.mul(cg1, cg3); ! sv.Ci.mul(sv.Os, cg1); ! } ! ! } --- 1,71 ---- ! /* ! * SurfaceRandomcheckers.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.grid.Color3fGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.SurfaceShader; ! ! public class SurfaceRandomcheckers extends SurfaceShader { ! private static Vector3fGrid vg1= new Vector3fGrid(); ! private static Color3fGrid cg1= new Color3fGrid(); ! private static Color3fGrid cg2= new Color3fGrid(); ! private static Color3fGrid cg3= new Color3fGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Ka", "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Kd", "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("noisescale", ! "uniform float"), ! 1f)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKa= (UniformScalarFloat)getParameter(sv, "Ka"); ! final float Ka= paramKa.getValue(); ! UniformScalarFloat paramKd= (UniformScalarFloat)getParameter(sv, "Kd"); ! final float Kd= paramKd.getValue(); ! UniformScalarFloat paramNoisescale= ! (UniformScalarFloat)getParameter(sv, "noisescale"); ! final float noisescale= paramNoisescale.getValue(); ! vg1.normalize(sv.N); ! vg1.faceforward(vg1, sv.I); ! sv.Oi.set(sv.Os); ! ambient(sv, cg1); ! cg3.set(Ka); ! cg1.mul(cg1, cg3); ! diffuse(sv, vg1, cg2); ! cg3.set(Kd); ! cg2.mul(cg2, cg3); ! cg1.add(cg1, cg2); ! vg1.set(noisescale); ! vg1.mul(vg1, sv.P); ! cg3.cellnoise(vg1); ! cg1.mul(cg1, cg3); ! sv.Ci.mul(sv.Os, cg1); ! } ! ! } Index: SurfaceClouds.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceClouds.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceClouds.java 11 Dec 2003 15:25:24 -0000 1.1 --- SurfaceClouds.java 28 Feb 2007 00:02:40 -0000 1.2 *************** *** 1,77 **** ! /* ! * DisplacementDented.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.grid.Color3fGrid; ! import org.jrman.grid.FloatGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.parameters.UniformScalarInteger; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.SurfaceShader; ! ! public class SurfaceClouds extends SurfaceShader { ! private static Vector3fGrid vg1= new Vector3fGrid(); ! private static Color3fGrid cg1= new Color3fGrid(); ! private static Color3fGrid cg2= new Color3fGrid(); ! private static Color3fGrid cg3= new Color3fGrid(); ! private static FloatGrid fg1= new FloatGrid(); ! private static FloatGrid fg2= new FloatGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Ka", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("Kd", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarFloat(new Declaration("noisescale", "uniform float"), 1f)); ! defaultParameters.addParameter(new UniformScalarInteger(new Declaration("noiseoctaves", "uniform integer"), 1)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKa= (UniformScalarFloat)getParameter(sv, "Ka"); ! final float Ka= paramKa.getValue(); ! UniformScalarFloat paramKd= (UniformScalarFloat)getParameter(sv, "Kd"); ! final float Kd= paramKd.getValue(); ! UniformScalarFloat paramNoisescale= (UniformScalarFloat)getParameter(sv, "noisescale"); ! final float noisescale= paramNoisescale.getValue(); ! UniformScalarInteger paramNoiseoctaves= (UniformScalarInteger)getParameter(sv, "noiseoctaves"); ! final int noiseoctaves= paramNoiseoctaves.getValue(); ! vg1.normalize(sv.N); ! vg1.faceforward(vg1, sv.I); ! sv.Oi.set(sv.Os); ! ambient(sv, cg1); ! cg3.set(Ka); ! cg1.mul(cg1, cg3); ! diffuse(sv, vg1, cg2); ! cg3.set(Kd); ! cg2.mul(cg2, cg3); ! cg1.add(cg1, cg2); ! vg1.set(noisescale); ! vg1.mul(vg1, sv.P); ! fg2.set(0f); ! for (int j= 1; j <= noiseoctaves; j++) { ! fg1.noise(vg1); ! fg1.mul(fg1, 0.5f / j); ! fg2.add(fg2, fg1); ! vg1.mul(vg1, 2.0123f); ! } ! cg3.set(fg2); ! cg1.mul(cg1, cg3); ! sv.Ci.mul(sv.Os, cg1); ! } ! ! } --- 1,89 ---- ! /* ! * SurfaceClouds.java Copyright (C) 2003 Alessandro Falappa ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) ! * any later version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ! * more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! ! import org.jrman.grid.Color3fGrid; ! import org.jrman.grid.FloatGrid; ! import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; ! import org.jrman.parameters.UniformScalarFloat; ! import org.jrman.parameters.UniformScalarInteger; ! import org.jrman.render.ShaderVariables; ! import org.jrman.shaders.SurfaceShader; ! ! public class SurfaceClouds extends SurfaceShader { ! private static Vector3fGrid vg1= new Vector3fGrid(); ! private static Color3fGrid cg1= new Color3fGrid(); ! private static Color3fGrid cg2= new Color3fGrid(); ! private static Color3fGrid cg3= new Color3fGrid(); ! private static FloatGrid fg1= new FloatGrid(); ! private static FloatGrid fg2= new FloatGrid(); ! ! protected void initDefaults() { ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Ka", "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("Kd", "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("noisescale", ! "uniform float"), ! 1f)); ! defaultParameters.addParameter( ! new UniformScalarInteger(new Declaration("noiseoctaves", ! "uniform integer"), ! 1)); ! } ! ! public void shade(ShaderVariables sv) { ! super.shade(sv); ! UniformScalarFloat paramKa= (UniformScalarFloat)getParameter(sv, "Ka"); ! final float Ka= paramKa.getValue(); ! UniformScalarFloat paramKd= (UniformScalarFloat)getParameter(sv, "Kd"); ! final float Kd= paramKd.getValue(); ! UniformScalarFloat paramNoisescale= ! (UniformScalarFloat)getParameter(sv, "noisescale"); ! final float noisescale= paramNoisescale.getValue(); ! UniformScalarInteger paramNoiseoctaves= ! (UniformScalarInteger)getParameter(sv, "noiseoctaves"); ! final int noiseoctaves= paramNoiseoctaves.getValue(); ! vg1.normalize(sv.N); ! vg1.faceforward(vg1, sv.I); ! sv.Oi.set(sv.Os); ! ambient(sv, cg1); ! cg3.set(Ka); ! cg1.mul(cg1, cg3); ! diffuse(sv, vg1, cg2); ! cg3.set(Kd); ! cg2.mul(cg2, cg3); ! cg1.add(cg1, cg2); ! vg1.set(noisescale); ! vg1.mul(vg1, sv.P); ! fg2.set(0f); ! for (int j= 1; j <= noiseoctaves; j++) { ! fg1.noise(vg1); ! fg1.mul(fg1, 0.5f / j); ! fg2.add(fg2, fg1); ! vg1.mul(vg1, 2.0123f); ! } ! cg3.set(fg2); ! cg1.mul(cg1, cg3); ! sv.Ci.mul(sv.Os, cg1); ! } ! ! } Index: SurfaceRandomcolors.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceRandomcolors.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SurfaceRandomcolors.java 4 Jul 2005 06:32:02 -0000 1.6 --- SurfaceRandomcolors.java 28 Feb 2007 00:02:40 -0000 1.7 *************** *** 1,19 **** /* ! SurfaceRandomcolors.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! SurfaceRandomcolors.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 48,54 **** public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKd = (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); vg1.normalize(sv.N); --- 48,56 ---- public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = ! (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKd = ! (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); vg1.normalize(sv.N); Index: GenCubes.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/GenCubes.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenCubes.java 17 May 2003 21:47:57 -0000 1.1 --- GenCubes.java 28 Feb 2007 00:02:40 -0000 1.2 *************** *** 1,19 **** /* ! GenCubes.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! GenCubes.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ... [truncated message content] |
From: Gerardo H. <ma...@us...> - 2007-02-28 00:02:49
|
Update of /cvsroot/jrman/drafts/src/net/falappa/swing In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4501/src/net/falappa/swing Modified Files: CheckeredPaint.java ExtensionFileFilter.java Log Message: Finished reformatting code :) Code is almost 100% clean (no more hideous Eclipse formatting, no tabs, no line longer than 80 columns, no CR/LF) Index: ExtensionFileFilter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/swing/ExtensionFileFilter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExtensionFileFilter.java 26 Feb 2007 15:25:14 -0000 1.2 --- ExtensionFileFilter.java 28 Feb 2007 00:02:40 -0000 1.3 *************** *** 1,60 **** ! /* ! * Created on 26-ott-2003 ! */ ! package net.falappa.swing; ! ! import java.io.File; ! import java.text.MessageFormat; ! import java.util.ResourceBundle; ! ! import javax.swing.filechooser.FileFilter; ! ! /** ! * A <code>JFileChooser</code> file filter based on an extension string. ! * The file filter accepts directories and files ending with the extension it is ! * built with. ! * ! * @author Alessandro Falappa ! */ ! public class ExtensionFileFilter extends FileFilter { ! private String ext; ! private String desc; ! private static final ResourceBundle messagesBundle= ! ResourceBundle.getBundle( ! ExtensionFileFilter.class.getPackage().getName() ! + ".res.ExtensionFileFilter"); ! ! /** ! * Constructs a <code>ExtensionFileFilter</code> object. ! * ! * @param ext ! * the extension this filter will allow to select ! */ ! public ExtensionFileFilter(String ext) { ! if (ext == null) ! throw new NullPointerException("invalid extension"); //$NON-NLS-1$ ! this.ext= ext; ! desc= ! MessageFormat.format( ! messagesBundle.getString("ExtensionFileFilter.description"), //$NON-NLS-1$ ! ext.toUpperCase(), ext ); ! } ! ! /* ! * (non-Javadoc) ! * ! * @see javax.swing.filechooser.FileFilter#accept(java.io.File) ! */ ! public boolean accept(File f) { ! return f.isDirectory() || f.getName().toLowerCase().endsWith(ext); ! } ! ! /* ! * (non-Javadoc) ! * ! * @see javax.swing.filechooser.FileFilter#getDescription() ! */ ! public String getDescription() { ! return desc; ! } ! } --- 1,60 ---- ! /* ! * Created on 26-ott-2003 ! */ ! package net.falappa.swing; ! ! import java.io.File; ! import java.text.MessageFormat; ! import java.util.ResourceBundle; ! ! import javax.swing.filechooser.FileFilter; ! ! /** ! * A <code>JFileChooser</code> file filter based on an extension string. ! * The file filter accepts directories and files ending with the extension it is ! * built with. ! * ! * @author Alessandro Falappa ! */ ! public class ExtensionFileFilter extends FileFilter { ! private String ext; ! private String desc; ! private static final ResourceBundle messagesBundle= ! ResourceBundle.getBundle( ! ExtensionFileFilter.class.getPackage().getName() ! + ".res.ExtensionFileFilter"); ! ! /** ! * Constructs a <code>ExtensionFileFilter</code> object. ! * ! * @param ext ! * the extension this filter will allow to select ! */ ! public ExtensionFileFilter(String ext) { ! if (ext == null) ! throw new NullPointerException("invalid extension"); //$NON-NLS-1$ ! this.ext= ext; ! desc= ! MessageFormat.format( ! messagesBundle.getString("ExtensionFileFilter.description"), //$NON-NLS-1$ ! ext.toUpperCase(), ext ); ! } ! ! /* ! * (non-Javadoc) ! * ! * @see javax.swing.filechooser.FileFilter#accept(java.io.File) ! */ ! public boolean accept(File f) { ! return f.isDirectory() || f.getName().toLowerCase().endsWith(ext); ! } ! ! /* ! * (non-Javadoc) ! * ! * @see javax.swing.filechooser.FileFilter#getDescription() ! */ ! public String getDescription() { ! return desc; ! } ! } Index: CheckeredPaint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/swing/CheckeredPaint.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CheckeredPaint.java 25 Nov 2003 06:00:57 -0000 1.2 --- CheckeredPaint.java 28 Feb 2007 00:02:40 -0000 1.3 *************** *** 8,72 **** public class CheckeredPaint extends TexturePaint { ! private static final int TONE_BITMASK= 0x0f; ! private static final int SIZE_BITMASK= 0xf0; ! public static final int PRESET_LIGHT_TONE_SMALL= 0x00; ! public static final int PRESET_MID_TONE_SMALL= 0x01; ! public static final int PRESET_DARK_TONE_SMALL= 0x02; ! public static final int PRESET_LIGHT_TONE_MEDIUM= 0x10; ! public static final int PRESET_MID_TONE_MEDIUM= 0x11; ! public static final int PRESET_DARK_TONE_MEDIUM= 0x12; ! public static final int PRESET_LIGHT_TONE_LARGE= 0x20; ! public static final int PRESET_MID_TONE_LARGE= 0x21; ! public static final int PRESET_DARK_TONE_LARGE= 0x22; ! private void init(int squareSize, Color color1, Color color2) { ! Graphics g= getImage().getGraphics(); ! g.setColor(color1); ! g.fillRect(0, 0, squareSize, squareSize); ! g.fillRect(squareSize, squareSize, squareSize, squareSize); ! g.setColor(color2); ! g.fillRect(squareSize, 0, squareSize, squareSize); ! g.fillRect(0, squareSize, squareSize, squareSize); ! } ! public CheckeredPaint(int squareSize, Color color1, Color color2) { ! super( ! new BufferedImage( 2 * squareSize, 2 * squareSize, BufferedImage.TYPE_INT_RGB), ! new Rectangle2D.Float(0.f, 0.f, 2 * squareSize, 2 * squareSize)); ! init(squareSize, color1, color2); ! } ! public CheckeredPaint() { ! this(8, Color.white, Color.lightGray); ! } ! public static CheckeredPaint createPreset(int preset) { ! int checkSize; ! Color c1, c2; ! int i= (preset & SIZE_BITMASK) >> 4; ! if (i == 2) ! checkSize= 32; ! else if (i == 1) ! checkSize= 16; ! else ! checkSize= 8; ! i= (preset & TONE_BITMASK); ! if (i == 2) { ! c1= Color.lightGray; ! c2= Color.darkGray; ! } ! else if (i == 1) { ! c1= Color.white; ! c2= Color.gray; ! } ! else { ! c1= Color.white; ! c2= Color.lightGray; ! } ! return new CheckeredPaint(checkSize, c1, c2); ! } } --- 8,72 ---- public class CheckeredPaint extends TexturePaint { ! private static final int TONE_BITMASK= 0x0f; ! private static final int SIZE_BITMASK= 0xf0; ! public static final int PRESET_LIGHT_TONE_SMALL= 0x00; ! public static final int PRESET_MID_TONE_SMALL= 0x01; ! public static final int PRESET_DARK_TONE_SMALL= 0x02; ! public static final int PRESET_LIGHT_TONE_MEDIUM= 0x10; ! public static final int PRESET_MID_TONE_MEDIUM= 0x11; ! public static final int PRESET_DARK_TONE_MEDIUM= 0x12; ! public static final int PRESET_LIGHT_TONE_LARGE= 0x20; ! public static final int PRESET_MID_TONE_LARGE= 0x21; ! public static final int PRESET_DARK_TONE_LARGE= 0x22; ! private void init(int squareSize, Color color1, Color color2) { ! Graphics g= getImage().getGraphics(); ! g.setColor(color1); ! g.fillRect(0, 0, squareSize, squareSize); ! g.fillRect(squareSize, squareSize, squareSize, squareSize); ! g.setColor(color2); ! g.fillRect(squareSize, 0, squareSize, squareSize); ! g.fillRect(0, squareSize, squareSize, squareSize); ! } ! public CheckeredPaint(int squareSize, Color color1, Color color2) { ! super( ! new BufferedImage( 2 * squareSize, 2 * squareSize, BufferedImage.TYPE_INT_RGB), ! new Rectangle2D.Float(0.f, 0.f, 2 * squareSize, 2 * squareSize)); ! init(squareSize, color1, color2); ! } ! public CheckeredPaint() { ! this(8, Color.white, Color.lightGray); ! } ! public static CheckeredPaint createPreset(int preset) { ! int checkSize; ! Color c1, c2; ! int i= (preset & SIZE_BITMASK) >> 4; ! if (i == 2) ! checkSize= 32; ! else if (i == 1) ! checkSize= 16; ! else ! checkSize= 8; ! i= (preset & TONE_BITMASK); ! if (i == 2) { ! c1= Color.lightGray; ! c2= Color.darkGray; ! } ! else if (i == 1) { ! c1= Color.white; ! c2= Color.gray; ! } ! else { ! c1= Color.white; ! c2= Color.lightGray; ! } ! return new CheckeredPaint(checkSize, c1, c2); ! } } |
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4501/src/org/jrman/shaders Modified Files: LightDistantlight.java LightPointlight.java LightShader.java LightShadowdistantlight.java LightShadowspotlight.java LightSpotlight.java Shader.java SurfaceConstant.java SurfaceFakedlight.java SurfaceMatte.java SurfaceMetal.java SurfacePaintedplastic.java SurfacePlastic.java SurfaceReflectivepaintedplastic.java SurfaceShader.java VolumeDepthcue.java VolumeFog.java VolumeShader.java Log Message: Finished reformatting code :) Code is almost 100% clean (no more hideous Eclipse formatting, no tabs, no line longer than 80 columns, no CR/LF) Index: SurfacePlastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfacePlastic.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SurfacePlastic.java 25 Nov 2003 16:34:08 -0000 1.3 --- SurfacePlastic.java 28 Feb 2007 00:02:41 -0000 1.4 *************** *** 1,19 **** /* ! SurfaceMetal.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! SurfacePlastic.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 51,72 **** new UniformScalarFloat(new Declaration("Ks", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("roughness", "uniform float"), .1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f( ! new Declaration("specularcolor", "uniform color"), ! 1f, ! 1f, ! 1f)); } public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKd = (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); ! UniformScalarFloat paramKs = (UniformScalarFloat) getParameter(sv, "Ks"); final float Ks = paramKs.getValue(); ! UniformScalarFloat paramRoughness = (UniformScalarFloat) getParameter(sv, "roughness"); final float roughness = paramRoughness.getValue(); UniformScalarTuple3f paramSpecularcolor = --- 51,76 ---- new UniformScalarFloat(new Declaration("Ks", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("roughness", ! "uniform float"), ! .1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("specularcolor", ! "uniform color"), ! 1f, 1f, 1f)); } public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = ! (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKd = ! (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); ! UniformScalarFloat paramKs = ! (UniformScalarFloat) getParameter(sv, "Ks"); final float Ks = paramKs.getValue(); ! UniformScalarFloat paramRoughness = ! (UniformScalarFloat) getParameter(sv, "roughness"); final float roughness = paramRoughness.getValue(); UniformScalarTuple3f paramSpecularcolor = Index: SurfaceMetal.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceMetal.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SurfaceMetal.java 25 Nov 2003 16:34:08 -0000 1.3 --- SurfaceMetal.java 28 Feb 2007 00:02:41 -0000 1.4 *************** *** 1,19 **** /* ! SurfaceMetal.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! SurfaceMetal.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 44,57 **** new UniformScalarFloat(new Declaration("Ks", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("roughness", "uniform float"), .1f)); } public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKs = (UniformScalarFloat) getParameter(sv, "Ks"); final float Ks = paramKs.getValue(); ! UniformScalarFloat paramRoughness = (UniformScalarFloat) getParameter(sv, "roughness"); final float roughness = paramRoughness.getValue(); vg1.normalize(sv.N); --- 44,62 ---- new UniformScalarFloat(new Declaration("Ks", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("roughness", ! "uniform float"), ! .1f)); } public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = ! (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKs = ! (UniformScalarFloat) getParameter(sv, "Ks"); final float Ks = paramKs.getValue(); ! UniformScalarFloat paramRoughness = ! (UniformScalarFloat) getParameter(sv, "roughness"); final float roughness = paramRoughness.getValue(); vg1.normalize(sv.N); Index: VolumeFog.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/VolumeFog.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VolumeFog.java 25 Nov 2003 16:34:08 -0000 1.3 --- VolumeFog.java 28 Feb 2007 00:02:41 -0000 1.4 *************** *** 1,19 **** /* ! VolumeDepthcue.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! VolumeFog.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 38,53 **** protected void initDefaults() { defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("distance", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f( ! new Declaration("background", "uniform color"), ! 0f, ! 0f, ! 0f)); } public void shade(ShaderVariables sv, float near, float far) { super.shade(sv, near, far); ! UniformScalarFloat paramDistance = (UniformScalarFloat) getParameter(sv, "distance"); final float distance = paramDistance.getValue(); UniformScalarTuple3f paramBackground = --- 38,54 ---- protected void initDefaults() { defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("distance", ! "uniform float"), ! 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("background", ! "uniform color"), ! 0f, 0f, 0f)); } public void shade(ShaderVariables sv, float near, float far) { super.shade(sv, near, far); ! UniformScalarFloat paramDistance = ! (UniformScalarFloat) getParameter(sv, "distance"); final float distance = paramDistance.getValue(); UniformScalarTuple3f paramBackground = Index: LightShader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightShader.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LightShader.java 16 Sep 2004 04:16:42 -0000 1.11 --- LightShader.java 28 Feb 2007 00:02:41 -0000 1.12 *************** *** 1,19 **** /* ! LightShader.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! LightShader.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 56,60 **** LightShader result; String className = ! "Light" + name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase(); try { result = (LightShader) Class.forName(className).newInstance(); --- 56,61 ---- LightShader result; String className = ! "Light" + name.substring(0, 1).toUpperCase() + ! name.substring(1).toLowerCase(); try { result = (LightShader) Class.forName(className).newInstance(); *************** *** 66,70 **** .newInstance(); } catch (Exception e2) { ! throw new IllegalArgumentException("Unknown light shader: " + name); } } --- 67,72 ---- .newInstance(); } catch (Exception e2) { ! throw new IllegalArgumentException("Unknown light shader: " + ! name); } } *************** *** 137,141 **** } ! public boolean shade(ShaderVariables sv, Point3fGrid P, Vector3fGrid N, float angle) { sv.Cl.set(BLACK); return false; --- 139,144 ---- } ! public boolean shade(ShaderVariables sv, Point3fGrid P, Vector3fGrid N, ! float angle) { sv.Cl.set(BLACK); return false; Index: VolumeShader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/VolumeShader.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** VolumeShader.java 25 Nov 2003 16:34:08 -0000 1.6 --- VolumeShader.java 28 Feb 2007 00:02:41 -0000 1.7 *************** *** 1,19 **** /* ! VolumeShader.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! VolumeShader.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 32,36 **** VolumeShader result; String className = ! "Volume" + name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase(); try { result = (VolumeShader) Class.forName(className).newInstance(); --- 32,37 ---- VolumeShader result; String className = ! "Volume" + name.substring(0, 1).toUpperCase() + ! name.substring(1).toLowerCase(); try { result = (VolumeShader) Class.forName(className).newInstance(); *************** *** 42,46 **** .newInstance(); } catch (Exception e2) { ! throw new IllegalArgumentException("Unknown Volume shader: " + name); } } --- 43,48 ---- .newInstance(); } catch (Exception e2) { ! throw new IllegalArgumentException("Unknown Volume shader: " + ! name); } } Index: LightShadowdistantlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightShadowdistantlight.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LightShadowdistantlight.java 16 Sep 2004 04:16:42 -0000 1.6 --- LightShadowdistantlight.java 28 Feb 2007 00:02:41 -0000 1.7 *************** *** 1,4 **** /* ! LightDistantlight.java Copyright (C) 2003 Gerardo Horvilleur Martinez --- 1,4 ---- /* ! LightShadowdistantlight.java Copyright (C) 2003 Gerardo Horvilleur Martinez *************** *** 53,57 **** static Color3fGrid cg = new Color3fGrid(); ! private DistantShadowLightStatement statement = new DistantShadowLightStatement(); private static class DistantShadowLightStatement extends Statement { --- 53,58 ---- static Color3fGrid cg = new Color3fGrid(); ! private DistantShadowLightStatement statement = ! new DistantShadowLightStatement(); private static class DistantShadowLightStatement extends Statement { *************** *** 101,123 **** protected void initDefaults() { defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("intensity", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f( ! new Declaration("lightcolor", "uniform color"), ! 1f, ! 1f, ! 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("from", "uniform point"), 0f, 0f, 0f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("to", "uniform point"), 0f, 0f, 1f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("bias", "uniform float"), .1f)); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("shadowmap", "string"), "")); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("samples", "uniform float"), 16f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("blur", "uniform float"), 0f)); } --- 102,130 ---- protected void initDefaults() { defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("intensity", ! "uniform float"), ! 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("lightcolor", ! "uniform color"), ! 1f, 1f, 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("from", "uniform point"), ! 0f, 0f, 0f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("to", "uniform point"), ! 0f, 0f, 1f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("bias", "uniform float"), ! .1f)); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("shadowmap", "string"), ! "")); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("samples", "uniform float"), ! 16f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("blur", "uniform float"), ! 0f)); } *************** *** 128,132 **** float angle) { super.shade(sv, P, N, angle); ! UniformScalarFloat paramIntensity = (UniformScalarFloat) getParameter(sv, "intensity"); float intensity = paramIntensity.getValue(); UniformScalarTuple3f paramLightcolor = --- 135,140 ---- float angle) { super.shade(sv, P, N, angle); ! UniformScalarFloat paramIntensity = ! (UniformScalarFloat) getParameter(sv, "intensity"); float intensity = paramIntensity.getValue(); UniformScalarTuple3f paramLightcolor = *************** *** 135,154 **** Transform shaderTransform = attributes.getTransform(); if (attributes.getSpace() == Space.WORLD) ! shaderTransform = Global.getTransform("camera").concat(shaderTransform); ! UniformScalarTuple3f paramFrom = (UniformScalarTuple3f) getParameter(sv, "from"); paramFrom.getValue(from); shaderTransform.transformPoint(from, from); ! UniformScalarTuple3f paramTo = (UniformScalarTuple3f) getParameter(sv, "to"); paramTo.getValue(to); shaderTransform.transformPoint(to, to); vtmp.sub(to, from); ! UniformScalarFloat paramBias = (UniformScalarFloat) getParameter(sv, "bias"); float bias = paramBias.getValue(); UniformScalarString paramShadowmap = (UniformScalarString) getParameter(sv, "shadowmap"); String shadowmap = paramShadowmap.getValue(); ! UniformScalarFloat paramSamples = (UniformScalarFloat) getParameter(sv, "samples"); float samples = paramSamples.getValue(); ! UniformScalarFloat paramBlur = (UniformScalarFloat) getParameter(sv, "blur"); float blur = paramBlur.getValue(); statement.setIntensity(intensity); --- 143,168 ---- Transform shaderTransform = attributes.getTransform(); if (attributes.getSpace() == Space.WORLD) ! shaderTransform = ! Global.getTransform("camera").concat(shaderTransform); ! UniformScalarTuple3f paramFrom = ! (UniformScalarTuple3f) getParameter(sv, "from"); paramFrom.getValue(from); shaderTransform.transformPoint(from, from); ! UniformScalarTuple3f paramTo = ! (UniformScalarTuple3f) getParameter(sv, "to"); paramTo.getValue(to); shaderTransform.transformPoint(to, to); vtmp.sub(to, from); ! UniformScalarFloat paramBias = ! (UniformScalarFloat) getParameter(sv, "bias"); float bias = paramBias.getValue(); UniformScalarString paramShadowmap = (UniformScalarString) getParameter(sv, "shadowmap"); String shadowmap = paramShadowmap.getValue(); ! UniformScalarFloat paramSamples = ! (UniformScalarFloat) getParameter(sv, "samples"); float samples = paramSamples.getValue(); ! UniformScalarFloat paramBlur = ! (UniformScalarFloat) getParameter(sv, "blur"); float blur = paramBlur.getValue(); statement.setIntensity(intensity); Index: LightSpotlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightSpotlight.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LightSpotlight.java 16 Sep 2004 04:16:42 -0000 1.4 --- LightSpotlight.java 28 Feb 2007 00:02:41 -0000 1.5 *************** *** 1,19 **** /* ! LightSpotlight.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! LightSpotlight.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 109,123 **** protected void initDefaults() { defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("intensity", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f( ! new Declaration("lightcolor", "uniform color"), ! 1f, ! 1f, ! 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("from", "uniform point"), 0f, 0f, 0f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("to", "uniform point"), 0f, 0f, 1f)); defaultParameters.addParameter( new UniformScalarFloat( --- 109,126 ---- protected void initDefaults() { defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("intensity", ! "uniform float"), ! 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("lightcolor", ! "uniform color"), ! 1f, 1f,1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("from", ! "uniform point"), ! 0f, 0f, 0f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("to", "uniform point"), ! 0f, 0f, 1f)); defaultParameters.addParameter( new UniformScalarFloat( *************** *** 129,133 **** (float) Math.toRadians(5))); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("beamdistribution", "uniform float"), 2f)); } --- 132,138 ---- (float) Math.toRadians(5))); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("beamdistribution", ! "uniform float"), ! 2f)); } *************** *** 138,142 **** float angle) { super.shade(sv, P, N, angle); ! UniformScalarFloat paramIntensity = (UniformScalarFloat) getParameter(sv, "intensity"); float intensity = paramIntensity.getValue(); UniformScalarTuple3f paramLightcolor = --- 143,148 ---- float angle) { super.shade(sv, P, N, angle); ! UniformScalarFloat paramIntensity = ! (UniformScalarFloat) getParameter(sv, "intensity"); float intensity = paramIntensity.getValue(); UniformScalarTuple3f paramLightcolor = *************** *** 145,156 **** Transform shaderTransform = attributes.getTransform(); if (attributes.getSpace() == Space.WORLD) ! shaderTransform = Global.getTransform("camera").concat(shaderTransform); ! UniformScalarTuple3f paramFrom = (UniformScalarTuple3f) getParameter(sv, "from"); paramFrom.getValue(from); shaderTransform.transformPoint(from, from); ! UniformScalarTuple3f paramTo = (UniformScalarTuple3f) getParameter(sv, "to"); paramTo.getValue(to); shaderTransform.transformPoint(to, to); ! UniformScalarFloat paramConeangle = (UniformScalarFloat) getParameter(sv, "coneangle"); float coneangle = paramConeangle.getValue(); UniformScalarFloat paramConedeltaangle = --- 151,166 ---- Transform shaderTransform = attributes.getTransform(); if (attributes.getSpace() == Space.WORLD) ! shaderTransform = ! Global.getTransform("camera").concat(shaderTransform); ! UniformScalarTuple3f paramFrom = ! (UniformScalarTuple3f) getParameter(sv, "from"); paramFrom.getValue(from); shaderTransform.transformPoint(from, from); ! UniformScalarTuple3f paramTo = ! (UniformScalarTuple3f) getParameter(sv, "to"); paramTo.getValue(to); shaderTransform.transformPoint(to, to); ! UniformScalarFloat paramConeangle = ! (UniformScalarFloat) getParameter(sv, "coneangle"); float coneangle = paramConeangle.getValue(); UniformScalarFloat paramConedeltaangle = Index: SurfaceConstant.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceConstant.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceConstant.java 19 May 2003 08:15:28 -0000 1.1 --- SurfaceConstant.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! SurfaceConstant.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! SurfaceConstant.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: SurfaceReflectivepaintedplastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceReflectivepaintedplastic.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SurfaceReflectivepaintedplastic.java 13 Apr 2004 20:37:03 -0000 1.4 --- SurfaceReflectivepaintedplastic.java 28 Feb 2007 00:02:41 -0000 1.5 *************** *** 1,19 **** /* ! SurfaceMetal.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! SurfaceReflectivepaintedplastic.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 63,92 **** new UniformScalarFloat(new Declaration("Ks", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("roughness", "uniform float"), .1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f( ! new Declaration("specularcolor", "uniform color"), ! 1f, ! 1f, ! 1f)); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("texturename", "string"), "")); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("rtexturename", "string"), "")); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("blur", "uniform float"), 0f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("rblur", "uniform float"), 0f)); } public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKd = (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); ! UniformScalarFloat paramKs = (UniformScalarFloat) getParameter(sv, "Ks"); final float Ks = paramKs.getValue(); ! UniformScalarFloat paramRoughness = (UniformScalarFloat) getParameter(sv, "roughness"); final float roughness = paramRoughness.getValue(); UniformScalarTuple3f paramSpecularcolor = --- 63,99 ---- new UniformScalarFloat(new Declaration("Ks", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("roughness", ! "uniform float"), .1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("specularcolor", ! "uniform color"), ! 1f, 1f, 1f)); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("texturename", "string"), ! "")); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("rtexturename", "string"), ! "")); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("blur", "uniform float"), ! 0f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("rblur", "uniform float"), ! 0f)); } public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = ! (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKd = ! (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); ! UniformScalarFloat paramKs = ! (UniformScalarFloat) getParameter(sv, "Ks"); final float Ks = paramKs.getValue(); ! UniformScalarFloat paramRoughness = ! (UniformScalarFloat) getParameter(sv, "roughness"); final float roughness = paramRoughness.getValue(); UniformScalarTuple3f paramSpecularcolor = *************** *** 99,105 **** (UniformScalarString) getParameter(sv, "rtexturename"); final String rtexturename = paramRtexturename.getValue(); ! UniformScalarFloat paramBlur = (UniformScalarFloat) getParameter(sv, "blur"); final float blur = paramBlur.getValue(); ! UniformScalarFloat paramRblur = (UniformScalarFloat) getParameter(sv, "rblur"); final float rblur = paramRblur.getValue(); vg1.normalize(sv.N); --- 106,114 ---- (UniformScalarString) getParameter(sv, "rtexturename"); final String rtexturename = paramRtexturename.getValue(); ! UniformScalarFloat paramBlur = ! (UniformScalarFloat) getParameter(sv, "blur"); final float blur = paramBlur.getValue(); ! UniformScalarFloat paramRblur = ! (UniformScalarFloat) getParameter(sv, "rblur"); final float rblur = paramRblur.getValue(); vg1.normalize(sv.N); *************** *** 126,130 **** Transform cameraToNDC = rasterToNDC.concat(screenToRaster); if (cameraToScreen instanceof PerspectiveTransform) ! cameraToNDC = ((PerspectiveTransform) cameraToScreen).preConcat(cameraToNDC); else cameraToNDC = cameraToNDC.concat(cameraToScreen); --- 135,140 ---- Transform cameraToNDC = rasterToNDC.concat(screenToRaster); if (cameraToScreen instanceof PerspectiveTransform) ! cameraToNDC = ! ((PerspectiveTransform) cameraToScreen).preConcat(cameraToNDC); else cameraToNDC = cameraToNDC.concat(cameraToScreen); Index: SurfaceMatte.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceMatte.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SurfaceMatte.java 4 Jul 2005 06:32:03 -0000 1.4 --- SurfaceMatte.java 28 Feb 2007 00:02:41 -0000 1.5 *************** *** 1,19 **** /* ! SurfaceMatte.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! SurfaceMatte.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 49,55 **** public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKd = (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); vg1.normalize(sv.N); --- 49,57 ---- public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKa = ! (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); ! UniformScalarFloat paramKd = ! (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); vg1.normalize(sv.N); Index: Shader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/Shader.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Shader.java 3 Jul 2005 04:37:36 -0000 1.7 --- Shader.java 28 Feb 2007 00:02:41 -0000 1.8 *************** *** 1,19 **** /* ! Shader.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Shader.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 38,42 **** protected ParameterList defaultParameters = new ParameterList(); ! protected void init(String name, ParameterList parameters, Attributes attributes) { this.name = name; this.parameters = parameters; --- 38,43 ---- protected ParameterList defaultParameters = new ParameterList(); ! protected void init(String name, ParameterList parameters, ! Attributes attributes) { this.name = name; this.parameters = parameters; *************** *** 89,93 **** } else throw new IllegalArgumentException( ! "Can't store a varying parameter in a uniform variable: " + paramName); } else if (resultHolder instanceof FloatGrid) { if (storageClass == Declaration.StorageClass.CONSTANT || --- 90,95 ---- } else throw new IllegalArgumentException( ! "Can't store a varying parameter in a uniform variable: " ! + paramName); } else if (resultHolder instanceof FloatGrid) { if (storageClass == Declaration.StorageClass.CONSTANT || *************** *** 97,101 **** } else { // TODO handle vertex/varying parameters ! // What should we do? Why or when would a shader have such a parameter? } } else --- 99,104 ---- } else { // TODO handle vertex/varying parameters ! // What should we do? ! // Why or when would a shader have such a parameter? } } else *************** *** 122,126 **** // TODO implement HPOINT message passing } else ! throw new RuntimeException("Unknown Declaration type for parameter: " + paramName); return 1f; } --- 125,130 ---- // TODO implement HPOINT message passing } else ! throw new RuntimeException("Unknown Declaration type for parameter: " ! + paramName); return 1f; } Index: SurfaceFakedlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceFakedlight.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceFakedlight.java 19 May 2003 08:15:28 -0000 1.1 --- SurfaceFakedlight.java 28 Feb 2007 00:02:41 -0000 1.2 *************** *** 1,19 **** /* ! SurfaceFakedlight.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! SurfaceFakedlight.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: LightShadowspotlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightShadowspotlight.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LightShadowspotlight.java 16 Sep 2004 04:16:42 -0000 1.5 --- LightShadowspotlight.java 28 Feb 2007 00:02:41 -0000 1.6 *************** *** 1,19 **** /* ! LightShadowspotlight.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! LightShadowspotlight.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 144,158 **** protected void initDefaults() { defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("intensity", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f( ! new Declaration("lightcolor", "uniform color"), ! 1f, ! 1f, ! 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("from", "uniform point"), 0f, 0f, 0f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("to", "uniform point"), 0f, 0f, 1f)); defaultParameters.addParameter( new UniformScalarFloat( --- 144,160 ---- protected void initDefaults() { defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("intensity", ! "uniform float"), ! 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("lightcolor", ! "uniform color"), ! 1f, 1f, 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("from", "uniform point"), ! 0f, 0f, 0f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("to", "uniform point"), ! 0f, 0f, 1f)); defaultParameters.addParameter( new UniformScalarFloat( *************** *** 164,176 **** (float) Math.toRadians(5))); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("beamdistribution", "uniform float"), 2f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("bias", "uniform float"), .1f)); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("shadowmap", "string"), "")); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("samples", "uniform float"), 16f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("blur", "uniform float"), 0f)); } --- 166,184 ---- (float) Math.toRadians(5))); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("beamdistribution", ! "uniform float"), ! 2f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("bias", "uniform float"), ! .1f)); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("shadowmap", "string"), ! "")); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("samples", "uniform float"), ! 16f)); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("blur", "uniform float"), ! 0f)); } *************** *** 181,185 **** float angle) { super.shade(sv, P, N, angle); ! UniformScalarFloat paramIntensity = (UniformScalarFloat) getParameter(sv, "intensity"); float intensity = paramIntensity.getValue(); UniformScalarTuple3f paramLightcolor = --- 189,194 ---- float angle) { super.shade(sv, P, N, angle); ! UniformScalarFloat paramIntensity = ! (UniformScalarFloat) getParameter(sv, "intensity"); float intensity = paramIntensity.getValue(); UniformScalarTuple3f paramLightcolor = *************** *** 188,199 **** Transform shaderTransform = attributes.getTransform(); if (attributes.getSpace() == Space.WORLD) ! shaderTransform = Global.getTransform("camera").concat(shaderTransform); ! UniformScalarTuple3f paramFrom = (UniformScalarTuple3f) getParameter(sv, "from"); paramFrom.getValue(from); shaderTransform.transformPoint(from, from); ! UniformScalarTuple3f paramTo = (UniformScalarTuple3f) getParameter(sv, "to"); paramTo.getValue(to); shaderTransform.transformPoint(to, to); ! UniformScalarFloat paramConeangle = (UniformScalarFloat) getParameter(sv, "coneangle"); float coneangle = paramConeangle.getValue(); UniformScalarFloat paramConedeltaangle = --- 197,212 ---- Transform shaderTransform = attributes.getTransform(); if (attributes.getSpace() == Space.WORLD) ! shaderTransform = ! Global.getTransform("camera").concat(shaderTransform); ! UniformScalarTuple3f paramFrom = ! (UniformScalarTuple3f) getParameter(sv, "from"); paramFrom.getValue(from); shaderTransform.transformPoint(from, from); ! UniformScalarTuple3f paramTo = ! (UniformScalarTuple3f) getParameter(sv, "to"); paramTo.getValue(to); shaderTransform.transformPoint(to, to); ! UniformScalarFloat paramConeangle = ! (UniformScalarFloat) getParameter(sv, "coneangle"); float coneangle = paramConeangle.getValue(); UniformScalarFloat paramConedeltaangle = *************** *** 203,214 **** (UniformScalarFloat) getParameter(sv, "beamdistribution"); float beamdistribution = paramBeamdistribution.getValue(); ! UniformScalarFloat paramBias = (UniformScalarFloat) getParameter(sv, "bias"); float bias = paramBias.getValue(); UniformScalarString paramShadowmap = (UniformScalarString) getParameter(sv, "shadowmap"); String shadowmap = paramShadowmap.getValue(); ! UniformScalarFloat paramSamples = (UniformScalarFloat) getParameter(sv, "samples"); float samples = paramSamples.getValue(); ! UniformScalarFloat paramBlur = (UniformScalarFloat) getParameter(sv, "blur"); float blur = paramBlur.getValue(); vtmp.sub(to, from); --- 216,230 ---- (UniformScalarFloat) getParameter(sv, "beamdistribution"); float beamdistribution = paramBeamdistribution.getValue(); ! UniformScalarFloat paramBias = ! (UniformScalarFloat) getParameter(sv, "bias"); float bias = paramBias.getValue(); UniformScalarString paramShadowmap = (UniformScalarString) getParameter(sv, "shadowmap"); String shadowmap = paramShadowmap.getValue(); ! UniformScalarFloat paramSamples = ! (UniformScalarFloat) getParameter(sv, "samples"); float samples = paramSamples.getValue(); ! UniformScalarFloat paramBlur = ! (UniformScalarFloat) getParameter(sv, "blur"); float blur = paramBlur.getValue(); vtmp.sub(to, from); Index: SurfacePaintedplastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfacePaintedplastic.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SurfacePaintedplastic.java 13 Apr 2004 20:37:03 -0000 1.6 --- SurfacePaintedplastic... [truncated message content] |