Browse Source

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

persist/11.0
Maksim 5 years ago
parent
commit
178ae5f836
  1. 292
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 3
      designer-base/src/main/java/com/fr/design/gui/chart/MiddleChartComponent.java
  3. 6
      designer-base/src/main/java/com/fr/design/gui/frpane/CommitTabbedPane.java
  4. 6
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java
  5. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java
  6. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButton.java
  7. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java
  8. 4
      designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIScrollBarUI.java
  9. 8
      designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java
  10. 10
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextArea.java
  11. 17
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/Style.java
  12. 23
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxScheme.java
  13. 4
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/folding/HtmlFoldParser.java
  14. 17
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/MakefileTokenMaker.java
  15. 38
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java
  16. 5
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/SearchEngine.java
  17. 7
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/VolatileImageBackgroundPainterStrategy.java
  18. 9
      designer-base/src/main/java/com/fr/design/icon/BorderIcon.java
  19. 2
      designer-base/src/main/java/com/fr/design/icon/LockIcon.java
  20. 2
      designer-base/src/main/java/com/fr/design/icon/WarningIcon.java
  21. 5
      designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java
  22. 40
      designer-base/src/main/java/com/fr/design/layout/TableLayout.java
  23. 4
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  24. 4
      designer-base/src/main/java/com/fr/design/report/WatermarkPane.java
  25. 5
      designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java
  26. 5
      designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java
  27. 303
      designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java
  28. 45
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  29. 139
      designer-chart/src/main/java/com/fr/design/chart/fun/ChartTypeUIProvider.java
  30. 101
      designer-chart/src/main/java/com/fr/design/chart/fun/IndependentChartUIProvider.java
  31. 91
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java
  32. 66
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractIndependentChartUI.java
  33. 28
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java
  34. 27
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractIndependentChartsUI.java
  35. 26
      designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java
  36. 2
      designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java
  37. 6
      designer-chart/src/main/java/com/fr/design/chart/report/GisMapReportDataContentPane.java
  38. 8
      designer-chart/src/main/java/com/fr/design/chart/report/GisMapTableDataContentPane.java
  39. 8
      designer-chart/src/main/java/com/fr/design/chart/report/MapMoreTableIndexPane.java
  40. 8
      designer-chart/src/main/java/com/fr/design/chart/report/MapTableDataSinglePane.java
  41. 3
      designer-chart/src/main/java/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java
  42. 30
      designer-chart/src/main/java/com/fr/design/chartx/AbstractVanSingleDataPane.java
  43. 25
      designer-chart/src/main/java/com/fr/design/chartx/GanttChartDataPane.java
  44. 21
      designer-chart/src/main/java/com/fr/design/chartx/MultiPieChartDataPane.java
  45. 23
      designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java
  46. 20
      designer-chart/src/main/java/com/fr/design/chartx/WordCloudChartDataPane.java
  47. 3
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java
  48. 68
      designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractDataPane.java
  49. 42
      designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractOtherPane.java
  50. 79
      designer-chart/src/main/java/com/fr/design/chartx/impl/DefaultTypePane.java
  51. 8
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartsEditPane.java
  52. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  53. 21
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  54. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java
  55. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java
  56. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDataPointLabel4MapPane.java
  57. 25
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java
  58. 23
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java
  59. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java
  60. 19
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartUIProvider.java
  61. 3
      designer-chart/src/main/java/com/fr/extended/chart/ExtendedTypePane.java
  62. 37
      designer-chart/src/main/java/com/fr/van/chart/area/AreaIndependentVanChartInterface.java
  63. 37
      designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaPlotPane.java
  64. 38
      designer-chart/src/main/java/com/fr/van/chart/bar/BarIndependentVanChartInterface.java
  65. 36
      designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java
  66. 26
      designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java
  67. 29
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java
  68. 44
      designer-chart/src/main/java/com/fr/van/chart/column/ColumnIndependentVanChartInterface.java
  69. 37
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java
  70. 30
      designer-chart/src/main/java/com/fr/van/chart/custom/CustomIndependentVanChartInterface.java
  71. 32
      designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java
  72. 16
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  73. 27
      designer-chart/src/main/java/com/fr/van/chart/drillmap/DrillMapIndependentVanChartInterface.java
  74. 31
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java
  75. 16
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/FunnelIndependentVanChartInterface.java
  76. 29
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/type/VanChartFunnelTypePane.java
  77. 18
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/GanttIndependentVanChartInterface.java
  78. 22
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/type/VanChartGanttPlotPane.java
  79. 32
      designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java
  80. 36
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugePlotPane.java
  81. 17
      designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java
  82. 29
      designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java
  83. 28
      designer-chart/src/main/java/com/fr/van/chart/line/LineIndependentVanChartInterface.java
  84. 36
      designer-chart/src/main/java/com/fr/van/chart/line/VanChartLinePlotPane.java
  85. 32
      designer-chart/src/main/java/com/fr/van/chart/map/MapIndependentVanChartInterface.java
  86. 34
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java
  87. 26
      designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java
  88. 22
      designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java
  89. 3
      designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotReportDataContentPane.java
  90. 3
      designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java
  91. 29
      designer-chart/src/main/java/com/fr/van/chart/pie/PieIndependentVanChartInterface.java
  92. 32
      designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java
  93. 26
      designer-chart/src/main/java/com/fr/van/chart/radar/RadarIndependentVanChartInterface.java
  94. 31
      designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarPlotPane.java
  95. 3
      designer-chart/src/main/java/com/fr/van/chart/range/component/LegendGradientBar.java
  96. 17
      designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java
  97. 31
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java
  98. 24
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java
  99. 28
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java
  100. 16
      designer-chart/src/main/java/com/fr/van/chart/treemap/TreeMapIndependentVanChartInterface.java
  101. Some files were not shown because too many files have changed in this diff Show More

292
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,6 +1,6 @@
package com.fr.design.actions.file;
import com.fr.base.BaseUtils;
import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager;
@ -18,12 +18,14 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIDictionaryComboBox;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iprogressbar.UIProgressBarUI;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.mainframe.vcs.common.VcsHelper;
@ -36,22 +38,39 @@ import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import com.fr.third.apache.log4j.Level;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.vcs.VcsOperator;
import com.fr.workspace.server.vcs.git.config.GcConfig;
import javax.swing.BorderFactory;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JDialog;
import javax.swing.Timer;
import javax.swing.SwingWorker;
import javax.swing.UIManager;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FlowLayout;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -59,9 +78,15 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;
import java.io.File;
import java.text.DecimalFormat;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
/**
* 选项对话框
@ -148,9 +173,17 @@ public class PreferencePane extends BasicPane {
private UICheckBox saveCommitCheckBox;
private UICheckBox useIntervalCheckBox;
private IntegerEditor saveIntervalEditor;
private UICheckBox gcEnableCheckBox;
private UIButton gcButton;
private UILabel remindVcsLabel;
private JDialog gcDialog;
private UILabel gcMessage = new UILabel();
private JPanel gcDialogDownPane = new JPanel();
private JPanel gcProgressBarPanel = new JPanel();
private JProgressBar gcProgressBar;
private Timer gcProgressTimer;
private UIButton gcOkButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
public PreferencePane() {
this.initComponents();
@ -230,6 +263,10 @@ public class PreferencePane extends BasicPane {
saveCommitCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Vcs_No_Delete"));
saveIntervalEditor = new IntegerEditor(60);
useIntervalCheckBox = new UICheckBox();
//gc面板
JPanel gcControlPane = createGcControlPane();
JPanel enableVcsPanel = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());
enableVcsPanel.add(vcsEnableCheckBox);
enableVcsPanel.add(remindVcsLabel);
@ -262,6 +299,42 @@ public class PreferencePane extends BasicPane {
vcsPane.add(enableVcsPanel);
vcsPane.add(intervalPanel);
vcsPane.add(saveCommitCheckBox);
vcsPane.add(gcControlPane);
}
/**
* 模创建板版本gc 配置操作面板
*
* @return 面板
*/
private JPanel createGcControlPane() {
//gc面板
JPanel gcControlPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
JPanel gcButtonPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 40, 0));
gcEnableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Vcs_Storage_Optimization"));
gcButton = initGcButton();
gcButtonPane.add(gcButton);
gcControlPane.add(gcEnableCheckBox);
gcControlPane.add(gcButtonPane);
gcButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
tryGc();
}
});
gcEnableCheckBox.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
gcButton.setEnabled(gcEnableCheckBox.isSelected());
}
});
//集群下禁用
if (FineClusterConfig.getInstance().isCluster()) {
gcEnableCheckBox.setEnabled(false);
gcButton.setEnabled(false);
}
return gcControlPane;
}
private void createFunctionPane(JPanel generalPane) {
@ -629,7 +702,8 @@ public class PreferencePane extends BasicPane {
saveIntervalEditor.setValue(vcsConfigManager.getSaveInterval());
saveCommitCheckBox.setSelected(vcsConfigManager.isSaveCommit());
useIntervalCheckBox.setSelected(vcsConfigManager.isUseInterval());
gcEnableCheckBox.setSelected(GcConfig.getInstance().isGcEnable());
gcButton.setEnabled(gcEnableCheckBox.isSelected());
supportCellEditorDefCheckBox.setSelected(designerEnvManager.isSupportCellEditorDef());
isDragPermitedCheckBox.setSelected(designerEnvManager.isDragPermited());
@ -726,6 +800,18 @@ public class PreferencePane extends BasicPane {
vcsConfigManager.setVcsEnable(this.vcsEnableCheckBox.isSelected());
vcsConfigManager.setSaveCommit(this.saveCommitCheckBox.isSelected());
vcsConfigManager.setUseInterval(this.useIntervalCheckBox.isSelected());
Configurations.update(new Worker() {
@Override
public void run() {
GcConfig.getInstance().setGcEnable(gcEnableCheckBox.isSelected());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{GcConfig.class};
}
});
if (this.autoPushUpdateCheckBox != null) {
designerEnvManager.setAutoPushUpdateEnabled(this.autoPushUpdateCheckBox.isSelected());
}
@ -762,7 +848,6 @@ public class PreferencePane extends BasicPane {
}
// 如果语言设置改变了,则显示重启对话框
public void showRestartDialog() {
if (!languageChanged) {
@ -797,4 +882,203 @@ public class PreferencePane extends BasicPane {
public BasicDialog showWindow(Window window, DialogActionListener l) {
return showWindowWithCustomSize(window, l, new Dimension(BasicDialog.DEFAULT.width, this.getPreferredSize().height + OFFSET_HEIGHT));
}
private void tryGc() {
final SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() {
private long size = 0;
@Override
protected Boolean doInBackground() {
size = WorkContext.getCurrent().get(VcsOperator.class).immediatelyGc();
return true;
}
@Override
protected void done() {
try {
get();
} catch (ExecutionException e) {
updateGcDialogPanelInfo(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Vcs_Need_Update_Remote_Server_Jar"));
return;
} catch (InterruptedException e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
}
updateGcDialogPanelInfo(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Vcs_Reduce_File_Size") + fileSizeConvert(size));
gcDialogDownPane.revalidate();
gcDialogDownPane.repaint();
gcDialogDownPane.add(gcOkButton);
}
};
worker.execute();
initGcDialog();
gcOkButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
gcDialog.dispose();
}
});
gcDialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
stopGcProgressTimer();
worker.cancel(true);
}
});
gcDialog.setVisible(true);
gcDialog.dispose();
}
/**
* gc 后更新进度条面板信息
*
* @param message
*/
private void updateGcDialogPanelInfo(String message) {
stopGcProgressTimer();
gcMessage.setText(message);
if (null != gcProgressBar) {
gcProgressBarPanel.remove(gcProgressBar);
}
if (null != gcDialog) {
gcDialog.setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"));
}
}
/**
* 初始化 gc 对话框
*/
private void initGcDialog() {
gcDialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(PreferencePane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Vcs_Clean_Progress") + "...", true);
gcDialog.setSize(new Dimension(340, 140));
JPanel jp = new JPanel();
//中上
JPanel gcUpPane = new JPanel();
gcUpPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
gcUpPane.add(new UILabel(UIManager.getIcon("OptionPane.informationIcon")));
gcProgressBarPanel = createProgressBarPane();
gcUpPane.add(gcProgressBarPanel);
//中下
gcDialogDownPane = new JPanel();
gcDialogDownPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0));
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
jp.add(gcUpPane);
jp.add(gcDialogDownPane);
gcDialog.add(jp);
gcDialog.setResizable(false);
gcDialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(PreferencePane.this));
}
/**
* gc 进度条面板
*
* @return
*/
private JPanel createProgressBarPane() {
JPanel jp = new JPanel();
VerticalFlowLayout layout = new VerticalFlowLayout();
layout.setAlignLeft(true);
jp.setLayout(layout);
//提示
gcMessage = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Vcs_Cleaning"));
// 创建一个进度条
gcProgressBar = createGcProgressBar(0, 30, 240, 15, Color.GREEN);
gcProgressTimer = createGcProgressTimer(500, gcProgressBar);
gcProgressTimer.start();
jp.add(gcMessage);
jp.add(gcProgressBar);
return jp;
}
/**
* 创建 gc 进度条
*
* @param min 最小值
* @param max 最大值
* @param width 宽度
* @param height 高度
* @param color 填充的图片颜色
* @return
*/
private JProgressBar createGcProgressBar(int min, int max, int width, int height, Color color) {
// 创建一个进度条
JProgressBar progressBar = new JProgressBar(min, max);
UIProgressBarUI progressBarUI = new UIProgressBarUI();
progressBar.setUI(progressBarUI);
//颜色(进度条里的小方块)
progressBar.setForeground(color);
progressBar.setOpaque(false);
progressBar.setPreferredSize(new Dimension(width, height));
return progressBar;
}
/**
* @param delay 每隔 delay 毫秒更新进度
* @param progressBar 要更新的进度条
* @return
*/
private Timer createGcProgressTimer(int delay, final JProgressBar progressBar) {
if (null == progressBar) {
return null;
}
// 模拟延时操作进度, 每隔 delay / 1000 秒更新进度
Timer timer = new Timer(delay, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
int currentProgress = progressBar.getValue() + 1;
if (currentProgress > progressBar.getMaximum()) {
currentProgress = progressBar.getMinimum();
}
progressBar.setValue(currentProgress);
}
});
return timer;
}
/**
* 停止进度条模拟计时器
*/
private void stopGcProgressTimer() {
if (null == gcProgressTimer) {
return;
}
gcProgressTimer.stop();
}
/**
* 将字节转换成 KB or MB or GB 保留两位小数
*
* @param size
* @return
*/
private String fileSizeConvert(long size) {
DecimalFormat df = new DecimalFormat("0.00");
double n = 1024d;
if (size > Math.pow(n, 3)) {
return df.format(size / Math.pow(n, 3)) + "GB";
}
if (size > Math.pow(n, 2)) {
return df.format(size / Math.pow(n, 2)) + "MB";
}
return new StringBuilder().append(df.format(size / n)).append("KB").toString();
}
/**
* 立即清理的Button
*
* @return
*/
private UIButton initGcButton() {
UIButton gcButton = new UIButton(Toolkit.i18nText("Fine-Design_Vcs_Clean"));
gcButton.setPreferredSize(new Dimension(100, 15));
gcButton.setRoundBorder(true, Constants.LEFT);
return gcButton;
}
}

