javax.swing.JSplitPane.getUI()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中javax.swing.JSplitPane.getUI()方法的一些代码示例,展示了JSplitPane.getUI()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSplitPane.getUI()方法的具体详情如下:
包路径:javax.swing.JSplitPane
类名称:JSplitPane
方法名:getUI

JSplitPane.getUI介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

final BasicSplitPaneUI myUi = (BasicSplitPaneUI) jSplitPane0.getUI();
final BasicSplitPaneDivider divider = myUi.getDivider();
final JButton upArrowButton = (JButton) divider.getComponent(0);

代码示例来源:origin: stackoverflow.com

public static void toggle(JSplitPane sp, boolean collapse) {
   try {
     BasicSplitPaneDivider bspd = ((BasicSplitPaneUI) sp.getUI()).getDivider();
     Field buttonField = BasicSplitPaneDivider.class.
         getDeclaredField(collapse ? "rightButton" : "leftButton");
     buttonField.setAccessible(true);
     JButton button = (JButton) buttonField.get(((BasicSplitPaneUI) sp.getUI()).getDivider());
     button.getActionListeners()[0].actionPerformed(new ActionEvent(bspd, MouseEvent.MOUSE_CLICKED,
         "bum"));
   } catch (Exception e) {
     e.printStackTrace();
   }
 }

代码示例来源:origin: stackoverflow.com

JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panelOne, panelTwo);
BasicSplitPaneUI basicSplitPaneUI = (BasicSplitPaneUI) pane.getUI();
BasicSplitPaneDivider basicSplitPaneDivider = basicSplitPaneUI.getDivider();
basicSplitPaneDivider.addMouseMotionListener(new MouseMotionAdapter() {
  @Override
  public void mouseDragged(MouseEvent e) {
    // some processing here
  }
});

代码示例来源:origin: stackoverflow.com

JSplitPane splitPane = (JSplitPane)e.getSource();
BasicSplitPaneUI ui = (BasicSplitPaneUI)splitPane.getUI();
BasicSplitPaneDivider divider = ui.getDivider();
JButton button1 = (JButton)divider.getComponent(0)

代码示例来源:origin: beanshell/beanshell

private JSplitPane splitPane(
  int orientation,
  boolean redraw,
  JComponent c1,
  JComponent c2
) {
  JSplitPane sp = new JSplitPane(orientation, redraw, c1, c2);
  sp.setBorder(null);
  javax.swing.plaf.SplitPaneUI ui = sp.getUI();
  if(ui instanceof javax.swing.plaf.basic.BasicSplitPaneUI) {
    ((javax.swing.plaf.basic.BasicSplitPaneUI)ui).getDivider()
      .setBorder(null);
  }
  return sp;
}

代码示例来源:origin: stackoverflow.com

