Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~hades/design into release/10.0

feature/big-screen
hades 4 years ago
parent
commit
efb007f81e
  1. 14
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  2. 33
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 19
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java
  4. 9
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSettingPane.java
  5. 6
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java
  6. 18
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java
  7. 21
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleListControlPane.java
  8. 2
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ImageDetailPane.java
  9. 12
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/cell/CustomPredefinedStylePane.java
  10. 46
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ComponentPreviewPane.java
  11. 132
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java
  12. 6
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java
  13. 7
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  14. 8
      designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java
  15. 1
      designer-base/src/main/resources/com/fr/design/mainframe/predefined/previewData
  16. 3
      designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java
  17. 36
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java
  18. 60
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java
  19. 13
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java
  20. 34
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java
  21. 20
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java
  22. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  23. 9
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java
  24. 12
      designer-form/src/main/java/com/fr/design/gui/xpane/FormPredefinedBackgroundPane.java
  25. 14
      designer-form/src/main/java/com/fr/design/gui/xpane/PredefinedComponentStyleSettingPane.java
  26. 1
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  27. 22
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  28. 16
      designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java
  29. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  30. 39
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java
  31. 10
      designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java

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

@ -13,6 +13,7 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JTemplateFactory;
import com.fr.design.mainframe.JVirtualTemplate;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.file.FILE;
import com.fr.file.FileNodeFILE;
import com.fr.file.StashedFILE;
@ -22,6 +23,7 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.io.FilenameUtils;
import javax.swing.SwingUtilities;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Collections;
@ -427,4 +429,16 @@ public class HistoryTemplateListCache implements CallbackEvent {
jt.refreshResource();
}
}
/**
* 重绘当前模板
*/
public void repaintCurrentEditingTemplate(){
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
getCurrentEditingTemplate().repaint();
}
});
}
}

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

@ -51,6 +51,7 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.menu.NameSeparator;
import com.fr.design.menu.ShortCut;
import com.fr.design.preview.PagePreview;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils;
import com.fr.design.write.submit.DBManipulationInWidgetEventPane;
import com.fr.design.write.submit.DBManipulationPane;
@ -120,6 +121,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
private PreviewProvider previewType;
protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer();
public int resolution = ScreenResolution.getScreenResolution();
private UIButton predefinedBtn;
private PluginEventListener pluginListener;
@ -570,6 +572,18 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
protected abstract void applyUndoState(U u);
protected void refreshPredefinedState() {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
if(predefinedBtn != null){
JTemplate.this.predefinedBtn.setText(getTemplatePredefinedStyle());
setPredefinedButtonSize(predefinedBtn);
}
}
});
}
/**
* 停止编辑, 判断保存属性 *
*/
@ -1323,7 +1337,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
for (DesignerFrameUpButtonProvider provider : providers) {
uiButtons = ArrayUtils.addAll(uiButtons, provider.getUpButtons(getMenuState()));
}
UIButton predefinedBtn = createPreDefinedButton();
predefinedBtn = createPreDefinedButton();
if (predefinedBtn != null) {
uiButtons = ArrayUtils.addAll(uiButtons, new UIButton[]{predefinedBtn});
}
@ -1341,7 +1355,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
@Override
public void actionPerformed(ActionEvent e) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
ReportPredefinedStylePane stylePane = new ReportPredefinedStylePane(JTemplate.this, preferenceButton);
ReportPredefinedStylePane stylePane = new ReportPredefinedStylePane(JTemplate.this);
ReportPredefinedStyleDialog dialog = new ReportPredefinedStyleDialog(designerFrame, stylePane);
PredefinedStyleInfoCollector.getInstance().collectClickNumber();
dialog.setVisible(true);
@ -1360,12 +1374,17 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
predefinedBtn.setPreferredSize(new Dimension(Math.min(metrics.stringWidth(text) + PREDEFINED_ICON_WIDTH, 100), 20));
}
public void resetPredefinedStyle(String styleName, UIButton predefinedBtn) {
public void resetPredefinedStyle(String styleName) {
this.getTarget().setPredefinedStyleName(styleName, true);
predefinedBtn.setText(getTemplatePredefinedStyle());
setPredefinedButtonSize(predefinedBtn);
this.fireTargetModified();
this.repaint();
refreshPredefinedState();
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
JTemplate.this.fireTargetModified();
JTemplate.this.repaint();
}
});
}
public String getTemplatePredefinedStyle(){

19
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java

@ -12,6 +12,7 @@ import com.fr.config.predefined.PredefinedStyle;
import com.fr.config.predefined.PredefinedStyleConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UITabbedPane;
@ -25,10 +26,13 @@ import com.fr.design.mainframe.predefined.ui.detail.PredefinedBackgroundSettingP
import com.fr.design.mainframe.predefined.ui.detail.ComponentStyleSettingPane;
import com.fr.design.mainframe.predefined.ui.detail.CellStyleListControlPane;
import com.fr.design.mainframe.predefined.ui.preview.PredefinedStylePreviewPane;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils;
import com.fr.general.FRFont;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
@ -185,6 +189,12 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
this.cellStyleSettingPane = new CellStyleListControlPane();
this.cellStyleSettingPane.registerAttrChangeListener(new AttributeChangeListener() {
@Override
public void attributeChange() {
valueChangeAction();
}
});
jPanel.add(this.cellStyleSettingPane);
return jPanel;
}
@ -288,7 +298,7 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
if (!saveStyle(previewObject)) {
return false;
}
DesignUtils.refreshDesignerFrame();
HistoryTemplateListCache.getInstance().repaintCurrentEditingTemplate();
return true;
}
@ -302,7 +312,12 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
}
config.add(previewObject);
PredefinedStyleConfig sortedConfig = resortConfigStyles(previewObject, config);
ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(sortedConfig);
Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) {
@Override
public void run() {
ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(sortedConfig);
}
});
selectPane.refreshPane();
return true;
}

