Browse Source

Merge pull request #11119 in DESIGN/design from final/10.0 to persist/10.0

* commit '2379599733f9d472a060b10a74988293089da734':
  REPORT-87124 国际化设计器需要对服务平台做下隐藏
  REPORT-87124 国际化设计器需要对服务平台做下隐藏
  REPORT-87124 国际化设计器需要对服务平台做下隐藏
  REPORT-85618 【FR设计器-移动端】组件顺序-frm模板,组件修改名称后,body-移动端-组件顺序会排到最后一位
  REPORT-86364 服务平台设计器适配
  REPORT-85708 FR10决策报表-设计画布内的报表块的内容显示
  REPORT-85611 FR10组件复用-多组件生成的复用组件,绝对画布块缩小到500*260的尺寸限制了,但内部组件没等比例缩小
persist/10.0
superman 2 years ago
parent
commit
0c3dd42f07
  1. 4
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java
  2. 12
      designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java
  3. 30
      designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java
  4. 9
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  5. 3
      designer-base/src/main/resources/com/fr/design/images/platform/platform_normal.svg
  6. 6
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java
  7. 70
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  8. 36
      designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java

4
designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

@ -127,8 +127,8 @@ public class AboutPane extends JPanel {
if (GeneralContext.getLocale().equals(Locale.TAIWAN)) {
return;
}
boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ: " + CloudCenter.getInstance().acquireUrlByKind("help.qq"));
contentPane.add(boxCenterAlignmentPane);
JPanel servicePlatformPane = getURLActionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Service_Platform"), CloudCenter.getInstance().acquireUrlByKind("service.platform"));
contentPane.add(servicePlatformPane);
}
// 是否显示鸣谢面板

12
designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java

@ -171,5 +171,17 @@ public enum SupportLocaleImpl implements SupportLocale {
set.add(Locale.TAIWAN);
return set;
}
},
/**
* 帮助-服务平台只针对中国大陆
*/
SERVICE_PLATFORM {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<>();
set.add(Locale.CHINA);
return set;
}
}
}

30
designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java

@ -0,0 +1,30 @@
package com.fr.design.mainframe.platform;
import com.fr.design.actions.UpdateAction;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter;
import com.fr.log.FineLoggerFactory;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.net.URI;
/**
* 帮助-服务平台
*
* @author Destiny.Lin
* @version 11.0
* created by Destiny.Lin on 2022-12-14
*/
public class ServicePlatformAction extends UpdateAction {
public ServicePlatformAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Service_Platform_Title"));
this.setSmallIcon("/com/fr/design/images/platform/platform");
}
@Override
public void actionPerformed(ActionEvent e) {
BrowseUtils.browser(CloudCenter.getInstance().acquireUrlByKind("service.platform"));
}
}

