Browse Source

Merge branch 'feature/x' of https://code.fineres.com/scm/~fly.li/design into feature/x

research/11.0
fly.li 3 years ago
parent
commit
523fd512dd
  1. 3
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 10
      designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java
  3. 20
      designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java
  4. 7
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  5. 3
      designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java
  6. 11
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  7. 11
      designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java
  8. 10
      designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java
  9. 30
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java
  10. 57
      designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeManageDialog.java
  11. 60
      designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java
  12. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java
  13. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java
  14. 39
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java
  15. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/CornerPreviewCell.java
  16. 23
      designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeManageActionProvider.java
  17. 23
      designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeProfileActionProvider.java
  18. 28
      designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeManageActionProvider.java
  19. 27
      designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeProfileActionProvider.java
  20. 41
      designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedFloatElement.java
  21. 35
      designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java
  22. 2
      designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarNoTheme.java
  23. 1
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  24. 5
      designer-base/src/main/java/com/fr/design/style/color/ColorCell.java
  25. 13
      designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java
  26. 5
      designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java
  27. 4
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java
  28. 3
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  29. 3
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  30. 3
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  31. 3
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  32. 3
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  33. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  34. 3
      designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java
  35. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java
  36. 2
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  37. 36
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  38. 36
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  39. 33
      designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java
  40. 10
      designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java
  41. 3
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java
  42. 9
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java
  43. 16
      designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java
  44. 3
      designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java
  45. 3
      designer-realize/src/main/java/com/fr/design/actions/insert/flot/FormulaFloatAction.java
  46. 3
      designer-realize/src/main/java/com/fr/design/actions/insert/flot/ImageFloatAction.java
  47. 3
      designer-realize/src/main/java/com/fr/design/actions/insert/flot/TextBoxFloatAction.java
  48. 3
      designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java
  49. 5
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java
  50. 3
      designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java
  51. 5
      designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

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

@ -403,9 +403,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
}
File envHome = new File(userHome + File.separator + "." + ProductConstants.APP_NAME + version);
if (!envHome.exists()) {
StableUtils.mkdirs(envHome);
}
return envHome.getAbsolutePath();
}

10
designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java

