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

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

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

JSplitPane.getMinimumDividerLocation介绍

暂无

代码示例

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

/** Set the divider position proportionally. */
public void actionMoveDivider(Component c,
               final double proportionalLocation) {
  JSplitPane split = (JSplitPane)c;
  int max = split.getMaximumDividerLocation();
  int min = split.getMinimumDividerLocation();
  int position = min + (int)((max - min) * proportionalLocation);
  actionMoveDividerAbsolute(split, position);
}

代码示例来源:origin: com.github.tornaia/aott-desktop-client-core

@Override
  public void propertyChange(PropertyChangeEvent evt) {
    int min = jSplitPane.getMinimumDividerLocation();
    int max = jSplitPane.getMaximumDividerLocation();
    int previous = lastDividerLocation.get();
    int actual = jSplitPane.getDividerLocation();
    boolean initial = lastDividerLocation.get() == -1;
    boolean attachToTop = actual < (max - min) * 0.15D && previous > actual;
    boolean attachToBottom = actual > (max - min) * 0.85D && actual > previous;
    boolean detachFromTop = previous == min && actual > previous;
    boolean detachFromBottom = previous == max && actual < previous;
    if (!initial) {
      if (attachToTop) {
        jSplitPane.setDividerLocation(min);
        jSplitPane.getTopComponent().setVisible(false);
      } else if (detachFromTop) {
        jSplitPane.setDividerLocation((int) ((max - min) * 0.15D));
        jSplitPane.getTopComponent().setVisible(true);
      } else if (attachToBottom) {
        jSplitPane.setDividerLocation(max);
        jSplitPane.getBottomComponent().setVisible(false);
      } else if (detachFromBottom) {
        jSplitPane.setDividerLocation((int) ((max - min) * 0.85D));
        jSplitPane.getBottomComponent().setVisible(true);
      }
    }

    lastDividerLocation.set(actual);
  }
}

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

if (collapse != (sp.getDividerLocation() < sp.getMinimumDividerLocation())) {
  return;

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

int delta = pt.x - startPt.x;
startPt.setLocation(pt);
if (delta < 0 && sp.getMinimumDividerLocation() == sp.getDividerLocation()) {
   splitPane.getMinimumDividerLocation(), dividerLocation + delta);
 splitPane.setDividerLocation(dividerLocation);
 EventQueue.invokeLater(() -> {
  sp.setDividerLocation(sp.getMinimumDividerLocation());
 });

代码示例来源:origin: cpesch/RouteConverter

private void enableActions() {
    ActionManager actionManager = getContext().getActionManager();
    actionManager.enable("maximize-map", location < mapSplitPane.getMaximumDividerLocation() - 10);
    actionManager.enable("maximize-positionlist", location > mapSplitPane.getMinimumDividerLocation() + 10);
    actionManager.enable("show-map-and-positionlist", location == 1 || location > mapSplitPane.getMaximumDividerLocation() + tabbedPane.getMinimumSize().width - 1);
  }
}

相关文章

JSplitPane类方法