9
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -56,6 +56,7 @@ import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.locale.impl.SupportLocaleImpl;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.ToolBarNewTemplatePane;
import com.fr.design.mainframe.platform.ServicePlatformAction;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut;
@ -561,14 +562,16 @@ public abstract class ToolBarMenuDock {
//远程不使用更新升级,产品演示
if (WorkContext.getCurrent().isLocal()) {
shortCuts.add(new WebDemoAction());
if (!Locale.getDefault().equals(Locale.JAPAN) && !Locale.getDefault().equals(Locale.JAPANESE)) {
LocaleCenter.buildAction(() -> shortCuts.add(new SoftwareUpdateAction()), SupportLocaleImpl.UPDATE_HELP);
}
LocaleCenter.buildAction(() -> shortCuts.add(new SoftwareUpdateAction()), SupportLocaleImpl.UPDATE_HELP);
}
if (AlphaFineConfigManager.isALPHALicAvailable()) {
shortCuts.add(new AlphaFineAction());
}
//服务平台(仅针对中国大陆)
LocaleCenter.buildAction(() -> shortCuts.add(new ServicePlatformAction()), SupportLocaleImpl.SERVICE_PLATFORM);
shortCuts.add(SeparatorDef.DEFAULT);
if (DesignerEnvManager.getEnvManager().isOpenDebug()) {
OSSupportCenter.buildAction(objects -> shortCuts.add(new FineUIAction()), SupportOSImpl.FINEUI);

3
designer-base/src/main/resources/com/fr/design/images/platform/platform_normal.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 6.5V10.5V12H10V6H12.9776C12.725 3.19675 10.369 1 7.5 1C4.63098 1 2.27504 3.19675 2.02242 6H5V12H2V14H6V13H9V16H6V15H1V12V11.5V10.5V6.5V6H1.01894C1.27426 2.64378 4.07839 0 7.5 0C10.9216 0 13.7257 2.64378 13.9811 6H14V6.5ZM13 10.5V7H11V11H13V10.5ZM2 10.5V7H4V11H2V10.5ZM7 15V14H8V15H7Z" fill="#333334"/>
</svg>

After

Width:  |  Height:  |  Size: 458 B

6
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java

@ -30,6 +30,7 @@ import com.fr.design.widget.Operator;
import com.fr.design.widget.ui.designer.component.WidgetAbsoluteBoundPane;
import com.fr.design.widget.ui.designer.component.WidgetBoundPane;
import com.fr.design.widget.ui.designer.component.WidgetCardTagBoundPane;
import com.fr.form.main.WidgetUtil;
import com.fr.form.ui.ChartEditor;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WScaleLayout;
@ -243,7 +244,12 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
showNameInvalidDialog(Toolkit.i18nText("Fine-Design_Form_Chart_Widget_Rename_Failure"));
return;
}
String oldName = widget.getWidgetName();
widgetPropertyPane.update(widget);
Widget innerWidget = WidgetUtil.getInnerWidget(widget);
if (!StringUtils.equals(oldName, innerWidget.getWidgetName())) {
innerWidget.setMobileOldWidgetName(oldName);
}
// 上面一行更新了组件 这里必须重新调用getWidgetName
xCreator.resetCreatorName(widget.getWidgetName());
xCreator.resetVisible(widget.isVisible());

70
designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java

@ -3,6 +3,8 @@
*/
package com.fr.design.mainframe.form;
import com.fr.base.DynamicUnitList;
import com.fr.base.GraphHelper;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
import com.fr.design.actions.AllowAuthorityEditAction;
@ -31,13 +33,18 @@ import com.fr.design.selection.SelectionListener;
import com.fr.form.FormElementCaseProvider;
import com.fr.form.main.Form;
import com.fr.grid.Grid;
import com.fr.grid.GridUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.report.ReportHelper;
import com.fr.report.cell.CellElement;
import com.fr.report.elementcase.ElementCase;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.FormElementCase;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ColumnRow;
import com.fr.stable.Constants;
import javax.swing.JComponent;
import javax.swing.JPanel;
@ -122,16 +129,23 @@ public class FormElementCaseDesigner
}
/**
* 获取当前ElementCase的缩略图
* 获取当前ElementCase的缩略图 缩略图中包含所有有内容的单元格
*
* @param size 缩略图的大小
*/
@Override
public BufferedImage getElementCaseImage(Dimension size) {
Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null;
if (grid == null) {
return new BufferedImage(0, 0, BufferedImage.TYPE_INT_RGB);
}
resetGrid(grid);
BufferedImage image = null;
try {
int width = size.width;
int height = size.height;
int width = Math.max(grid.getWidth(), size.width);
int height = Math.max(grid.getHeight(), size.width);
// 使用TYPE_INT_RGB和new Color(255, 255, 255, 1)设置有透明背景buffer image,
// 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0)
@ -147,19 +161,16 @@ public class FormElementCaseDesigner
// 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0)
// 这样不支持透明通道缩略图的旧设计器打开新设计器创建的模版时,就不会创建出拥有黑色背景的缩略图
g2d.setColor(new Color(255, 255, 255, 1));
g2d.fillRect(0, 0, (int) size.getWidth(), (int) size.getHeight());
Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null;
if (grid != null) {
boolean oldTranslucent = grid.isTranslucent();
boolean oldShowExtraGridLine = grid.isShowExtraGridLine();
// 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景
grid.setTranslucent(true);
grid.setShowExtraGridLine(false);
grid.paint(g2d);
grid.setTranslucent(oldTranslucent);
grid.setShowExtraGridLine(oldShowExtraGridLine);
}
g2d.fillRect(0, 0, width, height);
boolean oldTranslucent = grid.isTranslucent();
boolean oldShowExtraGridLine = grid.isShowExtraGridLine();
// 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景
grid.setTranslucent(true);
grid.setShowExtraGridLine(false);
grid.paint(g2d);
grid.setTranslucent(oldTranslucent);
grid.setShowExtraGridLine(oldShowExtraGridLine);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
@ -168,6 +179,33 @@ public class FormElementCaseDesigner
return image;
}
private void resetGrid(Grid grid) {
grid.setVerticalValue(0);
grid.setHorizontalValue(0);
FormElementCasePaneDelegate reportPane = getEditingElementCasePane();
ColumnRow lastColumnRow = GridUtils.getAdjustLastColumnRowOfReportPane(reportPane);
int lastColumn = lastColumnRow.getColumn();
int lastRow = lastColumnRow.getRow();
grid.setVerticalExtent(lastRow);
grid.setHorizontalExtent(lastColumn);
ElementCase report = reportPane.getEditingElementCase();
DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report);
DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report);
int resolution = grid.getResolution();
int width = columnWidthList.getRangeValueFromZero(lastColumn).toPixI(resolution);
int height = rowHeightList.getRangeValueFromZero(lastRow).toPixI(resolution);
int gridLineWidth = GraphHelper.getLineStyleSize(Constants.LINE_THIN);
grid.setSize(width + gridLineWidth, height + gridLineWidth);
grid.updateUI();
}
/**
* 刷新右侧属性面板
*/