@ -10,7 +10,15 @@ public class DesignModeContext {
private static DesignerMode mode = DesignerMode.NORMAL;
public static void switchTo(DesignerMode mode) {
DesignModeContext.mode = mode;
changeMode(DesignModeContext.mode, mode);
}
private static void changeMode(DesignerMode oldMode, DesignerMode newMode) {
if (oldMode != newMode) {
DesignModeContext.mode = newMode;
oldMode.closeMode();
newMode.openMode();
}
}
public static DesignerMode getMode() {

20
designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java

@ -1,9 +1,25 @@
package com.fr.design.base.mode;
import com.fr.design.mainframe.DesignerContext;
public enum DesignerMode {
NORMAL,
BAN_COPY_AND_CUT,
VCS,
AUTHORITY,
DUCHAMP
AUTHORITY {
@Override
public void closeMode() {
DesignerContext.getDesignerFrame().closeAuthorityMode();
}
},
DUCHAMP;
public void openMode() {
}
public void closeMode() {
}
}

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

@ -4,6 +4,7 @@ import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.base.io.BaseBook;
import com.fr.design.DesignerEnvManager;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.base.mode.DesignerMode;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.file.filter.ClassFilter;
import com.fr.design.i18n.Toolkit;
@ -69,7 +70,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
DesignTableDataManager.closeTemplate(selected);
//直接关闭模板的时候(当且仅当设计器tab上只剩一个模板)退出权限编辑
if (DesignModeContext.isAuthorityEditing() && historyList.size() <= 1) {
DesignerContext.getDesignerFrame().closeAuthorityEditing();
DesignModeContext.switchTo(DesignerMode.NORMAL);
}
if (contains(selected) == -1) {
return;
@ -430,13 +431,13 @@ public class HistoryTemplateListCache implements CallbackEvent {
*/
@Deprecated
public void reloadCurrentTemplate() {
reloadAllEditingTemplate();
reloadAllEditingTemplate();
}
/**
* 重绘当前模板
*/
public void repaintCurrentEditingTemplate(){
public void repaintCurrentEditingTemplate() {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {

3
designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java

@ -67,6 +67,9 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
fileChooserParent = DesignerContext.getDesignerFrame();
}
Stage stage = showCoverStage(fileChooserParent);
if (stage != null) {
stage.setAlwaysOnTop(true);
}
try {
if (fileSelectionMode == FileSelectionMode.FILE || fileSelectionMode == FileSelectionMode.MULTIPLE_FILE) {
FileChooser fileChooser = new FileChooser();

11
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -9,6 +9,7 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.base.mode.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane;
@ -221,7 +222,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
@Override
public void mouseReleased(MouseEvent e) {
if (DesignModeContext.isAuthorityEditing()) {
closeAuthorityEditing();
DesignModeContext.switchTo(DesignerMode.NORMAL);
}
}
@ -301,8 +302,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().doResize();
}
@Deprecated
public void closeAuthorityEditing() {
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL);
DesignModeContext.switchTo(DesignerMode.NORMAL);
}
public void closeAuthorityMode() {
WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
@ -314,6 +319,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
EventDispatcher.fire(DesignAuthorityEventType.StopEdit, DesignerFrame.this);
}
/**
* 注册app.
*
@ -793,6 +799,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* @param jt 添加的模板.
*/
public void addAndActivateJTemplate(JTemplate<?, ?> jt) {
DesignModeContext.switchTo(DesignerMode.NORMAL);
JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (currentEditingTemplate != null) {
currentEditingTemplate.stopEditing();

11
designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java

@ -59,17 +59,10 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane<FormTheme> {
}
@Override
public void populateBean(FormTheme theme) {
super.populateBean(theme);
isPopulating = true;
public void populateBean4CustomEditors(FormTheme theme) {
super.populateBean4CustomEditors(theme);
formBodyStyleSettingPane.populateBean(theme.getBodyStyle());
componentStyleSettingPane.populateBean(theme.getComponentStyle());
themePreviewPane.refresh(theme);
isPopulating = false;
}
@Override

10
designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java

@ -35,15 +35,9 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane<ReportTheme
}
@Override
public void populateBean(ReportTheme theme) {
super.populateBean(theme);
isPopulating = true;
public void populateBean4CustomEditors(ReportTheme theme) {
super.populateBean4CustomEditors(theme);
reportBodyStyleSettingPane.populateBean(theme.getBodyStyle());
themePreviewPane.refresh(theme);
isPopulating = false;
}
@Override

30
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java

@ -1,11 +1,11 @@
package com.fr.design.mainframe.theme;
import com.fr.base.theme.FineColorFlushUtils;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeConfig;
import com.fr.base.theme.settings.ThemeThumbnail;
import com.fr.base.theme.settings.ThemedCellStyleList;
import com.fr.base.theme.settings.ThemedChartStyle;
import com.fr.base.theme.settings.ThemedColorScheme;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.FineJOptionPane;
@ -31,9 +31,6 @@ import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JDialog;
@ -71,7 +68,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
public static final int PREVIEW_PANE_WIDTH = LEFT_TITLE_PANE_WIDTH - 10;
public static final int PREVIEW_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT - TITLE_BORDER_FONT - 16;
public static final int RIGHT_PANE_WIDTH = 352;
public static final int RIGHT_PANE_WIDTH = 362;
public static final int RIGHT_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT;
public static final int COLOR_SCHEME_TITLE_PANE_WIDTH = 298;
public static final int COLOR_SCHEME_TITLE_PANE_HEIGHT = 174 + TITLE_BORDER_FONT / 2;
@ -317,19 +314,18 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors);
T theme = updateBean();
FineColorFlushUtils.replaceCacheObject(theme, replaceByColorScheme);
FineColorManager.traverse(theme, replaceByColorScheme);
populateBean(theme);
populateBean4CustomEditors(theme);
//图表渐变色
chartStyleSettingPane.populateGradientBar(colors);
themePreviewPane.refresh(theme);
this.repaint();
}
public void populateBean(T theme) {
try {
this.theme = (T) theme.clone();
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
this.theme = theme;
isPopulating = true;
String name = theme.getName();
@ -345,14 +341,20 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
saveAsButton.setEnabled(!currentIsNewTheme);
}
cellStyleSettingPane.populateBean(theme.getCellStyleList());
colorListPane.populate(theme.getColorScheme().getColors());
colorListExtendedPane.populate(colorListPane.update());
chartStyleSettingPane.populateBean(theme.getChartStyle());
populateBean4CustomEditors(theme);
themePreviewPane.refresh(theme);
isPopulating = false;
}
protected void populateBean4CustomEditors(T theme) {
cellStyleSettingPane.populateBean(theme.getCellStyleList());
chartStyleSettingPane.populateBean(theme.getChartStyle());
}
public T updateBean() {
if (theme == null) {
theme = config.createNewTheme();

57
designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeManageDialog.java

@ -1,17 +1,20 @@
package com.fr.design.mainframe.theme.dialog;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.FormThemeConfig;
import com.fr.base.theme.ReportTheme;
import com.fr.base.theme.ReportThemeConfig;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeConfig;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.theme.TemplateThemeListPane;
import com.fr.design.mainframe.theme.TemplateThemeManagePane;
import com.fr.design.mainframe.theme.provider.ThemeManageActionProvider;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
@ -20,6 +23,9 @@ import java.awt.Dimension;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
* @author Starryi
@ -35,7 +41,37 @@ public class TemplateThemeManageDialog extends TemplateThemeDialog {
TemplateThemeManageDialogContentPane.CONTENT_WIDTH, TemplateThemeManageDialogContentPane.CONTENT_HEIGHT);
contentPane = new TemplateThemeManageDialogContentPane();
setContentPane(createDialogContentPane(contentPane, new UIButton[]{ createCompleteButton() }));
setContentPane(createDialogContentPane(contentPane, createActionButtons()));
}
@Override
public void exit(){
contentPane.exit();
super.exit();
}
private UIButton[] createActionButtons() {
List<UIButton> uiButtonList = new ArrayList<>();
Set<ThemeManageActionProvider> providers = ExtraDesignClassManager.getInstance().getArray(ThemeManageActionProvider.MARK_STRING);
for (ThemeManageActionProvider provider : providers) {
uiButtonList.add(provider.createButton(new ThemeManageActionProvider.ThemeManageActionContext() {
@Override
public TemplateThemeDialog getDialog() {
return TemplateThemeManageDialog.this;
}
@Override
public TemplateThemeConfig<? extends TemplateTheme> getConfig() {
return contentPane.getConfig();
}
}));
}
uiButtonList.add(createCompleteButton());
return uiButtonList.toArray(new UIButton[]{});
}
private UIButton createCompleteButton() {
@ -49,16 +85,11 @@ public class TemplateThemeManageDialog extends TemplateThemeDialog {
return button;
}
@Override
public void exit(){
contentPane.exit();
super.exit();
}
public static class TemplateThemeManageDialogContentPane extends JPanel {
public static final int CONTENT_WIDTH = TemplateThemeManagePane.CONTENT_WIDTH + 24;
public static final int CONTENT_HEIGHT = TemplateThemeManagePane.CONTENT_HEIGHT + 40;
private final UITabbedPane tabbedPane;
private final TemplateThemeManagePane<FormTheme> formThemesManagerPane;
private final TemplateThemeManagePane<ReportTheme> reportThemesManagerPane;
@ -67,7 +98,7 @@ public class TemplateThemeManageDialog extends TemplateThemeDialog {
setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT));
UITabbedPane tabbedPane = new UITabbedPane();
tabbedPane = new UITabbedPane();
add(tabbedPane, BorderLayout.NORTH);
formThemesManagerPane = TemplateThemeManagePane.createFormThemesManagerPane();
@ -88,6 +119,14 @@ public class TemplateThemeManageDialog extends TemplateThemeDialog {
}
}
public TemplateThemeConfig<? extends TemplateTheme> getConfig() {
if (tabbedPane.getSelectedIndex() == 0) {
return FormThemeConfig.getInstance();
} else {
return ReportThemeConfig.getInstance();
}
}
public void exit() {
formThemesManagerPane.stopListenThemeConfig();
formThemesManagerPane.stopAsyncFetchTheme();

60
designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java

@ -1,10 +1,12 @@
package com.fr.design.mainframe.theme.dialog;
import com.fr.base.theme.TemplateTheme;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.theme.TemplateThemeProfilePane;
import com.fr.design.mainframe.theme.provider.ThemeProfileActionProvider;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -13,7 +15,9 @@ import java.awt.Dimension;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
* @author Starryi
@ -24,7 +28,7 @@ public class TemplateThemeProfileDialog<T extends TemplateTheme> extends Templat
private static final int PADDING_VERTICAL = 4;
public static TemplateThemeProfilePane<? extends TemplateTheme> currentVisibleProfilePane;
public static final int CONTENT_WIDTH = 1000;
public static final int CONTENT_WIDTH = 1010;
public static final int CONTENT_HEIGHT = 542;
public TemplateThemeProfileDialog(Window parent, TemplateThemeProfilePane<T> profilePane) {
@ -34,26 +38,11 @@ public class TemplateThemeProfileDialog<T extends TemplateTheme> extends Templat
content.setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT));
content.add(profilePane, BorderLayout.CENTER);
setContentPane(createDialogContentPane(content, new UIButton[]{
profilePane.createSaveButton(),
profilePane.createSaveAsButton(this),
createCancelButton()
}));
setContentPane(createDialogContentPane(content, createActionButtons(profilePane)));
currentVisibleProfilePane = profilePane;
}
private UIButton createCancelButton() {
UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
exit();
}
});
return button;
}
@Override
public void exit() {
currentVisibleProfilePane = null;
@ -74,4 +63,41 @@ public class TemplateThemeProfileDialog<T extends TemplateTheme> extends Templat
protected int getPaddingVertical(){
return PADDING_VERTICAL;
}
private UIButton[] createActionButtons(final TemplateThemeProfilePane<T> profilePane) {
List<UIButton> uiButtonList = new ArrayList<>();
Set<ThemeProfileActionProvider> providers = ExtraDesignClassManager.getInstance().getArray(ThemeProfileActionProvider.MARK_STRING);
for (ThemeProfileActionProvider provider : providers) {
uiButtonList.add(provider.createButton(new ThemeProfileActionProvider.ThemeProfileActionContext() {
@Override
public TemplateThemeDialog getDialog() {
return TemplateThemeProfileDialog.this;
}
@Override
public TemplateThemeProfilePane<? extends TemplateTheme> getProfilePane() {
return profilePane;
}
}));
}
uiButtonList.add(profilePane.createSaveButton());
uiButtonList.add(profilePane.createSaveAsButton(TemplateThemeProfileDialog.this));
uiButtonList.add(createCancelButton());
return uiButtonList.toArray(new UIButton[]{});
}
private UIButton createCancelButton() {
UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
exit();
}
});
return button;
}
}

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

@ -22,6 +22,7 @@ import com.fr.plugin.chart.vanchart.VanChart;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
@ -40,11 +41,12 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane<ReportTheme
public ReportThemePreviewPane() {
setLayout(FRGUIPaneFactory.createBorderLayout());
chartPreviewPane = new ChartPreviewPane();
chartPreviewPane.setPreferredSize(new Dimension(615, 237));
chartPreviewPane.populate(initColumnChart());
chartPreviewPane.setCallbackEvent(this);
reportPreviewPane = new ECReportPreviewPane();
this.add(chartPreviewPane, BorderLayout.CENTER);
this.add(reportPreviewPane, BorderLayout.SOUTH);
this.add(reportPreviewPane, BorderLayout.CENTER);
this.add(chartPreviewPane, BorderLayout.SOUTH);
}
@Override

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

@ -11,6 +11,9 @@ import com.fr.design.mainframe.theme.preview.ecpreview.cell.AbstractPreviewCell;
import java.util.List;
public abstract class AbstractECPreviewPane extends UINoOpaquePanel implements ThemePreviewed<TemplateTheme> {
protected Style getReportBigTitleStyle(ThemedCellStyleList cellStyleList) {
return getCellStyle(cellStyleList.getUse4BigTitle());
}
protected Style getReportHeaderStyle(ThemedCellStyleList cellStyleList) {
return getCellStyle(cellStyleList.getUse4Header());
}

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

@ -3,6 +3,7 @@ package com.fr.design.mainframe.theme.preview.ecpreview;
import com.fr.base.theme.ReportTheme;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedCellStyleList;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.theme.preview.ThemePreviewed;
import com.fr.design.mainframe.theme.preview.UINoOpaquePanel;
@ -21,6 +22,7 @@ import java.util.ArrayList;
import java.util.List;
public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreviewed<ReportTheme> {
private List<AbstractPreviewCell> headerTitleCellList = new ArrayList<>();
private List<AbstractPreviewCell> headerCellList = new ArrayList<>();
private List<AbstractPreviewCell> titleCellList = new ArrayList<>();
private List<AbstractPreviewCell> contentCellList = new ArrayList<>();
@ -56,20 +58,26 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
private JPanel createNorthPane() {
JPanel northPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
CornerPreviewCell cornerCell = new CornerPreviewCell(new String[]{"产品", "数据", "统计维度"}, new Point2D[]{new Point(132, 75), new Point(189, 53)});
cornerCell.setPreferredSize(new Dimension(189, 75));
AbstractPreviewCell bigTitleCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Big_Title"));
bigTitleCell.setPreferredSize(new Dimension(615, 46));
headerTitleCellList.add(bigTitleCell);
northPane.add(bigTitleCell, BorderLayout.NORTH);
CornerPreviewCell cornerCell = new CornerPreviewCell(new String[]{Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Product"),
Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Data"), Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Statistical_Dimension")},
new Point2D[]{new Point(159, 71), new Point(226, 49)});
cornerCell.setPreferredSize(new Dimension(226, 71));
headerCellList.add(cornerCell);
northPane.add(cornerCell, BorderLayout.WEST);
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
northPane.add(centerPane, BorderLayout.CENTER);
PreviewCell cell = new PreviewCell("按地区统计");
PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Statistical_By_Area"));
titleCellList.add(cell);
cell.setPreferredSize(new Dimension(308, 38));
centerPane.add(cell, BorderLayout.NORTH);
JPanel eastSouthPane = new UINoOpaquePanel(new GridLayout());
PreviewCell cell1 = new PreviewCell("华东");
PreviewCell cell2 = new PreviewCell("华南");
PreviewCell cell3 = new PreviewCell("小计");
PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_East_China"));
PreviewCell cell2 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_South_China"));
PreviewCell cell3 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Subtotal"));
headerCellList.add(cell1);
headerCellList.add(cell2);
headerCellList.add(cell3);
@ -84,24 +92,24 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
JPanel westPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
centerPane.add(westPane, BorderLayout.WEST);
PreviewCell cell1 = new PreviewCell("饮料");
PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Drink"));
titleCellList.add(cell1);
cell1.setPreferredSize(new Dimension(94, 183));
cell1.setPreferredSize(new Dimension(112, 153));
westPane.add(cell1, BorderLayout.WEST);
JPanel gridPane = new UINoOpaquePanel(new GridLayout(6, 1));
for (int i = 0; i < 6; i++) {
PreviewCell cell = new PreviewCell("苹果汁");
cell.setPreferredSize(new Dimension(95, 31));
JPanel gridPane = new UINoOpaquePanel(new GridLayout(5, 1));
for (int i = 0; i < 5; i++) {
PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Apple_Juice"));
cell.setPreferredSize(new Dimension(114, 31));
headerCellList.add(cell);
gridPane.add(cell);
}
westPane.add(gridPane, BorderLayout.CENTER);
JPanel innerCenterPane = new UINoOpaquePanel(new GridLayout(6, 3));
JPanel innerCenterPane = new UINoOpaquePanel(new GridLayout(5, 3));
centerPane.add(innerCenterPane, BorderLayout.CENTER);
for (int i = 0; i < 18; i++) {
for (int i = 0; i < 15; i++) {
PreviewCell cell = new PreviewCell("35600");
cell.setPreferredSize(new Dimension(102, 31));
cell.setPreferredSize(new Dimension(123, 31));
if ((i + 1) % 3 == 0) {
highLightCellList.add(cell);
} else {
@ -117,6 +125,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
@Override
public void refresh(TemplateTheme theme) {
ThemedCellStyleList cellStyleConfig = theme.getCellStyleList();
refresh(headerTitleCellList, getReportBigTitleStyle(cellStyleConfig));
refresh(headerCellList, getReportHeaderStyle(cellStyleConfig));
refresh(contentCellList, getMainContentStyle(cellStyleConfig));
refresh(titleCellList, getSmallTitleStyle(cellStyleConfig));

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

@ -21,8 +21,8 @@ public class CornerPreviewCell extends AbstractPreviewCell {
FRFont frFont = style.getFRFont();
g2d.setPaint(frFont.getForeground());
g2d.drawString(values[0], 23, 53);
GraphDrawHelper.drawRotatedString(g2d, values[1], 104, 50, 30);
g2d.drawString(values[2], 128, 23);
GraphDrawHelper.drawRotatedString(g2d, values[1], 128, 50, 30);
g2d.drawString(values[2], 150, 23);
//画分割线
for (int i = 0; i < point2DS.length; i++) {
g2d.draw(new Line2D.Double(0, 0, point2DS[i].getX(), point2DS[i].getY())); //画线

23
designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeManageActionProvider.java

@ -0,0 +1,23 @@
package com.fr.design.mainframe.theme.provider;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
/**
* @author Starryi
* @version 1.0
* Created by Starryi on 2021/9/7
*/
@API(level = ThemeManageActionProvider.CURRENT_LEVEL)
public abstract class AbstractThemeManageActionProvider extends AbstractProvider implements ThemeManageActionProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
}

23
designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeProfileActionProvider.java

@ -0,0 +1,23 @@
package com.fr.design.mainframe.theme.provider;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
/**
* @author Starryi
* @version 1.0
* Created by Starryi on 2021/9/7
*/
@API(level = ThemeProfileActionProvider.CURRENT_LEVEL)
public abstract class AbstractThemeProfileActionProvider extends AbstractProvider implements ThemeProfileActionProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
}

28
designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeManageActionProvider.java

@ -0,0 +1,28 @@
package com.fr.design.mainframe.theme.provider;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeConfig;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.theme.dialog.TemplateThemeDialog;
import com.fr.stable.fun.mark.Mutable;
/**
* @author Starryi
* @version 1.0
* Created by Starryi on 2021/9/7
*/
public interface ThemeManageActionProvider extends Mutable {
String MARK_STRING = "ThemeManageActionProvider";
int CURRENT_LEVEL = 1;
UIButton createButton(ThemeManageActionContext context);
interface ThemeManageActionContext {
TemplateThemeDialog getDialog();
TemplateThemeConfig<? extends TemplateTheme> getConfig();
}
}

27
designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeProfileActionProvider.java

@ -0,0 +1,27 @@
package com.fr.design.mainframe.theme.provider;
import com.fr.base.theme.TemplateTheme;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.theme.TemplateThemeProfilePane;
import com.fr.design.mainframe.theme.dialog.TemplateThemeDialog;
import com.fr.stable.fun.mark.Mutable;
/**
* @author Starryi
* @version 1.0
* Created by Starryi on 2021/9/7
*/
public interface ThemeProfileActionProvider extends Mutable {
String MARK_STRING = "ThemeProfileActionProvider";
int CURRENT_LEVEL = 1;
UIButton createButton(ThemeProfileActionContext context);
interface ThemeProfileActionContext {
TemplateThemeDialog getDialog();
TemplateThemeProfilePane<? extends TemplateTheme> getProfilePane();
}
}

41
designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedFloatElement.java

@ -0,0 +1,41 @@
package com.fr.design.mainframe.theme.utils;
import com.fr.base.NameStyle;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedCellStyle;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.JTemplate;
import com.fr.report.cell.FloatElement;
import com.fr.stable.unit.UNIT;
/**
* @author Starryi
* @version 1.0
* Created by Starryi on 2021/9/9
*/
public class DefaultThemedFloatElement {
public static FloatElement createInstance() {
return themingFloatElement(new FloatElement());
}
public static FloatElement createInstance(Object value) {
return themingFloatElement(new FloatElement(value));
}
public static FloatElement createInstance(UNIT leftDistance, UNIT topDistance, UNIT width, UNIT height, Object value) {
return themingFloatElement(new FloatElement(leftDistance, topDistance, width, height, value));
}
private static FloatElement themingFloatElement(FloatElement floatElement) {
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) {
TemplateTheme theme = template.getTemplateTheme();
ThemedCellStyle themedCellStyle = theme.getCellStyleList().getUse4Default();
if (themedCellStyle != null) {
NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle());
floatElement.setStyle(nameStyle);
}
}
return floatElement;
}
}

35
designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java

@ -18,21 +18,22 @@ import java.util.Map;
*/
public class RolesEditedSourceOP extends RoleSourceOP {
protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map<String, RoleDataWrapper> map) {
List<ExpandMutableTreeNode> roleList = new ArrayList<ExpandMutableTreeNode>();
Iterator<Map.Entry<String, RoleDataWrapper>> entryIt = map.entrySet().iterator();
while (entryIt.hasNext()) {
Map.Entry<String, RoleDataWrapper> entry = entryIt.next();
RoleDataWrapper t = entry.getValue();
JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget();
ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet()));
for (ExpandMutableTreeNode expandMutableTreeNode : expand) {
roleList.add(expandMutableTreeNode);
}
}
return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]);
}
protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map<String, RoleDataWrapper> map) {
List<ExpandMutableTreeNode> roleList = new ArrayList<ExpandMutableTreeNode>();
Iterator<Map.Entry<String, RoleDataWrapper>> entryIt = map.entrySet().iterator();
while (entryIt.hasNext()) {
Map.Entry<String, RoleDataWrapper> entry = entryIt.next();
RoleDataWrapper t = entry.getValue();
JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt.getTarget() instanceof PrivilegeEditedRoleProvider) {
PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget();
ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet()));
for (ExpandMutableTreeNode expandMutableTreeNode : expand) {
roleList.add(expandMutableTreeNode);
}
}
}
return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]);
}
}

2
designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarNoTheme.java

@ -23,7 +23,7 @@ public class FixedGradientBarNoTheme extends FixedGradientBar {
protected void clickButton(int select) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
Color selectColor = getList().get(select).getColorInner() == null ? Color.WHITE : getList().get(select).getColorInner();
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, FixedGradientBarNoTheme.this);
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, FixedGradientBarNoTheme.this, true);
Color color = FixedGradientBarNoTheme.this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);

1
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java

@ -146,6 +146,7 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver,
return false;
}
};
colorPane.setColor(getColor());
colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
hidePopupMenu();

5
designer-base/src/main/java/com/fr/design/style/color/ColorCell.java

@ -10,6 +10,7 @@ import java.awt.event.MouseEvent;
import javax.swing.JComponent;
import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants;
import com.fr.general.ComparatorUtils;
@ -100,6 +101,10 @@ public class ColorCell extends JComponent implements ColorSelectable {
if (e == null || e.getID() == MouseEvent.MOUSE_RELEASED) {
colorSelectable.setColor(this.getColor());
colorSelectable.colorSetted(this);
if (this.getColor() != null) {
int rgb = this.getColor().getRGB();
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(new Color(rgb));
}
}
if (e != null) {

13
designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java

@ -62,19 +62,28 @@ public abstract class ColorControlWindow extends JPopupMenu {
}
protected void initSelectionPopupPane(boolean isSupportTransparent) {
selectionPopupPane = new ColorSelectionPopupPane(isSupportTransparent, supportThemeColor());
selectionPopupPane = createColorSelectionPopupPane(isSupportTransparent);
this.add(selectionPopupPane, BorderLayout.CENTER);
}
protected ColorSelectionPopupPane createColorSelectionPopupPane(boolean isSupportTransparent) {
return new ColorSelectionPopupPane(isSupportTransparent, supportThemeColor());
}
protected boolean supportThemeColor(){
return true;
}
class ColorSelectionPopupPane extends NewColorSelectPane {
protected class ColorSelectionPopupPane extends NewColorSelectPane {
private static final long serialVersionUID = 7822856562329146354L;
public ColorSelectionPopupPane(boolean isSupportTransparent, boolean isSupportThemeColor) {
this(isSupportTransparent, isSupportThemeColor, null);
}
public ColorSelectionPopupPane(boolean isSupportTransparent, boolean isSupportThemeColor, Color color) {
super(isSupportTransparent, isSupportThemeColor);
this.setColor(color);
this.addChangeListener(new ChangeListener() {
@Override

5
designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java

@ -1,6 +1,7 @@
package com.fr.design.style.color;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.DesignerEnvManager;
import com.fr.design.gui.chart.MiddleChartDialog;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.utils.gui.GUICoreUtils;
@ -101,7 +102,9 @@ public class ColorSelectDialog extends MiddleChartDialog{
ok.setActionCommand("OK");
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
seletePane.setColor(okListener.getColor());
Color color = okListener.getColor();
seletePane.setColor(color);
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
doOK();
}
});

4
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

@ -332,9 +332,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
changeListener.stateChanged(evt);
}
}
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color.getColor());
}
this.repaint();
}

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

