Browse Source

Merge remote-tracking branch 'origin/fbp/master' into fbp/master

fbp/master^2
Anner 3 days ago
parent
commit
7b54330f10
  1. 3
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  2. 45
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java
  3. 7
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  4. 3
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  5. 16
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  6. 30
      designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataPane.java
  7. 8
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java
  8. 5
      designer-base/src/main/java/com/fr/design/foldablepane/UIExpandablePane.java
  9. 24
      designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java
  10. 12
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  11. 4
      designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java
  12. 4
      designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb.svg
  13. 4
      designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb_click.svg
  14. 4
      designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb_hover.svg
  15. 3
      designer-base/src/main/resources/com/fine/theme/icon/alphafine/minimize.svg
  16. 3
      designer-base/src/main/resources/com/fine/theme/icon/alphafine/minimize_disable.svg
  17. 20
      designer-base/src/main/resources/com/fine/theme/icon/alphafine/no_result.svg
  18. 28
      designer-base/src/main/resources/com/fine/theme/icon/alphafine/search_hint.svg
  19. 8
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  20. 14
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  21. 36
      designer-chart/src/main/java/com/fanruan/map/DesignGEOJSONHelper.java
  22. 3
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java
  23. 10
      designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java
  24. 2
      designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java
  25. 28
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  26. 190
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
  27. 21
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsContentCellRender.java
  28. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsSearchResultPane.java
  29. 51
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java
  30. 7
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchListModel.java
  31. 10
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultContentCellRender.java
  32. 15
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultPane.java
  33. 13
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/TemplateResourcePageGridPane.java
  34. 3
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/TemplateResourcePanel.java
  35. 39
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultProductNewsPane.java
  36. 23
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java
  37. 33
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java
  38. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java

3
designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java

@ -30,6 +30,9 @@ public interface FineUIStyle {
String LABEL_BOLD = "boldLabel"; String LABEL_BOLD = "boldLabel";
String LABEL_TIP_WINDOW_TITLE = "tipWindowTitleLabel"; String LABEL_TIP_WINDOW_TITLE = "tipWindowTitleLabel";
String LABEL_SECONDARY = "secondaryLabel"; String LABEL_SECONDARY = "secondaryLabel";
String LABEL_HIGHLIGHT = "highLightLabel";
String LABEL_PRIMARY = "primaryLabel";
String LABEL_DISABLED = "disabledLabel";
String LABEL_TIP = "tipLabel"; String LABEL_TIP = "tipLabel";
String LABEL_WARNING_TIP = "warningTipLabel"; String LABEL_WARNING_TIP = "warningTipLabel";
String LABEL_UILIST = "uiListLabel"; String LABEL_UILIST = "uiListLabel";

45
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java

@ -1,10 +1,10 @@
package com.fr.design.actions.help.alphafine; 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.extension.FileExtension;
import com.fr.base.svg.IconUtils;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.general.IOUtils;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.Color; import java.awt.Color;
@ -40,23 +40,20 @@ public class AlphaFineConstants {
public static final int LATEST_SHOW_SIZE = 3; 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; 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 long DOCUMENT_SEARCH_GAP = 1000;
public static final Dimension FULL_SIZE = new Dimension(680, 460); public static final Dimension FULL_SIZE = FineUIScale.createScaleDimension(680, 490);
public static final Dimension CONTENT_SIZE = new Dimension(680, 405);
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 PREVIEW_SIZE = FineUIScale.createScaleDimension(640, 300);
public static final Dimension CLOSE_BUTTON_SIZE = new Dimension(40, 40);
public static final Color WHITE = new Color(0xf9f9f9); 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 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); 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 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"); public static final String HOT_SEARCH = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Hot_Search");

7
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -50,6 +50,7 @@ import javax.swing.JFrame;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.lang.reflect.UndeclaredThrowableException;
import java.text.Collator; import java.text.Collator;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -596,7 +597,11 @@ public abstract class DesignTableDataManager {
} }
} catch (Exception e) { } catch (Exception e) {
throw new TableDataException(e.getMessage(), e); String msg = e.getMessage();
if (e instanceof UndeclaredThrowableException) {
msg = ((UndeclaredThrowableException) e).getUndeclaredThrowable().getMessage();
}
throw new TableDataException(msg, e);
} finally { } finally {
ScheduledExecutorService scheduledExecutorService = ComponentUtils ScheduledExecutorService scheduledExecutorService = ComponentUtils
.getExecutor() .getExecutor()

3
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -336,9 +336,10 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
for (ServerDataSetBean bean : deleteDatas) { for (ServerDataSetBean bean : deleteDatas) {
TableDataRepository.getInstance().delete(bean); TableDataRepository.getInstance().delete(bean);
} }
TableDataRepository.getInstance().invalidCache();
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} finally {
TableDataRepository.getInstance().invalidCache();
} }
} }

