Mercurial > rlm
comparison src/rlm/visualize.clj @ 9:1065e7d615a4 tip
deactivate some cruft.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 08 Jul 2013 12:51:12 -0400 |
parents | 12d1367cf1aa |
children |
comparison
equal
deleted
inserted
replaced
8:7240d7a5f959 | 9:1065e7d615a4 |
---|---|
9 (:import java.awt.image.BufferedImage | 9 (:import java.awt.image.BufferedImage |
10 [ij ImagePlus IJ])) | 10 [ij ImagePlus IJ])) |
11 | 11 |
12 (defmulti visual (fn [& args] (class (last args)))) | 12 (defmulti visual (fn [& args] (class (last args)))) |
13 | 13 |
14 (import '[org.scilab.forge.jlatexmath TeXConstants TeXFormula TeXIcon]) | 14 ;;(import '[org.scilab.forge.jlatexmath TeXConstants TeXFormula TeXIcon]) |
15 (import java.awt.Insets) | 15 (import java.awt.Insets) |
16 (import javax.swing.JLabel) | 16 (import javax.swing.JLabel) |
17 (import java.awt.Color) | 17 (import java.awt.Color) |
18 | 18 |
19 | 19 |
30 (defmethod visual BufferedImage | 30 (defmethod visual BufferedImage |
31 [image] | 31 [image] |
32 (visual (ImagePlus. "visual" image))) | 32 (visual (ImagePlus. "visual" image))) |
33 | 33 |
34 | 34 |
35 (defmethod visual TeXFormula | 35 ;; (defmethod visual TeXFormula |
36 [formula] | 36 ;; [formula] |
37 (let [icon | 37 ;; (let [icon |
38 (doto (.createTeXIcon formula TeXConstants/STYLE_DISPLAY 30) | 38 ;; (doto (.createTeXIcon formula TeXConstants/STYLE_DISPLAY 30) |
39 (.setInsets (Insets. 5 5 5 5))) | 39 ;; (.setInsets (Insets. 5 5 5 5))) |
40 image (BufferedImage. (.getIconWidth icon) (.getIconHeight icon) | 40 ;; image (BufferedImage. (.getIconWidth icon) (.getIconHeight icon) |
41 BufferedImage/TYPE_INT_ARGB) | 41 ;; BufferedImage/TYPE_INT_ARGB) |
42 g (.createGraphics image) | 42 ;; g (.createGraphics image) |
43 jl (JLabel.)] | 43 ;; jl (JLabel.)] |
44 (.setForeground jl (Color. 0 0 0)) | 44 ;; (.setForeground jl (Color. 0 0 0)) |
45 (.setColor g Color/white) | 45 ;; (.setColor g Color/white) |
46 (.fillRect g 0 0 (.getIconWidth icon) (.getIconHeight icon)) | 46 ;; (.fillRect g 0 0 (.getIconWidth icon) (.getIconHeight icon)) |
47 (.paintIcon icon jl g 0 0) | 47 ;; (.paintIcon icon jl g 0 0) |
48 (visual image))) | 48 ;; (visual image))) |
49 | 49 |
50 | 50 |
51 | 51 |
52 | 52 |
53 | 53 |