class org.aswing.JSplitPane extends Container

JSplitPane is used to divide two (and only two) Components. The two Components are graphically divided based on the look and feel implementation, and the two Components can then be interactively resized by the user.

The two Components in a split pane can be aligned left to right using JSplitPane.HORIZONTALSPLIT, or top to bottom using JSplitPane.VERTICALSPLIT. The preferred way to change the size of the Components is to invoke setDividerLocation where location is either the new x or y position, depending on the orientation of the JSplitPane.

To resize the Components to their preferred sizes invoke resetToPreferredSizes.

When the user is resizing the Components the minimum size of the Components is used to determine the maximum/minimum position the Components can be set to. If the minimum size of the two components is greater than the size of the split pane the divider will not allow you to resize it. To alter the minimum size of a JComponent, see JComponent#minimumSize.

When the user resizes the split pane the new space is distributed between the two components based on the resizeWeight property. A value of 0, the default, indicates the right/bottom component gets all the space, where as a value of 1 indicates the left/top component gets all the space.

@author paling

Class Fields

static var DIVIDER:String

Used to add a Component to the divider Component.

static var HORIZONTAL_SPLIT:Int

Horizontal split indicates the Components are split along the x axis. For example the two Components will be split one to the left of the other.

static var LEFT:String

Used to add a Component to the left of the other Component.

static var RIGHT:String

Used to add a Component to the right of the other Component.

static var VERTICAL_SPLIT:Int

Vertical split indicates the Components are split along the y axis. For example the two Components will be split one on top of the other.

Instance Fields

Show inherited public instance fieldsHide inherited public instance fields

Inherited from Container

var layout:LayoutManager
function append(com:Component, ?constraints:Dynamic):Void
function appendAll(coms:Array<Dynamic>):Void
function doLayout():Void
function getComponent(index:Int):Component
function getComponentCount():Int
function getComponents():Array<Dynamic>
function getFocusTraversalPolicy():FocusTraversalPolicy
function getIndex(com:Component):Int
function getLayout():LayoutManager
function insert(i:Int, com:Component, ?constraints:Dynamic):Void
function insertAll(index:Int, coms:Array<Dynamic>):Void
function invalidate():Void
function isAncestorOf(c:Component):Bool
function reAppendChildren():Void
function remove(com:Component):Component
function removeAll():Void
function removeAt(i:Int):Component
function removeChild(child:DisplayObject):DisplayObject
function removeChildAt(index:Int):DisplayObject
function setFocusTraversalPolicy(ftp:FocusTraversalPolicy):Void
function setLayout(layout:LayoutManager):Void
function validate():Void

Inherited from Component

