Browse Source

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

feature/big-screen
Yuan.Wang 4 years ago
parent
commit
905b646aa7
  1. 3
      build.gradle
  2. 2
      designer-base/src/main/java/com/fr/design/extra/LoginDialog.java
  3. 2
      designer-base/src/main/java/com/fr/design/extra/ShopDialog.java
  4. 4
      designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java
  5. 6
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  6. 130
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java
  7. 248
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  8. 57
      designer-chart/src/main/java/com/fr/van/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java
  9. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java
  10. 19
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  11. 5
      designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java
  12. 4
      designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarPlotPane.java
  13. 3
      designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java
  14. 2
      designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java

3
build.gradle

@ -64,7 +64,7 @@ allprojects {
implementation 'org.swingexplorer:swexpl:2.0.1'
implementation 'org.swingexplorer:swag:1.0'
implementation 'net.java.dev.jna:jna:5.4.0'
implementation 'org.apache.tomcat:tomcat-catalina:8.5.32'
implementation 'org.apache.tomcat:tomcat-catalina:8.5.57'
implementation 'io.socket:socket.io-client:0.7.0'
implementation 'com.fr.third:fine-third:' + frVersion
implementation 'com.fr.core:fine-core:' + frDevVersion
@ -73,6 +73,7 @@ allprojects {
implementation 'com.fr.decision:fine-decision:' + frVersion
implementation 'com.fr.schedule:fine-schedule:' + frVersion
implementation 'com.fr.report:fine-report-engine:' + frDevVersion
implementation 'com.fr.design:design-i18n' + frDevVersion
testImplementation 'org.easymock:easymock:3.5.1'
testImplementation 'org.powermock:powermock-module-junit4:1.7.1'
testImplementation 'org.powermock:powermock-api-easymock:1.7.1'

2
designer-base/src/main/java/com/fr/design/extra/LoginDialog.java

@ -24,7 +24,7 @@ public class LoginDialog extends UIDialog {
}
private void init(Component pane) {
if (StableUtils.getMajorJavaVersion() == 8) {
if (StableUtils.getMajorJavaVersion() >= 8) {
setUndecorated(true);
}
JPanel panel = (JPanel) getContentPane();

2
designer-base/src/main/java/com/fr/design/extra/ShopDialog.java

@ -16,7 +16,7 @@ public class ShopDialog extends UIDialog {
public ShopDialog(Frame frame, BasicPane pane) {
super(frame);
if (StableUtils.getMajorJavaVersion() == 8) {
if (StableUtils.getMajorJavaVersion() >= 8) {
setUndecorated(true);
}
JPanel panel = (JPanel) getContentPane();

4
designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java

@ -159,7 +159,7 @@ public class WebViewDlgHelper {
}
public static void createLoginDialog() {
if (StableUtils.getMajorJavaVersion() == VERSION_8) {
if (StableUtils.getMajorJavaVersion() >= VERSION_8) {
File file = new File(StableUtils.pathJoin(installHome, "scripts"));
if (!file.exists()) {
confirmDownLoadShopJS();
@ -172,7 +172,7 @@ public class WebViewDlgHelper {
public static void createLoginDialog(Window parent) {
if (StableUtils.getMajorJavaVersion() == VERSION_8) {
if (StableUtils.getMajorJavaVersion() >= VERSION_8) {
File file = new File(StableUtils.pathJoin(installHome, "scripts"));
if (!file.exists()) {
confirmDownLoadShopJS();

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

@ -748,9 +748,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* @param al 组件名称
*/
public void checkCombineUp(boolean flag, ArrayList<String> al) {
//Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的
if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) {
return;
}
combineUp.checkComponentsByNames(flag, al);
}
/**

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

@ -0,0 +1,130 @@
package com.fr.van.chart.designer.component;
import com.fr.design.ui.ModernUIPane;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.stable.StringUtils;
import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class VanChartRichEditorPane {
private static final String namespace = "Pool";
private static final String variable = "data";
private static final String richEditorPath = "/com/fr/design/editor/rich_editor.html";
private static final String expression = "dispatch()";
private static ModernUIPane<RichEditorModel> richEditorPane;
private static Browser browser;
public static ModernUIPane<RichEditorModel> createRichEditorPane(AttrTooltipRichText richEditor) {
RichEditorModel model = getRichEditorModel(richEditor);
if (richEditorPane == null) {
richEditorPane = initPane(model);
} else if (browser != null) {
updatePane(browser, model);
}
return richEditorPane;
}
public static ModernUIPane<RichEditorModel> initPane(RichEditorModel model) {
return new ModernUIPane.Builder<RichEditorModel>()
.prepare(new ScriptContextAdapter() {
public void onScriptContextCreated(ScriptContextEvent event) {
browser = event.getBrowser();
JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace);
ns.asObject().setProperty(variable, model);
}
})
.withEMB(richEditorPath)
.namespace(namespace).build();
}
public static void updatePane(Browser browser, RichEditorModel model) {
JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace);
ns.asObject().setProperty(variable, model);
browser.executeJavaScript("window." + namespace + "." + expression);
}
public static RichEditorModel getRichEditorModel(AttrTooltipRichText richText) {
Map<String, String> paramsMap = richText.getParams();
StringBuilder paramsStr = new StringBuilder(StringUtils.EMPTY);
if (paramsMap != null) {
for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
paramsStr.append(entry.getKey()).append(":").append(entry.getValue());
paramsStr.append("-");
}
}
int len = paramsStr.length();
if (len > 0) {
paramsStr.deleteCharAt(len - 1);
}
return new RichEditorModel(richText.getContent(), richText.isAuto(), paramsStr.toString());
}
public static List<String> richParamsParser(String content, Map<String, String> paramsMap) {
if (content == null || paramsMap == null) {
return null;
}
List<String> result = new ArrayList<>();
for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
String param = entry.getValue();
if (content.contains(URLEncoder.encode(param))) {
result.add(param);
}
}
return result;
}
public static class RichEditorModel {
private String content;
private boolean auto;
private String params;
public RichEditorModel(String content, boolean auto, String params) {
this.content = content;
this.auto = auto;
this.params = params;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public boolean isAuto() {
return auto;
}
public void setAuto(boolean auto) {
this.auto = auto;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
}
}

248
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

@ -1,12 +1,19 @@
package com.fr.van.chart.designer.component;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.ui.ModernUIPane;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.base.format.AttrTooltipFormat;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox;
@ -14,15 +21,22 @@ import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithChec
import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
/**
* 内容界面 数据点提示
@ -43,22 +57,28 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private JPanel centerPane;
private JPanel commonPanel;
private JPanel editorPane;
private VanChartHtmlLabelPane htmlLabelPane;
private VanChartStylePane parent;
private JPanel showOnPane;
private AttrTooltipRichText richText;
public VanChartTooltipContentPane(VanChartStylePane parent, JPanel showOnPane){
this.parent = parent;
this.showOnPane = showOnPane;
this.richText = new AttrTooltipRichText();
this.setLayout(new BorderLayout());
this.add(createLabelContentPane(),BorderLayout.CENTER);
}
private JPanel createLabelContentPane() {
content = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")});
content = new UIButtonGroup<>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Common"),
Toolkit.i18nText("Fine-Design_Chart_Custom")
});
initFormatPane(parent, showOnPane);
@ -80,8 +100,8 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
}
};
centerPane.add(htmlLabelPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom"));
centerPane.add(commonPanel,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common"));
centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom"));
centerPane.add(commonPanel, Toolkit.i18nText("Fine-Design_Chart_Common"));
double[] column = {f, e};
double[] row = {p,p,p};
@ -90,17 +110,28 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
new Component[]{new UILabel(getLabelContentTitle()),content},
new Component[]{null,centerPane},
};
initContentListener();
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column);
return getLabelContentPane(contentPane);
// editorPane = createRichEditorPanel();
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(contentPane, BorderLayout.CENTER);
// panel.add(editorPane, BorderLayout.SOUTH);
initContentListener();
return getLabelContentPane(panel);
}
protected String getLabelContentTitle () {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text");
return Toolkit.i18nText("Fine-Design_Report_Text");
}
protected JPanel getLabelContentPane(JPanel contentPane) {
return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), contentPane);
return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Content"), contentPane);
}
protected VanChartHtmlLabelPane createHtmlLabelPane() {
@ -117,6 +148,65 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize);
}
private JPanel createRichEditorPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Content_Style")), createContentStylePane()}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
private JComponent createContentStylePane() {
UIButton contentTextArea = new UIButton(Toolkit.i18nText("Fine-Design_Report_RichTextEditor"));
contentTextArea.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
fireRichEditor();
}
});
return contentTextArea;
}
private void fireRichEditor() {
final ModernUIPane<VanChartRichEditorPane.RichEditorModel> pane = VanChartRichEditorPane.createRichEditorPane(richText);
BasicDialog dialog = pane.showWindow(new JFrame());
pane.populate(VanChartRichEditorPane.getRichEditorModel(richText));
dialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
VanChartRichEditorPane.RichEditorModel model = pane.update();
String content = model.getContent();
List<String> params = VanChartRichEditorPane.richParamsParser(content, richText.getParams());
populateFormatParams(params);
updateLocalRichText(content, model.isAuto());
SwingUtilities.getWindowAncestor(pane).setVisible(false);
}
public void doCancel() {
SwingUtilities.getWindowAncestor(pane).setVisible(false);
}
});
dialog.setVisible(true);
if (parent != null) {
parent.attributeChanged();
}
}
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane){
categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane);
seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane);
@ -154,13 +244,17 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private void checkCardPane() {
CardLayout cardLayout = (CardLayout) centerPane.getLayout();
if (content.getSelectedIndex() == 1) {
cardLayout.show(centerPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom"));
cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Custom"));
if(isDirty()){
setCustomFormatterText();
setDirty(false);
}
} else {
cardLayout.show(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common"));
cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Common"));
}
if (editorPane != null) {
editorPane.setVisible(content.getSelectedIndex() == 0);
}
}
@ -187,6 +281,59 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
}
protected VanChartFormatPaneWithCheckBox[] getFormatPaneGroup() {
return new VanChartFormatPaneWithCheckBox[]{
categoryNameFormatPane, seriesNameFormatPane,
valueFormatPane, percentFormatPane,
changedValueFormatPane, changedPercentFormatPane
};
}
protected VanChartFormatPaneWithCheckBox getTargetFormatPane(Object param) {
VanChartFormatPaneWithCheckBox[] formatPaneGroup = getFormatPaneGroup();
Object[] params = richText.getParams().values().toArray();
for (int i = 0, len = Math.min(params.length, formatPaneGroup.length); i < len; i++) {
if (ComparatorUtils.equals(params[i], param) && formatPaneGroup[i] != null) {
return formatPaneGroup[i];
}
}
return null;
}
private String getParamsRichText() {
VanChartFormatPaneWithCheckBox[] formatPaneGroup = getFormatPaneGroup();
// todo 获取参数对应的富文本字符串,正确的流程是:
// 在BI的富文本组件中,先清空content,然后addParam,最后读取最新的content,
// 但是当前接口还没开出来,暂时先在本地写死,模拟类似的效果
String[] richTextGroup = new String[]{
"<img alt=\"%24%7BCATEGORY%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:86.095703125px;height: 16px; max-width:86.095703125px;max-height: 16px; min-width:86.095703125px;min-height: 16px\" name=\"%24%7BCATEGORY%7D\" />",
"<img alt=\"%24%7BSERIES%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:63.8828125px;height: 16px; max-width:63.8828125px;max-height: 16px; min-width:63.8828125px;min-height: 16px\" name=\"%24%7BSERIES%7D\" />",
"<img alt=\"%24%7BVALUE%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:61.849609375px;height: 16px; max-width:61.849609375px;max-height: 16px; min-width:61.849609375px;min-height: 16px\" name=\"%24%7BVALUE%7D\" />",
"<img alt=\"%24%7BPERCENT%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:77.39453125px;height: 16px; max-width:77.39453125px;max-height: 16px; min-width:77.39453125px;min-height: 16px\" name=\"%24%7BPERCENT%7D\" />",
"<img alt=\"%24%7BCHANGEDVALUE%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:122.119140625px;height: 16px; max-width:122.119140625px;max-height: 16px; min-width:122.119140625px;min-height: 16px\" name=\"%24%7BCHANGEDVALUE%7D\" />",
"<img alt=\"%24%7BCHANGEDPERCENT%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:137.6640625px;height: 16px; max-width:137.6640625px;max-height: 16px; min-width:137.6640625px;min-height: 16px\" name=\"%24%7BCHANGEDPERCENT%7D\" />"
};
StringBuilder result = new StringBuilder("<p>");
for (int i = 0, len = formatPaneGroup.length; i < len; i++) {
VanChartFormatPaneWithCheckBox formatPane = formatPaneGroup[i];
String paramRichText = richTextGroup[i];
if (formatPane != null && formatPane.isSelected()) {
result.append(paramRichText);
}
}
result.append("</p>");
return result.toString();
}
@Override
protected String title4PopupWindow() {
return "";
@ -211,26 +358,72 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
protected void populateFormatPane(AttrTooltipContent attrTooltipContent) {
categoryNameFormatPane.populate(attrTooltipContent.getCategoryFormat());
seriesNameFormatPane.populate(attrTooltipContent.getSeriesFormat());
valueFormatPane.populate(attrTooltipContent.getValueFormat());
percentFormatPane.populate(attrTooltipContent.getPercentFormat());
VanChartFormatPaneWithCheckBox[] formatPaneGroup = getFormatPaneGroup();
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{
attrTooltipContent.getCategoryFormat(),
attrTooltipContent.getSeriesFormat(),
attrTooltipContent.getValueFormat(),
attrTooltipContent.getPercentFormat(),
attrTooltipContent.getChangedValueFormat(),
attrTooltipContent.getChangedPercentFormat()
};
if (changedValueFormatPane != null) {
changedValueFormatPane.populate(attrTooltipContent.getChangedValueFormat());
for (int i = 0, len = formatPaneGroup.length; i < len; i++) {
VanChartFormatPaneWithCheckBox formatPane = formatPaneGroup[i];
AttrTooltipFormat format = formatGroup[i];
if (formatPane != null && format != null) {
formatPane.populate(format);
// 填充面板时,更新富文本编辑器参数
formatPane.updateFormatParams(richText.getParams(), format.getJs());
}
}
AttrTooltipRichText tooltipRichText = attrTooltipContent.getRichText();
if (tooltipRichText != null) {
updateLocalRichText(tooltipRichText.getContent(), tooltipRichText.isAuto());
setDirty(false);
}
}
private void populateFormatParams(List<String> params) {
if (params == null) {
return;
}
VanChartFormatPaneWithCheckBox[] formatPaneGroup = getFormatPaneGroup();
for (VanChartFormatPaneWithCheckBox formatPane : formatPaneGroup) {
if (formatPane != null) {
formatPane.setSelected(false);
}
}
for (String param : params) {
VanChartFormatPaneWithCheckBox formatPane = getTargetFormatPane(param);
if (formatPane != null) {
formatPane.setSelected(true);
}
if (changedPercentFormatPane != null) {
changedPercentFormatPane.populate(attrTooltipContent.getChangedPercentFormat());
}
}
public AttrTooltipContent updateBean() {
AttrTooltipContent attrTooltipContent = createAttrTooltip();
attrTooltipContent.setCommon(content.getSelectedIndex() == 0);
boolean isCommon = content.getSelectedIndex() == 0;
updateFormatPane(attrTooltipContent);
attrTooltipContent.setCommon(isCommon);
if (isDirty() && isCommon) {
updateLocalRichText(getParamsRichText(), false);
setDirty(false);
}
updateFormatPane(attrTooltipContent);
updateTooltipRichText(attrTooltipContent);
updateFormatsWithPaneWidth(attrTooltipContent);
htmlLabelPane.update(attrTooltipContent.getHtmlLabel());
@ -256,6 +449,19 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
}
private void updateLocalRichText(String content, boolean isAuto) {
richText.setContent(content);
richText.setAuto(isAuto);
}
private void updateTooltipRichText(AttrTooltipContent attrTooltipContent) {
if (attrTooltipContent != null) {
AttrTooltipRichText tooltipRichText = attrTooltipContent.getRichText();
tooltipRichText.setContent(richText.getContent());
tooltipRichText.setAuto(richText.isAuto());
}
}
/**
* CHART-1295
* 通过格式的面板宽度来判断在自定义js代码中是否显示this.seriesName字符串

57
designer-chart/src/main/java/com/fr/van/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java

@ -6,7 +6,7 @@ import com.fr.design.gui.frpane.UIBubbleFloatPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.style.FormatPane;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.base.format.AttrTooltipFormat;
import com.fr.stable.Constants;
@ -15,8 +15,8 @@ import java.awt.BorderLayout;
import java.awt.Point;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.text.Format;
import java.util.Map;
/**
* Created by Mitisky on 16/2/23.
@ -37,41 +37,22 @@ public abstract class VanChartFormatPaneWithCheckBox extends JPanel{
public VanChartFormatPaneWithCheckBox(AbstractAttrNoScrollPane parent, JPanel showOnPane) {
this.parent = parent;
this.showOnPane = showOnPane;
this.isDirty = true;
this.isDirty = false;
this.setLayout(new BorderLayout());
isSelectedBox = new UICheckBox(getCheckBoxText());
formatButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Format"));
this.add(isSelectedBox, BorderLayout.CENTER);
this.add(formatButton, BorderLayout.EAST);
initFormatListener();
isSelectedBox.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
isSelectedBox = new UICheckBox(getCheckBoxText()) {
protected void attributeChange() {
isDirty = true;
super.attributeChange();
}
};
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
formatButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Use_Format"));
this.add(isSelectedBox, BorderLayout.CENTER);
this.add(formatButton, BorderLayout.EAST);
}
});
initFormatListener();
}
protected abstract String getCheckBoxText();
@ -126,6 +107,14 @@ public abstract class VanChartFormatPaneWithCheckBox extends JPanel{
this.isDirty = isDirty;
}
public boolean isSelected() {
return this.isSelectedBox.isSelected();
}
public void setSelected(boolean isSelected) {
this.isSelectedBox.setSelected(isSelected);
}
public void populate(AttrTooltipFormat tooltipFormat) {
this.isSelectedBox.setSelected(tooltipFormat.isEnable());
this.format = tooltipFormat.getFormat();
@ -135,4 +124,12 @@ public abstract class VanChartFormatPaneWithCheckBox extends JPanel{
tooltipFormat.setFormat(format);
tooltipFormat.setEnable(isSelectedBox.isSelected());
}
public void updateFormatParams(Map<String, String> paramMap, String value) {
String key = this.getCheckBoxText();
if (paramMap != null && !paramMap.containsKey(key)) {
paramMap.put(key, value);
}
}
}

2
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java

@ -68,6 +68,8 @@ public abstract class AbstractRectanglePlotPane extends AbstractVanChartTypePane
VanChartAxis vanChartAxis = vanChartRectanglePlot.getValueAxisList().get(0);
cloneAxis.setFormat(vanChartAxis.getFormat());
cloneAxis.setPercentage(vanChartAxis.isPercentage());
cloneAxis.setCommonValueFormat(vanChartAxis.isCommonValueFormat());
cloneAxis.setHtmlLabel(vanChartAxis.getHtmlLabel());
}
return clonePlot;
} catch (CloneNotSupportedException ex) {

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

@ -1,10 +1,13 @@
package com.fr.van.chart.designer.type;
import com.fr.base.BaseUtils;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Legend;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chart.chartglyph.DataSheet;
@ -167,6 +170,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
}
protected void resetChartAttr(VanChart chart, VanChartPlot newPlot) {
resetFilterDefinition(chart);
//上个图表支持继承部分属性到新图表
if (supportExtendAttr(chart)) {
newPlot.extendAttribute(chart);
@ -186,8 +190,6 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
resetTitleAttr(chart);
//重置监控刷新选项
resetRefreshMoreLabelAttr(chart);
resetFilterDefinition(chart);
}
//是否支持属性的继承
@ -290,4 +292,17 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
autoButton.addActionListener(autoButtonListener);
}
}
//部分图表继承到多分类之后会报错
protected void resetMoreCateDefinition(Chart chart) {
TopDefinitionProvider filterDefinition = chart.getFilterDefinition();
if (filterDefinition instanceof NormalTableDataDefinition) {
((NormalTableDataDefinition) filterDefinition).clearMoreCate();
((VanChartPlot) chart.getPlot()).setCategoryNum(1);
}
if (filterDefinition instanceof NormalReportDataDefinition) {
((NormalReportDataDefinition) filterDefinition).clearMoreCate();
((VanChartPlot) chart.getPlot()).setCategoryNum(1);
}
}
}

5
designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java

@ -83,4 +83,9 @@ public class VanChartPiePlotPane extends AbstractVanChartTypePane {
public Chart getDefaultChart() {
return PieIndependentVanChart.newPieChartTypes[0];
}
//重置数据配置
protected void resetFilterDefinition(Chart chart) {
resetMoreCateDefinition(chart);
}
}

4
designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarPlotPane.java

@ -49,4 +49,8 @@ public class VanChartRadarPlotPane extends AbstractVanChartTypePane {
return RadarIndependentVanChart.RadarVanChartTypes[0];
}
//重置数据配置
protected void resetFilterDefinition(Chart chart) {
resetMoreCateDefinition(chart);
}
}

3
designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java

@ -1,5 +1,6 @@
package com.fr.design.form.util;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.JTemplate;
@ -17,7 +18,7 @@ public class FormDesignerUtils {
* @return
*/
public static boolean isAppRelayout(FormDesigner designer) {
if (!designer.getRootComponent().acceptType(WFitLayout.class)) {
if (!designer.getRootComponent().acceptType(XWFitLayout.class)) {
return false;
}
return ((WFitLayout) designer.getRootComponent().toData()).isAppRelayout();

2
designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -199,7 +199,7 @@ public class UserInfoLabel extends UILabel {
this.addMouseListener(userInfoAdapter);
this.setHorizontalAlignment(SwingConstants.CENTER);
if (StableUtils.getMajorJavaVersion() == VERSION_8) {
if (StableUtils.getMajorJavaVersion() >= VERSION_8) {
LoginWebBridge.getHelper().setUILabel(UserInfoLabel.this);
PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this);
}

Loading…
Cancel
Save