Browse Source

Merge remote-tracking branch 'origin/release/11.0' into release/11.0

bugfix/11.0
xiqiu 3 years ago
parent
commit
b6834333d2
  1. 16
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 47
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  3. 11
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java
  4. 42
      designer-base/src/main/java/com/fr/design/icon/LocalFileIcon.java
  5. 3
      designer-base/src/main/java/com/fr/design/icon/LockIcon.java
  6. 7
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  7. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java
  8. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java
  9. 24
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java
  10. 13
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java
  11. 6
      designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java
  12. 17
      designer-base/src/main/java/com/fr/file/StashedFILE.java
  13. BIN
      designer-base/src/main/resources/com/fr/design/images/gui/file_lock.png
  14. 6
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  15. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  16. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  17. 18
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  18. 15
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  19. 12
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  20. 19
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  21. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  22. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java
  23. 13
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java
  24. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java
  25. 15
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

16
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -167,6 +167,7 @@ public class PreferencePane extends BasicPane {
private UICheckBox oracleSpace; private UICheckBox oracleSpace;
private UISpinner cachingTemplateSpinner; private UISpinner cachingTemplateSpinner;
private UICheckBox useOptimizedUPMCheckbox; private UICheckBox useOptimizedUPMCheckbox;
private UICheckBox useNewVersionLoginCheckbox;
private UICheckBox useUniverseDBMCheckbox; private UICheckBox useUniverseDBMCheckbox;
private UICheckBox joinProductImproveCheckBox; private UICheckBox joinProductImproveCheckBox;
private UICheckBox autoPushUpdateCheckBox; private UICheckBox autoPushUpdateCheckBox;
@ -233,6 +234,13 @@ public class PreferencePane extends BasicPane {
advancePane.add(upmSelectorPane); advancePane.add(upmSelectorPane);
} }
if (SupportOSImpl.DESIGNER_LOGIN.support()) {
JPanel loginSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Login_Manager"));
useNewVersionLoginCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Login_Manager"));
loginSelectorPane.add(useNewVersionLoginCheckbox);
advancePane.add(loginSelectorPane);
}
JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager")); JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager"));
useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager")); useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager"));
//dbmSelectorPane.add(useUniverseDBMCheckbox); //dbmSelectorPane.add(useUniverseDBMCheckbox);
@ -726,6 +734,10 @@ public class PreferencePane extends BasicPane {
useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM()); useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM());
} }
if (useNewVersionLoginCheckbox != null) {
useNewVersionLoginCheckbox.setSelected(!DesignerEnvManager.getEnvManager().isUseOldVersionLogin());
}
useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM()); useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM());
this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace()); this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace());
@ -820,6 +832,10 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setAutoPushUpdateEnabled(this.autoPushUpdateCheckBox.isSelected()); designerEnvManager.setAutoPushUpdateEnabled(this.autoPushUpdateCheckBox.isSelected());
} }
if (useNewVersionLoginCheckbox != null) {
designerEnvManager.setUseOldVersionLogin(!this.useNewVersionLoginCheckbox.isSelected());
}
designerEnvManager.setUndoLimit(maxUndoLimit.getSelectedIndex() * SELECTED_INDEX_5); designerEnvManager.setUndoLimit(maxUndoLimit.getSelectedIndex() * SELECTED_INDEX_5);
if (maxUndoLimit.getSelectedIndex() == SELECTED_INDEX_5) { if (maxUndoLimit.getSelectedIndex() == SELECTED_INDEX_5) {
designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50);

47
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -12,7 +12,6 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JVirtualTemplate; import com.fr.design.mainframe.JVirtualTemplate;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
@ -361,22 +360,30 @@ public class HistoryTemplateListCache implements CallbackEvent {
int size = historyList.size(); int size = historyList.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
JTemplate<?, ?> template = historyList.get(i); JTemplate<?, ?> template = historyList.get(i);
FILE file = template.getEditingFILE(); FILE file = templateToStashFile(template);
try { if (file != null) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); stashFILEMap.put(i, file);
BaseBook target = template.getTarget();
if (target != null) {
target.export(outputStream);
stashFILEMap.put(i, new StashedFILE(file, outputStream.toByteArray()));
}
// 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
FineLoggerFactory.getLogger().info("Env Change Template Stashed."); FineLoggerFactory.getLogger().info("Env Change Template Stashed.");
} }
private FILE templateToStashFile(JTemplate<?, ?> template) {
FILE file = template.getEditingFILE();
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BaseBook target = template.getTarget();
if (target != null) {
target.export(outputStream);
return new StashedFILE(file, outputStream.toByteArray(), template.suffix());
}
// 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}
private boolean checkStash() { private boolean checkStash() {
try { try {
return stashWorker.get(); return stashWorker.get();
@ -458,18 +465,10 @@ public class HistoryTemplateListCache implements CallbackEvent {
FILE file = template.getEditingFILE(); FILE file = template.getEditingFILE();
boolean needReload = context == null || needReloadTemplate(context, template); boolean needReload = context == null || needReloadTemplate(context, template);
if (needReload) { if (needReload) {
try { FILE stashFile = templateToStashFile(template);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); if (stashFile != null) {
BaseBook target = template.getTarget(); FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName());
if (target != null) { template.refreshResource(stashFile);
FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName());
target.export(outputStream);
FILE stashedFile = new StashedFILE(file, outputStream.toByteArray());
template.refreshResource(stashedFile);
}
// 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
} }

11
designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java

@ -2,6 +2,7 @@ package com.fr.design.gui.itree.filetree;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.icon.LocalFileIcon;
import com.fr.design.icon.LockIcon; import com.fr.design.icon.LockIcon;
import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.design.fun.ReportSupportedFileUIProvider;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
@ -19,6 +20,8 @@ public class FileTreeIcon {
private FileTreeIcon() { private FileTreeIcon() {
} }
public static final String FILE_LOCKED_ICON_PATH = "/com/fr/design/images/gui/file_lock.png";
public static final Icon BLANK_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/blank.gif"); public static final Icon BLANK_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/blank.gif");
public static final Icon FOLDER_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/folder.png"); public static final Icon FOLDER_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/folder.png");
@ -153,7 +156,7 @@ public class FileTreeIcon {
if (node.isDirectory()) { if (node.isDirectory()) {
return FileTreeIcon.FOLDER_IMAGE_ICON; return FileTreeIcon.FOLDER_IMAGE_ICON;
} }
return getLocalFileIcon(path); return getLocalFileIcon(path, isShowLock);
} }
} }
if (node.isDirectory()) { if (node.isDirectory()) {
@ -163,12 +166,12 @@ public class FileTreeIcon {
} }
} }
private static Icon getLocalFileIcon(String path) { private static Icon getLocalFileIcon(String path, boolean isShowLock) {
Icon icon = getExtraIcon(path, false); Icon icon = getExtraIcon(path, isShowLock);
if (icon != null) { if (icon != null) {
return icon; return icon;
} }
return FileSystemView.getFileSystemView().getSystemIcon(new File(path)); return new LocalFileIcon(FileSystemView.getFileSystemView().getSystemIcon(new File(path)), isShowLock);
} }
private static Icon getRemoteFileIcon(FileNode node, boolean isShowLock) { private static Icon getRemoteFileIcon(FileNode node, boolean isShowLock) {

42
designer-base/src/main/java/com/fr/design/icon/LocalFileIcon.java

@ -0,0 +1,42 @@
package com.fr.design.icon;
import com.fr.base.BaseUtils;
import com.fr.design.gui.itree.filetree.FileTreeIcon;
import javax.swing.Icon;
import java.awt.Component;
import java.awt.Graphics;
/**
* Created by kerry on 2021/11/11
*/
public class LocalFileIcon implements Icon {
private static final Icon FILE_LOCKED_ICON = BaseUtils.readIcon(FileTreeIcon.FILE_LOCKED_ICON_PATH);
private static final int OFFSET_X = 9;
private static final int OFFSET_Y = 8;
private final Icon mainIcon;
private final boolean showLock;
public LocalFileIcon(Icon mainIcon, boolean showLock) {
this.mainIcon = mainIcon;
this.showLock = showLock;
}
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
mainIcon.paintIcon(c, g, x, y);
if (showLock) {
FILE_LOCKED_ICON.paintIcon(c, g, OFFSET_X, OFFSET_Y);
}
}
@Override
public int getIconWidth() {
return mainIcon.getIconWidth();
}
@Override
public int getIconHeight() {
return mainIcon.getIconHeight();
}
}

3
designer-base/src/main/java/com/fr/design/icon/LockIcon.java

@ -1,6 +1,7 @@
package com.fr.design.icon; package com.fr.design.icon;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.gui.itree.filetree.FileTreeIcon;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import javax.swing.GrayFilter; import javax.swing.GrayFilter;
@ -12,7 +13,7 @@ import java.awt.MediaTracker;
import java.awt.image.ImageObserver; import java.awt.image.ImageObserver;
public class LockIcon extends ImageIcon { public class LockIcon extends ImageIcon {
private final static Image lockImage = BaseUtils.readImage("/com/fr/design/images/gui/locked.gif"); private final static Image lockImage = BaseUtils.readImage(FileTreeIcon.FILE_LOCKED_ICON_PATH);
private Image mainImage = null; private Image mainImage = null;

7
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -466,8 +466,11 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} }
private void setTargetByFile(FILE file) { private void setTargetByFile(FILE file) {
this.template = JTemplateFactory.asIOFile(file, this.suffix()); T newTemplate = JTemplateFactory.asIOFile(file, this.suffix());
setTarget(this.template); if (newTemplate != null) {
this.template = newTemplate;
setTarget(this.template);
}
} }
private void addCenterPane() { private void addCenterPane() {

2
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java

@ -41,7 +41,7 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane<ReportTheme
public ReportThemePreviewPane() { public ReportThemePreviewPane() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
chartPreviewPane = new ChartPreviewPane(); chartPreviewPane = new ChartPreviewPane();
chartPreviewPane.setPreferredSize(new Dimension(615, 237)); chartPreviewPane.setPreferredSize(new Dimension(615, 207));
chartPreviewPane.populate(initColumnChart()); chartPreviewPane.populate(initColumnChart());
chartPreviewPane.setCallbackEvent(this); chartPreviewPane.setCallbackEvent(this);
reportPreviewPane = new ECReportPreviewPane(); reportPreviewPane = new ECReportPreviewPane();

4
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java

@ -30,6 +30,10 @@ public abstract class AbstractECPreviewPane extends UINoOpaquePanel implements T
return getCellStyle(cellStyleList.getUse4SmallTitle()); return getCellStyle(cellStyleList.getUse4SmallTitle());
} }
protected Style getAssistMsgStyle(ThemedCellStyleList cellStyleList) {
return getCellStyle(cellStyleList.getUse4SupportInfo());
}
private Style getCellStyle(ThemedCellStyle themedCellStyle) { private Style getCellStyle(ThemedCellStyle themedCellStyle) {
if (themedCellStyle == null) { if (themedCellStyle == null) {
return Style.DEFAULT_STYLE; return Style.DEFAULT_STYLE;

24
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java

@ -24,15 +24,18 @@ public class ECPreviewPane extends AbstractECPreviewPane {
private final List<AbstractPreviewCell> headerCellList = new ArrayList<>(); private final List<AbstractPreviewCell> headerCellList = new ArrayList<>();
private final List<AbstractPreviewCell> contentCellList = new ArrayList<>(); private final List<AbstractPreviewCell> contentCellList = new ArrayList<>();
private final List<AbstractPreviewCell> highLightCellList = new ArrayList<>(); private final List<AbstractPreviewCell> highLightCellList = new ArrayList<>();
private final List<AbstractPreviewCell> assistCellList = new ArrayList<>();
private static final int COL_COUNT = 5; private static final int COL_COUNT = 5;
private static final int CONTENT_ROW_COUNT = 2; private static final int CONTENT_ROW_COUNT = 2;
public ECPreviewPane() { public ECPreviewPane() {
this.setPreferredSize(new Dimension(517, 147)); this.setPreferredSize(new Dimension(517, 158));
this.setBorder(BorderFactory.createEmptyBorder(0, 1, 2, 1)); this.setBorder(BorderFactory.createEmptyBorder(0, 1, 2, 1));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel titlePane = new UINoOpaquePanel(new GridLayout()); JPanel titlePane = new UINoOpaquePanel(new GridLayout());
this.add(titlePane, BorderLayout.NORTH); JPanel extCenterPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
this.add(extCenterPane, BorderLayout.CENTER);
extCenterPane.add(titlePane, BorderLayout.NORTH);
for (int i = 0; i < COL_COUNT; i++) { for (int i = 0; i < COL_COUNT; i++) {
PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header"));
cell.setPreferredSize(new Dimension(103, 36)); cell.setPreferredSize(new Dimension(103, 36));
@ -40,22 +43,29 @@ public class ECPreviewPane extends AbstractECPreviewPane {
headerCellList.add(cell); headerCellList.add(cell);
} }
JPanel contentPane = new UINoOpaquePanel(new GridLayout(2, 5, 0, 0)); JPanel contentPane = new UINoOpaquePanel(new GridLayout(2, 5, 0, 0));
this.add(contentPane, BorderLayout.CENTER); extCenterPane.add(contentPane, BorderLayout.CENTER);
for (int i = 0; i < COL_COUNT * CONTENT_ROW_COUNT; i++) { for (int i = 0; i < COL_COUNT * CONTENT_ROW_COUNT; i++) {
PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text")); PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text"));
cell.setPreferredSize(new Dimension(103, 33)); cell.setPreferredSize(new Dimension(103, 30));
contentPane.add(cell); contentPane.add(cell);
contentCellList.add(cell); contentCellList.add(cell);
} }
JPanel endPane = new UINoOpaquePanel(new GridLayout()); JPanel endPane = new UINoOpaquePanel(new GridLayout());
this.add(endPane, BorderLayout.SOUTH); extCenterPane.add(endPane, BorderLayout.SOUTH);
for (int i = 0; i < COL_COUNT; i++) { for (int i = 0; i < COL_COUNT; i++) {
PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text"));
cell.setPreferredSize(new Dimension(103, 33)); cell.setPreferredSize(new Dimension(103, 30));
endPane.add(cell); endPane.add(cell);
highLightCellList.add(cell); highLightCellList.add(cell);
} }
JPanel extSouthPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
PreviewCell assistCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Assist_Text"));
assistCell.setPreferredSize(new Dimension(123, 30));
assistCellList.add(assistCell);
extSouthPane.add(assistCell);
this.add(extSouthPane, BorderLayout.SOUTH);
} }
@Override @Override
@ -64,6 +74,8 @@ public class ECPreviewPane extends AbstractECPreviewPane {
refresh(headerCellList, getReportHeaderStyle(cellStyleConfig)); refresh(headerCellList, getReportHeaderStyle(cellStyleConfig));
refresh(contentCellList, getMainContentStyle(cellStyleConfig)); refresh(contentCellList, getMainContentStyle(cellStyleConfig));
refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); refresh(highLightCellList, getHighLightStyle(cellStyleConfig));
refresh(highLightCellList, getHighLightStyle(cellStyleConfig));
refresh(assistCellList, getAssistMsgStyle(cellStyleConfig));
} }

13
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java

@ -27,6 +27,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
private final List<AbstractPreviewCell> titleCellList = new ArrayList<>(); private final List<AbstractPreviewCell> titleCellList = new ArrayList<>();
private final List<AbstractPreviewCell> contentCellList = new ArrayList<>(); private final List<AbstractPreviewCell> contentCellList = new ArrayList<>();
private final List<AbstractPreviewCell> highLightCellList = new ArrayList<>(); private final List<AbstractPreviewCell> highLightCellList = new ArrayList<>();
private final List<AbstractPreviewCell> assistCellList = new ArrayList<>();
private static final int CONTENT_ROW_COUNT = 3; private static final int CONTENT_ROW_COUNT = 3;
private static final int COL_COUNT = 5; private static final int COL_COUNT = 5;
@ -54,8 +55,10 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel northPane = createNorthPane(); JPanel northPane = createNorthPane();
JPanel centerPane = createCenterPane(); JPanel centerPane = createCenterPane();
JPanel southPane = createSouthPane();
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
this.add(southPane, BorderLayout.SOUTH);
} }
private JPanel createNorthPane() { private JPanel createNorthPane() {
@ -126,6 +129,15 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
return centerPane; return centerPane;
} }
private JPanel createSouthPane(){
JPanel southPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
PreviewCell assistCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Assist_Text"));
assistCell.setPreferredSize(new Dimension(123, 30));
assistCellList.add(assistCell);
southPane.add(assistCell, BorderLayout.CENTER);
return southPane;
}
@Override @Override
public void refresh(TemplateTheme theme) { public void refresh(TemplateTheme theme) {
ThemedCellStyleList cellStyleConfig = theme.getCellStyleList(); ThemedCellStyleList cellStyleConfig = theme.getCellStyleList();
@ -134,6 +146,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
refresh(contentCellList, getMainContentStyle(cellStyleConfig)); refresh(contentCellList, getMainContentStyle(cellStyleConfig));
refresh(titleCellList, getSmallTitleStyle(cellStyleConfig)); refresh(titleCellList, getSmallTitleStyle(cellStyleConfig));
refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); refresh(highLightCellList, getHighLightStyle(cellStyleConfig));
refresh(assistCellList, getAssistMsgStyle(cellStyleConfig));
} }
} }
} }

