Skip to content
Browse files

asdf/require reorg and cleanup, move Vector jimport to utilities.

  • Loading branch information...
1 parent 54b17f1 commit e8ea6804599b190e7b1fb605e2e8d03c576549ef @slyrus committed Mar 30, 2012
Showing with 11 additions and 26 deletions.
  1. +6 −2 abcl-cdk-hacking.asd
  2. +5 −24 abcl-cdk-hacking.lisp
View
8 abcl-cdk-hacking.asd
@@ -1,7 +1,9 @@
(eval-when (:compile-toplevel :load-toplevel :execute)
(cl:require 'abcl-contrib)
- (cl:require 'abcl-asdf))
+ (cl:require 'abcl-asdf)
+ (cl:require 'extensible-sequences)
+ (cl:require 'java-collections))
(asdf:defsystem :abcl-cdk-hacking
:name "abcl-cdk-hacking"
@@ -12,7 +14,9 @@
((:mvn "org.freehep/freehep-graphics2d" :version "2.1.1")
(:mvn "org.freehep/freehep-graphicsio-pdf" :version "2.1.1")
(:mvn "org.freehep/freehep-graphicsio-svg" :version "2.1.1")
- (:mvn "org.openscience/cdk" :version "1.4.7")
+ (:mvn "org.openscience.cdk/cdk" :version "1.4.8-SNAPSHOT")
+ (:file "package")
+ (:file "utilities")
(:file "abcl-cdk-hacking")))
(cl:defpackage #:abcl-cdk-hacking-config (:export #:*base-directory*))
View
29 abcl-cdk-hacking.lisp
@@ -27,23 +27,8 @@
;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (cl:require :extensible-sequences)
- (cl:require :java-collections))
-
-(cl:defpackage :abcl-cdk-hacking
- (:use :common-lisp))
-
(cl:in-package :abcl-cdk-hacking)
-(defmacro jimport (java-package class &optional package)
- `(defparameter ,(apply #'intern class
- (when package (list package)))
- (concatenate 'string (symbol-name (quote ,java-package))
- "."
- (symbol-name (quote ,class)))))
-
(jimport |org.openscience.cdk.smiles| |SmilesParser|)
(jimport |org.openscience.cdk| |DefaultChemObjectBuilder|)
@@ -58,7 +43,6 @@
(jimport |org.openscience.cdk.renderer.visitor| |AWTDrawVisitor|)
(jimport |org.openscience.cdk.layout| |StructureDiagramGenerator|)
-(jimport |java.util| |Vector|)
(jimport |java.awt| |Rectangle|)
(jimport |java.awt| |Dimension|)
(jimport |java.awt.geom| |Rectangle2D$Double|)
@@ -73,11 +57,6 @@
(defun getmol (smiles-string)
(java:jcall "parseSmiles" *smiles-parser* smiles-string))
-(defun jlist (&rest initial-contents)
- (sequence:make-sequence-like
- (java:jnew |Vector|) (length initial-contents)
- :initial-contents initial-contents))
-
(defun mol-to-svg (mol pathname)
(with-open-file (out-stream pathname :direction :output
:if-exists :supersede
@@ -128,8 +107,10 @@
java:+true+)
(java:jcall "endExport" vg))))
-(defparameter *tam* (getmol "CCC(=C(C1=CC=CC=C1)C2=CC=C(C=C2)OCCN(C)C)C3=CC=CC=C3"))
+(defparameter *caffeine*
+ (java:jcall "parseSmiles" *smiles-parser* "CN1C=NC2=C1C(=O)N(C(=O)N2C)C"))
+
+(mol-to-svg *caffeine* "/tmp/caffeine.svg")
-(mol-to-svg *tam* "/tmp/tam.svg")
+(mol-to-pdf *caffeine* "/tmp/caffeine.pdf")
-(mol-to-pdf *tam* "/tmp/tam.pdf")

0 comments on commit e8ea680

Please sign in to comment.
Something went wrong with that request. Please try again.