Browse Source

Merge pull request #1018 in BA/design from ~MANGO/design:release to release

* commit '2369145cbfeff4cf9830093c92e2b7190e5c785e':
  合并代码:将图表dev中修改合并到release
master
superman 7 years ago
parent
commit
9339b4dd52
  1. 14
      designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java
  2. 9
      designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java
  3. 3
      designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java
  4. 485
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java
  5. 29
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java
  6. 23
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  7. 33
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  8. 11
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java
  9. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

14
designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java

@ -1,7 +1,7 @@
package com.fr.design.editor.editor; package com.fr.design.editor.editor;
import com.fr.design.data.DesignTableDataManager;
import com.fr.data.SimpleDSColumn; import com.fr.data.SimpleDSColumn;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -36,8 +36,12 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem();
if (tableDataWrapper == null) {
return;
}
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。 //这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
List<String> nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); List<String> nameList = tableDataWrapper.calculateColumnNameList();
columnNames = new String[nameList.size()]; columnNames = new String[nameList.size()];
columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames);
columnNameComboBox.removeAllItems(); columnNameComboBox.removeAllItems();
@ -64,7 +68,7 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
dsColumn.setDsName(tableDataWrappe.getTableDataName()); dsColumn.setDsName(tableDataWrappe.getTableDataName());
TableDataColumn column; TableDataColumn column;
String columnExp = (String) this.columnNameComboBox.getSelectedItem(); String columnExp = (String) this.columnNameComboBox.getSelectedItem();
if (StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#")) { if (StringUtils.isNotBlank(columnExp) && checkColumnExp(columnExp)) {
String number = columnExp.substring(1); String number = columnExp.substring(1);
Pattern pattern = Pattern.compile("[^\\d]"); Pattern pattern = Pattern.compile("[^\\d]");
if (pattern.matcher(number).find()) { if (pattern.matcher(number).find()) {
@ -80,6 +84,10 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
return dsColumn; return dsColumn;
} }
private boolean checkColumnExp (String columnExp) {
return (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#");
}
public String getIconName() { public String getIconName() {
return "ds_column"; return "ds_column";
} }

9
designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.js.JavaScript;
import javax.swing.*; import javax.swing.*;
@ -70,6 +71,14 @@ public abstract class AbstractNameableCreator implements NameableCreator {
return this.clazzOfEditor; return this.clazzOfEditor;
} }
/**
* get clazzOfObject
* @return clazzOfObject
*/
public Class <? extends JavaScript> getHyperlink() {
return this.clazzOfObject;
}
/** /**
* *
* @param ob * @param ob

3
designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java

@ -2,6 +2,7 @@ package com.fr.design.gui.controlpane;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.js.JavaScript;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import javax.swing.*; import javax.swing.*;
@ -17,6 +18,8 @@ public interface NameableCreator {
public Class<? extends BasicBeanPane> getUpdatePane(); public Class<? extends BasicBeanPane> getUpdatePane();
public Class <? extends JavaScript> getHyperlink();
public Object acceptObject2Populate(Object ob); public Object acceptObject2Populate(Object ob);
public void saveUpdatedBean(ListModelElement wrapper, Object bean); public void saveUpdatedBean(ListModelElement wrapper, Object bean);

485
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java

File diff suppressed because one or more lines are too long

29
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java

@ -96,7 +96,7 @@ public class DataLabelPane extends TooltipContentsPane {
} }
delimiterBox.setPreferredSize(new Dimension(70, 20)); delimiterBox.setPreferredSize(new Dimension(70, 20));
JPanel boxPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); JPanel boxPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
boxPane.add(new UILabel(Inter.getLocText("Form-Delimiter") + ":")); boxPane.add(new UILabel(Inter.getLocText("FR-Designer_Dismenber") + ":"));
boxPane.add(delimiterBox); boxPane.add(delimiterBox);
return boxPane; return boxPane;
} }
@ -111,34 +111,9 @@ public class DataLabelPane extends TooltipContentsPane {
} }
protected JPanel createJPanel4Position() { protected JPanel createJPanel4Position() {
// 标签位置:上下左右中. return null;
bottomButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Bottom"));
leftButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Left"));
rigtButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Right"));
topButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Top"));
centerButton = new UIRadioButton(Inter.getLocText("Center"));
ButtonGroup bg = new ButtonGroup();
bg.add(bottomButton);
bg.add(leftButton);
bg.add(rigtButton);
bg.add(topButton);
bg.add(centerButton);
topButton.setSelected(true);
JPanel buttonPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
buttonPane.add(new UILabel(Inter.getLocText(new String[]{"Label", "Layout"}) + ":"));
buttonPane.add(bottomButton);
buttonPane.add(leftButton);
buttonPane.add(rigtButton);
buttonPane.add(topButton);
buttonPane.add(centerButton);
return buttonPane;
} }
public void populate(AttrContents seriesAttrContents) { public void populate(AttrContents seriesAttrContents) {
super.populate(seriesAttrContents); super.populate(seriesAttrContents);
String dataLabel = seriesAttrContents.getSeriesLabel(); String dataLabel = seriesAttrContents.getSeriesLabel();

23
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -5,6 +5,7 @@ import com.fr.base.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalReportDataDefinition; import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -21,6 +22,7 @@ import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
/** /**
@ -37,6 +39,10 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
private ArrayList<TinyFormulaPane> formualList = new ArrayList<TinyFormulaPane>(); private ArrayList<TinyFormulaPane> formualList = new ArrayList<TinyFormulaPane>();
private UIObserverListener uiobListener = null; private UIObserverListener uiobListener = null;
public List<TinyFormulaPane> getFormualList() {
return formualList;
}
public CategoryPlotMoreCateReportDataContentPane() { public CategoryPlotMoreCateReportDataContentPane() {
} }
@ -105,13 +111,13 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
boxPane.remove(newButtonPane); boxPane.remove(newButtonPane);
formualList.remove(pane); formualList.remove(pane);
checkAddButton(); checkComponent();
relayoutPane(); relayoutPane();
} }
}); });
delButton.registerChangeListener(uiobListener); delButton.registerChangeListener(uiobListener);
checkAddButton(); checkComponent();
relayoutPane(); relayoutPane();
return pane; return pane;
@ -122,6 +128,10 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
addButton.setEnabled(size < 2); addButton.setEnabled(size < 2);
} }
protected void checkComponent() {
checkAddButton();
}
private void relayoutPane() { private void relayoutPane() {
this.revalidate(); this.revalidate();
} }
@ -168,15 +178,20 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
super.updateBean(collection); super.updateBean(collection);
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();
Plot plot = collection.getSelectedChart().getPlot();
if (definition instanceof NormalReportDataDefinition) { if (definition instanceof NormalReportDataDefinition) {
NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition; NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition;
reportDefinition.clearMoreCate(); reportDefinition.clearMoreCate();
updateMoreCate(reportDefinition, plot);
for(int i = 0, size = formualList.size(); i < size; i++) { }
}
protected void updateMoreCate(NormalReportDataDefinition reportDefinition, Plot plot) {
for (int i = 0, size = formualList.size(); i < size; i++) {
TinyFormulaPane pane = formualList.get(i); TinyFormulaPane pane = formualList.get(i);
reportDefinition.addMoreCate(canBeFormula(pane.updateBean())); reportDefinition.addMoreCate(canBeFormula(pane.updateBean()));
} }
} }
}
} }

33
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition; import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -42,6 +43,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
private UIObserverListener uiobListener = null; private UIObserverListener uiobListener = null;
public List<UIComboBox> getBoxList() {
return boxList;
}
public CategoryPlotMoreCateTableDataContentPane() { public CategoryPlotMoreCateTableDataContentPane() {
// do nothing // do nothing
} }
@ -87,7 +92,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
checkSeriseUse(categoryCombox.getSelectedItem() != null); checkSeriseUse(categoryCombox.getSelectedItem() != null);
makeToolTipUse(categoryCombox); makeToolTipUse(categoryCombox);
checkAddButton(); checkComponent();
} }
}); });
} }
@ -127,14 +132,14 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
boxPane.add(buttonPane); boxPane.add(buttonPane);
boxList.add(combox); boxList.add(combox);
checkAddButton(); checkComponent();
delButton.addActionListener(new ActionListener() { delButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
boxPane.remove(buttonPane); boxPane.remove(buttonPane);
boxList.remove(combox); boxList.remove(combox);
checkAddButton(); checkComponent();
relayoutPane(); relayoutPane();
} }
}); });
@ -148,6 +153,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
addButton.setEnabled(size < 2 && categoryCombox.getSelectedItem() != null); addButton.setEnabled(size < 2 && categoryCombox.getSelectedItem() != null);
} }
protected void checkComponent() {
checkAddButton();
}
private void relayoutPane() { private void relayoutPane() {
this.revalidate(); this.revalidate();
} }
@ -160,7 +169,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
public void checkBoxUse(boolean hasUse) { public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse); super.checkBoxUse(hasUse);
checkAddButton(); checkComponent();
} }
protected void refreshBoxListWithSelectTableData(List list) { protected void refreshBoxListWithSelectTableData(List list) {
@ -220,15 +229,21 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
super.updateBean(collection); super.updateBean(collection);
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition();
if(top instanceof NormalTableDataDefinition) { Plot plot = collection.getSelectedChart().getPlot();
NormalTableDataDefinition normal = (NormalTableDataDefinition)top; if (top instanceof NormalTableDataDefinition) {
NormalTableDataDefinition normal = (NormalTableDataDefinition) top;
normal.clearMoreCate(); normal.clearMoreCate();
for(int i = 0, size = boxList.size(); i < size; i++) { updateMoreCate(normal, plot);
}
}
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {
for (int i = 0, size = boxList.size(); i < size; i++) {
UIComboBox box = boxList.get(i); UIComboBox box = boxList.get(i);
if(box.getSelectedItem() != null) { if (box.getSelectedItem() != null) {
normal.addMoreCate(box.getSelectedItem().toString()); normal.addMoreCate(box.getSelectedItem().toString());
} }
} }
} }
}
} }

11
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java

@ -12,6 +12,7 @@ import com.fr.chart.chartdata.GisMapTableDefinition;
import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperPoplink;
import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateCellLink;
import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.javascript.ChartEmailPane; import com.fr.design.chart.javascript.ChartEmailPane;
import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane;
@ -21,6 +22,8 @@ import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.frpane.UIBubbleFloatPane; import com.fr.design.gui.frpane.UIBubbleFloatPane;
import com.fr.design.gui.frpane.UICorrelationComboBoxPane; import com.fr.design.gui.frpane.UICorrelationComboBoxPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -53,6 +56,7 @@ import java.text.DecimalFormat;
import java.text.Format; import java.text.Format;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIObserver{ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIObserver{
private static final long serialVersionUID = 3477409806918835992L; private static final long serialVersionUID = 3477409806918835992L;
@ -655,6 +659,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private void populateHyperlink(Plot plot) { private void populateHyperlink(Plot plot) {
HashMap paneMap = renewMapWithPlot(plot); HashMap paneMap = renewMapWithPlot(plot);
//安装平台内打开插件时,添加相应按钮
Set<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG);
for (HyperlinkProvider provider : providers) {
NameableCreator nc = provider.createHyperlinkCreator();
paneMap.put(nc.getHyperlink(), nc.getUpdatePane());
}
List<UIMenuNameableCreator> list = refreshList(paneMap); List<UIMenuNameableCreator> list = refreshList(paneMap);
superLink.refreshMenuAndAddMenuAction(list); superLink.refreshMenuAndAddMenuAction(list);

2
designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -133,7 +133,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
} }
//子类覆盖 //子类覆盖
protected Plot getSelectedClonedPlot(){ protected <T extends Plot> T getSelectedClonedPlot(){
return null; return null;
} }

Loading…
Cancel
Save