Browse Source

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

fbp/master
renekton 1 month ago
parent
commit
ba7f8d5b00
  1. 1
      build.gradle
  2. 2
      designer-base/src/main/java/com/fine/theme/light/ui/FineComboBoxUI.java
  3. 10
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java
  4. 5
      designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java
  5. 2
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  6. 8
      designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java
  7. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  8. 4
      designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java
  9. 14
      designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java
  10. 1
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  11. 40
      designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java
  12. BIN
      designer-chart/src/main/resources/com/fr/design/images/background/null_background.png
  13. 105
      designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java
  14. 5
      designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java
  15. 18
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignReportBaseComponent.java

1
build.gradle

@ -110,6 +110,7 @@ allprojects {
implementation 'com.fr.datasource:fine-datasource-core:' + fdlVersion
implementation 'com.fr.datasource:fine-datasource-web:' + fdlVersion
implementation 'com.fr.decision:decision-i18n:' + frVersion
implementation 'com.fr.decision:decision-report:' + frVersion
implementation 'com.fr.report:engine-report:' + frDevVersion
implementation 'com.fr.report:engine-x:' + frDevVersion
implementation 'com.fr.report:engine-chart:' + frDevVersion

2
designer-base/src/main/java/com/fine/theme/light/ui/FineComboBoxUI.java

@ -88,7 +88,7 @@ public class FineComboBoxUI extends FlatComboBoxUI {
// 限制最大宽度,如超出则高度预留展示横向滚动条所需宽度
int comboWidth = comboBox.getWidth();
if (fitRectangle.width > comboWidth) {
return new Rectangle(px, py, comboWidth, fitRectangle.height + FlatUIUtils.getUIInt("ScrollBar.width", 10));
return new Rectangle(px, py, comboWidth, fitRectangle.height + FineUIUtils.getAndScaleInt("ScrollBar.width", 10));
}
return fitRectangle;
}

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

@ -2,7 +2,6 @@ package com.fr.design.data.datapane.preview.desensitization.view.setting;
import com.fr.data.desensitize.base.DesensitizationTableData;
import com.fr.data.desensitize.base.TableDataDesensitizationItem;
import com.fr.data.desensitize.rule.DesensitizationRuleManager;
import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager;
@ -12,8 +11,11 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
@ -89,7 +91,7 @@ public class TableDataDesensitizationTablePane extends JPanel {
// 获取当前所有用户组
roleMap.putAll(RemoteAuthorityRepository.getInstance().getAllRoles4Desensitization());
// 获取当前最新的所有规则
latestRules.putAll(DesensitizationRuleManager.getInstance().getAllRules());
latestRules.putAll(RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap());
return null;
}

5
designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane.sqlpane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.TableProcedure;
import com.fr.design.actions.UpdateAction;
@ -10,7 +11,6 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.Icon;
import javax.swing.JPopupMenu;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
@ -57,8 +57,7 @@ public class SQLEditPane extends RSyntaxTextArea {
if (requestDroptarget) {
new SQLPaneDropTarget(this);
}
setBorder(null);
setBorder(new ScaledEmptyBorder(2, 2, 2, 2));
}

2
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -315,7 +315,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
// text
initFormulaTextArea();
UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea);
formulaTextArea.setBorder(null);
formulaTextArea.setBorder(new ScaledEmptyBorder(2, 2, 2, 2));
formulaTextAreaScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
// buttonPane

8
designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java