9
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSettingPane.java

@ -9,7 +9,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -68,6 +67,7 @@ public abstract class PredefinedStyleSettingPane<T> extends AbstractAttrNoScroll
predefinedRadioBtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
populateCustomPane();
tabbedPane.show(center, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined"));
}
});
@ -125,6 +125,13 @@ public abstract class PredefinedStyleSettingPane<T> extends AbstractAttrNoScroll
return template.getTemplatePredefinedStyle();
}
/**
* 用于在切换到预定义样式后重置自定义样式的设置
*/
protected abstract void populateCustomPane();
/**
* 展示数据
*

6
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java

@ -16,11 +16,9 @@ import java.awt.FlowLayout;
public class ReportPredefinedStylePane extends BasicPane {
private PredefinedStyleSelectPane selectPane;
private JTemplate currentTemplate;
private UIButton preferenceBtn;
public ReportPredefinedStylePane(JTemplate jTemplate, UIButton preferenceButton) {
public ReportPredefinedStylePane(JTemplate jTemplate) {
this.currentTemplate = jTemplate;
this.preferenceBtn = preferenceButton;
initPane();
}
@ -38,7 +36,7 @@ public class ReportPredefinedStylePane extends BasicPane {
public void update() {
PredefinedStyle style = selectPane.update();
if (style != null) {
currentTemplate.resetPredefinedStyle(style.getStyleName(), preferenceBtn);
currentTemplate.resetPredefinedStyle(style.getStyleName());
}
}

18
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java

@ -21,6 +21,8 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.DesignUtils;
import com.fr.stable.StringUtils;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javax.swing.BorderFactory;
import javax.swing.JOptionPane;
@ -138,8 +140,12 @@ public class ServerPredefinedStylePane extends BasicPane {
if (style != null) {
PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig();
config.setDefaultPredefinedStyle(style.getStyleName());
ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config);
DesignUtils.refreshDesignerFrame();
Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) {
@Override
public void run() {
ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config);
}
});
}
}
@ -201,8 +207,12 @@ public class ServerPredefinedStylePane extends BasicPane {
private void removeStyle(String name) {
PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig();
config.removeStyle(name);
ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config);
DesignUtils.refreshDesignerFrame();
Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) {
@Override
public void run() {
ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config);
}
});
}
}

21
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleListControlPane.java

@ -14,6 +14,7 @@ import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.gui.style.AlignmentPane;
@ -24,6 +25,7 @@ import com.fr.design.mainframe.predefined.ui.detail.cell.CustomPredefinedStylePa
import com.fr.design.menu.ShortCut;
import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject;
import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
@ -49,6 +51,9 @@ import java.util.List;
*/
public class CellStyleListControlPane extends JListControlPane {
private boolean namePermitted = true;
private AttributeChangeListener attributeChangeListener;
public CellStyleListControlPane() {
super();
@ -73,6 +78,13 @@ public class CellStyleListControlPane extends JListControlPane {
});
}
public void registerAttrChangeListener(AttributeChangeListener listener){
this.attributeChangeListener = listener;
}
private void showTipDialogAndReset(String content, int index) {
nameableList.stopEditing();
@ -98,6 +110,15 @@ public class CellStyleListControlPane extends JListControlPane {
PredefinedCellStyle.class, CustomPredefinedStylePane.class)};
}
@Override
public BasicBeanPane createPaneByCreators(NameableCreator creator) {
CustomPredefinedStylePane stylePane = (CustomPredefinedStylePane) super.createPaneByCreators(creator);
stylePane.registerAttrChangeListener(attributeChangeListener);
return stylePane;
}
@Override
protected String title4PopupWindow() {
return StringUtils.EMPTY;

2
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ImageDetailPane.java

@ -98,7 +98,7 @@ public class ImageDetailPane extends AbstractBackgroundDetailPane<ImageBackgroun
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Fill_Mode")), jp}
};
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_NONE,
IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1);
IntervalConstants.INTERVAL_L4, IntervalConstants.INTERVAL_L1);
selectFilePane.add(centerPane, BorderLayout.CENTER);
return selectFilePane;
}

12
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/cell/CustomPredefinedStylePane.java