@ -6,4 +6,5 @@ com.fr.design.report.ReportColumnsPane=800*600
com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=490*95
com.fr.design.version.detail.label=750*30
com.fr.design.version.detail.dialog=900*500
com.fr.design.version.detail.dialog=900*500
com.fr.design.web.pane.text.field=450*20

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

@ -5,4 +5,5 @@ com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=610*280
com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=430*95
com.fr.design.version.detail.label=650*30
com.fr.design.version.detail.dialog=800*500
com.fr.design.version.detail.dialog=800*500
com.fr.design.web.pane.text.field=400*20

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

@ -5,4 +5,5 @@ com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280
com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=450*95
com.fr.design.version.detail.label=700*30
com.fr.design.version.detail.dialog=850*500
com.fr.design.version.detail.dialog=850*500
com.fr.design.web.pane.text.field=450*20

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

@ -6,4 +6,5 @@ com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280
com.fr.env.RemoteEnvPane.dialog=308*132
com.fr.design.version.check.dialog=230*95
com.fr.design.version.detail.label=450*30
com.fr.design.version.detail.dialog=600*500
com.fr.design.version.detail.dialog=600*500
com.fr.design.web.pane.text.field=450*20

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

@ -5,4 +5,5 @@ com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280
com.fr.env.RemoteEnvPane.dialog=308*132
com.fr.design.version.check.dialog=230*95
com.fr.design.version.detail.label=450*30
com.fr.design.version.detail.dialog=600*500
com.fr.design.version.detail.dialog=600*500
com.fr.design.web.pane.text.field=450*20