3
designer-base/src/main/java/com/fr/design/gui/chart/MiddleChartComponent.java

@ -1,7 +1,6 @@
package com.fr.design.gui.chart;
import com.fr.base.chart.BaseChartCollection;
import com.fr.chartx.attr.ChartProvider;
import com.fr.stable.core.PropertyChangeListener;
import javax.swing.JComponent;
@ -18,7 +17,5 @@ public abstract class MiddleChartComponent extends JComponent {
public abstract void reset();
public abstract ChartProvider getEditingChart();
public abstract void addStopEditingListener(PropertyChangeListener list);
}

6
designer-base/src/main/java/com/fr/design/gui/frpane/CommitTabbedPane.java

@ -296,7 +296,7 @@ public class CommitTabbedPane extends JComponent implements MouseListener, Mous
double[] x = {startX, startX, startX + tabWidth, startX + tabWidth, startX};
double[] y = {-1, getHeight(), getHeight(), -1, -1};
RoundRectangle2D.Double rect1 = new RoundRectangle2D.Double(startX, 1, this.getWidth(), this.getHeight(), 7, 7);
g2d.setPaint(new GradientPaint(1, 1, new Color(255, 255, 255), 1, getHeight() - 1, UIConstants.NORMAL_BACKGROUND));
g2d.setPaint(new GradientPaint(1, 1, new Color(255, 255, 255), 1, getHeight() - 1f, UIConstants.NORMAL_BACKGROUND));
GeneralPath generalPath = new GeneralPath(Path2D.WIND_EVEN_ODD, x.length);
generalPath.moveTo((float) x[0] + CORNOR_RADIUS, (float) y[0]);
@ -345,9 +345,9 @@ public class CommitTabbedPane extends JComponent implements MouseListener, Mous
double[] x = {startX, startX, startX + tabWidth, startX + tabWidth, startX};
double[] y = {-1, getHeight() - 1, getHeight() - 1, -1, -1};
if (selfIndex == mouseOveredIndex) {
g2d.setPaint(new GradientPaint(1, 1, new Color(255, 255, 255), 1, getHeight() - 1, UIConstants.NORMAL_BACKGROUND));
g2d.setPaint(new GradientPaint(1, 1, new Color(255, 255, 255), 1, getHeight() - 1f, UIConstants.NORMAL_BACKGROUND));
} else {
g2d.setPaint(new GradientPaint(1, 1, UIConstants.NORMAL_BACKGROUND, 1, getHeight() - 1, UIConstants.NORMAL_BACKGROUND));
g2d.setPaint(new GradientPaint(1, 1, UIConstants.NORMAL_BACKGROUND, 1, getHeight() - 1f, UIConstants.NORMAL_BACKGROUND));
}

6
designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java

@ -321,9 +321,9 @@ public class UIBasicButtonUI extends MetalButtonUI {
//harry: 画带有高光的按钮。
private void drawHighLightButton(Graphics2D g2, Color color1, Color color2, int w, int h) {
GradientPaint buttonPaint = new GradientPaint(0, 0, color1, 0, h - 1, color2);
GradientPaint buttonHighLightPaint = new GradientPaint(0, 0, new Color(1.0f, 1.0f, 1.0f, 0.6f), 0, h / 2, new Color(1.0f, 1.0f, 1.0f, 0.2f));
GradientPaint buttonHighLightLinePaint = new GradientPaint(1, 1, new Color(1.0f, 1.0f, 1.0f, 0.8f), 0, h / 2, new Color(1.0f, 1.0f, 1.0f, 0.4f));
GradientPaint buttonPaint = new GradientPaint(0, 0, color1, 0, h - 1f, color2);
GradientPaint buttonHighLightPaint = new GradientPaint(0, 0, new Color(1.0f, 1.0f, 1.0f, 0.6f), 0, h / 2f, new Color(1.0f, 1.0f, 1.0f, 0.2f));
GradientPaint buttonHighLightLinePaint = new GradientPaint(1, 1, new Color(1.0f, 1.0f, 1.0f, 0.8f), 0, h / 2f, new Color(1.0f, 1.0f, 1.0f, 0.4f));
g2.setPaint(buttonPaint);
g2.fillRoundRect(0, 0, w - 1, h - 1, 3, 3);
g2.setPaint(buttonHighLightLinePaint);//按钮内侧高光线(内发光,0%阻塞)

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java

@ -251,7 +251,7 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
protected void paintOtherBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(borderStroke);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1f, getHeight() - 1f, UIConstants.ARC, UIConstants.ARC);
g2d.setColor(borderColor);
g2d.draw(shape);
}

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButton.java

@ -232,7 +232,7 @@ public class UISliderButton extends JButton implements UIObserver {
protected void paintOtherBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(borderStroke);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1f, getHeight() - 1f, UIConstants.ARC, UIConstants.ARC);
g2d.setColor(borderColor);
g2d.draw(shape);
}

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java

@ -176,7 +176,7 @@ public class UISliderButtonUI extends BasicButtonUI {
private void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp;
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE);
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1f, UIConstants.AUTHORITY_DARK_BLUE);
} else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1, UIConstants.SELECT_TAB);
}else{

4
designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIScrollBarUI.java

@ -1326,9 +1326,9 @@ public class UIScrollBarUI extends ScrollBarUI implements LayoutManager, SwingCo
newModel.addChangeListener(modelListener);
scrollbar.repaint();
scrollbar.revalidate();
} else if ("orientation" == propertyName) {
} else if (StringUtils.equals("orientation", propertyName)) {
updateButtonDirections();
} else if ("componentOrientation" == propertyName) {
} else if (StringUtils.equals("componentOrientation", propertyName)) {
updateButtonDirections();
InputMap inputMap = getInputMap(JComponent.WHEN_FOCUSED);
SwingUtilities.replaceUIInputMap(scrollbar, JComponent.WHEN_FOCUSED, inputMap);

8
designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java

@ -9,9 +9,11 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.CommonUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.utils.MathUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@ -109,7 +111,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
}
value = value < minValue ? minValue : value;
value = value > maxValue ? maxValue : value;
if (value == this.value) {
if (CommonUtils.equals(value, this.value)) {
return;
}
this.value = value;
@ -132,7 +134,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
value = value < minValue ? minValue : value;
value = value > maxValue ? maxValue : value;
if (value == this.value) {
if (CommonUtils.equals(value, this.value)) {
return;
}
this.value = value;
@ -371,4 +373,4 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
// jf.setSize(400, 400);
// jf.setVisible(true);
}
}
}

10
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextArea.java

@ -3016,11 +3016,6 @@ private boolean fractionalFontMetricsEnabled;
return he;
}
private final boolean equal(LinkGeneratorResult e1,
LinkGeneratorResult e2) {
return e1.getSourceOffset()==e2.getSourceOffset();
}
@Override
public void mouseClicked(MouseEvent e) {
if (getHyperlinksEnabled() && isScanningForLinks &&
@ -3080,8 +3075,7 @@ private boolean fractionalFontMetricsEnabled;
isLinkAtOffset(RSyntaxTextArea.this, offs);
if (newResult!=null) {
// Repaint if we're at a new link now.
if (linkGeneratorResult==null ||
!equal(newResult, linkGeneratorResult)) {
if (linkGeneratorResult==null || newResult.getSourceOffset() != linkGeneratorResult.getSourceOffset()) {
repaint();
}
linkGeneratorResult = newResult;
@ -3120,4 +3114,4 @@ private boolean fractionalFontMetricsEnabled;
}
}
}

17
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/Style.java

@ -9,6 +9,7 @@
*/
package com.fr.design.gui.syntax.ui.rsyntaxtextarea;
import com.fr.log.FineLoggerFactory;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
@ -123,15 +124,15 @@ public class Style implements Cloneable {
Style clone = null;
try {
clone = (Style)super.clone();
clone.foreground = foreground;
clone.background = background;
clone.font = font;
clone.underline = underline;
clone.fontMetrics = fontMetrics;
} catch (CloneNotSupportedException cnse) { // Never happens
cnse.printStackTrace();
return null;
FineLoggerFactory.getLogger().error(cnse.getMessage(), cnse);
clone = null;
}
clone.foreground = foreground;
clone.background = background;
clone.font = font;
clone.underline = underline;
clone.fontMetrics = fontMetrics;
return clone;
}
@ -193,4 +194,4 @@ public class Style implements Cloneable {
}
}
}

23
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxScheme.java

@ -9,6 +9,7 @@
*/
package com.fr.design.gui.syntax.ui.rsyntaxtextarea;
import com.fr.log.FineLoggerFactory;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
@ -121,17 +122,17 @@ public class SyntaxScheme implements Cloneable, TokenTypes {
public Object clone() {
SyntaxScheme shcs = null;
try {
shcs = (SyntaxScheme)super.clone();
} catch (CloneNotSupportedException cnse) { // Never happens
cnse.printStackTrace();
return null;
}
shcs.styles = new Style[styles.length];
for (int i=0; i<styles.length; i++) {
Style s = styles[i];
if (s!=null) {
shcs.styles[i] = (Style)s.clone();
shcs = (SyntaxScheme) super.clone();
shcs.styles = new Style[styles.length];
for (int i = 0; i < styles.length; i++) {
Style s = styles[i];
if (s != null) {
shcs.styles[i] = (Style) s.clone();
}
}
} catch (CloneNotSupportedException cnse) { // Never happens
FineLoggerFactory.getLogger().error(cnse.getMessage(), cnse);
shcs = null;
}
return shcs;
}
@ -712,4 +713,4 @@ public class SyntaxScheme implements Cloneable, TokenTypes {
}
}
}

4
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/folding/HtmlFoldParser.java

@ -149,7 +149,7 @@ public class HtmlFoldParser implements FoldParser {
}
// ?> or %>
else if (t.startsWith(LANG_END[language])) {
else if (currentFold != null && t.startsWith(LANG_END[language])) {
int phpEnd = t.getEndOffset() - 1;
currentFold.setEndOffset(phpEnd);
Fold parentFold = currentFold.getParent();
@ -400,4 +400,4 @@ public class HtmlFoldParser implements FoldParser {
}
}
}

17
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/MakefileTokenMaker.java

@ -10,12 +10,13 @@
*/
package com.fr.design.gui.syntax.ui.rsyntaxtextarea.modes;
import java.io.*;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.AbstractJFlexTokenMaker;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.Token;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.TokenImpl;
import java.io.IOException;
import java.util.Stack;
import javax.swing.text.Segment;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.*;
/**
* Scanner for makefiles.<p>
@ -762,8 +763,8 @@ public final void yybegin(int newState) {
{ addToken(Token.LITERAL_CHAR);
}
case 25: break;
case 12:
{ if (!varDepths.empty() && varDepths.peek()==Boolean.TRUE) {
case 12:
{ if (!varDepths.empty() && Boolean.TRUE.equals(varDepths.peek())) {
varDepths.pop();
if (varDepths.empty()) {
addToken(start,zzStartRead, Token.VARIABLE); yybegin(YYINITIAL);
@ -771,8 +772,8 @@ public final void yybegin(int newState) {
}
}
case 26: break;
case 11:
{ if (!varDepths.empty() && varDepths.peek()==Boolean.FALSE) {
case 11:
{ if (!varDepths.empty() && Boolean.FALSE.equals(varDepths.peek())) {
varDepths.pop();
if (varDepths.empty()) {
addToken(start,zzStartRead, Token.VARIABLE); yybegin(YYINITIAL);
@ -864,4 +865,4 @@ public final void yybegin(int newState) {
}
}
}

38
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java

@ -723,37 +723,13 @@ int currentCaretY; // Used to know when to rehighlight current line.
// If we're wrapping lines we need to check the actual y-coordinate
// of the caret, not just the line number, since a single logical
// line can span multiple physical lines.
if (getLineWrap()) {
try {
Rectangle temp = modelToView(dot);
if (temp!=null) {
currentCaretY = temp.y;
}
} catch (BadLocationException ble) {
ble.printStackTrace(); // Should never happen.
try {
Rectangle temp = modelToView(dot);
if (temp != null) {
currentCaretY = temp.y;
}
}
// No line wrap - we can simply check the line number (quicker).
else {
// Document doc = getDocument();
// if (doc!=null) {
// Element map = doc.getDefaultRootElement();
// int caretLine = map.getElementIndex(dot);
// Rectangle alloc = ((RTextAreaUI)getUI()).
// getVisibleEditorRect();
// if (alloc!=null)
// currentCaretY = alloc.y + caretLine*lineHeight;
// }
// Modified for code folding requirements
try {
Rectangle temp = modelToView(dot);
if (temp!=null) {
currentCaretY = temp.y;
}
} catch (BadLocationException ble) {
ble.printStackTrace(); // Should never happen.
}
} catch (BadLocationException ble) {
ble.printStackTrace(); // Should never happen.
}
// Repaint current line (to fill in entire highlight), and old line
@ -1211,4 +1187,4 @@ try {
}
}
}

5
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/SearchEngine.java

@ -25,6 +25,7 @@ import javax.swing.text.Caret;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.DocumentRange;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.folding.FoldManager;
import org.jetbrains.annotations.NotNull;
/**
@ -174,6 +175,7 @@ public class SearchEngine {
* @param forward Whether we're searching forward or backward.
* @return The character sequence.
*/
@NotNull
private static CharSequence getFindInCharSequence(RTextArea textArea,
int start, boolean forward) {
RDocument doc = (RDocument)textArea.getDocument();
@ -752,7 +754,6 @@ public class SearchEngine {
int start = makeMarkAndDotEqual(textArea, forward);
CharSequence findIn = getFindInCharSequence(textArea, start, forward);
if (findIn==null) return new SearchResult();
int markAllCount = 0;
if (context.getMarkAll()) {
@ -1014,4 +1015,4 @@ public class SearchEngine {
}
}
}

7
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/VolatileImageBackgroundPainterStrategy.java

@ -103,6 +103,9 @@ public class VolatileImageBackgroundPainterStrategy
} finally {
tracker.removeImage(i, 1);
}
if(bgImage == null) {
continue;
}
bgImage.getGraphics().drawImage(i, 0,0, null);
tracker.addImage(bgImage, 0);
try {
@ -114,7 +117,7 @@ public class VolatileImageBackgroundPainterStrategy
} finally {
tracker.removeImage(bgImage, 0);
}
} while (bgImage.contentsLost());
} while (bgImage != null && bgImage.contentsLost());
} // End of if (master!=null).
else {
bgImage = null;
@ -137,4 +140,4 @@ public class VolatileImageBackgroundPainterStrategy
}
}
}

9
designer-base/src/main/java/com/fr/design/icon/BorderIcon.java