@ -39,6 +39,7 @@ public class CustomPredefinedStylePane extends MultiTabPane<PredefinedCellStyle>
private PredefinedCellStyle cellStyle;
private PreviewArea previewArea;
private boolean populating;
private AttributeChangeListener attributeChangeListener;
public CustomPredefinedStylePane() {
@ -49,6 +50,16 @@ public class CustomPredefinedStylePane extends MultiTabPane<PredefinedCellStyle>
tabPane.setLayout(new GridLayout(1, 3, 0, 0));
}
public void registerAttrChangeListener(AttributeChangeListener listener){
this.attributeChangeListener = listener;
}
private void fireAttrChangeListener() {
if (this.attributeChangeListener != null) {
this.attributeChangeListener.attributeChange();
}
}
/**
* @return
*/
@ -141,6 +152,7 @@ public class CustomPredefinedStylePane extends MultiTabPane<PredefinedCellStyle>
if (cellStyle != null) {
previewArea.preview(cellStyle.getStyle());
}
fireAttrChangeListener();
}
});
BasicScrollPane basicScrollPane = new AttrScrollPane() {

46
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ComponentPreviewPane.java

@ -8,6 +8,7 @@ import com.fr.general.Background;
import com.fr.general.FRFont;
import com.fr.general.act.BorderPacker;
import com.fr.general.act.TitlePacker;
import com.fr.stable.Constants;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
@ -24,7 +25,7 @@ import java.awt.geom.Rectangle2D;
*/
public abstract class ComponentPreviewPane extends StyleSettingPreviewPane {
private PredefinedStyle style = new PredefinedStyle();
private static final int SMALL_GAP = 5;
private static final int SMALL_GAP = 10;
private static final int GAP = 10;
private JPanel contentPane;
private TitlePreviewPane titlePane;
@ -53,23 +54,16 @@ public abstract class ComponentPreviewPane extends StyleSettingPreviewPane {
this.style = style;
}
@Override
public void paint(Graphics g) {
paintContent(g);
}
public void paintContent(Graphics g) {
public void paintComponents(Graphics g) {
BorderPacker borderStyle = style.getComponentStyle().getBorderStyle();
updateBorders(g, borderStyle);
paintTitle(g, borderStyle.getTitle());
paintContentPane(g,borderStyle);
paintContentPane(g, borderStyle);
super.paintComponents(g);
}
private void paintContentPane(Graphics g, BorderPacker borderStyle) {
@ -79,18 +73,15 @@ public abstract class ComponentPreviewPane extends StyleSettingPreviewPane {
if (borderStyle.getBackground() != null) {
borderStyle.getBackground().paint(clipg, clipg.getClipBounds());
}
this.contentPane.paint(clipg);
clipg.dispose();
}
private void paintTitle(Graphics g, TitlePacker titlePacker) {
FRFont font = titlePacker.getFrFont();
Background background = titlePacker.getBackground();
if (background != null) {
background.paint(g, new Rectangle2D.Double(10, 5, this.titlePane.getWidth(), this.titlePane.getHeight()));
}
titlePane.setFontObject(font);
titlePane.setTitleObject(titlePacker);
titlePane.paintComponent(g);
}
@ -103,6 +94,7 @@ public abstract class ComponentPreviewPane extends StyleSettingPreviewPane {
private class TitlePreviewPane extends JPanel {
private FRFont frFont = null;
private int titlePosition = Constants.LEFT;
public TitlePreviewPane() {
this.setBackground(null);
@ -127,19 +119,23 @@ public abstract class ComponentPreviewPane extends StyleSettingPreviewPane {
} else {
g2d.setColor(new Color(237, 237, 237));
}
g2d.setFont(frFont.applySize(14).applyResolutionNP(96));
int startY = 0;
startY = (d.height + fm.getHeight()) / 2;
drawTabBack(g2d, startY);
}
private void drawTabBack(Graphics2D g2d, int startY) {
g2d.setFont(frFont.applyResolutionNP(96));
String paintText = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Predefined_Preview_Title_Text");
GraphHelper.drawString(g2d, paintText, GAP, 32);
int startY = 0, startX = 0;
startX = (d.width - fm.stringWidth(paintText)) / 2;
startY = (d.height - fm.getHeight()) / 2 + fm.getAscent();
if (this.titlePosition == Constants.LEFT) {
startX = GAP;
} else if (this.titlePosition == Constants.RIGHT) {
startX = d.width - fm.stringWidth(paintText) - GAP - fm.getMaxAdvance();
}
GraphHelper.drawString(g2d, paintText, startX, startY);
}
public void setFontObject(FRFont font) {
this.frFont = font;
public void setTitleObject(TitlePacker titlePacker) {
this.frFont = titlePacker.getFrFont();
this.titlePosition = titlePacker.getPosition();
}
}

132
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java

@ -1,21 +1,26 @@
package com.fr.design.mainframe.predefined.ui.preview;
import com.fr.design.gui.ilable.UILabel;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.config.predefined.PredefinedCellStyle;
import com.fr.config.predefined.PredefinedCellStyleConfig;
import com.fr.config.predefined.PredefinedStyle;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.FRFont;
import com.fr.log.FineLoggerFactory;
import com.fr.third.javax.annotation.Nonnull;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
/**
* Created by kerry on 2020-09-04
@ -23,6 +28,7 @@ import java.awt.Dimension;
public class ElementCasePreview extends ComponentPreviewPane {
private static final List<String[]> PREVIEW_DATA_LIST = new ArrayList<>();
private static final String BLANK_CHAR = " ";
private List<GridRowPane> gridRowPanes;
static {
readPreviewData();
@ -44,56 +50,122 @@ public class ElementCasePreview extends ComponentPreviewPane {
}
}
@Override
protected JPanel createContentPane() {
gridRowPanes = new ArrayList<>();
JPanel jPanel = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
jPanel.setOpaque(false);
jPanel.setBackground(null);
FRFont font = FRFont.getInstance();
font = font.applySize(11);
FRFont titleFont = font.applySize(14).applyForeground(Color.decode("#63B2EE"));
FRFont endFont = font.applySize(11).applyForeground(Color.decode("#1B97FF"));
for (int i = 0; i < PREVIEW_DATA_LIST.size(); i++) {
FRFont frFont = font;
GridRowPane gridRowPane = new GridRowPane(PREVIEW_DATA_LIST.get(i), Style.DEFAULT_STYLE);
gridRowPanes.add(gridRowPane);
jPanel.add(gridRowPane);
}
return jPanel;
}
public void refresh(PredefinedStyle style) {
super.refresh(style);
PredefinedCellStyleConfig cellStyleConfig = style.getCellStyleConfig();
for (int i = 0; i < gridRowPanes.size(); i++) {
Style renderStyle = getMainContentStyle(cellStyleConfig);
if (i == 0) {
frFont = titleFont;
renderStyle = getReportHeaderStyle(cellStyleConfig);
}
if (i == PREVIEW_DATA_LIST.size() - 1) {
frFont = endFont;
renderStyle = getHighLightStyle(cellStyleConfig);
}
jPanel.add(new GridRowPane(frFont, PREVIEW_DATA_LIST.get(i)));
gridRowPanes.get(i).preview(renderStyle);
}
}
return jPanel;
private Style getReportHeaderStyle(PredefinedCellStyleConfig config) {
return getCellStyle(config, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header"));
}
private Style getMainContentStyle(PredefinedCellStyleConfig config) {
return getCellStyle(config, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text"));
}
private Style getHighLightStyle(PredefinedCellStyleConfig config) {
return getCellStyle(config, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text"));
}
@Nonnull
private Style getCellStyle(PredefinedCellStyleConfig config, String styleName) {
PredefinedCellStyle cellStyle = config.getStyle(styleName);
if (cellStyle == null) {
return Style.DEFAULT_STYLE;
}
return cellStyle.getStyle();
}
class GridRowPane extends JPanel {
public GridRowPane(FRFont frFont, String[] data) {
private List<GridPreview> gridPreviews = new ArrayList<>();
public GridRowPane(String[] data, Style style) {
this.setOpaque(false);
this.setBackground(null);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel panel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(4, 20, 10);
JPanel panel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(4, 0, 0);
panel.setOpaque(false);
panel.setBackground(null);
for (String text : data) {
panel.add(createLabel(text, frFont));
GridPreview gridPreview = new GridPreview(text);
gridPreviews.add(gridPreview);
panel.add(gridPreview);
}
this.add(panel, BorderLayout.CENTER);
JSeparator jSeparator = new JSeparator();
jSeparator.setPreferredSize(new Dimension(246, 2));
this.add(jSeparator, BorderLayout.SOUTH);
preview(style);
}
private UILabel createLabel(String text, FRFont frFont) {
UILabel label = new UILabel(text);
label.setFont(frFont);
label.setForeground(frFont.getForeground());
label.setBackground(null);
return label;
public void preview(Style style) {
for (GridPreview grid : gridPreviews) {
grid.preview(style);
}
}
}
private static class GridPreview extends JComponent {
private Style style = Style.DEFAULT_STYLE;
private String value;
public GridPreview(String value) {
this.value = value;
setPreferredSize(new Dimension(125, 30));
}
public void preview(Style style) {
this.style = style;
}
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
int resolution = ScreenResolution.getScreenResolution();
if (style == Style.DEFAULT_STYLE) {
Style.paintContent(g2d, value, style, getWidth() - 3, getHeight() - 3, resolution);
return;
}
Style.paintBackground(g2d, style, getWidth(), getHeight());
Style.paintContent(g2d, value, style, getWidth() - 3, getHeight() - 3, resolution);
Style.paintBorder(g2d, style, getWidth() , getHeight() );
}
@Override
public Dimension getMinimumSize() {
return getPreferredSize();
}
}
}

6
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java

@ -37,7 +37,7 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen
private ChartPreStylePreView columnChartPane;
private int COLUMN_CHART_WIDTH = 517;
private int COLUMN_CHART_HEIGHT = 300;
private int COLUMN_CHART_HEIGHT = 290;
private JPanel parent;
@ -51,7 +51,7 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen
this.setBackground(Color.WHITE);
this.elementCasePreview = new ElementCasePreview();
this.add(initChartPreViewPane());
this.elementCasePreview.setPreferredSize(new Dimension(517, 190));
this.elementCasePreview.setPreferredSize(new Dimension(517, 200));
this.add(this.elementCasePreview);
}
@ -120,7 +120,7 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen
this.columnChartPane.paintComponent(g);
g.translate(0, COLUMN_CHART_HEIGHT);
this.elementCasePreview.paintContent(g);
this.elementCasePreview.paintComponents(g);
g.translate(0, -COLUMN_CHART_HEIGHT);
// 恢复双缓冲
ComponentUtils.resetBuffer(dbcomponents);

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

@ -54,7 +54,9 @@ import com.fr.design.mainframe.ToolBarNewTemplatePane;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.SnapChatMenuDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.notification.SnapChatAllTypes;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.remote.action.RemoteDesignAuthManagerAction;
import com.fr.design.update.actions.SoftwareUpdateAction;
@ -72,7 +74,6 @@ import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.start.OemHandler;
import com.fr.workspace.WorkContext;
@ -468,7 +469,9 @@ public abstract class ToolBarMenuDock {
}
protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) {
MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S');
MenuDef menuDef = new SnapChatMenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S',
SnapChatAllTypes.Menu.SERVER);
if (!DesignerMode.isAuthorityEditing()) {
menuDef.addShortCut(

8
designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java

@ -12,7 +12,13 @@ public abstract class SnapChatAllTypes {
/**
* 社区按钮
*/
BBS("BBS");
BBS("BBS"),
/**
* 服务器按钮
*/
SERVER("SERVER");
private static final String SIGN = "0001";

1
designer-base/src/main/resources/com/fr/design/mainframe/predefined/previewData

@ -2,5 +2,4 @@
南通市 324,646 324,646 100%
合肥市 248,938 348,938 140%
邵阳市 248,938 348,938 140%
苏州市 248,938 348,938 140%
合计 1,071,460 1,371,460 128%

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

@ -18,6 +18,7 @@ import com.fr.plugin.chart.vanchart.export.ImagePainter;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.van.chart.DownloadOnlineSourcesHelper;
import com.fr.van.chart.designer.component.VanChartRichEditorPane;
/**
* Created by juhaoyu on 2018/6/27.
@ -47,6 +48,8 @@ public class ChartDesignerActivator extends Activator implements Prepare {
ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
ImagePainter.registerDefaultCallbackEvent(HistoryTemplateListCache.getInstance());
VanChartRichEditorPane.initRichEditorPane();
ChartTypeInterfaceManager.addPluginChangedListener();
}

36
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java

@ -1,6 +1,8 @@
package com.fr.van.chart.designer.component;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.ui.ModernUIPane;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.type.TextAlign;
import com.fr.stable.StringUtils;
@ -10,6 +12,8 @@ import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class VanChartRichEditorPane {
@ -21,6 +25,25 @@ public class VanChartRichEditorPane {
private static ModernUIPane<RichEditorModel> richEditorPane;
private static Browser browser;
public static void initRichEditorPane() {
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(new NamedThreadFactory("VanChartRichEditor"));
try {
singleThreadExecutor.submit(new Runnable() {
@Override
public void run() {
try {
richEditorPane = initPane(new RichEditorModel());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
});
} finally {
singleThreadExecutor.shutdown();
}
}
public static ModernUIPane<RichEditorModel> createRichEditorPane(AttrTooltipRichText richEditor) {
RichEditorModel model = getRichEditorModel(richEditor);
@ -88,11 +111,14 @@ public class VanChartRichEditorPane {
}
public static class RichEditorModel {
private String content;
private boolean auto;
private String params;
private String initParams;
private String align;
private String content = StringUtils.EMPTY;
private boolean auto = true;
private String params = StringUtils.EMPTY;
private String initParams = StringUtils.EMPTY;
private String align = TextAlign.LEFT.getAlign();
public RichEditorModel() {
}
public RichEditorModel(String content, boolean auto, String params, String initParams, String align) {
this.content = content;

60
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java

@ -7,6 +7,7 @@ import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
@ -39,6 +40,7 @@ public class VanChartBackgroundPane extends BasicPane {
protected List<BackgroundQuickPane> paneList;
protected UIComboBox typeComboBox;
private UILabel transparentLabel;
protected UINumberDragPane transparent;
protected UIButtonGroup<Boolean> shadow;
@ -46,6 +48,8 @@ public class VanChartBackgroundPane extends BasicPane {
private boolean hasAuto;
private static final int AUTO = 0;
public VanChartBackgroundPane() {
this(false);
}
@ -58,6 +62,9 @@ public class VanChartBackgroundPane extends BasicPane {
this.add(panel, BorderLayout.CENTER);
}
public UILabel getTransparentLabel() {
return transparentLabel;
}
public boolean isHasAuto() {
return hasAuto;
@ -78,6 +85,7 @@ public class VanChartBackgroundPane extends BasicPane {
final CardLayout cardlayout = new CardLayout();
paneList = new ArrayList<>();
initAutoPane();
initList();
centerPane = new JPanel(cardlayout) {
@ -100,24 +108,43 @@ public class VanChartBackgroundPane extends BasicPane {
public void itemStateChanged(ItemEvent e) {
cardlayout.show(centerPane, (String) typeComboBox.getSelectedItem());
fireStateChanged();
checkTransparent();
}
});
transparentLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha"));
transparent = new UINumberDragPane(0, 100);
}
protected Component[][] getPaneComponents() {
shadow = new UIButtonGroup<Boolean>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
shadow = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox},
new Component[]{null, centerPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Shadow")), shadow},
new Component[]{transparentLabel, transparent},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shadow")), shadow},
};
}
protected void initAutoPane() {
if (isHasAuto()) {
paneList.add(new NullBackgroundQuickPane() {
public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Automatic");
}
});
}
}
private void checkTransparent() {
if (isHasAuto()) {
boolean enable = typeComboBox.getSelectedIndex() != AUTO;
transparentLabel.setEnabled(enable);
transparent.setEnabled(enable);
}
}
protected void initList() {
paneList.add(new NullBackgroundQuickPane());
paneList.add(new ColorBackgroundQuickPane());
@ -158,7 +185,17 @@ public class VanChartBackgroundPane extends BasicPane {
if (shadow != null) {
shadow.setSelectedIndex(attr.isShadow() == true ? 0 : 1);
}
populateBackground(attr, 0);
if (isHasAuto()) {
if (attr.isAutoBackground()) {
typeComboBox.setSelectedIndex(AUTO);
checkTransparent();
return;
}
populateBackground(attr, 1);
} else {
populateBackground(attr, 0);
}
}
public void populateBackground(GeneralInfo attr, int begin) {
@ -168,20 +205,29 @@ public class VanChartBackgroundPane extends BasicPane {
if (pane.accept(background)) {
pane.populateBean(background);
typeComboBox.setSelectedIndex(i);
checkTransparent();
return;
}
}
checkTransparent();
}
public void update(GeneralInfo attr) {
if (attr == null) {
attr = new GeneralInfo();
}
updateBackground(attr);
attr.setAlpha((float) (transparent.updateBean() / ALPHA_V));
if (shadow != null) {
attr.setShadow(shadow.getSelectedIndex() == 0);
}
if (isHasAuto()) {
if (typeComboBox.getSelectedIndex() == AUTO) {
attr.setAutoBackground(true);
return;
}
attr.setAutoBackground(false);
}
updateBackground(attr);
}
public void updateBackground(GeneralInfo attr) {

13
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java

@ -1,12 +1,10 @@
package com.fr.van.chart.designer.component.background;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import javax.swing.JPanel;
import java.awt.Component;
@ -16,6 +14,15 @@ import java.awt.Component;
*/
public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgroundPane {
public VanChartBackgroundPaneWithOutImageAndShadow() {
this(false);
}
public VanChartBackgroundPaneWithOutImageAndShadow(boolean hasAuto) {
super(hasAuto);
}
@Override
protected JPanel initContentPanel() {
double p = TableLayout.PREFERRED;
@ -49,7 +56,7 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro
return new Component[][]{
new Component[]{typeComboBox, null},
new Component[]{centerPane, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent},
new Component[]{getTransparentLabel(), transparent},
};
}

34
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java

@ -1,7 +1,5 @@
package com.fr.van.chart.designer.component.background;
import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.VanChartGradientPane;
@ -13,8 +11,6 @@ import com.fr.design.mainframe.backgroundpane.VanChartGradientPane;
public class VanChartBackgroundWithOutImagePane extends VanChartBackgroundPane {
private static final long serialVersionUID = 1322979785605013853L;
private static final int AUTO = 0;
public VanChartBackgroundWithOutImagePane() {
this(false);
}
@ -24,38 +20,8 @@ public class VanChartBackgroundWithOutImagePane extends VanChartBackgroundPane {
}
protected void initList() {
if (isHasAuto()) {
paneList.add(new NullBackgroundQuickPane() {
public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Automatic");
}
});
}
paneList.add(new NullBackgroundQuickPane());
paneList.add(new ColorBackgroundQuickPane());
paneList.add(new VanChartGradientPane());
}
public void populateBackground(GeneralInfo attr, int begin) {
if (isHasAuto()) {
if (attr.isAutoBackground()) {
typeComboBox.setSelectedIndex(AUTO);
return;
}
super.populateBackground(attr, begin + 1);
} else {
super.populateBackground(attr, begin);
}
}
public void updateBackground(GeneralInfo attr) {
if (isHasAuto()) {
if (typeComboBox.getSelectedIndex() == AUTO) {
attr.setAutoBackground(true);
return;
}
attr.setAutoBackground(false);
}
super.updateBackground(attr);
}
}

20
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java

@ -3,7 +3,7 @@ package com.fr.van.chart.designer.component.background;
import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import java.awt.Component;
@ -15,27 +15,27 @@ public class VanChartBackgroundWithOutShadowWithRadiusPane extends VanChartBackg
private UISpinner radius;
public VanChartBackgroundWithOutShadowWithRadiusPane(){
public VanChartBackgroundWithOutShadowWithRadiusPane() {
super();
}
public VanChartBackgroundWithOutShadowWithRadiusPane(boolean hasAuto){
public VanChartBackgroundWithOutShadowWithRadiusPane(boolean hasAuto) {
super(hasAuto);
}
protected Component[][] getPaneComponents() {
radius = new UISpinner(0,1000,1,0);
return new Component[][]{
radius = new UISpinner(0, 1000, 1, 0);
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox},
new Component[]{null, centerPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")),radius}
new Component[]{getTransparentLabel(), transparent},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), radius}
};
}
public void populate(GeneralInfo attr) {
if(attr == null) {
if (attr == null) {
return;
}
super.populate(attr);
@ -48,7 +48,7 @@ public class VanChartBackgroundWithOutShadowWithRadiusPane extends VanChartBackg
if (attr == null) {
attr = new GeneralInfo();
}
attr.setRoundRadius((int)radius.getValue());
attr.setRoundRadius((int) radius.getValue());
}
}

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -153,7 +153,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox},
new Component[]{null, centerPane},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent},
new Component[]{getTransparentLabel(), transparent},
};
}
};

9
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java

@ -7,7 +7,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
@ -77,15 +76,9 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
}
};
backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow() {
backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(true) {
@Override
protected void initList() {
paneList.add(new NullBackgroundQuickPane() {
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic");
}
});
paneList.add(new ColorBackgroundQuickPane());
}
};