16
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -231,7 +231,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
List<String> removedConnNames = new ArrayList<>(); List<String> removedConnNames = new ArrayList<>();
List<ConnectionInfoBean> addConnections = new ArrayList<>(); List<ConnectionInfoBean> addConnections = new ArrayList<>();
List<ConnectionInfoBean> updateConnection = new ArrayList<>(); List<ConnectionInfoBean> updateConnection = new ArrayList<>();
List<Connection> validConnection = new ArrayList<>(); Map<String, Connection> validConnection = new HashMap<>();
MapCompareUtils.contrastMapEntries(populatedConnectionsSnapshot, updatedMap, (entryEventKind, s, connection) -> { MapCompareUtils.contrastMapEntries(populatedConnectionsSnapshot, updatedMap, (entryEventKind, s, connection) -> {
try { try {
switch (entryEventKind) { switch (entryEventKind) {
@ -242,7 +242,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
ConnectionInfoBean add = ConnectionInfoBeanHelper.createConnectionInfoBean(s, connection, true); ConnectionInfoBean add = ConnectionInfoBeanHelper.createConnectionInfoBean(s, connection, true);
if (StringUtils.isNotEmpty(add.getConnectionData())) { if (StringUtils.isNotEmpty(add.getConnectionData())) {
addConnections.add(add); addConnections.add(add);
validConnection.add(connection); validConnection.put(s, connection);
} else { } else {
FineLoggerFactory.getLogger().error("Unable to find the corresponding processor : {}", connection.getClass()); FineLoggerFactory.getLogger().error("Unable to find the corresponding processor : {}", connection.getClass());
} }
@ -251,7 +251,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
ConnectionInfoBean update = ConnectionInfoBeanHelper.createConnectionInfoBean(s, connection, true); ConnectionInfoBean update = ConnectionInfoBeanHelper.createConnectionInfoBean(s, connection, true);
if (StringUtils.isNotEmpty(update.getConnectionData())) { if (StringUtils.isNotEmpty(update.getConnectionData())) {
updateConnection.add(update); updateConnection.add(update);
validConnection.add(connection); validConnection.put(s, connection);
} else { } else {
FineLoggerFactory.getLogger().error("Unable to find the corresponding processor : {}", connection.getClass()); FineLoggerFactory.getLogger().error("Unable to find the corresponding processor : {}", connection.getClass());
} }
@ -297,7 +297,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
}); });
/// 先不管 /// 先不管
//this.validateDatabaseType(validConnection); //this.validateDatabaseType(validConnection);
this.alterConnections(addConnections, removedConnNames, updateConnection); this.alterConnections(addConnections, removedConnNames, updateConnection, validConnection);
} }
/** /**
@ -344,26 +344,30 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
} }
private void alterConnections(List<ConnectionInfoBean> addConnections, List<String> removedConnNames, List<ConnectionInfoBean> updateConnection) throws Exception { private void alterConnections(List<ConnectionInfoBean> addConnections, List<String> removedConnNames, List<ConnectionInfoBean> updateConnection, Map<String, Connection> validConnection) throws Exception {
try { try {
for (ConnectionInfoBean bean : addConnections) { for (ConnectionInfoBean bean : addConnections) {
ConnectionRepository.getInstance().add(bean); ConnectionRepository.getInstance().add(bean);
populatedConnectionsSnapshot.put(bean.getConnectionName(), validConnection.get(bean.getConnectionName()));
} }
for (ConnectionInfoBean bean : updateConnection) { for (ConnectionInfoBean bean : updateConnection) {
ConnectionRepository.getInstance().update(bean); ConnectionRepository.getInstance().update(bean);
populatedConnectionsSnapshot.put(bean.getConnectionName(), validConnection.get(bean.getConnectionName()));
} }
for (String name : removedConnNames) { for (String name : removedConnNames) {
ConnectionRepository.getInstance().delete(new ConnectionInfoBean(name)); ConnectionRepository.getInstance().delete(new ConnectionInfoBean(name));
populatedConnectionsSnapshot.remove(name);
} }
// hades:远程环境时,由于时直接RPC调用远程修改,因此设计器本地配置需要失效 // hades:远程环境时,由于时直接RPC调用远程修改,因此设计器本地配置需要失效
if (!WorkContext.getCurrent().isLocal()) { if (!WorkContext.getCurrent().isLocal()) {
EventDispatcher.fire(RemoteConfigEvent.EDIT, "ConnectionConfig"); EventDispatcher.fire(RemoteConfigEvent.EDIT, "ConnectionConfig");
} }
ConnectionRepository.getInstance().invalidCache();
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
throw e; throw e;
} finally {
ConnectionRepository.getInstance().invalidCache();
} }
} }

30
designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataPane.java

@ -9,6 +9,7 @@ import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.jxbrowser.JxEngine; import com.fr.design.jxbrowser.JxEngine;
import com.fr.design.jxbrowser.JxUIPane; import com.fr.design.jxbrowser.JxUIPane;
import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.json.revise.EmbedJson; import com.fr.json.revise.EmbedJson;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.guava.collect.ImmutableMap; import com.fr.third.guava.collect.ImmutableMap;
@ -36,6 +37,7 @@ public class DCTableDataPane extends AbstractTableDataPane<DCTableData> {
private static final String DATA_CENTER_HELPER = "dcHelper"; private static final String DATA_CENTER_HELPER = "dcHelper";
private static final String DATA_CENTER_INJECT_URL = "fineServletURL"; private static final String DATA_CENTER_INJECT_URL = "fineServletURL";
private static final String DC_INDEX_HTML = "com/fr/design/data/tabledata/datacenter/web/data-choose.prod.html"; private static final String DC_INDEX_HTML = "com/fr/design/data/tabledata/datacenter/web/data-choose.prod.html";
private static final String DATACENTERS_URL = System.getProperty("devMode.datacenters.url");
private final JxUIPane<String> dataCenterJxUIPane; private final JxUIPane<String> dataCenterJxUIPane;
private final JxTableDataNamePane namePane = new JxTableDataNamePane(this); private final JxTableDataNamePane namePane = new JxTableDataNamePane(this);
// 用于复制粘贴场景 // 用于复制粘贴场景
@ -62,13 +64,22 @@ public class DCTableDataPane extends AbstractTableDataPane<DCTableData> {
} }
private static JxUIPane<String> getJxUIPane() { private static JxUIPane<String> getJxUIPane() {
if (DesignerUIModeConfig.getInstance().isUIDevMode()
return new JxUIPane.Builder<String>() && StringUtils.isNotBlank(DATACENTERS_URL)) {
.engine(JX_ENGINE) return new JxUIPane.Builder<String>()
.namespace(DATA_CENTER) .engine(JX_ENGINE)
.bindWindow(DATA_CENTER_HELPER, DCTableDataJSBridge::getBridge) .namespace(DATA_CENTER)
.withEMB(DC_INDEX_HTML, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl())) .bindWindow(DATA_CENTER_HELPER, DCTableDataJSBridge::getBridge)
.build(); .withURL(DATACENTERS_URL, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl()))
.build();
} else {
return new JxUIPane.Builder<String>()
.engine(JX_ENGINE)
.namespace(DATA_CENTER)
.bindWindow(DATA_CENTER_HELPER, DCTableDataJSBridge::getBridge)
.withEMB(DC_INDEX_HTML, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl()))
.build();
}
} }
private static String getDatacentersUrl() { private static String getDatacentersUrl() {
@ -96,7 +107,10 @@ public class DCTableDataPane extends AbstractTableDataPane<DCTableData> {
} }
private void reload() { private void reload() {
dataCenterJxUIPane.redirect(EMB_TAG + SCHEME_HEADER + DC_INDEX_HTML, dataCenterJxUIPane.redirect(
DesignerUIModeConfig.getInstance().isUIDevMode() && StringUtils.isNotBlank(DATACENTERS_URL)
? DATACENTERS_URL
: EMB_TAG + SCHEME_HEADER + DC_INDEX_HTML,
ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl())); ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl()));
} }

8
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

@ -16,9 +16,11 @@ import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor; import javax.swing.DefaultCellEditor;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener; import javax.swing.event.TableModelListener;
import javax.swing.table.AbstractTableModel; import javax.swing.table.AbstractTableModel;
@ -350,10 +352,12 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
private class CellRenderer extends DefaultTableCellRenderer { private class CellRenderer extends DefaultTableCellRenderer {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (column == 0) { if (column == 0) {
setBackground(new Color(229, 229, 229));
setHorizontalAlignment(CENTER); setHorizontalAlignment(CENTER);
} }
return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
//居中文本不需要设置 borderInsets
setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
return component;
} }
} }

5
designer-base/src/main/java/com/fr/design/foldablepane/UIExpandablePane.java

@ -59,15 +59,14 @@ public class UIExpandablePane extends JPanel {
headerPanel = new HeaderPane(title); headerPanel = new HeaderPane(title);
headerPanel.addMouseListener(new PanelAction()); headerPanel.addMouseListener(new PanelAction());
setcontentPanelontentPanelBorder(); setcontentPanelontentPanelBorder();
this.add(headerPanel, BorderLayout.NORTH);
this.add(contentPanel, BorderLayout.CENTER);
if (withUnderline) { if (withUnderline) {
this.add(column( this.add(column(
cell(headerPanel), cell(contentPanel).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))), cell(headerPanel), cell(contentPanel).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))),
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder()))) fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())))
.getComponent()); .getComponent());
} else { } else {
this.add(column(cell(headerPanel), cell(contentPanel)).getComponent()); this.add(headerPanel, BorderLayout.NORTH);
this.add(contentPanel, BorderLayout.CENTER);
} }
setOpaque(false); setOpaque(false);

24
designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java

@ -1,6 +1,9 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.border.FineBorderFactory; import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
@ -9,6 +12,7 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.UIList; import com.fr.design.gui.ilist.UIList;
import com.fr.design.gui.ilist.UINameEdList;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
@ -26,12 +30,14 @@ import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListCellRenderer; import javax.swing.ListCellRenderer;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.UIManager;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point; import java.awt.Point;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -49,7 +55,7 @@ import java.util.Comparator;
public class UISimpleListControlPane extends BasicPane { public class UISimpleListControlPane extends BasicPane {
public static final String LIST_NAME = "UISimpleControl_List"; public static final String LIST_NAME = "UISimpleControl_List";
protected UIList nameList; protected UINameEdList nameList;
protected String selectedName; protected String selectedName;
private ShortCut4JControlPane[] shorts; private ShortCut4JControlPane[] shorts;
private ToolBarDef toolbarDef; private ToolBarDef toolbarDef;
@ -108,10 +114,8 @@ public class UISimpleListControlPane extends BasicPane {
protected void initListPane(JPanel listPane) { protected void initListPane(JPanel listPane) {
nameList = createJNameList(); nameList = createJNameList();
nameList.setName(LIST_NAME); nameList.setName(LIST_NAME);
nameList.setSelectionBackground(UIConstants.ATTRIBUTE_PRESS);
listPane.add(new UIScrollPane(nameList), BorderLayout.CENTER); listPane.add(new UIScrollPane(nameList), BorderLayout.CENTER);
nameList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); nameList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
nameList.addMouseListener(listMouseListener); nameList.addMouseListener(listMouseListener);
nameList.addListSelectionListener(new ListSelectionListener() { nameList.addListSelectionListener(new ListSelectionListener() {
@ -124,8 +128,12 @@ public class UISimpleListControlPane extends BasicPane {
}); });
} }
public UIList createJNameList() { /**
UIList nameList = new UIList(new DefaultListModel()) { * 构造 list设置 render
* @return UINameEdList
*/
public UINameEdList createJNameList() {
UINameEdList nameList = new UINameEdList(new DefaultListModel()) {
@Override @Override
public int locationToIndex(Point location) { public int locationToIndex(Point location) {
int index = super.locationToIndex(location); int index = super.locationToIndex(location);
@ -411,6 +419,7 @@ public class UISimpleListControlPane extends BasicPane {
label = new UILabel(); label = new UILabel();
initialLabelForeground = label.getForeground(); initialLabelForeground = label.getForeground();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
label.setBorder(new ScaledEmptyBorder(0, 6, 0, 0));
this.add(label, BorderLayout.CENTER); this.add(label, BorderLayout.CENTER);
} }
@ -425,6 +434,7 @@ public class UISimpleListControlPane extends BasicPane {
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) { int index, boolean isSelected, boolean cellHasFocus) {
setPreferredSize(new Dimension(list.getWidth(), FineUIScale.scale(UIManager.getInt("List.cellRender.height"))));
setComponentOrientation(list.getComponentOrientation()); setComponentOrientation(list.getComponentOrientation());
Color bg = null; Color bg = null;
@ -442,9 +452,7 @@ public class UISimpleListControlPane extends BasicPane {
} }
if (isSelected) { if (isSelected) {
setBackground(bg == null ? list.getSelectionBackground() : bg); setBackground(FlatUIUtils.getUIColor("List.selectionInactiveBackground", Color.GRAY));
setForeground(fg == null ? list.getSelectionForeground() : fg);
label.setForeground(Color.WHITE);
} }
else { else {
setBackground(list.getBackground()); setBackground(list.getBackground());

12
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -3,8 +3,6 @@ package com.fr.design.gui.ilist;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fanruan.config.impl.data.ConnectionConfigProviderFactory;
import com.fr.base.BaseUtils;
import com.fr.data.core.DataCoreUtils; import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
import com.fr.data.core.db.dialect.base.key.check.DataBaseDetail; import com.fr.data.core.db.dialect.base.key.check.DataBaseDetail;
@ -19,7 +17,6 @@ import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.server.entity.connection.ConnectionBean;
import com.fr.workspace.server.repository.connection.ConnectionRepository; import com.fr.workspace.server.repository.connection.ConnectionRepository;
import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListCellRenderer;
@ -47,9 +44,10 @@ import java.util.concurrent.CancellationException;
* 表或者视图或者存储过程组成的一个下拉列表 * 表或者视图或者存储过程组成的一个下拉列表
* *
* @author zhou * @author zhou
* @since 2012-3-28下午10:07:34 * @Created on 2012-3-28下午10:07:34
* @since 11.0
*/ */
public class TableViewList extends UIList { public class TableViewList extends JList {
/** /**
* *
@ -162,7 +160,7 @@ public class TableViewList extends UIList {
* augustdatabaseName是数据库名字searchFilter是输入的过滤条件,typesFilter是视图 * augustdatabaseName是数据库名字searchFilter是输入的过滤条件,typesFilter是视图
* 存储过程中的一者或者几者 * 存储过程中的一者或者几者
* *
* @param databaseName * @param datasource
* @param searchFilter * @param searchFilter
* @param typesFilter * @param typesFilter
*/ */
@ -267,7 +265,7 @@ public class TableViewList extends UIList {
icon = new LazyIcon("store_procedure"); icon = new LazyIcon("store_procedure");
} }
this.setIcon(icon); this.setIcon(icon);
this.setToolTipText(getPreferredSize().width > list.getVisibleRect().width ? this.getText() : null);
return this; return this;
} }

4
designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java

@ -6,6 +6,7 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.design.ui.ModernUIConstants; import com.fr.design.ui.ModernUIConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.collections.combination.Pair; import com.fr.stable.collections.combination.Pair;
@ -99,7 +100,8 @@ public class JxUIPane<T> extends BasicPane {
* 按需初始化debug界面UI * 按需初始化debug界面UI
*/ */
private void initDebugIfNeeded() { private void initDebugIfNeeded() {
if (DesignerEnvManager.getEnvManager().isOpenDebug()) { if (DesignerEnvManager.getEnvManager().isOpenDebug()
|| DesignerUIModeConfig.getInstance().isUIDevMode()) {
UIToolbar toolbar = new UIToolbar(); UIToolbar toolbar = new UIToolbar();
add(toolbar, BorderLayout.NORTH); add(toolbar, BorderLayout.NORTH);
UIButton openDebugButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Open_Debug_Window")); UIButton openDebugButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Open_Debug_Window"));

4
designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.8057 27.1943C10.8057 26.5285 11.3454 25.9888 12.0112 25.9888H19.9334C20.5992 25.9888 21.139 26.5285 21.139 27.1943C21.139 27.8602 20.5992 28.3999 19.9334 28.3999H12.0112C11.3454 28.3999 10.8057 27.8602 10.8057 27.1943Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.8066 19.2888C10.8053 19.3183 10.8047 19.3481 10.8047 19.3779V21.0121C8.21305 19.3219 6.5 16.3972 6.5 13.0723C6.5 7.84096 10.7409 3.6001 15.9722 3.6001C21.2036 3.6001 25.4444 7.84096 25.4444 13.0723C25.4444 16.3971 23.7315 19.3218 21.14 21.012V22.545C21.14 23.4961 20.3689 24.2672 19.4177 24.2672H12.5289C11.5777 24.2672 10.8066 23.4961 10.8066 22.545V19.2888ZM23.0333 13.0723C23.0333 15.113 22.1676 16.9516 20.7834 18.2407C20.7834 18.2406 20.7835 18.2408 20.7834 18.2407C20.1858 18.7972 19.4918 19.2516 18.7289 19.5754V21.8561H13.2177V19.5763C12.4535 19.2523 11.7582 18.7974 11.1598 18.2399C11.1598 18.24 11.1599 18.2398 11.1598 18.2399C9.77624 16.9508 8.91111 15.1125 8.91111 13.0723C8.91111 9.17258 12.0725 6.01121 15.9722 6.01121C19.872 6.01121 23.0333 9.17258 23.0333 13.0723Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

4
designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb_click.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.14 21.012C23.7315 19.3218 25.4444 16.3971 25.4444 13.0723C25.4444 7.84096 21.2036 3.6001 15.9722 3.6001C10.7409 3.6001 6.5 7.84096 6.5 13.0723C6.5 16.398 8.21391 19.3234 10.8066 21.0134V22.545C10.8066 23.4961 11.5777 24.2672 12.5289 24.2672H19.4177C20.3689 24.2672 21.14 23.4961 21.14 22.545V21.012ZM11.0282 12.4647C11.2947 9.95547 13.4196 8 16 8V6C12.3859 6 9.4127 8.73804 9.03941 12.2535L11.0282 12.4647ZM11.6227 15.4188C11.421 15.0546 11.2635 14.6629 11.1575 14.2507L9.22059 14.7493C9.36955 15.328 9.59055 15.8777 9.87325 16.388L11.6227 15.4188Z" fill="#FEC148"/>
<path d="M10.8057 27.1943C10.8057 26.5285 11.3454 25.9888 12.0112 25.9888H19.9334C20.5993 25.9888 21.139 26.5285 21.139 27.1943C21.139 27.8601 20.5993 28.3999 19.9334 28.3999H12.0112C11.3454 28.3999 10.8057 27.8601 10.8057 27.1943Z" fill="#FEC148"/>
</svg>

After

Width:  |  Height:  |  Size: 973 B

4
designer-base/src/main/resources/com/fine/theme/icon/alphafine/bulb_hover.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.14 21.012C23.7315 19.3218 25.4444 16.3971 25.4444 13.0723C25.4444 7.84096 21.2036 3.6001 15.9722 3.6001C10.7409 3.6001 6.5 7.84096 6.5 13.0723C6.5 16.398 8.21391 19.3234 10.8066 21.0134V22.545C10.8066 23.4961 11.5777 24.2672 12.5289 24.2672H19.4177C20.3689 24.2672 21.14 23.4961 21.14 22.545V21.012ZM11.0282 12.4647C11.2947 9.95547 13.4196 8 16 8V6C12.3859 6 9.4127 8.73804 9.03941 12.2535L11.0282 12.4647ZM11.6227 15.4188C11.421 15.0546 11.2635 14.6629 11.1575 14.2507L9.22059 14.7493C9.36955 15.328 9.59055 15.8777 9.87325 16.388L11.6227 15.4188Z" fill="#F9AE31"/>
<path d="M10.8057 27.1943C10.8057 26.5285 11.3454 25.9888 12.0112 25.9888H19.9334C20.5993 25.9888 21.139 26.5285 21.139 27.1943C21.139 27.8601 20.5993 28.3999 19.9334 28.3999H12.0112C11.3454 28.3999 10.8057 27.8601 10.8057 27.1943Z" fill="#F9AE31"/>
</svg>

After

Width:  |  Height:  |  Size: 973 B

3
designer-base/src/main/resources/com/fine/theme/icon/alphafine/minimize.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.39961 17.4C4.62641 17.4 3.99961 16.7732 3.99961 16V16C3.99961 15.2268 4.62641 14.6 5.39961 14.6L26.5996 14.6C27.3728 14.6 27.9996 15.2268 27.9996 16V16C27.9996 16.7732 27.3728 17.4 26.5996 17.4L5.39961 17.4Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 400 B

3
designer-base/src/main/resources/com/fine/theme/icon/alphafine/minimize_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.39961 17.4C4.62641 17.4 3.99961 16.7732 3.99961 16V16C3.99961 15.2268 4.62641 14.6 5.39961 14.6L26.5996 14.6C27.3728 14.6 27.9996 15.2268 27.9996 16V16C27.9996 16.7732 27.3728 17.4 26.5996 17.4L5.39961 17.4Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 401 B

20
designer-base/src/main/resources/com/fine/theme/icon/alphafine/no_result.svg

@ -0,0 +1,20 @@
<svg width="110" height="110" viewBox="0 0 110 110" fill="none" xmlns="http://www.w3.org/2000/svg">
<g opacity="0.75">
<path d="M16.589 46.6279C16.589 45.5234 17.4844 44.6279 18.589 44.6279H72.2392C73.3437 44.6279 74.2392 45.5234 74.2392 46.6279V99.1374H20.589C18.3799 99.1374 16.589 97.3465 16.589 95.1374V46.6279Z" fill="#CFD4DC"/>
<path d="M73.429 46.6279C73.429 45.5234 74.3244 44.6279 75.429 44.6279H93.125C94.2296 44.6279 95.125 45.5234 95.125 46.6279V95.1374C95.125 97.3465 93.3341 99.1374 91.125 99.1374H73.429V46.6279Z" fill="url(#paint0_linear_11857_159075)"/>
<path d="M6.87805 34.2639C5.81283 32.9574 6.74244 31 8.4281 31H62.5379C63.8239 31 65.0316 31.6184 65.7833 32.6618L75.222 45.763H17.2037C16.6027 45.763 16.0335 45.4927 15.6537 45.0268L6.87805 34.2639Z" fill="#E6E9EF"/>
<path d="M75.3136 45.1376L65.4428 31.5H97.1673C98.1963 31.5 98.9198 32.5125 98.5864 33.486L94.9433 44.1236C94.7356 44.7302 94.1654 45.1376 93.5242 45.1376H75.3136Z" fill="#CFD4DC" stroke="#CFD4DC"/>
<path d="M104.514 59.1721C105.345 60.5043 104.387 62.2305 102.817 62.2305L85.9881 62.2305C85.3122 62.2305 84.6819 61.889 84.3128 61.3227L73.429 44.6285L94.334 44.6285C95.0243 44.6285 95.6657 44.9844 96.031 45.5701L104.514 59.1721Z" fill="#E6E9EF"/>
<path d="M25.1956 87.7715C25.1956 87.1496 25.6998 86.6455 26.3216 86.6455H43.4347C44.0566 86.6455 44.5607 87.1496 44.5607 87.7715C44.5607 88.3933 44.0566 88.8975 43.4347 88.8975H26.3216C25.6998 88.8975 25.1956 88.3933 25.1956 87.7715Z" fill="#8A95A6"/>
<path d="M25.1956 76.415C25.1956 75.7932 25.6998 75.2891 26.3216 75.2891H56.3448C56.9666 75.2891 57.4707 75.7932 57.4707 76.415C57.4707 77.0369 56.9666 77.541 56.3447 77.541H26.3216C25.6998 77.541 25.1956 77.0369 25.1956 76.415Z" fill="#8A95A6"/>
<path d="M72.0593 13.0465C71.5392 12.8606 70.9132 13.1083 70.661 13.5996L67.3221 20.1044C67.0699 20.5958 67.2871 21.1448 67.8072 21.3306C68.3272 21.5165 68.9533 21.2689 69.2055 20.7776L72.5443 14.2728C72.7965 13.7814 72.5793 13.2324 72.0593 13.0465Z" fill="#5D697C"/>
<path d="M53.582 11.2031C53.0511 11.3552 52.8367 11.8707 53.1031 12.3545L58.1773 21.5702C58.4437 22.054 59.09 22.3229 59.6209 22.1708C60.1518 22.0186 60.3663 21.5031 60.0999 21.0193L55.0257 11.8036C54.7593 11.3199 54.113 11.051 53.582 11.2031Z" fill="#5D697C"/>
<path d="M84.9809 18.496C84.5947 18.1012 83.8924 18.0025 83.4122 18.2755L73.1291 24.1223C72.649 24.3953 72.5729 24.9366 72.9592 25.3314C73.3454 25.7261 74.0478 25.8248 74.5279 25.5518L84.811 19.705C85.2911 19.432 85.3672 18.8907 84.9809 18.496Z" fill="#5D697C"/>
</g>
<defs>
<linearGradient id="paint0_linear_11857_159075" x1="84.277" y1="44.6279" x2="84.277" y2="99.1374" gradientUnits="userSpaceOnUse">
<stop stop-color="#8A95A6"/>
<stop offset="1" stop-color="#B8BDC5"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

28
designer-base/src/main/resources/com/fine/theme/icon/alphafine/search_hint.svg

@ -0,0 +1,28 @@
<svg width="110" height="110" viewBox="0 0 110 110" fill="none" xmlns="http://www.w3.org/2000/svg">
<g opacity="0.75" clip-path="url(#clip0_11857_128092)">
<rect x="8.41439" y="24.8418" width="56.5622" height="67.2295" rx="4" transform="rotate(-15 8.41439 24.8418)" fill="url(#paint0_linear_11857_128092)"/>
<path d="M23.527 42.1796C23.3957 41.6894 23.6866 41.1855 24.1768 41.0542L48.0736 34.651C48.5638 34.5197 49.0677 34.8106 49.199 35.3008C49.3304 35.791 49.0394 36.2949 48.5492 36.4263L24.6525 42.8294C24.1623 42.9607 23.6584 42.6698 23.527 42.1796Z" fill="#8A95A6"/>
<path d="M21.6243 35.079C21.493 34.5888 21.7839 34.0849 22.2741 33.9536L48.0147 27.0564C48.5049 26.925 49.0088 27.216 49.1402 27.7062C49.2715 28.1964 48.9806 28.7003 48.4904 28.8316L22.7498 35.7288C22.2596 35.8601 21.7557 35.5692 21.6243 35.079Z" fill="#8A95A6"/>
<path d="M26.0325 48.9442C25.9011 48.454 26.1921 47.9502 26.6823 47.8188L52.4229 40.9216C52.9131 40.7903 53.417 41.0812 53.5483 41.5714C53.6797 42.0616 53.3888 42.5655 52.8986 42.6968L27.1579 49.594C26.6677 49.7254 26.1638 49.4345 26.0325 48.9442Z" fill="#8A95A6"/>
<path d="M27.9352 56.0448C27.8038 55.5546 28.0947 55.0507 28.5849 54.9194L54.3256 48.0222C54.8158 47.8909 55.3196 48.1818 55.451 48.672C55.5823 49.1622 55.2914 49.6661 54.8012 49.7974L29.0606 56.6946C28.5704 56.826 28.0665 56.535 27.9352 56.0448Z" fill="#8A95A6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M91.8499 27.1967L50.4554 19.8977C48.2799 19.5141 46.2052 20.9668 45.8216 23.1424L34.7082 86.1694C34.3246 88.345 35.7773 90.4196 37.9529 90.8033L88.0749 99.6411C90.2505 100.025 92.3252 98.5721 92.7088 96.3965L102.19 42.6248L91.8499 27.1967Z" fill="#DADEE7"/>
<path d="M102.201 42.5596L93.5353 41.0315C91.3597 40.6479 89.907 38.5732 90.2906 36.3977L91.9113 27.2062L102.201 42.5596Z" fill="#8A95A6"/>
<rect x="51.6104" y="33.5654" width="33.2983" height="2" rx="1" transform="rotate(10 51.6104 33.5654)" fill="#B8BFCB"/>
<rect x="50.1899" y="41.6211" width="45.2857" height="2" rx="1" transform="rotate(10 50.1899 41.6211)" fill="#B8BFCB"/>
<rect x="48.7693" y="49.6758" width="45.2857" height="2" rx="1" transform="rotate(10 48.7693 49.6758)" fill="#B8BFCB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M87.3897 85.3897C92.482 80.2974 92.482 72.0411 87.3897 66.9488C82.2974 61.8564 74.0411 61.8565 68.9488 66.9488C63.8565 72.0411 63.8565 80.2974 68.9488 85.3897C74.0411 90.482 82.2974 90.482 87.3897 85.3897ZM89.6026 64.7359C95.3236 70.4568 95.8613 79.3983 91.2158 85.7246L97.0196 91.5284C97.7908 92.2996 97.7908 93.5499 97.0196 94.3211C96.2484 95.0922 94.9981 95.0922 94.227 94.3211L88.5083 88.6024C82.1558 93.8974 72.6974 93.5641 66.7359 87.6026C60.4214 81.2881 60.4214 71.0503 66.7359 64.7359C73.0503 58.4214 83.2881 58.4214 89.6026 64.7359ZM84.172 72.9285C84.172 69.8569 81.4776 67.3626 78.2323 67.3626C75.0958 67.3626 72.645 69.6663 72.3275 72.3618C72.2891 72.6876 72.5586 72.9546 72.8866 72.9546H74.7355C75.0635 72.9546 75.3222 72.6853 75.3937 72.3652C75.6485 71.2253 76.6508 70.3325 78.2323 70.3325C79.9592 70.3325 81.1352 71.4708 81.1352 72.9285C81.1352 73.6574 80.7481 74.2822 80.2122 74.9069L77.8899 77.6402C77.1754 78.4732 76.8777 79.15 76.8777 80.2173V80.4299C76.8777 80.758 77.1436 81.0239 77.4716 81.0239H79.6183C79.9463 81.0239 80.2122 80.758 80.2122 80.4299V80.3475C80.2122 79.931 80.4206 79.3322 80.7481 78.9418L83.0407 76.1304C83.8445 75.1672 84.172 74.178 84.172 72.9285ZM80.2521 85.1826C80.2521 86.1667 79.4543 86.9645 78.4701 86.9645C77.486 86.9645 76.6882 86.1667 76.6882 85.1826C76.6882 84.1985 77.486 83.4007 78.4701 83.4007C79.4543 83.4007 80.2521 84.1985 80.2521 85.1826Z" fill="url(#paint1_linear_11857_128092)"/>
</g>
<defs>
<linearGradient id="paint0_linear_11857_128092" x1="25.6508" y1="55.506" x2="51.8986" y2="218.348" gradientUnits="userSpaceOnUse">
<stop stop-color="#B8BFCB"/>
<stop offset="1" stop-color="#8A95A6"/>
</linearGradient>
<linearGradient id="paint1_linear_11857_128092" x1="50.0919" y1="82.603" x2="96.1368" y2="80.8275" gradientUnits="userSpaceOnUse">
<stop stop-color="#223553"/>
<stop offset="1" stop-color="#8A95A6"/>
</linearGradient>
<clipPath id="clip0_11857_128092">
<rect width="110" height="110" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

8
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_vertical_center": "arrange/arrange_vertical_center.svg",
"arrange_bottom_align": "arrange/arrange_bottom_align.svg", "arrange_bottom_align": "arrange/arrange_bottom_align.svg",
"arrange_horizontal_distribute": "arrange/arrange_horizontal_distribute.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"
} }
} }

14
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -414,7 +414,10 @@ Label.borderColor = $defaultBorderColor
Label.hyperLinkColor = #2576EF Label.hyperLinkColor = #2576EF
Label.strongHintColor = #FF0000 Label.strongHintColor = #FF0000
Label.warningColor = #F1393C 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 ----
Calendar.background = $fill.normal Calendar.background = $fill.normal
@ -1379,9 +1382,18 @@ chart.selectedBorderColor = #2576EF
[style]Label.warningTipLabel = \ [style]Label.warningTipLabel = \
foreground: $Label.warningColor foreground: $Label.warningColor
[style]Label.disabledLabel = \
foreground: $Label.disabledColor
[style]Label.secondaryLabel = \ [style]Label.secondaryLabel = \
foreground: $Label.secondaryColor foreground: $Label.secondaryColor
[style]Label.primaryLabel = \
foreground: $Label.primaryColor
[style]Label.highLightLabel = \
foreground: $Label.highLightColor
[style]Label.uiListLabel = \ [style]Label.uiListLabel = \
foreground: $List.wrapper.text.fontColor; \ foreground: $List.wrapper.text.fontColor; \
background: $background.normal background: $background.normal

36
designer-chart/src/main/java/com/fanruan/map/DesignGEOJSONHelper.java

@ -0,0 +1,36 @@
package com.fanruan.map;
import com.fr.decision.webservice.v10.map.geojson.MapDataType;
import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper;
import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.third.org.apache.commons.lang3.time.StopWatch;
import com.fr.workspace.server.repository.map.MapRepository;
/**
* 设计器地图资源Helper
*
* @author Destiny.Lin
* @since 11.0
* Created on 2024/9/27
*/
public class DesignGEOJSONHelper extends GEOJSONHelper {
@Override
protected void init() {
try {
StopWatch watch = new StopWatch();
watch.start();
URL_JSON_MAP.putAll(MapRepository.getInstance().getMapResource(GEOJSONUtils.getMapDataTypePath(MapDataType.GEOGRAPHIC)));
URL_JSON_MAP.putAll(MapRepository.getInstance().getMapResource(GEOJSONUtils.getMapDataTypePath(MapDataType.IMAGE)));
FineLoggerFactory.getLogger().info("Load chart map resources spend time {} ms", watch.getTime());
watch.stop();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}

3
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java

@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer.mobile; package com.fr.design.widget.ui.designer.mobile;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -77,7 +78,7 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData()); mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData());
JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane();
panelWrapper.add(mobileWidgetListPane, BorderLayout.CENTER); panelWrapper.add(mobileWidgetListPane, BorderLayout.CENTER);
panelWrapper.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Order"), 280, 20, panelWrapper); return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Order"), 280, 20, panelWrapper);
} }

10
designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java

@ -37,7 +37,7 @@ import static com.fr.decision.authority.base.constant.ReportAuthorityItems.ENTER
* *
* @author Anner * @author Anner
* @since 11.0 * @since 11.0
* Created on 2024/10/15 * Created on 2024/10/15
*/ */
public class DesignServerSupportModule { public class DesignServerSupportModule {
private final static Set<String> SUPPORT_MODULE = Sets.newHashSet( private final static Set<String> SUPPORT_MODULE = Sets.newHashSet(
@ -70,8 +70,7 @@ public class DesignServerSupportModule {
// 安全管理 // 安全管理
SECURITY_ID, SECURITY_ID,
// 地图管理 // 地图管理
MAP_ID MAP_ID);
);
/** /**
* 注册一下支持展示的模块 * 注册一下支持展示的模块
@ -99,10 +98,11 @@ public class DesignServerSupportModule {
@Override @Override
public void onStart() { public void onStart() {
PortalModuleManager.allModules().values().stream() PortalModuleManager.allModules().values().stream()
.filter(m -> !StringUtils.equals(m.getParentID(), PortalAuthorityItems.PORTAL_ROOT_ID)).map(PortalModule::getId) .filter(m -> !StringUtils.equals(m.getParentID(), PortalAuthorityItems.PORTAL_ROOT_ID))
.map(PortalModule::getId)
.filter(m -> !SUPPORT_MODULE.contains(m)) .filter(m -> !SUPPORT_MODULE.contains(m))
.forEach(PortalModuleManager::unregister); .forEach(PortalModuleManager::unregister);
} }
}); });
} }
} }

2
designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java

@ -63,6 +63,7 @@ import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import com.fr.workspace.server.repository.compatible.register.CompatibleRegister; import com.fr.workspace.server.repository.compatible.register.CompatibleRegister;
import com.fanruan.repository.ConfigRepository; import com.fanruan.repository.ConfigRepository;
import com.fr.workspace.server.repository.connection.ConnectionRepository; import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.map.MapRepository;
import com.fr.workspace.server.repository.plugin.PluginRepository; import com.fr.workspace.server.repository.plugin.PluginRepository;
import com.fr.workspace.server.repository.resource.PublicResourceRepository; import com.fr.workspace.server.repository.resource.PublicResourceRepository;
import com.fr.workspace.server.repository.resource.WorkResourceRepository; import com.fr.workspace.server.repository.resource.WorkResourceRepository;
@ -114,6 +115,7 @@ public class DesignWorkContextComponent {
RepositoryManager.getInstance().pureRegisterRepo4Start(PublicResourceRepository.getInstance()); RepositoryManager.getInstance().pureRegisterRepo4Start(PublicResourceRepository.getInstance());
RepositoryManager.getInstance().pureRegisterRepo4Start(ConfigRepository.getInstance()); RepositoryManager.getInstance().pureRegisterRepo4Start(ConfigRepository.getInstance());
RepositoryManager.getInstance().pureRegisterRepo4Start(PluginRepository.getInstance()); RepositoryManager.getInstance().pureRegisterRepo4Start(PluginRepository.getInstance());
RepositoryManager.getInstance().pureRegisterRepo4Start(MapRepository.getInstance());
RepositoryManager.getInstance().initLocalRepository(); RepositoryManager.getInstance().initLocalRepository();
CompatibleRegister.registerCompatibleEnv(); CompatibleRegister.registerCompatibleEnv();
for (WorkRPCRegister<?> workRPCRegister : ServiceContext.group(WorkspaceKey.class).getAll()) { for (WorkRPCRegister<?> workRPCRegister : ServiceContext.group(WorkspaceKey.class).getAll()) {

28
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -1,6 +1,9 @@
package com.fr.design.mainframe.alphafine.component; package com.fr.design.mainframe.alphafine.component;
import com.bulenkov.iconloader.IconLoader; 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.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants; import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
@ -204,8 +207,7 @@ public class AlphaFineDialog extends UIDialog {
super.paintComponent(g); super.paintComponent(g);
} }
}; };
closeButton.setPreferredSize(AlphaFineConstants.CLOSE_BUTTON_SIZE); closeButton.setIcon(new LazyIcon("close", 40));
closeButton.setIcon(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + "alphafine_close.png"));
closeButton.set4ToolbarButton(); closeButton.set4ToolbarButton();
closeButton.setBorderPainted(false); closeButton.setBorderPainted(false);
closeButton.setRolloverEnabled(false); closeButton.setRolloverEnabled(false);
@ -229,12 +231,12 @@ public class AlphaFineDialog extends UIDialog {
private void initHotPane() { private void initHotPane() {
removeHotPane(); removeHotPane();
hotPane = new JPanel(); 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.setPreferredSize(AlphaFineConstants.CONTENT_SIZE);
hotPane.setLayout(new BorderLayout()); hotPane.setLayout(new BorderLayout());
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Hot")); 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.setFont(AlphaFineConstants.SMALL_FONT);
uiLabel.setForeground(AlphaFineConstants.DARK_GRAY); uiLabel.setForeground(AlphaFineConstants.DARK_GRAY);
@ -283,7 +285,6 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void initProperties() { private void initProperties() {
setUndecorated(true); setUndecorated(true);
//addComponentListener(new ComponentHandler());
setSize(AlphaFineConstants.FIELD_SIZE); setSize(AlphaFineConstants.FIELD_SIZE);
centerWindow(this); centerWindow(this);
@ -1238,12 +1239,6 @@ public class AlphaFineDialog extends UIDialog {
@Override @Override
protected void fireContentsChanged(Object source, int index0, int index1) { 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); super.fireContentsChanged(source, index0, index1);
} }
@ -1367,8 +1362,8 @@ public class AlphaFineDialog extends UIDialog {
backPane = new JPanel(new BorderLayout()); backPane = new JPanel(new BorderLayout());
JLabel jLabel = new JLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Back")); 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.setIcon(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + AlphaFineConstants.BACK_ICON_NAME));
jLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); jLabel.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
jLabel.setPreferredSize(new Dimension(80, 20)); jLabel.setPreferredSize(FineUIScale.createScaleDimension(80, 20));
jLabel.setFont(AlphaFineConstants.SMALL_FONT); jLabel.setFont(AlphaFineConstants.SMALL_FONT);
jLabel.setForeground(AlphaFineConstants.DARK_GRAY); jLabel.setForeground(AlphaFineConstants.DARK_GRAY);
jLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); jLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
@ -1401,14 +1396,15 @@ public class AlphaFineDialog extends UIDialog {
public HotIssueJpanel(String[] str, int pngIndex) { public HotIssueJpanel(String[] str, int pngIndex) {
this.setLayout(new BorderLayout()); 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); this.setSize(AlphaFineConstants.HOT_ISSUES_JAPNEL_SIZE);
JPanel pane1 = new JPanel(new BorderLayout()); JPanel pane1 = new JPanel(new BorderLayout());
// 图标待替换
UILabel iconLabel = new UILabel(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + AlphaFineConstants.ALPHA_HOT_IMAGE_NAME + pngIndex + ".png")); UILabel iconLabel = new UILabel(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + AlphaFineConstants.ALPHA_HOT_IMAGE_NAME + pngIndex + ".png"));
iconLabel.setOpaque(true); iconLabel.setOpaque(true);
iconLabel.setBackground(Color.WHITE); 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); pane1.add(iconLabel, BorderLayout.NORTH);
add(pane1, BorderLayout.NORTH); add(pane1, BorderLayout.NORTH);
@ -1454,7 +1450,7 @@ public class AlphaFineDialog extends UIDialog {
bottomPanel.add(subTitle); bottomPanel.add(subTitle);
} }
bottomPanel.setLayout(gridLayout); bottomPanel.setLayout(gridLayout);
bottomPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 22, 0)); bottomPanel.setBorder(new ScaledEmptyBorder(0, 20, 20, 0));
add(bottomPanel, BorderLayout.SOUTH); add(bottomPanel, BorderLayout.SOUTH);
} }
} }

190
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java

@ -1,13 +1,18 @@
package com.fr.design.mainframe.alphafine.component; 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.IconUtils;
import com.fr.base.svg.SVGLoader; import com.fr.base.svg.SVGLoader;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.actions.help.alphafine.AlphaFineShortCutUtil; 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.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; 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.ProductNewsSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager; import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.TemplateResourceSearchManager; 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.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JPopupMenu; import javax.swing.JPopupMenu;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.Timer; import javax.swing.Timer;
import javax.swing.border.LineBorder;
import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener; import javax.swing.event.PopupMenuListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -61,7 +65,6 @@ import java.awt.Font;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.Insets;
import java.awt.RenderingHints; import java.awt.RenderingHints;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.Window; import java.awt.Window;
@ -81,6 +84,13 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; 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 * @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 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(); private final CardLayout cardLayout = new CardLayout();
@ -259,45 +269,46 @@ public class AlphaFineFrame extends JFrame {
* 初始化全部组件 * 初始化全部组件
*/ */
private void initComponents() { private void initComponents() {
add(createTopPane(), BorderLayout.NORTH); add(column(10,
initSearchTextField(); cell(createTopPane()),
add(createSearchPane(), BorderLayout.CENTER); cell(createSearchPane()),
add(createShowPane(), BorderLayout.SOUTH); cell(createShowPane())
).getComponent());
this.getContentPane().setBackground(Color.WHITE); this.getContentPane().setBackground(Color.WHITE);
this.setIconImage(SEARCH_IMAGE); // 应用图标 this.setIconImage(SEARCH_IMAGE); // 应用图标
} }
private JPanel createTopPane() { private JPanel createTopPane() {
JPanel topPane = new JPanel(new BorderLayout()); JPanel topPane = new JPanel(new BorderLayout());
topPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); topPane.setBorder(new ScaledEmptyBorder(10, 20, 0, 20));
topPane.setBackground(Color.WHITE); UILabel topLeftPane = new UILabel(AlphaFineConstants.TITLE);
JPanel topLeftPane = new JPanel(new FlowLayout(FlowLayout.LEFT)); topLeftPane.setFont(new Font("Arial Black", Font.PLAIN, FineUIScale.scale(20)));
topLeftPane.setBackground(Color.WHITE); topLeftPane.setForeground(FLESH_BLUE);
UILabel alphaFineLabel = new UILabel(AlphaFineConstants.TITLE); topLeftPane.setOpaque(false);
alphaFineLabel.setFont(new Font("Arial Black", Font.PLAIN, 20));
alphaFineLabel.setForeground(UIConstants.FLESH_BLUE);
topLeftPane.add(alphaFineLabel);
topPane.add(topLeftPane, BorderLayout.WEST); 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 = new UILabel(AlphaFineConstants.BULB_ICON);
tipIconLabel.addMouseListener(tipMouseListener); tipIconLabel.addMouseListener(tipMouseListener);
useTipLabel = new UILabel(SKILLS); useTipLabel = new UILabel(SKILLS, FineUIStyle.LABEL_HIGHLIGHT);
useTipLabel.addMouseListener(tipMouseListener); useTipLabel.addMouseListener(tipMouseListener);
useTipLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6); UIButton minimizeButton = new UIButton(new LazyIcon("minimize"));
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"));
minimizeButton.addActionListener(e -> AlphaFineFrame.this.setExtendedState(JFrame.ICONIFIED)); minimizeButton.addActionListener(e -> AlphaFineFrame.this.setExtendedState(JFrame.ICONIFIED));
topRightPane.add(minimizeButton); FineUIStyle.setStyle(minimizeButton, FineUIStyle.ORIGINAL_BUTTON);
UIButton closeButton = createButton(IconUtils.readIcon("/com/fr/design/mainframe/alphafine/images/close.svg")); minimizeButton.setBackground(Color.WHITE);
UIButton closeButton = new UIButton(new LazyIcon("close"));
closeButton.addActionListener(e -> AlphaFineFrame.this.dispose()); closeButton.addActionListener(e -> AlphaFineFrame.this.dispose());
topRightPane.add(closeButton); FineUIStyle.setStyle(closeButton, FineUIStyle.ORIGINAL_BUTTON);
topPane.add(topRightPane, BorderLayout.EAST); 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; return topPane;
} }
@ -313,30 +324,29 @@ public class AlphaFineFrame extends JFrame {
@Override @Override
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
if (popupMenu == null || !popupMenu.isShowing()) { if (popupMenu == null || !popupMenu.isShowing()) {
useTipLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6); useTipLabel.setForeground(FineUIUtils.getUIColor("Label.highLightColor", "Label.highLightColor"));
tipIconLabel.setIcon(AlphaFineConstants.BULB_ICON); tipIconLabel.setIcon(AlphaFineConstants.BULB_ICON);
} }
} }
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
useTipLabel.setForeground(UIConstants.FLESH_BLUE); useTipLabel.setForeground(FLESH_BLUE);
tipIconLabel.setIcon(AlphaFineConstants.LIGHT_YELLOW_BULB_ICON); tipIconLabel.setIcon(AlphaFineConstants.LIGHT_YELLOW_BULB_ICON);
popupMenu = createTipPop(); 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() { private JPopupMenu createTipPop() {
JPanel panel = new JPanel(new BorderLayout()); 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())); 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); UILabel label = new UILabel(toolTip, FineUIStyle.LABEL_HIGHLIGHT);
label.setForeground(AlphaFineConstants.FOREGROUND_COLOR_8);
label.setBackground(Color.WHITE); label.setBackground(Color.WHITE);
panel.add(label); panel.add(label);
panel.setBackground(Color.WHITE); panel.setBackground(Color.WHITE);
JPopupMenu popupMenu = new JPopupMenu(); JPopupMenu popupMenu = new JPopupMenu();
popupMenu.setBorder(BorderFactory.createEmptyBorder(20, 5, 10, 5)); popupMenu.setBorder(new ScaledEmptyBorder(20, 5, 10, 5));
popupMenu.add(panel); popupMenu.add(panel);
popupMenu.setBackground(Color.WHITE); popupMenu.setBackground(Color.WHITE);
popupMenu.addPopupMenuListener(new PopupMenuListener() { popupMenu.addPopupMenuListener(new PopupMenuListener() {
@ -347,7 +357,7 @@ public class AlphaFineFrame extends JFrame {
@Override @Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
useTipLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6); useTipLabel.setForeground(FineUIUtils.getUIColor("Label.highLightColor", "Label.highLightColor"));
tipIconLabel.setIcon(AlphaFineConstants.BULB_ICON); tipIconLabel.setIcon(AlphaFineConstants.BULB_ICON);
} }
@ -361,15 +371,14 @@ public class AlphaFineFrame extends JFrame {
private JPanel createSearchPane() { private JPanel createSearchPane() {
JPanel searchPane = new JPanel(new BorderLayout()); JPanel searchPane = new JPanel(new BorderLayout());
searchPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); searchPane.setPreferredSize(FineUIScale.createScaleDimension(632, 32));
searchTextFieldWrapperPane = new JPanel(new BorderLayout()) { searchPane.setBorder(new ScaledEmptyBorder(0, 20, 0, 20));
@Override
protected void paintBorder(Graphics g) { searchTextField = new AlphaFineTextField(PLACE_HOLDER);
g.setColor(BORDER_COLOR); initTextFieldListener();
g.drawRoundRect(0, 0, getWidth() - 1, getHeight() - 1, 5, 5); searchTextField.setBackground(Color.WHITE);
}
}; searchTextFieldWrapperPane = new JPanel(new BorderLayout());
searchTextFieldWrapperPane.setBorder(new UITextFieldBorder(new Insets(2, 3, 2, 3)));
searchTextFieldWrapperPane.setBackground(Color.WHITE); searchTextFieldWrapperPane.setBackground(Color.WHITE);
searchTextFieldWrapperPane.add(searchTextField, BorderLayout.CENTER); searchTextFieldWrapperPane.add(searchTextField, BorderLayout.CENTER);
clearLabel = new UILabel(IconUtils.readIcon("/com/fr/design/mainframe/alphafine/images/clear.svg")); 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.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); 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) { JButton searchButton = new JButton(SEARCH) {
@Override @Override
public void paintComponent(Graphics g) { public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(UIConstants.FLESH_BLUE); g2d.setColor(FLESH_BLUE);
g2d.fillRoundRect(0, 0, getWidth(), getHeight(), 4, 4); g2d.fillRoundRect(0, 0, getWidth(), getHeight(), FineUIScale.scale(4), FineUIScale.scale(4));
super.paintComponent(g2d); super.paintComponent(g2d);
} }
}; };
@ -400,13 +420,10 @@ public class AlphaFineFrame extends JFrame {
fireSearch(); fireSearch();
} }
}); });
searchButton.setPreferredSize(new Dimension(70, 60));
searchButton.setForeground(Color.WHITE); searchButton.setForeground(Color.WHITE);
searchButton.setBorderPainted(false); searchButton.setBorderPainted(false);
searchButton.setContentAreaFilled(false); searchButton.setContentAreaFilled(false);
searchPane.add(searchButton, BorderLayout.EAST); return searchButton;
searchPane.setBackground(Color.WHITE);
return searchPane;
} }
/** /**
@ -414,7 +431,6 @@ public class AlphaFineFrame extends JFrame {
*/ */
private JPanel createShowPane() { private JPanel createShowPane() {
JPanel showPane = new JPanel(new BorderLayout()); JPanel showPane = new JPanel(new BorderLayout());
// 内容区,card layout // 内容区,card layout
resultPane.add(new DefaultProductNewsPane(), CellType.PRODUCT_NEWS.getFlagStr4None()); resultPane.add(new DefaultProductNewsPane(), CellType.PRODUCT_NEWS.getFlagStr4None());
resultPane.add(new NoResultWithLinkPane(GO_FORUM, AlphaFineConstants.NO_RESULT_ICON), CellType.NO_RESULT.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(new HelpDocumentNoResultPane(SEARCH_TERM, AlphaFineConstants.NO_RESULT_ICON), CellType.DOCUMENT.getFlagStr4None());
resultPane.add(TemplateShopPane.getInstance(), CellType.TEMPLATE_SHOP.getFlagStr4None()); resultPane.add(TemplateShopPane.getInstance(), CellType.TEMPLATE_SHOP.getFlagStr4None());
resultPane.add(new NetWorkFailedPane(this::reSearch), AlphaFineConstants.NETWORK_ERROR); resultPane.add(new NetWorkFailedPane(this::reSearch), AlphaFineConstants.NETWORK_ERROR);
//resultPane.setBackground(Color.WHITE);
// label区,border layout // label区,border layout
labelPane = new JPanel(new BorderLayout()); labelPane = new JPanel(new BorderLayout());
labelPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
labelPane.setBackground(Color.WHITE); labelPane.setBackground(Color.WHITE);
labelContentPane = new JPanel(new BorderLayout()); labelContentPane = new JPanel(new BorderLayout());
tabLabel = createTabLabel(AlphaFineConstants.PRODUCT_NEWS); tabLabel = createTabLabel(AlphaFineConstants.PRODUCT_NEWS);
labelWestPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); labelWestPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
labelWestPane.add(tabLabel); labelWestPane.add(tabLabel);
labelWestPane.setOpaque(false);
labelContentPane.add(labelWestPane, BorderLayout.WEST); labelContentPane.add(labelWestPane, BorderLayout.WEST);
labelEastPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0)); labelEastPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
// 一键已读 // 一键已读
readLabel = new UILabel(ONE_CLICK_READ); readLabel = new UILabel(ONE_CLICK_READ);
readLabel.setHorizontalAlignment(SwingConstants.RIGHT); readLabel.setHorizontalAlignment(SwingConstants.RIGHT);
readLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); readLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
readLabel.setPreferredSize(new Dimension(100, 30)); readLabel.setPreferredSize(FineUIScale.createScaleDimension(100, 30));
readLabel.setForeground(UIConstants.FLESH_BLUE); readLabel.setForeground(FLESH_BLUE);
readLabel.addMouseListener(new MouseAdapter() { readLabel.addMouseListener(new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
@ -450,14 +467,18 @@ public class AlphaFineFrame extends JFrame {
} }
}); });
labelEastPane.add(readLabel); labelEastPane.add(readLabel);
labelEastPane.setOpaque(false);
labelContentPane.add(labelEastPane, BorderLayout.EAST); labelContentPane.add(labelEastPane, BorderLayout.EAST);
labelContentPane.setBackground(new Color(245, 245, 247)); labelContentPane.setBackground(FineUIUtils.getUIColor("FineTabbedPane.background", "fill.gray"));
labelPane.add(labelContentPane); 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 // tab区 flow layout
tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10)); tabPane = new JPanel(new BorderLayout());
tabPane.setBackground(Color.WHITE); Row tabRow = new Row();
tabRow.setSpacing(20);
tabPane.add(tabRow);
tabPane.setOpaque(false);
List<SelectedLabel> selectedLabelList = createSelectedLabelList(); List<SelectedLabel> selectedLabelList = createSelectedLabelList();
selectedTab = null; selectedTab = null;
for (SelectedLabel label : selectedLabelList) { for (SelectedLabel label : selectedLabelList) {
@ -472,19 +493,22 @@ public class AlphaFineFrame extends JFrame {
} }
for (SelectedLabel label : selectedLabelList) { for (SelectedLabel label : selectedLabelList) {
label.addMouseListener(createMouseListener(selectedLabelList, label, tabPane, tabLabel, readLabel)); label.addMouseListener(createMouseListener(selectedLabelList, label, tabPane, tabLabel, readLabel));
tabPane.add(label); tabRow.add(label);
} }
showPane.add(tabPane, BorderLayout.NORTH); showPane.setBackground(Color.WHITE);
showPane.add(labelPane, BorderLayout.CENTER); showPane.setBorder(new ScaledEmptyBorder(0, 20, 0, 20));
showPane.add(resultPane, BorderLayout.SOUTH); showPane.add(column(10,
cell(tabPane),
cell(labelPane),
cell(resultPane)
).getComponent());
return showPane; return showPane;
} }
private UILabel createTabLabel(String labelName) { private UILabel createTabLabel(String labelName) {
UILabel label = new UILabel(labelName); UILabel label = new UILabel(labelName, FineUIStyle.STYLE_PRIMARY);
label.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); label.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
label.setPreferredSize(new Dimension(60, 30)); label.setPreferredSize(FineUIScale.createScaleDimension(60, 30));
label.setForeground(AlphaFineConstants.LABEL_SELECTED);
return label; return label;
} }
@ -725,12 +749,7 @@ public class AlphaFineFrame extends JFrame {
} }
private void initSearchTextField() { 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() { private void initTextFieldListener() {
@ -963,23 +982,6 @@ public class AlphaFineFrame extends JFrame {
return searchText; 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;
}
/** /**
* 设置面板位置 * 设置面板位置
* *

21
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsContentCellRender.java

@ -1,13 +1,14 @@
package com.fr.design.mainframe.alphafine.component; 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.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.mainframe.alphafine.AlphaFineUtil;
import com.fr.design.mainframe.alphafine.model.ProductNews; import com.fr.design.mainframe.alphafine.model.ProductNews;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import javax.swing.BorderFactory;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListCellRenderer; import javax.swing.ListCellRenderer;
@ -32,17 +33,17 @@ public class ProductNewsContentCellRender implements ListCellRenderer<Object> {
/** /**
* 透明灰色背景 Y方向偏移 * 透明灰色背景 Y方向偏移
*/ */
private static final int GRAY_BACKGROUND_Y_GAP = 39; private static final int GRAY_BACKGROUND_Y_GAP = FineUIScale.scale(42);
/** /**
* 透明灰色背景 高度 * 透明灰色背景 高度
*/ */
private static final int GRAY_BACKGROUND_HEIGHT = 23; private static final int GRAY_BACKGROUND_HEIGHT = FineUIScale.scale(24);
/** /**
* 单行产品动态的高度与宽度尺寸 * 单行产品动态的高度与宽度尺寸
*/ */
private static final Dimension DEFAULT_DIMENSION = new Dimension(500, 100); private static final Dimension DEFAULT_DIMENSION = FineUIScale.createScaleDimension(600, 100);
private String[] segmentationResult; private String[] segmentationResult;
@ -62,16 +63,16 @@ public class ProductNewsContentCellRender implements ListCellRenderer<Object> {
boolean cellHasFocus) { boolean cellHasFocus) {
ProductNews productNews = (ProductNews) value; ProductNews productNews = (ProductNews) value;
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); panel.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
panel.setBackground(Color.WHITE); panel.setBackground(Color.WHITE);
panel.add(new ProductNewsImagePanel(productNews), BorderLayout.WEST); panel.add(new ProductNewsImagePanel(productNews), BorderLayout.WEST);
JPanel textPane = new JPanel(new BorderLayout()); JPanel textPane = new JPanel(new BorderLayout());
textPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 0)); textPane.setBorder(new ScaledEmptyBorder(0, 10, 10, 0));
UILabel titleLabel = new UILabel(AlphaFineUtil.highLightModelName(productNews.getTitle(), segmentationResult)); UILabel titleLabel = new UILabel(AlphaFineUtil.highLightModelName(productNews.getTitle(), segmentationResult));
titleLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(20)); titleLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(16));
if (productNewsList.getHoverIndex() == index) { if (productNewsList.getHoverIndex() == index) {
titleLabel.setForeground(UIConstants.FLESH_BLUE); titleLabel.setForeground(FlatUIUtils.getUIColor("brand.normal", Color.BLUE));
} }
textPane.add(titleLabel, BorderLayout.NORTH); textPane.add(titleLabel, BorderLayout.NORTH);
@ -89,7 +90,7 @@ public class ProductNewsContentCellRender implements ListCellRenderer<Object> {
UILabel dateLabel = new UILabel(DATE_FORMAT.format(productNews.getPushDate())); UILabel dateLabel = new UILabel(DATE_FORMAT.format(productNews.getPushDate()));
dateLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6); dateLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6);
dateLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); dateLabel.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
infoPane.setBackground(Color.WHITE); infoPane.setBackground(Color.WHITE);
infoPane.add(dateLabel, BorderLayout.CENTER); infoPane.add(dateLabel, BorderLayout.CENTER);
textPane.setBackground(Color.WHITE); textPane.setBackground(Color.WHITE);

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsSearchResultPane.java

