本文整理了Java中javax.swing.JSplitPane.getInsets()
方法的一些代码示例,展示了JSplitPane.getInsets()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSplitPane.getInsets()
方法的具体详情如下:
包路径:javax.swing.JSplitPane
类名称:JSplitPane
方法名:getInsets
暂无
代码示例来源:origin: magefree/mage
@Override
public void actionPerformed(ActionEvent actionEvent) {
imagePanelState = !imagePanelState;
if (!imagePanelState) {
jSplitPane0.resetToPreferredSizes();
jSplitPane0.setDividerLocation(jSplitPane0.getSize().width - jSplitPane0.getInsets().right - jSplitPane0.getDividerSize() - 260);
} else {
jSplitPane0.setDividerLocation(1.0);
}
}
});
代码示例来源:origin: cytoscape/application
else if (width < WEST_MIN_WIDTH)
width = WEST_MIN_WIDTH;
jsp.setDividerLocation(width+jsp.getInsets().left+jsp.getInsets().right+5);
} else if (compassDirection == SwingConstants.EAST) {
if (width > EAST_MAX_WIDTH)
width = EAST_MIN_WIDTH;
jsp.setDividerLocation(jsp.getSize().width
-jsp.getInsets().right
-jsp.getInsets().left
-jsp.getDividerSize()
-width-5);
代码示例来源:origin: org.cytoscape/swing-application-impl
else if (width < WEST_MIN_WIDTH)
width = WEST_MIN_WIDTH;
jsp.setDividerLocation(width+jsp.getInsets().left+jsp.getInsets().right);
} else if (compassDirection == CytoPanelName.EAST) {
if (width > EAST_MAX_WIDTH)
-jsp.getInsets().right
-jsp.getInsets().left
-jsp.getDividerSize()
-width);
代码示例来源:origin: joel-costigliola/assertj-swing
@RunsInCurrentThread
private int calculateMinimum(@Nonnull JSplitPane splitPane) {
Component left = splitPane.getLeftComponent();
if (left == null || !left.isVisible()) {
return 0;
}
int minimum = left.getMinimumSize().width;
Insets insets = splitPane.getInsets();
if (insets != null) {
minimum += insets.left;
}
return minimum;
}
代码示例来源:origin: joel-costigliola/assertj-swing
@RunsInCurrentThread
private int calculateMinimum(@Nonnull JSplitPane splitPane) {
Component left = splitPane.getLeftComponent();
if (left == null || !left.isVisible()) {
return 0;
}
int minimum = left.getMinimumSize().height;
Insets insets = splitPane.getInsets();
if (insets != null) {
minimum += insets.top;
}
return minimum;
}
代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler
protected void initStatusBar() {
status = new JLabel();
status.setFont(status.getFont().deriveFont(Font.PLAIN, 10));
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setBorder(TopBorder.create());
splitPane.getInsets().left = 5;
splitPane.getInsets().right = 5;
splitPane.setResizeWeight(0.7);
// Moving this to try-catch block per CAY-940. Exception will be stack-traced
try {
ComponentGeometry geometry = new ComponentGeometry(this.getClass(), "splitPane/divider");
geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, 400);
} catch (Exception ex) {
LoggerFactory.getLogger(getClass()).error("Cannot bind divider property", ex);
}
JPanel statusBar = new JPanel(new FlowLayout(FlowLayout.LEFT, 3, 1));
statusBar.setBorder(TopBorder.create());
// add placeholder
statusBar.add(Box.createVerticalStrut(16));
statusBar.add(status);
if(getContentPane() instanceof JPanel) {
((JPanel) getContentPane()).setBorder(BorderFactory.createEmptyBorder());
}
getContentPane().add(splitPane, BorderLayout.CENTER);
getContentPane().add(statusBar, BorderLayout.SOUTH);
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-ui
public static int getPref(JSplitPane jSplitPane) {
if (jSplitPane == null) {
return 0;
}
Component c = jSplitPane.getTopComponent();
if (c == null || c.getPreferredSize() == null) {
if (jSplitPane.getSize() != null) {
return jSplitPane.getSize().height;
} else {
return 0;
}
}
if (JScrollPane.class.isAssignableFrom(c.getClass())) {
JScrollBar jsb = ((JScrollPane) c).getHorizontalScrollBar();
if (jsb.isShowing()) {
return jsb.getSize().height + c.getPreferredSize().height + jSplitPane.getInsets().top;
}
}
return c.getPreferredSize().height + jSplitPane.getInsets().top;
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
holder.add(js, BorderLayout.CENTER);
JSplitPane p2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, p, holder);
p2.setDividerLocation(200 + p2.getInsets().left);
代码示例来源:origin: Waikato/weka-trunk
holder.add(js, BorderLayout.CENTER);
JSplitPane p2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, p, holder);
p2.setDividerLocation(200 + p2.getInsets().left);
代码示例来源:origin: joel-costigliola/assertj-swing
@RunsInCurrentThread
private int calculateMaximum(@Nonnull JSplitPane splitPane) {
Component rightComponent = splitPane.getRightComponent();
if (splitPane.getLeftComponent() == null || rightComponent == null) {
return -1; // Don't allow dragging.
}
Insets insets = splitPane.getInsets();
int dividerSize = splitPane.getDividerSize();
int bottom = (insets != null) ? insets.bottom : 0;
int splitPaneHeight = splitPane.getSize().height;
if (!rightComponent.isVisible()) {
return max(0, splitPaneHeight - (dividerSize + bottom));
}
return max(0, splitPaneHeight - (dividerSize + bottom) - rightComponent.getMinimumSize().height);
}
代码示例来源:origin: joel-costigliola/assertj-swing
@RunsInCurrentThread
private int calculateMaximum(@Nonnull JSplitPane splitPane) {
Component rightComponent = splitPane.getRightComponent();
if (splitPane.getLeftComponent() == null || rightComponent == null) {
return -1; // Don't allow dragging.
}
Insets insets = splitPane.getInsets();
int dividerSize = splitPane.getDividerSize();
int right = (insets != null) ? insets.right : 0;
int splitPaneWidth = splitPane.getSize().width;
if (!rightComponent.isVisible()) {
return max(0, splitPaneWidth - (dividerSize + right));
}
return max(0, splitPaneWidth - (dividerSize + right) - rightComponent.getMinimumSize().width);
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf
/**
* Gets the PreferredSize attribute of the GtkSplitPane object
*
* @param splitpane Description of Parameter
* @return The PreferredSize value
*/
public Dimension getPreferredSize(JSplitPane splitpane) {
Insets insets = splitpane.getInsets();
int width = 0;
int height = 0;
if (splitpane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
width = Math.max(Math.max(up.getWidth(), down.getWidth()), 10);
height = splitpane.getHeight() + insets.top + insets.bottom;
}
else {
height = Math.max(Math.max(left.getHeight(), right.getHeight()), 10);
width = splitpane.getWidth() + insets.left + insets.right;
}
Dimension d = new Dimension(width, height);
return (d);
//return (splitpane.getOrientation() == JSplitPane.VERTICAL_SPLIT)
// ? new Dimension(Math.max(10, Math.min(up.getWidth(), v_thumb.getWidth())), 48)
// : new Dimension(48, Math.max(10, Math.min(left.getHeight(), h_thumb.getHeight())));
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, m_history, m_textScroller);
add(p2, BorderLayout.CENTER);
p2.setDividerLocation(200 + p2.getInsets().left);
代码示例来源:origin: Waikato/weka-trunk
new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, m_history, m_textScroller);
add(p2, BorderLayout.CENTER);
p2.setDividerLocation(200 + p2.getInsets().left);
代码示例来源:origin: openstreetmap/osmembrane
- splitMain.getInsets().right - splitMain.getDividerSize()
- 384);
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
m_splitPane.setDividerLocation(200 + m_splitPane.getInsets().left);
代码示例来源:origin: Waikato/weka-trunk
m_splitPane.setDividerLocation(200 + m_splitPane.getInsets().left);
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
m_splitPane.setDividerLocation(200 + m_splitPane.getInsets().left);
boolean first = true;
for (PlotData2D pd : ((DataVisualizer) getStep()).getPlots()) {
代码示例来源:origin: Waikato/weka-trunk
m_splitPane.setDividerLocation(200 + m_splitPane.getInsets().left);
boolean first = true;
for (PlotData2D pd : ((DataVisualizer) getStep()).getPlots()) {
内容来源于网络,如有侵权,请联系作者删除!