12
designer-form/src/main/java/com/fr/design/gui/xpane/FormPredefinedBackgroundPane.java

@ -63,13 +63,21 @@ public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<Nam
private BackgroundWithAlpha getCurrentValue() {
if (this.predefinedRadioBtn.isSelected()) {
NameComponentBackground componentBackground = NameFormBackground.createPredefinedStyle(getPredefinedStyleName());
return componentBackground.createRealStyle();
return updatePredefinedStyle();
} else {
return this.backgroundPane.updateBean();
}
}
private BackgroundWithAlpha updatePredefinedStyle(){
NameComponentBackground componentBackground = NameFormBackground.createPredefinedStyle(getPredefinedStyleName());
return componentBackground.createRealStyle();
}
protected void populateCustomPane(){
this.backgroundPane.populateBean(updatePredefinedStyle());
}
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background");

14
designer-form/src/main/java/com/fr/design/gui/xpane/PredefinedComponentStyleSettingPane.java

@ -61,13 +61,21 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
@Override
public NameLayoutBorderStyle updateBean() {
if (predefinedRadioBtn.isSelected()) {
NameLayoutBorderStyle layoutBorderStyle = NameLayoutBorderStyle.createPredefinedStyle(getPredefinedStyleName());
layoutBorderStyle.setTitleText(formulaPane.updateBean());
return layoutBorderStyle;
return updatePredefinedStyle();
}
return styleSettingPane.updateBean();
}
private NameLayoutBorderStyle updatePredefinedStyle() {
NameLayoutBorderStyle layoutBorderStyle = NameLayoutBorderStyle.createPredefinedStyle(getPredefinedStyleName());
layoutBorderStyle.setTitleText(formulaPane.updateBean());
return layoutBorderStyle;
}
protected void populateCustomPane() {
this.styleSettingPane.populateBean(updatePredefinedStyle());
}
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style");

