Skip to content

Commit

Permalink
merge with jcp21
Browse files Browse the repository at this point in the history
git-svn-id: https://cdk.svn.sourceforge.net/svnroot/cdk/trunk/cdk@5783 eb4e18e3-b210-0410-a6ab-dec725e4b171
  • Loading branch information
shk3 committed Mar 7, 2006
1 parent 29f7757 commit 03a7837
Show file tree
Hide file tree
Showing 79 changed files with 2,509 additions and 1,393 deletions.
1 change: 1 addition & 0 deletions EditorApplet.html
Expand Up @@ -14,6 +14,7 @@ <h2>
<param name="load" value="src/data/mdl/a-pinene.mol">
</applet>
<a href="javascript:alert(document.Editor.getMolFile())">show mol file</a>
<a href="javascript:document.Editor.clear()">clear</a>
<blockquote>
<hr>

Expand Down
256 changes: 256 additions & 0 deletions applet/org/openscience/cdk/tools/LoggingTool.java
@@ -0,0 +1,256 @@
/* $RCSfile$
* $Author$
* $Date$
* $Revision$
*
* Copyright (C) 2001-2005 The Chemistry Development Kit (CDK) project
*
* Contact: cdk-devel@lists.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.openscience.cdk.tools;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringReader;
import java.net.URL;
import java.util.Properties;

/**
* Useful for logging messages. Often used as a class static variable instantiated like:
* <pre>
* private static org.openscience.cdk.tools.LoggingTool logger = new LoggingTool(ThisClass.class.getName(), true);
* </pre>
*
* <p>Uses log4j as a backend if available, and System.out otherwise.
*
* <p>Jmol version of LoggingTool.
*
* @cdk.module standard
*/
public class LoggingTool {

private boolean debug = false;
private boolean tostdout = true;

private String classname;

/** Default number of StackTraceElements to be printed by debug(Exception) */
private final int DEFAULT_STACK_LENGTH = 5;

private int stackLength = DEFAULT_STACK_LENGTH;

public LoggingTool() {
}

public LoggingTool(Object object) {
}

public LoggingTool(Class classInst) {
}

public static void configureLog4j() {
}

public void dumpSystemProperties() {
debug("os.name : " + System.getProperty("os.name"));
debug("os.version : " + System.getProperty("os.version"));
debug("os.arch : " + System.getProperty("os.arch"));
debug("java.version : " + System.getProperty("java.version"));
debug("java.vendor : " + System.getProperty("java.vendor"));
}

/**
* Sets the number of StackTraceElements to be printed in DEBUG mode.
* Defaults to DEFAULT_STACK_LENGTH.
*/
public void setStackLength(int length) {
this.stackLength = length;
}

public void dumpClasspath() {
debug("java.class.path: " + System.getProperty("java.class.path"));
}

/**
* Shows debug output for the Object. If the object is an instanceof
* Throwable it will output the trace. Otherwise it will use the
* toString() method.
*/
public void debug(Object object) {
}

private void debugString(String string) {
}

public void debug(Object object, Object object2) {
}

public void debug(Object object, int number) {
}

public void debug(Object object, double number) {
}

public void debug(Object obj, Object obj2, Object obj3) {
}

public void debug(Object obj, Object obj2, Object obj3, Object obj4) {
}

public void debug(Object obj, Object obj2, Object obj3, Object obj4, Object obj5) {
}

private void debugThrowable(Throwable problem) {
}

public void error(Object object) {
if (debug) {
errorString(object.toString());
}
}

public void error(Object object, int number) {
if (debug) {
errorString(object.toString() + number);
}
}

public void error(Object object, double number) {
if (debug) {
errorString(object.toString() + number);
}
}

private void errorString(String string) {
toSTDOUT("ERROR", string);
}

public void error(Object object, Object object2) {
if (debug) {
errorString(object.toString() + object2.toString());
}
}

public void error(Object obj, Object obj2, Object obj3) {
if (debug) {
errorString(obj.toString() + obj2.toString() + obj3.toString());
}
}

public void error(Object obj, Object obj2, Object obj3, Object obj4) {
if (debug) {
errorString(obj.toString() + obj2.toString() + obj3.toString() +
obj4.toString());
}
}

public void error(Object obj, Object obj2, Object obj3, Object obj4, Object obj5) {
if (debug) {
errorString(obj.toString() + obj2.toString() + obj3.toString() +
obj4.toString() + obj5.toString());
}
}

public void fatal(Object object) {
toSTDOUT("FATAL", object.toString());
}

public void info(Object object) {
if (debug) {
infoString(object.toString());
}
}

public void info(Object object, int number) {
if (debug) {
infoString(object.toString() + number);
}
}

public void info(Object object, double number) {
if (debug) {
infoString(object.toString() + number);
}
}

private void infoString(String string) {
toSTDOUT("INFO", string);
}

public void info(Object object, Object object2) {
if (debug) {
infoString(object.toString() + object2.toString());
}
}

public void info(Object obj, Object obj2, Object obj3) {
if (debug) {
infoString(obj.toString() + obj2.toString() + obj3.toString());
}
}

public void info(Object obj, Object obj2, Object obj3, Object obj4) {
if (debug) {
infoString(obj.toString() + obj2.toString() + obj3.toString() +
obj4.toString());
}
}

public void info(Object obj, Object obj2, Object obj3, Object obj4, Object obj5) {
if (debug) {
infoString(obj.toString() + obj2.toString() + obj3.toString() +
obj4.toString() + obj5.toString());
}
}
public void warn(Object object) {
}

private void warnString(String string) {
}

public void warn(Object object, int number) {
}

public void warn(Object object, double number) {
}

public void warn(Object object, Object object2) {
}

public void warn(Object obj, Object obj2, Object obj3) {
}

public void warn(Object obj, Object obj2, Object obj3, Object obj4) {
}

public void warn(Object obj, Object obj2, Object obj3, Object obj4, Object obj5) {
}

public boolean isDebugEnabled() {
return debug;
}

private void toSTDOUT(String level, String message) {
System.out.print(classname);
System.out.print(" ");
System.out.print(level);
System.out.print(": ");
System.out.println(message);
}

}
24 changes: 23 additions & 1 deletion build-applet.xml
Expand Up @@ -45,13 +45,36 @@
</sequential>
</macrodef>

