LayoutContainer

trait LayoutContainer extends Wrapper

A container that associates layout constraints of member type Constraints with its children.

A container that associates layout constraints of member type Constraints with its children.

See GridBagPanel for an example container with custom constraints.

Note

[Java Swing] In scala.swing, panels and layout managers are combined into subclasses of this base class. This approach allows for typed component constraints.

trait Wrapper
trait Container
trait UIElement
trait LazyPublisher
trait Publisher
trait Reactor
trait Proxy
class Object
trait Matchable
class Any

Type members

Inherited classlikes

protected class Content
Inherited from
Wrapper

Types

type Constraints <: AnyRef

The type of component constraints for this container.

The type of component constraints for this container.

Value members

Abstract methods

protected def add(comp: Component, c: Constraints): Unit

Adds a component with the given constraints to the underlying layout manager and the component peer. This method needs to interact properly with method constraintsFor, i.e., it might need to remove previously held components in order to maintain layout consistency. See BorderPanel for an example.

Adds a component with the given constraints to the underlying layout manager and the component peer. This method needs to interact properly with method constraintsFor, i.e., it might need to remove previously held components in order to maintain layout consistency. See BorderPanel for an example.

protected def areValid(c: Constraints): (Boolean, String)

Checks whether the given constraints are valid. Additionally returns an error string that is only fetched if the constraints aren't valid.

Checks whether the given constraints are valid. Additionally returns an error string that is only fetched if the constraints aren't valid.

Obtains the constraints for the given component from the underlying Swing layout manager.

Obtains the constraints for the given component from the underlying Swing layout manager.

Concrete methods

A map of components to the associated layout constraints. Any element in this map is automatically added to the contents of this panel. Therefore, specifying the layout of a component via

A map of components to the associated layout constraints. Any element in this map is automatically added to the contents of this panel. Therefore, specifying the layout of a component via

layout(myComponent) = myConstraints

also ensures that myComponent is properly added to this container.

Inherited methods

Inherited from
UIElement
def background_=(c: Color): Unit
Inherited from
UIElement
Inherited from
UIElement
def componentOrientation: ComponentOrientation
Inherited from
UIElement
def componentOrientation_=(x: ComponentOrientation): Unit
Inherited from
UIElement
def contents: Seq[Component]
Inherited from
Wrapper
def cursor: Cursor
Inherited from
UIElement
def cursor_=(c: Cursor): Unit
Inherited from
UIElement
def deafTo(ps: Publisher*): Unit

Installed reaction won't receive events from the given publisher anylonger.

Installed reaction won't receive events from the given publisher anylonger.

Inherited from
Reactor
def displayable: Boolean
Inherited from
UIElement
override def equals(that: Any): Boolean
Definition Classes
Proxy -> Any
Inherited from
Proxy
def font: Font
Inherited from
UIElement
def font_=(f: Font): Unit
Inherited from
UIElement
Inherited from
UIElement
def foreground_=(c: Color): Unit
Inherited from
UIElement
override def hashCode(): Int
Definition Classes
Proxy -> Any
Inherited from
Proxy
def ignoreRepaint: Boolean
Inherited from
UIElement
def ignoreRepaint_=(b: Boolean): Unit
Inherited from
UIElement
def listenTo(ps: Publisher*): Unit

Listen to the given publisher as long as deafTo isn't called for them.

Listen to the given publisher as long as deafTo isn't called for them.

Inherited from
Reactor
def locale: Locale
Inherited from
UIElement
Inherited from
UIElement
Inherited from
UIElement
Inherited from
UIElement
def maximumSize_=(x: Dimension): Unit
Inherited from
UIElement
Inherited from
UIElement
def minimumSize_=(x: Dimension): Unit
Inherited from
UIElement
override def peer: JComponent
Definition Classes
Inherited from
Wrapper
Inherited from
UIElement
def preferredSize_=(x: Dimension): Unit
Inherited from
UIElement
def publish(e: Event): Unit

Notify all registered reactions.

Notify all registered reactions.

Inherited from
Publisher
def repaint(rect: Rectangle): Unit
Inherited from
UIElement
def repaint(): Unit
Inherited from
UIElement
def self: Any
Inherited from
UIElement
def showing: Boolean
Inherited from
UIElement
Inherited from
UIElement
override def subscribe(listener: Reaction): Unit
Definition Classes
LazyPublisher -> Publisher
Inherited from
LazyPublisher
override def toString(): String
Definition Classes
Proxy -> Any
Inherited from
Proxy
def toolkit: Toolkit
Inherited from
UIElement
override def unsubscribe(listener: Reaction): Unit
Definition Classes
LazyPublisher -> Publisher
Inherited from
LazyPublisher
def validate(): Unit
Inherited from
UIElement
def visible: Boolean
Inherited from
UIElement
def visible_=(b: Boolean): Unit
Inherited from
UIElement

Inherited fields

protected val _contents: Content
Inherited from
Wrapper
protected val listeners: RefSet[Reaction]
Inherited from
Publisher

All reactions of this reactor.

All reactions of this reactor.

Inherited from
Reactor