📄 panelwithstruts.java
字号:
// PanelWithStruts.java
//
// Copyright (c) 2000-2001 Symbian Ltd. All rights reserved
package com.symbian.devnet.whist.awt;
import java.awt.*;
/**
* GridPanel offers a straightforward way to achieve relative positioning of
* visual components in a Panel. It makes use of a FlowLayout.
* @author Symbian Devnet
*/
public class PanelWithStruts extends Panel
{
/** The Layout of the <code>Panel</code>. */
private FlowLayout layout;
/**
*
*/
public PanelWithStruts()
{
layout = new FlowLayout(FlowLayout.LEFT, 8, 3);
setLayout(layout);
}
/**
* Returns the preferred <code>Dimension</code>s of the <code>Panel</code>.
* @return the preferred size of the <code>Panel</code>
*/
public Dimension getPreferredSize()
{
if (getComponentCount() > 6)
return new Dimension(240, 84);
else
return new Dimension(240, 42);
}
/**
* Returns the minimum <code>Dimension</code>s of the <code>Panel</code>.
* This method just calls {@link com.symbian.devnet.whist.awt.PanelWithStruts#getPreferredSize() getPreferredSize}.
* @return the minimum size of the <code>Panel</code>
*/
public Dimension getMinimumSize()
{
return getPreferredSize();
}
/**
* Returns the maximum <code>Dimension</code>s of the <code>Panel</code>.
* This method just calls {@link com.symbian.devnet.whist.awt.PanelWithStruts#getPreferredSize() getPreferredSize}.
* @return the maximum size of the <code>Panel</code>
*/
public Dimension getMaximumSize()
{
return getPreferredSize();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -