1.2.0 permalink Arrow_down_16x16
  • (miglayout container & args)
Adds java.awt.Components to a javax.swing.JComponent with constraints
formatted for the MiGLayout layout manager.

Arguments: container [item constraint*]*

- container: the container for the specified components, its layout
manager will be set to a new instance of MigLayout

- an inline series of items and constraints--each item may be followed
by zero or more constraints.

Item:

- An item is either a Component or one of the keywords :layout
:column or :row. Constraints for a keyword item affect the entire
layout.

Constraint: string, keyword, vector, map, or set

- A string specifies one or more constraints each with zero or more
arguments.
- A keyword specifies a single constraint without arguments
- A vector specifies a single constraint with one or more arguments
- A map specifies one or more constraints as keys, each mapped to a
single argument
- A set groups two or more constraints, each a string, keyword,
vector, map, or set

Any items marked with an "id" constraint will be included in a map from
id to component attached to the container. The map can be retrieved using
clojure.contrib.miglayout/components.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/miglayout.clj:37 top

(defn miglayout
  "Adds java.awt.Components to a javax.swing.JComponent with constraints
  formatted for the MiGLayout layout manager.

  Arguments: container [item constraint*]*

    - container: the container for the specified components, its layout
      manager will be set to a new instance of MigLayout

    - an inline series of items and constraints--each item may be followed
      by zero or more constraints.

  Item:

    - An item is either a Component or one of the keywords :layout
     :column or :row. Constraints for a keyword item affect the entire
      layout.

  Constraint: string, keyword, vector, map, or set

    - A string specifies one or more constraints each with zero or more
      arguments.
    - A keyword specifies a single constraint without arguments
    - A vector specifies a single constraint with one or more arguments
    - A map specifies one or more constraints as keys, each mapped to a
      single argument
    - A set groups two or more constraints, each a string, keyword,
      vector, map, or set

  Any items marked with an \"id\" constraint will be included in a map from
  id to component attached to the container. The map can be retrieved using
  clojure.contrib.miglayout/components."
  [^JComponent container & args]
  (let [item-constraints (apply parse-item-constraints args)
        {:keys [keywords components]} item-constraints
        {:keys [layout column row]} keywords]
    (do-layout container layout column row components)))
Vars in clojure.contrib.miglayout/miglayout: defn let
Used in 0 other vars

Comments top

No comments for miglayout. Log in to add a comment.