@ -1,5 +1,6 @@
package com.fr.design.icon;
import com.fr.stable.AssistUtils;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
@ -43,13 +44,13 @@ public class BorderIcon implements Icon {
if (lineStyle == Constants.LINE_MEDIUM
|| lineStyle == Constants.LINE_THICK) {
lineStyle = Constants.LINE_MEDIUM;
if (x1 == x2) {
if (x1 == y1) {
if (AssistUtils.equals(x1, x2)) {
if (AssistUtils.equals(x1, y1)) {
GraphHelper.drawLine(g, x1, y1 - 1, x2, y2 + 1, lineStyle);
} else {
GraphHelper.drawLine(g, x1, y1, x2, y2 + 1, lineStyle);
}
} else if (y1 == y2) {
} else if (AssistUtils.equals(y1, y2)) {
GraphHelper.drawLine(g, x1, y1, x2 + 1, y2, lineStyle);
}
} else if (lineStyle == Constants.LINE_THIN
@ -57,7 +58,7 @@ public class BorderIcon implements Icon {
GraphHelper.drawLine(g, x1, y1, x2, y2, lineStyle);
} else {
lineStyle = Constants.LINE_DOT;
if (y1 == x2 && x2 == y2) {
if (AssistUtils.equals(y1, x2) && AssistUtils.equals(x2, y2)) {
GraphHelper.drawLine(g, x1, y1, x2 + 1, y2, lineStyle);
} else {
GraphHelper.drawLine(g, x1, y1, x2, y2, lineStyle);

2
designer-base/src/main/java/com/fr/design/icon/LockIcon.java

@ -35,7 +35,7 @@ public class LockIcon extends ImageIcon {
}
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
if (mainImage != null) {
g.drawImage(mainImage, x, y, c);
}

2
designer-base/src/main/java/com/fr/design/icon/WarningIcon.java

@ -37,7 +37,7 @@ public class WarningIcon extends ImageIcon {
}
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
if (mainImage != null) {
g.drawImage(mainImage, x, y, c);
}

5
designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java

@ -3,6 +3,7 @@ package com.fr.design.layout;
import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.ilable.UILabel;
import com.fr.stable.AssistUtils;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.Icon;
@ -562,9 +563,9 @@ public class FRGUIPaneFactory {
float i = Math.abs((((int) m + (int) (m + 1)) / WIDTHABS_PARA_F) - m);
float j = Math.abs((((int) n + (int) (n + 1)) / WIDTHABS_PARA_F) - n);
float x = i > j ? i : j;
if (x == i) {
if (AssistUtils.equals(x, i)) {
w = Math.round(m) * WIDTH_PARA_INT - WIDTH_OFFSET_M;
} else if (x == j) {
} else if (AssistUtils.equals(x, j)) {
w = Math.round(n) * WIDTH_PARA_INT - WIDTH_OFFSET_N;
}
return w;

40
designer-base/src/main/java/com/fr/design/layout/TableLayout.java

@ -1,9 +1,9 @@
package com.fr.design.layout;
import com.fr.stable.AssistUtils;
import com.fr.general.GeneralUtils;
import com.fr.stable.CommonUtils;
import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Container;
@ -322,7 +322,7 @@ public class TableLayout implements LayoutManager2, Serializable {
this row/column. */
public static final double MINIMUM = -3.0;
public static final double EPSILON = 0.0000001;
//******************************************************************************
//** Constructors ***
@ -400,17 +400,17 @@ public class TableLayout implements LayoutManager2, Serializable {
// Make sure rows and columns are valid
for (int counter = 0; counter < crSpec[C].length; counter++)
if ((crSpec[C][counter] < 0.0) &&
(crSpec[C][counter] != FILL) &&
(crSpec[C][counter] != PREFERRED) &&
(crSpec[C][counter] != MINIMUM)) {
!AssistUtils.equals(crSpec[C][counter], FILL) &&
!AssistUtils.equals(crSpec[C][counter], PREFERRED) &&
!AssistUtils.equals(crSpec[C][counter], MINIMUM)) {
crSpec[C][counter] = 0.0;
}
for (int counter = 0; counter < crSpec[R].length; counter++)
if ((crSpec[R][counter] < 0.0) &&
(crSpec[R][counter] != FILL) &&
(crSpec[R][counter] != PREFERRED) &&
(crSpec[R][counter] != MINIMUM)) {
!AssistUtils.equals(crSpec[R][counter], FILL) &&
!AssistUtils.equals(crSpec[R][counter], PREFERRED) &&
!AssistUtils.equals(crSpec[R][counter], MINIMUM)) {
crSpec[R][counter] = 0.0;
}
@ -557,9 +557,9 @@ public class TableLayout implements LayoutManager2, Serializable {
// Make sure rows are valid
for (int counter = 0; counter < crSpec[z].length; counter++)
if ((crSpec[z][counter] < 0.0) &&
(crSpec[z][counter] != FILL) &&
(crSpec[z][counter] != PREFERRED) &&
(crSpec[z][counter] != MINIMUM)) {
!AssistUtils.equals(crSpec[z][counter], FILL) &&
!AssistUtils.equals(crSpec[z][counter], PREFERRED) &&
!AssistUtils.equals(crSpec[z][counter], MINIMUM)) {
crSpec[z][counter] = 0.0;
}
@ -642,9 +642,9 @@ public class TableLayout implements LayoutManager2, Serializable {
protected void setCr(int z, int i, double size) {
// Make sure size is valid
if ((size < 0.0) &&
(size != FILL) &&
(size != PREFERRED) &&
(size != MINIMUM)) {
!AssistUtils.equals(size, FILL) &&
!AssistUtils.equals(size, PREFERRED) &&
!AssistUtils.equals(size, MINIMUM)) {
size = 0.0;
}
@ -1808,8 +1808,8 @@ public class TableLayout implements LayoutManager2, Serializable {
for (counter = entry.cr1[z]; counter <= entry.cr2[z]; counter++)
if (crSpec[z][counter] >= 1.0)
scalableSize -= crSpec[z][counter];
else if ((crSpec[z][counter] == PREFERRED) ||
(crSpec[z][counter] == MINIMUM)) {
else if (Math.abs(crSpec[z][counter] - PREFERRED) < EPSILON ||
Math.abs(crSpec[z][counter] - MINIMUM) < EPSILON) {
scalableSize -= crPrefMin[counter];
}
@ -1825,13 +1825,13 @@ public class TableLayout implements LayoutManager2, Serializable {
// Add scaled size to relativeWidth
relativeSize += crSpec[z][counter];
// Cr is fill
else if ((crSpec[z][counter] == FILL) && (fillSizeRatio != 0.0))
else if (Math.abs(crSpec[z][counter] - FILL) < EPSILON && Math.abs(fillSizeRatio - 0.0) >= EPSILON)
// Add fill size to relativeWidth
relativeSize += fillSizeRatio;
}
// Determine the total scaled size as estimated by this component
if (relativeSize == 0)
if (Math.abs(relativeSize - 0) < EPSILON)
temp = 0;
else
temp = (int) (scalableSize / relativeSize + 0.5);
@ -1852,8 +1852,8 @@ public class TableLayout implements LayoutManager2, Serializable {
if (crSpec[z][counter] >= 1.0)
totalSize += (int) (crSpec[z][counter] + 0.5);
// Is the current cr a preferred/minimum size
else if ((crSpec[z][counter] == PREFERRED) ||
(crSpec[z][counter] == MINIMUM)) {
else if (Math.abs(crSpec[z][counter] - PREFERRED) < EPSILON||
Math.abs(crSpec[z][counter] - MINIMUM) < EPSILON) {
// Add preferred/minimum width
totalSize += crPrefMin[counter];
}

4
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -20,6 +20,7 @@ import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.vcs.VcsOperator;
import com.fr.workspace.server.vcs.filesystem.VcsFileSystem;
import com.fr.workspace.server.vcs.git.config.GcConfig;
import javax.swing.Icon;
import javax.swing.border.EmptyBorder;
@ -146,6 +147,9 @@ public class VcsHelper implements JTemplateActionListener {
if (needDeleteVersion(oldEntity)) {
operator.deleteVersion(oldEntity.getFilename(), oldEntity.getVersion());
}
if (GcConfig.getInstance().isGcEnable()) {
operator.gc();
}
}
}).start();

4
designer-base/src/main/java/com/fr/design/report/WatermarkPane.java

@ -113,8 +113,8 @@ public class WatermarkPane extends BasicPane {
formulaPane = new TinyFormulaPane();
fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES);
fontSizeComboBox.setEditable(true);
horizontalGapSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, 200);
verticalGapSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, 100);
horizontalGapSpinner = new UnsignedIntUISpinner(100, Integer.MAX_VALUE, 1, 200);
verticalGapSpinner = new UnsignedIntUISpinner(50, Integer.MAX_VALUE, 1, 100);
horizontalGapSpinner.setPreferredSize(SPINNER_DIMENSION);
verticalGapSpinner.setPreferredSize(SPINNER_DIMENSION);
JPanel fontSizeTypePane = new JPanel(new BorderLayout(10,0));

5
designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java

@ -9,6 +9,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.NumberEditor;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
@ -226,7 +227,7 @@ public class NumberEditorValidatePane extends JPanel {
}
allowNegativeCheckBox.setSelected(e.isAllowNegative());
if (e.getMaxValue() == Double.MAX_VALUE) {
if (AssistUtils.equals(e.getMaxValue(),Double.MAX_VALUE)) {
setMaxValueCheckBox.setSelected(false);
maxValueSpinner.setValue(Double.MAX_VALUE);
maxValueSpinner.setEnabled(false);
@ -236,7 +237,7 @@ public class NumberEditorValidatePane extends JPanel {
maxValueSpinner.setValue(e.getMaxValue());
}
if (e.getMinValue() == -Double.MAX_VALUE) {
if (AssistUtils.equals(e.getMinValue(),-Double.MAX_VALUE)) {
setMinValueCheckBox.setSelected(false);
minValueSpinner.setValue(-Double.MAX_VALUE);
minValueSpinner.setEnabled(false);

5
designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java

@ -633,9 +633,6 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
for (int i = 0; i < len; i++) {
currentColumnNames[i] = new ColumnName(colNames[i]);
}
if (currentColumnNames == null) {
currentColumnNames = new ColumnName[0];
}
return currentColumnNames;
}
@ -701,7 +698,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
} else {
dmlConfigComboBox.setSelectedIndex(0);
}
jobs = new NameSubmitJob[dmlConfig == null ? 0 : dmlConfig.getSubmitJobCount()];
jobs = new NameSubmitJob[dmlConfig.getSubmitJobCount()];
for (int i = 0; i < jobs.length; i++) {
jobs[i] = dmlConfig.getSubmitJob(i);
}

303
designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java

@ -1,13 +1,15 @@
package com.fr.design;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chart.fun.ChartTypeProvider;
import com.fr.chartx.attr.ChartProvider;
import com.fr.common.annotations.Compatible;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.chartinterface.AreaIndependentChartInterface;
import com.fr.design.chartinterface.BarIndependentChartInterface;
@ -38,10 +40,13 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.extended.chart.AbstractChart;
import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.invoke.Reflect;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.area.VanChartAreaPlot;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
@ -111,9 +116,9 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
private static ChartTypeInterfaceManager classManager = new ChartTypeInterfaceManager();
private static LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>> chartTypeInterfaces =
new LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>>();
private static LinkedHashMap<String, CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap>> chartTypeInterfaces =
new LinkedHashMap<String, CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap>>();
private static Map<String, String> idAndPriorityMap = new HashMap<String, String>();
@ -156,18 +161,18 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
public static WidgetOption[] initWidgetOption() {
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs();
ChartWidgetOption[] child = new ChartWidgetOption[chartIDs.length];
int index = 0;
for (ChartInternationalNameContentBean bean : typeName) {
String plotID = bean.getChartID();
ChartProvider[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
if (ArrayUtils.isEmpty(rowChart) && !ChartTypeManager.innerChart(plotID)) {
for (String chartID : chartIDs) {
ChartProvider[] rowChart = ChartTypeManager.getInstance().getChartTypes(chartID);
if (ArrayUtils.isEmpty(rowChart) && !ChartTypeManager.innerChart(chartID)) {
continue;
}
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
String name = ChartTypeInterfaceManager.getInstance().getName(chartID);
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(chartID);
Icon icon = IOUtils.readIcon(iconPath);
child[index] = new ChartWidgetOption(InterProviderFactory.getProvider().getLocText(bean.getName()), icon, ChartEditor.class, plotID);
child[index] = new ChartWidgetOption(name, icon, ChartEditor.class, chartID);
index++;
}
@ -218,18 +223,18 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
addChartTypeInterface(DEPRECATED_CHART_PRIORITY, ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface());
addChartTypeInterface(DEPRECATED_CHART_PRIORITY, ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface());
}
private static void addChartTypeInterface(String priority, String plotID, IndependentChartUIProvider provider) {
private static void addChartTypeInterface(String priority, String plotID, ChartTypeUIProvider provider) {
if (chartTypeInterfaces != null) {
if (!chartTypeInterfaces.containsKey(priority)) {
//新建一个具体图表列表
CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap> chartUIList
= new CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>(LinkedHashMap.class);
CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap> chartUIList
= new CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap>(LinkedHashMap.class);
chartUIList.put(plotID, provider);
chartTypeInterfaces.put(priority, chartUIList);
} else {
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority);
Map<String, ChartTypeUIProvider> chartUIList = chartTypeInterfaces.get(priority);
if (!chartUIList.containsKey(plotID)) {
chartUIList.put(plotID, provider);
}
@ -238,7 +243,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
}
}
private IndependentChartUIProvider getChartTypeInterface(String plotID) {
private ChartTypeUIProvider getChartTypeInterface(String plotID) {
if (idAndPriorityMap.containsKey(plotID)) {
String priority = idAndPriorityMap.get(plotID);
if (chartTypeInterfaces.containsKey(priority)) {
@ -267,66 +272,35 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) {
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority);
Map<String, ChartTypeUIProvider> chartUIList = chartTypeInterfaces.get(priority);
Iterator<Map.Entry<String, IndependentChartUIProvider>> iterator = chartUIList.entrySet().iterator();
Iterator<Map.Entry<String, ChartTypeUIProvider>> iterator = chartUIList.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, IndependentChartUIProvider> entry = iterator.next();
String plotID = entry.getKey();
AbstractChartTypePane pane = entry.getValue().getPlotTypePane();
if (AssistUtils.equals(pane.title4PopupWindow(), TYPE_PANE_DEFAULT_TITLE)) {
continue;
}
pane.setPlotID(plotID);
paneList.add(pane);
if (allChartTypePane.get(priority) == null) {
allChartTypePane.put(priority, new LinkedHashMap<String, FurtherBasicBeanPane<? extends ChartProvider>>());
try {
Map.Entry<String, ChartTypeUIProvider> entry = iterator.next();
String plotID = entry.getKey();
AbstractChartTypePane pane = entry.getValue().getPlotTypePane();
if (AssistUtils.equals(pane.title4PopupWindow(), TYPE_PANE_DEFAULT_TITLE)) {
continue;
}
pane.reLayout(plotID);
paneList.add(pane);
if (allChartTypePane.get(priority) == null) {
allChartTypePane.put(priority, new LinkedHashMap<String, FurtherBasicBeanPane<? extends ChartProvider>>());
}
allChartTypePane.get(priority).put(plotID, pane);
} catch (Throwable e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
allChartTypePane.get(priority).put(plotID, pane);
}
}
}
private String getChartName(String plotID, IndependentChartUIProvider provider) {
String name = provider.getPlotTypeTitle4PopupWindow();
if (StringUtils.isEmpty(name)) {
name = ChartTypeManager.getInstance().getChartName(plotID);
}
return name;
}
@Compatible
public String getTitle4PopupWindow(String plotID) {
IndependentChartUIProvider provider = getChartTypeInterface(plotID);
if (provider != null) {
return provider.getPlotTypeTitle4PopupWindow();
}
return StringUtils.EMPTY;
}
/**
* 获取指定图表的标题
*/
public String getTitle4PopupWindow(String priority, String plotID) {
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)) {
IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID);
return getChartName(plotID, provider);
}
//兼容老的插件
if (chartTypeInterfaces != null) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
String defaultPriority = (String) entry.getKey();
if (chartTypeInterfaces.get(defaultPriority).containsKey(plotID)) {
return getChartName(plotID, chartTypeInterfaces.get(defaultPriority).get(plotID));
}
}
}
return StringUtils.EMPTY;
return getName(plotID);
}
private List<Integer> getPriorityInOrder() {
@ -346,16 +320,153 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
public String getIconPath(String plotID) {
if (chartTypeInterfaces != null) {
IndependentChartUIProvider provider = getChartTypeInterface(plotID);
ChartTypeUIProvider provider = getChartTypeInterface(plotID);
if (provider != null) {
return provider.getIconPath();
}
}
return StringUtils.EMPTY;
}
public String[] getDemoImagePath(String chartID) {
if (chartTypeInterfaces != null) {
ChartTypeUIProvider provider = getChartTypeInterface(chartID);
if (provider != null) {
String[] result = null;
try {
result = provider.getDemoImagePath();
} catch (Throwable e) {
//do nothing
}
return ArrayUtils.isEmpty(result) ? getCompatibleDemoImagePath(chartID) : result;
}
}
return new String[0];
}
private String[] getCompatibleDemoImagePath(String chartID) {
String[] result = null;
try {
//AbstractIndependentChartsProvider
ChartTypeProvider chartTypeProvider = Reflect.on(ChartTypeManager.getInstanceWithCheck()).call("getChartType", chartID).get();
result = new String[]{
Reflect.on(chartTypeProvider).call("getChartImagePath").get()
};
if (ArrayUtils.isNotEmpty(result)) {
return result;
}
} catch (Exception e) {
//do nothing
}
try {
//兼容 图表类型选择界面会调到这边
ChartProvider[] charts = ChartTypeManager.getInstanceWithCheck().getChartTypes(chartID);
result = new String[charts.length];
for (int i = 0; i < charts.length; i++) {
//Chart && AbstractChart
ChartProvider chart = charts[i];
if (!(chart instanceof AbstractChart)) {//扩展图表
chart = Reflect.on(chart).field("subChart").get();
}
result[i] = Reflect.on(chart).call("demoImagePath").get();
}
} catch (Exception e) {
//do nothing
}
return new String[0];
}
public String[] getSubName(String chartID) {
if (chartTypeInterfaces != null) {
ChartTypeUIProvider provider = getChartTypeInterface(chartID);
if (provider != null) {
String[] subNames = null;
try {
subNames = provider.getSubName();
} catch (Throwable throwable) {
//do nothing
}
return ArrayUtils.isEmpty(subNames) ? getCompatibleSubName(chartID, provider) : subNames;
}
}
return new String[0];
}
//兼容
private String[] getCompatibleSubName(String chartID, ChartTypeUIProvider provider) {
ChartProvider[] chartProviders = ChartTypeManager.getInstanceWithCheck().getChartTypes(chartID);
if (chartProviders.length == 1) {
return new String[]{getName(chartID)};
}
String[] result = new String[chartProviders.length];
for (int i = 0; i < chartProviders.length; i++) {
if (chartProviders[i] instanceof Chart) {
//Chart && AbstractChart
result[i] = ((Chart) chartProviders[i]).getChartName();
}
}
return result;
}
public String getName(String chartID) {
if (chartTypeInterfaces != null) {
ChartTypeUIProvider provider = getChartTypeInterface(chartID);
if (provider != null) {
String name = null;
try {
name = provider.getName();
} catch (Throwable throwable) {
//do nothing
}
return StringUtils.isEmpty(name) ? getCompatibleName(chartID, provider) : name;
}
}
return StringUtils.EMPTY;
}
//兼容
private static String getCompatibleName(String chartID, ChartTypeUIProvider provider) {
String result = null;
try {
//AbstractIndependentChartsProvider
ChartTypeProvider chartTypeProvider = Reflect.on(ChartTypeManager.getInstanceWithCheck()).call("getChartType", chartID).get();
result = Reflect.on(chartTypeProvider).call("getChartName").get();//国际化的key
result = InterProviderFactory.getProvider().getLocText(result);
if (StringUtils.isNotEmpty(result)) {
return result;
}
} catch (Exception e) {
//do nothing
}
try {
ChartProvider chartProvider = ChartTypeManager.getInstanceWithCheck().getChartTypes(chartID)[0];
if (chartProvider instanceof Chart) {
//AbstractExtendedChartUIProvider
result = ((Chart) chartProvider).getChartName();
}
if (StringUtils.isNotEmpty(result) && !"Charts".equals(result)) {
return result;
}
} catch (Exception e) {
//do nothing
}
return provider.getPlotTypePane().title4PopupWindow();
}
public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) {
IndependentChartUIProvider provider = getChartTypeInterface(plotID);
ChartTypeUIProvider provider = getChartTypeInterface(plotID);
if (provider != null) {
return provider.getChartDataPane(listener);
}
@ -363,20 +474,8 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
return new ChartDataPane(listener);
}
/**
* 获取对应ID的图表数量
*
*/
private int getChartSize(String key) {
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(key)) {
return chartTypeInterfaces.get(key).size();
}
return 0;
}
public AbstractChartAttrPane[] getAttrPaneArray(String plotID, AttributeChangeListener listener) {
IndependentChartUIProvider provider = getChartTypeInterface(plotID);
ChartTypeUIProvider provider = getChartTypeInterface(plotID);
if (provider != null) {
return provider.getAttrPaneArray(listener);
}
@ -387,7 +486,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID());
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID());
if (provider != null) {
return provider.getTableDataSourcePane(plot, parent);
}
@ -397,7 +496,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID());
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID());
if (provider != null) {
return provider.getReportDataSourcePane(plot, parent);
}
@ -405,17 +504,9 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
return null;
}
private boolean plotInChart(String plotID, String priority) {
return chartTypeInterfaces != null
&& chartTypeInterfaces.containsKey(priority)
&& chartTypeInterfaces.get(priority).containsKey(plotID);
}
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID());
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID());
if (provider != null) {
return provider.getPlotConditionPane(plot);
}
@ -425,7 +516,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID());
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID());
if (provider != null) {
return provider.getPlotSeriesPane(parent, plot);
}
@ -441,7 +532,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
*/
public boolean isUseDefaultPane(String plotID) {
IndependentChartUIProvider provider = getChartTypeInterface(plotID);
ChartTypeUIProvider provider = getChartTypeInterface(plotID);
if (provider != null) {
return provider.isUseDefaultPane();
}
@ -452,7 +543,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
public boolean needChartChangePane(ChartProvider chart) {
if (chart != null) {
String chartID = chart.getID();
IndependentChartUIProvider provider = getChartTypeInterface(chartID);
ChartTypeUIProvider provider = getChartTypeInterface(chartID);
if (provider != null) {
return provider.needChartChangePane();
}
@ -467,7 +558,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
if (isIndependentChartUIProvider(injection)) {
String priority = injection.getAttribute("priority", DEFAULT_PRIORITY);
String plotID = injection.getAttribute("plotID");
IndependentChartUIProvider instance = (IndependentChartUIProvider) injection.getObject();
ChartTypeUIProvider instance = (ChartTypeUIProvider) injection.getObject();
addChartTypeInterface(priority, plotID, instance);
}
}
@ -487,7 +578,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
if (chartTypeInterfaces != null) {
if (chartTypeInterfaces.containsKey(priority)) {
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority);
Map<String, ChartTypeUIProvider> chartUIList = chartTypeInterfaces.get(priority);
chartUIList.remove(plotID);
}
}
@ -495,13 +586,13 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
private boolean isIndependentChartUIProvider(PluginSingleInjection injection) {
return !(injection == null || injection.getObject() == null) && IndependentChartUIProvider.XML_TAG.equals(injection.getName()) && injection.getObject() instanceof IndependentChartUIProvider;
return !(injection == null || injection.getObject() == null) && ChartTypeUIProvider.XML_TAG.equals(injection.getName()) && injection.getObject() instanceof ChartTypeUIProvider;
}
public ChartEditPane getChartEditPane(String plotID) {
IndependentChartUIProvider provider = getChartTypeInterface(plotID);
ChartTypeUIProvider provider = getChartTypeInterface(plotID);
if (provider != null) {
return provider.getChartEditPane(plotID);
}
@ -509,7 +600,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
}
public ChartsConfigPane getChartConfigPane(String plotID) {
IndependentChartUIProvider provider = getChartTypeInterface(plotID);
ChartTypeUIProvider provider = getChartTypeInterface(plotID);
if (provider != null) {
return provider.getChartConfigPane(plotID);
}

45
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -3,14 +3,13 @@ package com.fr.design.chart;
* the Pane of the Chart
*/
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory;
@ -28,29 +27,7 @@ import java.awt.Component;
public class ChartTypePane extends ChartCommonWizardPane {
private static final long serialVersionUID = -1175602484968520546L;
private ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstanceWithCheck().getAllChartBaseNames();
private ChartProvider[][] charts4Icon = null;
{
charts4Icon = new ChartProvider[this.typeName.length][];
for (int i = 0; i < this.typeName.length; i++) {
ChartProvider[] rowCharts = ChartTypeManager.getInstanceWithCheck().getChartTypes(this.typeName[i].getChartID());
int rowChartsCount = rowCharts.length;
charts4Icon[i] = new ChartProvider[rowChartsCount];
for (int j = 0; j < rowChartsCount; j++) {
try {
charts4Icon[i][j] = (ChartProvider) rowCharts[j].clone();
//todo@shinerefactor 老图表也是提供一张图片 这边就不用setTitle(null) 然后实时去画
// charts4Icon[i][j].setTitle(null);
// if(charts4Icon[i][j].getPlot() != null){
// charts4Icon[i][j].getPlot().setLegend(null);
// }
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
}
private String[] chartIDs = ChartTypeManager.getInstanceWithCheck().getAllChartIDs();
private JList mainTypeList = null;
private JList iconViewList = null;
@ -61,8 +38,8 @@ public class ChartTypePane extends ChartCommonWizardPane {
DefaultListModel defaultListModel = new DefaultListModel();
mainTypeList = new JList(defaultListModel);
for (int i = 0; i < typeName.length; i++) {
defaultListModel.insertElementAt(InterProviderFactory.getProvider().getLocText(typeName[i].getName()), i);
for (int i = 0; i < chartIDs.length; i++) {
defaultListModel.insertElementAt(ChartTypeInterfaceManager.getInstance().getName(chartIDs[i]), i);
}
mainTypeList.addListSelectionListener(listSelectionListener);
@ -115,11 +92,15 @@ public class ChartTypePane extends ChartCommonWizardPane {
protected ListSelectionListener listSelectionListener = new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
int main_index = mainTypeList.getSelectedIndex();
ChartProvider[] sub_charts = ChartTypePane.this.charts4Icon[main_index];
String id = ChartTypePane.this.chartIDs[main_index];
String[] demoImagePath = ChartTypeInterfaceManager.getInstance().getDemoImagePath(id);
String[] subName = ChartTypeInterfaceManager.getInstance().getSubName(id);
ChartTypePane.this.iconListModel.clear();
for (int i = 0; i < sub_charts.length; i++) {
String ImagePath = sub_charts[i].demoImagePath();
String chartName = sub_charts[i].getChartName();
for (int i = 0, len = demoImagePath.length; i < len; i++) {
String ImagePath = demoImagePath[i];
String chartName = subName[i];
ChartTypePane.this.iconListModel.addElement(new ChartIcon(ImagePath, chartName));
}
iconViewList.setSelectedIndex(0);
@ -143,7 +124,7 @@ public class ChartTypePane extends ChartCommonWizardPane {
ChartProvider chart4Update = cc.getSelectedChartProvider();
if (chart4Update == null) {
String plotID = typeName[mainTypeList.getSelectedIndex()].getChartID();
String plotID = this.chartIDs[mainTypeList.getSelectedIndex()];
ChartProvider chart = ChartTypeManager.getInstance().getChartTypes(plotID)[iconViewList.getSelectedIndex()];
try {
chart4Update = (ChartProvider) chart.clone();

139
designer-chart/src/main/java/com/fr/design/chart/fun/ChartTypeUIProvider.java

@ -0,0 +1,139 @@
package com.fr.design.chart.fun;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartsConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.injectable.SpecialLevel;
import com.fr.stable.fun.Level;
/**
* Created by eason on 14/12/29.
*
* @since 8.0
* 自定义 图表类型 界面接口
*/
public interface ChartTypeUIProvider extends Level {
String XML_TAG = SpecialLevel.IndependentChartUIProvider.getTagName();
int CURRENT_API_LEVEL = 3;
/**
* 图表 类型定义界面类型就是属性表的第一个界面
* 可以返回null 代表没有 图表类型切换界面
*
* @return 图表的类型定义界面类型
*/
AbstractChartTypePane getPlotTypePane();
/**
* 图表 数据配置界面 即属性表的第二个界面
* 可以返回null 代表没有数据配置界面
*/
ChartDataPane getChartDataPane(AttributeChangeListener listener);
/**
* 图表 属性界面数组 其他样式界面数组
* 可以返回空数组 代表没有其他样式界面
*
* @return 属性界面
*/
AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener);
/**
* 图表 名称
* eg:柱形图
*
* @return 图表 名称
*/
String getName();
/**
* 图表 名称
* 柱形图 堆积柱形图
*
* @return 图表 名称
*/
String[] getSubName();
/**
* 图表 demo图片路径
* 400*225
* 1.图表选择界面的图的路径 原样渲染
* 2.图表属性第一个界面 类型界面 缩放渲染
*
* @return demo图片路径
*/
String[] getDemoImagePath();
/**
* 小图标路径
* 表单 工具栏 图表小图标
* 16*16
*
* @return 图标路径
*/
String getIconPath();
//todo:把下面这些接口删除
@Deprecated
boolean needChartChangePane();
/**
* 数据集数据源的界面
*
* @return 数据集数据源的界面
*/
@Deprecated
AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent);
/**
* 单元格数据源的界面
*
* @return 单元格数据源的界面
*/
@Deprecated
AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent);
/**
* 条件属性界面
*
* @return 条件属性界面
*/
@Deprecated
ConditionAttributesPane getPlotConditionPane(Plot plot);
/**
* 系列界面
*
* @return 系列界面
*/
@Deprecated
BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot);
/**
* 是否使用默认的界面为了避免界面来回切换
*
* @return 是否使用默认的界面
*/
@Deprecated
boolean isUseDefaultPane();
@Deprecated
ChartEditPane getChartEditPane(String plotID);
@Deprecated
ChartsConfigPane getChartConfigPane(String plotID);
}

101
designer-chart/src/main/java/com/fr/design/chart/fun/IndependentChartUIProvider.java

@ -1,102 +1,11 @@
package com.fr.design.chart.fun;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartsConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.injectable.SpecialLevel;
import com.fr.stable.fun.Level;
import com.fr.common.annotations.Compatible;
/**
* Created by eason on 14/12/29.
*
* @since 8.0
* 自定义图表类型设设计界面接口
* Created by shine on 2019/09/05.
*/
public interface IndependentChartUIProvider extends Level {
String XML_TAG = SpecialLevel.IndependentChartUIProvider.getTagName();
@Compatible
public interface IndependentChartUIProvider extends ChartTypeUIProvider {
int CURRENT_API_LEVEL = 3;
boolean needChartChangePane();
/**
* 图表的类型定义界面类型就是属性表的第一个界面
*
* @return 图表的类型定义界面类型
*/
AbstractChartTypePane getPlotTypePane();
/**
* 数据集数据源的界面
*
* @return 数据集数据源的界面
*/
AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent);
/**
* 单元格数据源的界面
*
* @return 单元格数据源的界面
*/
AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent);
/**
* 条件属性界面
*
* @return 条件属性界面
*/
ConditionAttributesPane getPlotConditionPane(Plot plot);
/**
* 系列界面
*
* @return 系列界面
*/
BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot);
/**
* 图表的属性界面数组
*
* @return 属性界面
*/
AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener);
ChartDataPane getChartDataPane(AttributeChangeListener listener);
/**
* 是否使用默认的界面为了避免界面来回切换
*
* @return 是否使用默认的界面
*/
boolean isUseDefaultPane();
/**
* 图标路径
*
* @return 图标路径
*/
String getIconPath();
/**
* plot面板的标题
*/
String getPlotTypeTitle4PopupWindow();
ChartEditPane getChartEditPane(String plotID);
ChartsConfigPane getChartConfigPane(String plotID);
}
}

91
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java

@ -0,0 +1,91 @@
package com.fr.design.chart.fun.impl;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.chartx.impl.AbstractDataPane;
import com.fr.design.chartx.impl.AbstractOtherPane;
import com.fr.design.chartx.impl.DefaultTypePane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartsConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.stable.fun.impl.AbstractProvider;
/**
* Created by shine on 2019/09/03.
*/
public abstract class AbstractChartTypeUI extends AbstractProvider implements ChartTypeUIProvider {
@Override
public AbstractChartTypePane getPlotTypePane() {
return new DefaultTypePane();
}
@Override
public abstract AbstractDataPane getChartDataPane(AttributeChangeListener listener);
@Override
public abstract AbstractOtherPane[] getAttrPaneArray(AttributeChangeListener listener);
@Override
public String[] getSubName() {
return new String[]{getName()};
}
@Override
public int currentAPILevel() {
return CURRENT_API_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
@Override
public boolean needChartChangePane() {
return false;
}
@Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
}
@Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
}
@Override
public boolean isUseDefaultPane() {
return false;
}
@Override
public ChartEditPane getChartEditPane(String plotID) {
return new ChartEditPane();
}
@Override
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return null;
}
@Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return null;
}
@Override
public ChartsConfigPane getChartConfigPane(String plotID) {
return null;
}
}

66
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractIndependentChartUI.java

@ -1,66 +0,0 @@
package com.fr.design.chart.fun.impl;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartsConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StableUtils;
/**
* Created by eason on 15/4/23.
*/
@Deprecated
public abstract class AbstractIndependentChartUI implements IndependentChartUIProvider {
@Override
public int currentAPILevel() {
return -1;
}
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
return new AbstractChartAttrPane[0];
}
public ChartDataPane getChartDataPane(AttributeChangeListener listener){
return new ChartDataPane(listener);
}
/**
* 是否使用默认的界面为了避免界面来回切换
* @return 是否使用默认的界面
*/
public boolean isUseDefaultPane(){
return true;
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return getPlotSeriesPane();
}
public BasicBeanPane<Plot> getPlotSeriesPane(){
return null;
}
public boolean equals(Object obj) {
return obj != null && ComparatorUtils.equals(obj.getClass(), this.getClass());
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new DataSeriesConditionPane();
}
public ChartEditPane getChartEditPane(String plotID){ return StableUtils.construct(ChartEditPane.class);}
public ChartsConfigPane getChartConfigPane(String plotID){return null;}
}

28
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java

@ -2,7 +2,7 @@ package com.fr.design.chart.fun.impl;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
@ -17,7 +17,7 @@ import com.fr.stable.StableUtils;
/**
* Created by Mitisky on 16/3/7.
*/
public abstract class AbstractIndependentChartUIWithAPILevel implements IndependentChartUIProvider {
public abstract class AbstractIndependentChartUIWithAPILevel implements ChartTypeUIProvider {
//这个不能改,是做兼容用的
//2016.10.14-11.24号的8.0jar因为改了这个为3,不会提示5.26号之前的插件更新
private static final int OLD_PLUGIN_LEVEL = -2;
@ -37,6 +37,22 @@ public abstract class AbstractIndependentChartUIWithAPILevel implements Independ
return new ChartDataPane(listener);
}
//todo@bjornrefactor 适配旧版本图表后 删掉下面两个方法
@Override
public String getName() {
return null;
}
@Override
public String[] getSubName() {
return new String[0];
}
@Override
public String[] getDemoImagePath() {
return new String[0];
}
/**
* 是否使用默认的界面为了避免界面来回切换
* @return 是否使用默认的界面
@ -66,14 +82,6 @@ public abstract class AbstractIndependentChartUIWithAPILevel implements Independ
return new DataSeriesConditionPane();
}
/**
* plot面板的标题
* 插件兼容
*/
public String getPlotTypeTitle4PopupWindow(){
return getPlotTypePane().title4PopupWindow();
}
public ChartEditPane getChartEditPane(String plotID){ return StableUtils.construct(ChartEditPane.class);}
public ChartsConfigPane getChartConfigPane(String plotID){return null;}

27
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractIndependentChartsUI.java

@ -3,7 +3,7 @@ package com.fr.design.chart.fun.impl;
import com.fr.chart.chartattr.Plot;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
@ -26,8 +26,19 @@ import com.fr.stable.fun.mark.API;
* 用户使用第三方图表需要继承的面板抽象类
*/
@API(level = IndependentChartUIProvider.CURRENT_API_LEVEL)
public abstract class AbstractIndependentChartsUI extends AbstractProvider implements IndependentChartUIProvider {
@Deprecated
@API(level = ChartTypeUIProvider.CURRENT_API_LEVEL)
public abstract class AbstractIndependentChartsUI extends AbstractProvider implements ChartTypeUIProvider {
@Override
public String getName() {
return null;
}
@Override
public String[] getSubName() {
return new String[0];
}
public String mark4Provider() {
return getClass().getName();
@ -96,16 +107,6 @@ public abstract class AbstractIndependentChartsUI extends AbstractProvider imple
return "com/fr/design/images/form/toolbar/ChartF-Column.png";
}
@Override
/**
* plot面板的标题
* 插件兼容
*/
public String getPlotTypeTitle4PopupWindow(){
return getPlotTypePane().title4PopupWindow();
}
@Override
public ChartEditPane getChartEditPane(String plotID) {
return new ChartsEditPane();

26
designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java

@ -2,21 +2,21 @@ package com.fr.design.chart.gui;
import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChartCollection;
import com.fr.base.chart.BaseChartPainter;
import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.chart.ChartWebPara;
import com.fr.base.chart.result.WebChartIDInfo;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.log.FineLoggerFactory;
import com.fr.script.Calculator;
import com.fr.stable.core.PropertyChangeListener;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Paint;
import java.awt.RenderingHints;
import java.awt.event.MouseEvent;
@ -35,7 +35,6 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
private static final long serialVersionUID = 744164838619052097L;
private final List<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
private ChartCollection chartCollection4Design;
private ChartProvider editingChart;
private int chartWidth = -1;
private int chartHeight = -1;
@ -91,11 +90,8 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
public void reset() {
fireStopEditing();
this.editingChart = null;
this.chartHeight = this.chartWidth = -1;
this.editingChart = this.chartCollection4Design.getSelectedChartProvider();
refreshChartGlyph();
repaint();
@ -138,11 +134,6 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
return (this.chartCollection4Design == null) ? 0 : this.chartCollection4Design.getChartCount();
}
public ChartProvider getEditingChart() {
return editingChart;
}
public void paintComponent(Graphics g) { //
super.paintComponent(g);
@ -180,7 +171,6 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
*/
private void refreshChartGlyph() {
Dimension d = getBounds().getSize();
this.editingChart = this.chartCollection4Design.getSelectedChartProvider();// kunsnat: 切换选中时 同步切换Plot
this.chartWidth = d.width - ChartConstants.PREGAP4BOUNDS;
this.chartHeight = d.height - ChartConstants.PREGAP4BOUNDS;
}
@ -240,20 +230,20 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
}
private boolean needRefreshChartGlyph() {
return editingChart == null || chartWidth != this.getBounds().width || chartHeight != this.getBounds().height;
return chartWidth != this.getBounds().width || chartHeight != this.getBounds().height;
}
private void drawChart(Graphics2D g2d) {
if (editingChart != null) {
if (chartCollection4Design != null) {
BaseChartPainter painter = chartCollection4Design.createResultChartPainter(Calculator.createCalculator(),
WebChartIDInfo.createEmptyDesignerInfo(), chartWidth, chartHeight);
int resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution();
if (resolution == 0){
resolution = ScreenResolution.getScreenResolution();
}
Image chartImage = editingChart.toImage(chartWidth, chartHeight, resolution, new ChartWebPara());
g2d.drawImage(chartImage, 0, 0, null);
painter.paint(g2d, chartWidth, chartHeight, resolution, null);
}
}

2
designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java

@ -37,7 +37,7 @@ public class ChartWidgetOption extends WidgetOption {
Class<? extends ChartEditor> clz = widgetClass();
try {
ChartEditor widget = clz.newInstance();
widget.setChartCollection(BaseChartGetter.createChartCollection(this.chartID));
widget.resetChangeChartCollection(BaseChartGetter.createChartCollection(this.chartID));
return widget;
} catch (InstantiationException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);

6
designer-chart/src/main/java/com/fr/design/chart/report/GisMapReportDataContentPane.java

@ -182,11 +182,7 @@ public class GisMapReportDataContentPane extends FurtherBasicBeanPane<GisMapRepo
String addressName = addressNamePane.updateBean();
if (addressName != null && !StringUtils.isBlank(addressName)) {
if (StableUtils.canBeFormula(addressName)) {
reportDefinition.setAddressName(addressName);
} else {
reportDefinition.setAddressName(addressName);
}
reportDefinition.setAddressName(addressName);
}
List values = seriesPane.updateBean();
if (values != null && !values.isEmpty()) {

8
designer-chart/src/main/java/com/fr/design/chart/report/GisMapTableDataContentPane.java

@ -341,12 +341,8 @@ public class GisMapTableDataContentPane extends FurtherBasicBeanPane<GisMapTable
titleValuePane.stopCellEditing();
}
});
if (value != null && StringUtils.isNotEmpty(value.toString())) {
box.setSelectedItem(value);
} else {
box.setSelectedItem(value);
}
box.setSelectedItem(value);
this.editorComponent = box;
}

8
designer-chart/src/main/java/com/fr/design/chart/report/MapMoreTableIndexPane.java

@ -179,12 +179,8 @@ public class MapMoreTableIndexPane extends BasicBeanPane<MapSingleLayerTableDefi
tabPane.stopCellEditing();
}
});
if (value != null && StringUtils.isNotEmpty(value.toString())) {
box.setSelectedItem(value);
} else {
box.setSelectedItem(value);
}
box.setSelectedItem(value);
editorComponent = box;
}

8
designer-chart/src/main/java/com/fr/design/chart/report/MapTableDataSinglePane.java

@ -254,12 +254,8 @@ public class MapTableDataSinglePane extends FurtherBasicBeanPane<MapSingleLayerT
titleValuePane.stopCellEditing();
}
});
if (value != null && StringUtils.isNotEmpty(value.toString())) {
box.setSelectedItem(value);
} else {
box.setSelectedItem(value);
}
box.setSelectedItem(value);
this.editorComponent = box;
}

3
designer-chart/src/main/java/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java

@ -348,9 +348,6 @@ public class UIGroupExtensionPane extends BasicPane {
boolean isSelected,
boolean cellHasFocus) {
JComponent c = (JComponent) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (!hasEditOperation(list)) {
return c;
}
Border border = null;
c.setBorder(border);
UILabel editLabel = new UILabel(UIConstants.EDIT_ICON);

30
designer-chart/src/main/java/com/fr/design/chartx/MultiCategoryChartDataPane.java → designer-chart/src/main/java/com/fr/design/chartx/AbstractVanSingleDataPane.java

@ -1,24 +1,30 @@
package com.fr.design.chartx;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.MultiCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import javax.swing.JPanel;
/**
* Created by shine on 2019/5/22.
* Created by shine on 2019/09/06.
*/
public class MultiCategoryChartDataPane extends AbstractChartDataPane<AbstractDataDefinition> {
public abstract class AbstractVanSingleDataPane extends AbstractChartDataPane<AbstractDataDefinition> {
private SingleDataPane singleDataPane;
public MultiCategoryChartDataPane(AttributeChangeListener listener) {
public AbstractVanSingleDataPane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected JPanel createContentPane() {
singleDataPane = createSingleDataPane();
return singleDataPane;
}
protected abstract SingleDataPane createSingleDataPane();
@Override
protected void populate(AbstractDataDefinition dataDefinition) {
singleDataPane.populateBean(dataDefinition);
@ -28,16 +34,4 @@ public class MultiCategoryChartDataPane extends AbstractChartDataPane<AbstractDa
protected AbstractDataDefinition update() {
return singleDataPane.updateBean();
}
@Override
protected JPanel createContentPane() {
singleDataPane = createSingleDataPane();
return singleDataPane;
}
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
}
}

25
designer-chart/src/main/java/com/fr/design/chartx/GanttChartDataPane.java

@ -1,6 +1,9 @@
package com.fr.design.chartx;
import com.fr.chartx.data.GanttChartDataDefinition;
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.MultiCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.van.chart.map.designer.VanChartGroupPane;
@ -11,13 +14,23 @@ import javax.swing.JPanel;
*/
public class GanttChartDataPane extends AbstractChartDataPane<GanttChartDataDefinition> {
private MultiCategoryChartDataPane dataPane;
private MultiCategoryChartDataPane linkPane;
private AbstractVanSingleDataPane dataPane;
private AbstractVanSingleDataPane linkPane;
@Override
protected JPanel createContentPane() {
dataPane = new MultiCategoryChartDataPane(listener);
linkPane = new MultiCategoryChartDataPane(listener);
dataPane = new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
}
};
linkPane = new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
}
};
return new VanChartGroupPane(new String[]{"data", "link"}, new JPanel[]{dataPane, linkPane}) {
};
}
@ -27,13 +40,13 @@ public class GanttChartDataPane extends AbstractChartDataPane<GanttChartDataDefi
}
@Override
protected void populate(GanttChartDataDefinition ganttChartDataDefinition) {
public void populate(GanttChartDataDefinition ganttChartDataDefinition) {
dataPane.populate(ganttChartDataDefinition.getDataDefinition());
linkPane.populate(ganttChartDataDefinition.getLinkDefinition());
}
@Override
protected GanttChartDataDefinition update() {
public GanttChartDataDefinition update() {
return null;
}
}

21
designer-chart/src/main/java/com/fr/design/chartx/MultiPieChartDataPane.java

@ -1,21 +0,0 @@
package com.fr.design.chartx;
import com.fr.design.chartx.fields.diff.MultiPieCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.MultiPieDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
/**
* Created by shine on 2019/6/18.
*/
public class MultiPieChartDataPane extends MultiCategoryChartDataPane {
public MultiPieChartDataPane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new MultiPieDataSetFieldsPane(), new MultiPieCellDataFieldsPane());
}
}

23
designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java

@ -1,23 +0,0 @@
package com.fr.design.chartx;
import com.fr.design.chartx.fields.diff.StructureCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.StructureDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2019-09-02
*/
public class StructureChartDataPane extends MultiCategoryChartDataPane {
public StructureChartDataPane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new StructureDataSetFieldsPane(), new StructureCellDataFieldsPane());
}
}

