Browse Source

Merge branch 'fbp/release' of ssh://code.fineres.com:7999/~renekton/design into fbp/release

fbp/release
renekton 2 months ago
parent
commit
c79e808d6b
  1. 37
      designer-base/src/main/java/com/fine/theme/light/ui/FineComboCheckBoxUI.java
  2. 3
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  3. 4
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  4. 12
      designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java
  5. 17
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  6. 17
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  7. 8
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java
  8. 17
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java
  9. 25
      designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java
  10. 7
      designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java
  11. 6
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  12. 28
      designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java
  13. 7
      designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java
  14. 11
      designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java
  15. 135
      designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java
  16. 1
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  17. 18
      designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java
  18. 7
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java
  19. 21
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java
  20. 23
      designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkAction.java
  21. 78
      designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkTablePane.java
  22. 10
      designer-base/src/main/java/com/fr/design/style/FRFontPane.java
  23. 9
      designer-base/src/main/java/com/fr/design/utils/ColorUtils.java
  24. 26
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  25. 1
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties
  26. 23
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  27. 119
      designer-base/src/main/resources/com/fr/design/data/tabledata/datacenter/web/data-choose.main.js
  28. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  29. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  30. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  31. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  32. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  33. 46
      designer-base/src/test/java/com/fr/design/gui/storybook/components/ComboCheckBoxStoryBoard.java
  34. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java
  35. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/AbstractVanChartScrollPane.java
  36. 12
      designer-realize/src/main/java/com/fr/design/condition/BackPane.java
  37. 7
      designer-realize/src/main/java/com/fr/design/condition/BorderHighlightPane.java
  38. 10
      designer-realize/src/main/java/com/fr/design/condition/FontPane.java
  39. 9
      designer-realize/src/main/java/com/fr/design/condition/ForeGroundPane.java
  40. 9
      designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java
  41. 9
      designer-realize/src/main/java/com/fr/design/condition/NewRealValuePane.java
  42. 11
      designer-realize/src/main/java/com/fr/design/condition/PaddingPane.java
  43. 9
      designer-realize/src/main/java/com/fr/design/condition/PagePane.java
  44. 9
      designer-realize/src/main/java/com/fr/design/condition/PresentHighlightPane.java
  45. 9
      designer-realize/src/main/java/com/fr/design/condition/WHPane.java
  46. 9
      designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java
  47. 18
      designer-realize/src/main/java/com/fr/design/dscolumn/SpecifiedGroupAttrPane.java
  48. 2
      designer-realize/src/main/java/com/fr/design/mainframe/AbstractAttrPane.java
  49. 7
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java
  50. 3
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java
  51. 2
      designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java
  52. 17
      designer-realize/src/main/java/com/fr/design/widget/ui/UserEditorDefinePane.java
  53. 4
      designer-realize/src/main/java/com/fr/design/widget/ui/WritableRepeatEditorPane.java
  54. 10
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java
  55. 10
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java

37
designer-base/src/main/java/com/fine/theme/light/ui/FineComboCheckBoxUI.java

@ -0,0 +1,37 @@
package com.fine.theme.light.ui;
import com.formdev.flatlaf.ui.FlatComboBoxUI;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
/**
* {@link com.fr.design.gui.icombocheckbox.UIComboCheckBox} UI 样式
*
* @author lemon
* @since 12.0
* Created on 2024/09/27
*/
public class FineComboCheckBoxUI extends FlatComboBoxUI {
public FineComboCheckBoxUI() {
super();
}
/**
* 创建UI
*/
public static ComponentUI createUI(JComponent c) {
return new FineComboCheckBoxUI();
}
@Override
public void installUI(JComponent c) {
super.installUI(c);
c.setBackground(UIManager.getColor("ComboCheckBox.background"));
c.setBorder(UIManager.getBorder("ComboCheckBox.border"));
}
}

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