var __fieldBindings__:FieldsBindSignal
var __methodBindings__:MethodsBindSignal
var alignmentX:Float
var alignmentY:Float
var background:ASColor
var backgroundDecorator:GroundDecorator
var border:Border
var bounds:IntRectangle
var clipBounds:IntRectangle
var constraints:Dynamic
var currentSize:IntDimension
var dragEnabled:Bool
var dropTrigger:Bool
var enabled:Bool
var focusable:Bool
var focusableSet:Bool
var font:ASFont
var foreground:ASColor
var foregroundDecorator:GroundDecorator
var location:IntPoint
var maximumSize:IntDimension
var mideground:ASColor
var minimumSize:IntDimension
var opaque:Bool
var opaqueSet:Bool
var preferredSize:IntDimension
var resizerMargin:Insets
var styleProxy:Component
var styleTune:StyleTune
var toolTipText:String
var transitFocusFactor:Float
var ui:ComponentUI
var uiElement:Bool
var visibility:Bool
function addDragAcceptableInitiator(com:Component):Void
function componentToGlobal(p:IntPoint):IntPoint
function getClientProperty(key:String, ?defaultValue:Dynamic):Dynamic
function getDefaultBasicUIClass():Class<Dynamic>
function getFocusManager():FocusManager
function getGlobalLocation(?rv:IntPoint):IntPoint
function getInsets():Insets
function getInternalFocusObject():InteractiveObject
function getKeyboardManager():KeyboardManager
function getMousePosition():IntPoint
function getPaintBounds():IntRectangle
function getParent():Container
function getRootPaneAncestor():JRootPane
function getUIClassID():String
function globalToComponent(p:IntPoint):IntPoint
function hitTestMouse():Bool
function invalidate():Void
function invalidatePreferSizeCaches():Void
function isCachePreferSizes():Bool
function isDragAcceptableInitiator(com:Component):Bool
function isFocusOwner():Bool
function isFontValidated():Bool
function isOnStage():Bool
function isShowing():Bool
function isValid():Bool
function isValidateRoot():Bool
function makeFocus():Void
function pack():Void
function paintFocusRect(?force:Bool):Void
function paintImmediately():Void
function parentReAppendChildren():Void
function putClientProperty(key:String, value:Dynamic):Void
function reAppendToParent(?constraints:Dynamic):Void
function removeDragAcceptableInitiator(com:Component):Void
function removeFromContainer():Void
function repaint():Void
function repaintAndRevalidate():Void
function requestFocus():Bool
function revalidate():Void
function setCachePreferSizes(b:Bool):Void
function setClipSize(size:IntDimension):Void
function setDragAcceptableInitiatorAppraiser(func:Dynamic ->Bool):Void
function setFontValidated(b:Bool):Void
function setGlobalLocation(gp:IntPoint):Void
function transferFocus():Bool
function transferFocusBackward():Bool
function updateUI():Void
function validate():Void

Inherited from AWSprite

function bringToBottom(child:DisplayObject):Void
function bringToTop(child:DisplayObject):Void
function containsChild(child:DisplayObject):Bool
function getHighestIndexUnderForeground():Int
function getLowestIndexAboveBackground():Int
function isClipMasked():Bool
function setChildIndex(child:DisplayObject, index:Int):Void
function setClipMaskRect(b:IntRectangle):Void
function setClipMasked(m:Bool):Void
function toString():String

Inherited from Sprite

var buttonMode:Bool
var dropTarget:DisplayObject
var graphics:Graphics
var hitArea:Sprite
var soundTransform:SoundTransform
var useHandCursor:Bool
function startDrag(?lockCenter:Bool, ?bounds:Rectangle):Void
function startTouchDrag(touchPointID:Int, ?lockCenter:Bool, ?bounds:Rectangle):Void
function stopDrag():Void
function stopTouchDrag(touchPointID:Int):Void

Inherited from DisplayObjectContainer

var mouseChildren:Bool
var numChildren:Int
var tabChildren:Bool
var textSnapshot:TextSnapshot
function addChild(child:DisplayObject):DisplayObject
function addChildAt(child:DisplayObject, index:Int):DisplayObject
function areInaccessibleObjectsUnderPoint(point:Point):Bool
function contains(child:DisplayObject):Bool
function getChildAt(index:Int):DisplayObject
function getChildByName(name:String):DisplayObject
function getChildIndex(child:DisplayObject):Int
function getObjectsUnderPoint(point:Point):Array<DisplayObject>
function removeChild(child:DisplayObject):DisplayObject
function removeChildAt(index:Int):DisplayObject
function setChildIndex(child:DisplayObject, index:Int):Void
function swapChildren(child1:DisplayObject, child2:DisplayObject):Void
function swapChildrenAt(index1:Int, index2:Int):Void

Inherited from InteractiveObject

var accessibilityImplementation:AccessibilityImplementation
var contextMenu:ContextMenu
var doubleClickEnabled:Bool
var focusRect:Dynamic
var mouseEnabled:Bool
var tabEnabled:Bool
var tabIndex:Int

Inherited from DisplayObject