<!-- <echo message="Compiling applet logging tool org/openscience/cdk/tools/LoggingTool.java to ${appjars.dir}"/>
<delete file="${appjars.dir}/org/openscience/cdk/tools/LoggingTool.class"/>
<javac srcdir="applet" destdir="${appjars.dir}" optimize="${optimization}" debug="${debug}" deprecation="${deprecation}" target="1.3" source="1.3">
</javac>-->

<jar-from-list destfile="${dist}/jar/jchempaint-applet-viewer-opts.jar" includesfile="${metainf}/applet-viewer-opts.files"/>
<jar-from-list destfile="${dist}/jar/jchempaint-applet-editor.jar" includesfile="${metainf}/applet-editor.files"/>
<jar-from-list destfile="${dist}/jar/jchempaint-applet-editor-opts.jar" includesfile="${metainf}/applet-editor-opts.files"/>
<jar-from-list destfile="${dist}/jar/jchempaint-applet-resources.jar" includesfile="${metainf}/jchempaint.application.datafiles"/>
<!-- the following jar files are packed from directory patterns -->
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk_applications_jchempaint.jar" includepattern="org/openscience/cdk/applications/jchempaint/**"/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk_applications.jar" includepattern="org/openscience/cdk/applications/**"/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk_config.jar" includepattern="org/openscience/cdk/config/**"
/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk_dict.jar" includepattern="org/openscience/cdk/dict/**"
/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk_io.jar" includepattern="org/openscience/cdk/io/**"
/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk_qsar.jar" includepattern="org/openscience/cdk/qsar/**"
/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk_iupac.jar" includepattern="org/openscience/cdk/iupac/**"
/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk_math.jar" includepattern="org/openscience/cdk/math/**"
/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk_tools.jar" includepattern="org/openscience/cdk/tools/**"
/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk_structgen.jar" includepattern="org/openscience/cdk/structgen/**"
/>


<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience_cdk.jar" includepattern="org/openscience/cdk/**"/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_openscience.jar" includepattern="org/openscience/**"/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-org_3pq.jar" includepattern="org/_3pq/**"/>
Expand All @@ -71,7 +94,6 @@
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-javax_xml.jar" includepattern="javax/xml/**"/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-jumbo.jar" includepattern="jumbo/**"/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-nu.jar" includepattern="nu/**"/>
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-uk.jar" includepattern="uk/**"/>
<!-- the following jar contains all other classes and resources -->
<jar-from-pattern destfile="${dist}/jar/jchempaint-applet-others.jar" includepattern="**/*"/>
<!-- the main jar file is packed from a list, but it must be packed as last file because it contains INDEX.LIST -->
Expand Down
4 changes: 2 additions & 2 deletions build.props
@@ -1,2 +1,2 @@
version=cvs.post.20050826
jcp.version=2.1.5
version=cvs.20060303
jcp.version=2.2.0
4 changes: 2 additions & 2 deletions build.xml
Expand Up @@ -468,7 +468,7 @@