@ -41,6 +41,7 @@ public interface FineUIStyle {
String POPUP_MENU_TOOL_BAR = "popupMenuToolBar";
String POPUP_MENU_DROPDOWN = "dropdownPopupMenu";
String TRANSPARENT_TEXT_FIELD = "transparentTextField";
String OFFET_LEFT_TEXT_FIELD = "offsetLeftText";
String TRANSPARENT_BACKGROUND = "transparentBackground";
String PURE_LIST = "pureList";
String NO_BORDER_LIST = "noBorderList";
@ -51,9 +52,11 @@ public interface FineUIStyle {
String DEFAULT_TABLE = "defaultTable";
String WHITE_BUTTON = "whiteButton";
String ORIGINAL_BUTTON = "originalButton";
String PLAIN_ARROW_BUTTON = "plainArrowButton";
String GRAY_BUTTON = "grayButton";
String DETAIL_LABEL = "detailLabel";
String WIDGET_EVENT_LABEL = "widgetEventLabel";
String HYPER_LINK_LABEL = "hyperLinkLabel";
/**

4
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -2,7 +2,6 @@ package com.fr.design.condition;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.fr.common.annotations.Open;
@ -90,7 +89,8 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
this.add(FineUIUtils.wrapComponentWithTitle(column(
10,
row(cell(addItemPane), flex()),
cell(selectedItemScrollPane).weight(1).with(it -> it.setBorder(new FineRoundBorder())),
cell(selectedItemScrollPane).weight(1).with(
it -> it.setBorder(FineBorderFactory.createWrappedRoundBorder())),
fix(10)
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property")), BorderLayout.NORTH);
}

12
designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java

@ -6,11 +6,17 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
public abstract class SingleConditionPane<T> extends BasicPane {
private static final long serialVersionUID = -4274960170813368817L;
@ -23,14 +29,14 @@ public abstract class SingleConditionPane<T> extends BasicPane {
public SingleConditionPane(boolean isRemove) {
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(10, 0));
this.setBorder(new ScaledEmptyBorder(4, 8, 4, 8));
if (isRemove) {
if(cancel == null) {
cancel = new UIButton(new LazyIcon("remove"));
cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Remove"));
cancel.addActionListener(cancleListener);
cancel.setBackground(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250, 255)));
cancel.setBorder(null);
FineUIStyle.setStyle(cancel, FineUIStyle.ORIGINAL_BUTTON);
}
addCancel();
}
@ -40,7 +46,7 @@ public abstract class SingleConditionPane<T> extends BasicPane {
* 添加删除按钮
*/
public void addCancel() {
this.add(cancel, BorderLayout.EAST);
this.add(column(flex(), cell(cancel), flex()).getComponent(), BorderLayout.EAST);
}
ActionListener cancleListener = new ActionListener() {

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

@ -9,8 +9,10 @@ import com.fr.data.MultiResultTableData;
import com.fr.data.TableDataSource;
import com.fr.data.TableDataSourceTailor;
import com.fr.data.core.DataCoreXmlUtils;
import com.fr.data.impl.ConditionTableData;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.data.impl.NameDataModel;
import com.fr.data.impl.RecursionTableData;
import com.fr.data.impl.storeproc.ProcedureDataModel;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.data.impl.storeproc.StoreProcedureConstants;
@ -589,7 +591,7 @@ public abstract class DesignTableDataManager {
bean.setStart(rowCount);
bean.setEnd(-1);
bean.updateConvertMap(parameterMap);
if (checkBean(bean)) {
if (checkBean(bean, tabledata)) {
return (EmbeddedTableData) TableDataRepository.getInstance().previewTableData(bean).getTableData();
} else {
PreviewDataBean dataBean = new PreviewDataBean();
@ -624,9 +626,16 @@ public abstract class DesignTableDataManager {
}
}
private static boolean checkBean(PreviewSourceBean bean) {
// dataName为空说明是新建的,得用tabledata传
return !bean.getDataName().isEmpty();
private static boolean checkBean(PreviewSourceBean bean, TableData tableData) {
if (bean.getDataName().isEmpty()) {
if (tableData instanceof ConditionTableData || tableData instanceof RecursionTableData) {
bean.getDataSource().putTableData(StringUtils.EMPTY, tableData);
return true;
}
// dataName为空并且不为特殊的数据集说明是新建的,得用tabledata传
return false;
}
return true;
}
private static boolean needInputParams(boolean mustInputParameters, ParameterProvider[] parameters) {

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

@ -1,5 +1,6 @@
package com.fr.design.data.datapane;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.TableData;
import com.fr.base.TableDataBean;
import com.fr.data.MultiResultTableData;
@ -14,6 +15,7 @@ import com.fr.design.data.datapane.preview.TableDataBeanHelper;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.i18n.Toolkit;
import com.fr.file.ProcedureConfig;
@ -94,6 +96,21 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
return Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", getEditingName());
}
@Override
protected ShortCut4JControlPane[] createShortcuts() {
return new ShortCut4JControlPane[]{
shortCutFactory.addItemShortCut(),
shortCutFactory.removeItemShortCut(),
shortCutFactory.copyItemShortCut(),
shortCutFactory.sortItemShortCut(),
};
}
@Override
protected int getLeftPreferredSize() {
return FineUIScale.scale(180);
}
@Override
public Collection getExtraItemsToCheckNameRepeat() {
return DesignTableDataManager.getGlobalDataSet().keySet();

8
designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java

@ -2,8 +2,8 @@ package com.fr.design.data.datapane.connect;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit;
@ -55,16 +55,16 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
itemComboBox.setEnabled(true);
this.add(itemComboBox, BorderLayout.CENTER);
refreshButton = new UIButton(new LazyIcon("refresh"));
FineUIStyle.setStyle(refreshButton, FineUIStyle.ORIGINAL_BUTTON);
JPanel jPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 0 ,4);
editButton = initEditButton(editButton, buttonSize);
editButton.setBorder(null);
FineUIStyle.setStyle(editButton, FineUIStyle.ORIGINAL_BUTTON);
editButton.setBackground(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250, 255)));
jPanel.add(editButton);
jPanel.add(refreshButton);
jPanel.setOpaque(true);
this.add(jPanel, BorderLayout.EAST);
refreshButton.setPreferredSize(buttonSize);
refreshButton.setBorder(null);
refreshButton.setBackground(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250, 255)));
refreshButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -74,7 +74,7 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
}
protected UIButton initEditButton(UIButton editButton, Dimension buttonSize) {
editButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/control-center2.png"));
editButton = new UIButton(new LazyIcon("edit"));
editButton.setPreferredSize(buttonSize);
editButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {

17
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java

@ -1,7 +1,6 @@
package com.fr.design.data.datapane.preview.desensitization.view.setting;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.data.desensitize.base.DesensitizationTableData;
@ -14,7 +13,6 @@ import com.fr.design.data.datapane.preview.desensitization.view.rule.Desensitiza
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.ComboCheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombocheckbox.UIComboCheckBox;
import com.fr.design.gui.ilable.UILabel;
@ -39,7 +37,6 @@ import javax.swing.UIManager;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@ -57,6 +54,8 @@ import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/**
* 处理TableDataDesensitizationTablePane中TableEditPane的Model
*
@ -367,12 +366,6 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
}
});
setBoxStyle();
}
private void setBoxStyle() {
this.rolesCheckBox.setBorder(new FineRoundBorder());
FineUIStyle.setStyle(this.rolesCheckBox.getEditor(), FineUIStyle.TRANSPARENT_TEXT_FIELD);
}
@Override
@ -433,7 +426,9 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
protected void setLayoutAndAddComponents() {
// 使用BorderLayout,否则默认使用的FlowLayout会让整个下拉选框使用最小Size,然后TableCell这边会出现空白
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(getLabel(), BorderLayout.EAST);
JPanel pane = getClickPane();
pane.setOpaque(false);
this.add(pane, BorderLayout.CENTER);
}
@Override
@ -457,7 +452,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
// 规则状态
this.ruleStatusLabel = new UILabel();
this.ruleStatusLabel.setOpaque(true);
FineUIStyle.setStyle(ruleStatusLabel, FineUIStyle.LABEL_WARNING_TIP);
setStyle(ruleStatusLabel, FineUIStyle.LABEL_WARNING_TIP);
}
/**

25
designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java vendored

@ -5,19 +5,19 @@ import com.fanruan.workplace.http.HttpServiceMap;
import com.fanruan.workplace.http.RepositoryManager;
import com.fanruan.workplace.http.info.Stub;
import com.fanruan.workplace.network.RemoteNetworkRepository;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.workspace.engine.exception.RemoteDesignConnectionException;
import com.fr.workspace.engine.exception.RemoteDesignNoAuthException;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import com.fr.workspace.server.repository.compatible.register.CompatibleRegister;
import com.fr.workspace.server.repository.connect.FineWorkspaceHttpClient;
import com.fr.decision.webservice.bean.authentication.LoginRequestInfoBean;
import com.fr.decision.webservice.bean.authentication.LoginResponseInfoBean;
import com.fr.stable.StringUtils;
import com.fr.workspace.connect.WorkspaceClient;
import com.fr.workspace.connect.WorkspaceConnection;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.connect.WorkspaceConnector;
import com.fr.workspace.engine.exception.RemoteDesignConnectionException;
import com.fr.workspace.engine.exception.RemoteDesignNoAuthException;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import com.fr.workspace.server.repository.authority.RemoteAuthoritySource;
import com.fr.workspace.server.repository.compatible.register.CompatibleRegister;
import com.fr.workspace.server.repository.connect.FineWorkspaceHttpClient;
import java.net.InetAddress;
import java.util.Map;
@ -72,13 +72,18 @@ public class HttpWorkspaceConnector implements WorkspaceConnector {
Stub<?> stub = entry.getValue();
stub.clearProxy();
}
LoginResponseInfoBean bean = RemoteAuthorityRepository.getInstance().login(createLoginBean(connectionInfo));
Map<String, Object> loginConfigMap = RemoteAuthorityRepository.getInstance().getLoginConfigMap();
long timeout = Long.parseLong(String.valueOf(loginConfigMap.get(RemoteAuthoritySource.LOGIN_TIMEOUT)));
boolean rememberLogin = (boolean) loginConfigMap.get(RemoteAuthoritySource.SUPPORT_REMEMBER_LOGIN);
LoginResponseInfoBean bean = RemoteAuthorityRepository.getInstance().login(createLoginBean(connectionInfo, rememberLogin));
WorkspaceConnection connection = new WorkspaceConnection(
UUID.randomUUID().toString(),
connectionInfo.getUserName(),
HttpConstants.AUTHORIZATION_PREFIX + bean.getAccessToken(),
InetAddress.getLocalHost().getHostAddress());
client.updateConnection(connection);
client.setRememberLogin(rememberLogin);
client.setTimeout(timeout);
try {
return RemoteNetworkRepository.getInstance().testConnect();
} catch (RemoteDesignNoAuthException e) {
@ -88,12 +93,12 @@ public class HttpWorkspaceConnector implements WorkspaceConnector {
}
}
private LoginRequestInfoBean createLoginBean(WorkspaceConnectionInfo connectionInfo) {
private LoginRequestInfoBean createLoginBean(WorkspaceConnectionInfo connectionInfo, boolean rememberLogin) {
LoginRequestInfoBean bean = new LoginRequestInfoBean();
bean.setUsername(connectionInfo.getUserName());
bean.setPassword(connectionInfo.getPassword());
bean.setEncrypted(false);
bean.setValidity(-2);
bean.setValidity(rememberLogin ? -2 : -1);
return bean;
}
}

7
designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java

@ -1,6 +1,7 @@
package com.fr.design.formula;
import com.fr.base.FRContext;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton;
@ -18,12 +19,10 @@ import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.ByteArrayInputStream;
@ -43,8 +42,9 @@ public class JavaEditorPane extends BasicPane {
public JavaEditorPane(String className, String defaultText) {
this.className = className;
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
javaText = new RSyntaxTextArea();
javaText.setBorder(null);
configRSyntax(javaText);
if (StringUtils.isNotEmpty(className)) {
javaText.setText("//Loading source code from server...");
@ -86,6 +86,7 @@ public class JavaEditorPane extends BasicPane {
}
UIScrollPane jt = new UIScrollPane(javaText);
jt.setBorder(FineBorderFactory.createWrappedRoundBorder());
JPanel toolbarPane = new JPanel(new BorderLayout());
UIButton saveButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save"));
saveButton.setAction(new SaveAction());

6
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -1,10 +1,9 @@
package com.fr.design.gui.controlpane;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
@ -29,7 +28,6 @@ import javax.swing.DefaultListModel;
import javax.swing.JPanel;
import javax.swing.ListModel;
import javax.swing.ListSelectionModel;
import javax.swing.UIManager;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;
@ -102,7 +100,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
@Override
protected void initLeftPane(JPanel leftPane) {
leftPane.add(new UIScrollPane(contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0)), BorderLayout.CENTER);
leftPane.setBorder(new FineRoundBorder());
leftPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
}

28
designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java

@ -43,7 +43,7 @@ public class FineTabbedPane extends Box {
private final UIButtonGroup<String> tabGroup;
private final Map<String, JComponent> tabComponents;
private final int[] tabLayout;
private final boolean useFitTab ;
private final boolean useFitTab;
private FineTabbedPane(Map<String, JComponent> tabComponents, float headRatio, int[] tabLayout, boolean useFitTab) {
this.headRatio = headRatio;
@ -142,35 +142,45 @@ public class FineTabbedPane extends Box {
initCoreComponents();
setMatchParentSize(true);
float flexRatio = (1 - headRatio) / 2;
int headHeight = FlatUIUtils.getUIInt("Component.defaultHeight",24) * tabLayout.length / 2;
Component component = useFitTab ? row(flex(), cell(tabGroup), flex()).getComponent() : row(flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio)).getComponent();
int headHeight = FlatUIUtils.getUIInt("Component.defaultHeight", 24) * tabLayout.length / 2;
Component tabRow = useFitTab ? row(flex(), cell(tabGroup), flex()).getComponent() : row(flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio)).getComponent();
Component backgroundComp = createBackGroundComp();
add(
column(
cell(component),
flex()
cell(tabRow),
cell(centerPane).with(it -> it.setBorder(new ScaledEmptyBorder(10, 10, 10, 10))).weight(1)
),
column(
fix(headHeight),
cell(centerPane).with(it -> it.setBorder(new ScaledEmptyBorder(headHeight + 10, 10, 10, 10))).weight(1)
cell(backgroundComp).weight(1)
)
);
fillBackgroundColor();
}
private Component createBackGroundComp() {
JPanel pane = new JPanel();
pane.putClientProperty(PANEL_TYPE, ROUNDED_PANEL);
pane.setBackground(getFillColor());
return pane;
}
private void initCoreComponents() {
cards = new CardLayout();
centerPane = new JPanel(cards);
centerPane.putClientProperty(PANEL_TYPE, ROUNDED_PANEL);
tabComponents.forEach((key, value) -> {
value.setOpaque(false);
centerPane.add(value, key);
});
}
private Color getFillColor() {
return FineUIUtils.getUIColor("FineTabbedPane.background", "fill.gray");
}
private void fillBackgroundColor() {
Color fillColor = FineUIUtils.getUIColor("FineTabbedPane.background", "fill.gray");
Color defaultColor = FineUIUtils.getUIColor("default.background", "Component.background");
ColorUtils.syncBackgroundIfAbsent(centerPane, fillColor, defaultColor);
ColorUtils.syncBackgroundIfAbsent(centerPane, getFillColor(), defaultColor);
}
private void initListeners() {

7
designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java

@ -14,13 +14,12 @@ import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNameObserver {
private static final long serialVersionUID = -8681716725163358249L;
private static double DRAG_BAR_WEIGHT = 0.64;
private static double SPINNER_WIGHT = 0.36;
private static double DRAG_BAR_WEIGHT = 0.6;
private static double SPINNER_WIGHT = 0.4;
private UISlider dragBar;
private UISpinner spinner;
private boolean isEditing = false;
@ -49,7 +48,7 @@ public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNam
spinner.setValue(dragBar.getValue());
this.setLayout(new BorderLayout());
this.add(Layouts.row(
cell(dragBar).weight(DRAG_BAR_WEIGHT), fix(2), cell(spinner).weight(SPINNER_WIGHT)
cell(dragBar).weight(DRAG_BAR_WEIGHT), fix(8), cell(spinner).weight(SPINNER_WIGHT)
).getComponent());
dragBar.addChangeListener(e -> {
if (globalNameListener != null && shouldResponseNameListener()) {

11
designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java

@ -31,6 +31,10 @@ import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
public class UICheckListPopup extends UIPopupMenu {
private List<ActionListener> listeners = new ArrayList<ActionListener>();
private List<JCheckBox> checkBoxList = new ArrayList<JCheckBox>();
@ -120,15 +124,12 @@ public class UICheckListPopup extends UIPopupMenu {
}
private void addOneCheckValue(Object checkValue) {
JPanel checkPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
checkPane.setPreferredSize(FineUIScale.scale(new Dimension(144, CHECKBOX_HEIGHT)));
JPanel checkPane = new JPanel(new BorderLayout());
final JCheckBox temp = createCheckbox();
final UILabel label = new UILabel(checkValue.toString());
label.setBackground(Color.WHITE);
label.setPreferredSize(FineUIScale.scale(new Dimension(100, 20)));
checkPane.setBackground(Color.WHITE);
checkPane.add(temp);
checkPane.add(label);
checkPane.add(row(fix(4), cell(temp), cell(label)).getComponent());
if (labelNeedToolTips) {
// 设置每项Label的tooltips为其省略前的内容
label.setToolTipText(checkValue.toString());

135
designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java

@ -2,19 +2,20 @@ package com.fr.design.gui.icombocheckbox;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.HoverAware;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.StringUtils;
import javax.swing.Icon;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
@ -36,6 +37,11 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.fine.theme.utils.FineUIStyle.OFFET_LEFT_TEXT_FIELD;
import static com.fine.theme.utils.FineUIStyle.PLAIN_ARROW_BUTTON;
import static com.fine.theme.utils.FineUIStyle.TRANSPARENT_TEXT_FIELD;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/**
* 设计器下拉复选框组件
* 支持全选半选
@ -43,10 +49,10 @@ import java.util.Map;
* 可以省略显示
*
* @author
* @since
* Created on
* @since Created on
*/
public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNameObserver, HoverAware {
public class UIComboCheckBox extends JComboBox implements UIObserver, GlobalNameObserver, HoverAware {
private static final String UI_CLASS_ID = "ComboCheckBoxUI";
//下拉框的值
private Object[] values;
//已经选中的值
@ -55,8 +61,8 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
private List<ActionListener> listeners = new ArrayList<ActionListener>();
private UICheckListPopup popup;
private UITextField editor;
private final JPanel clickPane = new JPanel(new BorderLayout());
private UIButton arrowButton;
private UILabel label;
//选中的值之间显示的分隔符
private String valueSperator;
private static final String DEFAULT_VALUE_SPERATOR = ",";
@ -71,6 +77,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
private String placeHolder = StringUtils.EMPTY;
private boolean rollOver;
private boolean popupVisible = false;
public UIComboCheckBox(Object[] value) {
this(value, DEFAULT_VALUE_SPERATOR, true);
@ -123,19 +130,22 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
}
private void initComponent() {
this.popup = new UICheckListPopup(values, supportSelectAll);
this.popup = new UICheckListPopup(values, supportSelectAll) {
@Override
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
size.width = UIComboCheckBox.this.getWidth();
return size;
}
};
this.popup.setBorder(new FineRoundBorder());
this.popup.addActionListener(new PopupAction());
this.editor = createEditor();
this.arrowButton = createArrowButton();
this.label = new UILabel(getIcon());
label.setPreferredSize(FineUIScale.scale(new Dimension(24, 24)));
initClickPane();
setLayoutAndAddComponents();
setText();
addPopupListener(this);
setBackground(Color.WHITE);
setOpaque(true);
}
/**
@ -152,8 +162,8 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
return popup;
}
public UITextField getEditor() {
return editor;
public JPanel getClickPane() {
return clickPane;
}
public String getPlaceHolder() {
@ -164,31 +174,37 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
this.placeHolder = placeHolder;
}
public UIButton getArrowButton() {
return arrowButton;
}
private void initClickPane() {
editor = new TextField();
editor.setEditable(false);
setStyle(editor, OFFET_LEFT_TEXT_FIELD);
public UILabel getLabel() {
return label;
}
arrowButton = new UIButton(getIcon());
setStyle(arrowButton, PLAIN_ARROW_BUTTON);
private UIButton createArrowButton() {
final UIButton arrowBtn = new UIButton();
arrowBtn.setNormalPainted(false);
arrowBtn.setPreferredSize(FineUIScale.scale(new Dimension(20, 5)));
arrowBtn.setIcon(getIcon());
arrowBtn.setExtraPainted(false);
addPopupListener(arrowBtn);
clickPane.add(editor, BorderLayout.CENTER);
clickPane.add(arrowButton, BorderLayout.EAST);
return arrowBtn;
addPopupListener(editor);
addPopupListener(arrowButton);
addHoverStatusListener(editor);
addHoverStatusListener(arrowButton);
}
private UITextField createEditor() {
UITextField editor = new TextField();
editor.setEditable(false);
addPopupListener(editor);
protected void addHoverStatusListener(JComponent component) {
component.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
rollOver = true;
repaint();
}
return editor;
@Override
public void mouseExited(MouseEvent e) {
rollOver = popup.isVisible();
repaint();
}
});
}
/**
@ -202,18 +218,6 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
public void mouseClicked(MouseEvent e) {
togglePopup();
}
@Override
public void mouseEntered(MouseEvent e) {
rollOver = true;
repaint();
}
@Override
public void mouseExited(MouseEvent e) {
rollOver = false;
repaint();
}
});
}
@ -240,7 +244,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
@Override
public boolean isHovered() {
return rollOver || this.popup.isShowing();
return rollOver;
}
private class PopupAction implements ActionListener {
@ -258,10 +262,32 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
private void togglePopup() {
if (this.arrowButton.isEnabled()) {
popup.setBorder(new FineRoundBorder());
popup.setPreferredSize(new Dimension(getWidth(), this.popup.getPreferredSize().height));
popup.show(this, 0, getHeight());
if (popupVisible) {
hidePopup();
} else {
showPopup();
}
}
}
/**
* 展示 popup
*/
public void showPopup() {
this.popup.show(this, 0, getHeight());
arrowButton.setIcon(new LazyIcon("up_arrow"));
arrowButton.repaint();
popupVisible = true;
}
/**
* 隐藏 popup
*/
public void hidePopup() {
popup.setVisible(false);
arrowButton.setIcon(new LazyIcon("down_arrow"));
arrowButton.repaint();
popupVisible = false;
}
/**
@ -301,6 +327,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
/**
* 为为添加placeholder
*
* @param editor
*/
protected void setEditorPlaceHolder(UITextField editor) {
@ -335,7 +362,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
for (int i = 1; i <= chars.length; i++) {
//如果原文本+省略号长度超过文本框
if (fontMetrics.charsWidth(chars, 0, i) + omitLength > textEditor.getPreferredSize().getWidth()) {
if (fontMetrics.charsWidth(chars, 0, i) + omitLength > textEditor.getWidth()) {
//从第i-1的位置截断再拼上省略号
omitText = text.substring(0, i - 2) + OMIT_TEXT;
break;
@ -466,8 +493,14 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
}
}
@Override
public String getUIClassID() {
return UI_CLASS_ID;
}
/**
* 简单的测试demo
*
* @param args
*/
public static void main(String args[]) {

1
designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -86,6 +86,7 @@ public class UIEastResizableContainer extends JPanel {
@Override
public void mouseReleased(MouseEvent e) {
dragging = false;
updateCursor(e);
}
};

18
designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java

@ -1,29 +1,23 @@
package com.fr.design.mainframe.authority;
import com.fanruan.config.impl.data.ConnectionConfigProviderFactory;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.base.CloneCollector;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.log.FineLoggerFactory;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.authority.user.UserAuthority;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static javax.swing.JOptionPane.WARNING_MESSAGE;
@ -31,6 +25,7 @@ public class JTemplateAuthorityChecker {
JTemplate<?, ?> jTemplate;
Set<String> authConnectionNames;
Set<String> authDatasetNames;
Set<String> templateDatasetNames;
Map<String, ElementAuthorityChecker> checkerMap = new HashMap<>();
Set<String> authFailConnectionNames = new HashSet<>();
Set<String> authFailDatasetNames = new HashSet<>();
@ -45,7 +40,12 @@ public class JTemplateAuthorityChecker {
}
private void initAuthNames() {
// 无需获取所有数据集和数据连接了,当前只能获取自己有权限的
// 无需获取所有服务器数据集和数据连接了,因为当前只能获取自己有权限的,只要拿一下模板数据集就行
templateDatasetNames = new HashSet<>();
Iterator<String> tableDataNameIterator = jTemplate.getTarget().getTableDataNameIterator();
while (tableDataNameIterator.hasNext()) {
templateDatasetNames.add(tableDataNameIterator.next());
}
Map<String, Set<String>> authNamesMap = RemoteAuthorityRepository.getInstance().getAuthServerDataSetAndConnectionNames(WorkContext.getCurrent().getConnection().getUserName());
if (authNamesMap != null) {
//有权限的数据连接名称
@ -87,6 +87,8 @@ public class JTemplateAuthorityChecker {
}
}
}
// 排除模板数据集的部分
authFailDatasetNames.removeAll(templateDatasetNames);
FineLoggerFactory.getLogger().info("JTemplateAuthorityChecker check time consume:" + (System.currentTimeMillis() - s));
return authFailConnectionNames.size() == 0 && authFailDatasetNames.size() == 0;
}

7
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java

@ -4,6 +4,7 @@ import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.settings.ThemedChartStyle;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.theme.edit.chart.ChartAxisStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartDataSheetStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartLabelStylePane;
@ -11,7 +12,7 @@ import com.fr.design.mainframe.theme.edit.chart.ChartLegendStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartSeriesStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartTitleAndBackgroundStylePane;
import javax.swing.BorderFactory;
import java.awt.BorderLayout;
import java.util.ArrayList;
import java.util.List;
@ -34,7 +35,9 @@ public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
@Override
protected void initLayout() {
super.initLayout();
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
this.add(tabPane, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
}

21
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java

@ -2,21 +2,16 @@ package com.fr.design.mainframe.theme.edit.chart;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.FineUITable;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.GeneralUtils;
@ -24,12 +19,8 @@ import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Font;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author Bjorn
* @version 10.0
@ -70,11 +61,13 @@ public class ChartFontPane extends BasicPane {
}
protected void initComponents() {
Component[] components = new Component[]{
fontSizeComboBox, fontColor, italic, bold
};
UIToolbar toolbar = new UIToolbar();
toolbar.add(fontSizeComboBox);
toolbar.add(fontColor);
toolbar.add(italic);
toolbar.add(bold);
JPanel buttonPane = new JPanel(new BorderLayout());
buttonPane.add(row(4, cell(fontSizeComboBox), cell(fontColor), cell(italic), cell(bold)).getComponent());
buttonPane.add(toolbar);
this.setLayout(new BorderLayout());
this.add(getContentPane(buttonPane), BorderLayout.CENTER);

23
designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkAction.java

@ -1,7 +1,7 @@
package com.fr.design.remote.ui.debug;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.utils.gui.GUICoreUtils;
@ -10,6 +10,11 @@ import com.fr.workspace.WorkContext;
import javax.swing.JDialog;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import static com.fine.theme.utils.FineUIScale.createScaleDimension;
import static com.fine.theme.utils.FineUIScale.unscale;
/**
* 远程设计网络调试
@ -28,19 +33,29 @@ public class RemoteDesignNetWorkAction extends UpdateAction {
@Override
public void actionPerformed(ActionEvent e) {
if (WorkContext.getCurrent().isLocal()) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
"Remote Design NetWork can't show on local environment.");
return;
}
JDialog jDialog = new JDialog(DesignerContext.getDesignerFrame(), TITLE);
jDialog.setSize(calculatePaneDimension());
jDialog.add(new RemoteDesignNetWorkTablePane());
RemoteDesignNetWorkTablePane netWorkPane = new RemoteDesignNetWorkTablePane();
jDialog.add(netWorkPane);
jDialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
netWorkPane.clear();
super.windowClosing(e);
}
});
GUICoreUtils.centerWindow(jDialog);
jDialog.setVisible(true);
}
private static Dimension calculatePaneDimension() {
DesignerFrame parent = DesignerContext.getDesignerFrame();
return new Dimension((int) (FineUIScale.unscale(parent.getWidth()) * 0.8),
(int) (FineUIScale.unscale(parent.getHeight()) * 0.6));
return createScaleDimension((int) (unscale(parent.getWidth()) * 0.8),
(int) (unscale(parent.getHeight()) * 0.6));
}
}

78
designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkTablePane.java

@ -1,7 +1,9 @@
package com.fr.design.remote.ui.debug;
import com.fanruan.workplace.http.debug.RequestInfo;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
@ -10,6 +12,8 @@ import com.fr.workspace.WorkContext;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JToolBar;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
@ -34,14 +38,36 @@ public class RemoteDesignNetWorkTablePane extends JPanel {
private JTable uiTable;
private DefaultTableModel model;
private final Listener<RequestInfo> remoteDesignDebugListener = new Listener<RequestInfo>() {
@Override
public void on(Event event, RequestInfo requestInfo) {
model.addRow(new Object[]{
requestInfo.getStatus(),
dateFormat(requestInfo.getDate()),
requestInfo.getPath().substring(WorkContext.getCurrent().getPath().length() - 1),
requestInfo.getConsume() + "ms",
simpleSize(requestInfo.getRequestSize()),
simpleSize(requestInfo.getResponseSize()),
requestInfo.getSendBody(),
requestInfo.getReturnBody(),
});
adjustColumnWidths(uiTable);
}
};
public RemoteDesignNetWorkTablePane() {
setLayout(new BorderLayout());
setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
initComponent();
initListener();
addListener();
}
private void initComponent() {
initTable();
initToolBar();
}
private void initTable() {
model = new DefaultTableModel();
model.addColumn("status");
model.addColumn("time");
@ -55,23 +81,43 @@ public class RemoteDesignNetWorkTablePane extends JPanel {
add(new JScrollPane(uiTable), BorderLayout.CENTER);
}
private void initListener() {
EventDispatcher.listen(REMOTE_HTTP_REQUEST, new Listener<RequestInfo>() {
@Override
public void on(Event event, RequestInfo requestInfo) {
model.addRow(new Object[]{
requestInfo.getStatus(),
dateFormat(requestInfo.getDate()),
requestInfo.getPath().substring(WorkContext.getCurrent().getPath().length() - 1),
requestInfo.getConsume() + "ms",
simpleSize(requestInfo.getRequestSize()),
simpleSize(requestInfo.getResponseSize()),
requestInfo.getSendBody(),
requestInfo.getReturnBody(),
private void initToolBar() {
JToolBar jToolBar = new JToolBar();
jToolBar.setBorder(new EmptyBorder(5, 0, 10, 0));
UIButton run = new UIButton(new LazyIcon("run"));
UIButton forbid = new UIButton(new LazyIcon("forbid"));
UIButton refresh = new UIButton(new LazyIcon("remove"));
run.setEnabled(false);
run.setToolTipText("Start Record");
run.addActionListener(e -> {
addListener();
run.setEnabled(false);
forbid.setEnabled(true);
});
adjustColumnWidths(uiTable);
}
forbid.setToolTipText("Stop Record");
forbid.addActionListener(e -> {
EventDispatcher.stopListen(remoteDesignDebugListener);
run.setEnabled(true);
forbid.setEnabled(false);
});
refresh.setToolTipText("Clear Records");
refresh.addActionListener(e -> model.setRowCount(0));
jToolBar.add(run);
jToolBar.add(forbid);
jToolBar.add(refresh);
add(jToolBar, BorderLayout.NORTH);
}
/**
* 清理监听
*/
public void clear() {
EventDispatcher.stopListen(remoteDesignDebugListener);
}
private void addListener() {
EventDispatcher.listen(REMOTE_HTTP_REQUEST, remoteDesignDebugListener);
}
private static void adjustColumnWidths(JTable table) {

10
designer-base/src/main/java/com/fr/design/style/FRFontPane.java

@ -217,6 +217,16 @@ public class FRFontPane extends BasicPane {
updatePreviewLabel();
}
};
ItemListener updatePreviewItemListener = new ItemListener() {
public void itemStateChanged(ItemEvent e) {
updatePreviewLabel();
}
};
this.fontNameComboBox.addItemListener(updatePreviewItemListener);
this.fontSizeStylePane.fontComboBox.addItemListener(updatePreviewItemListener);
this.fontSizeStylePane.fontSizeComboBox.addItemListener(updatePreviewItemListener);
this.isStrikethroughCheckBox.addActionListener(updatePreviewActionListener);
this.isShadowCheckBox.addActionListener(updatePreviewActionListener);
this.isSuperscriptCheckBox.addActionListener(updatePreviewActionListener);

9
designer-base/src/main/java/com/fr/design/utils/ColorUtils.java

@ -7,6 +7,8 @@ import javax.swing.JScrollPane;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.event.ContainerAdapter;
import java.awt.event.ContainerEvent;
import java.util.Arrays;
/**
@ -53,6 +55,13 @@ public class ColorUtils {
if (components != null) {
Arrays.stream(components).forEach((e) -> syncBackgroundIfAbsent(e, replaceColor, defaultColor));
}
container.addContainerListener(new ContainerAdapter() {
@Override
public void componentAdded(ContainerEvent e) {
Component addedComponent = e.getChild();
syncBackgroundIfAbsent(addedComponent, replaceColor, defaultColor);
}
});
}
}

26
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -1,11 +1,12 @@
package com.fr.design.web;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.Icon;
import com.fr.base.IconManager;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
@ -90,7 +91,7 @@ public class CustomIconPane extends BasicPane {
UILabel iconLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon"));
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel noNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
noNamePane.setBorder(new FineRoundBorder());
noNamePane.setBorder(FineBorderFactory.createWrappedRoundBorder());
noNamePane.setBackground(Color.WHITE);
iconPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
@ -419,7 +420,8 @@ public class CustomIconPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon"));
browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button"));
nameTextField = new UITextField(20);
nameTextField = new UITextField();
nameTextField.setPreferredSize(FineUIScale.createScaleDimension(172, 24));
browseButton.addActionListener(e -> onBrowseButtonClicked(SwingUtilities.getWindowAncestor(EditIconDialog.this)));
@ -443,18 +445,16 @@ public class CustomIconPane extends BasicPane {
});
showImageLabel = new UILabel();
showImageLabel.setPreferredSize(FineUIScale.scale(new Dimension(50, 50)));
showImageLabel.setPreferredSize(FineUIScale.createScaleDimension(50, 50));
JPanel centerPane = column(10,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")).weight(1.2),
cell(nameTextField).weight(3)
JPanel centerPane = column(LayoutConstants.VERTICAL_GAP,
row(40,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")),
cell(nameTextField)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":")).weight(1.2),
row(
cell(showImageLabel), column(fix(13), cell(browseButton), fix(13)).weight(1)
).weight(3)
row(40,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":")),
row(cell(showImageLabel), column(fix(13), cell(browseButton), fix(13)).weight(1)).weight(1)
)
).getComponent();
this.add(centerPane, BorderLayout.WEST);

1
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties

@ -5,6 +5,7 @@ CheckBoxUI=com.fine.theme.light.ui.FineCheckBoxUI
CheckBoxMenuItemUI=com.formdev.flatlaf.ui.FlatCheckBoxMenuItemUI
ColorChooserUI=com.formdev.flatlaf.ui.FlatColorChooserUI
ComboBoxUI=com.fine.theme.light.ui.FineComboBoxUI
ComboCheckBoxUI=com.fine.theme.light.ui.FineComboCheckBoxUI
DesktopIconUI=com.formdev.flatlaf.ui.FlatDesktopIconUI
DesktopPaneUI=com.formdev.flatlaf.ui.FlatDesktopPaneUI
CalendarPaneUI=com.fine.theme.light.ui.FineCalendarPaneUI

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

@ -325,6 +325,10 @@ ComboBox.comboHeight = 24
ComboBox.selectBox.button.height = 22
ComboBox.renderInset = 0,6,0,6
#---- ComboCheckBox ----
ComboCheckBox.background = $fill.normal
ComboCheckBox.border = com.fine.theme.light.ui.FineRoundBorder
#---- Component ----
Component.focusWidth = 0
@ -1277,6 +1281,15 @@ chart.selectedBorderColor = #2576EF
borderWidth : 0; \
disabledBackground : fade($Button.background,0%);
[style]Button.plainArrowButton=\
background : fade($Button.background,0%); \
margin: 4,4,4,4; \
borderWidth : 0; \
disabledBackground : fade($Button.background,0%); \
hoverBackground : null; \
selectedBackground : null; \
pressedBackground : null
[style]CombinationButton.primary = \
background : @BrandColor; \
arc : 3
@ -1329,6 +1342,11 @@ chart.selectedBorderColor = #2576EF
[style]TextField.transparentTextField=\
background: fade(@background, 0%); \
border: null;
[style]TextField.offsetLeftText=\
background: fade(@background, 0%); \
border: 0,6,0,0;
[style]PopupMenu.dropdownPopupMenu=\
background: fade(@background, 0%); \
borderInsets: 0,0,0,0;
@ -1411,7 +1429,7 @@ chart.selectedBorderColor = #2576EF
[style]Button.originalButton = \
borderColor: null; \
background: $fill.normal; \
background: null; \
hoverBorderColor: null;
[style]Button.grayButton = \
@ -1428,3 +1446,6 @@ chart.selectedBorderColor = #2576EF
[style]Label.widgetEventLabel = \
foreground: $List.wrapper.text.fontColor; \
background: $fill.normal;
[style]Label.hyperLinkLabel = \
foreground: $brand.normal;

119
designer-base/src/main/resources/com/fr/design/data/tabledata/datacenter/web/data-choose.main.js

File diff suppressed because one or more lines are too long

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -38,6 +38,6 @@ com.fr.design.actions.reportWebAttr.dialog=800*630
com.fr.design.actions.printingSetting.dialog=700*600
com.fr.design.data.datapane.preview.dialog=700*600
com.fr.design.data.tabledata.dialog=1200*600
com.fr.design.dscolumn.SpecifiedGroupAttrPane=900*600

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -37,6 +37,6 @@ com.fr.design.actions.reportWebAttr.dialog=700*630
com.fr.design.actions.printingSetting.dialog=700*600
com.fr.design.data.datapane.preview.dialog=700*600
com.fr.design.data.tabledata.dialog=900*600
com.fr.design.dscolumn.SpecifiedGroupAttrPane=800*600

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -37,6 +37,6 @@ com.fr.design.actions.reportWebAttr.dialog=700*630
com.fr.design.actions.printingSetting.dialog=700*600
com.fr.design.data.datapane.preview.dialog=700*600
com.fr.design.data.tabledata.dialog=900*600
com.fr.design.dscolumn.SpecifiedGroupAttrPane=760*600

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -37,6 +37,7 @@ com.fr.design.actions.reportWebAttr.dialog=660*600
com.fr.design.actions.printingSetting.dialog=660*600
com.fr.design.data.datapane.preview.dialog=660*600
com.fr.design.data.tabledata.dialog=900*600
com.fr.design.dscolumn.SpecifiedGroupAttrPane=760*600

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -36,6 +36,6 @@ com.fr.design.actions.reportWebAttr.dialog=700*630
com.fr.design.actions.printingSetting.dialog=700*600
com.fr.design.data.datapane.preview.dialog=700*600
com.fr.design.data.tabledata.dialog=900*600
com.fr.design.dscolumn.SpecifiedGroupAttrPane=760*600

46
designer-base/src/test/java/com/fr/design/gui/storybook/components/ComboCheckBoxStoryBoard.java

@ -0,0 +1,46 @@
package com.fr.design.gui.storybook.components;
import com.fr.design.gui.icombocheckbox.UIComboCheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.storybook.StoryBoard;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.ArrayUtils;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
public class ComboCheckBoxStoryBoard extends StoryBoard {
public ComboCheckBoxStoryBoard() {
super("下拉多选框");
add(
cell(new UILabel("普通状态")).with(this::h3),
cell(getComboCheckBox(ArrayUtils.toArray("测试1", "测试2", "测试3", "测试4"))),
cell(new UILabel("长文字状态")).with(this::h3),
cell(getComboCheckBox(ArrayUtils.toArray("测试长文字1测试长文字1测试长文字1测试长文字1测试长文字1测试长文字1测试长文字1",
"测试长文字2测试长文字2测试长文字2测试长文字2测试长文字2测试长文字2测试长文字2",
"测试长文字3测试长文字3测试长文字3测试长文字3测试长文字3测试长文字3测试长文字3",
"测试长文字4测试长文字4测试长文字4测试长文字4测试长文字4测试长文字4测试长文字4"))),
flex()
);
}
private UIComboCheckBox getComboCheckBox(Object[] array) {
return new UIComboCheckBox(array, true) {
protected void setLayoutAndAddComponents() {
// 使用BorderLayout,否则默认使用的FlowLayout会让整个下拉选框使用最小Size,然后TableCell这边会出现空白
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel pane = getClickPane();
pane.setOpaque(false);
this.add(pane, BorderLayout.CENTER);
}
};
}
}

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java

@ -10,6 +10,7 @@ import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
@ -203,7 +204,11 @@ public class ChartTextAttrPane extends BasicPane {
protected void initComponents() {
JPanel buttonPane = new JPanel(new BorderLayout(scale(10), 0));
buttonPane.add(fontSizeComboBox, BorderLayout.CENTER);
buttonPane.add(FineLayoutBuilder.createHorizontalLayout(10, fontColor, italic, bold), BorderLayout.EAST);
UIToolbar toolbar = new UIToolbar();
toolbar.add(fontColor);
toolbar.add(italic);
toolbar.add(bold);
buttonPane.add(toolbar, BorderLayout.EAST);
this.setLayout(new BorderLayout());
this.add(getContentPane(buttonPane), BorderLayout.CENTER);

9
designer-chart/src/main/java/com/fr/van/chart/designer/AbstractVanChartScrollPane.java

@ -1,12 +1,9 @@
package com.fr.van.chart.designer;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.dialog.BasicScrollPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.Window;
/**
* Created by mengao on 2017/8/11.
@ -24,13 +21,11 @@ public abstract class AbstractVanChartScrollPane<T> extends BasicScrollPane<T> {
}
/**
* getHeight与最外层ChartPropertyPane获取的高度一致都是计算的面板高度而不是到设计器底部的高度
* 这里直接获取设计器高度减去单元格元素北区最大高度(格式TextFormatPaneContainer高度不固定)先让滚动效果显示起来
* 获取可视窗口高度
* @return height
*/
@Override
protected int getMaxHeight() {
Window window = SwingUtilities.getWindowAncestor(this);
return window.getHeight() - FineUIScale.scale(400);
return getVisibleRect().height;
}
}

12
designer-realize/src/main/java/com/fr/design/condition/BackPane.java

@ -23,6 +23,7 @@ import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX;
import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE;
import static com.fine.theme.utils.FineUIScale.scale;
/**
* @author richie
@ -36,9 +37,9 @@ public class BackPane extends ConditionAttrSingleConditionPane<HighlightAction>
public BackPane(final ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
backgroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background") + ":");
backgroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background"));
this.backgroundPreviewPane = new BackgroundPreviewLabel();
this.backgroundPreviewPane.setPreferredSize(FineUIScale.scale(new Dimension(80, 20)));
this.backgroundPreviewPane.setPreferredSize(new Dimension(scale(100), backgroundPreviewPane.getPreferredSize().height));
UIButton editBackgroundButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
editBackgroundButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -62,12 +63,11 @@ public class BackPane extends ConditionAttrSingleConditionPane<HighlightAction>
this.backScopeComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
this.backgroundPreviewPane.setBackgroundObject(ColorBackground.getInstance(Color.WHITE));
this.add(row(10, cell(backgroundLabel).weight(0.2), row(
10,
this.add(row(4, cell(backgroundLabel),
cell(backgroundPreviewPane),
cell(editBackgroundButton),
cell(backScopeComboBox)).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
cell(backScopeComboBox)
).getComponent(), BorderLayout.CENTER);
}
@Override

7
designer-realize/src/main/java/com/fr/design/condition/BorderHighlightPane.java

@ -79,10 +79,9 @@ public class BorderHighlightPane extends ConditionAttrSingleConditionPane<Highli
UILabel borderLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Border"));
this.add(row(10, cell(borderLabel).weight(0.2), row(
10,
cell(borderButton)).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
this.add(row(4, cell(borderLabel),
cell(borderButton)
).getComponent(), BorderLayout.CENTER);
}
@Override

10
designer-realize/src/main/java/com/fr/design/condition/FontPane.java

@ -37,10 +37,9 @@ public class FontPane extends ConditionAttrSingleConditionPane<HighlightAction>
public FontPane(final ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
fontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sytle_FRFont") + ":");
fontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sytle_FRFont"));
frFontPreviewPane = new FRFontPreviewArea();
frFontPreviewPane.setBorder(BorderFactory.createTitledBorder(""));
frFontPreviewPane.setPreferredSize(FineUIScale.scale(new Dimension(80, 20)));
UIButton editFRFontButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
editFRFontButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -66,12 +65,11 @@ public class FontPane extends ConditionAttrSingleConditionPane<HighlightAction>
this.fontScopeComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
this.frFontPreviewPane.setFontObject(DesignUtils.getDefaultGUIFont());
this.add(row(10, cell(fontLabel).weight(0.2), row(
10,
this.add(row(4, cell(fontLabel),
cell(frFontPreviewPane),
cell(editFRFontButton),
cell(fontScopeComboBox)).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
cell(fontScopeComboBox)
).getComponent(), BorderLayout.CENTER);
}
@Override

9
designer-realize/src/main/java/com/fr/design/condition/ForeGroundPane.java

@ -29,7 +29,7 @@ public class ForeGroundPane extends ConditionAttrSingleConditionPane<HighlightAc
public ForeGroundPane(ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
foregroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground") + ":");
foregroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"));
this.foregroundColorPane = new ColorSelectBox(80);
foregroundColorPane.setPreferredSize(new Dimension(FineUIScale.scale(100), foregroundColorPane.getHeight()));
this.foreScopeComboBox = new UIComboBox(new String[] {
@ -39,11 +39,10 @@ public class ForeGroundPane extends ConditionAttrSingleConditionPane<HighlightAc
this.foreScopeComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
this.foregroundColorPane.setSelectObject(Color.black);
this.add(row(10, cell(foregroundLabel).weight(0.2), row(
10,
this.add(row(4, cell(foregroundLabel),
cell(foregroundColorPane),
cell(foreScopeComboBox)).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
cell(foreScopeComboBox)
).getComponent(), BorderLayout.CENTER);
}
@Override

9
designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java

@ -61,19 +61,18 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane<HighlightAct
}
});
hyperlinkButton.setEnabled(false);
UILabel hyperlinkLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Hyperlink_Type") + ":");
UILabel hyperlinkLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Hyperlink_Type"));
typeField = new UITextField(12);
typeField.setEditable(false);
useHyperlink = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_Links"));
useHyperlink.addActionListener(l);
this.add(row(10, cell(hyperlinkLabel).weight(0.2), row(
10,
this.add(row(4, cell(hyperlinkLabel),
cell(typeField),
cell(hyperlinkButton),
cell(useHyperlink)).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
cell(useHyperlink)
).getComponent(), BorderLayout.CENTER);
}
@Override

9
designer-realize/src/main/java/com/fr/design/condition/NewRealValuePane.java

@ -23,13 +23,12 @@ public class NewRealValuePane extends ConditionAttrSingleConditionPane<Highlight
public NewRealValuePane(ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Value") + ":");
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Value"));
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
this.add(row(10, cell(label).weight(0.2), row(
10,
cell(valueEditor)).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
this.add(row(10, cell(label),
cell(valueEditor)
).getComponent(), BorderLayout.CENTER);
}
@Override

11
designer-realize/src/main/java/com/fr/design/condition/PaddingPane.java

@ -42,10 +42,10 @@ public class PaddingPane extends ConditionAttrSingleConditionPane<HighlightActio
public PaddingPane(ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
paddingLeft = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Style_Left_Indent") + ":");
paddingLeft = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Style_Left_Indent"));
paddingLeftSpinner = new UIBasicSpinner(new SpinnerNumberModel(2, 0, Integer.MAX_VALUE, 1));
GUICoreUtils.setColumnForSpinner(paddingLeftSpinner, 5);
paddingRight = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Style_Right_Indent") + ":");
paddingRight = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Style_Right_Indent"));
paddingRightSpinner = new UIBasicSpinner(new SpinnerNumberModel(2, 0, Integer.MAX_VALUE, 1));
GUICoreUtils.setColumnForSpinner(paddingRightSpinner, 5);
this.paddingScopeComboBox = new UIComboBox(new String[] {
@ -71,13 +71,10 @@ public class PaddingPane extends ConditionAttrSingleConditionPane<HighlightActio
refreshIndentationUnit();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sytle_Indentation"));
this.add(row(10, column(5, cell(label).weight(0.5), flex(0.5)).weight(0.2)
.with(it -> it.setPreferredSize(new Dimension(-1, FineUIScale.scale(53)))), row(
10,
this.add(row(4, column(4, cell(label).weight(0.5), flex(0.5)),
column(5, cell(paddingLeftSpinner).weight(0.5),cell(paddingLeft).weight(0.5)),
column(5, cell(paddingRightSpinner).weight(0.5),cell(paddingRight).weight(0.5)),
column(5, cell(paddingScopeComboBox).weight(0.5), flex(0.5))).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent());
column(5, cell(paddingScopeComboBox).weight(0.5), flex(0.5))).getComponent());
}
/**

9
designer-realize/src/main/java/com/fr/design/condition/PagePane.java

@ -25,7 +25,7 @@ public class PagePane extends ConditionAttrSingleConditionPane<HighlightAction>
public PagePane(ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
pageLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Pagination") + ":");
pageLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Pagination"));
this.pageComboBox = new UIComboBox(new String[] {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_No_Pagination"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cell_Write_Page_After_Row"),
@ -35,10 +35,9 @@ public class PagePane extends ConditionAttrSingleConditionPane<HighlightAction>
this.pageComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
this.pageComboBox.setSelectedIndex(0);
this.add(row(10, cell(pageLabel).weight(0.2), row(
10,
cell(pageComboBox)).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
this.add(row(4, cell(pageLabel),
cell(pageComboBox)
).getComponent(), BorderLayout.CENTER);
}
@Override

9
designer-realize/src/main/java/com/fr/design/condition/PresentHighlightPane.java

@ -40,7 +40,7 @@ public class PresentHighlightPane extends ConditionAttrSingleConditionPane<Highl
public PresentHighlightPane(final ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Present") + ":");
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Present"));
String[] typeArray = {PresentConstants.NORMAL, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other_Present")};
presentComboBox = new UIComboBox(typeArray);
@ -92,11 +92,10 @@ public class PresentHighlightPane extends ConditionAttrSingleConditionPane<Highl
});
presentComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
this.add(row(10, cell(label).weight(0.2), row(
10,
this.add(row(4, cell(label),
cell(presentComboBox),
cell(type)).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
cell(type)
).getComponent(), BorderLayout.CENTER);
}
@Override

9
designer-realize/src/main/java/com/fr/design/condition/WHPane.java

@ -31,18 +31,17 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
protected WHPane(ConditionAttributesPane conditionAttributesPane, String locString) {
super(conditionAttributesPane);
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText(locString) + ":");
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText(locString));
spinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0,Integer.MAX_VALUE, 1));
this.unitLabel = new UILabel(getUnitString());
GUICoreUtils.setColumnForSpinner(spinner, 5);
this.spinner.setValue(new Integer(0));
this.locString = locString;
this.add(row(10, cell(label).weight(0.2), row(
10,
this.add(row(4, cell(label),
cell(spinner),
cell(unitLabel)).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
cell(unitLabel)
).getComponent(), BorderLayout.CENTER);
}
@Override

9
designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java

@ -63,7 +63,7 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane<Highli
}
});
UILabel widgetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget") + ":");
UILabel widgetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget"));
String[] editorTypes = new String[] {
"",
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"),
@ -100,12 +100,11 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane<Highli
});
this.add(row(10, cell(widgetLabel).weight(0.2), row(
10,
this.add(row(4, cell(widgetLabel),
cell(box),
cell(widgetButton),
cell(useWidget)).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
cell(useWidget)
).getComponent(), BorderLayout.CENTER);
}
@Override

18
designer-realize/src/main/java/com/fr/design/dscolumn/SpecifiedGroupAttrPane.java

@ -1,5 +1,6 @@
package com.fr.design.dscolumn;
import com.fine.swing.ui.layout.Row;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.BaseFormula;
@ -20,7 +21,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.NameObject;
import com.fr.report.cell.CellElement;
@ -30,8 +30,12 @@ import com.fr.report.cell.cellattr.core.group.FunctionGrouper;
import com.fr.report.cell.cellattr.core.group.RecordGrouper;
import com.fr.stable.Nameable;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
@ -121,19 +125,17 @@ public class SpecifiedGroupAttrPane extends BasicPane {
conditionsGroupPane.add(specifiedControlPane, BorderLayout.CENTER);
JPanel southPane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
conditionsGroupPane.add(southPane, BorderLayout.SOUTH);
forceCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_SpecifiedG-Force_Group"));
moreCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_One_Record_Exists_In_Many_Groups"));
southPane.add(forceCheckBox); southPane.add(moreCheckBox);
otherComboBox = new UIComboBox(new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_SpecifiedG-Discard_All_Others"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_SpecifiedG_Leave_In_Their_Own_Groups"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_SpecifiedG_Put_All_Others_Together")});
otherComboBox.addItemListener(otherItemListener);
otherComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OtherGroup_Name") + ":");
otherTextField = new UITextField(8);
southPane.add(otherComboBox);
southPane.add(GUICoreUtils.createFlowPane(new Component[]{label, otherTextField}, FlowLayout.LEFT));
Row southPane = FineLayoutBuilder.createHorizontalLayout(10, forceCheckBox, moreCheckBox, otherComboBox, label, otherTextField);
conditionsGroupPane.add(southPane, BorderLayout.SOUTH);
// 公式分组
formulaGroupPane = new FormulaGroupPane();

2
designer-realize/src/main/java/com/fr/design/mainframe/AbstractAttrPane.java

@ -15,7 +15,7 @@ import java.awt.event.MouseWheelListener;
* 几点子类不需要写构造函数了所有的组件都放在createContentPane()方法生成的pane里面,它不需要考虑border
*/
public abstract class AbstractAttrPane extends AbstractAttrNoScrollPane {
private static final int MAXVALUE = FineUIScale.scale(100);
private static final int MAXVALUE = 100;
private static final int TITLE_HEIGHT = FineUIScale.scale(50);
private static final int MOUSE_WHEEL_SPEED = 5;
private int maxHeight = FineUIScale.scale(280);

7
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java

@ -292,12 +292,7 @@ public class DesensitizationCellPane extends BasicBeanPane {
protected void setLayoutAndAddComponents() {
// 使用BorderLayout,否则默认使用的FlowLayout会让整个下拉选框使用最小Size,然后TableCell这边会出现空白
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UITextField editor = getEditor();
UIButton arrowButton = getArrowButton();
setStyle(editor, TRANSPARENT_TEXT_FIELD);
setStyle(arrowButton, PLAIN_BUTTON);
this.add(editor, BorderLayout.CENTER);
this.add(arrowButton, BorderLayout.EAST);
this.add(getClickPane(), BorderLayout.CENTER);
}
@Override

3
designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

@ -2,6 +2,7 @@ package com.fr.design.report;
import com.fanruan.cloud.FanruanCloud;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.FineJOptionPane;
@ -221,7 +222,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
UILabel downExplainLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Report_Detail_Reference"));
downExplainLabel.setForeground(new Color(0, 0, 0));
JLabel helper = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Community_Help"));
helper.setForeground(new Color(1, 159, 222));
FineUIStyle.setStyle(helper, FineUIStyle.HYPER_LINK_LABEL);
helper.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {

2
designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java

@ -27,7 +27,7 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane<FT> {
protected boolean isEnalbed;
protected void initComponent() {
Dimension size = FineUIScale.createScaleDimension(50, 21);
Dimension size = FineUIScale.createScaleDimension(58, 21);
if (start instanceof UISpinner) {
start.setPreferredSize(size);
((UISpinner) start).addChangeListener(new ChangeListener() {

17
designer-realize/src/main/java/com/fr/design/widget/ui/UserEditorDefinePane.java

@ -1,13 +1,12 @@
package com.fr.design.widget.ui;
import com.fr.design.gui.ilable.UILabel;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.form.ui.NameWidget;
import javax.swing.SwingConstants;
import javax.swing.JTextArea;
import java.awt.BorderLayout;
import java.awt.Font;
public class UserEditorDefinePane extends AbstractDataModify<NameWidget> {
private NameWidget nWidget;
@ -18,13 +17,9 @@ public class UserEditorDefinePane extends AbstractDataModify<NameWidget> {
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel infoLabel = new UILabel();
infoLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(24).applyStyle(Font.BOLD));
infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText(
"Fine-Design_Report_Widget_User_Defined_Editor") + ".");
infoLabel.setHorizontalAlignment(SwingConstants.CENTER);
this.add(infoLabel, BorderLayout.CENTER);
JTextArea label = FineUIUtils.createAutoWrapTipLabel(Toolkit.i18nText(
"Fine-Design_Report_Widget_User_Defined_Editor"));
this.add(label, BorderLayout.CENTER);
}
@Override

4
designer-realize/src/main/java/com/fr/design/widget/ui/WritableRepeatEditorPane.java

@ -5,8 +5,6 @@ import com.fr.form.ui.WriteAbleRepeatEditor;
import javax.swing.JPanel;
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;
public abstract class WritableRepeatEditorPane<E extends WriteAbleRepeatEditor> extends DirectWriteEditorDefinePane<E> {
@ -21,7 +19,7 @@ public abstract class WritableRepeatEditorPane<E extends WriteAbleRepeatEditor>
JPanel contentPane = column(LayoutConstants.VERTICAL_GAP).getComponent();
JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) {
contentPane.add(row(cell(otherContentPane).weight(1.0)).getComponent());
contentPane.add(otherContentPane);
}
return contentPane;
}

10
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java

@ -1,12 +1,11 @@
package com.fr.quickeditor.cellquick;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.BiasCellAction;
import com.fr.design.cell.editor.BiasTextPainterCellEditor.BiasTextPainterPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
@ -16,7 +15,6 @@ import com.fr.report.cell.painter.BiasTextPainter;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -39,11 +37,7 @@ public class CellBiasTextPainterEditor extends CellQuickEditor {
}
});
editButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{EMPTY_LABEL, editButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
return FineLayoutBuilder.asBorderLayoutWrapped(editButton);
}
@Override

10
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java

@ -1,5 +1,6 @@
package com.fr.quickeditor.cellquick;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.SubReportCellAction;
import com.fr.design.constants.UIConstants;
@ -10,9 +11,6 @@ import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 单元格元素子报表编辑器
*
@ -31,11 +29,7 @@ public class CellSubReportEditor extends CellQuickEditor {
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
subReportButton = new UIButton();
content.add(row(
cell(EMPTY_LABEL).weight(1.2),
cell(subReportButton).weight(3)
).getComponent());
return content;
return FineLayoutBuilder.asBorderLayoutWrapped(subReportButton);
}
@Override

Loading…
Cancel
Save