|
|
|
@ -98,7 +98,6 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
|
|
|
|
|
setPressedIcon(pressed); |
|
|
|
|
setExtraPainted(false); |
|
|
|
|
setBackground(null); |
|
|
|
|
// setForeground(UIConstants.FONT_COLOR);
|
|
|
|
|
setOpaque(false); |
|
|
|
|
initListener(); |
|
|
|
|
} |
|
|
|
@ -139,7 +138,6 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
|
|
|
|
|
public void set4ToolbarButton() { |
|
|
|
|
setNormalPainted(false); |
|
|
|
|
Dimension dim = getPreferredSize(); |
|
|
|
|
// dim.height = HEIGHT;
|
|
|
|
|
setBackground(null); |
|
|
|
|
setOpaque(false); |
|
|
|
|
setSize(dim); |
|
|
|
@ -159,7 +157,6 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
|
|
|
|
|
setNormalPainted(false); |
|
|
|
|
setBackground(null); |
|
|
|
|
setOpaque(false); |
|
|
|
|
|
|
|
|
|
setSize(new Dimension(34, 44)); |
|
|
|
|
setBorderPaintedOnlyWhenPressed(true); |
|
|
|
|
} |
|
|
|
@ -177,24 +174,6 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
|
|
|
|
|
return this.border; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// public Insets getInsets() {
|
|
|
|
|
// if (getIcon() != null) {
|
|
|
|
|
// return new Insets(0, 3, 0, 3);
|
|
|
|
|
// }
|
|
|
|
|
// return new Insets(0, 10, 0, 10);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//@Override
|
|
|
|
|
// public Dimension getPreferredSize() {
|
|
|
|
|
// Dimension dim = super.getPreferredSize();
|
|
|
|
|
// if (isFixedHeight() || dim.height < HEIGHT) {
|
|
|
|
|
// dim.height = HEIGHT;
|
|
|
|
|
// }
|
|
|
|
|
// return dim;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int getBorderType() { |
|
|
|
|
return borderType; |
|
|
|
|
} |
|
|
|
@ -324,15 +303,6 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
|
|
|
|
|
this.isBorderPaintedOnlyWhenPressed = value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// private boolean isFixedHeight() {
|
|
|
|
|
// String text = this.getText();
|
|
|
|
|
// if (StringUtils.isEmpty(text)) {
|
|
|
|
|
// return true;
|
|
|
|
|
// }
|
|
|
|
|
// // 如果允许换行,需要放开按钮高度的限制
|
|
|
|
|
// return !text.startsWith("<html>");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 主函数 |
|
|
|
|
* @param args 入口参数 |
|
|
|
|