aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/miglayout
diff options
context:
space:
mode:
authorscgilardi <scgilardi@gmail.com>2008-10-09 01:04:29 +0000
committerscgilardi <scgilardi@gmail.com>2008-10-09 01:04:29 +0000
commit35631a80f94820eb355b4032bdca6f9f53d33621 (patch)
treeefa17437dd313a660b397c2133e98fc74d3a8b97 /src/clojure/contrib/miglayout
parent0d66a5b133475b8297a15ee53850f8d518f7d652 (diff)
miglayout: updated docs
Diffstat (limited to 'src/clojure/contrib/miglayout')
-rw-r--r--src/clojure/contrib/miglayout/miglayout.clj34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/clojure/contrib/miglayout/miglayout.clj b/src/clojure/contrib/miglayout/miglayout.clj
index 62cb6fb4..3d8bbd9e 100644
--- a/src/clojure/contrib/miglayout/miglayout.clj
+++ b/src/clojure/contrib/miglayout/miglayout.clj
@@ -27,28 +27,32 @@
"Adds java.awt.Components to a java.awt.Container with constraints
formatted for the MiGLayout layout manager.
- Arguments:
- - container is the container for the subsequent components
- - an optional map mapping any or all of the keys :layout, :column
- or :row to a string that specifies the corresponding constraints for
- the whole layout
- - a series of compononents, each followed by zero or more component
- constraints
+ Arguments: container layout-constraints? [component constraint*]*
- Component constraints may be supplied as strings, keywords, vectors, or
- maps. The set of constraints for a single component is presented to
- MiGLayout as a single string with each constraint and its arguments
- separated from any subsequent constraint by a comma. Keywords appear
- without their leading colons.
+ - container: the container for the specified components, its layout
+ manager will be set to a new instance of MigLayout
+ - layout-constraints: an optional map that maps any or all of
+ :layout, :column, and/or :row to a string that specifies the
+ corresponding constraints for the whole layout
+ - an inline series of components and constraints: each component may be
+ followed by zero or more component constraints
+
+ The set of constraints for each component is presented to MiGLayout as a
+ single string with each constraint and its arguments separated from any
+ subsequent constraint by a comma.
+
+ Component constraint: string, keyword, vector, or map
- Component constraints:
- A string specifies one or more constraints each with zero or more
arguments. If it specifies more than one constraint, the string must
include commas to separate them.
- A keyword specifies a single constraint without arguments
- - A vector specifies a single constraint with zero or more arguments
+ - A vector specifies a single constraint with one or more arguments
- A map specifiess one or more constraints as keys, each mapped to a
- single argument"
+ single argument
+
+ Empty strings, vectors, and maps are accepted but don't affect the
+ layout."
[#^Container container & args]
(let [[f & r :as a] args
[constraints args] (if (map? f) [f r] [nil a])