SplitPaneUI ui = sp.getUI();
ui = sp.getUI();
if( ui instanceof BasicSplitPaneUI ) {
  ((BasicSplitPaneUI)ui).getDivider().setBorder( null );
ui = sp.getUI();
if( ui instanceof BasicSplitPaneUI ) {
  ((BasicSplitPaneUI)ui).getDivider().setBorder( null );
ui = sp.getUI();
if( ui instanceof BasicSplitPaneUI ) {
  ((BasicSplitPaneUI)ui).getDivider().setBorder( null );

代码示例来源:origin: magefree/mage

final BasicSplitPaneUI myUi = (BasicSplitPaneUI) jSplitPane0.getUI();
final BasicSplitPaneDivider divider = myUi.getDivider();
final JButton upArrowButton = (JButton) divider.getComponent(0);

代码示例来源:origin: stackoverflow.com

try {
  BasicSplitPaneDivider bspd = ((BasicSplitPaneUI) sp.getUI()).getDivider();
  Field buttonField;
  JButton button = (JButton) buttonField.get(((BasicSplitPaneUI) sp.getUI()).getDivider());

代码示例来源:origin: stackoverflow.com

BasicSplitPaneUI ui = (BasicSplitPaneUI)splitPane.getUI();
BasicSplitPaneDivider divider = ui.getDivider();

代码示例来源:origin: stackoverflow.com

sp.setDividerLocation(0);
BasicSplitPaneDivider divider = ((BasicSplitPaneUI) sp.getUI()).getDivider();
divider.addMouseListener(new MouseAdapter() {

代码示例来源:origin: jcbvm/i18n-editor

SplitPaneUI splitPaneUI = contentPane.getUI();
if (splitPaneUI instanceof BasicSplitPaneUI) {
  BasicSplitPaneDivider divider = ((BasicSplitPaneUI)splitPaneUI).getDivider();

代码示例来源:origin: net.java.dev.appframework/appframework

/**
 * Returns a {@link SplitPaneState SplitPaneState} object
 * for {@code JSplitPane c}.  If the split pane's 
 * {@code dividerLocation} is -1, indicating that either
 * the divider hasn't been moved, or it's been reset,
 * then return null.
 * <p>
 * Throws an {@code IllegalArgumentException} if {@code Component c}
 * isn't a non-null {@code JSplitPane}.
 * 
 * @param c the {@code JSplitPane} whose dividerLocation will
 *     recoreded in a {@code SplitPaneState} object.
 * @return the {@code SplitPaneState} object
 * @see #setSessionState
 * @see SplitPaneState
 */
  public Object getSessionState(Component c) {
  checkComponent(c);
  JSplitPane p = (JSplitPane)c;
    return new SplitPaneState(p.getUI().getDividerLocation(p), p.getOrientation());
}

代码示例来源:origin: org.jdesktop.bsaf/bsaf

/**
 * Returns a {@link SplitPaneState SplitPaneState} object
 * for {@code JSplitPane c}.  If the split pane's
 * {@code dividerLocation} is -1, indicating that either
 * the divider hasn't been moved, or it's been reset,
 * then return null.
 * <p>
 * Throws an {@code IllegalArgumentException} if {@code Component c}
 * isn't a non-null {@code JSplitPane}.
 *
 * @param c the {@code JSplitPane} whose dividerLocation will
 *     recoreded in a {@code SplitPaneState} object.
 * @return the {@code SplitPaneState} object
 * @see #setSessionState
 * @see SplitPaneState
 */
@Override
public Object getSessionState(Component c) {
  checkComponent(c);
  JSplitPane p = (JSplitPane) c;
  return new SplitPaneState(p.getUI().getDividerLocation(p), p.getOrientation());
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime

@Override
public State getState(Object o) {
  JSplitPane p = checkComponent(o);
  JSplitPaneState result = new JSplitPaneState();
  result.setDividerLocation(p.getUI().getDividerLocation(p));
  result.setOrientation(p.getOrientation());
  return result;
}

代码示例来源:origin: org.nuiton/nuiton-widgets

@Override
public State getState(Object o) {
  JSplitPane p = checkComponent(o);
  JSplitPaneState result = new JSplitPaneState();
  result.setDividerLocation(p.getUI().getDividerLocation(p));
  result.setOrientation(p.getOrientation());
  return result;
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-session

@Override
public State getState(Object o) {
  JSplitPane p = checkComponent(o);
  JSplitPaneState result = new JSplitPaneState();
  result.setDividerLocation(p.getUI().getDividerLocation(p));
  result.setOrientation(p.getOrientation());
  return result;
}

代码示例来源:origin: stackoverflow.com

BasicSplitPaneUI l_ui = (BasicSplitPaneUI) sp.getUI();
final BasicSplitPaneDivider l_divider = l_ui.getDivider();
l_divider.addMouseMotionListener(new MouseMotionAdapter() {

代码示例来源:origin: de.richtercloud/flexdock-core

/**
 * 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)
 */
@Override
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);
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

SplitPaneUI spUI = _splitPane.getUI();
if (spUI instanceof BasicSplitPaneUI) {
  BasicSplitPaneUI bspUI = (BasicSplitPaneUI) spUI;

代码示例来源:origin: realXuJiang/bigtable-sql

SplitPaneUI spUI = _splitPane.getUI();
if (spUI instanceof BasicSplitPaneUI) {
  BasicSplitPaneUI bspUI = (BasicSplitPaneUI) spUI;

相关文章

JSplitPane类方法