6
designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java

@ -46,12 +46,12 @@ public class WidgetBoundsPaneFactory {
private static final int RIGHT_PANE_WIDTH = 145; private static final int RIGHT_PANE_WIDTH = 145;
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked) { public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked, NameAttribute nameAttribute) {
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Component_Size")), new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()),
ratioLocked != null ? createRightPane(width, ratioLocked, height) : createRightPane(width, height)}, ratioLocked != null ? createRightPane(width, ratioLocked, height) : createRightPane(width, height)},
new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))},
}; };
@ -65,7 +65,7 @@ public class WidgetBoundsPaneFactory {
} }
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) { public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) {
return createBoundsPane(width, height, null); return createBoundsPane(width, height, null, NameAttribute.DEFAULT);
} }
public static JPanel createRightPane(Component com1, Component com2) { public static JPanel createRightPane(Component com1, Component com2) {

17
designer-base/src/main/java/com/fr/file/StashedFILE.java

@ -1,5 +1,9 @@
package com.fr.file; package com.fr.file;
import com.fr.base.io.XMLEncryptUtils;
import com.fr.io.EncryptUtils;
import com.fr.io.FineEncryptUtils;
import com.fr.stable.StringUtils;
import javax.swing.Icon; import javax.swing.Icon;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
@ -11,10 +15,16 @@ public class StashedFILE extends AbstractFILE {
private FILE file; private FILE file;
private byte[] content; private byte[] content;
private String suffix;
public StashedFILE(FILE file, byte[] content) { public StashedFILE(FILE file, byte[] content) {
this(file, content, null);
}
public StashedFILE(FILE file, byte[] content, String suffix) {
this.file = file; this.file = file;
this.content = content; this.content = content;
this.suffix = suffix;
} }
@Override @Override
@ -54,7 +64,12 @@ public class StashedFILE extends AbstractFILE {
@Override @Override
public InputStream asInputStream() throws Exception { public InputStream asInputStream() throws Exception {
return new ByteArrayInputStream(content); ByteArrayInputStream in = new ByteArrayInputStream(content);
return needDecode() ? XMLEncryptUtils.decodeInputStream(EncryptUtils.decodeInputStream(FineEncryptUtils.decode(in))) : in;
}
private boolean needDecode() {
return StringUtils.isNotEmpty(suffix) && (suffix.endsWith(".cpt") || suffix.endsWith(".frm"));
} }
@Override @Override

BIN
designer-base/src/main/resources/com/fr/design/images/gui/file_lock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

6
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -156,10 +156,10 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
} }
if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) { if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) {
//主题中有的属性 不跟随属性 全部设置成自定义 //主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
((VanChart) chart4Update).setThemeCustom(); ((VanChart) chart4Update).setThemeCustom();
//主题中没有的 根据主题深浅色自动 的属性 全部设置成自定义 // //主题中没有的 根据主题深浅色自动 的属性 默认自动
((VanChart) chart4Update).setAutoThemeCustom(); // ((VanChart) chart4Update).setAutoThemeCustom();
} }
update(chart4Update); update(chart4Update);

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