@ -1,9 +1,9 @@
package com.fr.design.mainframe.alphafine.component; package com.fr.design.mainframe.alphafine.component;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
@ -22,7 +22,7 @@ public class ProductNewsSearchResultPane extends JPanel {
productNewsList = new ProductNewsList(); productNewsList = new ProductNewsList();
UIScrollPane scrollPane = new UIScrollPane(productNewsList); UIScrollPane scrollPane = new UIScrollPane(productNewsList);
scrollPane.setBackground(Color.WHITE); scrollPane.setBackground(Color.WHITE);
scrollPane.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 20)); scrollPane.setBorder(new ScaledEmptyBorder(10, 20, 0, 20));
productNewsList.setCellRenderer(new ProductNewsContentCellRender(segmentationResult, productNewsList)); productNewsList.setCellRenderer(new ProductNewsContentCellRender(segmentationResult, productNewsList));
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBackground(Color.WHITE); this.setBackground(Color.WHITE);

51
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java

@ -1,24 +1,27 @@
package com.fr.design.mainframe.alphafine.component; package com.fr.design.mainframe.alphafine.component;
import com.fr.base.svg.IconUtils; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.fr.common.util.Collections; import com.fr.common.util.Collections;
import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.DesignUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
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;
import static com.fine.swing.ui.layout.Layouts.fix;
/** /**
* alphafine - 搜索提示面板 * alphafine - 搜索提示面板
* *
@ -30,11 +33,7 @@ public class SearchHintPane extends JPanel {
private static final String TITLE = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Search_Title"); private static final String TITLE = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Search_Title");
private static final String RECOMMEND = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend_Search"); private static final String RECOMMEND = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend_Search");
private static final Icon ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/search_hint.svg"); private static final Icon ICON = new LazyIcon("search_hint", 110);
private static final int HEIGHT = 200;
private static final int WIDTH = 300;
private static final int TITLE_LABEL_HEIGHT = 30;
private static final int TITLE_FONT_SIZE = 14;
public SearchHintPane() { public SearchHintPane() {
this(new ArrayList<>()); this(new ArrayList<>());
@ -48,31 +47,23 @@ public class SearchHintPane extends JPanel {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
setBorder(BorderFactory.createEmptyBorder(40,0,0,0)); setBorder(BorderFactory.createEmptyBorder(40,0,0,0));
setBackground(Color.white); setBackground(Color.white);
setPreferredSize(new Dimension(WIDTH, HEIGHT));
setAlignmentY(SwingConstants.CENTER);
UILabel image = new UILabel(); UILabel image = new UILabel();
image.setPreferredSize(new Dimension(150, 111)); image.setPreferredSize(FineUIScale.createScaleDimension(110, 110));
image.setHorizontalAlignment(SwingConstants.CENTER);
image.setIcon(icon); image.setIcon(icon);
image.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); add(column(
add(image, BorderLayout.NORTH); flex(),
add(generateDescription(title), BorderLayout.CENTER); row(flex(), cell(image), flex()),
add(generateHintsLabel(hints), BorderLayout.SOUTH); fix(4),
} row(flex(), cell(new UILabel(title, FineUIStyle.LABEL_DISABLED)), flex()),
fix(10),
protected Component generateDescription(String title) { row(flex(), cell(generateHintsLabel(hints)), flex()),
JLabel description = new JLabel(title); flex()
description.setForeground(AlphaFineConstants.MEDIUM_GRAY); ).getComponent());
description.setFont(DesignUtils.getDefaultGUIFont().applySize(TITLE_FONT_SIZE));
description.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
description.setHorizontalAlignment(SwingConstants.CENTER);
description.setPreferredSize(new Dimension(WIDTH, TITLE_LABEL_HEIGHT));
return description;
} }
private Component generateHintsLabel(List<String> hints) { private Component generateHintsLabel(List<String> hints) {
if (Collections.isEmpty(hints)) { if (Collections.isEmpty(hints)) {
return new JLabel(); return new UILabel();
} }
return new RecommendSearchLabel(RECOMMEND, hints); return new RecommendSearchLabel(RECOMMEND, hints);
} }

7
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchListModel.java

@ -14,7 +14,6 @@ import javax.swing.DefaultListModel;
*/ */
public class SearchListModel extends DefaultListModel<AlphaCellModel> { public class SearchListModel extends DefaultListModel<AlphaCellModel> {
private static final int MAX_SHOW_SIZE = 12;
private static final long serialVersionUID = 7230585307439551228L; private static final long serialVersionUID = 7230585307439551228L;
@ -47,12 +46,6 @@ public class SearchListModel extends DefaultListModel<AlphaCellModel> {
@Override @Override
protected void fireContentsChanged(Object source, int index0, int index1) { 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); super.fireContentsChanged(source, index0, index1);
} }

10
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultContentCellRender.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.alphafine.component; package com.fr.design.mainframe.alphafine.component;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.mainframe.alphafine.AlphaFineUtil;
@ -7,7 +9,6 @@ import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListCellRenderer; import javax.swing.ListCellRenderer;
@ -23,7 +24,7 @@ import java.awt.Dimension;
*/ */
public class SearchResultContentCellRender implements ListCellRenderer<Object> { public class SearchResultContentCellRender implements ListCellRenderer<Object> {
private static final int OFFSET = 45; private static final int OFFSET = FineUIScale.scale(45);
private static final String SELECTED_PATH = AlphaFineConstants.IMAGE_URL + "selected"; private static final String SELECTED_PATH = AlphaFineConstants.IMAGE_URL + "selected";
private static final String CELL_PATH = AlphaFineConstants.IMAGE_URL + "alphafine"; private static final String CELL_PATH = AlphaFineConstants.IMAGE_URL + "alphafine";
private static final String SUFFIX = ".png"; private static final String SUFFIX = ".png";
@ -41,8 +42,8 @@ public class SearchResultContentCellRender implements ListCellRenderer<Object> {
AlphaCellModel model = (AlphaCellModel) value; AlphaCellModel model = (AlphaCellModel) value;
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.setBackground(null); panel.setBackground(Color.WHITE);
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); panel.setBorder(new ScaledEmptyBorder(0,10,0,0));
// 图标icon 样式 // 图标icon 样式
UILabel iconLabel = new UILabel(); UILabel iconLabel = new UILabel();
if (isSelected) { if (isSelected) {
@ -56,7 +57,6 @@ public class SearchResultContentCellRender implements ListCellRenderer<Object> {
String iconUrl = CELL_PATH + model.getType().getTypeValue() + SUFFIX; String iconUrl = CELL_PATH + model.getType().getTypeValue() + SUFFIX;
iconLabel.setIcon(IOUtils.readIcon(iconUrl)); iconLabel.setIcon(IOUtils.readIcon(iconUrl));
} }
iconLabel.setFont(AlphaFineConstants.MEDIUM_FONT);
// 内容详情label 样式 // 内容详情label 样式

15
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.alphafine.component; package com.fr.design.mainframe.alphafine.component;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.model.SearchResult;
@ -8,7 +9,9 @@ import com.fr.design.mainframe.alphafine.preview.ResultShowPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* @author hades * @author hades
@ -26,19 +29,17 @@ public class SearchResultPane extends JPanel {
public SearchResultPane(String[] segmentationResult, ResultShowPane rightSearchResultPane) { public SearchResultPane(String[] segmentationResult, ResultShowPane rightSearchResultPane) {
searchResultList = new AlphaFineList(); searchResultList = new AlphaFineList();
searchResultList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
searchResultList.setFixedCellHeight(AlphaFineConstants.CELL_HEIGHT); searchResultList.setFixedCellHeight(AlphaFineConstants.CELL_HEIGHT);
leftSearchResultPane = new UIScrollPane(searchResultList); leftSearchResultPane = new UIScrollPane(searchResultList);
leftSearchResultPane.setBorder(null);
leftSearchResultPane.setBackground(Color.WHITE);
leftSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.LEFT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT));
searchListModel = new SearchListModel(new SearchResult(), searchResultList, leftSearchResultPane); searchListModel = new SearchListModel(new SearchResult(), searchResultList, leftSearchResultPane);
searchResultList.setModel(searchListModel); searchResultList.setModel(searchListModel);
searchResultList.setCellRenderer(new SearchResultContentCellRender(segmentationResult)); searchResultList.setCellRenderer(new SearchResultContentCellRender(segmentationResult));
searchResultList.setResultShowPane(rightSearchResultPane); searchResultList.setResultShowPane(rightSearchResultPane);
this.setPreferredSize(AlphaFineConstants.CONTENT_SIZE);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(leftSearchResultPane, BorderLayout.WEST); this.add(row(cell(leftSearchResultPane).weight(1), cell(rightSearchResultPane).weight(1)).getComponent());
this.add(rightSearchResultPane, BorderLayout.EAST); this.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
this.setPreferredSize(AlphaFineConstants.PREVIEW_SIZE); this.setPreferredSize(AlphaFineConstants.PREVIEW_SIZE);
} }

13
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/TemplateResourcePageGridPane.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.alphafine.component; package com.fr.design.mainframe.alphafine.component;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -38,12 +40,11 @@ public class TemplateResourcePageGridPane extends JPanel {
List<UIScrollPane> scrollPanes = new ArrayList<>(); List<UIScrollPane> scrollPanes = new ArrayList<>();
private static final int PAGE_MAX_SIZE = 12; private static final int PAGE_MAX_SIZE = 12;
private static final int TABLE_MAX_ROW_COUNT = 4;
private static final int TABLE_COL_COUNT = 3; private static final int TABLE_COL_COUNT = 3;
private static final int TABLE_VGAP = 15; private static final int TABLE_VGAP = FineUIScale.scale(15);
private static final int TABLE_HGAP = 15; private static final int TABLE_HGAP = FineUIScale.scale(15);
private static final int RESOURCE_WIDTH = 197; private static final int RESOURCE_WIDTH = FineUIScale.scale(200);
private static final int RESOURCE_HEIGHT = 128; private static final int RESOURCE_HEIGHT = FineUIScale.scale(132);
public TemplateResourcePageGridPane(List<TemplateResource> templateResourceList) { public TemplateResourcePageGridPane(List<TemplateResource> templateResourceList) {
this.data = templateResourceList; this.data = templateResourceList;
@ -51,7 +52,7 @@ public class TemplateResourcePageGridPane extends JPanel {
createPages(); createPages();
initComponents(); initComponents();
this.setBackground(Color.WHITE); this.setBackground(Color.WHITE);
this.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 20)); this.setBorder(new ScaledEmptyBorder(0,0,0,0));
switchPage(1); switchPage(1);
} }

3
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/TemplateResourcePanel.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.alphafine.component; package com.fr.design.mainframe.alphafine.component;
import com.fine.theme.utils.FineUIScale;
import com.fr.common.util.Strings; import com.fr.common.util.Strings;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.alphafine.model.TemplateResource; import com.fr.design.mainframe.alphafine.model.TemplateResource;
@ -141,6 +142,6 @@ public class TemplateResourcePanel extends JPanel {
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(180, 90); return FineUIScale.createScaleDimension(200, 132);
} }
} }

