diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java index 5854b8d6e1..3212a41853 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java @@ -61,8 +61,14 @@ public class FineLightIconSet extends AbstractIconSet { new SvgIconSource("vcs_list", "com/fr/design/standard/vcslist/vcs_list.svg", true), new SvgIconSource("view_folder", "com/fr/design/standard/viewfolder/view_folder.svg", true), new SvgIconSource("refresh", "com/fr/design/standard/refresh.svg", true), - new SvgIconSource("new_folder", "com/fr/design/standard/newfolder/new_folder.svg", true) + new SvgIconSource("new_folder", "com/fr/design/standard/newfolder/new_folder.svg", true), - ); + // CheckBox相关Icon + new SvgIconSource("checkbox_checked", "com/fr/design/standard/checkbox/checked.svg", true), + new SvgIconSource("checkbox_unchecked", "com/fr/design/standard/checkbox/unchecked.svg", true), + new SvgIconSource("checkbox_part_checked", "com/fr/design/standard/checkbox/part_checked.svg", true), + new SvgIconSource("checkbox_hovered", "com/fr/design/standard/checkbox/hovered.svg", true) + + ); } } diff --git a/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java b/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java index 8162c7ba86..93490f7116 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java @@ -1,13 +1,11 @@ package com.fr.design.gui.icheckbox; -import com.fr.design.constants.UIConstants; +import com.fine.theme.icon.LazyIcon; import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.core.UITextComponent; -import com.fr.design.utils.gui.GUIPaintUtils; -import com.fr.stable.Constants; import sun.swing.SwingUtilities2; import javax.swing.AbstractButton; @@ -144,7 +142,7 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser * * @return UICheckBoxUI */ - public UICheckBoxUI getUICheckBoxUI(){ + public UICheckBoxUI getUICheckBoxUI() { return new UICheckBoxUI(); } @@ -176,28 +174,15 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser b.getVerticalTextPosition(), b.getHorizontalTextPosition(), viewRect, iconRect, textRect, b.getIconTextGap()); - // fill background - if (c.isOpaque()) { - g.setColor(b.getBackground()); - g.fillRect(0, 0, size.width, size.height); - } - Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); if (model.isSelected()) { - GUIPaintUtils.fillPaint(g2d, iconRect.x, iconRect.y, iconRect.width, iconRect.height, false, Constants.NULL, - model.isEnabled() ? UIConstants.CHECKBOX_HOVER_SELECTED : UIConstants.DISABLED_ICON_COLOR, 0); - } else if (model.isRollover() && !model.isSelected()) { - g.setColor(UIConstants.CHECKBOX_HOVER_SELECTED); - g2d.drawRoundRect(iconRect.x, iconRect.y, iconRect.width - 1, iconRect.height - 1, UIConstants.ARC, UIConstants.ARC); + new LazyIcon("checkbox_checked").paintIcon(c, g, iconRect.x, iconRect.y); + } else if (model.isRollover()) { + new LazyIcon("checkbox_hovered").paintIcon(c, g, iconRect.x, iconRect.y); } else { - g.setColor(UIConstants.LINE_COLOR); - g2d.drawRoundRect(iconRect.x, iconRect.y, iconRect.width - 1, iconRect.height - 1, UIConstants.ARC, UIConstants.ARC); + new LazyIcon("checkbox_unchecked").paintIcon(c, g, iconRect.x, iconRect.y); } - - if (model.isSelected()) { - UIConstants.YES_ICON.paintIcon(c, g, iconRect.x + 2, iconRect.y + 2); - } g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); // Draw the Text diff --git a/designer-base/src/main/resources/com/fr/design/images/newui/check-hovered.svg b/designer-base/src/main/resources/com/fr/design/images/newui/check-hovered.svg new file mode 100644 index 0000000000..1305030ec4 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/newui/check-hovered.svg @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/newui/checked.svg b/designer-base/src/main/resources/com/fr/design/images/newui/checked.svg new file mode 100644 index 0000000000..d6d97f23ab --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/newui/checked.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/newui/not-checked.svg b/designer-base/src/main/resources/com/fr/design/images/newui/not-checked.svg new file mode 100644 index 0000000000..3f26076a0b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/newui/not-checked.svg @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/standard/checkbox/checked.svg b/designer-base/src/main/resources/com/fr/design/standard/checkbox/checked.svg new file mode 100644 index 0000000000..fa4b47ddd7 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/checkbox/checked.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/checkbox/checked_disable.svg b/designer-base/src/main/resources/com/fr/design/standard/checkbox/checked_disable.svg new file mode 100644 index 0000000000..88df5c1a59 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/checkbox/checked_disable.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/checkbox/hovered.svg b/designer-base/src/main/resources/com/fr/design/standard/checkbox/hovered.svg new file mode 100644 index 0000000000..54a7539d4d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/checkbox/hovered.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/checkbox/part_checked.svg b/designer-base/src/main/resources/com/fr/design/standard/checkbox/part_checked.svg new file mode 100644 index 0000000000..caeebfd58c --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/checkbox/part_checked.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/checkbox/unchecked.svg b/designer-base/src/main/resources/com/fr/design/standard/checkbox/unchecked.svg new file mode 100644 index 0000000000..86fa2f7148 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/checkbox/unchecked.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/checkbox/unchecked_disable.svg b/designer-base/src/main/resources/com/fr/design/standard/checkbox/unchecked_disable.svg new file mode 100644 index 0000000000..cab88105ee --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/checkbox/unchecked_disable.svg @@ -0,0 +1,6 @@ + + + + + +