API for miglayout
- ()
by Stephen C. Gilardi
clojure-contrib is now deprecated
clojure-contrib is no longer being developed or maintained.
Rather than a single, monolithic, contributions library, Clojure now has
a set of separate libraries for each unit of functionality. The libraries
are in the Clojure GitHub organization at
https://github.com/clojure.
API documentation of the libraries can be found at
https://clojure.github.io.
If you're looking for a specific function or namespace from the old
clojure-contrib, see
"Where Did Clojure.Contrib Go".
Full namespace name:
clojure.contrib.miglayout
Overview
Clojure support for the MiGLayout layout manager
http://www.miglayout.com/
Example:
(use '[clojure.contrib.miglayout.test :as mlt :only ()])
(dotimes [i 5] (mlt/run-test i))
Public Variables and Functions
components
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (components container)
Returns a map from id (a keyword) to component for all components with
an id constraint set
Source
miglayout
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (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.
Source
miglayout.internal
add-components
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (add-components container components)
Adds components with constraints to a container
Source
component?
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (component? x)
Returns true if x is a java.awt.Component
Source
constraint?
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (constraint? x)
Returns true if x is not a keyword-item or component
Source
do-layout
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (do-layout container layout column row components)
Attaches a MigLayout layout manager to container and adds components
with constraints
Source
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (format-constraint c)
Returns a vector of vectors representing one or more constraints
separated by commas. Constraints may be specified in Clojure using
strings, keywords, vectors, maps, and/or sets.
Source
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (format-constraints & constraints)
Returns a string representing all the constraints for one keyword-item
or component formatted for miglayout.
Source
get-components
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (get-components container)
Returns a map from id to component for all components with an id
Source
parse-component-constraint
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (parse-component-constraint constraint)
Parses a component constraint string returning a CC object
Source
parse-item-constraints
function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (parse-item-constraints & args)
Iterates over args and builds a map containing values associated with
:keywords and :components. The value for :keywords is a map from keyword
items to constraints strings. The value for :components is a vector of
vectors each associating a component with its constraints string.
Source