Synth's SplitPaneUI.
| Method from javax.swing.plaf.synth.SynthSplitPaneUI Detail: |
public BasicSplitPaneDivider createDefaultDivider() {
SynthSplitPaneDivider divider = new SynthSplitPaneDivider(this);
divider.setDividerSize(splitPane.getDividerSize());
return divider;
}
Creates the default divider. |
protected Component createDefaultNonContinuousLayoutDivider() {
return new Canvas() {
public void paint(Graphics g) {
paintDragDivider(g, 0, 0, getWidth(), getHeight());
}
};
}
|
public static ComponentUI createUI(JComponent x) {
return new SynthSplitPaneUI();
}
Creates a new SynthSplitPaneUI instance |
public void finishedPaintingChildren(JSplitPane jc,
Graphics g) {
if(jc == splitPane && getLastDragLocation() != -1 &&
!isContinuousLayout() && !draggingHW) {
if(jc.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
paintDragDivider(g, getLastDragLocation(), 0, dividerSize - 1,
splitPane.getHeight() - 1);
} else {
paintDragDivider(g, 0, getLastDragLocation(),
splitPane.getWidth() - 1, dividerSize - 1);
}
}
}
|
public SynthContext getContext(JComponent c) {
return getContext(c, getComponentState(c));
}
|
SynthContext getContext(JComponent c,
Region region) {
return getContext(c, region, getComponentState(c, region));
}
|
protected void installDefaults() {
updateStyle(splitPane);
setOrientation(splitPane.getOrientation());
setContinuousLayout(splitPane.isContinuousLayout());
resetLayoutManager();
/* Install the nonContinuousLayoutDivider here to avoid having to
add/remove everything later. */
if(nonContinuousLayoutDivider == null) {
setNonContinuousLayoutDivider(
createDefaultNonContinuousLayoutDivider(),
true);
} else {
setNonContinuousLayoutDivider(nonContinuousLayoutDivider, true);
}
// focus forward traversal key
if (managingFocusForwardTraversalKeys==null) {
managingFocusForwardTraversalKeys = new HashSet();
managingFocusForwardTraversalKeys.add(
KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
}
splitPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
managingFocusForwardTraversalKeys);
// focus backward traversal key
if (managingFocusBackwardTraversalKeys==null) {
managingFocusBackwardTraversalKeys = new HashSet();
managingFocusBackwardTraversalKeys.add(
KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK));
}
splitPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
managingFocusBackwardTraversalKeys);
}
Installs the UI defaults. |
protected void installListeners() {
super.installListeners();
splitPane.addPropertyChangeListener(this);
}
Installs the event listeners for the UI. |
public void paint(Graphics g,
JComponent c) {
SynthContext context = getContext(c);
paint(context, g);
context.dispose();
}
|
protected void paint(SynthContext context,
Graphics g) {
// This is done to update package private variables in
// BasicSplitPaneUI
super.paint(g, splitPane);
}
|
public void paintBorder(SynthContext context,
Graphics g,
int x,
int y,
int w,
int h) {
context.getPainter().paintSplitPaneBorder(context, g, x, y, w, h);
}
|
public void propertyChange(PropertyChangeEvent e) {
if (SynthLookAndFeel.shouldUpdateStyle(e)) {
updateStyle((JSplitPane)e.getSource());
}
}
|
protected void uninstallDefaults() {
SynthContext context = getContext(splitPane, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
context = getContext(splitPane, Region.SPLIT_PANE_DIVIDER, ENABLED);
dividerStyle.uninstallDefaults(context);
context.dispose();
dividerStyle = null;
super.uninstallDefaults();
}
Uninstalls the UI defaults. |
protected void uninstallListeners() {
super.uninstallListeners();
splitPane.removePropertyChangeListener(this);
}
Uninstalls the event listeners for the UI. |
public void update(Graphics g,
JComponent c) {
SynthContext context = getContext(c);
SynthLookAndFeel.update(context, g);
context.getPainter().paintSplitPaneBackground(context,
g, 0, 0, c.getWidth(), c.getHeight());
paint(context, g);
context.dispose();
}
|