Browse Source

Merge pull request #14926 in DESIGN/design from fbp/release to fbp/feature

* commit '34a601f5ce193c6e3686f8ff15d0365f30a85c54':
  REPORT-135549 【fr-fbp回归】远程连接失败
  REPORT-135453 fix:fbp回归问题修复
  REPORT-133897 fix:TabPane垂直布局调整
  REPORT-135889 fix:NewUI自查问题修复
fbp/feature
superman 2 months ago
parent
commit
1619c02706
  1. 1
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  2. 4
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  3. 8
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java
  4. 25
      designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java
  5. 6
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  6. 28
      designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java
  7. 7
      designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java
  8. 9
      designer-base/src/main/java/com/fr/design/utils/ColorUtils.java
  9. 4
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  10. 3
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  11. 3
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java
  12. 10
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java
  13. 10
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java

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

@ -54,6 +54,7 @@ public interface FineUIStyle {
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);
}

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) {

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;
}
}

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()) {

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);
}
});
}
}

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

@ -1,11 +1,11 @@
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.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
@ -90,7 +90,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();

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

@ -1427,3 +1427,6 @@ chart.selectedBorderColor = #2576EF
[style]Label.widgetEventLabel = \
foreground: $List.wrapper.text.fontColor; \
background: $fill.normal;
[style]Label.hyperLinkLabel = \
foreground: $brand.normal;

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) {

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