API for seesaw.swingx
-
by Dave Ray
Full namespace name:
seesaw.swingx
Overview
SwingX integration. Unfortunately, SwingX is hosted on java.net which means
it looks abandoned most of the time. Downloads are here
http://java.net/downloads/swingx/releases/1.6/
This is an incomplete wrapper. If something's missing that you want, just ask.
Public Variables and Functions
busy-label
function
Usage: (busy-label & args)
Creates a org.jdesktop.swingx.JXBusyLabel which is a label that shows
'busy' status with a spinner, kind of like an indeterminate progress bar.
Additional options:
:busy? Whether busy status should be shown or not. Defaults to false.
Examples:
(busy-label :text "Processing ..."
:busy? true)
See:
(seesaw.core/label)
(seesaw.core/label-options)
(seesaw.swingx/busy-label-options)
function
Usage: (button-x & args)
Creates a org.jdesktop.swingx.JXButton which is an improved (button) that
supports painters. Supports these additional options:
:foreground-painter The foreground painter
:background-painter The background painter
:paint-border-insets? Default to true. If false painter paints entire
background.
Examples:
See:
(seesaw.core/button)
(seesaw.core/button-options)
(seesaw.swingx/button-x-options)
function
Usage: (color-selection-button & args)
Creates a color selection button. In addition to normal button options,
supports:
:selection A color value. See (seesaw.color/to-color)
The currently selected color canbe retrieved with (seesaw.core/selection).
Examples:
(def b (color-selection-button :selection :aliceblue))
(selection! b java.awt.Color/RED)
(listen b :selection
(fn [e]
(println "Selected color changed to ")))
See:
(seesaw.swingx/color-selection-button-options)
(seesaw.color/color)
function
Usage: (header & args)
Creates a header which consists of a title, description (supports basic HTML)
and an icon. Additional options:
:title The title. May be a resource.
:description The description. Supports basic HTML (3.2). May be a resource.
:icon The icon. May be a resource.
Examples:
(header :title "This is a title"
:description "<html>A <b>description</b> with some
<i>italics</i></html>"
:icon "http://url/to/icon.png")
See:
(seesaw.swingx/header-options)
hyperlink
function
Usage: (hyperlink & args)
Constuct an org.jdesktop.swingx.JXHyperlink which is a button that looks like
a link and opens its URI in the system browser. In addition to all the options of
a button, supports:
:uri A string, java.net.URL, or java.net.URI with the URI to open
Examples:
(hyperlink :text "Click Me" :uri "http://google.com")
See:
(seesaw.core/button)
(seesaw.core/button-options)
label-x
function
Usage: (label-x & args)
Creates a org.jdesktop.swingx.JXLabel which is an improved (label) that
supports wrapped text, rotation, etc. Additional options:
:wrap-lines? When true, text is wrapped to fit
:text-rotation Rotation of text in radians
Examples:
(label-x :text "This is really a very very very very very very long label"
:wrap-lines? true
:rotation (Math/toRadians 90.0))
See:
(seesaw.core/label)
(seesaw.core/label-options)
(seesaw.swingx/label-x-options)
listbox-x
function
Usage: (listbox-x & args)
Create a JXList which is basically an improved (seesaw.core/listbox).
Additional capabilities include sorting, searching, and highlighting.
Beyond listbox, has the following additional options:
:sort-with A comparator (like <, >, etc) used to sort the items in the
model.
:sort-order :ascending or descending
:highlighters A list of highlighters
By default, ctrl/cmd-F is bound to the search function.
Examples:
See:
(seesaw.core/listbox)
table-x
function
Usage: (table-x & args)
Create a JXTable which is basically an improved (seesaw.core/table).
Additional capabilities include searching, sorting and highlighting.
Beyond table, has the following additional options:
:column-control-visible? Show column visibility control in upper right corner.
Defaults to true.
:column-margin Set margin between cells in pixels
:highlighters A list of highlighters
:horizontal-scroll-enabled? Allow horizontal scrollbars. Defaults to false.
By default, ctrl/cmd-F is bound to the search function.
Examples:
See:
(seesaw.core/table-options)
(seesaw.core/table)
task-pane
function
Usage: (task-pane & args)
Create a org.jdesktop.swingx.JXTaskPane which is a collapsable component with a title
and icon. It is generally used as an item inside a task-pane-container. Supports the
following additional options
:resource Get icon and title from a resource
:icon The icon
:title The pane's title
:animated? True if collapse is animated
:collapsed? True if the pane should be collapsed
:scroll-on-expand? If true, when expanded, it's container will scroll the pane into
view
:special? If true, the pane will be displayed in a 'special' way depending on
look and feel
The pane can be populated with the standard :items option, which just takes a
sequence of widgets. Additionally, the :actions option takes a sequence of
action objects and makes hyper-links out of them.
See:
(seesaw.swingx/task-pane-options)
(seesaw.swingx/task-pane-container)
task-pane-container
function
Usage: (task-pane-container & args)
Creates a container for task panes. Supports the following additional
options:
:items Sequence of task-panes to display
Examples:
(task-pane-container
:items [(task-pane :title "First"
:actions [(action :name "HI")
(action :name "BYE")])
(task-pane :title "Second"
:actions [(action :name "HI")
(action :name "BYE")])
(task-pane :title "Third" :special? true :collapsed? true
:items [(button :text "YEP")])])
See:
(seesaw.swingx/task-pane-container-options)
(seesaw.swingx/task-pane)
titled-panel
function
Usage: (titled-panel & args)
Creates a panel with a title and content. Has the following properties:
:content The content widget. Passed through (seesaw.core/to-widget)
:title The text of the title. May be a resource.
:title-color Text color. Passed through (seesaw.color/to-color). May
be resource.
:left-decoration Decoration widget on left of title.
:right-decoration Decoration widget on right of title.
:resource Set :title and :title-color from a resource bundle
:painter Painter used on the title
Examples:
(titled-panel :title "Error"
:title-color :red
:content (label-x :wrap-lines? true
:text "An error occurred!"))
See:
(seesaw.core/listbox)
tree-x
function
Usage: (tree-x & args)
Create a JXTree which is basically an improved (seesaw.core/tree).
Additional capabilities include searching, and highlighting.
Beyond tree, has the following additional options:
:highlighters A list of highlighters
By default, ctrl/cmd-F is bound to the search function.
Examples:
See:
(seesaw.core/tree-options)
(seesaw.core/tree)