5
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

@ -370,6 +370,11 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
ColorRecButton.this.repaint();
}
@Override
protected ColorSelectionPopupPane createColorSelectionPopupPane(boolean isSupportTransparent) {
return new ColorSelectionPopupPane(isSupportTransparent, supportThemeColor(), ColorRecButton.this.color);
}
};
}

3
designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java

@ -8,6 +8,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.background.gradient.FixedGradientBarNoTheme;
import com.fr.design.style.color.ColorAdjustPane;
import com.fr.design.style.background.gradient.FixedGradientBar;
@ -58,7 +59,7 @@ public class ChartPreFillStylePane extends BasicBeanPane<ChartColorMatching> {
changeColorSetPane = new JPanel(cardLayout = new CardLayout());
changeColorSetPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 150), "gradient");
changeColorSetPane.add(colorGradient = new FixedGradientBarNoTheme(4, 150), "gradient");
changeColorSetPane.add(colorAdjustPane = new ColorAdjustPane(), "acc");
cardLayout.show(changeColorSetPane, "acc");
customPane.add(changeColorSetPane, BorderLayout.CENTER);

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java

@ -1,9 +1,10 @@
package com.fr.van.chart.designer.style.axis;
import com.fr.chart.base.ColorWithThemeStyle;
import com.fr.chart.chartattr.Axis;
import com.fr.design.i18n.Toolkit;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
@ -16,9 +17,9 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
/**
* 带有坐标轴类型选择控件可选类型分类时间数值
@ -98,11 +99,13 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
public VanChartAxis update(VanChartAxis axis) {
int index = axisTypePane.getSelectedIndex();
ColorWithThemeStyle mainGridColorWithPreStyle = axis.getMainGridColorWithPreStyle();
if(ComparatorUtils.equals(index, AxisType.AXIS_CATEGORY.ordinal())){
if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)){
textAxisPane.updateBean(axis);
} else {
axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor());
axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle);
textAxisPane.updateBean(axis);
}
} else if(ComparatorUtils.equals(index, AxisType.AXIS_TIME.ordinal())){
@ -110,6 +113,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
timeAxisPane.updateBean(axis);
} else {
axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor());
axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle);
timeAxisPane.updateBean(axis);
}
} else if(ComparatorUtils.equals(index, AxisType.AXIS_VALUE.ordinal())){
@ -117,6 +121,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
valueAxisPane.updateBean(axis);
} else {
axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor());
axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle);
valueAxisPane.updateBean(axis);
}
}

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

@ -797,7 +797,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
int formDesignerWidth = designer.getWidth();
int formDesignerHeight = designer.getHeight();
// 不超过可绘制区域
int extraX = Math.min(creatorRightX, formDesignerWidth);
int extraX = creatorRightX < 0 ? 0 : Math.min(creatorRightX, formDesignerWidth);
int extraY = creatorRightY < 0 ? 0 : Math.min(creatorRightY, formDesignerHeight);
if (designer.isFormParaDesigner() && extraY + this.getHeight() >= formDesignerHeight) {

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

@ -3,6 +3,11 @@
*/
package com.fr.design.designer.creator;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeAware;
import com.fr.base.theme.TemplateThemeCompatible;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.creator.cardlayout.XCardAddButton;
import com.fr.design.designer.creator.cardlayout.XCardSwitchButton;
@ -11,11 +16,15 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.fun.ChartWidgetOptionProvider;
import com.fr.design.fun.FormWidgetOptionProvider;
import com.fr.design.fun.ParameterWidgetOptionProvider;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.main.Form;
import com.fr.form.main.WidgetGather;
import com.fr.form.parameter.FormSubmitButton;
import com.fr.form.ui.Button;
import com.fr.form.ui.CardAddButton;
@ -216,6 +225,16 @@ public class XCreatorUtils {
return xClazz;
}
public static XCreator createThemedXCreator(Widget widget) {
XCreator creator = createXCreator(widget);
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
TemplateTheme theme = template.getTemplateTheme();
if (theme instanceof FormTheme) {
setupTemplateTheme(creator, (FormTheme) theme, TemplateThemeCompatible.NONE);
}
return creator;
}
/**
* 创建creator
*
@ -356,4 +375,21 @@ public class XCreatorUtils {
}
return null;
}
public static void setupTemplateTheme(XCreator container, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) {
FineColorManager.traverse(container.toData(), new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible));
Form.traversalWidget(container.toData(), new WidgetGather() {
@Override
public void dealWith(Widget widget) {
TemplateThemeAware<FormTheme> themedWidget = (TemplateThemeAware) widget;
themedWidget.onTemplateUsingThemeChange(currentTemplateUsingTheme, compatible);
}
@Override
public boolean dealWithAllCards() {
return true;
}
}, TemplateThemeAware.class);
}
}

36
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -1195,9 +1195,6 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @param xCreator 组件
*/
public void startDraggingBean(XCreator xCreator) {
// 新疆的图表块和报表块默认主题化
addThemeToDroppedNewWidget(xCreator);
// 根据所选择的组件的BeanInfo生成相应的AddingModel
// AddingModel和StateModel不一样,适合当前选择的组件相关的
addingModel = new AddingModel(this, xCreator);
@ -1862,37 +1859,4 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
public FormSpacingLineDrawer getSpacingLineDrawer() {
return spacingLineDrawer;
}
private void addThemeToDroppedNewWidget(XCreator addingXCreator) {
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template == null) {
return;
}
TemplateTheme theme = template.getTemplateTheme();
if (!(theme instanceof FormTheme)) {
return;
}
FormTheme formTheme = (FormTheme) theme;
Form.traversalWidget(addingXCreator.toData(), new WidgetGather() {
@Override
public void dealWith(Widget widget) {
if (widget instanceof AbstractBorderStyleWidget) {
AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) widget;
if (!styleWidget.supportThemed()) {
return;
}
boolean followingTheme = (!addingXCreator.isShared()) || styleWidget.isBorderStyleFollowingTheme();
styleWidget.setBorderStyleFollowingTheme(followingTheme);
if (followingTheme) {
styleWidget.onTemplateUsingThemeChange(formTheme, TemplateThemeCompatible.NONE);
}
}
}
@Override
public boolean dealWithAllCards() { return true; }
}, AbstractBorderStyleWidget.class);
addingXCreator.rebuid();
}
}