var accessibilityProperties:AccessibilityProperties
var alpha:Float
var blendMode:BlendMode
var blendShader:Shader
var cacheAsBitmap:Bool
var filters:Array<BitmapFilter>
var height:Float
var loaderInfo:LoaderInfo
var mask:DisplayObject
var mouseX:Float
var mouseY:Float
var name:String
var opaqueBackground:Null<UInt>
var parent:DisplayObjectContainer
var root:DisplayObject
var rotation:Float
var rotationX:Float
var rotationY:Float
var rotationZ:Float
var scale9Grid:Rectangle
var scaleX:Float
var scaleY:Float
var scaleZ:Float
var scrollRect:Rectangle
var stage:Stage
var transform:Transform
var visible:Bool
var width:Float
var x:Float
var y:Float
var z:Float
function getBounds(targetCoordinateSpace:DisplayObject):Rectangle
function getRect(targetCoordinateSpace:DisplayObject):Rectangle
function globalToLocal(point:Point):Point
function globalToLocal3D(point:Point):Vector3D
function hitTestObject(obj:DisplayObject):Bool
function hitTestPoint(x:Float, y:Float, ?shapeFlag:Bool):Bool
function local3DToGlobal(point3d:Vector3D):Point
function localToGlobal(point:Point):Point

Inherited from EventDispatcher

function addEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool, ?priority:Int, ?useWeakReference:Bool):Void
function dispatchEvent(event:Event):Bool
function hasEventListener(type:String):Bool
function removeEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool):Void
function toString():String
function willTrigger(type:String):Bool

var continuousLayout:Bool

true for the child components to be continuously redisplayed and laid out during user intervention.

The default value of this property is false. Some look and feels might not support continuous layout; they will ignore this property.

var dividerLocation:Int

The location of the divider.

Setting is passed off to the look and feel implementation, and then listeners are notified.

A value less than 0 means collapse left/top component. A value equals AsWingConstants.MAX_VALUE means collapse right/top component.

var dividerSize:Int

The divider's size, this size is width when the orientation is horizontal it is height when the orientation is vertical.

var leftComponent:Component

The component to the left (or above) the divider.

var oneTouchExpandable:Bool

true for the JSplitPane to provide a UI widget on the divider to quickly expand/collapse the divider.

The default value of this property is false. Some look and feels might not support one-touch expanding; they will ignore this property.

var orientation:Int

The orientation, or how the splitter is divided. The options are:

  • JSplitPane.VERTICALSPLIT (above/below orientation of components)
  • JSplitPane.HORIZONTALSPLIT (left/right orientation of components)

var resizeWeight:Float

Specifies how to distribute extra space when the size of the split pane changes.

A value of 0, the default, indicates the right/bottom component gets all the extra space (the left/top component acts fixed), where as a value of 1 specifies the left/top component gets all the extra space (the right/bottom component acts fixed). Specifically, the left/top component gets (weight * diff) extra space and the right/bottom component gets (1 - weight) * diff extra space.

var rightComponent:Component

The component to the right (or below) the divider.

function new(?orientation:Int = 0, ?continuousLayout:Bool = false, ?leftComponent:Component = null, ?rightComponent:Component = null): Void

Creates a new JSplitPane with the specified orientation and redrawing style, and with the specified components.

orientation

(Optional)JSplitPane.HORIZONTALSPLIT or JSplitPane.VERTICALSPLIT.Default is JSplitPane.HORIZONTAL_SPLIT

continuousLayout

(Optional) a boolean, true for the components to redraw continuously as the divider changes position, false to wait until the divider position stops changing to redraw. Default is false

leftComponent

(Optional)the Component that will appear on the left of a horizontally-split pane, or at the top of a vertically-split pane. Default is null.

rightComponent

(Optional)the Component that will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane. Default is null.

function removeAt(index:Int): Component

Removes the Component at the specified index. Updates the leftComponent and rightComponent instance variables as necessary, and then messages super.

index

an integer specifying the component to remove, where 1 specifies the left/top component and 2 specifies the bottom/right component

function resetToPreferredSizes(): Void

Lays out the JSplitPane layout based on the preferred size of the children components. This will likely result in changing the divider location.