@ -18,6 +18,7 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane; import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane;
import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
@ -154,6 +155,12 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
addButton.addActionListener((e) -> { addButton.addActionListener((e) -> {
String name = getNewChartName(); String name = getNewChartName();
ChartProvider chart = getChangeStateNewChart(); ChartProvider chart = getChangeStateNewChart();
if (!ChartEditContext.supportTheme() && chart instanceof VanChart) {
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
((VanChart) chart).setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
checkInForm(chart); checkInForm(chart);
addNewChart(chart, name, editingCollection.getChartCount()); addNewChart(chart, name, editingCollection.getChartCount());
}); });

6
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -152,6 +152,12 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
newPlot.setCategoryNum(oldPlot.getCategoryNum()); newPlot.setCategoryNum(oldPlot.getCategoryNum());
//切换类型埋点 //切换类型埋点
ChartInfoCollector.getInstance().updateChartTypeTime(chart, oldPlot.getPlotID()); ChartInfoCollector.getInstance().updateChartTypeTime(chart, oldPlot.getPlotID());
if (!ChartEditContext.supportTheme()) {
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
chart.setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
} }
if (!ChartEditContext.supportTheme()) { if (!ChartEditContext.supportTheme()) {
chart.setAutoThemeCustom(); chart.setAutoThemeCustom();

18
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -238,18 +238,18 @@ public class GisLayerPane extends JPanel implements UIObserver {
public void resetGisLayer(VanChartMapPlot mapPlot) { public void resetGisLayer(VanChartMapPlot mapPlot) {
if (ChartEditContext.supportTheme()) { // if (ChartEditContext.supportTheme()) {
GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer(); GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer();
mapPlot.setGisLayer(defaultGisLayer); mapPlot.setGisLayer(defaultGisLayer);
populate(defaultGisLayer); populate(defaultGisLayer);
} else { // } else {
GaoDeGisType gaoDeGisType = mapPlot.getDefaultGisLayerType(); // GaoDeGisType gaoDeGisType = mapPlot.getDefaultGisLayerType();
//
mapPlot.getGisLayer().setGisLayerType(GISLayerType.GAO_DE_API); // mapPlot.getGisLayer().setGisLayerType(GISLayerType.GAO_DE_API);
mapPlot.getGisLayer().setLayerName(gaoDeGisType.getTypeName()); // mapPlot.getGisLayer().setLayerName(gaoDeGisType.getTypeName());
mapPlot.getGisLayer().setGaoDeGisType(gaoDeGisType); // mapPlot.getGisLayer().setGaoDeGisType(gaoDeGisType);
populate(mapPlot.getGisLayer()); // populate(mapPlot.getGisLayer());
} // }
} }
public void populate(GisLayer layer) { public void populate(GisLayer layer) {

15
designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

@ -20,7 +20,6 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.form.ui.BaseChartEditor; import com.fr.form.ui.BaseChartEditor;
import com.fr.form.ui.PaddingMargin;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
@ -29,9 +28,15 @@ import javax.swing.BorderFactory;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.*; import java.awt.Color;
import java.beans.IntrospectionException; import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.beans.IntrospectionException;
/** /**
* form中的图表按钮弹出的控件, 创建初始化图表内容. * form中的图表按钮弹出的控件, 创建初始化图表内容.
@ -367,4 +372,8 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
return false; return false;
} }
@Override
public boolean isComponent() {
return true;
}
} }

12
designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

@ -9,8 +9,8 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.designer.beans.events.DesignerEditor; import com.fr.design.designer.beans.events.DesignerEditor;
import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.creator.operate.XCreatorBaseOperate;
import com.fr.design.designer.creator.operate.DefaultXCreatorBaseOperate; import com.fr.design.designer.creator.operate.DefaultXCreatorBaseOperate;
import com.fr.design.designer.creator.operate.XCreatorBaseOperate;
import com.fr.design.designer.treeview.DefaultXCreatorTreeCellRender; import com.fr.design.designer.treeview.DefaultXCreatorTreeCellRender;
import com.fr.design.designer.treeview.XCreatorTreeCellRender; import com.fr.design.designer.treeview.XCreatorTreeCellRender;
import com.fr.design.designer.ui.PopupDialogContext; import com.fr.design.designer.ui.PopupDialogContext;
@ -36,7 +36,6 @@ import com.fr.stable.Constants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.awt.event.MouseListener;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JFrame; import javax.swing.JFrame;
@ -50,6 +49,7 @@ import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.IntrospectionException; import java.beans.IntrospectionException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -935,4 +935,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
return new DefaultXCreatorBaseOperate(); return new DefaultXCreatorBaseOperate();
} }
/**
* 是否是组件控件还是组件
* @return 是否是组件
*/
public boolean isComponent() {
return false;
}
} }

19
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -427,4 +427,23 @@ public class XCreatorUtils {
} }
return null; return null;
} }
/**
* 把控件例如textEditor外层的容器剥掉
* @param xCreator 控件
* @return 内层控件
*/
public static XCreator getXCreatorInnerWidget(XCreator xCreator) {
if (xCreator.acceptType(XWScaleLayout.class)) {
if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) {
return (XCreator) xCreator.getComponent(0);
}
}
if (xCreator.acceptType(XWTitleLayout.class)) {
return (XCreator) xCreator.getComponent(0);
}
return xCreator;
}
} }