33
designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java

@ -137,43 +137,22 @@ public class FormSpacingLineDrawer {
GraphDrawHelper.drawString(g2d, text, labelX, labelY);
}
private boolean isSelectedParaComponent() {
return designer.getParaComponent() == selectedCreator;
}
private boolean isSelectedRootComponent() {
return designer.isRoot(selectedCreator);
}
private boolean isSelectedForm() {
return selectedCreator.getParent() == null;
}
private boolean isNeedExtendedLine(AbstractFormParallelLine[] nearestSides) {
return nearestSides[0].isVerticalCenterLineBeforeTheParallelLine(nearestSides[1]) || nearestSides[0].isVerticalCenterLineBehindTheParallelLine(nearestSides[1]);
}
private boolean isSelectedRootPane() {
// form、body、para这三个选中了,都不要画任何间距线
return isSelectedForm() || isSelectedRootComponent() || isSelectedParaComponent();
}
// 当前组件是否在参数面板里面
private boolean isCompInBody(XCreator creator) {
private boolean isComponentInBody(XCreator creator) {
XLayoutContainer container = XCreatorUtils.getHotspotContainer(creator);
return container != null && !container.acceptType(XWParameterLayout.class);
}
private boolean isSelectedCompInBody() {
return isCompInBody(selectedCreator);
}
private boolean isHoveredCompInBody() {
return isCompInBody(hoverCreator);
private boolean isSelectedComponentInBody() {
return isComponentInBody(selectedCreator);
}
private boolean isCompInBody() {
return isSelectedCompInBody() && isHoveredCompInBody();
private boolean isHoveredComponentInBody() {
return isComponentInBody(hoverCreator);
}
private boolean isBodyAbsoluteLayout() {
@ -185,7 +164,7 @@ public class FormSpacingLineDrawer {
}
private boolean isDrawSpacingLine() {
return isInAbsoluteLayout() && !isSelectedRootPane() && isCompInBody();
return isInAbsoluteLayout() && isSelectedComponentInBody() && isHoveredComponentInBody();
}
private AbstractFormParallelLine[] getNearestHorizontalSide() {

10
designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe.share.generate.task;
import com.fr.base.TableData;
import com.fr.base.iofile.attr.ExtendSharableAttrMark;
import com.fr.base.iofile.attr.SharableAttrMark;
import com.fr.base.theme.TemplateTheme;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.share.generate.impl.AbstractComponentCreatorProcessor;
@ -39,6 +40,8 @@ public class ComponentCreator extends AbstractComponentCreatorProcessor {
@Override
public ComponentReuBean create(JTemplate<?, ?> jt, Map<String, Object> paraMap, Widget widget, DefaultSharableWidget info) throws Exception {
// 适用于共享组件的模版主题
setSuitableTemplateThemeName(jt, info);
// 遍历判断是否存在共享组件
checkOriginStatus(widget, info);
@ -56,6 +59,13 @@ public class ComponentCreator extends AbstractComponentCreatorProcessor {
return new ComponentReuBean(generatePath, editor, info);
}
private void setSuitableTemplateThemeName(JTemplate<?, ?> jt, DefaultSharableWidget info) {
TemplateTheme theme = jt.getTemplateTheme();
if (theme != null) {
info.setSuitableTemplateThemeName(theme.getName());
}
}
protected void checkOriginStatus(Widget widget, final DefaultSharableWidget info) {
Form.traversalWidget(widget, new WidgetGatherAdapter() {

3
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java

@ -211,7 +211,8 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
creatorSource.setWidgetID(UUID.randomUUID().toString());
((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true));
//tab布局WCardMainBorderLayout通过反射出来的大小是960*480
XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, no.getBindInfo());
String suitableTemplateThemeName = no.getWidget().getSuitableTemplateThemeName();
XCreator xCreator = ShareComponentUtils.createThemedXCreator(creatorSource, suitableTemplateThemeName, shareId, no.getBindInfo());
WidgetToolBarPane.getTarget().startDraggingBean(xCreator);
lastPressEvent = null;
this.setBorder(null);

9
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java

@ -12,6 +12,7 @@ import com.fr.design.login.DesignerLoginHelper;
import com.fr.design.login.DesignerLoginSource;
import com.fr.design.mainframe.WidgetToolBarPane;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.form.share.DefaultSharableWidget;
import com.fr.form.share.group.DefaultShareGroup;
import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane;
import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane;
@ -143,7 +144,13 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true));
SharableWidgetProvider bindInfo = ShareUtils.getElCaseBindInfoById(shareId);
//tab布局WCardMainBorderLayout通过反射出来的大小是960*480
XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, bindInfo);
XCreator xCreator;
if (bindInfo instanceof DefaultSharableWidget) {
String suitableTemplateThemeName = ((DefaultSharableWidget) bindInfo).getSuitableTemplateThemeName();
xCreator = ShareComponentUtils.createThemedXCreator(creatorSource, suitableTemplateThemeName, shareId, bindInfo);
} else {
xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, bindInfo);
}
WidgetToolBarPane.getTarget().startDraggingBean(xCreator);
lastPressEvent = null;
this.setBorder(null);

16
designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java

@ -2,6 +2,9 @@ package com.fr.design.mainframe.share.util;
import com.fr.base.io.IOFile;
import com.fr.base.iofile.attr.ExtendSharableAttrMark;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeCompatible;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
@ -50,6 +53,19 @@ public class ShareComponentUtils {
return xCreator;
}
public static XCreator createThemedXCreator(Widget creatorSource, String suitableTemplateThemeName, String shareId, SharableWidgetProvider provider) {
XCreator creator = createXCreator(creatorSource, shareId, provider);
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
TemplateTheme theme = template.getTemplateTheme();
if (theme instanceof FormTheme) {
boolean isCurrentUsingThemeSuitSharedComponent = StringUtils.isNotEmpty(theme.getName()) &&
StringUtils.isNotEmpty(suitableTemplateThemeName) &&
StringUtils.equals(theme.getName(), suitableTemplateThemeName);
XCreatorUtils.setupTemplateTheme(creator, (FormTheme) theme, isCurrentUsingThemeSuitSharedComponent ? TemplateThemeCompatible.NONE : TemplateThemeCompatible.ABSENT);
}
return creator;
}
/**
* 检查readme.txt文件
*/

3
designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java

@ -13,6 +13,7 @@ import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.chart.MiddleChartDialog;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.module.DesignModuleFactory;
import com.fr.grid.Grid;
@ -90,7 +91,7 @@ public class ChartFloatAction extends ElementCaseAction {
public void doOk() {
isRecordNeeded = true;
FloatElement newFloatElement;
newFloatElement = new FloatElement(chartDialog.getChartCollection());
newFloatElement = DefaultThemedFloatElement.createInstance(chartDialog.getChartCollection());
newFloatElement.setWidth(new OLDPIX(BaseChartCollection.CHART_DEFAULT_WIDTH));
newFloatElement.setHeight(new OLDPIX(BaseChartCollection.CHART_DEFAULT_HEIGHT));

3
designer-realize/src/main/java/com/fr/design/actions/insert/flot/FormulaFloatAction.java

@ -14,6 +14,7 @@ import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement;
import com.fr.design.menu.MenuKeySet;
import com.fr.grid.Grid;
@ -99,7 +100,7 @@ public class FormulaFloatAction extends ElementCaseAction {
}
reportPane.stopEditing();
final FloatElement floatElement = new FloatElement();
final FloatElement floatElement = DefaultThemedFloatElement.createInstance();
final UIFormula formulaPane = FormulaFactory.createFormulaPane();
formulaPane.populate(BaseFormula.createFormulaBuilder().build());

3
designer-realize/src/main/java/com/fr/design/actions/insert/flot/ImageFloatAction.java

@ -12,6 +12,7 @@ import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.report.SelectImagePane;
@ -73,7 +74,7 @@ public class ImageFloatAction extends ElementCaseAction {
reportPane.stopEditing();
final FloatElement floatElement = new FloatElement();
final FloatElement floatElement = DefaultThemedFloatElement.createInstance();
final SelectImagePane selectImagePane = new SelectImagePane();
selectImagePane.populate(floatElement);

3
designer-realize/src/main/java/com/fr/design/actions/insert/flot/TextBoxFloatAction.java

@ -6,6 +6,7 @@ package com.fr.design.actions.insert.flot;
import com.fr.base.DynamicUnitList;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement;
import com.fr.design.menu.MenuKeySet;
import com.fr.grid.Grid;
@ -59,7 +60,7 @@ public class TextBoxFloatAction extends AbstractShapeAction {
if (jws == null) {
return;
}
FloatElement floatElement = new FloatElement("Text");
FloatElement floatElement = DefaultThemedFloatElement.createInstance("Text");
this.startDraw(floatElement);
doWithDrawingFloatElement();
}

3
designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

@ -27,6 +27,7 @@ import com.fr.third.guava.cache.CacheBuilder;
import com.fr.third.guava.collect.Multimap;
import com.fr.workspace.WorkContext;
import javax.swing.SwingUtilities;
import java.time.Duration;
import java.util.Collection;
import java.util.Map;
@ -183,7 +184,7 @@ public class DesignerAppUtils {
// 试图获取多行读取错误提示并缓存待处理列表
String detail = dealWithErrorDetailMultiLineAndCache(path);
if (detail.length() > 0) {
UIUtil.invokeLaterIfNeeded(() -> {
SwingUtilities.invokeLater(() -> {
if (WorkContext.getCurrent().isLocal()) {
UIExpandDialog.Builder()
.owner(DesignerContext.getDesignerFrame())

5
designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

@ -21,6 +21,8 @@ import com.fr.form.main.Form;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.report.util.ReadXmlType;
import com.fr.report.util.ReadXmlTypeLocalManager;
import com.fr.stable.Constants;
import com.fr.stable.bridge.StableFactory;
import org.jetbrains.annotations.Nullable;
@ -90,13 +92,16 @@ class FormApp extends AbstractAppProvider {
@Nullable
private Form getForm(FILE tplFile) {
ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN);
Form form = asIOFile(tplFile);
ReadXmlTypeLocalManager.remove();
if (form != null) {
DesignerAppUtils.dealWithTemplateIOError(tplFile.getPath());
}
return form;
}
@Override
public Form asIOFile(FILE file) {

3
designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java

@ -5,6 +5,7 @@ import com.fr.design.gui.frpane.EditingStringListPane;
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.i18n.DesignSizeI18nManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.file.FILE;
@ -38,7 +39,7 @@ public class WebCssPane extends BasicPane {
JPanel outnorth = new JPanel(new BorderLayout(0, 5));
JPanel northPane = new JPanel(new FlowLayout(FlowLayout.LEFT,8,0));
localText = new UITextField();
localText.setPreferredSize(new Dimension(450, 20));
localText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field"));
localText.setEditable(false);
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection"));
chooseFile.setPreferredSize(new Dimension(75, 23));

5
designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

@ -7,6 +7,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.file.FILE;
@ -66,8 +67,8 @@ public class WebJsPane extends BasicPane {
localText = new UITextField();
localText.setEditable(false);
urlText = new UITextField();
localText.setPreferredSize(new Dimension(450, 20));
urlText.setPreferredSize(new Dimension(450, 20));
localText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field"));
urlText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field"));
urlText.addKeyListener(urlTextListener);
urlText.setEnabled(false);
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection"));

Loading…
Cancel
Save