Browse Source

无jira任务 代码质量

newui
vito 12 months 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) @Styleable(dot = true)
protected int arc; protected int arc;
@SuppressWarnings({"MethodOverridesStaticMethodOfSuperclass", "UnusedDeclaration"}) /**
* 创建UI
*
* @param c 组件
* @return ComponentUI
*/
public static ComponentUI createUI(JComponent c) { public static ComponentUI createUI(JComponent c) {
return new FineHeadGroupUI(); 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); 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 入口参数

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 { public class UIHeadGroup extends Row {
private static final String uiClassID = "HeadGroupUI"; private static final String UI_CLASS_ID = "HeadGroupUI";
private UIHeadGroupSingleSelectionModel model; private UIHeadGroupSingleSelectionModel model;
private List<AbstractButton> btns; private List<AbstractButton> btns;
@ -62,7 +62,7 @@ public class UIHeadGroup extends Row {
* @see UIDefaults#getUI * @see UIDefaults#getUI
*/ */
public String getUIClassID() { public String getUIClassID() {
return uiClassID; return UI_CLASS_ID;
} }
private void intiContent() { private void intiContent() {

Loading…
Cancel
Save