<!-- ok, now that we have a copy, compile this copy -->
<javac srcdir="${build.src}" destdir="${build}" optimize="${optimization}"
debug="${debug}" deprecation="${deprecation}">
debug="${debug}" deprecation="${deprecation}" target="1.3" source="1.3">
<classpath>
<fileset dir="${lib}" >
<exclude name="**/*" unless="module.libdepends.present" />
Expand Down Expand Up @@ -846,7 +846,7 @@
<target id="run-test" name="run-test" depends="dist-all"
description="Runs one specific JUnit test suite (org.openscience.cdk.test.&lt;class>) as a standalone application with -Dtestclass=&lt;class>.">
<echo message="Running test class: testclass=${testclass}"/>
<java classname="org.openscience.cdk.test.${testclass}" fork="yes">
<java classname="org.openscience.cdk.test.${testclass}" fork="yes" maxmemory="512m">
<jvmarg value="-Dcdk.debugging=true"/>
<classpath>
<fileset dir="${dist}/jar/">
Expand Down
Binary file removed jar/jh.jar
Binary file not shown.
19 changes: 19 additions & 0 deletions src/META-INF/applet-editor-opts.files
Expand Up @@ -284,3 +284,22 @@ org/openscience/cdk/validate/ValidatorInterface.class
org/xml/sax/ext/Attributes2.class
org/xml/sax/ext/DefaultHandler2.class
org/xml/sax/ext/EntityResolver2.class
org/openscience/cdk/config/ElementPTFactory.class
org/openscience/cdk/config/elements/ElementPTReader.class
org/openscience/cdk/config/elements/ElementPTHandler.class
org/openscience/cdk/PeriodicTableElement.class
org/openscience/cdk/config/elements/ElementPTReader.class
org/openscience/cdk/config/elements/ElementPTHandler.class
org/openscience/cdk/applications/swing/PeriodicTablePanel$BackAction.class
org/openscience/cdk/isomorphism/matchers/QueryBond.class
org/openscience/cdk/applications/undoredo/ChangeCoordsEdit.class
org/openscience/cdk/applications/undoredo/ChangeAtomSymbolEdit.class
org/openscience/cdk/applications/undoredo/CleanUpEdit.class
org/openscience/cdk/applications/swing/periodicTable_Mendeleev.jpg
org/openscience/cdk/config/CDKBasedAtomTypeConfigurator.class
org/openscience/cdk/config/atomtypes/AtomTypeReader.class
org/openscience/cdk/config/atomtypes/AtomTypeHandler.class
org/openscience/cdk/config/AtomTypeConfigurator.class
org/openscience/cdk/config/data/chemicalElements.xml
org/openscience/cdk/config/data/structgen_atomtypes.xml

0 comments on commit 03a7837

Please sign in to comment.