public class Splitter extends javax.swing.JPanel implements Splittable
Modifier and Type | Class and Description |
---|---|
class |
Splitter.DividerImpl |
static class |
Splitter.DividerPositionStrategy |
static class |
Splitter.LackOfSpaceStrategy |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected Divider |
myDivider |
protected float |
myProportion |
static java.lang.String |
PROP_ORIENTATION |
static java.lang.String |
PROP_PROPORTION |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
Splitter()
Creates horizontal split (with components which are side by side) with proportion equals to .5f
|
Splitter(boolean vertical)
Creates split with specified orientation and proportion equals to .5f
|
Splitter(boolean vertical,
float proportion)
Creates split with specified orientation and proportion.
|
Splitter(boolean vertical,
float proportion,
float minProp,
float maxProp) |
Modifier and Type | Method and Description |
---|---|
java.awt.Component |
add(java.awt.Component comp)
Deprecated.
|
java.awt.Component |
asComponent() |
protected Divider |
createDivider() |
void |
dispose() |
void |
doLayout() |
javax.swing.JPanel |
getDivider() |
Splitter.DividerPositionStrategy |
getDividerPositionStrategy() |
int |
getDividerWidth() |
javax.swing.JComponent |
getFirstComponent() |
Splitter.LackOfSpaceStrategy |
getLackOfSpaceStrategy() |
java.awt.Dimension |
getMinimumSize() |
float |
getMinProportion(boolean first) |
boolean |
getOrientation() |
javax.swing.JComponent |
getOtherComponent(java.awt.Component comp) |
java.awt.Dimension |
getPreferredSize() |
float |
getProportion() |
protected float |
getProportionForFirstSize(int firstSize,
int totalSize) |
protected float |
getProportionForSecondSize(int secondSize,
int totalSize) |
javax.swing.JComponent |
getSecondComponent() |
boolean |
isHonorMinimumSize() |
boolean |
isShowDividerControls() |
boolean |
isShowDividerIcon() |
boolean |
isVertical() |
boolean |
isVisible() |
void |
reshape(int x,
int y,
int w,
int h) |
void |
setAllowSwitchOrientationByMouseClick(boolean enabled) |
void |
setDividerPositionStrategy(Splitter.DividerPositionStrategy dividerPositionStrategy) |
void |
setDividerWidth(int width) |
void |
setDragging(boolean dragging) |
void |
setFirstComponent(javax.swing.JComponent component)
Sets component which is located as the "first" split area.
|
void |
setHonorComponentsMinimumSize(boolean honorMinimumSize) |
void |
setLackOfSpaceStrategy(Splitter.LackOfSpaceStrategy strategy) |
void |
setOrientation(boolean verticalSplit) |
void |
setProportion(float proportion) |
void |
setResizeEnabled(boolean value) |
void |
setSecondComponent(javax.swing.JComponent component)
Sets component which is located as the "second" split area.
|
void |
setShowDividerControls(boolean showDividerControls) |
void |
setShowDividerIcon(boolean showDividerIcon) |
void |
skipNextLayout() |
void |
swapComponents()
Swaps components.
|
getAccessibleContext, 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, getNextFocusableComponent, getPopupLocation, 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, paintChildren, paintComponent, 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, 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, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String PROP_PROPORTION
public static final java.lang.String PROP_ORIENTATION
protected float myProportion
protected final Divider myDivider
public Splitter()
public Splitter(boolean vertical)
vertical
- If true, components are displayed above one another. If false, components are displayed side by side.public Splitter(boolean vertical, float proportion)
vertical
- If true, components are displayed above one another. If false, components are displayed side by side.proportion
- The initial proportion of the splitter (between 0.0f and 1.0f).public Splitter(boolean vertical, float proportion, float minProp, float maxProp)
public void setShowDividerControls(boolean showDividerControls)
public void setShowDividerIcon(boolean showDividerIcon)
public void setResizeEnabled(boolean value)
public void setAllowSwitchOrientationByMouseClick(boolean enabled)
public boolean isShowDividerIcon()
public boolean isShowDividerControls()
public boolean isHonorMinimumSize()
public void setHonorComponentsMinimumSize(boolean honorMinimumSize)
public void setLackOfSpaceStrategy(Splitter.LackOfSpaceStrategy strategy)
public Splitter.LackOfSpaceStrategy getLackOfSpaceStrategy()
public void setDividerPositionStrategy(Splitter.DividerPositionStrategy dividerPositionStrategy)
public Splitter.DividerPositionStrategy getDividerPositionStrategy()
@Deprecated public java.awt.Component add(java.awt.Component comp)
setFirstComponent(JComponent)
and setSecondComponent(JComponent)
add
in class java.awt.Container
public void dispose()
protected Divider createDivider()
public boolean isVisible()
isVisible
in class java.awt.Component
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public void skipNextLayout()
public void reshape(int x, int y, int w, int h)
reshape
in class javax.swing.JComponent
protected final float getProportionForFirstSize(int firstSize, int totalSize)
protected final float getProportionForSecondSize(int secondSize, int totalSize)
public void doLayout()
doLayout
in class java.awt.Container
public int getDividerWidth()
public void setDividerWidth(int width)
public float getProportion()
public void setProportion(float proportion)
setProportion
in interface Splittable
public void swapComponents()
public boolean getOrientation()
getOrientation
in interface Splittable
true
if splitter has vertical orientation, false
otherwisepublic boolean isVertical()
public void setOrientation(boolean verticalSplit)
setOrientation
in interface Splittable
verticalSplit
- true
means that splitter will have vertical splitpublic javax.swing.JComponent getFirstComponent()
public void setFirstComponent(javax.swing.JComponent component)
public javax.swing.JComponent getSecondComponent()
public javax.swing.JComponent getOtherComponent(java.awt.Component comp)
public void setSecondComponent(javax.swing.JComponent component)
public float getMinProportion(boolean first)
getMinProportion
in interface Splittable
public java.awt.Component asComponent()
asComponent
in interface Splittable
public void setDragging(boolean dragging)
setDragging
in interface Splittable
public javax.swing.JPanel getDivider()