本文整理汇总了Java中javax.swing.plaf.basic.BasicSplitPaneDivider类的典型用法代码示例。如果您正苦于以下问题:Java BasicSplitPaneDivider类的具体用法?Java BasicSplitPaneDivider怎么用?Java BasicSplitPaneDivider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BasicSplitPaneDivider类属于javax.swing.plaf.basic包,在下文中一共展示了BasicSplitPaneDivider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reset
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
public static void reset() {
entries.clear();
add(Component.class, RUnknownComponent.class);
add(Window.class, RWindow.class);
add(JTable.class, RTable.class);
add(JTableHeader.class, RTableHeader.class);
add(AbstractButton.class, RAbstractButton.class);
add(JToggleButton.class, RToggleButton.class);
add(JComboBox.class, RComboBox.class);
add(JTextComponent.class, RTextComponent.class);
add(JTree.class, RTree.class);
add(JList.class, RList.class);
add(JTabbedPane.class, RTabbedPane.class);
add(JMenuItem.class, RMenuItem.class);
add(JSlider.class, RSlider.class);
add(JProgressBar.class, RProgressBar.class);
add(JSpinner.class, RSpinner.class);
add(DefaultEditor.class, RDefaultEditor.class);
add(JColorChooser.class, RColorChooser.class);
add(JSplitPane.class, RSplitPane.class);
add(BasicSplitPaneDivider.class, RSplitPane.class);
add(JFileChooser.class, RFileChooser.class);
add(JEditorPane.class, REditorPane.class);
add(JLabel.class, RLabel.class);
add(JScrollBar.class, RIgnoreComponent.class);
}
示例2: selectSplitPaneDividerLocation
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
public void selectSplitPaneDividerLocation() throws InterruptedException {
final LoggingRecorder lr = new LoggingRecorder();
siw(new Runnable() {
@Override public void run() {
JSplitPane splitPane = (JSplitPane) ComponentUtils.findComponent(JSplitPane.class, frame);
splitPane.setDividerLocation(300);
BasicSplitPaneDivider divider = (BasicSplitPaneDivider) ComponentUtils.findComponent(BasicSplitPaneDivider.class,
splitPane);
RSplitPane rDivider = new RSplitPane(divider, null, null, lr);
rDivider.mouseReleased(null);
}
});
Call call = lr.getCall();
AssertJUnit.assertEquals("select", call.getFunction());
AssertJUnit.assertEquals("300", call.getState());
}
示例3: removeBordersFromSplitPane
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
public static void removeBordersFromSplitPane(JSplitPane split)
{
// remove the border from the split pane
split.setBorder(null);
// check the UI. If we can't work with the UI any further, then
// exit here.
if( !(split.getUI() instanceof BasicSplitPaneUI) )
{
return;
}
// grab the divider from the UI and remove the border from it
final BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI()).getDivider();
if( divider != null )
{
// Taken from http://forums.sun.com/thread.jspa?threadID=566152
divider.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0),
new SplitPaneBorder(UIManager.getColor("SplitPane.background")))); //$NON-NLS-1$
}
}
示例4: createDefaultDivider
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
@Override
public BasicSplitPaneDivider createDefaultDivider() {
return new BasicSplitPaneDivider(this) {
@Override
public void setBorder(Border b) {
b = border ;
}
@Override
public void paint(Graphics g) {
g.setColor(c);
g.fillRect(0, 0, getSize().width, getSize().height);
super.paint(g);
}
};
}
示例5: createDefaultDivider
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
public BasicSplitPaneDivider createDefaultDivider() {
BasicSplitPaneDivider divider = new BasicSplitPaneDivider(this) {
public int getDividerSize() {
return ((int) size.getWidth());
}
};
if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
divider.setLayout(new BoxLayout(divider, BoxLayout.Y_AXIS));
divider.add(Box.createVerticalGlue());
divider.add(addButtonV);
divider.add(Box.createVerticalStrut(50));
divider.add(removeButtonV);
divider.add(Box.createVerticalGlue());
} else {
divider.setLayout(new BoxLayout(divider, BoxLayout.X_AXIS));
divider.add(Box.createHorizontalGlue());
divider.add(addButtonH);
divider.add(Box.createHorizontalStrut(50));
divider.add(removeButtonH);
divider.add(Box.createHorizontalGlue());
}
return divider;
}
示例6: findDivider
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
/**
* Searches divider inside split pane.
*
* @return an operator for the divider.
*/
public BasicSplitPaneDivider findDivider() {
return ((BasicSplitPaneDivider) waitSubComponent(new ComponentChooser() {
@Override
public boolean checkComponent(Component comp) {
return comp instanceof BasicSplitPaneDivider;
}
@Override
public String getDescription() {
return "";
}
@Override
public String toString() {
return "JSplitPaneOperator.findDivider.ComponentChooser{description = " + getDescription() + '}';
}
}));
}
示例7: createDefaultDivider
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
@Override
public BasicSplitPaneDivider createDefaultDivider() {
return new BasicSplitPaneDivider(this) {
@Override
public void paint(Graphics g) {
g.setColor(backgroundColor);
g.fillRect(0, 0, getSize().width, getSize().height);
int mid = getSize().height / 2;
g.setColor(ORANGE_COLOR);
int min = 4;
int max = 9;
for (int i = min; i <= max; i++) {
g.drawLine(i, mid - max + i, i, mid + max - i);
}
super.paint(g);
}
};
}
示例8: layout
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
@Override
@SuppressWarnings("deprecation")
public void layout() {
super.layout();
// increase divider width or height
BasicSplitPaneDivider divider = ((BasicSplitPaneUI) getUI()).getDivider();
Rectangle bounds = divider.getBounds();
if (orientation == HORIZONTAL_SPLIT) {
bounds.x -= dividerDragOffset;
bounds.width = dividerDragSize;
} else {
bounds.y -= dividerDragOffset;
bounds.height = dividerDragSize;
}
divider.setBounds(bounds);
}
示例9: createDefaultDivider
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
/**
* Creates the default divider.
*/
@Override
public BasicSplitPaneDivider createDefaultDivider() {
return new BasicSplitPaneDivider(this){
/**
* Paints the divider.</br>
* <b>Zeichne den Divier nicht.</b>
*/
@Override
public void paint(Graphics g) {
// super.paint(g);
//
// // Paint the border.
// Border border = getBorder();
//
// if (border != null) {
// Dimension size = getSize();
//
// border.paintBorder(this, g, 0, 0, size.width, size.height);
// }
}
};
}
示例10: createSplitPane
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
public JSplitPane createSplitPane() {
JSplitPane split = new JSplitPane();
// remove the border from the split pane
split.setBorder(null);
// set the divider size for a more reasonable, less bulky look
split.setDividerSize(3);
split.setOpaque(false);
// check the UI. If we can't work with the UI any further, then
// exit here.
if (!(split.getUI() instanceof BasicSplitPaneUI))
return split;
// grab the divider from the UI and remove the border from it
BasicSplitPaneDivider divider =
((BasicSplitPaneUI) split.getUI()).getDivider();
if (divider != null)
divider.setBorder(null);
return split;
}
示例11: createSplitPane
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
private static JSplitPane createSplitPane(int orientation) {
JSplitPane split = new JSplitPane(orientation);
// remove the border from the split pane
split.setBorder(null);
// set the divider size for a more reasonable, less bulky look
split.setDividerSize(3);
// check the UI. If we can't work with the UI any further, then
// exit here.
if (!(split.getUI() instanceof BasicSplitPaneUI))
return split;
// grab the divider from the UI and remove the border from it
BasicSplitPaneDivider divider =
((BasicSplitPaneUI) split.getUI()).getDivider();
if (divider != null)
divider.setBorder(null);
return split;
}
示例12: createSplitPane
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
public JSplitPane createSplitPane() {
JSplitPane split = new JSplitPane();
// remove the border from the split pane
split.setBorder(null);
// set the divider size for a more reasonable, less bulky look
split.setDividerSize(3);
// check the UI. If we can't work with the UI any further, then
// exit here.
if (!(split.getUI() instanceof BasicSplitPaneUI))
return split;
// grab the divider from the UI and remove the border from it
BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI()).getDivider();
if (divider != null)
divider.setBorder(null);
return split;
}
示例13: managePortSplitChild
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
/**
* Removes any border from the <code>DockingPort</code> itself and places the currently
* assigned border on the two child components of the <code>DockingPort's</code JSplitPane</code>
* child.
* @see basesource.convertor.ui.docking.defaults.BorderManager#managePortSplitChild(basesource.convertor.ui.docking.DockingPort)
*/
public void managePortSplitChild(DockingPort port) {
if(port==null || !(port.getDockedComponent() instanceof JSplitPane))
return;
setBorder(port, null);
// clear the border from the split pane
JSplitPane split = (JSplitPane) port.getDockedComponent();
if (split.getUI() instanceof BasicSplitPaneUI) {
// grab the divider from the UI and remove the border from it
BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI()).getDivider();
if (divider != null && divider.getBorder()!=null)
divider.setBorder(null);
}
setBorder(split, null);
// set the borders on each of the child components
setBorder(split.getLeftComponent(), assignedBorder);
setBorder(split.getRightComponent(), assignedBorder);
}
示例14: doLayout
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
@Override
public void doLayout()
{
super.doLayout();
// increase divider width or height
BasicSplitPaneDivider divider = ((BasicSplitPaneUI) getUI())
.getDivider();
Rectangle bounds = divider.getBounds();
if (orientation == HORIZONTAL_SPLIT)
{
bounds.x -= dividerDragOffset;
bounds.width = dividerDragSize;
}
else
{
bounds.y -= dividerDragOffset;
bounds.height = dividerDragSize;
}
divider.setBounds(bounds);
}
示例15: managePortSplitChild
import javax.swing.plaf.basic.BasicSplitPaneDivider; //导入依赖的package包/类
/**
* Removes any border from the {@code DockingPort} itself and places the
* currently assigned border on the two child components of the
* {@code DockingPort's</code JSplitPane} child.
*
* @see BorderManager#managePortSplitChild(DockingPort)
*/
public void managePortSplitChild(DockingPort port) {
if (port == null || !(port.getDockedComponent() instanceof JSplitPane))
return;
setBorder(port, null);
// clear the border from the split pane
JSplitPane split = (JSplitPane) port.getDockedComponent();
if (split.getUI() instanceof BasicSplitPaneUI) {
// grab the divider from the UI and remove the border from it
BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI())
.getDivider();
if (divider != null && divider.getBorder() != null)
divider.setBorder(null);
}
setBorder(split, null);
// set the borders on each of the child components
setSubComponentBorder(split.getLeftComponent(), assignedBorder);
setSubComponentBorder(split.getRightComponent(), assignedBorder);
}