20
designer-chart/src/main/java/com/fr/design/chartx/WordCloudChartDataPane.java

@ -1,20 +0,0 @@
package com.fr.design.chartx;
import com.fr.design.chartx.fields.diff.WordCloudCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.WordCloudDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
/**
* Created by shine on 2019/5/22.
*/
public class WordCloudChartDataPane extends MultiCategoryChartDataPane {
public WordCloudChartDataPane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new WordCloudDataSetFieldsPane(), new WordCloudCellDataFieldsPane());
}
}

3
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java

@ -7,6 +7,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.stable.AssistUtils;
import javax.swing.JComponent;
import javax.swing.JPanel;
@ -59,7 +60,7 @@ public abstract class AbstractMultiComponentPaneWithUISpinner<T extends JCompone
@Override
public void setTextFieldValue(double value) {
//如果为0,则没有改变值
if (value == 0) {
if (AssistUtils.equals(value,0)) {
return;
}
super.setTextFieldValue(value);

68
designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractDataPane.java

@ -0,0 +1,68 @@
package com.fr.design.chartx.impl;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.impl.AbstractChartWithData;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/**
* Created by shine on 2019/09/04.
*/
public abstract class AbstractDataPane extends ChartDataPane {
private SingleDataPane singleDataPane;
public AbstractDataPane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected JPanel createContentPane() {
singleDataPane = createSingleDataPane();
return singleDataPane;
}
protected abstract SingleDataPane createSingleDataPane();
@Override
public void populate(ChartCollection collection) {
if (collection == null) {
return;
}
AbstractChartWithData chart = collection.getSelectedChart(AbstractChartWithData.class);
if (chart == null) {
return;
}
this.removeAll();
this.add(createContentPane(), BorderLayout.CENTER);
ChartDataDefinitionProvider dataDefinition = chart.getChartDataDefinition();
singleDataPane.populateBean((AbstractDataDefinition) dataDefinition);
this.initAllListeners();
this.validate();
}
@Override
public void update(ChartCollection collection) {
if (collection == null) {
return;
}
VanChart chart = collection.getSelectedChart(VanChart.class);
if (chart == null) {
return;
}
chart.setChartDataDefinition(singleDataPane.updateBean());
}
}

42
designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractOtherPane.java

@ -0,0 +1,42 @@
package com.fr.design.chartx.impl;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.impl.AbstractChartWithData;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
/**
* Created by shine on 2019/09/04.
*/
public abstract class AbstractOtherPane<T extends AbstractChartWithData> extends AbstractChartAttrPane {
protected abstract void populate(T chart);
protected abstract void update(T chart);
@Override
public void populate(ChartCollection collection) {
if (collection == null) {
return;
}
AbstractChartWithData chart = collection.getSelectedChart(AbstractChartWithData.class);
if (chart == null) {
return;
}
populate((T) chart);
}
@Override
public void update(ChartCollection collection) {
if (collection == null) {
return;
}
AbstractChartWithData chart = collection.getSelectedChart(AbstractChartWithData.class);
if (chart == null) {
return;
}
update((T) chart);
}
}

79
designer-chart/src/main/java/com/fr/design/chartx/impl/DefaultTypePane.java

@ -0,0 +1,79 @@
package com.fr.design.chartx.impl;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chart.impl.AbstractChartWithData;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
/**
* Created by shine on 2019/09/04.
*/
public class DefaultTypePane<T extends AbstractChartWithData> extends AbstractChartTypePane<AbstractChartWithData> {
@Override
protected String[] getTypeIconPath() {
return ChartTypeInterfaceManager.getInstance().getDemoImagePath(getPlotID());
}
@Override
protected String[] getTypeTipName() {
return ChartTypeInterfaceManager.getInstance().getSubName(getPlotID());
}
@Override
public ChartProvider getDefaultChart() {
return ChartTypeManager.getInstance().getChartTypes(getPlotID())[0];
}
@Override
public String title4PopupWindow() {
return ChartTypeInterfaceManager.getInstance().getName(getPlotID());
}
protected int getSelectIndexInChart(T chart) {
return 0;
}
protected void setSelectIndexInChart(T chart, int index) {
}
@Override
public void populateBean(AbstractChartWithData ob) {
if (getTypeIconPath().length > 0) {
for (ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
typeDemo.get(getSelectIndexInChart((T) ob)).isPressing = true;
checkDemosBackground();
}
}
@Override
public void updateBean(AbstractChartWithData ob) {
if (getTypeIconPath().length > 0) {
for (int index = 0, len = typeDemo.size(); index < len; index++) {
if (typeDemo.get(index).isPressing) {
setSelectIndexInChart((T) ob, index);
return;
}
}
}
}
@Override
protected String[] getTypeLayoutPath() {
return new String[0];
}
@Override
protected String[] getTypeLayoutTipName() {
return new String[0];
}
@Override
protected String getPlotTypeID() {
return null;
}
}

8
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartsEditPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.chart;
import com.fr.chart.chartattr.Chart;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
@ -30,15 +31,16 @@ public class ChartsEditPane extends ChartEditPane {
* 重新构造面板
* @param currentChart 图表
*/
public void reLayout(Chart currentChart) {
public void reLayout(ChartProvider currentChart) {
if (currentChart != null) {
Chart chart = (Chart) currentChart;
this.removeAll();
this.setLayout(new BorderLayout());
paneList = new ArrayList<AbstractChartAttrPane>();
String plotID = "";
if (currentChart.getPlot() != null) {
plotID = currentChart.getPlot().getPlotID();
if (chart.getPlot() != null) {
plotID = chart.getPlot().getPlotID();
}
dataPane4SupportCell = createChartDataPane(plotID);

5
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -178,9 +178,8 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
*/
public ChartProvider getChangeStateNewChart() {
ChartProvider chart = editingCollection.getSelectedChartProvider();
String priority = ChartTypeManager.VAN_CHART_PRIORITY;
//todo@shinerefactor
// chart.getPriority();
String chartID = chart.getID();
String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID);
return ChartTypeManager.getInstanceWithCheck().getFirstChart(priority);
}

21
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe.chart.gui;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.SwitchState;
import com.fr.chart.charttypes.ChartTypeManager;
@ -146,12 +145,6 @@ public class ChartTypePane extends AbstractChartAttrPane{
//chartID改变的话图表类型就算改变了
if (StringUtils.isNotEmpty(chartID)) {
if (chart instanceof Chart) {
//todo@shinerefactor: 这边看下是否可以删除
((Chart) chart).setWrapperName(ChartTypeManager.getInstanceWithCheck().getWrapperName(chartID));
((Chart) chart).setChartImagePath(ChartTypeManager.getInstanceWithCheck().getChartImagePath(chartID));
}
boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID);
if (editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, chartID))) {
@ -217,12 +210,10 @@ public class ChartTypePane extends AbstractChartAttrPane{
private void relayout(ChartCollection collection){
//重构需要重构下拉框选项和cardNames
ChartProvider chart = collection.getSelectedChartProvider();
String priority = ChartTypeManager.VAN_CHART_PRIORITY;
//TODO@shinerefactor
// chart.getPriority();
String plotID = chart.getID();
boolean enabledChart = ChartTypeManager.enabledChart(plotID);
String item = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(priority, plotID);
String chartID = chart.getID();
String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID);
boolean enabledChart = ChartTypeManager.enabledChart(chartID);
String item = ChartTypeInterfaceManager.getInstance().getName(chartID);
//第一步就是重构cards
cards.clear();
@ -233,7 +224,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
addOnePriorityCards(priority);
}
} else {
addOnePlotIDCards(priority, plotID);
addOnePlotIDCards(priority, chartID);
}
//下拉框重构开始。为了防止重构是触发update
@ -309,6 +300,8 @@ public class ChartTypePane extends AbstractChartAttrPane{
boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
if (editPane != null && editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))){
editPane.reLayout(chart);
}else {
throw new IllegalArgumentException("editPane can not be null.");
}
}

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java

@ -140,7 +140,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa
} else if(data!= null && !this.boxItemsContainsObject(categoryCombox,data.getCategoryName())){
categoryCombox.setSelectedItem(null);
}else {
combineCustomEditValue(categoryCombox, data == null ? null : data.getCategoryName());
combineCustomEditValue(categoryCombox, data.getCategoryName());
}
seriesTypeComboxPane.populateBean(collection,this.isNeedSummaryCaculateMethod());

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

@ -310,11 +310,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
});
editorComponent = uiComboBox;
if (value != null && StringUtils.isNotEmpty(value.toString())) {
uiComboBox.getModel().setSelectedItem(value);
} else {
uiComboBox.getModel().setSelectedItem(value);
}
uiComboBox.getModel().setSelectedItem(value);
return uiComboBox;
}

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

