SwingPlus
statement
SwingPlus tries to fill in the holes left behind by Scala-Swing. From missing .width
and .height
methods to
missing components such as Spinner
to additional components such GroupPanel
.
SwingPlus is (C)opyright 2013–2020 Hanns Holger Rutz and released under
the GNU Lesser General Public License v2.1+ and comes
with absolutely no warranties. To contact the author, send an email to contact at sciss.de
.
It contains some classes (e.g. ComboBox
) derived from the original Scala-Swing package, (C)opyright 2007-2013,
LAMP/EPFL, which was released under a BSD style license.
requirements / installation
This project builds with sbt against Scala 2.13, 2.12, Dotty.
To use the library in your project:
"de.sciss" %% "swingplus" % v
The current version v
is "0.5.0"
contributing
Please see the file CONTRIBUTING.md
documentation
All classes and methods reside in package de.sciss.swingplus
.
additional standard components
GroupPanel
is a panel with a group-layout. I departed from Andreas Flierl's approach and simplified or changed the API, reducing the amount of complex conversions. I think I have arrived at a reasonable simple to use component.OverlayPanel
is a panel with an overlay-layout.ToolBar
wraps the corresponding javax component.Separator
wraps the corresponding javax component.Spinner
wraps the corresponding javax component. Currently it still relies on javax'sSpinnerModel
. A future version might seem a more Scala'ish wrapper for the model, too.PopupMenu
wraps the corresponding javax component. Note that Scala 2.11 does have a popup menu now, but you can use this one for compatibility between Scala 2.10 and 2.11.ComboBox
does away with the Scala-Swing version that has problems compiling under JDK 7 due to the retrofitting of generics in Swing. It achieves this by hiding the peer type, at the same time adding a few missing methods and therefore making it usually unnecessary to gain access to theJComboBox
peer type. I have also added a properModel
wrapper.ListView
has the same problem asComboBox
in standard Scala-Swing. The version provided here is also usable in project that want to allows compilation both in JDK 6 and 7. It also has a properModel
wrapper. Note that it fires events inswingplus.event
instead ofscala.swing.event
.ScrollBar
fixes the Scala-Swing version by dispatchingValueChanged
events.DropMode
is a type-safe enumeration wrapping the javax constants. It is currently used for theListView
.
additional utility components
DoClickAction
is an action that causes a visual button pressLabeled
is a useful class for presenting fully typed objects in a combo-box, providing an alternative string representationPaddedIcon
adds an extra margin to an existingIcon
SpinningProgressBar
is a small indefinite progress bar that can be hidden. Some look-and-feels (e.g. Aqua) support rendering a spinning icon instead of a bar.SpinnerComboBox
is a combo-box with aSpinner
for editing numbers.
extension methods
They are imported through swingplus.Implicits._
.
UIElement
. Methodswidth
andheight
are provided, so one does not have to create aDimension
viasize
first.Component
. Methodbaseline
is provided. This is currently using theInt
type of javax. A future version might use a type-safe enumeration instead. MethodclientProps
creates a lightweight wrapper for the component's client properties, providing a subset of methods familiar from Scala'scollection.mutable.Map
.Frame
. MethoddefaultCloseOperation
is provided with the type-safe enumeration typeCloseOperation
.Action.wrap
allows one to wrap a javaxAction
as a Scala-SwingAction
.
related
Please also check out the ScalaSwingContrib project which has similar goals.
Also check out the TreeTable project which provides a very powerful component, combining tree and table. Ideally this will also go into the mix, but API needs to be properly developed and should negotiate common interface with Ken Scambler's tree implementation.
Finally, there is Desktop, which aims rather at an application framework based on Swing.