Browse Source

无jira任务 代码质量

newui
vito 1 year ago
parent
commit
c660381217
  1. 7
      designer-base/src/main/java/com/fine/theme/light/ui/FineHeadGroupUI.java
  2. 30
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java
  3. 4
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java

7
designer-base/src/main/java/com/fine/theme/light/ui/FineHeadGroupUI.java

@ -27,7 +27,12 @@ public class FineHeadGroupUI extends PanelUI {
@Styleable(dot = true)
protected int arc;
@SuppressWarnings({"MethodOverridesStaticMethodOfSuperclass", "UnusedDeclaration"})
/**
* 创建UI
*
* @param c 组件
* @return ComponentUI
*/
public static ComponentUI createUI(JComponent c) {
return new FineHeadGroupUI();
}

30
designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java

@ -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 入口参数

4
designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java

@ -30,7 +30,7 @@ import static com.formdev.flatlaf.FlatClientProperties.BUTTON_TYPE_TAB;
*/
public class UIHeadGroup extends Row {
private static final String uiClassID = "HeadGroupUI";
private static final String UI_CLASS_ID = "HeadGroupUI";
private UIHeadGroupSingleSelectionModel model;
private List<AbstractButton> btns;
@ -62,7 +62,7 @@ public class UIHeadGroup extends Row {
* @see UIDefaults#getUI
*/
public String getUIClassID() {
return uiClassID;
return UI_CLASS_ID;
}
private void intiContent() {

Loading…
Cancel
Save