@ -121,11 +121,7 @@ public class ChartDataPointLabel4MapPane extends ChartDatapointLabelPane {
percentFormat = attrContents.getPercentFormat();
if(textFontPane != null) {
if (attrContents != null) {
textFontPane.populate(attrContents.getTextAttr());
} else {
textFontPane.populate(FRFont.getInstance());
}
textFontPane.populate(attrContents.getTextAttr());
}
}

25
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -60,6 +60,11 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
}
public AbstractChartTypePane() {
}
public void reLayout(String chartID) {
this.plotID = chartID;
double vs = 4;
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
@ -156,9 +161,11 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
}
}
for(int i = 0; i < typeDemo.size(); i++) {
typeDemo.get(i).checkBorder();
typeDemo.get(i).repaint();
if (this.typeDemo != null && !typeDemo.isEmpty()) {
for (int i = 0; i < typeDemo.size(); i++) {
typeDemo.get(i).checkBorder();
typeDemo.get(i).repaint();
}
}
}
@ -197,22 +204,14 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
return plotID;
}
public void setPlotID(String plotID) {
this.plotID = plotID;
}
/**
*
* @param ob 对象
* @return
*/
public boolean accept(Object ob) {
if(ob instanceof Chart){
Chart chart = (Chart)ob;
Plot plot = chart.getPlot();
if(plot != null && ComparatorUtils.equals(plot.getPlotID(), getPlotID())){
return true;
}
if (ob instanceof ChartProvider) {
return ComparatorUtils.equals(((ChartProvider) ob).getID(), getPlotID());
}
return false;
}

23
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java

@ -5,9 +5,13 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.IOUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
public class ChartImagePane extends ChartSelectDemoPane {
private static final long serialVersionUID = -2785128245790568603L;
@ -33,9 +37,18 @@ public class ChartImagePane extends ChartSelectDemoPane {
constructImagePane(fullIconPath, tipName, isDrawRightLine);
}
private void constructImagePane(String fullIconPath, String tipName, boolean isDrawRightLine){
UILabel image = new UILabel(IOUtils.readIcon(fullIconPath));
private void constructImagePane(final String fullIconPath, String tipName, boolean isDrawRightLine) {
UILabel image = new UILabel() {
@Override
public void paint(Graphics g) {
super.paint(g);
BufferedImage image1 = IOUtils.readImageWithCache(fullIconPath);
g.drawImage(image1, 0, 0, IMAGE_WIDTH, IMAGE_HIGTH, null);
}
};
this.setLayout(new BorderLayout());
this.add(image, BorderLayout.CENTER);
addMouseListener(this);

5
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java

@ -13,6 +13,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.AssistUtils;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -139,9 +140,9 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
}
}else{
String key = this.keyInput.getText().trim();
if(plot.isGisType() && key != plot.getBaiduKey()){
if(plot.isGisType() && !AssistUtils.equals(key,plot.getBaiduKey())){
plot.setBaiduKey(key);
}else if(!plot.isGisType() && key != plot.getGoogleKey()){
}else if(!plot.isGisType() && !AssistUtils.equals(key,plot.getGoogleKey())){
plot.setGoogleKey(key);
}
}

19
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartUIProvider.java

@ -2,7 +2,7 @@ package com.fr.extended.chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
@ -13,18 +13,27 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.stable.StringUtils;
import com.fr.stable.fun.impl.AbstractProvider;
/**
* Created by shine on 2018/3/2.
*/
public abstract class AbstractExtendedChartUIProvider extends AbstractProvider implements IndependentChartUIProvider {
public abstract class AbstractExtendedChartUIProvider extends AbstractProvider implements ChartTypeUIProvider {
protected abstract AbstractExtendedChartTableDataPane getTableDataSourcePane();
protected abstract AbstractReportDataContentPane getReportDataSourcePane();
@Override
public String getName() {
return null;
}
@Override
public String[] getSubName() {
return new String[0];
}
@Override
public boolean needChartChangePane() {
return false;
@ -85,10 +94,6 @@ public abstract class AbstractExtendedChartUIProvider extends AbstractProvider i
return null;
}
public String getPlotTypeTitle4PopupWindow(){
return StringUtils.EMPTY;
}
@Override
public ChartsConfigPane getChartConfigPane(String plotID) {
return null;

3
designer-chart/src/main/java/com/fr/extended/chart/ExtendedTypePane.java

@ -2,6 +2,7 @@ package com.fr.extended.chart;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
@ -71,7 +72,7 @@ public class ExtendedTypePane<T extends AbstractChart> extends AbstractChartType
@Override
public String title4PopupWindow() {
return ChartTypeManager.getInstance().getChartName(getPlotID());
return ChartTypeInterfaceManager.getInstance().getName(getPlotID());
}
@Override

37
designer-chart/src/main/java/com/fr/van/chart/area/AreaIndependentVanChartInterface.java

@ -3,6 +3,7 @@ package com.fr.van.chart.area;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
@ -16,6 +17,34 @@ public class AreaIndependentVanChartInterface extends AbstractMultiCategoryVanCh
return "com/fr/design/images/form/toolbar/area.png";
}
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Area");
}
@Override
public String[] getSubName() {
String area = Toolkit.i18nText("Fine-Design_Chart_New_Area");
String stack = Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
return new String[]{
area,
stack + area,
percent + stack + area,
Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/14.png",
"com/fr/plugin/chart/demo/image/15.png",
"com/fr/plugin/chart/demo/image/16.png",
"com/fr/plugin/chart/demo/image/17.png"
};
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartAreaPlotPane();
@ -29,12 +58,4 @@ public class AreaIndependentVanChartInterface extends AbstractMultiCategoryVanCh
return new VanChartAreaSeriesPane(parent, plot);
}
/**
* plot面板的标题
* 插件兼容
*/
public String getPlotTypeTitle4PopupWindow(){
return VanChartAreaPlotPane.TITLE;
}
}

37
designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaPlotPane.java

@ -3,7 +3,6 @@ package com.fr.van.chart.area;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.area.AreaIndependentVanChart;
import com.fr.plugin.chart.area.VanChartAreaPlot;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -12,8 +11,6 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by Mitisky on 15/11/18.
*/
public class VanChartAreaPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Area");
private static final long serialVersionUID = -8161581682558781651L;
@Override
protected String[] getTypeIconPath() {
@ -25,40 +22,6 @@ public class VanChartAreaPlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
String area = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Area");
String stack = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
return new String[]{
area,
stack + area,
percent + stack + area,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")
};
}
/**
* 返回界面标题
*
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Area");
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID;
}
protected Plot getSelectedClonedPlot() {
VanChartAreaPlot newPlot = null;
Chart[] areaChart = AreaIndependentVanChart.AreaVanChartTypes;

38
designer-chart/src/main/java/com/fr/van/chart/bar/BarIndependentVanChartInterface.java

@ -4,6 +4,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
@ -17,6 +18,35 @@ import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
* Created by Mitisky on 15/10/20.
*/
public class BarIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI {
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Bar");
}
@Override
public String[] getSubName() {
String bar = Toolkit.i18nText("Fine-Design_Chart_New_Bar");
String stack = Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
return new String[]{
bar,
stack + bar,
percent + stack + bar,
Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/7.png",
"com/fr/plugin/chart/demo/image/8.png",
"com/fr/plugin/chart/demo/image/9.png",
"com/fr/plugin/chart/demo/image/10.png",
};
}
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/bar.png";
@ -45,12 +75,4 @@ public class BarIndependentVanChartInterface extends AbstractMultiCategoryVanCha
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
/**
* plot面板的标题
* 插件兼容
*/
public String getPlotTypeTitle4PopupWindow(){
return VanChartBarPlotPane.TITLE;
}
}

36
designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java

@ -3,7 +3,6 @@ package com.fr.van.chart.bar;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.bar.BarIndependentVanChart;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -12,9 +11,6 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by Mitisky on 15/10/20.
*/
public class VanChartBarPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Bar");
private static final long serialVersionUID = 2879689884048643002L;
@Override
protected String[] getTypeIconPath() {
@ -25,38 +21,6 @@ public class VanChartBarPlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
String bar = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Bar");
String stack = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
return new String[]{
bar,
stack + bar,
percent + stack + bar,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Bar");
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartColumnPlot newPlot = null;
Chart[] barChart = BarIndependentVanChart.BarVanChartTypes;

26
designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java

@ -5,6 +5,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
@ -22,6 +23,27 @@ import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
* Created by Mitisky on 16/3/31.
*/
public class BubbleIndependentVanChartInterface extends AbstractIndependentVanChartUI {
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Bubble");
}
@Override
public String[] getSubName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Bubble_Chart"),
Toolkit.i18nText("Fine-Design_Chart_New_Force_Bubble")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/26.png",
"com/fr/plugin/chart/demo/image/27.png"
};
}
/**
* 图表的类型定义界面类型就是属性表的第一个界面
*
@ -79,8 +101,4 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartBubbleConditionPane(plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartBubblePlotPane.TITLE;
}
}

29
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java

@ -7,7 +7,6 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom;
import com.fr.plugin.chart.bubble.BubbleIndependentVanChart;
@ -20,7 +19,6 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Bubble");;
private static final long serialVersionUID = -3481633368542654247L;
@ -35,23 +33,6 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Bubble_Chart"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Force_Bubble")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Bubble");
}
private void removeDefaultAttr(ConditionAttr conditionAttr, Class <? extends DataSeriesCondition> targetClass) {
DataSeriesCondition attr = conditionAttr.getExisted(targetClass);
if (attr != null){
@ -59,16 +40,6 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
}
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartBubblePlot newPlot = null;
Chart[] bubbleChart = BubbleIndependentVanChart.BubbleVanChartTypes;

44
designer-chart/src/main/java/com/fr/van/chart/column/ColumnIndependentVanChartInterface.java

@ -2,10 +2,8 @@ package com.fr.van.chart.column;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.MultiCategoryChartDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
@ -14,6 +12,35 @@ import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
* Created by Mitisky on 15/9/24.
*/
public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI {
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Column");
}
@Override
public String[] getSubName() {
String column = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Column");
String stack = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
return new String[]{
column,
stack + column,
percent + stack + column,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/3.png",
"com/fr/plugin/chart/demo/image/4.png",
"com/fr/plugin/chart/demo/image/5.png",
"com/fr/plugin/chart/demo/image/6.png",
};
}
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/column.png";
@ -33,12 +60,13 @@ public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVan
return new VanChartColumnSeriesPane(parent, plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartColumnPlotPane.TITLE;
}
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new MultiCategoryChartDataPane(listener);
// return new AbstractDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
// }
// };
// }
}

37
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java

@ -3,7 +3,6 @@ package com.fr.van.chart.column;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.column.ColumnIndependentVanChart;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -12,10 +11,6 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by Mitisky on 15/9/24.
*/
public class VanChartColumnPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Column");
private static final long serialVersionUID = 5950923001789733745L;
@Override
protected String[] getTypeIconPath() {
@ -26,38 +21,6 @@ public class VanChartColumnPlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
String column = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Column");
String stack = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
return new String[]{
column,
stack + column,
percent + stack + column,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Column");
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartColumnPlot newPlot = null;
Chart[] columnChart = ColumnIndependentVanChart.ColumnVanChartTypes;

30
designer-chart/src/main/java/com/fr/van/chart/custom/CustomIndependentVanChartInterface.java

@ -1,6 +1,7 @@
package com.fr.van.chart.custom;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
@ -14,6 +15,31 @@ import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
* Created by Mitisky on 16/2/16.
*/
public class CustomIndependentVanChartInterface extends AbstractIndependentVanChartUI {
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Combine");
}
@Override
public String[] getSubName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_New_Column_Line"),
Toolkit.i18nText("Fine-Design_Chart_New_Column_Area"),
Toolkit.i18nText("Fine-Design_Chart_New_StackColumn_Line"),
Toolkit.i18nText("Fine-Design_Chart_New_Custom_Combine")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/28.png",
"com/fr/plugin/chart/demo/image/29.png",
"com/fr/plugin/chart/demo/image/30.png",
"com/fr/plugin/chart/demo/image/31.png"
};
}
/**
* 图表的类型定义界面类型就是属性表的第一个界面
*
@ -49,8 +75,4 @@ public class CustomIndependentVanChartInterface extends AbstractIndependentVanCh
public ChartDataPane getChartDataPane(AttributeChangeListener listener){
return new VanChartCustomDataPane(listener);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartCustomPlotPane.TITLE;
}
}

32
designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java

@ -10,7 +10,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.custom.CustomDefinition;
@ -35,7 +34,6 @@ import java.util.Map;
* Created by Mitisky on 16/2/16.
*/
public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Combine");
//是否选择自定义
private boolean isCustom = false;
@ -114,26 +112,6 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Column_Line"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Column_Area"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_StackColumn_Line"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Custom_Combine")
};
}
@Override
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Combine");
}
@Override
public void updateBean(Chart chart) {
@ -241,16 +219,6 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID;
}
protected Plot getSelectedClonedPlot() {
VanChartCustomPlot newPlot = null;
Chart[] customChart = CustomIndependentVanChart.CustomVanChartTypes;

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

@ -7,6 +7,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chart.chartglyph.DataSheet;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.MultilineLabel;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
@ -45,6 +46,21 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Cha
return new String[0];
}
@Override
protected String[] getTypeTipName() {
return ChartTypeInterfaceManager.getInstance().getSubName(getPlotID());
}
@Override
public String title4PopupWindow() {
return ChartTypeInterfaceManager.getInstance().getName(getPlotID());
}
@Override
protected String getPlotTypeID() {
return getPlotID();
}
protected Component[][] getComponentsWithLargeData(JPanel typePane){
largeModelCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open_Large_Data_Model"));
MultilineLabel prompt = new MultilineLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Data_Model_Prompt"));

27
designer-chart/src/main/java/com/fr/van/chart/drillmap/DrillMapIndependentVanChartInterface.java

@ -1,6 +1,7 @@
package com.fr.van.chart.drillmap;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
@ -16,6 +17,28 @@ import com.fr.van.chart.map.designer.style.VanChartMapStylePane;
* Created by Mitisky on 16/6/20.
*/
public class DrillMapIndependentVanChartInterface extends MapIndependentVanChartInterface {
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_Drill_Map");
}
@Override
public String[] getSubName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Region_Map"),
Toolkit.i18nText("Fine-Design_Chart_PointMap"),
Toolkit.i18nText("Fine-Design_Chart_Custom_Map")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/37.png",
"com/fr/plugin/chart/demo/image/38.png",
"com/fr/plugin/chart/demo/image/39.png"
};
}
/**
* 图标路径
@ -50,8 +73,4 @@ public class DrillMapIndependentVanChartInterface extends MapIndependentVanChart
VanChartOtherPane otherPane = new VanChartDrillMapOtherPane();
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartDrillMapPlotPane.TITLE;
}
}

31
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java

@ -2,7 +2,6 @@ package com.fr.van.chart.drillmap.designer.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChart;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
@ -18,8 +17,6 @@ import java.util.ArrayList;
*/
public class VanChartDrillMapPlotPane extends VanChartMapPlotPane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill_Map");
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/van/chart/drillmap/images/area-map.png",
@ -38,14 +35,6 @@ public class VanChartDrillMapPlotPane extends VanChartMapPlotPane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Region_Map"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_PointMap"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Map")
};
}
//钻取地图不全屏
@Override
@ -57,26 +46,6 @@ public class VanChartDrillMapPlotPane extends VanChartMapPlotPane {
return tools;
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID;
}
/**
* title应该是一个属性不只是对话框的标题时用到与其他组件结合时也会用得到
*
* @return 绥化狂标题
*/
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill_Map");
}
protected Chart[] getDefaultCharts() {
return DrillMapIndependentVanChart.DrillMapVanCharts;

16
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/FunnelIndependentVanChartInterface.java

@ -5,6 +5,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
@ -25,6 +26,18 @@ import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
* Created by Mitisky on 16/10/10.
*/
public class FunnelIndependentVanChartInterface extends AbstractIndependentVanChartUI {
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Funnel");
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/41.png"
};
}
/**
* 图表的类型定义界面类型就是属性表的第一个界面
*
@ -77,7 +90,4 @@ public class FunnelIndependentVanChartInterface extends AbstractIndependentVanCh
return "com/fr/design/images/form/toolbar/funnel.png";
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartFunnelTypePane.TITLE;
}
}

29
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/type/VanChartFunnelTypePane.java

@ -3,7 +3,6 @@ package com.fr.van.chart.funnel.designer.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.funnel.FunnelIndependentVanChart;
import com.fr.plugin.chart.funnel.VanChartFunnelPlot;
@ -13,7 +12,6 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by Mitisky on 16/10/10.
*/
public class VanChartFunnelTypePane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Funnel");
@Override
protected String[] getTypeIconPath() {
@ -22,33 +20,6 @@ public class VanChartFunnelTypePane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Funnel")
};
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartFunnelPlot.VAN_CHART_FUNNEL_PLOT_ID;
}
/**
* title应该是一个属性不只是对话框的标题时用到与其他组件结合时也会用得到
*
* @return 绥化狂标题
*/
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Funnel");
}
protected Plot getSelectedClonedPlot(){
Chart chart = getDefaultChart();
VanChartFunnelPlot newPlot = (VanChartFunnelPlot) chart.getPlot();

18
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/GanttIndependentVanChartInterface.java

@ -5,6 +5,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
@ -27,6 +28,18 @@ import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
* Created by hufan on 2017/1/9.
*/
public class GanttIndependentVanChartInterface extends AbstractIndependentVanChartUI {
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Gantt");
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/44.png"
};
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartGanttPlotPane();
@ -59,11 +72,6 @@ public class GanttIndependentVanChartInterface extends AbstractIndependentVanCha
return "com/fr/design/images/form/toolbar/gantt.png";
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartGanttPlotPane.TITLE;
}
/**
* 图表的属性界面数组
* @return 属性界面

22
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/type/VanChartGanttPlotPane.java

@ -3,7 +3,6 @@ package com.fr.van.chart.gantt.designer.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.gantt.GanttIndependentVanChart;
import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -12,33 +11,12 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by hufan on 2017/1/9.
*/
public class VanChartGanttPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Gantt");
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/van/chart/gantt/images/gantt.png"
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gantt_Chart")
};
}
@Override
protected String getPlotTypeID() {
return VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID;
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Gantt");
}
public Chart getDefaultChart() {
return GanttIndependentVanChart.ganttVanChartTypes[0];
}

