本文整理了Java中javax.swing.JToolBar.getSize()
方法的一些代码示例,展示了JToolBar.getSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JToolBar.getSize()
方法的具体详情如下:
包路径:javax.swing.JToolBar
类名称:JToolBar
方法名:getSize
暂无
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
public boolean canDock(Component c, Point p)
{
boolean b= false;
if (c.contains(p))
{
dockingSensitivity=
(toolBar.getOrientation() == JToolBar.HORIZONTAL)
? toolBar.getSize().height
: toolBar.getSize().width;
// North
if (p.y < dockingSensitivity)
b= true;
// South
if (p.y > c.getSize().height - dockingSensitivity)
b= true;
// West (Base distance on height for now!)
if (p.x < dockingSensitivity)
b= true;
// East (Base distance on height for now!)
if (p.x > c.getSize().width - dockingSensitivity)
b= true;
}
return b;
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
private String getDockingConstraint(Component c, Point p)
{
if (p == null)
return constraintBeforeFloating;
String s= BorderLayout.NORTH;
if (c.contains(p))
{
dockingSensitivity=
(toolBar.getOrientation() == JToolBar.HORIZONTAL)
? toolBar.getSize().height
: toolBar.getSize().width;
if (p.y >= dockingSource.getSize().height - dockingSensitivity)
s= BorderLayout.SOUTH;
// West (Base distance on height for now!)
if (p.x < dockingSensitivity)
s= BorderLayout.WEST;
// East (Base distance on height for now!)
if (p.x >= dockingSource.getSize().width - dockingSensitivity)
s= BorderLayout.EAST;
// North (Base distance on height for now!)
if (p.y < dockingSensitivity)
s= BorderLayout.NORTH;
}
return s;
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
private String calculateConstraint(Component c, Point p)
{
if (p == null)
return constraintBeforeFloating;
String s= BorderLayout.NORTH;
if (c.contains(p))
{
dockingSensitivity=
(toolBar.getOrientation() == JToolBar.HORIZONTAL)
? toolBar.getSize().height
: toolBar.getSize().width;
if (p.y >= dockingSource.getSize().height - dockingSensitivity)
s= BorderLayout.SOUTH;
// West (Base distance on height for now!)
else if (
p.x < dockingSensitivity
&& (toolBar.getOrientation() == JToolBar.VERTICAL))
s= BorderLayout.WEST;
// East (Base distance on height for now!)
else if (
p.x >= dockingSource.getSize().width - dockingSensitivity
&& (toolBar.getOrientation() == JToolBar.VERTICAL))
s= BorderLayout.EAST;
// North (Base distance on height for now!)
else if (p.y < dockingSensitivity)
s= BorderLayout.NORTH;
}
return s;
}
代码示例来源:origin: pvto/konte-art
messagesList1.setBackground(bgc);
jToolBar1.add(messagesList1);
messagesList1.setPreferredSize(jToolBar1.getSize());
this.setIconImage(new ImageIcon(getClass().
getResource("/org/konte/resources/images/k_icon.png")).getImage());
代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw
if (offset == null) {
Dimension size = toolBar.getSize();
offset = new Point(size.width / 2, size.height / 2);
dragWindow.setOffset(offset);
if (dragWindow.isVisible() == false) {
Dimension size = toolBar.getSize();
dragWindow.setSize(size.width, size.height);
dragWindow.setVisible(true);
内容来源于网络,如有侵权,请联系作者删除!