Search in sources :

Example 1 with SplitPaneUI

use of javax.swing.plaf.SplitPaneUI in project pcgen by PCGen.

the class FlippingSplitPane method setupExtensions.

//     private class KeyboardShiftHomeAction extends AbstractAction
//     {
//         public void actionPerformed(ActionEvent e)
// 	{
// 	    centerDividerLocations();
//         }
//     }
//     private class KeyboardShiftEndAction extends AbstractAction
//     {
//         public void actionPerformed(ActionEvent e)
// 	{
// 	    resetToPreferredSizes();
//         }
//     }
/**
	 * {@code setupExtensions} installs the mouse listener for the popup menu,
	 * and fixes some egregious defaults in {@code JSplitPane}.
	 */
private void setupExtensions() {
    SplitPaneUI anUi = getUI();
    if (anUi instanceof BasicSplitPaneUI) {
        ((BasicSplitPaneUI) anUi).getDivider().addMouseListener(new PopupListener());
    }
    // 	// See source for JSplitPane for this junk.
    // 	ActionMap map = (ActionMap) UIManager.get("SplitPane.actionMap");
    // 	map.put("selectCenter", new KeyboardShiftHomeAction()); // XXX
    // 	map.put("selectReset", new KeyboardShiftEndAction()); // XXX
    // 	SwingUtilities.replaceUIActionMap(this, map);
    // This is *so* much better than squishing the top/left
    // component into oblivion.
    setResizeWeight(0.5);
}
Also used : BasicSplitPaneUI(javax.swing.plaf.basic.BasicSplitPaneUI) SplitPaneUI(javax.swing.plaf.SplitPaneUI) BasicSplitPaneUI(javax.swing.plaf.basic.BasicSplitPaneUI)

Example 2 with SplitPaneUI

use of javax.swing.plaf.SplitPaneUI in project pcgen by PCGen.

the class FlippingSplitPane method initComponent.

/**
	 * {@code initComponent} installs the mouse listener for the popup menu,
	 * and fixes some egregious defaults in {@code JSplitPane}.
	 */
private void initComponent() {
    SplitPaneUI anUi = getUI();
    if (anUi instanceof BasicSplitPaneUI) {
        ((BasicSplitPaneUI) anUi).getDivider().addMouseListener(new PopupListener());
    }
    setResizeWeight(0.5);
    baseContext = UIPropertyContext.createContext("dividerPrefs");
    setInitialDividerLocation();
}
Also used : BasicSplitPaneUI(javax.swing.plaf.basic.BasicSplitPaneUI) SplitPaneUI(javax.swing.plaf.SplitPaneUI) BasicSplitPaneUI(javax.swing.plaf.basic.BasicSplitPaneUI)

Example 3 with SplitPaneUI

use of javax.swing.plaf.SplitPaneUI in project adempiere by adempiere.

the class VTreePanel method removeSplitPaneBorder.

//  jbInit
private void removeSplitPaneBorder() {
    if (centerSplitPane != null) {
        SplitPaneUI splitPaneUI = centerSplitPane.getUI();
        if (splitPaneUI instanceof BasicSplitPaneUI) {
            BasicSplitPaneUI basicUI = (BasicSplitPaneUI) splitPaneUI;
            basicUI.getDivider().setBorder(BorderFactory.createEmptyBorder());
        }
    }
}
Also used : BasicSplitPaneUI(javax.swing.plaf.basic.BasicSplitPaneUI) SplitPaneUI(javax.swing.plaf.SplitPaneUI) BasicSplitPaneUI(javax.swing.plaf.basic.BasicSplitPaneUI)

Aggregations

SplitPaneUI (javax.swing.plaf.SplitPaneUI)3 BasicSplitPaneUI (javax.swing.plaf.basic.BasicSplitPaneUI)3