1
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -644,6 +644,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
} else {
this.undoState = u;
}
refreshPredefinedState();
}
@Override

22
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -32,8 +32,6 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.designer.TargetComponent;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.fun.PreviewProvider;
@ -94,7 +92,6 @@ import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.cell.painter.CellImagePainter;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.report.Report;
import com.fr.report.stable.ReportSettings;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils;
@ -137,22 +134,18 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
private int resolution = ScreenResolution.getScreenResolution();
public JWorkBook() {
super(new WorkBook(new WorkSheet()), DEFAULT_WB_FILE_PREFIX);
initPredefinedInfo();
super(new WorkBook(createPredefinedWorkSheet()), DEFAULT_WB_FILE_PREFIX);
populateReportParameterAttr();
}
private void initPredefinedInfo() {
WorkBook workBook = this.getTarget();
for (int i = 0; i < workBook.getReportCount(); i++) {
Report report = workBook.getReport(i);
if (report != null) {
NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY);
((ReportSettings) report.getReportSettings()).setNameBackground(initBackground);
}
}
private static WorkSheet createPredefinedWorkSheet() {
WorkSheet sheet = new WorkSheet();
NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY);
((ReportSettings) sheet.getReportSettings()).setNameBackground(initBackground);
return sheet;
}
public JWorkBook(WorkBookX workBookX) {
super(new WorkBookAdapter(workBookX), DEFAULT_WBX_FILE_PREFIX);
populateReportParameterAttr();
@ -794,6 +787,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
refreshPredefinedState();
}
private void applyAll(WorkBookUndoState u) {

16
designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java

@ -38,6 +38,7 @@ import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.form.ui.NameBackground;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
@ -45,7 +46,9 @@ import com.fr.main.impl.WorkBook;
import com.fr.poly.PolyDesigner;
import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.report.TemplateReport;
import com.fr.report.stable.ReportSettings;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.StringUtils;
/**
* NameTabPane of sheets
@ -847,11 +850,18 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
protected abstract String getTemplateReportType();
}
private void initPredefinedInfo(TemplateReport report){
NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY);
((ReportSettings) report.getReportSettings()).setNameBackground(initBackground);
}
protected class GridReportInsertAction extends SheetInsertAction {
@Override
protected TemplateReport newTemplateReport() {
return new WorkSheet();
WorkSheet workSheet = new WorkSheet();
initPredefinedInfo(workSheet);
return workSheet;
}
@Override
@ -863,7 +873,9 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
protected class PolyReportInsertAction extends SheetInsertAction {
@Override
protected TemplateReport newTemplateReport() {
return new PolyWorkSheet();
PolyWorkSheet polyWorkSheet = new PolyWorkSheet();
initPredefinedInfo(polyWorkSheet);
return polyWorkSheet;
}
@Override

5
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -43,19 +43,18 @@ public class CellStylePane extends AbstractCellAttrPane {
@Override
public String getIconPath() {
// return "com/fr/design/images/m_format/cell.png";
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style");
}
@Override
public void updateBean(TemplateCellElement cellElement) {
cellElement.setStyle(stylePane.updateBean());
cellElement.setStyle(stylePane.updateStyle());
}
@Override
public void updateBeans() {
NameStyle s = stylePane.updateBean();
Style s = stylePane.updateStyle();
TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
int cellRectangleCount = cs.getCellRectangleCount();
for (int rect = 0; rect < cellRectangleCount; rect++) {

39
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java

@ -16,7 +16,6 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.AbstractBasicStylePane;
import com.fr.design.gui.style.AlignmentPane;
import com.fr.design.gui.style.BackgroundPane;
import com.fr.design.gui.style.BorderPane;
import com.fr.design.gui.style.FormatPane;
import com.fr.design.layout.FRGUIPaneFactory;
@ -29,6 +28,7 @@ import com.fr.design.style.BorderUtils;
import com.fr.predefined.PredefinedPatternStyleManager;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nonnull;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
@ -85,9 +85,7 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane<N
public void populateBean(NameStyle ob) {
this.setPopulating(true);
super.populate(ob);
JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
String styleName = template.getTemplatePredefinedStyle();
PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(styleName);
PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(getPredefinedStyleName());
PredefinedCellStyleConfig config = currentStyle.getCellStyleConfig();
Map<String, PredefinedCellStyle> allStyle = config.getAllStyles();
this.applicationFormat.clearBoxItems();
@ -103,6 +101,13 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane<N
this.setPopulating(false);
}
protected void populateCustomPane(){
this.customPredefinedStylePane.populateBean(updatePredefinedStyle());
}
public void dealWithBorder(ElementCasePane ePane) {
this.customPredefinedStylePane.dealWithBorder(ePane);
@ -113,18 +118,27 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane<N
}
@Override
@Nonnull
public NameStyle updateBean() {
NameStyle nameStyle = null;
Style style = updateStyle();
if (!(style instanceof NameStyle)) {
return NameStyle.createCustomStyle(style);
}
return (NameStyle) style;
}
@Nonnull
public Style updateStyle() {
if (this.predefinedRadioBtn.isSelected()) {
Object selectItem = this.applicationFormat.getSelectedItem();
nameStyle = NameStyle.createPredefinedStyle(getPredefinedStyleName(), selectItem == null ? StringUtils.EMPTY : selectItem.toString(), Style.getInstance());
return updatePredefinedStyle();
} else {
Style style = this.customPredefinedStylePane.updateBean();
if (!(style instanceof NameStyle)) {
nameStyle = NameStyle.createCustomStyle(style);
}
return this.customPredefinedStylePane.updateBean();
}
return nameStyle;
}
private NameStyle updatePredefinedStyle() {
Object selectItem = this.applicationFormat.getSelectedItem();
return NameStyle.createPredefinedStyle(getPredefinedStyleName(), selectItem == null ? StringUtils.EMPTY : selectItem.toString(), Style.getInstance());
}
class CustomStylePane extends MultiTabPane<Style> {
@ -132,7 +146,6 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane<N
private static final int THREE_INDEX = 3;
private static final int ONE_INDEX = 1;
private ElementCasePane reportPane;
private BackgroundPane backgroundPane = null;
public CustomStylePane() {

10
designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java

@ -84,7 +84,7 @@ public class ReportPredefinedBackgroundPane extends PredefinedStyleSettingPane<R
public void updateBean(ReportSettingsProvider reportSettings) {
if (this.predefinedRadioBtn.isSelected()) {
((ReportSettings) reportSettings).setNameBackground(NameBackground.createPredefinedStyle(getPredefinedStyleName()));
((ReportSettings) reportSettings).setNameBackground(updatePredefinedStyle());
} else {
reportSettings.setBackground(this.backgroundPane.updateBean());
}
@ -92,6 +92,14 @@ public class ReportPredefinedBackgroundPane extends PredefinedStyleSettingPane<R
reportSettings.setExportBackground(this.isExportBackgroundCheckBox.isSelected());
}
private NameBackground updatePredefinedStyle() {
return NameBackground.createPredefinedStyle(getPredefinedStyleName());
}
protected void populateCustomPane() {
this.backgroundPane.populateBean(updatePredefinedStyle().createRealStyle());
}
private Background getCurrentValue() {
if (this.predefinedRadioBtn.isSelected()) {
NameBackground nameReportBackground = NameBackground.createPredefinedStyle(getPredefinedStyleName());

Loading…
Cancel
Save