32
designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java

@ -3,6 +3,7 @@ package com.fr.van.chart.gauge;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
@ -31,6 +32,33 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha
return "com/fr/design/images/form/toolbar/gauge.png";
}
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Gauge");
}
@Override
public String[] getSubName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Gauge_Pointer"),
Toolkit.i18nText("Fine-Design_Chart_Gauge_Pointer180"),
Toolkit.i18nText("Fine-Design_Chart_Gauge_Ring"),
Toolkit.i18nText("Fine-Design_Chart_Gauge_Slot"),
Toolkit.i18nText("Fine-Design_Chart_Gauge_Cuvette")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/18.png",
"com/fr/plugin/chart/demo/image/19.png",
"com/fr/plugin/chart/demo/image/20.png",
"com/fr/plugin/chart/demo/image/21.png",
"com/fr/plugin/chart/demo/image/22.png"
};
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartGaugePlotPane();
@ -79,8 +107,4 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartGaugeSeriesPane(parent, plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartGaugePlotPane.TITLE;
}
}

36
designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugePlotPane.java

@ -3,7 +3,6 @@ package com.fr.van.chart.gauge;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.gauge.GaugeIndependentVanChart;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -12,7 +11,6 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by Mitisky on 15/11/27.
*/
public class VanChartGaugePlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Gauge");
private static final long serialVersionUID = -4599483879031804911L;
@ -26,24 +24,6 @@ public class VanChartGaugePlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gauge_Pointer"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gauge_Pointer180"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gauge_Ring"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gauge_Slot"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gauge_Cuvette")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Gauge");
}
protected Plot getSelectedClonedPlot(){
VanChartGaugePlot newPlot = null;
Chart[] GaugeChart = GaugeIndependentVanChart.GaugeVanChartTypes;
@ -55,7 +35,11 @@ public class VanChartGaugePlotPane extends AbstractVanChartTypePane {
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
if (newPlot == null) {
throw new IllegalArgumentException("newPlot con not be null");
}else {
cloned = (Plot)newPlot.clone();
}
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error("Error In GaugeChart");
}
@ -74,16 +58,6 @@ public class VanChartGaugePlotPane extends AbstractVanChartTypePane {
}
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartGaugePlot.VAN_CHART_GAUGE_PLOT;
}
protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{
}