5
designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java

@ -366,4 +366,9 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
public void releaseResources() { public void releaseResources() {
imageLable.setIcon(null); imageLable.setIcon(null);
} }
@Override
public boolean isComponent() {
return true;
}
} }

5
designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java

@ -612,4 +612,9 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
public void replaceXcreator(XCreator newCreator, XCreator oldCreator){ public void replaceXcreator(XCreator newCreator, XCreator oldCreator){
} }
@Override
public boolean isComponent() {
return true;
}
} }

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

@ -10,8 +10,6 @@ import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.XWScaleLayout;
import com.fr.design.designer.creator.XWTitleLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
@ -113,7 +111,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
} }
private void initComponents() { private void initComponents() {
XCreator innerCreator = getXCreatorDedicated(); XCreator innerCreator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
content.add(attriCardPane, BorderLayout.CENTER); content.add(attriCardPane, BorderLayout.CENTER);
@ -166,7 +164,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
private void initDefinePane() { private void initDefinePane() {
currentEditorDefinePane = null; currentEditorDefinePane = null;
XCreator creator = getXCreatorDedicated(); XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, designer, creator.toData(), new Operator() { FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, designer, creator.toData(), new Operator() {
@Override @Override
public void did(DataCreatorUI ui, String cardName) { public void did(DataCreatorUI ui, String cardName) {
@ -190,11 +188,6 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
currentEditorDefinePane = definePane; currentEditorDefinePane = definePane;
} }
private XCreator getXCreatorDedicated() {
boolean dedicateLayout = xCreator.acceptType(XWScaleLayout.class) && xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator() || xCreator.acceptType(XWTitleLayout.class);
return dedicateLayout ? (XCreator) xCreator.getComponent(0) : xCreator;
}
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return "Widget"; return "Widget";
@ -283,7 +276,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
} }
public void fireValueChanged() { public void fireValueChanged() {
XCreator creator = getXCreatorDedicated(); XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
creator.firePropertyChange(); creator.firePropertyChange();
} }

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java

@ -35,7 +35,7 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane {
width.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); width.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"));
height.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); height.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"));
ratioLockedButton.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); ratioLockedButton.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"));
this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, ratioLockedButton, WidgetBoundsPaneFactory.NameAttribute.WIDGET)); this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, ratioLockedButton, getNameAttribute()));
} }
@Override @Override

15
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -89,7 +89,20 @@ public class WidgetBoundPane extends BasicPane {
ratioLockedButton.setLockEnabled(false); ratioLockedButton.setLockEnabled(false);
} }
this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height, ratioLockedButton)); this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height, ratioLockedButton, getNameAttribute()));
}
protected WidgetBoundsPaneFactory.NameAttribute getNameAttribute() {
WidgetBoundsPaneFactory.NameAttribute nameAttribute = WidgetBoundsPaneFactory.NameAttribute.DEFAULT;
if (!isComponent()) {
nameAttribute = WidgetBoundsPaneFactory.NameAttribute.WIDGET;
}
return nameAttribute;
}
protected boolean isComponent() {
XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.creator);
return creator.isComponent();
} }

Loading…
Cancel
Save