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