17
designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java

@ -5,6 +5,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
@ -32,6 +33,18 @@ public class HeatMapIndependentVanChartInterface extends MapIndependentVanChartI
return "com/fr/design/images/form/toolbar/heatmap.png";
}
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_HeatMap");
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/42.png"
};
}
public AbstractChartTypePane getPlotTypePane() {
return new VanChartHeatMapTypePane();
}
@ -62,8 +75,4 @@ public class HeatMapIndependentVanChartInterface extends MapIndependentVanChartI
};
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartHeatMapTypePane.TITLE;
}
}

29
designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java

@ -4,7 +4,6 @@ import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.heatmap.HeatMapIndependentVanChart;
import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot;
@ -16,7 +15,6 @@ import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane;
* Created by Mitisky on 16/10/20.
*/
public class VanChartHeatMapTypePane extends VanChartMapPlotPane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_HeatMap");
@Override
protected String[] getTypeIconPath() {
@ -24,33 +22,6 @@ public class VanChartHeatMapTypePane extends VanChartMapPlotPane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_HeatMap")
};
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID;
}
/**
* title应该是一个属性不只是对话框的标题时用到与其他组件结合时也会用得到
*
* @return 绥化狂标题
*/
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_HeatMap");
}
@Override
protected VanChartMapSourceChoosePane createSourceChoosePane() {
return new VanChartHeatMapSourceChoosePane();

28
designer-chart/src/main/java/com/fr/van/chart/line/LineIndependentVanChartInterface.java

@ -3,6 +3,7 @@ package com.fr.van.chart.line;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
@ -16,6 +17,29 @@ public class LineIndependentVanChartInterface extends AbstractMultiCategoryVanCh
return "com/fr/design/images/form/toolbar/line.png";
}
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Line");
}
@Override
public String[] getSubName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Line_Chart"),
Toolkit.i18nText("Fine-Design_Chart_Stacked_Line"),
Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/11.png",
"com/fr/plugin/chart/demo/image/12.png",
"com/fr/plugin/chart/demo/image/13.png"
};
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartLinePlotPane();
@ -29,8 +53,4 @@ public class LineIndependentVanChartInterface extends AbstractMultiCategoryVanCh
return new VanChartLineSeriesPane(parent, plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartLinePlotPane.TITLE;
}
}

