Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tramp 1.2.0 #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<properties>
<clojure.version>1.2.0-master-SNAPSHOT</clojure.version>
<clojure.version>1.2.0-beta1</clojure.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modelVersion>4.0.0</modelVersion>
<groupId>org.clojure</groupId>
<artifactId>clojure-contrib</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>1.2.0-beta1</version>
<url>http://clojure.org/</url>
<description>Clojure user contributions library.</description>
<name>${artifactId}</name>
Expand Down Expand Up @@ -41,7 +41,7 @@
</repository>
<repository>
<id>clojure-releases</id>
<url>http://build.clojure.org/snapshots</url>
<url>http://build.clojure.org/releases</url>
<releases>
<enabled>true</enabled>
</releases>
Expand Down
6 changes: 6 additions & 0 deletions src/main/clojure/clojure/contrib/complex_numbers.clj
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,9 @@
[x]
(let [i (imag x)]
(complex (gm/cos i) (gm/sin i))))

;Franz Haas
(defmethod gm/round ::complex
[x]
(let [[r i] (vals x)]
(complex (gm/round r) (gm/round i))))
25 changes: 24 additions & 1 deletion src/main/clojure/clojure/contrib/swing_utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
;; Created 31 May 2009

(ns clojure.contrib.swing-utils
(:import (java.awt.event ActionListener KeyAdapter)
(:import (java.awt.event ActionListener KeyAdapter MouseListener)
(javax.swing AbstractAction Action
JMenu JMenuBar JMenuItem
SwingUtilities))
Expand All @@ -40,6 +40,23 @@
(.addKeyListener component listener)
listener))

;; ----------------------------------------------------------------------
;; Franz Haas

(defn add-mouse-clicked-listener
"Adds a MouseListener, only setting the clicked interface When a key
is typed, f is invoked with the MouseEvent as its first argument
followed by args. Returns the listener."
[component f & args]
(let [listener (proxy [MouseListener] []
(mouseEntered [e])
(mouseExited [e])
(mousePressed [e])
(mouseReleased [e])
(mouseClicked [event] (apply f event args)))]
(.addMouseListener component listener)
listener))

;; ----------------------------------------------------------------------
;; Meikel Brandmeyer

Expand Down Expand Up @@ -150,3 +167,9 @@
menubar))

;; ----------------------------------------------------------------------
;; Franz Haas

(defn message-box
"shows a message box and return imediately"
[text]
(do-swing (javax.swing.JOptionPane/showMessageDialog nil text)))