Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~neil/design into release/10.0

bugfix/10.0
neil 6 years ago
parent
commit
1fc998129c
  1. 15
      designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java
  2. 6
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  3. 14
      designer-base/src/main/java/com/fr/design/utils/gui/UIComponentUtils.java
  4. 2
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  5. 93
      designer-base/src/main/java/com/fr/file/AbstractFILE.java
  6. 2
      designer-base/src/main/java/com/fr/file/FileFILE.java
  7. 102
      designer-base/src/main/java/com/fr/file/RenameExportFILE.java
  8. 34
      designer-base/src/main/java/com/fr/file/StashedFILE.java
  9. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  10. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  11. 55
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java
  12. 44
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java
  13. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java
  14. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  15. 18
      designer-chart/src/main/java/com/fr/van/chart/range/component/GradualIntervalConfigPane.java
  16. 60
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  17. 8
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

15
designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java

@ -1,7 +1,7 @@
package com.fr.design.actions.file.export; package com.fr.design.actions.file.export;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.JTemplateAction; import com.fr.design.actions.JTemplateAction;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.gui.iprogressbar.FRProgressBar; import com.fr.design.gui.iprogressbar.FRProgressBar;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -9,6 +9,7 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.exception.RemoteDesignPermissionDeniedException; import com.fr.exception.RemoteDesignPermissionDeniedException;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
import com.fr.file.RenameExportFILE;
import com.fr.file.filter.ChooseFileFilter; import com.fr.file.filter.ChooseFileFilter;
import com.fr.io.exporter.DesignExportType; import com.fr.io.exporter.DesignExportType;
import com.fr.io.exporter.ExporterKey; import com.fr.io.exporter.ExporterKey;
@ -92,12 +93,17 @@ public abstract class AbstractExportAction<E extends JTemplate<?, ?>> extends JT
int saveValue = fileChooserPane.showSaveDialog(DesignerContext.getDesignerFrame(), "." + this.getDefaultExtension()); int saveValue = fileChooserPane.showSaveDialog(DesignerContext.getDesignerFrame(), "." + this.getDefaultExtension());
if (saveValue == FILEChooserPane.JOPTIONPANE_OK_OPTION || saveValue == FILEChooserPane.OK_OPTION) { if (saveValue == FILEChooserPane.JOPTIONPANE_OK_OPTION || saveValue == FILEChooserPane.OK_OPTION) {
FILE target = fileChooserPane.getSelectedFILE(); FILE target = fileChooserPane.getSelectedFILE();
//rename 方式导出
target = RenameExportFILE.create(target);
try { try {
target.mkfile(); target.mkfile();
} catch (Exception exp) { } catch (Exception exp) {
FineLoggerFactory.getLogger().error("Error In Make New File", exp); FineLoggerFactory.getLogger().error("Error In Make New File", exp);
} }
FineLoggerFactory.getLogger().info("\"" + target.getName() + "\"" + Toolkit.i18nText("Fine-Design_Report_Prepare_Export") + "!"); FineLoggerFactory.getLogger().info(
"\"" + RenameExportFILE.recoverFileName(target.getName()) + "\"" +
Toolkit.i18nText("Fine-Design_Report_Prepare_Export") + "!"
);
progressbar = new FRProgressBar( progressbar = new FRProgressBar(
createExportWork(getSource(), target, para), createExportWork(getSource(), target, para),
@ -124,7 +130,7 @@ public abstract class AbstractExportAction<E extends JTemplate<?, ?>> extends JT
private boolean processNotSaved() { private boolean processNotSaved() {
//当前编辑的模板 //当前编辑的模板
E e = getEditingComponent(); E e = getEditingComponent();
if (!e.isALLSaved() && !DesignerMode.isVcsMode()) { if (!e.isALLSaved() && !DesignModeContext.isVcsMode()) {
e.stopEditing(); e.stopEditing();
int returnVal = JOptionPane.showConfirmDialog( int returnVal = JOptionPane.showConfirmDialog(
DesignerContext.getDesignerFrame(), DesignerContext.getDesignerFrame(),
@ -149,7 +155,7 @@ public abstract class AbstractExportAction<E extends JTemplate<?, ?>> extends JT
private SwingWorker createExportWork(final FILE source, final FILE target, final Map<String, Object> parameterMap) { private SwingWorker createExportWork(final FILE source, final FILE target, final Map<String, Object> parameterMap) {
final String path = source.getPath(); final String path = source.getPath();
final String name = target.getName(); final String name = RenameExportFILE.recoverFileName(target.getName());
return new SwingWorker<Void, Void>() { return new SwingWorker<Void, Void>() {
@ -162,7 +168,6 @@ public abstract class AbstractExportAction<E extends JTemplate<?, ?>> extends JT
dealExporter(outputStream, path, parameterMap); dealExporter(outputStream, path, parameterMap);
this.setProgress(80); this.setProgress(80);
outputStream.flush(); outputStream.flush();
outputStream.close();
this.setProgress(100); this.setProgress(100);
FineLoggerFactory.getLogger().info("\"" + name + "\"" + Toolkit.i18nText("Fine-Design_Report_Finish_Export") + "!"); FineLoggerFactory.getLogger().info("\"" + name + "\"" + Toolkit.i18nText("Fine-Design_Report_Finish_Export") + "!");

6
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -29,6 +29,7 @@ import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.gui.syntax.ui.rtextarea.RTextScrollPane; import com.fr.design.gui.syntax.ui.rtextarea.RTextScrollPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
@ -211,10 +212,13 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
isShareCheckBox.setBackground(Color.WHITE); isShareCheckBox.setBackground(Color.WHITE);
maxPanel = new MaxMemRowCountPanel(); maxPanel = new MaxMemRowCountPanel();
maxPanel.setBorder(null); maxPanel.setBorder(null);
JPanel wrapMaxPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
wrapMaxPanel.add(maxPanel);
wrapMaxPanel.setPreferredSize(new Dimension(250, 20));
UIToolbar editToolBar = ToolBarDef.createJToolBar(); UIToolbar editToolBar = ToolBarDef.createJToolBar();
toolBarDef.updateToolBar(editToolBar); toolBarDef.updateToolBar(editToolBar);
editToolBar.add(isShareCheckBox); editToolBar.add(isShareCheckBox);
editToolBar.add(maxPanel); editToolBar.add(wrapMaxPanel);
return editToolBar; return editToolBar;
} }

14
designer-base/src/main/java/com/fr/design/utils/gui/UIComponentUtils.java

@ -2,6 +2,8 @@ package com.fr.design.utils.gui;
import com.fr.design.gui.core.UITextComponent; import com.fr.design.gui.core.UITextComponent;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -9,6 +11,7 @@ import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.util.Locale;
/** /**
* 包含 UI 组件相关的工具方法 * 包含 UI 组件相关的工具方法
@ -45,15 +48,18 @@ public class UIComponentUtils {
} }
private static void insertPrefixToText(UITextComponent comp, String prefix) { private static void insertPrefixToText(UITextComponent comp, String prefix) {
if (comp == null) { if (comp == null || ComparatorUtils.equals(Locale.CHINA, GeneralContext.getLocale())) {
// 最初是为了解决日文国际化显示不全,而增加的换行功能。中文不需要换行。
// windows 下,字体为宋体时,对于 JLabel、JCheckBox、JButton 等控件,使用<html>换行后,文字会下移,可能导致文字下半部分被截断。
// 因此中文直接返回,不加换行逻辑。
return; return;
} }
String text = comp.getText();
if (StringUtils.isEmpty(comp.getText()) || text.startsWith(HTML_TAG)) { String text = comp.getText();
if (StringUtils.isEmpty(text) || text.startsWith(HTML_TAG)) {
return; return;
} }
comp.setText(prefix + comp.getText()); comp.setText(prefix + text);
} }
/** /**

2
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -291,7 +291,7 @@ public class CustomIconPane extends BasicPane {
Configurations.update(new WorkerFacade(WidgetInfoConfig.class) { Configurations.update(new WorkerFacade(WidgetInfoConfig.class) {
@Override @Override
public void run() { public void run() {
WidgetInfoConfig.getInstance().setIconManager(IconManager.getIconManager()); WidgetInfoConfig.getInstance().setIconManager(iconManager);
} }
}); });

93
designer-base/src/main/java/com/fr/file/AbstractFILE.java

@ -0,0 +1,93 @@
package com.fr.file;
import javax.swing.Icon;
import java.io.InputStream;
import java.io.OutputStream;
public abstract class AbstractFILE implements FILE {
@Override
public String prefix() {
throw new UnsupportedOperationException();
}
@Override
public boolean isDirectory() {
throw new UnsupportedOperationException();
}
@Override
public String getName() {
throw new UnsupportedOperationException();
}
@Override
public Icon getIcon() {
throw new UnsupportedOperationException();
}
@Override
public String getPath() {
throw new UnsupportedOperationException();
}
@Override
public void setPath(String path) {
throw new UnsupportedOperationException();
}
@Override
public FILE getParent() {
throw new UnsupportedOperationException();
}
@Override
public FILE[] listFiles() {
throw new UnsupportedOperationException();
}
@Override
public boolean createFolder(String name) {
throw new UnsupportedOperationException();
}
@Override
public boolean mkfile() throws Exception {
throw new UnsupportedOperationException();
}
@Override
public boolean exists() {
throw new UnsupportedOperationException();
}
@Override
public void closeTemplate() throws Exception {
throw new UnsupportedOperationException();
}
@Override
public InputStream asInputStream() throws Exception {
throw new UnsupportedOperationException();
}
@Override
public OutputStream asOutputStream() throws Exception {
throw new UnsupportedOperationException();
}
@Override
public String getEnvFullName() {
throw new UnsupportedOperationException();
}
@Override
public boolean isMemFile() {
throw new UnsupportedOperationException();
}
@Override
public boolean isEnvFile() {
throw new UnsupportedOperationException();
}
}

2
designer-base/src/main/java/com/fr/file/FileFILE.java

@ -201,7 +201,7 @@ public class FileFILE implements FILE {
OutputStream out; OutputStream out;
try { try {
StableUtils.makesureFileExist(file); StableUtils.makesureFileExist(file);
out = new FileOutputStream(file, true); out = new FileOutputStream(file, false);
} catch (Exception e) { } catch (Exception e) {
throw SessionLocalManager.createLogPackedException(e); throw SessionLocalManager.createLogPackedException(e);
} }

102
designer-base/src/main/java/com/fr/file/RenameExportFILE.java

@ -0,0 +1,102 @@
package com.fr.file;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.io.FileUtils;
import com.fr.web.session.SessionLocalManager;
import javax.swing.Icon;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
public class RenameExportFILE extends AbstractFILE {
private static final String EXPORT_SUFFIX = ".FRExportTmp";
private FILE file;
private RenameExportFILE(FILE file) {
this.file = new FileFILE(new File(file.getPath() + EXPORT_SUFFIX));
}
public static RenameExportFILE create(FILE file) {
return new RenameExportFILE(file);
}
public static String recoverFileName(String fileName) {
if (StringUtils.isEmpty(fileName) || !fileName.endsWith(EXPORT_SUFFIX)) {
return fileName;
}
return fileName.substring(0, fileName.lastIndexOf(EXPORT_SUFFIX));
}
@Override
public String prefix() {
return file.prefix();
}
@Override
public boolean isDirectory() {
return false;
}
@Override
public String getName() {
return file.getName();
}
@Override
public Icon getIcon() {
return null;
}
@Override
public String getPath() {
return file.getPath();
}
@Override
public FILE getParent() {
return file.getParent();
}
@Override
public boolean mkfile() throws Exception {
return file.mkfile();
}
@Override
public boolean exists() {
return file.exists();
}
@Override
public OutputStream asOutputStream() throws Exception {
final File localeFile = new File(file.getPath());
OutputStream out;
try {
StableUtils.makesureFileExist(localeFile);
out = new FileOutputStream(localeFile, false) {
@Override
public void close() throws IOException {
super.close();
String path = file.getPath();
if (localeFile.exists()) {
FileUtils.copyFile(localeFile, new File(recoverFileName(path)));
if (localeFile.getPath().endsWith(EXPORT_SUFFIX)) {
FileUtils.forceDelete(localeFile);
}
}
}
};
} catch (Exception e) {
throw SessionLocalManager.createLogPackedException(e);
}
return out;
}
}

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

@ -1,15 +1,13 @@
package com.fr.file; package com.fr.file;
import javax.swing.Icon; import javax.swing.Icon;
import javax.transaction.NotSupportedException;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream;
/** /**
* 切换环境用于暂存的文件类型 * 切换环境用于暂存的文件类型
*/ */
public class StashedFILE implements FILE { public class StashedFILE extends AbstractFILE {
private FILE file; private FILE file;
private byte[] content; private byte[] content;
@ -44,31 +42,6 @@ public class StashedFILE implements FILE {
return file.getPath(); return file.getPath();
} }
@Override
public void setPath(String path) {
throw new UnsupportedOperationException();
}
@Override
public FILE getParent() {
throw new UnsupportedOperationException();
}
@Override
public FILE[] listFiles() {
throw new UnsupportedOperationException();
}
@Override
public boolean createFolder(String name) {
throw new UnsupportedOperationException();
}
@Override
public boolean mkfile() throws Exception {
throw new UnsupportedOperationException();
}
@Override @Override
public boolean exists() { public boolean exists() {
return false; return false;
@ -84,11 +57,6 @@ public class StashedFILE implements FILE {
return new ByteArrayInputStream(content); return new ByteArrayInputStream(content);
} }
@Override
public OutputStream asOutputStream() throws Exception {
throw new NotSupportedException();
}
@Override @Override
public String getEnvFullName() { public String getEnvFullName() {
return file.getEnvFullName(); return file.getEnvFullName();

6
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -11,6 +11,7 @@ import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
@ -39,8 +40,9 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
} }
private void initDataPane() { private void initDataPane() {
UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TableData")); UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data"));
UIComponentUtils.setLineWrap(label, TABLE_DATA_LABEL_LINE_WRAP_WIDTH); UIComponentUtils.setLineWrap(label, TABLE_DATA_LABEL_LINE_WRAP_WIDTH);
UIComponentUtils.setPreferedWidth(label, ChartDataPane.LABEL_WIDTH);
tableDataPane = new DatabaseTableDataPane(label) { tableDataPane = new DatabaseTableDataPane(label) {
@Override @Override
@ -85,7 +87,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
* @return 返回标题. * @return 返回标题.
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TableData"); return Toolkit.i18nText("Fine-Design_Chart_TableData");
} }

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

@ -531,12 +531,16 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
double forValue = Double.MAX_VALUE; double forValue = Double.MAX_VALUE;
double backValue = -Double.MAX_VALUE; double backValue = -Double.MAX_VALUE;
for(int i = 0, size = textFieldList.size(); i < size; i++) {// check 是否合格, 然后检查 是否改变颜色, for(int i = 0, size = textFieldList.size(); i < size; i++) {// check 是否合格, 然后检查 是否改变颜色,
//backNumber是否是公式形式
boolean formulaBackNumber = false;
if(i == size - 1) { if(i == size - 1) {
backValue = -Double.MAX_VALUE; backValue = -Double.MAX_VALUE;
} else { } else {
Number backNumber = ChartBaseUtils.formula2Number(BaseFormula.createFormulaBuilder().build(getValue4Index(i+1))); Number backNumber = ChartBaseUtils.formula2Number(BaseFormula.createFormulaBuilder().build(getValue4Index(i+1)));
if(backNumber != null){ if(backNumber != null){
backValue = backNumber.doubleValue(); backValue = backNumber.doubleValue();
} else {
formulaBackNumber = true;
} }
} }
@ -544,7 +548,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
if(number != null) { if(number != null) {
double value = number.doubleValue(); double value = number.doubleValue();
if(value < forValue && value > backValue) { if ((value < forValue && value > backValue) || formulaBackNumber) {
setBackgroundUIColor(i,Color.WHITE); setBackgroundUIColor(i,Color.WHITE);
} else { } else {
setBackgroundUIColor(i, Color.red); setBackgroundUIColor(i, Color.red);

55
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java

@ -12,8 +12,8 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.Component;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -92,38 +92,53 @@ public abstract class AbstractExtendedChartReportDataPane<T extends AbstractData
if (chart.getFilterDefinition() instanceof ExtendedReportDataSet) { if (chart.getFilterDefinition() instanceof ExtendedReportDataSet) {
ExtendedReportDataSet dataSet = (ExtendedReportDataSet) chart.getFilterDefinition(); ExtendedReportDataSet dataSet = (ExtendedReportDataSet) chart.getFilterDefinition();
AbstractDataConfig dataConfig = dataSet.getDataConfig();
if (dataConfig != null) { populateDataSet(dataSet);
populate((T) dataConfig); }
}
public void populateDataSet(DataSet dataSet) {
if (dataSet == null) {
return;
}
AbstractDataConfig dataConfig = dataSet.getDataConfig();
if (dataConfig != null) {
populate((T) dataConfig);
if (hasCustomFieldPane() && dataConfig.getCustomFields().size() == 2) { if (hasCustomFieldPane() && dataConfig.getCustomFields().size() == 2) {
populateField(seriesPane, dataConfig.getCustomFields().get(0)); populateField(seriesPane, dataConfig.getCustomFields().get(0));
populateField(valuePane, dataConfig.getCustomFields().get(1)); populateField(valuePane, dataConfig.getCustomFields().get(1));
}
} }
} }
} }
public ExtendedReportDataSet updateDataSet() {
ExtendedReportDataSet dataSet = new ExtendedReportDataSet();
AbstractDataConfig dataConfig = update();
dataSet.setDataConfig(dataConfig);
List<ExtendedField> fieldList = new ArrayList<ExtendedField>();
if (hasCustomFieldPane()) {
fieldList.add(new ExtendedField(seriesPane.updateBean()));
fieldList.add(new ExtendedField(valuePane.updateBean()));
}
dataConfig.setCustomFields(fieldList);
return dataSet;
}
@Override @Override
public void updateBean(ChartCollection ob) { public void updateBean(ChartCollection ob) {
if (ob != null) { if (ob != null) {
Chart chart = ob.getSelectedChart(); Chart chart = ob.getSelectedChart();
if (chart != null) { if (chart != null) {
ExtendedReportDataSet dataSet = new ExtendedReportDataSet();
AbstractDataConfig dataConfig = update();
dataSet.setDataConfig(dataConfig);
List<ExtendedField> fieldList = new ArrayList<ExtendedField>();
if (hasCustomFieldPane()) {
fieldList.add(new ExtendedField(seriesPane.updateBean()));
fieldList.add(new ExtendedField(valuePane.updateBean()));
}
dataConfig.setCustomFields(fieldList);
chart.setFilterDefinition(dataSet); chart.setFilterDefinition(updateDataSet());
} }
} }
} }

44
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java

@ -93,17 +93,40 @@ public abstract class AbstractExtendedChartTableDataPane<T extends AbstractDataC
if (chart.getFilterDefinition() instanceof ExtendedTableDataSet) { if (chart.getFilterDefinition() instanceof ExtendedTableDataSet) {
ExtendedTableDataSet dataSet = (ExtendedTableDataSet) chart.getFilterDefinition(); ExtendedTableDataSet dataSet = (ExtendedTableDataSet) chart.getFilterDefinition();
AbstractDataConfig dataConfig = dataSet.getDataConfig(); populateDataSet(dataSet);
if (dataConfig != null) {
populate((T) dataConfig);
if (customFieldComboBoxPane != null) { }
customFieldComboBoxPane.populateBean(dataConfig);
} }
public void populateDataSet(DataSet dataSet) {
if (dataSet == null) {
return;
}
AbstractDataConfig dataConfig = dataSet.getDataConfig();
if (dataConfig != null) {
populate((T) dataConfig);
if (customFieldComboBoxPane != null) {
customFieldComboBoxPane.populateBean(dataConfig);
} }
}
}
public ExtendedTableDataSet updateDataSet() {
ExtendedTableDataSet dataSet = new ExtendedTableDataSet();
dataSet.setDataConfig(update());
if (customFieldComboBoxPane != null) {
customFieldComboBoxPane.updateBean(dataSet.getDataConfig());
} }
return dataSet;
} }
@ -113,14 +136,7 @@ public abstract class AbstractExtendedChartTableDataPane<T extends AbstractDataC
Chart chart = ob.getSelectedChart(); Chart chart = ob.getSelectedChart();
if (chart != null) { if (chart != null) {
ExtendedTableDataSet dataSet = new ExtendedTableDataSet(); chart.setFilterDefinition(updateDataSet());
dataSet.setDataConfig(update());
if (customFieldComboBoxPane != null) {
customFieldComboBoxPane.updateBean(dataSet.getDataConfig());
}
chart.setFilterDefinition(dataSet);
} }
} }
} }

14
designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java

@ -1,12 +1,16 @@
package com.fr.van.chart.designer.style; package com.fr.van.chart.designer.style;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
import com.fr.plugin.chart.type.LegendType; import com.fr.plugin.chart.type.LegendType;
import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick;
import com.fr.van.chart.range.component.GradualIntervalConfigPane; import com.fr.van.chart.range.component.GradualIntervalConfigPane;
import com.fr.van.chart.range.component.GradualLegendPane; import com.fr.van.chart.range.component.GradualLegendPane;
import com.fr.van.chart.range.component.LegendGradientBar;
import com.fr.van.chart.range.component.SectionIntervalConfigPaneWithOutNum; import com.fr.van.chart.range.component.SectionIntervalConfigPaneWithOutNum;
import com.fr.van.chart.range.component.SectionLegendPane; import com.fr.van.chart.range.component.SectionLegendPane;
@ -46,8 +50,12 @@ public class HeatMapRangeLegendPane extends VanChartRangeLegendPane {
protected GradualIntervalConfigPane createGradualIntervalConfigPane() { protected GradualIntervalConfigPane createGradualIntervalConfigPane() {
return new GradualIntervalConfigPane(){ return new GradualIntervalConfigPane(){
@Override @Override
protected Component[][] getPaneComponents() { protected Component[][] getPaneComponents(MinMaxValuePaneWithOutTick minMaxValuePane, ColorSelectBoxWithOutTransparent colorSelectBox, UINumberDragPane numberDragPane, LegendGradientBar legendGradientBar) {
return super.getPaneComponentsWithOutTheme(); return new Component[][]{
new Component[]{minMaxValuePane, null},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")), numberDragPane},
new Component[]{null, legendGradientBar}
};
} }
}; };
} }

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

@ -143,7 +143,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){
JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col); JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col);
return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout"), panel); return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel);
} }

18
designer-chart/src/main/java/com/fr/van/chart/range/component/GradualIntervalConfigPane.java

@ -4,7 +4,6 @@ import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.plugin.chart.range.GradualIntervalConfig; import com.fr.plugin.chart.range.GradualIntervalConfig;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick; import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick;
@ -23,7 +22,7 @@ public class GradualIntervalConfigPane extends JPanel{
//主题颜色 //主题颜色
private ColorSelectBoxWithOutTransparent colorSelectBox; private ColorSelectBoxWithOutTransparent colorSelectBox;
//划分阶段 //划分阶段
UINumberDragPane numberDragPane; private UINumberDragPane numberDragPane;
//渐变色编辑器 //渐变色编辑器
private LegendGradientBar legendGradientBar; private LegendGradientBar legendGradientBar;
@ -58,7 +57,7 @@ public class GradualIntervalConfigPane extends JPanel{
double[] col = new double[]{f, e}; double[] col = new double[]{f, e};
double[] row = new double[]{p, p, p, p}; double[] row = new double[]{p, p, p, p};
Component[][] components = getPaneComponents(); Component[][] components = getPaneComponents(minMaxValuePane, colorSelectBox, numberDragPane, legendGradientBar);
//控件承载面板 //控件承载面板
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col); JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col);
@ -70,7 +69,10 @@ public class GradualIntervalConfigPane extends JPanel{
return new LegendGradientBar(); return new LegendGradientBar();
} }
protected Component[][] getPaneComponents(){ protected Component[][] getPaneComponents(MinMaxValuePaneWithOutTick minMaxValuePane,
ColorSelectBoxWithOutTransparent colorSelectBox,
UINumberDragPane numberDragPane,
LegendGradientBar legendGradientBar) {
return new Component[][]{ return new Component[][]{
new Component[]{minMaxValuePane, null}, new Component[]{minMaxValuePane, null},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Subject_Color")), colorSelectBox}, new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Subject_Color")), colorSelectBox},
@ -79,14 +81,6 @@ public class GradualIntervalConfigPane extends JPanel{
}; };
} }
protected Component[][] getPaneComponentsWithOutTheme(){
return new Component[][]{
new Component[]{minMaxValuePane, null},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")), numberDragPane},
new Component[]{null, legendGradientBar},
};
}
public void populate(GradualIntervalConfig intervalConfig){ public void populate(GradualIntervalConfig intervalConfig){
minMaxValuePane.populate(intervalConfig.getMinAndMaxValue()); minMaxValuePane.populate(intervalConfig.getMinAndMaxValue());

60
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -17,6 +17,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
@ -51,6 +52,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private static final int HEAD_WDITH = 290; private static final int HEAD_WDITH = 290;
private static final int HEAD_HEIGTH = 24; private static final int HEAD_HEIGTH = 24;
private static final int COMBO_WIDTH = 154; private static final int COMBO_WIDTH = 154;
private static final int BUTTON_GROUP_WIDTH = 140;
// normal // normal
private UIButtonGroup autoshrik; private UIButtonGroup autoshrik;
@ -81,7 +83,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private UIRadioButton[] adjustRadioButtons; private UIRadioButton[] adjustRadioButtons;
// 插入行策略 // 插入行策略
private UIButtonGroup insertRowPolicy; private UIButtonGroup insertRowPolicyButtonGroup;
private ValueEditorPane valueEditor; private ValueEditorPane valueEditor;
private CardLayout insertRowLayout; private CardLayout insertRowLayout;
private JPanel insertRowPane; private JPanel insertRowPane;
@ -147,7 +149,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private void initInsertRowPolicyPane() { private void initInsertRowPolicyPane() {
// 插入行策略 // 插入行策略
insertRowPolicy = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_NULL"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Estate_Default_Text"), insertRowPolicyButtonGroup = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_NULL"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Estate_Default_Text"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_COPY")}); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_COPY")});
defaultValuePane = new JPanel(new BorderLayout(4, 0)); defaultValuePane = new JPanel(new BorderLayout(4, 0));
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane(); valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
@ -157,10 +159,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
insertRowPane.add(new JPanel(), "none"); insertRowPane.add(new JPanel(), "none");
insertRowPane.add(defaultValuePane, "content"); insertRowPane.add(defaultValuePane, "content");
insertRowPane.setPreferredSize(new Dimension(0, 0)); insertRowPane.setPreferredSize(new Dimension(0, 0));
insertRowPolicy.addChangeListener(new ChangeListener() { insertRowPolicyButtonGroup.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
if (insertRowPolicy.getSelectedIndex() == 1) { if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, 20)); insertRowPane.setPreferredSize(new Dimension(100, 20));
insertRowLayout.show(insertRowPane, "content"); insertRowLayout.show(insertRowPane, "content");
} else { } else {
@ -169,16 +171,33 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
} }
} }
}); });
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize1 = {p, p}; UILabel insertRowPolicyLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy", SwingConstants.LEFT));
double[] columnSize1 = {p, f}; UIComponentUtils.setLineWrap(insertRowPolicyLabel);
int[][] rowCount1 = {{1, 1}, {1, 1}};
Component[][] components1 = new Component[][]{ // 如果右侧需要很宽的空间,就用3行1列的布局
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy"), SwingConstants.LEFT), insertRowPolicy}, if (insertRowPolicyButtonGroup.getPreferredSize().getWidth() > BUTTON_GROUP_WIDTH) {
new Component[]{null, insertRowPane}, double[] rowSize = {p, p, p};
}; double[] columnSize = {f};
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components1, rowSize1, columnSize1, rowCount1, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
Component[][] components = new Component[][] {
new Component[]{insertRowPolicyLabel},
new Component[]{insertRowPolicyButtonGroup},
new Component[]{insertRowPane},
};
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
} else {
double[] rowSize = {p, p};
double[] columnSize = {f, BUTTON_GROUP_WIDTH};
Component[][] components = new Component[][] {
new Component[]{insertRowPolicyLabel, insertRowPolicyButtonGroup},
new Component[]{null, insertRowPane},
};
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
}
} }
private JPanel seniorUpPane() { private JPanel seniorUpPane() {
@ -200,13 +219,14 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
fileNamePane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); fileNamePane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
UILabel showContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Content"), SwingConstants.LEFT); UILabel showContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Content"), SwingConstants.LEFT);
UIComponentUtils.setLineWrap(showContentLabel);
UILabel toolTipLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip")); UILabel toolTipLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"));
JPanel toolTipTextFieldWrapper = new JPanel(new BorderLayout()); JPanel toolTipTextFieldWrapper = new JPanel(new BorderLayout());
toolTipTextFieldWrapper.add(tooltipTextField, BorderLayout.NORTH); toolTipTextFieldWrapper.add(tooltipTextField, BorderLayout.NORTH);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{showContentLabel, showContent}, new Component[]{showContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(showContent)},
new Component[]{fileNamePane, null}, // 选择"用下载连接显示二进制内容"时,会显示这一行的面板 new Component[]{fileNamePane, null}, // 选择"用下载连接显示二进制内容"时,会显示这一行的面板
new Component[]{toolTipLabel, toolTipTextFieldWrapper} new Component[]{toolTipLabel, toolTipTextFieldWrapper}
}; };
@ -323,7 +343,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
pageAfterColumnCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Page_After_Column")); pageAfterColumnCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Page_After_Column"));
canBreakOnPaginateCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellPage_Can_Break_On_Paginate")); canBreakOnPaginateCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellPage_Can_Break_On_Paginate"));
repeatCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellPage_Repeat_Content_When_Paging")); repeatCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellPage_Repeat_Content_When_Paging"));
insertRowPolicy.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy")); insertRowPolicyButtonGroup.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy"));
valueEditor.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy")); valueEditor.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy"));
} }
@ -395,16 +415,16 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
cellInsertPolicyAttr = new CellInsertPolicyAttr(); cellInsertPolicyAttr = new CellInsertPolicyAttr();
} }
if (ComparatorUtils.equals(CellInsertPolicyAttr.INSERT_POLICY_COPY, cellInsertPolicyAttr.getInsertPolicy())) { if (ComparatorUtils.equals(CellInsertPolicyAttr.INSERT_POLICY_COPY, cellInsertPolicyAttr.getInsertPolicy())) {
insertRowPolicy.setSelectedIndex(2); insertRowPolicyButtonGroup.setSelectedIndex(2);
} else if (ComparatorUtils.equals(CellInsertPolicyAttr.INSERT_POLICY_DEFAULT, cellInsertPolicyAttr.getInsertPolicy())) { } else if (ComparatorUtils.equals(CellInsertPolicyAttr.INSERT_POLICY_DEFAULT, cellInsertPolicyAttr.getInsertPolicy())) {
insertRowPolicy.setSelectedIndex(1); insertRowPolicyButtonGroup.setSelectedIndex(1);
Object defaultValue = cellInsertPolicyAttr.getDefaultInsertValue(); Object defaultValue = cellInsertPolicyAttr.getDefaultInsertValue();
this.valueEditor.populate(defaultValue); this.valueEditor.populate(defaultValue);
} else { } else {
insertRowPolicy.setSelectedIndex(0); insertRowPolicyButtonGroup.setSelectedIndex(0);
this.valueEditor.populate(StringUtils.EMPTY); this.valueEditor.populate(StringUtils.EMPTY);
} }
if (insertRowPolicy.getSelectedIndex() == 1) { if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, 20)); insertRowPane.setPreferredSize(new Dimension(100, 20));
insertRowLayout.show(insertRowPane, "content"); insertRowLayout.show(insertRowPane, "content");
} else { } else {
@ -521,9 +541,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
// 插入 // 插入
CellInsertPolicyAttr cellInsertPolicyAttr = new CellInsertPolicyAttr(); CellInsertPolicyAttr cellInsertPolicyAttr = new CellInsertPolicyAttr();
if (insertRowPolicy.getSelectedIndex() == 2) { if (insertRowPolicyButtonGroup.getSelectedIndex() == 2) {
cellInsertPolicyAttr.setInsertPolicy(CellInsertPolicyAttr.INSERT_POLICY_COPY); cellInsertPolicyAttr.setInsertPolicy(CellInsertPolicyAttr.INSERT_POLICY_COPY);
} else if (insertRowPolicy.getSelectedIndex() == 1) { } else if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) {
cellInsertPolicyAttr.setInsertPolicy(CellInsertPolicyAttr.INSERT_POLICY_DEFAULT); cellInsertPolicyAttr.setInsertPolicy(CellInsertPolicyAttr.INSERT_POLICY_DEFAULT);
Object value = valueEditor.update(); Object value = valueEditor.update();
cellInsertPolicyAttr.setDefaultInsertValue(value); cellInsertPolicyAttr.setDefaultInsertValue(value);

8
designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

@ -679,12 +679,10 @@ public class EditToolBar extends BasicPane {
private void updateCustomToolBarButton() { private void updateCustomToolBarButton() {
CustomToolBarButton customToolBarButton = (CustomToolBarButton) widget; CustomToolBarButton customToolBarButton = (CustomToolBarButton) widget;
if (customToolBarButton.getJSImpl() != null) { if (customToolBarButton.getJSImpl() == null) {
customToolBarButton.setJSImpl(this.javaScriptPane.updateBean()); this.javaScriptPane = JavaScriptActionPane.createDefault();
} else {
customToolBarButton.setJSImpl(JavaScriptActionPane.createDefault().updateBean());
} }
customToolBarButton.setJSImpl(this.javaScriptPane.updateBean());
} }
} }

Loading…
Cancel
Save