public class JXMultiSplitPane extends JPanel implements BackgroundPaintable
All properties in this class are bound: when a properties value is changed, all PropertyChangeListeners are fired.
Modifier and Type | Class and Description |
---|---|
protected class |
JXMultiSplitPane.AccessibleMultiSplitPane |
private class |
JXMultiSplitPane.DefaultDividerPainter |
static class |
JXMultiSplitPane.DividerPainter
Draws a single Divider.
|
private class |
JXMultiSplitPane.InputHandler |
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
private AccessibleContext |
accessibleContext |
private Painter |
backgroundPainter |
private boolean |
continuousLayout |
private JXMultiSplitPane.DividerPainter |
dividerPainter |
private MultiSplitLayout.Divider |
dragDivider |
private int |
dragMax |
private int |
dragMin |
private int |
dragOffsetX |
private int |
dragOffsetY |
private boolean |
dragUnderway |
private Rectangle |
initialDividerBounds |
private boolean |
oldFloatingDividers |
private boolean |
paintBorderInsets |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
JXMultiSplitPane()
Creates a MultiSplitPane with it's LayoutManager set to
to an empty MultiSplitLayout.
|
JXMultiSplitPane(MultiSplitLayout layout)
Creates a MultiSplitPane.
|
Modifier and Type | Method and Description |
---|---|
MultiSplitLayout.Divider |
activeDivider()
Returns the Divider that's currently being moved, typically
because the user is dragging it, or null.
|
private void |
cancelDrag() |
private void |
clearDragState() |
private void |
finishDrag(int x,
int y) |
AccessibleContext |
getAccessibleContext() |
Painter |
getBackgroundPainter()
Returns the current background painter.
|
JXMultiSplitPane.DividerPainter |
getDividerPainter()
The DividerPainter that's used to paint Dividers on this MultiSplitPane.
|
int |
getDividerSize()
A convenience method that returns the MultiSplitLayout dividerSize
property.
|
protected Dimension |
getMaxNodeSize(MultiSplitLayout msl,
MultiSplitLayout.Node n)
Set the maximum node size.
|
protected Dimension |
getMinNodeSize(MultiSplitLayout msl,
MultiSplitLayout.Node n)
Set the minimum node size.
|
MultiSplitLayout |
getMultiSplitLayout()
A convenience method that returns the layout manager cast
to MutliSplitLayout.
|
boolean |
isContinuousLayout()
Returns true if dragging a divider only updates
the layout when the drag gesture ends (typically, when the
mouse button is released).
|
boolean |
isPaintBorderInsets()
Determines whether this component paints its background paint underneath the border.
|
protected void |
paintChildren(Graphics g)
Uses the DividerPainter (if any) to paint each Divider that
overlaps the clip Rectangle.
|
protected void |
paintComponent(Graphics g)
Calls the UI delegate's paint method, if the UI delegate
is non-
null . |
private void |
repaintDragLimits() |
void |
setBackgroundPainter(Painter p)
Specifies a Painter to use to paint the background of this JXPanel.
|
void |
setContinuousLayout(boolean continuousLayout)
Sets the value of the
continuousLayout property. |
void |
setDividerPainter(JXMultiSplitPane.DividerPainter dividerPainter)
Sets the DividerPainter that's used to paint Dividers on this
MultiSplitPane.
|
void |
setDividerSize(int dividerSize)
A convenience method that sets the MultiSplitLayout dividerSize
property.
|
void |
setModel(MultiSplitLayout.Node model)
A convenience method that sets the MultiSplitLayout model.
|
void |
setPaintBorderInsets(boolean paintBorderInsets) |
private void |
startDrag(int mx,
int my) |
private void |
updateCursor(int x,
int y,
boolean show) |
private void |
updateDrag(int mx,
int my) |
getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private AccessibleContext accessibleContext
private boolean continuousLayout
private JXMultiSplitPane.DividerPainter dividerPainter
private Painter backgroundPainter
private boolean paintBorderInsets
private boolean dragUnderway
private MultiSplitLayout.Divider dragDivider
private Rectangle initialDividerBounds
private boolean oldFloatingDividers
private int dragOffsetX
private int dragOffsetY
private int dragMin
private int dragMax
public JXMultiSplitPane()
public JXMultiSplitPane(MultiSplitLayout layout)
layout
- the new split pane's layoutpublic final MultiSplitLayout getMultiSplitLayout()
Container.getLayout()
,
setModel(org.jdesktop.swingx.MultiSplitLayout.Node)
public final void setModel(MultiSplitLayout.Node model)
getMultiSplitLayout.setModel(model)
model
- the root of the MultiSplitLayout modelgetMultiSplitLayout()
,
MultiSplitLayout.setModel(org.jdesktop.swingx.MultiSplitLayout.Node)
public final void setDividerSize(int dividerSize)
getMultiSplitLayout().setDividerSize(newDividerSize)
.dividerSize
- the value of the dividerSize propertygetMultiSplitLayout()
,
MultiSplitLayout.setDividerSize(int)
public final int getDividerSize()
getMultiSplitLayout().getDividerSize()
.public void setContinuousLayout(boolean continuousLayout)
continuousLayout
property.
If true, then the layout is revalidated continuously while
a divider is being moved. The default value of this property
is true.continuousLayout
- value of the continuousLayout propertyisContinuousLayout()
public boolean isContinuousLayout()
continuousLayout
propertysetContinuousLayout(boolean)
public MultiSplitLayout.Divider activeDivider()
public JXMultiSplitPane.DividerPainter getDividerPainter()
setDividerPainter(org.jdesktop.swingx.JXMultiSplitPane.DividerPainter)
public void setDividerPainter(JXMultiSplitPane.DividerPainter dividerPainter)
dividerPainter
- the value of the dividerPainter property, can be nullpaintChildren(java.awt.Graphics)
,
activeDivider()
protected void paintComponent(Graphics g)
null
. We pass the delegate a copy of the
Graphics
object to protect the rest of the
paint code from irrevocable changes
(for example, Graphics.translate
).
If you override this in a subclass you should not make permanent
changes to the passed in Graphics
. For example, you
should not alter the clip Rectangle
or modify the
transform. If you need to do these operations you may find it
easier to create a new Graphics
from the passed in
Graphics
and manipulate it. Further, if you do not
invoker super's implementation you must honor the opaque property,
that is
if this component is opaque, you must completely fill in the background
in a non-opaque color. If you do not honor the opaque property you
will likely see visual artifacts.
The passed in Graphics
object might
have a transform other than the identify transform
installed on it. In this case, you might get
unexpected results if you cumulatively apply
another transform.
paintComponent
in class JComponent
g
- the Graphics
object to protectJComponent.paint(Graphics)
,
ComponentUI
public void setBackgroundPainter(Painter p)
p
is not null, then setOpaque(false) will be called
as a side effect. A component should not be opaque if painters are
being used, because Painters may paint transparent pixels or not
paint certain pixels, such as around the border insets.setBackgroundPainter
in interface BackgroundPaintable
p
- the new background painter; may be null
public Painter getBackgroundPainter()
BackgroundPaintable
getBackgroundPainter
in interface BackgroundPaintable
BackgroundPaintable.setBackgroundPainter(Painter)
,
BackgroundPaintable.isPaintBorderInsets()
public boolean isPaintBorderInsets()
isPaintBorderInsets
in interface BackgroundPaintable
true
to paint under the border; false
otherwisepublic void setPaintBorderInsets(boolean paintBorderInsets)
setPaintBorderInsets
in interface BackgroundPaintable
protected void paintChildren(Graphics g)
super.paintChildren()
so that Dividers can be
rendered "on top of" the children.
paintChildren
in class JComponent
private void startDrag(int mx, int my)
protected Dimension getMaxNodeSize(MultiSplitLayout msl, MultiSplitLayout.Node n)
class MyMultiSplitPane extends JXMultiSplitPane
{
protected Dimension getMaxNodeSize( MultiSplitLayout msl, Node n )
{
if (( n instanceof Leaf ) && ((Leaf)n).getName().equals( "top" ))
return msl.maximumNodeSize( n );
return null;
}
}
msl
- the MultiSplitLayout used by this panen
- the node being resizedprotected Dimension getMinNodeSize(MultiSplitLayout msl, MultiSplitLayout.Node n)
msl
- the MultiSplitLayout used by this panen
- the node being resizedprivate void repaintDragLimits()
private void updateDrag(int mx, int my)
private void clearDragState()
private void finishDrag(int x, int y)
private void cancelDrag()
private void updateCursor(int x, int y, boolean show)
public AccessibleContext getAccessibleContext()
getAccessibleContext
in interface Accessible
getAccessibleContext
in class JPanel
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses