diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java b/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
index e2186efc4e..294fdd57ce 100644
--- a/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
+++ b/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
@@ -30,6 +30,9 @@ public interface FineUIStyle {
String LABEL_BOLD = "boldLabel";
String LABEL_TIP_WINDOW_TITLE = "tipWindowTitleLabel";
String LABEL_SECONDARY = "secondaryLabel";
+ String LABEL_HIGHLIGHT = "highLightLabel";
+ String LABEL_PRIMARY = "primaryLabel";
+ String LABEL_DISABLED = "disabledLabel";
String LABEL_TIP = "tipLabel";
String LABEL_WARNING_TIP = "warningTipLabel";
String LABEL_UILIST = "uiListLabel";
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java
index b723e08b16..c18b153924 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java
@@ -1,10 +1,10 @@
package com.fr.design.actions.help.alphafine;
+import com.fine.theme.icon.LazyIcon;
+import com.fine.theme.utils.FineUIScale;
import com.fr.base.extension.FileExtension;
-import com.fr.base.svg.IconUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.DesignUtils;
-import com.fr.general.IOUtils;
import javax.swing.Icon;
import java.awt.Color;
@@ -40,23 +40,20 @@ public class AlphaFineConstants {
public static final int LATEST_SHOW_SIZE = 3;
- public static final int HEIGHT = 680;
+ public static final int HEIGHT = FineUIScale.scale(680);
- public static final int WIDTH = 460;
+ public static final int WIDTH = FineUIScale.scale(460);
- public static final int LEFT_WIDTH = 300;
+ public static final int LEFT_WIDTH = FineUIScale.scale(320);
- public static final int RIGHT_WIDTH = 380;
+ public static final int RIGHT_WIDTH = FineUIScale.scale(320);
- public static final int FIELD_HEIGHT = 55;
+ public static final int CONTENT_HEIGHT = FineUIScale.scale(280);
- public static final int CONTENT_HEIGHT = 405;
+ public static final int CELL_HEIGHT = FineUIScale.scale(24);
- public static final int CELL_HEIGHT = 29;
+ public static final int CELL_TITLE_HEIGHT = FineUIScale.scale(24);
- public static final int CELL_TITLE_HEIGHT = 24;
-
- public static final int HOT_ICON_LABEL_HEIGHT = 36;
public static final int HOT_ITEMS = 6;
@@ -70,24 +67,20 @@ public class AlphaFineConstants {
*/
public static final long DOCUMENT_SEARCH_GAP = 1000;
- public static final Dimension FULL_SIZE = new Dimension(680, 460);
-
- public static final Dimension CONTENT_SIZE = new Dimension(680, 405);
+ public static final Dimension FULL_SIZE = FineUIScale.createScaleDimension(680, 490);
- public static final Dimension FIELD_SIZE = new Dimension(680, 55);
+ public static final Dimension CONTENT_SIZE = FineUIScale.createScaleDimension(640, 280);
- public static final Dimension ICON_LABEL_SIZE = new Dimension(64, 64);
+ public static final Dimension FIELD_SIZE = FineUIScale.createScaleDimension(680, 55);
- public static final Dimension HOT_ICON_LABEL_SIZE = new Dimension(36, 36);
+ public static final Dimension ICON_LABEL_SIZE = FineUIScale.createScaleDimension(64, 64);
- public static final Dimension HOT_ISSUES_JAPNEL_SIZE = new Dimension(213, 182);
+ public static final Dimension HOT_ISSUES_JAPNEL_SIZE = FineUIScale.createScaleDimension(213, 182);
/**
* 展示面板的尺寸
*/
- public static final Dimension PREVIEW_SIZE = new Dimension(680, 305);
-
- public static final Dimension CLOSE_BUTTON_SIZE = new Dimension(40, 40);
+ public static final Dimension PREVIEW_SIZE = FineUIScale.createScaleDimension(640, 300);
public static final Color WHITE = new Color(0xf9f9f9);
@@ -149,7 +142,7 @@ public class AlphaFineConstants {
public static final String BACK_ICON_NAME = "back@1x.png";
- public static final Icon NO_RESULT_ICON = IOUtils.readIcon(AlphaFineConstants.IMAGE_URL + "noresult.png");
+ public static final Icon NO_RESULT_ICON = new LazyIcon("no_result", 110);
public static final Color SUSPENDED_COLOR = new Color(84, 165, 249);
@@ -166,11 +159,11 @@ public class AlphaFineConstants {
public static final Color BACKGROUND_COLOR = new Color(245, 245, 247);
- public static final Icon BULB_ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/bulb.svg");
+ public static final Icon BULB_ICON = new LazyIcon("bulb");
- public static final Icon YELLOW_BULB_ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/yellow_bulb.svg");
+ public static final Icon YELLOW_BULB_ICON = new LazyIcon("bulb_hover");
- public static final Icon LIGHT_YELLOW_BULB_ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/light_yellow_bulb.svg");
+ public static final Icon LIGHT_YELLOW_BULB_ICON = new LazyIcon("bulb_click");
public static final String HOT_SEARCH = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Hot_Search");
diff --git a/designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb.svg b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb.svg
new file mode 100644
index 0000000000..c08c0ea671
--- /dev/null
+++ b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb.svg
@@ -0,0 +1,4 @@
+
diff --git a/designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb_click.svg b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb_click.svg
new file mode 100644
index 0000000000..aa8edbf6b6
--- /dev/null
+++ b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb_click.svg
@@ -0,0 +1,4 @@
+
diff --git a/designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb_hover.svg b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb_hover.svg
new file mode 100644
index 0000000000..339ec4bc38
--- /dev/null
+++ b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb_hover.svg
@@ -0,0 +1,4 @@
+
diff --git a/designer-base/src/main/resources/com/fine/theme/icon/alphafine/minimize.svg b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/minimize.svg
new file mode 100644
index 0000000000..7226802a7e
--- /dev/null
+++ b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/minimize.svg
@@ -0,0 +1,3 @@
+
diff --git a/designer-base/src/main/resources/com/fine/theme/icon/alphafine/minimize_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/minimize_disable.svg
new file mode 100644
index 0000000000..674423958d
--- /dev/null
+++ b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/minimize_disable.svg
@@ -0,0 +1,3 @@
+
diff --git a/designer-base/src/main/resources/com/fine/theme/icon/alphafine/no_result.svg b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/no_result.svg
new file mode 100644
index 0000000000..e87a383159
--- /dev/null
+++ b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/no_result.svg
@@ -0,0 +1,20 @@
+
diff --git a/designer-base/src/main/resources/com/fine/theme/icon/alphafine/search_hint.svg b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/search_hint.svg
new file mode 100644
index 0000000000..b7e6de9cec
--- /dev/null
+++ b/designer-base/src/main/resources/com/fine/theme/icon/alphafine/search_hint.svg
@@ -0,0 +1,28 @@
+
diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
index 4cfeeb7521..81d2177697 100644
--- a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
+++ b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
@@ -481,6 +481,12 @@
"arrange_vertical_center": "arrange/arrange_vertical_center.svg",
"arrange_bottom_align": "arrange/arrange_bottom_align.svg",
"arrange_horizontal_distribute": "arrange/arrange_horizontal_distribute.svg",
- "arrange_vertical_distribute": "arrange/arrange_vertical_distribute.svg"
+ "arrange_vertical_distribute": "arrange/arrange_vertical_distribute.svg",
+ "bulb": "alphafine/bulb.svg",
+ "bulb_click": "alphafine/bulb_click.svg",
+ "bulb_hover": "alphafine/bulb_hover.svg",
+ "minimize": "alphafine/minimize.svg",
+ "search_hint": "alphafine/search_hint.svg",
+ "no_result": "alphafine/no_result.svg"
}
}
diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
index 0adc8cf686..df47e34cf2 100644
--- a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
+++ b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
@@ -414,7 +414,10 @@ Label.borderColor = $defaultBorderColor
Label.hyperLinkColor = #2576EF
Label.strongHintColor = #FF0000
Label.warningColor = #F1393C
-Label.secondaryColor = #0A1C38A8
+Label.disabledColor = fade(@foreground, 29%)
+Label.secondaryColor = fade(@foreground, 47%)
+Label.primaryColor = fade(@foreground, 78%)
+Label.highLightColor = fade(@foreground, 90%)
# ---- Calendar ----
Calendar.background = $fill.normal
@@ -1379,9 +1382,18 @@ chart.selectedBorderColor = #2576EF
[style]Label.warningTipLabel = \
foreground: $Label.warningColor
+[style]Label.disabledLabel = \
+ foreground: $Label.disabledColor
+
[style]Label.secondaryLabel = \
foreground: $Label.secondaryColor
+[style]Label.primaryLabel = \
+ foreground: $Label.primaryColor
+
+[style]Label.highLightLabel = \
+ foreground: $Label.highLightColor
+
[style]Label.uiListLabel = \
foreground: $List.wrapper.text.fontColor; \
background: $background.normal
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
index 4c2f611715..337bdc219f 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
@@ -1,6 +1,9 @@
package com.fr.design.mainframe.alphafine.component;
import com.bulenkov.iconloader.IconLoader;
+import com.fine.theme.icon.LazyIcon;
+import com.fine.theme.utils.FineUIScale;
+import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
@@ -204,8 +207,7 @@ public class AlphaFineDialog extends UIDialog {
super.paintComponent(g);
}
};
- closeButton.setPreferredSize(AlphaFineConstants.CLOSE_BUTTON_SIZE);
- closeButton.setIcon(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + "alphafine_close.png"));
+ closeButton.setIcon(new LazyIcon("close", 40));
closeButton.set4ToolbarButton();
closeButton.setBorderPainted(false);
closeButton.setRolloverEnabled(false);
@@ -229,12 +231,12 @@ public class AlphaFineDialog extends UIDialog {
private void initHotPane() {
removeHotPane();
hotPane = new JPanel();
- hotPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+ hotPane.setBorder(new ScaledEmptyBorder(5, 5, 5, 5));
hotPane.setPreferredSize(AlphaFineConstants.CONTENT_SIZE);
hotPane.setLayout(new BorderLayout());
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Hot"));
- uiLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
+ uiLabel.setBorder(new ScaledEmptyBorder(0, 5, 0, 0));
uiLabel.setFont(AlphaFineConstants.SMALL_FONT);
uiLabel.setForeground(AlphaFineConstants.DARK_GRAY);
@@ -283,7 +285,6 @@ public class AlphaFineDialog extends UIDialog {
*/
private void initProperties() {
setUndecorated(true);
-//addComponentListener(new ComponentHandler());
setSize(AlphaFineConstants.FIELD_SIZE);
centerWindow(this);
@@ -1238,12 +1239,6 @@ public class AlphaFineDialog extends UIDialog {
@Override
protected void fireContentsChanged(Object source, int index0, int index1) {
- if (myDelegate.size() > MAX_SHOW_SIZE) {
- leftSearchResultPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
- leftSearchResultPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 2));
- } else {
- leftSearchResultPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
- }
super.fireContentsChanged(source, index0, index1);
}
@@ -1367,8 +1362,8 @@ public class AlphaFineDialog extends UIDialog {
backPane = new JPanel(new BorderLayout());
JLabel jLabel = new JLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Back"));
jLabel.setIcon(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + AlphaFineConstants.BACK_ICON_NAME));
- jLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
- jLabel.setPreferredSize(new Dimension(80, 20));
+ jLabel.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
+ jLabel.setPreferredSize(FineUIScale.createScaleDimension(80, 20));
jLabel.setFont(AlphaFineConstants.SMALL_FONT);
jLabel.setForeground(AlphaFineConstants.DARK_GRAY);
jLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
@@ -1401,14 +1396,15 @@ public class AlphaFineDialog extends UIDialog {
public HotIssueJpanel(String[] str, int pngIndex) {
this.setLayout(new BorderLayout());
- this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+ this.setBorder(new ScaledEmptyBorder(5, 5, 5, 5));
this.setSize(AlphaFineConstants.HOT_ISSUES_JAPNEL_SIZE);
JPanel pane1 = new JPanel(new BorderLayout());
+ // 图标待替换
UILabel iconLabel = new UILabel(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + AlphaFineConstants.ALPHA_HOT_IMAGE_NAME + pngIndex + ".png"));
iconLabel.setOpaque(true);
iconLabel.setBackground(Color.WHITE);
- iconLabel.setBorder(BorderFactory.createEmptyBorder(20, 0, 0, 0));
+ iconLabel.setBorder(new ScaledEmptyBorder(20, 0, 0, 0));
pane1.add(iconLabel, BorderLayout.NORTH);
add(pane1, BorderLayout.NORTH);
@@ -1454,7 +1450,7 @@ public class AlphaFineDialog extends UIDialog {
bottomPanel.add(subTitle);
}
bottomPanel.setLayout(gridLayout);
- bottomPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 22, 0));
+ bottomPanel.setBorder(new ScaledEmptyBorder(0, 20, 20, 0));
add(bottomPanel, BorderLayout.SOUTH);
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
index 23625aa6ea..7c28c28f7d 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
@@ -1,13 +1,18 @@
package com.fr.design.mainframe.alphafine.component;
+import com.fine.swing.ui.layout.Row;
+import com.fine.theme.icon.LazyIcon;
+import com.fine.theme.utils.FineUIScale;
+import com.fine.theme.utils.FineUIStyle;
+import com.fine.theme.utils.FineUIUtils;
+import com.formdev.flatlaf.ui.FlatUIUtils;
+import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.svg.IconUtils;
import com.fr.base.svg.SVGLoader;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.actions.help.alphafine.AlphaFineShortCutUtil;
-import com.fr.design.constants.UIConstants;
-import com.fr.design.gui.borders.UITextFieldBorder;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineHelper;
@@ -37,19 +42,18 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.PluginSearchManager
import com.fr.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.TemplateResourceSearchManager;
-import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
-import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.SwingConstants;
import javax.swing.Timer;
+import javax.swing.border.LineBorder;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import java.awt.BorderLayout;
@@ -61,7 +65,6 @@ import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
-import java.awt.Insets;
import java.awt.RenderingHints;
import java.awt.Toolkit;
import java.awt.Window;
@@ -81,6 +84,13 @@ import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.jetbrains.annotations.NotNull;
+
+import static com.fine.swing.ui.layout.Layouts.cell;
+import static com.fine.swing.ui.layout.Layouts.row;
+import static com.fine.swing.ui.layout.Layouts.column;
+import static com.fine.swing.ui.layout.Layouts.flex;
+
/**
* @author hades
@@ -123,7 +133,7 @@ public class AlphaFineFrame extends JFrame {
private static final Image SEARCH_IMAGE = SVGLoader.load("/com/fr/design/mainframe/alphafine/images/search.svg");
- private static final Color BORDER_COLOR = new Color(232, 232, 233);
+ private static final Color FLESH_BLUE = FlatUIUtils.getUIColor("brand.normal", Color.BLUE);
private final CardLayout cardLayout = new CardLayout();
@@ -259,45 +269,46 @@ public class AlphaFineFrame extends JFrame {
* 初始化全部组件
*/
private void initComponents() {
- add(createTopPane(), BorderLayout.NORTH);
- initSearchTextField();
- add(createSearchPane(), BorderLayout.CENTER);
- add(createShowPane(), BorderLayout.SOUTH);
+ add(column(10,
+ cell(createTopPane()),
+ cell(createSearchPane()),
+ cell(createShowPane())
+ ).getComponent());
this.getContentPane().setBackground(Color.WHITE);
this.setIconImage(SEARCH_IMAGE); // 应用图标
}
private JPanel createTopPane() {
JPanel topPane = new JPanel(new BorderLayout());
- topPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
- topPane.setBackground(Color.WHITE);
- JPanel topLeftPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
- topLeftPane.setBackground(Color.WHITE);
- UILabel alphaFineLabel = new UILabel(AlphaFineConstants.TITLE);
- alphaFineLabel.setFont(new Font("Arial Black", Font.PLAIN, 20));
- alphaFineLabel.setForeground(UIConstants.FLESH_BLUE);
- topLeftPane.add(alphaFineLabel);
+ topPane.setBorder(new ScaledEmptyBorder(10, 20, 0, 20));
+ UILabel topLeftPane = new UILabel(AlphaFineConstants.TITLE);
+ topLeftPane.setFont(new Font("Arial Black", Font.PLAIN, FineUIScale.scale(20)));
+ topLeftPane.setForeground(FLESH_BLUE);
+ topLeftPane.setOpaque(false);
topPane.add(topLeftPane, BorderLayout.WEST);
- JPanel topRightPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 10));
- topRightPane.setBackground(Color.WHITE);
- JPanel tipPane = new JPanel(new BorderLayout());
- tipPane.setBackground(Color.WHITE);
tipIconLabel = new UILabel(AlphaFineConstants.BULB_ICON);
tipIconLabel.addMouseListener(tipMouseListener);
- useTipLabel = new UILabel(SKILLS);
+ useTipLabel = new UILabel(SKILLS, FineUIStyle.LABEL_HIGHLIGHT);
useTipLabel.addMouseListener(tipMouseListener);
- useTipLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6);
- tipPane.add(tipIconLabel, BorderLayout.WEST);
- tipPane.add(useTipLabel, BorderLayout.CENTER);
- topRightPane.add(tipPane);
- UIButton minimizeButton = createButton(IconUtils.readIcon("/com/fr/design/mainframe/alphafine/images/minimize.svg"));
+ UIButton minimizeButton = new UIButton(new LazyIcon("minimize"));
minimizeButton.addActionListener(e -> AlphaFineFrame.this.setExtendedState(JFrame.ICONIFIED));
- topRightPane.add(minimizeButton);
- UIButton closeButton = createButton(IconUtils.readIcon("/com/fr/design/mainframe/alphafine/images/close.svg"));
+ FineUIStyle.setStyle(minimizeButton, FineUIStyle.ORIGINAL_BUTTON);
+ minimizeButton.setBackground(Color.WHITE);
+ UIButton closeButton = new UIButton(new LazyIcon("close"));
closeButton.addActionListener(e -> AlphaFineFrame.this.dispose());
- topRightPane.add(closeButton);
- topPane.add(topRightPane, BorderLayout.EAST);
+ FineUIStyle.setStyle(closeButton, FineUIStyle.ORIGINAL_BUTTON);
+ closeButton.setBackground(Color.WHITE);
+
+ JPanel topRightPane = new JPanel(new BorderLayout());
+ topRightPane.setOpaque(false);
+ topRightPane.add(row(16,
+ row(cell(tipIconLabel), cell(useTipLabel)),
+ cell(minimizeButton),
+ cell(closeButton)
+ ).getComponent());
+ topPane.add(column(flex(), cell(topRightPane), flex()).getComponent(), BorderLayout.EAST);
+ topPane.setOpaque(false);
return topPane;
}
@@ -313,30 +324,29 @@ public class AlphaFineFrame extends JFrame {
@Override
public void mouseExited(MouseEvent e) {
if (popupMenu == null || !popupMenu.isShowing()) {
- useTipLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6);
+ useTipLabel.setForeground(FineUIUtils.getUIColor("Label.highLightColor", "Label.highLightColor"));
tipIconLabel.setIcon(AlphaFineConstants.BULB_ICON);
}
}
@Override
public void mousePressed(MouseEvent e) {
- useTipLabel.setForeground(UIConstants.FLESH_BLUE);
+ useTipLabel.setForeground(FLESH_BLUE);
tipIconLabel.setIcon(AlphaFineConstants.LIGHT_YELLOW_BULB_ICON);
popupMenu = createTipPop();
- GUICoreUtils.showPopupMenu(popupMenu, e.getComponent(), e.getComponent().getX() - 60, e.getComponent().getY() + 20);
+ GUICoreUtils.showPopupMenu(popupMenu, e.getComponent(), e.getComponent().getX() - FineUIScale.scale(60), e.getComponent().getY() + FineUIScale.scale(20));
}
};
private JPopupMenu createTipPop() {
JPanel panel = new JPanel(new BorderLayout());
String toolTip = AlphaFineShortCutUtil.getDisplayShortCut(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Short_Cut", DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getShortcuts()));
- UILabel label = new UILabel(toolTip);
- label.setForeground(AlphaFineConstants.FOREGROUND_COLOR_8);
+ UILabel label = new UILabel(toolTip, FineUIStyle.LABEL_HIGHLIGHT);
label.setBackground(Color.WHITE);
panel.add(label);
panel.setBackground(Color.WHITE);
JPopupMenu popupMenu = new JPopupMenu();
- popupMenu.setBorder(BorderFactory.createEmptyBorder(20, 5, 10, 5));
+ popupMenu.setBorder(new ScaledEmptyBorder(20, 5, 10, 5));
popupMenu.add(panel);
popupMenu.setBackground(Color.WHITE);
popupMenu.addPopupMenuListener(new PopupMenuListener() {
@@ -347,7 +357,7 @@ public class AlphaFineFrame extends JFrame {
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
- useTipLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6);
+ useTipLabel.setForeground(FineUIUtils.getUIColor("Label.highLightColor", "Label.highLightColor"));
tipIconLabel.setIcon(AlphaFineConstants.BULB_ICON);
}
@@ -361,15 +371,14 @@ public class AlphaFineFrame extends JFrame {
private JPanel createSearchPane() {
JPanel searchPane = new JPanel(new BorderLayout());
- searchPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
- searchTextFieldWrapperPane = new JPanel(new BorderLayout()) {
- @Override
- protected void paintBorder(Graphics g) {
- g.setColor(BORDER_COLOR);
- g.drawRoundRect(0, 0, getWidth() - 1, getHeight() - 1, 5, 5);
- }
- };
- searchTextFieldWrapperPane.setBorder(new UITextFieldBorder(new Insets(2, 3, 2, 3)));
+ searchPane.setPreferredSize(FineUIScale.createScaleDimension(632, 32));
+ searchPane.setBorder(new ScaledEmptyBorder(0, 20, 0, 20));
+
+ searchTextField = new AlphaFineTextField(PLACE_HOLDER);
+ initTextFieldListener();
+ searchTextField.setBackground(Color.WHITE);
+
+ searchTextFieldWrapperPane = new JPanel(new BorderLayout());
searchTextFieldWrapperPane.setBackground(Color.WHITE);
searchTextFieldWrapperPane.add(searchTextField, BorderLayout.CENTER);
clearLabel = new UILabel(IconUtils.readIcon("/com/fr/design/mainframe/alphafine/images/clear.svg"));
@@ -383,14 +392,25 @@ public class AlphaFineFrame extends JFrame {
}
});
searchTextFieldWrapperPane.add(clearLabel, BorderLayout.EAST);
+ searchTextFieldWrapperPane.setBorder(BorderFactory.createCompoundBorder(
+ new LineBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.BLACK)),
+ new ScaledEmptyBorder(0, 0, 0, 6)
+ ));
searchPane.add(searchTextFieldWrapperPane, BorderLayout.CENTER);
+ JButton searchButton = getSearchButton();
+ searchPane.add(searchButton, BorderLayout.EAST);
+ searchPane.setBackground(Color.WHITE);
+ return searchPane;
+ }
+
+ private @NotNull JButton getSearchButton() {
JButton searchButton = new JButton(SEARCH) {
@Override
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setColor(UIConstants.FLESH_BLUE);
- g2d.fillRoundRect(0, 0, getWidth(), getHeight(), 4, 4);
+ g2d.setColor(FLESH_BLUE);
+ g2d.fillRoundRect(0, 0, getWidth(), getHeight(), FineUIScale.scale(4), FineUIScale.scale(4));
super.paintComponent(g2d);
}
};
@@ -400,13 +420,10 @@ public class AlphaFineFrame extends JFrame {
fireSearch();
}
});
- searchButton.setPreferredSize(new Dimension(70, 60));
searchButton.setForeground(Color.WHITE);
searchButton.setBorderPainted(false);
searchButton.setContentAreaFilled(false);
- searchPane.add(searchButton, BorderLayout.EAST);
- searchPane.setBackground(Color.WHITE);
- return searchPane;
+ return searchButton;
}
/**
@@ -414,7 +431,6 @@ public class AlphaFineFrame extends JFrame {
*/
private JPanel createShowPane() {
JPanel showPane = new JPanel(new BorderLayout());
-
// 内容区,card layout
resultPane.add(new DefaultProductNewsPane(), CellType.PRODUCT_NEWS.getFlagStr4None());
resultPane.add(new NoResultWithLinkPane(GO_FORUM, AlphaFineConstants.NO_RESULT_ICON), CellType.NO_RESULT.getFlagStr4None());
@@ -424,24 +440,25 @@ public class AlphaFineFrame extends JFrame {
resultPane.add(new HelpDocumentNoResultPane(SEARCH_TERM, AlphaFineConstants.NO_RESULT_ICON), CellType.DOCUMENT.getFlagStr4None());
resultPane.add(TemplateShopPane.getInstance(), CellType.TEMPLATE_SHOP.getFlagStr4None());
resultPane.add(new NetWorkFailedPane(this::reSearch), AlphaFineConstants.NETWORK_ERROR);
-
+ //resultPane.setBackground(Color.WHITE);
// label区,border layout
labelPane = new JPanel(new BorderLayout());
- labelPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
labelPane.setBackground(Color.WHITE);
labelContentPane = new JPanel(new BorderLayout());
tabLabel = createTabLabel(AlphaFineConstants.PRODUCT_NEWS);
labelWestPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
labelWestPane.add(tabLabel);
+ labelWestPane.setOpaque(false);
labelContentPane.add(labelWestPane, BorderLayout.WEST);
+
labelEastPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
// 一键已读
readLabel = new UILabel(ONE_CLICK_READ);
readLabel.setHorizontalAlignment(SwingConstants.RIGHT);
readLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
- readLabel.setPreferredSize(new Dimension(100, 30));
- readLabel.setForeground(UIConstants.FLESH_BLUE);
+ readLabel.setPreferredSize(FineUIScale.createScaleDimension(100, 30));
+ readLabel.setForeground(FLESH_BLUE);
readLabel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
@@ -450,14 +467,18 @@ public class AlphaFineFrame extends JFrame {
}
});
labelEastPane.add(readLabel);
+ labelEastPane.setOpaque(false);
labelContentPane.add(labelEastPane, BorderLayout.EAST);
- labelContentPane.setBackground(new Color(245, 245, 247));
+ labelContentPane.setBackground(FineUIUtils.getUIColor("FineTabbedPane.background", "fill.gray"));
labelPane.add(labelContentPane);
- labelPane.setPreferredSize(new Dimension(AlphaFineConstants.FULL_SIZE.width, 30));
+ labelPane.setPreferredSize(new Dimension(AlphaFineConstants.FULL_SIZE.width, FineUIScale.scale(28)));
// tab区 flow layout
- tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10));
- tabPane.setBackground(Color.WHITE);
+ tabPane = new JPanel(new BorderLayout());
+ Row tabRow = new Row();
+ tabRow.setSpacing(20);
+ tabPane.add(tabRow);
+ tabPane.setOpaque(false);
List selectedLabelList = createSelectedLabelList();
selectedTab = null;
for (SelectedLabel label : selectedLabelList) {
@@ -472,19 +493,22 @@ public class AlphaFineFrame extends JFrame {
}
for (SelectedLabel label : selectedLabelList) {
label.addMouseListener(createMouseListener(selectedLabelList, label, tabPane, tabLabel, readLabel));
- tabPane.add(label);
+ tabRow.add(label);
}
- showPane.add(tabPane, BorderLayout.NORTH);
- showPane.add(labelPane, BorderLayout.CENTER);
- showPane.add(resultPane, BorderLayout.SOUTH);
+ showPane.setBackground(Color.WHITE);
+ showPane.setBorder(new ScaledEmptyBorder(0, 20, 0, 20));
+ showPane.add(column(10,
+ cell(tabPane),
+ cell(labelPane),
+ cell(resultPane)
+ ).getComponent());
return showPane;
}
private UILabel createTabLabel(String labelName) {
- UILabel label = new UILabel(labelName);
- label.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
- label.setPreferredSize(new Dimension(60, 30));
- label.setForeground(AlphaFineConstants.LABEL_SELECTED);
+ UILabel label = new UILabel(labelName, FineUIStyle.STYLE_PRIMARY);
+ label.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
+ label.setPreferredSize(FineUIScale.createScaleDimension(60, 30));
return label;
}
@@ -725,12 +749,7 @@ public class AlphaFineFrame extends JFrame {
}
private void initSearchTextField() {
- searchTextField = new AlphaFineTextField(PLACE_HOLDER);
- initTextFieldListener();
- searchTextField.setFont(DesignUtils.getDefaultGUIFont().applySize(14));
- searchTextField.setBackground(Color.WHITE);
- searchTextField.setPreferredSize(new Dimension(300, 60));
- searchTextField.setBorder(null);
+
}
private void initTextFieldListener() {
@@ -963,23 +982,6 @@ public class AlphaFineFrame extends JFrame {
return searchText;
}
- private UIButton createButton(Icon icon) {
- UIButton button = new UIButton() {
- @Override
- public void paintComponent(Graphics g) {
- g.setColor(Color.WHITE);
- g.fillRect(0, 0, getSize().width, getSize().height);
- super.paintComponent(g);
- }
- };
- button.setPreferredSize(new Dimension(20, 20));
- button.setIcon(icon);
- button.set4ToolbarButton();
- button.setBorderPainted(false);
- button.setRolloverEnabled(false);
- return button;
- }
-
/**
* 设置面板位置
*
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsContentCellRender.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsContentCellRender.java
index a8f51641c6..b59c1ef928 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsContentCellRender.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsContentCellRender.java
@@ -1,13 +1,14 @@
package com.fr.design.mainframe.alphafine.component;
+import com.fine.theme.utils.FineUIScale;
+import com.formdev.flatlaf.ui.FlatUIUtils;
+import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.actions.help.alphafine.AlphaFineConstants;
-import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineUtil;
import com.fr.design.mainframe.alphafine.model.ProductNews;
import com.fr.design.utils.DesignUtils;
-import javax.swing.BorderFactory;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ListCellRenderer;
@@ -32,17 +33,17 @@ public class ProductNewsContentCellRender implements ListCellRenderer