@ -212,10 +212,10 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
}
/**
* 刷新 NameableCreator
*
* @param creators 生成器
*/
* 刷新 NameableCreator
*
* @param creators 生成器
*/
public void refreshNameableCreator(NameableCreator[] creators) {
this.creators = creators;
shorts = this.createShortcuts();

4
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -243,8 +243,8 @@ public abstract class UIControlPane extends JControlPane {
}
/**
* 是否需要隐藏popupEditDialog
*/
* 是否需要隐藏popupEditDialog
*/
protected boolean needToHidePopupEditDialog() {
// 检查是否有子弹窗,如果有,则不隐藏
for (Window window : popupEditDialog.getOwnedWindows()) {

4
designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java

@ -45,7 +45,7 @@ public class MobilePopupRegularPane extends BasicPane {
spinnerGroupPane = this.createSpinnerPane();
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(this.createRadioButtonGroupPane()),
row(flex(1), cell(spinnerGroupPane).weight(3))
row(flex(1.5), cell(spinnerGroupPane).weight(3))
).getComponent());
}
@ -62,7 +62,7 @@ public class MobilePopupRegularPane extends BasicPane {
radioButtons.add(autoRadio);
radiosPane.add(row(30, cell(customRadio), cell(autoRadio), flex()).getComponent());
return row(cell(new UILabel(this.label, FineUIStyle.LABEL_SECONDARY)).weight(1), cell(radiosPane).weight(3)).getComponent();
return row(cell(new UILabel(this.label, FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(radiosPane).weight(3)).getComponent();
}
private ActionListener radioActionListener = new ActionListener() {

14
designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java

@ -83,9 +83,9 @@ public class StyleSettingPane extends BasicBeanPane<MobilePopupHyperlink> {
UILabel borderLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Border"));
borderPane.add(column(LayoutConstants.VERTICAL_GAP,
row(cell(borderLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Line"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderType).weight(2), flex(3)),
row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderColor).weight(2), flex(3)),
row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Radius"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderRadiusSpinner).weight(2), flex(3))
row(cell(borderLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Line"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderType).weight(2), flex(2.5)),
row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderColor).weight(2), flex(2.5)),
row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Radius"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderRadiusSpinner).weight(2), flex(2.5))
).getComponent());
return borderPane;
}
@ -102,8 +102,8 @@ public class StyleSettingPane extends BasicBeanPane<MobilePopupHyperlink> {
JLabel bgLabel = new JLabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Background"));
bgPane.add(column(LayoutConstants.VERTICAL_GAP,
row(cell(bgLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(bgColor).weight(2), flex(3)),
row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Opacity"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(transparencyPane).weight(3), flex(2))
row(cell(bgLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(bgColor).weight(2), flex(2.5)),
row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Opacity"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(transparencyPane).weight(3), flex(1.5))
).getComponent());
return bgPane;
}
@ -117,9 +117,9 @@ public class StyleSettingPane extends BasicBeanPane<MobilePopupHyperlink> {
sizePane.add(column(LayoutConstants.VERTICAL_GAP,
row(
column(LayoutConstants.VERTICAL_GAP, cell(sizeLabel), flex()).weight(1),
cell(mobileRegularPane).weight(4), flex(2)
cell(mobileRegularPane).weight(4.5), flex(1.5)
),
row(flex(1), cell(padRegularPane).weight(4), flex(2))
row(flex(1), cell(padRegularPane).weight(4.5), flex(1.5))
).getComponent());
return sizePane;
}

1
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -342,6 +342,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
renameAction.setEnabled(false);
delFileAction.setEnabled(false);
vcsAction.setEnabled(false);
this.revalidate();
this.repaint();
}

40
designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java

@ -1,20 +1,15 @@
package com.fr.design.style.background.impl;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundDetailPane;
import com.fr.general.Background;
import com.fr.general.locale.image.I18nImage;
import javax.swing.*;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
@ -25,23 +20,14 @@ import static com.fine.swing.ui.layout.Layouts.flex;
*/
public class NullBackgroundPane extends BackgroundDetailPane {
private static final String NULL_BACKGROUND = "/com/fr/design/images/background/null_background.png";
private static final Image DEFAULT_NULL_BACKGROUND_IMAGE;
static {
DEFAULT_NULL_BACKGROUND_IMAGE = I18nImage.getImage(NULL_BACKGROUND);
}
public NullBackgroundPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel centerLabel = new UILabel(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Background_Is_Null"));
ImagePanel imagePane = new ImagePanel();
JPanel pane = column(
10,
flex(),
cell(imagePane),
cell(centerLabel),
flex()
).getComponent();
@ -60,30 +46,4 @@ public class NullBackgroundPane extends BackgroundDetailPane {
public void addChangeListener(ChangeListener changeListener) {
// do nothing.
}
/**
* 水平居中绘制 Image
*/
public class ImagePanel extends JPanel {
public ImagePanel() {
}
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
if (DEFAULT_NULL_BACKGROUND_IMAGE != null) {
int x = (this.getWidth() - DEFAULT_NULL_BACKGROUND_IMAGE.getWidth(null)) / 2;
g.drawImage(DEFAULT_NULL_BACKGROUND_IMAGE, x, 0, this);
}
}
@Override
public Dimension getPreferredSize() {
if (DEFAULT_NULL_BACKGROUND_IMAGE == null) {
return super.getPreferredSize();
}
return FineUIScale.scale(new Dimension(DEFAULT_NULL_BACKGROUND_IMAGE.getWidth(null), DEFAULT_NULL_BACKGROUND_IMAGE.getHeight(null)));
}
}
}

BIN
designer-chart/src/main/resources/com/fr/design/images/background/null_background.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

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

@ -0,0 +1,105 @@
package com.fanruan.boot.adaptation;
import com.fanruan.carina.Carina;
import com.fanruan.carina.context.ContextListener;
import com.fanruan.portal.authority.PortalAuthorityItems;
import com.fanruan.portal.module.PortalModule;
import com.fanruan.portal.module.PortalModuleManager;
import com.fr.stable.StringUtils;
import com.fr.third.guava.collect.Sets;
import java.util.Optional;
import java.util.Set;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_DEPARTMENT_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_ROLE_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_DELETE_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_DELETE_ROLE_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_DEP_ROLE_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_EDIT_INFO_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_RESET_PASSWORD_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_FORBIDDEN_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ID;
import static com.fanruan.messenger.ums.authority.UMSAuthorityItems.PORTAL_MANAGEMENT_ENTERPRISE_UMS_ID;
import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_GENERAL_ID;
import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_ID;
import static com.fanruan.portal.authority.PortalAuthorityItems.MAP_ID;
import static com.fanruan.portal.authority.PortalAuthorityItems.PORTAL_MANAGEMENT_ID;
import static com.fanruan.portal.authority.PortalAuthorityItems.SECURITY_ID;
import static com.fr.decision.authority.base.constant.ReportAuthorityItems.ENTERPRISE_REPORT_BASE_SETTINGS_ID;
import static com.fr.decision.authority.base.constant.ReportAuthorityItems.ENTERPRISE_REPORT_ID;
/**
* 内置服务器支持展示的模块预期调用顺序在业务模块之后
*
* @author Anner
* @since 11.0
* Created on 2024/10/15
*/
public class DesignServerSupportModule {
private final static Set<String> SUPPORT_MODULE = Sets.newHashSet(
// 系统管理
PORTAL_MANAGEMENT_ID,
// 用户管理
USER_ID,
USER_ADD_ROLE_ID,
USER_ADD_DEPARTMENT_ID,
USER_ADD_ID,
USER_EDIT_ID,
USER_EDIT_RESET_PASSWORD_ID,
USER_EDIT_EDIT_INFO_ID,
USER_EDIT_DEP_ROLE_ID,
USER_DELETE_ID,
USER_DELETE_ROLE_ID,
USER_FORBIDDEN_ID,
// 企业设置
ENTERPRISE_ID,
// 企业设置 - 通知中心
PORTAL_MANAGEMENT_ENTERPRISE_UMS_ID,
// 企业设置 - 通用设置
ENTERPRISE_GENERAL_ID,
// 报表设置
ENTERPRISE_REPORT_ID,
// 报表设置 - 基础设置
ENTERPRISE_REPORT_BASE_SETTINGS_ID,
// 安全管理
SECURITY_ID,
// 地图管理
MAP_ID
);
/**
* 注册一下支持展示的模块
*
* @param moduleName name
*/
public static void register(String moduleName) {
Optional.of(moduleName).ifPresent(SUPPORT_MODULE::add);
}
/**
* 取消注册展示的模块
*
* @param moduleName name
*/
public static void unregister(String moduleName) {
Optional.of(moduleName).ifPresent(SUPPORT_MODULE::remove);
}
/**
* 启动入口重建一下展示的module
*/
public static void rebuild() {
Carina.getApplicationContext().addListener(new ContextListener() {
@Override
public void onStart() {
PortalModuleManager.allModules().values().stream()
.filter(m -> !StringUtils.equals(m.getParentID(), PortalAuthorityItems.PORTAL_ROOT_ID)).map(PortalModule::getId)
.filter(m -> !SUPPORT_MODULE.contains(m))
.forEach(PortalModuleManager::unregister);
}
});
}
}

5
designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java

@ -1,6 +1,7 @@
package com.fanruan.boot.adaptation;
import com.fanruan.carina.Carina;
import com.fanruan.carina.annotions.DependsOn;
import com.fanruan.carina.annotions.FineComponent;
import com.fanruan.carina.annotions.Start;
import com.fanruan.plugins.resource.PluginResourceHelper;
@ -57,8 +58,8 @@ import java.util.TreeSet;
* Created on 2024/6/24
*/
@FineComponent(name = "fine_report_adaptation")
@DependsOn(dependencies = {"fine_report"})
public class ReportAdaptationComponent {
/**
* 启动
*/
@ -74,6 +75,8 @@ public class ReportAdaptationComponent {
// 插件controller注册
PluginControllerManager.getInstance().init();
// 过滤掉内置服务器不支持的模块
DesignServerSupportModule.rebuild();
}
private void listenEmbedServletFilter(ServletContext servletContext) {

18
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignReportBaseComponent.java vendored

@ -5,7 +5,10 @@ import com.fanruan.carina.annotions.DependsOn;
import com.fanruan.carina.annotions.FineComponent;
import com.fanruan.carina.annotions.Start;
import com.fanruan.carina.annotions.Stop;
import com.fr.report.VcsContext;
import com.fanruan.carina.annotions.Supplemental;
import com.fr.nx.app.web.StreamAndTemplateReportletCreator;
import com.fr.nx.app.web.StreamReportletCreator;
import com.fr.web.factory.WebletFactory;
/**
* DesignReportBaseComponent
@ -18,12 +21,21 @@ import com.fr.report.VcsContext;
@DependsOn(dependencies = "design_function_chart_base")
public class DesignReportBaseComponent extends ReportBaseComponent {
/**
* prepare
*/
@Supplemental
public void supplemental() {
WebletFactory.registerWebletCreator(StreamReportletCreator.KEY);
WebletFactory.registerWebletCreator(StreamAndTemplateReportletCreator.KEY);
}
/**
* start
*/
@Start
public void start() {
VcsContext.init();
super.start();
}
/**
@ -31,6 +43,6 @@ public class DesignReportBaseComponent extends ReportBaseComponent {
*/
@Stop
public void stop() {
VcsContext.reset();
super.stop();
}
}

Loading…
Cancel
Save