36
designer-chart/src/main/java/com/fr/van/chart/line/VanChartLinePlotPane.java

@ -3,7 +3,6 @@ package com.fr.van.chart.line;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.line.LineIndependentVanChart;
import com.fr.plugin.chart.line.VanChartLinePlot;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -12,8 +11,6 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by Mitisky on 15/11/5.
*/
public class VanChartLinePlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Line");
private static final long serialVersionUID = -8161581682558781651L;
@Override
protected String[] getTypeIconPath() {
@ -23,33 +20,6 @@ public class VanChartLinePlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Chart"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Stacked_Line"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Line");
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartLinePlot.VAN_CHART_LINE_PLOT;
}
protected Plot getSelectedClonedPlot(){
VanChartLinePlot newPlot = null;
Chart[] lineChart = LineIndependentVanChart.LineVanChartTypes;
@ -60,7 +30,11 @@ public class VanChartLinePlotPane extends AbstractVanChartTypePane {
}
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
if (newPlot == null) {
throw new IllegalArgumentException("newPlot con not be null");
}else {
cloned = (Plot)newPlot.clone();
}
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error("Error In LineChart");
}

32
designer-chart/src/main/java/com/fr/van/chart/map/MapIndependentVanChartInterface.java

@ -4,6 +4,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
@ -32,6 +33,33 @@ import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
*/
public class MapIndependentVanChartInterface extends AbstractIndependentVanChartUI {
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Map");
}
@Override
public String[] getSubName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Region_Map"),
Toolkit.i18nText("Fine-Design_Chart_PointMap"),
Toolkit.i18nText("Fine-Design_Chart_LineMap"),
Toolkit.i18nText("Fine-Design_Chart_Combine_Map")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/33.png",
"com/fr/plugin/chart/demo/image/34.png",
"com/fr/plugin/chart/demo/image/35.png",
"com/fr/plugin/chart/demo/image/36.png"
};
}
/**
* 图表的类型定义界面类型就是属性表的第一个界面
*
@ -93,8 +121,4 @@ public class MapIndependentVanChartInterface extends AbstractIndependentVanChart
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartMapConditionPane(plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartMapPlotPane.TITLE;
}
}

34
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java

@ -19,7 +19,6 @@ import java.awt.Component;
* Created by Mitisky on 16/5/4.
*/
public class VanChartMapPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Map");
private VanChartMapSourceChoosePane sourceChoosePane;
@ -32,36 +31,6 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Region_Map"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_PointMap"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_LineMap"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Combine_Map")
};
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartMapPlot.VAN_CHART_MAP_ID;
}
/**
* title应该是一个属性不只是对话框的标题时用到与其他组件结合时也会用得到
*
* @return 绥化狂标题
*/
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Map");
}
protected Component[][] getPaneComponents(JPanel typePane){
try {
sourceChoosePane = createSourceChoosePane();
@ -146,6 +115,9 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
}
}
Plot cloned = null;
if (null == newPlot) {
return cloned;
}
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {

26
designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java

@ -2,10 +2,8 @@ package com.fr.van.chart.multilayer;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.MultiPieChartDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.multilayer.other.VanChartMultiPieConditionPane;
@ -26,9 +24,26 @@ public class MultiPieIndependentVanChartInterface extends AbstractIndependentVan
return "com/fr/design/images/form/toolbar/multiPie.png";
}
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_MultiPie");
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/32.png"
};
}
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new MultiPieChartDataPane(listener);
// return new AbstractDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// return new SingleDataPane(new MultiPieDataSetFieldsPane(), new MultiPieCellDataFieldsPane());
// }
// };
// }
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
@ -39,7 +54,4 @@ public class MultiPieIndependentVanChartInterface extends AbstractIndependentVan
return new VanChartMultiPieConditionPane(plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartMultiPiePlotPane.TITLE;
}
}

22
designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java

@ -3,7 +3,6 @@ package com.fr.van.chart.multilayer;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.multilayer.MultiPieIndependentVanChart;
import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot;
@ -14,30 +13,12 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by Fangjie on 2016/6/15.
*/
public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_MultiPie");
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/van/chart/multilayer/image/multiPie.png"
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_MultiPie_Chart")
};
}
@Override
protected String getPlotTypeID() {
return VanChartMultiPiePlot.VAN_CHART_MULTILAYER_PLOT_ID;
}
@Deprecated
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_MultiPie");
}
@Override
protected Plot getSelectedClonedPlot(){
VanChartMultiPiePlot newPlot = null;
@ -49,6 +30,9 @@ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane {
}
Plot cloned = null;
if (null == newPlot) {
return cloned;
}
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {

3
designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotReportDataContentPane.java

@ -14,6 +14,7 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.plugin.chart.multilayer.data.MultiPieReportDataDefinition;
import com.fr.stable.AssistUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
@ -81,7 +82,7 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent
@Override
public void setTextFieldValue(double value) {
//如果为0,则没有改变值
if (value == 0){
if (AssistUtils.equals(0, value)) {
return;
}
super.setTextFieldValue(value);

3
designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java

@ -18,6 +18,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.multilayer.data.MultiPieValueDefinition;
import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -170,7 +171,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
@Override
public void setTextFieldValue(double value) {
//如果为0,则没有改变值
if (value == 0){
if (AssistUtils.equals(0, value)) {
return;
}
super.setTextFieldValue(value);

29
designer-chart/src/main/java/com/fr/van/chart/pie/PieIndependentVanChartInterface.java

@ -3,6 +3,7 @@ package com.fr.van.chart.pie;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
@ -23,6 +24,30 @@ public class PieIndependentVanChartInterface extends AbstractIndependentVanChart
return "com/fr/design/images/form/toolbar/pie.png";
}
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Pie");
}
@Override
public String[] getSubName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Pie"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_SameArc_Pie"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_DifferArc_Pie")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/0.png",
"com/fr/plugin/chart/demo/image/1.png",
"com/fr/plugin/chart/demo/image/2.png"
};
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartPiePlotPane();
@ -48,8 +73,4 @@ public class PieIndependentVanChartInterface extends AbstractIndependentVanChart
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){
return (parent instanceof VanChartDataPane) ? new CategoryCustomPlotTableDataContentPane(parent) : new CategoryPlotTableDataContentPane(parent);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartPiePlotPane.TITLE;
}
}

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

@ -4,7 +4,6 @@ package com.fr.van.chart.pie;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.pie.PieIndependentVanChart;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -13,7 +12,6 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* 饼图(新特性) 属性表 选择类型 布局界面.
*/
public class VanChartPiePlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Pie");
private static final long serialVersionUID = 6163246902689597259L;
@ -25,33 +23,6 @@ public class VanChartPiePlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Pie"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_SameArc_Pie"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_DifferArc_Pie")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Pie");
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return PiePlot4VanChart.VAN_CHART_PIE_PLOT;
}
protected Plot getSelectedClonedPlot(){
PiePlot4VanChart newPlot = null;
Chart[] pieChart = PieIndependentVanChart.newPieChartTypes;
@ -62,6 +33,9 @@ public class VanChartPiePlotPane extends AbstractVanChartTypePane {
}
Plot cloned = null;
if (null == newPlot) {
return cloned;
}
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {

26
designer-chart/src/main/java/com/fr/van/chart/radar/RadarIndependentVanChartInterface.java

@ -3,6 +3,7 @@ package com.fr.van.chart.radar;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
@ -16,6 +17,27 @@ public class RadarIndependentVanChartInterface extends AbstractIndependentVanCha
return "com/fr/design/images/form/toolbar/radar.png";
}
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Radar");
}
@Override
public String[] getSubName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Radar_Chart"),
Toolkit.i18nText("Fine-Design_Chart_StackColumn_Radar")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/23.png",
"com/fr/plugin/chart/demo/image/24.png"
};
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartRadarPlotPane();
@ -28,8 +50,4 @@ public class RadarIndependentVanChartInterface extends AbstractIndependentVanCha
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartRadarConditionPane(plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartRadarPlotPane.TITLE;
}
}

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

@ -3,7 +3,6 @@ package com.fr.van.chart.radar;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.radar.RadarIndependentVanChart;
import com.fr.plugin.chart.radar.VanChartRadarPlot;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -12,7 +11,6 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by Mitisky on 15/12/28.
*/
public class VanChartRadarPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Radar");
private static final long serialVersionUID = -4599483879031804911L;
@ -23,32 +21,6 @@ public class VanChartRadarPlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radar_Chart"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_StackColumn_Radar")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Radar");
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartRadarPlot.VAN_CHART_RADAR_PLOT;
}
protected Plot getSelectedClonedPlot(){
VanChartRadarPlot newPlot = null;
Chart[] RadarChart = RadarIndependentVanChart.RadarVanChartTypes;
@ -59,6 +31,9 @@ public class VanChartRadarPlotPane extends AbstractVanChartTypePane {
}
Plot cloned = null;
if (null == newPlot) {
return cloned;
}
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {

3
designer-chart/src/main/java/com/fr/van/chart/range/component/LegendGradientBar.java

@ -13,6 +13,7 @@ import com.fr.design.style.color.ColorSelectDialog;
import com.fr.design.style.color.ColorSelectable;
import com.fr.plugin.chart.range.GradualIntervalConfig;
import com.fr.plugin.chart.range.glyph.GradualColorDist;
import com.fr.stable.AssistUtils;
import javax.swing.JComponent;
import javax.swing.event.ChangeEvent;
@ -224,7 +225,7 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
//防止位置重复,设置偏移
private int setOffset(int x, int index, int offset) {
for (int i = 0; i < selectColorPointBtnList.size(); i++){
if (i != index && x == selectColorPointBtnList.get(i).getX()){
if (i != index && AssistUtils.equals(x, selectColorPointBtnList.get(i).getX())) {
if (x >= (min+max)/2) {
x -= offset;
x = setOffset(x, index, offset+OFFSETSTEP);

17
designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java

@ -6,6 +6,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
@ -34,6 +35,18 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
return new VanChartScatterPlotPane();
}
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Scatter");
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/25.png"
};
}
/**
* 图标路径
*
@ -78,8 +91,4 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartScatterConditionPane(plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartScatterPlotPane.TITLE;
}
}

31
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java

@ -6,7 +6,6 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.scatter.ScatterIndependentVanChart;
@ -17,8 +16,6 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
* Created by Mitisky on 16/2/16.
*/
public class VanChartScatterPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Scatter");
private static final long serialVersionUID = -3481633368542654247L;
@Override
@ -27,31 +24,6 @@ public class VanChartScatterPlotPane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Scatter")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Scatter");
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartScatterPlot.VAN_CHART_SCATTER_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartScatterPlot newPlot = null;
Chart[] scatterChart = ScatterIndependentVanChart.ScatterVanChartTypes;
@ -61,6 +33,9 @@ public class VanChartScatterPlotPane extends AbstractVanChartTypePane {
}
}
Plot cloned = null;
if (null == newPlot) {
return cloned;
}
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {

24
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java

@ -5,6 +5,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
@ -31,6 +32,29 @@ public class StructureIndependentVanChartInterface extends AbstractIndependentVa
return new VanChartStructureTypePane();
}
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Structure");
}
@Override
public String[] getSubName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Vertical_Structure"),
Toolkit.i18nText("Fine-Design_Chart_Horizontal_Structure"),
Toolkit.i18nText("Fine-Design_Chart_Radial_Structure")
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/45.png",
"com/fr/plugin/chart/demo/image/46.png",
"com/fr/plugin/chart/demo/image/47.png"
};
}
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/structure.png";

28
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java

@ -3,7 +3,6 @@ package com.fr.van.chart.structure.desinger.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.structure.StructureIndependentVanChart;
import com.fr.plugin.chart.structure.VanChartStructurePlot;
@ -23,30 +22,6 @@ public class VanChartStructureTypePane extends AbstractVanChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Vertical_Structure"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Structure"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radial_Structure")
};
}
@Override
protected String getPlotTypeID() {
return VanChartStructurePlot.STRUCTURE_PLOT_ID;
}
/**
* title应该是一个属性不只是对话框的标题时用到与其他组件结合时也会用得到
*
* @return 绥化狂标题
*/
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Structure");
}
protected Plot getSelectedClonedPlot(){
VanChartStructurePlot newPlot = null;
Chart[] charts = StructureIndependentVanChart.StructureVanCharts;
@ -57,6 +32,9 @@ public class VanChartStructureTypePane extends AbstractVanChartTypePane {
}
Plot cloned = null;
if (null == newPlot) {
return cloned;
}
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {

16
designer-chart/src/main/java/com/fr/van/chart/treemap/TreeMapIndependentVanChartInterface.java

@ -4,6 +4,7 @@ import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
@ -22,6 +23,18 @@ public class TreeMapIndependentVanChartInterface extends MultiPieIndependentVanC
return new VanChartTreeMapPlotPane();
}
@Override
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_TreeMap");
}
@Override
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/40.png"
};
}
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/treeMap.png";
@ -43,7 +56,4 @@ public class TreeMapIndependentVanChartInterface extends MultiPieIndependentVanC
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartTreeMapPlotPane.TITLE;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save