36
designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java

@ -65,8 +65,6 @@ public class ShareGeneratePane extends BasicPane {
private static final Dimension DIALOG_SIZE = new Dimension(670, 760);
private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610);
private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6);
private static final double MAX_WIDTH = 500.0;
private static final double MAX_HEIGHT = 260.0;
private JPanel mainPane = null;
private ShareMainPane uploadPane = null;
@ -298,28 +296,11 @@ public class ShareGeneratePane extends BasicPane {
private boolean generateModule(DefaultSharableWidget info) throws Exception {
DefaultSharableWidget transformInfo = transform(info);
ComponentGenerateInfo generateInfo = new ComponentGenerateInfo(uploadCheckbox.isSelected(), jt, paraMap, shareWidget, transformInfo);
ComponentGenerateInfo generateInfo = new ComponentGenerateInfo(uploadCheckbox.isSelected(), jt, paraMap, shareWidget, info);
ComponentGeneratorCenter center = new ComponentGeneratorCenter(generateInfo);
return center.generate();
}
private DefaultSharableWidget transform(DefaultSharableWidget info) {
confineSize(info);
//先屏蔽
//if (shareWidget instanceof AbstractBorderStyleWidget) {
// AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) shareWidget;
// ExtendSharableAttrMark attrMark = styleWidget.getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG);
// if (attrMark != null) {
// String shareId = attrMark.getShareId();
// info.setId(shareId);
// }
//}
return info;
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Share_Module_Msg");
@ -329,19 +310,4 @@ public class ShareGeneratePane extends BasicPane {
return effectItemGroups.size() > 0 ? DIALOG_SIZE : DIALOG_NORMAL_SIZE;
}
private void confineSize(DefaultSharableWidget info) {
double width = info.getWidth();
double height = info.getHeight();
if (width > 0 && height > 0 && (width > MAX_WIDTH || height > MAX_HEIGHT)) {
double aspectRatio = width / height;
if (width / height > MAX_WIDTH / MAX_HEIGHT) {
info.setWidth((int) MAX_WIDTH);
info.setHeight((int) (MAX_WIDTH / aspectRatio));
} else {
info.setHeight((int) MAX_HEIGHT);
info.setWidth((int) (MAX_HEIGHT * aspectRatio));
}
}
}
}

Loading…
Cancel
Save