39
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultProductNewsPane.java

@ -1,8 +1,11 @@
package com.fr.design.mainframe.alphafine.preview; package com.fr.design.mainframe.alphafine.preview;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.component.ProductNewsContentCellRender; import com.fr.design.mainframe.alphafine.component.ProductNewsContentCellRender;
@ -10,18 +13,22 @@ import com.fr.design.mainframe.alphafine.component.ProductNewsList;
import com.fr.design.mainframe.alphafine.exception.AlphaFineNetworkException; import com.fr.design.mainframe.alphafine.exception.AlphaFineNetworkException;
import com.fr.design.mainframe.alphafine.model.ProductNews; import com.fr.design.mainframe.alphafine.model.ProductNews;
import com.fr.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchManager; import com.fr.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchManager;
import com.fr.design.utils.DesignUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory; import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.Color;
import java.util.List; import java.util.List;
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;
import static com.fine.swing.ui.layout.Layouts.fix;
/** /**
* @author hades * @author hades
* @version 11.0 * @version 11.0
@ -38,23 +45,18 @@ public class DefaultProductNewsPane extends JPanel {
public DefaultProductNewsPane() { public DefaultProductNewsPane() {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
this.add(createLoadingPane()); this.add(createLoadingPane(), BorderLayout.CENTER);
this.setPreferredSize(AlphaFineConstants.PREVIEW_SIZE); this.setPreferredSize(AlphaFineConstants.PREVIEW_SIZE);
this.setBackground(Color.WHITE);
this.worker = createWorker(); this.worker = createWorker();
this.worker.execute(); this.worker.execute();
} }
private JPanel createLoadingPane() { private JPanel createLoadingPane() {
JPanel loadingPane = new JPanel(new BorderLayout()); JPanel loadingPane = new JPanel(new BorderLayout());
UILabel loadingLabel = new UILabel(LOADING);
loadingLabel.setForeground(AlphaFineConstants.MEDIUM_GRAY);
loadingLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(14));
loadingLabel.setBorder(BorderFactory.createEmptyBorder(0, 280, 0, 0));
UILabel loadingIconLabel = new UILabel(LOADING_ICON); UILabel loadingIconLabel = new UILabel(LOADING_ICON);
loadingIconLabel.setBorder(BorderFactory.createEmptyBorder(100, 0, 0, 0)); UILabel loadingLabel = new UILabel(LOADING, FineUIStyle.LABEL_DISABLED);
loadingPane.add(loadingIconLabel, BorderLayout.NORTH); loadingPane.add(row(flex(),column(flex(), cell(loadingIconLabel), fix(20), cell(loadingLabel), flex()), flex()).getComponent());
loadingPane.add(loadingLabel, BorderLayout.CENTER);
loadingPane.setBackground(Color.WHITE); loadingPane.setBackground(Color.WHITE);
return loadingPane; return loadingPane;
} }
@ -113,9 +115,16 @@ public class DefaultProductNewsPane extends JPanel {
ProductNewsList productNewsJList = new ProductNewsList(productNewsDefaultListModel); ProductNewsList productNewsJList = new ProductNewsList(productNewsDefaultListModel);
productNewsJList.setBackground(Color.WHITE); productNewsJList.setBackground(Color.WHITE);
productNewsJList.setCellRenderer(new ProductNewsContentCellRender(productNewsJList)); productNewsJList.setCellRenderer(new ProductNewsContentCellRender(productNewsJList));
UIScrollPane scrollPane = new UIScrollPane(productNewsJList); UIScrollPane scrollPane = new UIScrollPane(productNewsJList) {
@Override
public UIScrollBar createVerticalScrollBar() {
UIScrollBar verticalScrollBar = super.createVerticalScrollBar();
verticalScrollBar.setOpaque(false);
return verticalScrollBar;
}
};
scrollPane.setBackground(Color.WHITE); scrollPane.setBackground(Color.WHITE);
scrollPane.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 20)); scrollPane.setBorder(new ScaledEmptyBorder(0, 0, 0, 0));
return scrollPane; return scrollPane;
} }

23
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java

@ -1,12 +1,13 @@
package com.fr.design.mainframe.alphafine.preview; package com.fr.design.mainframe.alphafine.preview;
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.AlphaFineCloudConstants; import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.BrowseUtils;
import com.fr.design.utils.DesignUtils;
import com.fr.json.JSON; import com.fr.json.JSON;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONFactory; import com.fr.json.JSONFactory;
@ -22,7 +23,6 @@ import javax.swing.SwingWorker;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
@ -74,7 +74,7 @@ public class HelpDocumentNoResultPane extends JPanel {
HelpDocumentNoResultPane.this.removeAll(); HelpDocumentNoResultPane.this.removeAll();
try { try {
if (get()) { if (get()) {
add(new NoResultPane(title, icon, 150), BorderLayout.CENTER); add(new NoResultPane(title, icon, FineUIScale.scale(150)));
add(createRecommendPane(linkMap), BorderLayout.EAST); add(createRecommendPane(linkMap), BorderLayout.EAST);
} else { } else {
add(new NetWorkFailedPane(() -> { add(new NetWorkFailedPane(() -> {
@ -109,10 +109,10 @@ public class HelpDocumentNoResultPane extends JPanel {
private JPanel createRecommendPane(Map<String, String> linkMap) { private JPanel createRecommendPane(Map<String, String> linkMap) {
JPanel wrapRecommendPane = new JPanel(new BorderLayout()); JPanel wrapRecommendPane = new JPanel(new BorderLayout());
wrapRecommendPane.setPreferredSize(new Dimension(200, 305)); wrapRecommendPane.setPreferredSize(FineUIScale.createScaleDimension(200, 300));
JPanel recommendPane = new JPanel(); JPanel recommendPane = new JPanel();
recommendPane.setLayout(new GridLayout(0, 1)); recommendPane.setLayout(new GridLayout(0, 1));
recommendPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 130, 0)); recommendPane.setBorder(new ScaledEmptyBorder(0, 5, 130, 0));
recommendPane.setBackground(Color.WHITE); recommendPane.setBackground(Color.WHITE);
recommendPane.add(new UILabel(RECOMMEND)); recommendPane.add(new UILabel(RECOMMEND));
for (Map.Entry<String, String> entry : linkMap.entrySet()) { for (Map.Entry<String, String> entry : linkMap.entrySet()) {
@ -122,7 +122,7 @@ public class HelpDocumentNoResultPane extends JPanel {
JSeparator sep = new JSeparator(); JSeparator sep = new JSeparator();
sep.setOrientation(JSeparator.VERTICAL); sep.setOrientation(JSeparator.VERTICAL);
sep.setLayout(new GridLayout(0, 1)); sep.setLayout(new GridLayout(0, 1));
sep.setPreferredSize(new Dimension(1, 285)); sep.setPreferredSize(FineUIScale.createScaleDimension(1, 285));
sep.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); sep.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
sep.add(new UILabel()); sep.add(new UILabel());
wrapRecommendPane.add(sep, BorderLayout.WEST); wrapRecommendPane.add(sep, BorderLayout.WEST);
@ -132,8 +132,8 @@ public class HelpDocumentNoResultPane extends JPanel {
private JPanel createListLabel(String text, String link) { private JPanel createListLabel(String text, String link) {
UILabel listLabel = new UILabel(String.format("%s", text)); UILabel listLabel = new UILabel(String.format("%s", text));
listLabel.setForeground(UIConstants.FLESH_BLUE); listLabel.setForeground(FlatUIUtils.getUIColor("brand.normal", Color.BLUE));
listLabel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); listLabel.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
listLabel.addMouseListener(new MouseAdapter() { listLabel.addMouseListener(new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
@ -145,13 +145,12 @@ public class HelpDocumentNoResultPane extends JPanel {
JPanel listPane = new JPanel(new BorderLayout()); JPanel listPane = new JPanel(new BorderLayout());
listPane.setBackground(Color.WHITE); listPane.setBackground(Color.WHITE);
UILabel dotLabel = new UILabel("·"); UILabel dotLabel = new UILabel("·");
dotLabel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); dotLabel.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
dotLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(14));
dotLabel.setHorizontalAlignment(SwingConstants.LEADING); dotLabel.setHorizontalAlignment(SwingConstants.LEADING);
dotLabel.setForeground(DOT_COLOR); dotLabel.setForeground(DOT_COLOR);
listPane.add(dotLabel, BorderLayout.WEST); listPane.add(dotLabel, BorderLayout.WEST);
listPane.add(listLabel, BorderLayout.CENTER); listPane.add(listLabel, BorderLayout.CENTER);
listPane.setPreferredSize(new Dimension(100, 20)); listPane.setPreferredSize(FineUIScale.createScaleDimension(100, 20));
return listPane; return listPane;
} }

33
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java

@ -1,18 +1,23 @@
package com.fr.design.mainframe.alphafine.preview; package com.fr.design.mainframe.alphafine.preview;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.DesignUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
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;
import static com.fine.swing.ui.layout.Layouts.fix;
/** /**
* Created by XiaXiang on 2017/8/14. * Created by XiaXiang on 2017/8/14.
*/ */
@ -24,22 +29,20 @@ public class NoResultPane extends JPanel {
public NoResultPane(String title, Icon icon, int width) { public NoResultPane(String title, Icon icon, int width) {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
setBackground(Color.white); setBackground(Color.white);
setPreferredSize(new Dimension(width, 305)); setPreferredSize(new Dimension(width, FineUIScale.scale(300)));
UILabel image = new UILabel(); UILabel image = new UILabel();
image.setPreferredSize(new Dimension(150, 111)); image.setPreferredSize(FineUIScale.createScaleDimension(110, 110));
image.setHorizontalAlignment(SwingConstants.CENTER);
image.setIcon(icon); image.setIcon(icon);
image.setBorder(BorderFactory.createEmptyBorder(30, 0, 0, 0)); add(column(
add(image, BorderLayout.CENTER); flex(),
add(generateDescription(title), BorderLayout.SOUTH); row(flex(), cell(image), flex()),
fix(4),
row(flex(), cell(generateDescription(title)), flex()),
flex()
).getComponent());
} }
protected Component generateDescription(String title) { protected Component generateDescription(String title) {
UILabel description = new UILabel(title); return new UILabel(title, FineUIStyle.LABEL_DISABLED);
description.setForeground(AlphaFineConstants.MEDIUM_GRAY);
description.setFont(DesignUtils.getDefaultGUIFont().applySize(14));
description.setBorder(BorderFactory.createEmptyBorder(0, 0, 135, 0));
description.setHorizontalAlignment(SwingConstants.CENTER);
return description;
} }
} }

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java

@ -6,7 +6,6 @@ import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.BrowseUtils;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener; import javax.swing.event.HyperlinkListener;
@ -34,7 +33,7 @@ public class NoResultWithLinkPane extends NoResultPane {
String[] para1 = title.split(TAG_A_START); String[] para1 = title.split(TAG_A_START);
String[] para2 = para1[1].split(TAG_A_END); String[] para2 = para1[1].split(TAG_A_END);
MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.getAlphaGoToForum(), para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) { MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.getAlphaGoToForum(), para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont(), AlphaFineConstants.MEDIUM_GRAY) {
@Override @Override
protected void initListener(String link) { protected void initListener(String link) {
@ -48,7 +47,6 @@ public class NoResultWithLinkPane extends NoResultPane {
}); });
} }
}; };
messageWithLink.setBorder(BorderFactory.createEmptyBorder(0, AlphaFineConstants.LEFT_WIDTH - 30, 135, 0));
return messageWithLink; return messageWithLink;
} }

Loading…
Cancel
Save