Browse Source

Merging in latest from upstream (DESIGN/design:refs/heads/feature/10.0)

* commit '2f34a914fafbe7a4eb6db58133cb9c08447f2390':
  无jira任务,sonar问题修复
  REPORT-20329 sonar问题修复
  无jira任务,sonar问题修复
  sonar问题修复,无jira任务
  REPORT-20981 去掉import *
  REPORT-20981 模板版本管理减少磁盘占用
  REPORT-20328 sonar问题修复
  无JIRA任务 sonar问题修复
  REPORT-20327 sonar问题修复
  无JIRA任务 sonar问题修复
  CHART-10225 表单设计器 图表渲染
  无JIRA任务,sonar问题修复
  sonar修复
  REPORT-20323 sonar问题修复
  CHART-10465 暂时注释掉新的数据结构
  REPORT-20318 sonar问题修复
  CHART-10465 框架图数据结构配置兼容
  无JIRA任务 feature版本还是走vanchart逻辑
  ChartComponent用ChartProvider.toIamge接口渲染图表 && CHART-9062 删除activeGlyph相关代码
research/11.0
vito 5 years ago
parent
commit
3c363f339c
  1. 290
      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/ibutton/UIBasicButtonUI.java
  4. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java
  5. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButton.java
  6. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java
  7. 4
      designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIScrollBarUI.java
  8. 8
      designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java
  9. 17
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/MakefileTokenMaker.java
  10. 9
      designer-base/src/main/java/com/fr/design/icon/BorderIcon.java
  11. 2
      designer-base/src/main/java/com/fr/design/icon/LockIcon.java
  12. 2
      designer-base/src/main/java/com/fr/design/icon/WarningIcon.java
  13. 5
      designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java
  14. 83
      designer-base/src/main/java/com/fr/design/layout/TableLayout.java
  15. 2
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  16. 5
      designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java
  17. 5
      designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java
  18. 97
      designer-chart/src/main/java/com/fr/design/chart/gui/ActiveGlyphFactory.java
  19. 112
      designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java
  20. 2
      designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java
  21. 161
      designer-chart/src/main/java/com/fr/design/chart/gui/active/ActiveGlyph.java
  22. 38
      designer-chart/src/main/java/com/fr/design/chart/gui/active/AlertValueActiveGlyph.java
  23. 43
      designer-chart/src/main/java/com/fr/design/chart/gui/active/AxisActiveGlyph.java
  24. 19
      designer-chart/src/main/java/com/fr/design/chart/gui/active/CategoryAxisActiveGlyph.java
  25. 39
      designer-chart/src/main/java/com/fr/design/chart/gui/active/ChartActiveGlyph.java
  26. 44
      designer-chart/src/main/java/com/fr/design/chart/gui/active/DataLabelActiveGlyph.java
  27. 53
      designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSeriesActiveGlyph.java
  28. 30
      designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSheetActiveGlyph.java
  29. 18
      designer-chart/src/main/java/com/fr/design/chart/gui/active/DateAxisActiveGlyph.java
  30. 30
      designer-chart/src/main/java/com/fr/design/chart/gui/active/LegendActiveGlyph.java
  31. 34
      designer-chart/src/main/java/com/fr/design/chart/gui/active/PlotActiveGlyph.java
  32. 18
      designer-chart/src/main/java/com/fr/design/chart/gui/active/RadarAxisActiveGlyph.java
  33. 18
      designer-chart/src/main/java/com/fr/design/chart/gui/active/RangeAxisActiveGlyph.java
  34. 35
      designer-chart/src/main/java/com/fr/design/chart/gui/active/TextActiveGlyph.java
  35. 43
      designer-chart/src/main/java/com/fr/design/chart/gui/active/TrendLineActiveGlyph.java
  36. 19
      designer-chart/src/main/java/com/fr/design/chart/gui/active/ValueAxisActiveGlyph.java
  37. 37
      designer-chart/src/main/java/com/fr/design/chart/gui/active/action/ChartComponentAction.java
  38. 27
      designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAnalysisLineStyleAction.java
  39. 33
      designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAxisStyleAction.java
  40. 31
      designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetChartStyleAciton.java
  41. 26
      designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataLabelStyleAction.java
  42. 33
      designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataSheetAction.java
  43. 32
      designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetLegendStyleAction.java
  44. 32
      designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetPlotStyleAction.java
  45. 32
      designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetTitleStyleAction.java
  46. 6
      designer-chart/src/main/java/com/fr/design/chart/report/GisMapReportDataContentPane.java
  47. 8
      designer-chart/src/main/java/com/fr/design/chart/report/GisMapTableDataContentPane.java
  48. 8
      designer-chart/src/main/java/com/fr/design/chart/report/MapMoreTableIndexPane.java
  49. 8
      designer-chart/src/main/java/com/fr/design/chart/report/MapTableDataSinglePane.java
  50. 3
      designer-chart/src/main/java/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java
  51. 23
      designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java
  52. 3
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java
  53. 86
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java
  54. 91
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java
  55. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java
  56. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  57. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java
  58. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java
  59. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDataPointLabel4MapPane.java
  60. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java
  61. 8
      designer-chart/src/main/java/com/fr/van/chart/column/ColumnIndependentVanChartInterface.java
  62. 6
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugePlotPane.java
  63. 6
      designer-chart/src/main/java/com/fr/van/chart/line/VanChartLinePlotPane.java
  64. 3
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java
  65. 8
      designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java
  66. 3
      designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java
  67. 3
      designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotReportDataContentPane.java
  68. 3
      designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java
  69. 3
      designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java
  70. 3
      designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarPlotPane.java
  71. 3
      designer-chart/src/main/java/com/fr/van/chart/range/component/LegendGradientBar.java
  72. 3
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java
  73. 6
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java
  74. 3
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java
  75. 3
      designer-chart/src/main/java/com/fr/van/chart/treemap/VanChartTreeMapPlotPane.java
  76. 8
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java
  77. 3
      designer-form/src/main/java/com/fr/design/designer/beans/AdapterBus.java
  78. 28
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  79. 7
      designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java
  80. 7
      designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java
  81. 18
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java
  82. 1
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  83. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormToolBar.java
  84. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormToolBarPane.java
  85. 1
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  86. 6
      designer-form/src/main/java/com/fr/design/mainframe/widget/UITreeComboBox.java
  87. 4
      designer-realize/src/main/java/com/fr/grid/GridRowUI.java
  88. 9
      designer-realize/src/main/java/com/fr/grid/GridUI.java
  89. 27
      designer-realize/src/main/java/com/fr/poly/PolyDesignUI.java
  90. 37
      designer-realize/src/main/java/com/fr/poly/creator/BlockCreator.java
  91. 53
      designer-realize/src/main/java/com/fr/poly/creator/BlockEditor.java
  92. 4
      designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java
  93. 1
      designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java

290
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,8 +173,19 @@ 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"));
private UIButton gcCancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
public PreferencePane() {
@ -230,6 +266,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 +302,36 @@ 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();
}
});
//集群下禁用
if (FineClusterConfig.getInstance().isCluster()) {
gcEnableCheckBox.setEnabled(false);
gcButton.setEnabled(false);
}
return gcControlPane;
}
private void createFunctionPane(JPanel generalPane) {
@ -629,6 +699,7 @@ public class PreferencePane extends BasicPane {
saveIntervalEditor.setValue(vcsConfigManager.getSaveInterval());
saveCommitCheckBox.setSelected(vcsConfigManager.isSaveCommit());
useIntervalCheckBox.setSelected(vcsConfigManager.isUseInterval());
gcEnableCheckBox.setSelected(GcConfig.getInstance().isGcEnable());
supportCellEditorDefCheckBox.setSelected(designerEnvManager.isSupportCellEditorDef());
@ -726,6 +797,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 +845,6 @@ public class PreferencePane extends BasicPane {
}
// 如果语言设置改变了,则显示重启对话框
public void showRestartDialog() {
if (!languageChanged) {
@ -797,4 +879,208 @@ 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() {
//停止gc线程时使用
final String uuid = String.valueOf(UUID.randomUUID());
final SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() {
private long size = 0;
@Override
protected Boolean doInBackground() {
size = WorkContext.getCurrent().get(VcsOperator.class).immediatelyGc(uuid);
return true;
}
@Override
protected void done() {
try {
get();
} catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
}
stopGcProgressTimer();
gcMessage.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Vcs_Reduce_File_Size") + fileSizeConvert(size));
if (null != gcProgressBar) {
gcProgressBarPanel.remove(gcProgressBar);
}
if (null != gcDialog) {
gcDialog.setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"));
}
gcDialogDownPane.remove(gcCancelButton);
gcDialogDownPane.revalidate();
gcDialogDownPane.repaint();
gcDialogDownPane.add(gcOkButton);
}
};
worker.execute();
initGcDialog();
gcOkButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
gcDialog.dispose();
}
});
gcCancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
stopGcProgressTimer();
//中断gc 线程
if (StringUtils.isNotEmpty(uuid)) {
WorkContext.getCurrent().get(VcsOperator.class).cancelImmediatelyGc(uuid);
}
gcDialog.dispose();
worker.cancel(true);
}
});
gcDialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
stopGcProgressTimer();
worker.cancel(true);
}
});
gcDialog.setVisible(true);
gcDialog.dispose();
}
/**
* 初始化 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));
gcDialogDownPane.add(gcCancelButton);
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/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);
}
}
}

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) {
}
}
}

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;

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

@ -1,6 +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;
@ -12,8 +15,6 @@ import java.lang.reflect.Method;
import java.util.LinkedList;
import java.util.ListIterator;
import com.fr.general.GeneralUtils;
/**
* <p>TableLayout is a layout manager that is more powerful than GridBagLayout
@ -321,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 ***
@ -399,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;
}
@ -556,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;
}
@ -641,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;
}
@ -853,9 +854,9 @@ public class TableLayout implements LayoutManager2, Serializable {
// Make sure row size is valid
if ((size < 0.0) &&
(size != FILL) &&
(size != PREFERRED) &&
(size != MINIMUM)) {
(!CommonUtils.equals(size, FILL)) &&
(!CommonUtils.equals(size, PREFERRED)) &&
(!CommonUtils.equals(size, MINIMUM))) {
size = 0.0;
}
@ -1177,7 +1178,7 @@ public class TableLayout implements LayoutManager2, Serializable {
int numCr = crSpec[z].length;
for (int counter = 0; counter < numCr; counter++)
if ((crSpec[z][counter] >= 1.0) || (crSpec[z][counter] == 0.0)) {
if ((crSpec[z][counter] >= 1.0) || CommonUtils.equals(crSpec[z][counter], 0.0)) {
crSize[z][counter] = (int) (crSpec[z][counter] + 0.5);
availableSize -= crSize[z][counter];
}
@ -1229,7 +1230,7 @@ public class TableLayout implements LayoutManager2, Serializable {
int numCr = crSpec[z].length;
for (int counter = 0; counter < numCr; counter++)
if (crSpec[z][counter] == FILL)
if (CommonUtils.equals(crSpec[z][counter], FILL))
numFillSize++;
// If numFillSize is zero, the if statement below will always evaluate to
@ -1241,7 +1242,7 @@ public class TableLayout implements LayoutManager2, Serializable {
// Assign "fill" cells equal amounts of the remaining space
for (int counter = 0; counter < numCr; counter++)
if (crSpec[z][counter] == FILL) {
if (CommonUtils.equals(crSpec[z][counter], FILL)) {
crSize[z][counter] = availableSize / numFillSize;
slackSize -= crSize[z][counter];
}
@ -1249,7 +1250,7 @@ public class TableLayout implements LayoutManager2, Serializable {
// Assign one pixel of slack to each FILL cr, starting at the last one,
// until all slack has been consumed
for (int counter = numCr - 1; (counter >= 0) && (slackSize > 0); counter--) {
if (crSpec[z][counter] == FILL) {
if (CommonUtils.equals(crSpec[z][counter], FILL)) {
crSize[z][counter]++;
slackSize--;
}
@ -1299,7 +1300,7 @@ public class TableLayout implements LayoutManager2, Serializable {
// Address every cr
for (int counter = 0; counter < numCr; counter++)
// Is the current cr a preferred/minimum (based on typeOfSize) size
if (crSpec[z][counter] == typeOfSize) {
if (CommonUtils.equals(crSpec[z][counter], typeOfSize)) {
// Assume a maximum width of zero
int maxSize = 0;
@ -1319,7 +1320,7 @@ public class TableLayout implements LayoutManager2, Serializable {
// the current component occupies
if ((entry.cr1[z] <= counter) && (entry.cr2[z] >= counter)) {
// Setup size and number of adjustable crs
Dimension p = (typeOfSize == PREFERRED) ?
Dimension p = CommonUtils.equals(typeOfSize, PREFERRED) ?
entry.component.getPreferredSize() :
entry.component.getMinimumSize();
@ -1328,23 +1329,23 @@ public class TableLayout implements LayoutManager2, Serializable {
int numAdjustable = 0;
// Calculate for preferred size
if (typeOfSize == PREFERRED)
if (CommonUtils.equals(typeOfSize, PREFERRED))
// Consider all crs this component occupies
for (int entryCr = entry.cr1[z];
entryCr <= entry.cr2[z]; entryCr++) {
// Subtract absolute, relative, and minumum cr
// sizes, which have already been calculated
if ((crSpec[z][entryCr] >= 0.0) ||
(crSpec[z][entryCr] == MINIMUM)) {
CommonUtils.equals(crSpec[z][entryCr], MINIMUM)) {
size -= crSize[z][entryCr];
}
// Count preferred/min width columns
else if (crSpec[z][entryCr] == PREFERRED)
else if (CommonUtils.equals(crSpec[z][entryCr], PREFERRED))
numAdjustable++;
// Skip any component that occupies a fill cr
// because the fill should fulfill the size
// requirements
else if (crSpec[z][entryCr] == FILL)
// Skip any component that occupies a fill cr
// because the fill should fulfill the size
// requirements
else if (CommonUtils.equals(crSpec[z][entryCr], FILL))
continue nextComponent;
}
// Calculate for minimum size
@ -1357,14 +1358,14 @@ public class TableLayout implements LayoutManager2, Serializable {
if (crSpec[z][entryCr] >= 0.0)
size -= crSize[z][entryCr];
// Count preferred/min width columns
else if ((crSpec[z][entryCr] == PREFERRED) ||
(crSpec[z][entryCr] == MINIMUM)) {
else if (CommonUtils.equals(crSpec[z][entryCr], PREFERRED) ||
CommonUtils.equals(crSpec[z][entryCr], MINIMUM)) {
numAdjustable++;
}
// Skip any component that occupies a fill cr
// because the fill should fulfill the size
// requirements
else if (crSpec[z][entryCr] == FILL)
else if (CommonUtils.equals(crSpec[z][entryCr], FILL))
continue nextComponent;
}
@ -1692,7 +1693,7 @@ public class TableLayout implements LayoutManager2, Serializable {
Dimension prefMinSize[] = new Dimension[numEntry];
for (int i = 0; i < numEntry; i++)
prefMinSize[i] = (typeOfSize == PREFERRED) ?
prefMinSize[i] = CommonUtils.equals(typeOfSize, PREFERRED) ?
entryList[i].component.getPreferredSize() :
entryList[i].component.getMinimumSize();
@ -1807,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];
}
@ -1824,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);
@ -1851,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];
}

2
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,7 @@ public class VcsHelper implements JTemplateActionListener {
if (needDeleteVersion(oldEntity)) {
operator.deleteVersion(oldEntity.getFilename(), oldEntity.getVersion());
}
operator.gc(true);
}
}).start();

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);
}

97
designer-chart/src/main/java/com/fr/design/chart/gui/ActiveGlyphFactory.java

@ -1,97 +0,0 @@
package com.fr.design.chart.gui;
import java.util.HashMap;
import java.util.Map;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.CategoryAxisGlyph;
import com.fr.chart.chartglyph.ChartAlertValueGlyph;
import com.fr.chart.chartglyph.ChartGlyph;
import com.fr.chart.chartglyph.DataSeries;
import com.fr.chart.chartglyph.DataSheetGlyph;
import com.fr.chart.chartglyph.DateAxisGlyph;
import com.fr.chart.chartglyph.LegendGlyph;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.chart.chartglyph.RadarAxisGlyph;
import com.fr.chart.chartglyph.RangeAxisGlyph;
import com.fr.chart.chartglyph.TextGlyph;
import com.fr.chart.chartglyph.TitleGlyph;
import com.fr.chart.chartglyph.TrendLineGlyph;
import com.fr.chart.chartglyph.ValueAxisGlyph;
import com.fr.design.chart.gui.active.ActiveGlyph;
import com.fr.design.chart.gui.active.AlertValueActiveGlyph;
import com.fr.design.chart.gui.active.CategoryAxisActiveGlyph;
import com.fr.design.chart.gui.active.ChartActiveGlyph;
import com.fr.design.chart.gui.active.DataLabelActiveGlyph;
import com.fr.design.chart.gui.active.DataSeriesActiveGlyph;
import com.fr.design.chart.gui.active.DataSheetActiveGlyph;
import com.fr.design.chart.gui.active.DateAxisActiveGlyph;
import com.fr.design.chart.gui.active.LegendActiveGlyph;
import com.fr.design.chart.gui.active.PlotActiveGlyph;
import com.fr.design.chart.gui.active.RadarAxisActiveGlyph;
import com.fr.design.chart.gui.active.RangeAxisActiveGlyph;
import com.fr.design.chart.gui.active.TextActiveGlyph;
import com.fr.design.chart.gui.active.TrendLineActiveGlyph;
import com.fr.design.chart.gui.active.ValueAxisActiveGlyph;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-23
* Time : 上午9:08
*/
public class ActiveGlyphFactory {
private static Map<String, Class> glyphMap = new HashMap<String, Class>();
static {
glyphMap.put(DataSeries.class.getName(), DataSeriesActiveGlyph.class);
glyphMap.put(RadarAxisGlyph.class.getName(), RadarAxisActiveGlyph.class);
glyphMap.put(RangeAxisGlyph.class.getName(), RangeAxisActiveGlyph.class);
glyphMap.put(TitleGlyph.class.getName(), TextActiveGlyph.class);
glyphMap.put(DateAxisGlyph.class.getName(), DateAxisActiveGlyph.class);
glyphMap.put(ValueAxisGlyph.class.getName(), ValueAxisActiveGlyph.class);
glyphMap.put(CategoryAxisGlyph.class.getName(), CategoryAxisActiveGlyph.class);
glyphMap.put(ChartGlyph.class.getName(), ChartActiveGlyph.class);
glyphMap.put(DataSheetGlyph.class.getName(), DataSheetActiveGlyph.class);
glyphMap.put(LegendGlyph.class.getName(), LegendActiveGlyph.class);
glyphMap.put(TextGlyph.class.getName(), DataLabelActiveGlyph.class);
glyphMap.put(TrendLineGlyph.class.getName(), TrendLineActiveGlyph.class);
glyphMap.put(ChartAlertValueGlyph.class.getName(), AlertValueActiveGlyph.class);
}
private ActiveGlyphFactory() {
}
public static ActiveGlyph createActiveGlyph(ChartComponent chartComponent, Object glyph) {
return createActiveGlyph(chartComponent, glyph, null);
}
public static ActiveGlyph createActiveGlyph(ChartComponent chartComponent, Object glyph, Glyph parentGlyph) {
if (glyph == null) {
return null;
}
String clsName = glyph.getClass().getName();
Class cls = glyphMap.get(clsName);
Class parameterCls = glyph.getClass();
if (cls == null) {
if (clsName.endsWith("PlotGlyph")) {
cls = PlotActiveGlyph.class;
parameterCls = PlotGlyph.class;
} else if (clsName.endsWith("DataSeries4Area")) {
cls = DataSeriesActiveGlyph.class;
parameterCls = DataSeries.class;
} else {
cls = ChartActiveGlyph.class;
parameterCls = ChartGlyph.class;
}
}
try {
Class[] argsClass = new Class[]{ChartComponent.class, parameterCls, Glyph.class};
return (ActiveGlyph) cls.getConstructor(argsClass).newInstance(new Object[]{chartComponent, glyph, parentGlyph});
} catch (Exception e) {
return null;
}
}
}

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

@ -2,36 +2,26 @@ package com.fr.design.chart.gui;
import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChartCollection;
import com.fr.base.chart.BaseChartGlyph;
import com.fr.base.chart.BaseChartPainter;
import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.base.chart.result.WebChartIDInfo;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartglyph.AxisGlyph;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.chart.gui.active.ActiveGlyph;
import com.fr.design.chart.gui.active.ChartActiveGlyph;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.script.Calculator;
import com.fr.stable.core.PropertyChangeListener;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Paint;
import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
import java.util.ArrayList;
import java.util.List;
@ -45,21 +35,10 @@ 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 Chart editingChart;
private BaseChartGlyph chartGlyph;
private int chartWidth = -1;
private int chartHeight = -1;
private Point point;
private int resolution = ScreenResolution.getScreenResolution();
private ActiveGlyph activeGlyph;
private boolean supportEdit = true;
private final int[] resizeCursors = new int[]{
Cursor.NW_RESIZE_CURSOR, Cursor.N_RESIZE_CURSOR, Cursor.NE_RESIZE_CURSOR,
Cursor.E_RESIZE_CURSOR, Cursor.W_RESIZE_CURSOR,
Cursor.SE_RESIZE_CURSOR, Cursor.S_RESIZE_CURSOR, Cursor.SW_RESIZE_CURSOR
};
private boolean supportEdit = true;
public ChartComponent() {
super();
@ -111,16 +90,9 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
public void reset() {
fireStopEditing();
this.editingChart = null;
this.chartGlyph = null;
this.activeGlyph = null;
this.point = null;
this.chartHeight = this.chartWidth = -1;
this.editingChart = this.chartCollection4Design.getSelectedChart();
refreshChartGlyph();
this.activeGlyph = ActiveGlyphFactory.createActiveGlyph(this, chartGlyph);
repaint();
}
@ -162,14 +134,6 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
return (this.chartCollection4Design == null) ? 0 : this.chartCollection4Design.getChartCount();
}
public ChartProvider getEditingChart() {
return editingChart;
}
public BaseChartGlyph getChartGlyph() {
return chartGlyph;
}
public void paintComponent(Graphics g) { //
super.paintComponent(g);
@ -192,12 +156,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
//画图
drawChartGlyph(g2d);
ActiveGlyph ag = this.getActiveGlyph();
if (ag != null) {
ag.paint4ActiveGlyph(g2d, chartGlyph);
}
drawChart(g2d);
g2d.translate(-ChartConstants.PREGAP4BOUNDS/2, -ChartConstants.PREGAP4BOUNDS/2);
if (lastHint == null) {
@ -212,24 +171,10 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
*/
private void refreshChartGlyph() {
Dimension d = getBounds().getSize();
this.editingChart = this.chartCollection4Design.getSelectedChart();// kunsnat: 切换选中时 同步切换Plot
if (editingChart != null) {
this.chartGlyph = editingChart.createGlyph(editingChart.defaultChartData());
this.activeGlyph = ActiveGlyphFactory.createActiveGlyph(this, chartGlyph);
}
this.chartWidth = d.width - ChartConstants.PREGAP4BOUNDS;
this.chartHeight = d.height - ChartConstants.PREGAP4BOUNDS;
}
private ActiveGlyph getActiveGlyph() {
if (point == null) {
this.activeGlyph = new ChartActiveGlyph(this, chartGlyph);
} else {
this.activeGlyph = new ChartActiveGlyph(this, chartGlyph).findActionGlyphFromChildren(point.x, point.y);
}
return this.activeGlyph;
}
/**
* 鼠标点击
* @param event 鼠标事件
@ -243,16 +188,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
* @param e 鼠标事件
*/
public void mousePressed(MouseEvent e) {
point = new Point(e.getX(),e.getY());
if (!ArrayUtils.contains(resizeCursors, this.getCursor().getType())) {
this.activeGlyph = new ChartActiveGlyph(this, chartGlyph).findActionGlyphFromChildren(point.x, point.y);
}
if (this.activeGlyph == null) {
return;
}
repaint();
}
@ -291,47 +227,23 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
* @param e 鼠标事件
*/
public void mouseMoved(MouseEvent e) {
ActiveGlyph ag = this.getActiveGlyph();
if (ag != null) {
ag.onMouseMove(e);
}
}
public AxisGlyph getActiveAxisGlyph() {
return (AxisGlyph) activeGlyph.getGlyph();
}
public Axis getActiveAxis() {
AxisGlyph axisGlyph = getActiveAxisGlyph();
if (editingChart.getPlot() != null) {
return editingChart.getPlot().getAxis(axisGlyph.getAxisType());
}
return null;
}
private boolean needRefreshChartGlyph() {
return chartGlyph == null || chartWidth != this.getBounds().width || chartHeight != this.getBounds().height;
return chartWidth != this.getBounds().width || chartHeight != this.getBounds().height;
}
public void drawChartGlyph(Graphics2D g2d) {
if (chartGlyph != null) {
if (chartGlyph.isRoundBorder()) {
chartGlyph.setBounds(new RoundRectangle2D.Double(0, 0, chartWidth, chartHeight, 10, 10));
} else {
chartGlyph.setBounds(new Rectangle2D.Double(0, 0, chartWidth, chartHeight));
}
private void drawChart(Graphics2D g2d) {
if (chartCollection4Design != null) {
//不直接画chartGlyph而画image的原因是表单的柱形图会溢出表单
//其他图都ok,其实感觉应该是柱形图画的不对,应该也可以改那边
//处理画图事件
BaseChartPainter painter = chartCollection4Design.createResultChartPainter(Calculator.createCalculator(),
WebChartIDInfo.createEmptyDesignerInfo(), chartWidth, chartHeight);
resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution();
int resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution();
if (resolution == 0){
resolution = ScreenResolution.getScreenResolution();
}
Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,resolution, this, null);
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);

161
designer-chart/src/main/java/com/fr/design/chart/gui/active/ActiveGlyph.java

@ -1,161 +0,0 @@
package com.fr.design.chart.gui.active;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.event.MouseEvent;
import java.awt.geom.Point2D;
import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChartGlyph;
import com.fr.base.chart.Glyph;
import com.fr.design.chart.gui.ActiveGlyphFactory;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:51
* 选中的Glyph
*/
public abstract class ActiveGlyph {
protected Glyph parentGlyph;
protected ChartComponent chartComponent;
public ActiveGlyph(ChartComponent chartComponent, Glyph parentGlyph) {
this.chartComponent = chartComponent;
this.parentGlyph = parentGlyph;
}
public abstract Glyph getGlyph();
public void drawAllGlyph(Graphics2D g2d, int resolution){
Point2D offset4Paint = offset4Paint();
g2d.translate(offset4Paint.getX(), offset4Paint.getY());
this.getGlyph().draw(g2d, resolution);
g2d.translate(-offset4Paint.getX(), -offset4Paint.getY());
};
/**
* 属性表中, 通过点击 展开到对应的界面.
*/
public abstract void goRightPane();
/**
* 画的偏移的
* @return 偏移的
*/
public Point2D offset4Paint() {
return new Point2D.Double(
this.parentGlyph.getShape().getBounds().getX(),
this.parentGlyph.getShape().getBounds().getY()
);
}
public void paint4ActiveGlyph(Graphics2D g2d, BaseChartGlyph chartGlyph) {
if(this.parentGlyph == null) {
return;
}
Paint oldPaint = g2d.getPaint();
Composite oldComposite = g2d.getComposite();
g2d.setPaint(Color.WHITE);
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
g2d.fill(chartGlyph.getShape());
drawAllGlyph(g2d, ScreenResolution.getScreenResolution());
g2d.setPaint(oldPaint);
g2d.setComposite(oldComposite);
}
protected void drawSelectedBounds4Active(Graphics2D g2d) {
if (this.getGlyph() != null) {
Shape shape = this.getGlyph().getShape();
if (shape != null) {
g2d.draw(shape);
}
}
}
/**
*当前的ActiveGlyph是否包含坐标mouseX, mouseY
* @param mouseX 坐标X
* @param mouseY 坐标Y
* @return 包含则返回true
*/
public boolean contains(int mouseX, int mouseY) {
if (getGlyph() == null || getGlyph().getShape() == null){
return false;
}
Point2D offset = this.offset4Paint();
/*
* alex:因为Line2D.contains(x, y)必然返回false
* 所以用intersect一个区域,这个区域大小用4 * 4的,区域大一些,就灵敏一些
*/
return getGlyph().getShape().intersects(mouseX - offset.getX() - 2, mouseY - offset.getY() - 2, 4, 4);
}
/**
* 在当前选中的ActiveGlyph中,仅仅在其Children中找与mouseX, mouseY匹配的ActiveGlyph
* @param mouseX 坐标X
* @param mouseY 坐标Y
* @return 当前ativeGlyph
*/
public ActiveGlyph findActionGlyphFromChildren(int mouseX, int mouseY) {
Glyph currentGlyph = getGlyph();
// 报错应对.
if (currentGlyph == null) {
return null;
}
java.util.Iterator selectableChildren = currentGlyph.selectableChildren();
ActiveGlyph resAG = null;
while (selectableChildren.hasNext() && resAG == null) {
ActiveGlyph childActiveGlyph = ActiveGlyphFactory.createActiveGlyph(chartComponent, selectableChildren.next(), currentGlyph);
// 如果childActiveGlyph不为null,找一下其子辈有没有符合条件
if (childActiveGlyph != null) {
resAG = childActiveGlyph.findActionGlyphFromChildren(mouseX, mouseY);
}
// 如果childActiveGlyph的子辈没有符合条件的,就看一下这个childGlyph是否符合条件
if (resAG == null && childActiveGlyph != null && childActiveGlyph.contains(mouseX, mouseY)) {
resAG = childActiveGlyph;
}
}
// 如果当前ActiveGlyph的所有子辈都没有与mouseX, mouseY相匹配的,看一下它自己是否匹配
if (resAG == null) {
if (this.contains(mouseX, mouseY)) {
resAG = this;
}
}
return resAG;
}
/**
* 拖拽
* @param e 事件
*/
public void onMouseDragged(MouseEvent e) {
}
/**
* 移动事件
* @param e 事件
*/
public void onMouseMove(MouseEvent e) {
}
}

38
designer-chart/src/main/java/com/fr/design/chart/gui/active/AlertValueActiveGlyph.java

@ -1,38 +0,0 @@
package com.fr.design.chart.gui.active;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.ChartAlertValueGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetAnalysisLineStyleAction;
public class AlertValueActiveGlyph extends ActiveGlyph{
ChartAlertValueGlyph alertValueGlyph;
public AlertValueActiveGlyph(ChartComponent chartComponent,ChartAlertValueGlyph alertLine, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.alertValueGlyph = alertLine;
}
public Point2D offset4Paint() {
Rectangle2D valueAxisBoudns = this.alertValueGlyph.getValueAxisGlyph().getBounds();
return new Point2D.Double(
this.parentGlyph.getShape().getBounds().getX() + valueAxisBoudns.getX(),
this.parentGlyph.getShape().getBounds().getY() + valueAxisBoudns.getY()
);
}
@Override
public Glyph getGlyph() {
return this.alertValueGlyph;
}
@Override
public void goRightPane() {
new SetAnalysisLineStyleAction(chartComponent).showAnalysisLineStylePane();
}
}

43
designer-chart/src/main/java/com/fr/design/chart/gui/active/AxisActiveGlyph.java

@ -1,43 +0,0 @@
package com.fr.design.chart.gui.active;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.AxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetAxisStyleAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:00
*/
public abstract class AxisActiveGlyph extends ActiveGlyph {
protected AxisGlyph axis;
public AxisActiveGlyph(ChartComponent chartComponent, AxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.axis = axis;
}
public void drawAllGlyph(Graphics2D g2d, int resolution){
Point2D offset4Paint = offset4Paint();
g2d.translate(offset4Paint.getX(), offset4Paint.getY());
this.axis.drawWithOutAlert(g2d, resolution);
g2d.translate(-offset4Paint.getX(), -offset4Paint.getY());
};
public void goRightPane() {
new SetAxisStyleAction(chartComponent).showAxisStylePane();
}
/**
* 返回 对应的属性Axis
*/
public Glyph getGlyph() {
return this.axis;
}
}

19
designer-chart/src/main/java/com/fr/design/chart/gui/active/CategoryAxisActiveGlyph.java

@ -1,19 +0,0 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.CategoryAxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:01
*/
public class CategoryAxisActiveGlyph extends AxisActiveGlyph {
public CategoryAxisActiveGlyph(ChartComponent chartComponent, CategoryAxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, axis, parentGlyph);
}
}

39
designer-chart/src/main/java/com/fr/design/chart/gui/active/ChartActiveGlyph.java

@ -1,39 +0,0 @@
package com.fr.design.chart.gui.active;
import java.awt.geom.Point2D;
import com.fr.base.chart.BaseChartGlyph;
import com.fr.base.chart.Glyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetChartStyleAciton;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:54
*/
public class ChartActiveGlyph extends ActiveGlyph {
private BaseChartGlyph glyphChart;
public ChartActiveGlyph(ChartComponent chartComponent, BaseChartGlyph chart) {
this(chartComponent, chart, null);
}
public ChartActiveGlyph(ChartComponent chartComponent, BaseChartGlyph chart, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.glyphChart = chart;
}
public Glyph getGlyph() {
return this.glyphChart;
}
public Point2D offset4Paint() {
return new java.awt.Point(0, 0);
}
public void goRightPane() {
new SetChartStyleAciton(chartComponent).showChartStylePane();
}
}

44
designer-chart/src/main/java/com/fr/design/chart/gui/active/DataLabelActiveGlyph.java

@ -1,44 +0,0 @@
package com.fr.design.chart.gui.active;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.chart.chartglyph.TextGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetDataLabelStyleAction;
public class DataLabelActiveGlyph extends ActiveGlyph{
private TextGlyph dataLabel;
public DataLabelActiveGlyph(ChartComponent chartComponent, TextGlyph dataLabel, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.dataLabel = dataLabel;
}
public void drawAllGlyph(Graphics2D g2d, int resolution){
Point2D offset4Paint = offset4Paint();
g2d.translate(offset4Paint.getX(), offset4Paint.getY());
ArrayList<TextGlyph> allDataPointLableGlyph = new ArrayList<TextGlyph>();
PlotGlyph plotGlyph = (PlotGlyph)(this.parentGlyph);
plotGlyph.getAllDataPointGlyph(allDataPointLableGlyph);
for(int index = 0; index < allDataPointLableGlyph.size(); index++){
allDataPointLableGlyph.get(index).draw(g2d, resolution);
}
g2d.translate(-offset4Paint.getX(), -offset4Paint.getY());
};
@Override
public Glyph getGlyph() {
return this.dataLabel;
}
@Override
public void goRightPane() {
new SetDataLabelStyleAction(chartComponent).showDataLabelStylePane();
}
}

53
designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSeriesActiveGlyph.java

@ -1,53 +0,0 @@
package com.fr.design.chart.gui.active;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.DataSeries;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:59
*/
public class DataSeriesActiveGlyph extends ActiveGlyph {
private DataSeries series;
public DataSeriesActiveGlyph(ChartComponent chartComponent, DataSeries series, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.series = series;
}
public Glyph getGlyph() {
return this.series;
}
/**
* 界面条状
*/
public void goRightPane() {
if(chartComponent.getEditingChart() == null) {
return;
}
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_SERIES_TITLE);
}
@Override
public void drawAllGlyph(Graphics2D g2d, int resolution) {
Point2D offset4Paint = offset4Paint();
g2d.translate(offset4Paint.getX(), offset4Paint.getY());
if(this.parentGlyph != null && this.parentGlyph instanceof PlotGlyph){
PlotGlyph plotGlyph = (PlotGlyph)this.parentGlyph;
plotGlyph.drawShape4Series(g2d, resolution);
}
g2d.translate(-offset4Paint.getX(), -offset4Paint.getY());
}
}

30
designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSheetActiveGlyph.java

@ -1,30 +0,0 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.DataSheetGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetDataSheetAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:57
*/
public class DataSheetActiveGlyph extends ActiveGlyph {
private DataSheetGlyph dataSheetGlyph;
public DataSheetActiveGlyph(ChartComponent chartComponent, DataSheetGlyph dataSheetGlyph, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.dataSheetGlyph = dataSheetGlyph;
}
public Glyph getGlyph() {
return this.dataSheetGlyph;
}
public void goRightPane() {
new SetDataSheetAction(chartComponent).showDataSheetStylePane();
}
}

18
designer-chart/src/main/java/com/fr/design/chart/gui/active/DateAxisActiveGlyph.java

@ -1,18 +0,0 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.DateAxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:03
*/
public class DateAxisActiveGlyph extends AxisActiveGlyph {
public DateAxisActiveGlyph(ChartComponent chartComponent, DateAxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, axis, parentGlyph);
}
}

30
designer-chart/src/main/java/com/fr/design/chart/gui/active/LegendActiveGlyph.java

@ -1,30 +0,0 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.LegendGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetLegendStyleAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:58
*/
public class LegendActiveGlyph extends ActiveGlyph {
private LegendGlyph legendGlyph;
public LegendActiveGlyph(ChartComponent chartComponent, LegendGlyph legendGlyph, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.legendGlyph = legendGlyph;
}
public Glyph getGlyph() {
return this.legendGlyph;
}
public void goRightPane() {
new SetLegendStyleAction(chartComponent).showLegendStylePane();
}
}

34
designer-chart/src/main/java/com/fr/design/chart/gui/active/PlotActiveGlyph.java

@ -1,34 +0,0 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetPlotStyleAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:55
*/
public class PlotActiveGlyph extends ActiveGlyph {
private PlotGlyph plotGlyph;
public PlotActiveGlyph(ChartComponent chartComponent, PlotGlyph plotGlyph, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.plotGlyph = plotGlyph;
}
public Glyph getGlyph() {
return this.plotGlyph;
}
public void goRightPane() {
new SetPlotStyleAction(chartComponent).showPlotPane();
}
public java.awt.Point offset4Paint() {
return new java.awt.Point(0, 0);
}
}

18
designer-chart/src/main/java/com/fr/design/chart/gui/active/RadarAxisActiveGlyph.java

@ -1,18 +0,0 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.RadarAxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:03
*/
public class RadarAxisActiveGlyph extends AxisActiveGlyph {
public RadarAxisActiveGlyph(ChartComponent chartComponent, RadarAxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, axis, parentGlyph);
}
}

18
designer-chart/src/main/java/com/fr/design/chart/gui/active/RangeAxisActiveGlyph.java

@ -1,18 +0,0 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.ValueAxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:02
*/
public class RangeAxisActiveGlyph extends AxisActiveGlyph {
public RangeAxisActiveGlyph(ChartComponent chartComponent, ValueAxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, axis, parentGlyph);
}
}

35
designer-chart/src/main/java/com/fr/design/chart/gui/active/TextActiveGlyph.java

@ -1,35 +0,0 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.TitleGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetTitleStyleAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:57
*/
public class TextActiveGlyph extends ActiveGlyph {
private TitleGlyph titleGlyph;
public TextActiveGlyph(ChartComponent chartComponent, TitleGlyph titleGlyph, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.titleGlyph = titleGlyph;
}
public Glyph getGlyph() {
return this.titleGlyph;
}
public java.awt.Point offset4Paint() {
return new java.awt.Point(0, 0);
}
public void goRightPane() {
new SetTitleStyleAction(chartComponent).showTitlePane();
}
}

43
designer-chart/src/main/java/com/fr/design/chart/gui/active/TrendLineActiveGlyph.java

@ -1,43 +0,0 @@
package com.fr.design.chart.gui.active;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.List;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.chart.chartglyph.TrendLineGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetAnalysisLineStyleAction;
public class TrendLineActiveGlyph extends ActiveGlyph{
private TrendLineGlyph trendLine;
public TrendLineActiveGlyph(ChartComponent chartComponent,TrendLineGlyph trendLine, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.trendLine = trendLine;
}
@Override
public Glyph getGlyph() {
return this.trendLine;
}
public void drawAllGlyph(Graphics2D g2d, int resolution){
Point2D offset4Paint = offset4Paint();
g2d.translate(offset4Paint.getX(), offset4Paint.getY());
PlotGlyph plotGlyph = (PlotGlyph)this.parentGlyph;
List<TrendLineGlyph> list = new ArrayList<TrendLineGlyph>();
plotGlyph.getAllTrendLineGlyph(list);
for(int index = 0; index < list.size(); index++){
list.get(index).draw(g2d, resolution);
}
g2d.translate(-offset4Paint.getX(), -offset4Paint.getY());
};
@Override
public void goRightPane() {
new SetAnalysisLineStyleAction(chartComponent).showAnalysisLineStylePane();
}
}

19
designer-chart/src/main/java/com/fr/design/chart/gui/active/ValueAxisActiveGlyph.java

@ -1,19 +0,0 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.ValueAxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:02
*/
public class ValueAxisActiveGlyph extends AxisActiveGlyph {
public ValueAxisActiveGlyph(ChartComponent chartComponent, ValueAxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, axis, parentGlyph);
}
}

37
designer-chart/src/main/java/com/fr/design/chart/gui/active/action/ChartComponentAction.java

@ -1,37 +0,0 @@
package com.fr.design.chart.gui.active.action;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartglyph.AxisGlyph;
import com.fr.design.actions.UpdateAction;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午5:05
*/
public abstract class ChartComponentAction extends UpdateAction {
protected ChartComponent chartComponent;
public ChartComponentAction(ChartComponent chartComponent) {
this.chartComponent = chartComponent;
}
public void reset() {
chartComponent.reset();
}
public void repaint() {
chartComponent.repaint();
}
public ChartCollection getChartCollection() {
return chartComponent.getChartCollection();
}
public AxisGlyph getActiveAxisGlyph() {
return chartComponent.getActiveAxisGlyph();
}
}

27
designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAnalysisLineStyleAction.java

@ -1,27 +0,0 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
public class SetAnalysisLineStyleAction extends ChartComponentAction{
public SetAnalysisLineStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Analysis_Line"));
}
@Override
public void actionPerformed(ActionEvent e) {
showAnalysisLineStylePane();
}
public void showAnalysisLineStylePane(){
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LINE_TITLE);
}
}

33
designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAxisStyleAction.java

@ -1,33 +0,0 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
import com.fr.stable.StringUtils;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午5:10
*/
public class SetAxisStyleAction extends ChartComponentAction {
public SetAxisStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Axis_Format"));
}
public void actionPerformed(ActionEvent e) {
showAxisStylePane();
}
public void showAxisStylePane() {
String axisType = getActiveAxisGlyph() == null ? StringUtils.EMPTY : getActiveAxisGlyph().getAxisType();
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AXIS_TITLE, axisType);
}
}

31
designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetChartStyleAciton.java

@ -1,31 +0,0 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午5:00
*/
public class SetChartStyleAciton extends ChartComponentAction {
public SetChartStyleAciton(ChartComponent chartComponent) {
super(chartComponent);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Pattern"));
}
public void actionPerformed(ActionEvent e) {
showChartStylePane();
}
public void showChartStylePane() {
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AREA_TITLE, PaneTitleConstants.CHART_STYLE_AREA_AREA_TITLE);
}
}

26
designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataLabelStyleAction.java

@ -1,26 +0,0 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
public class SetDataLabelStyleAction extends ChartComponentAction{
public SetDataLabelStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Data_Label"));
}
@Override
public void actionPerformed(ActionEvent e) {
showDataLabelStylePane();
}
public void showDataLabelStylePane() {
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LABEL_TITLE);
}
}

33
designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataSheetAction.java

@ -1,33 +0,0 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:49
*/
public class SetDataSheetAction extends ChartComponentAction {
private static final long serialVersionUID = -4763886493273213850L;
public SetDataSheetAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Data_Sheet"));
}
public void actionPerformed(ActionEvent e) {
showDataSheetStylePane();
}
public void showDataSheetStylePane() {
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_DATA_TITLE);
}
}

32
designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetLegendStyleAction.java

@ -1,32 +0,0 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:56
*/
public class SetLegendStyleAction extends ChartComponentAction {
private static final long serialVersionUID = 3253190503195130478L;
public SetLegendStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Legend_Sytle"));
}
public void actionPerformed(ActionEvent e) {
showLegendStylePane();
}
public void showLegendStylePane() {
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LEGNED_TITLE);
}
}

32
designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetPlotStyleAction.java

@ -1,32 +0,0 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:58
*/
public class SetPlotStyleAction extends ChartComponentAction {
private static final long serialVersionUID = 2894127568015714372L;
public SetPlotStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Plot"));
}
public void actionPerformed(ActionEvent e) {
showPlotPane();
}
public void showPlotPane() {
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AREA_TITLE, PaneTitleConstants.CHART_STYLE_AREA_PLOT_TITLE);
}
}

32
designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetTitleStyleAction.java

@ -1,32 +0,0 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:52
*/
public class SetTitleStyleAction extends ChartComponentAction {
private static final long serialVersionUID = -4763886493273213850L;
public SetTitleStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Title_Style"));
}
public void actionPerformed(ActionEvent e) {
showTitlePane();
}
public void showTitlePane() {
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_TITLE_TITLE);
}
}

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);

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

@ -0,0 +1,23 @@
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());
}
}

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);

86
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java

@ -0,0 +1,86 @@
package com.fr.design.chartx.fields.diff;
import com.fr.chartx.data.field.diff.StructureColumnFieldCollection;
import com.fr.design.chartx.fields.AbstractCellDataFieldsPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import java.awt.Component;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2019-09-02
*/
public class StructureCellDataFieldsPane extends AbstractCellDataFieldsPane<StructureColumnFieldCollection> {
private TinyFormulaPane nodeName;
private TinyFormulaPane nodeId;
private TinyFormulaPane parentId;
private UITextField seriesName;
private TinyFormulaPane nodeValue;
@Override
protected void initComponents() {
seriesName = new UITextField();
nodeName = new TinyFormulaPane();
nodeId = new TinyFormulaPane();
parentId = new TinyFormulaPane();
nodeValue = new TinyFormulaPane();
super.initComponents();
}
@Override
protected String[] fieldLabels() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Node_Name"),
"id",
Toolkit.i18nText("Fine-Design_Chart_Parent_ID"),
Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"),
Toolkit.i18nText("Fine-Design_Chart_Series_Value"),
};
}
@Override
protected TinyFormulaPane[] formulaPanes() {
return new TinyFormulaPane[]{
nodeName,
nodeId,
parentId,
nodeValue
};
}
@Override
protected Component[] fieldComponents() {
return new Component[]{
nodeName,
nodeId,
parentId,
nodeValue,
nodeValue,
};
}
@Override
public void populateBean(StructureColumnFieldCollection ob) {
seriesName.setText(ob.getSeriesName());
populateField(nodeName, ob.getNodeName());
populateField(nodeId, ob.getNodeId());
populateField(parentId, ob.getParentId());
populateField(nodeValue, ob.getNodeValue());
}
@Override
public StructureColumnFieldCollection updateBean() {
StructureColumnFieldCollection result = new StructureColumnFieldCollection();
result.setSeriesName(seriesName.getText());
updateField(nodeName, result.getNodeName());
updateField(nodeId, result.getNodeId());
updateField(parentId, result.getParentId());
updateField(nodeValue, result.getNodeValue());
return result;
}
}

91
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java

@ -0,0 +1,91 @@
package com.fr.design.chartx.fields.diff;
import com.fr.chartx.data.field.diff.StructureColumnFieldCollection;
import com.fr.design.chartx.fields.AbstractDataSetFieldsPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import java.awt.Component;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2019-09-02
*/
public class StructureDataSetFieldsPane extends AbstractDataSetFieldsPane<StructureColumnFieldCollection> {
private UIComboBox nodeName;
private UIComboBox nodeId;
private UIComboBox parentId;
private UITextField seriesName;
private UIComboBox nodeValue;
private CalculateComboBox calculateCombox;
@Override
protected void initComponents() {
nodeName = new UIComboBox();
nodeId = new UIComboBox();
parentId = new UIComboBox();
seriesName = new UITextField();
nodeValue = new UIComboBox();
calculateCombox = new CalculateComboBox();
super.initComponents();
}
@Override
protected String[] fieldLabels() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Node_Name"),
"id",
Toolkit.i18nText("Fine-Design_Chart_Parent_ID"),
Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"),
Toolkit.i18nText("Fine-Design_Chart_Series_Value"),
Toolkit.i18nText("Fine-Design_Chart_Summary_Method")
};
}
@Override
protected UIComboBox[] filedComboBoxes() {
return new UIComboBox[]{
nodeName,
nodeId,
parentId,
nodeValue
};
}
@Override
protected Component[] fieldComponents() {
return new Component[]{
nodeName,
nodeId,
parentId,
nodeValue,
nodeValue,
calculateCombox
};
}
@Override
public void populateBean(StructureColumnFieldCollection ob) {
seriesName.setText(ob.getSeriesName());
populateField(nodeName, ob.getNodeName());
populateField(nodeId, ob.getNodeId());
populateField(parentId, ob.getParentId());
populateFunctionField(nodeValue, calculateCombox, ob.getNodeValue());
}
@Override
public StructureColumnFieldCollection updateBean() {
StructureColumnFieldCollection result = new StructureColumnFieldCollection();
result.setSeriesName(seriesName.getText());
updateField(nodeName, result.getNodeName());
updateField(nodeId, result.getNodeId());
updateField(parentId, result.getParentId());
updateFunctionField(nodeValue, calculateCombox, result.getNodeValue());
return result;
}
}

2
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java

@ -64,7 +64,7 @@ public class WordCloudCellDataFieldsPane extends AbstractCellDataFieldsPane<Word
WordCloudColumnFieldCollection result = new WordCloudColumnFieldCollection();
result.setTargetName(name.getText());
updateField(wordName, result.getWordName());
populateField(wordValue, result.getWordValue());
updateField(wordValue, result.getWordValue());
return result;
}
}

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

@ -309,6 +309,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());
}
}

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);
}
}

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

@ -37,8 +37,8 @@ public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVan
return VanChartColumnPlotPane.TITLE;
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new MultiCategoryChartDataPane(listener);
}
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new MultiCategoryChartDataPane(listener);
// }
}

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

@ -55,7 +55,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");
}

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

@ -60,7 +60,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");
}

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

@ -146,6 +146,9 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
}
}
Plot cloned = null;
if (null == newPlot) {
return cloned;
}
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {

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

@ -26,10 +26,10 @@ public class MultiPieIndependentVanChartInterface extends AbstractIndependentVan
return "com/fr/design/images/form/toolbar/multiPie.png";
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new MultiPieChartDataPane(listener);
}
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new MultiPieChartDataPane(listener);
// }
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartMultiPieSeriesPane(parent, plot);

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

@ -49,6 +49,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);

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

@ -62,6 +62,9 @@ public class VanChartPiePlotPane 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/radar/VanChartRadarPlotPane.java

@ -59,6 +59,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);

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

@ -61,6 +61,9 @@ public class VanChartScatterPlotPane extends AbstractVanChartTypePane {
}
}
Plot cloned = null;
if (null == newPlot) {
return cloned;
}
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {

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

@ -11,7 +11,6 @@ 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.chart.base.VanChartConstants;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane;
@ -81,4 +80,9 @@ public class StructureIndependentVanChartInterface extends AbstractIndependentVa
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartStructureConditionPane(plot);
}
/* @Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new StructureChartDataPane(listener);
}*/
}

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

@ -57,6 +57,9 @@ public class VanChartStructureTypePane 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/treemap/VanChartTreeMapPlotPane.java

@ -45,6 +45,9 @@ public class VanChartTreeMapPlotPane extends VanChartMultiPiePlotPane {
}
Plot cloned = null;
if (null == newPlot) {
return cloned;
}
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {

8
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java

@ -91,8 +91,8 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa
return VanChartWordCloudTypePane.TITLE;
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new WordCloudChartDataPane(listener);
}
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new WordCloudChartDataPane(listener);
// }
}

3
designer-form/src/main/java/com/fr/design/designer/beans/AdapterBus.java

@ -41,6 +41,9 @@ public class AdapterBus {
*/
public static ComponentAdapter getComponentAdapter(FormDesigner designer, JComponent creator) {
JComponent jcomponent = getJComponent(creator);
if (null == jcomponent) {
return null;
}
ComponentAdapter adapter = (ComponentAdapter) jcomponent.getClientProperty("component.adapter");
if (adapter == null) {
adapter = new CompositeComponentAdapter(designer, creator);

28
designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

@ -176,16 +176,21 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
* @return 控件.
*/
public JComponent createToolPane(final BaseJForm jform, final FormDesigner formDesigner) {
getDesignerEditorTarget().addStopEditingListener(new PropertyChangeAdapter() {
public void propertyChange() {
JComponent pane = jform.getEditingPane();
if (pane instanceof BaseChartPropertyPane) {
((BaseChartPropertyPane) pane).setSupportCellData(true);
((BaseChartPropertyPane) pane).populateChartPropertyPane(getDesignerEditorTarget().update(), formDesigner);
MiddleChartComponent middleChartComponent = getDesignerEditorTarget();
if (null != middleChartComponent) {
middleChartComponent.addStopEditingListener(new PropertyChangeAdapter() {
public void propertyChange() {
JComponent pane = jform.getEditingPane();
if (pane instanceof BaseChartPropertyPane) {
((BaseChartPropertyPane) pane).setSupportCellData(true);
MiddleChartComponent middleChartComponent = getDesignerEditorTarget();
if (null != middleChartComponent) {
((BaseChartPropertyPane) pane).populateChartPropertyPane(middleChartComponent.update(), formDesigner);
}
}
}
}
});
});
}
if (isEditing){
final BaseChartPropertyPane propertyPane = DesignModuleFactory.getChartPropertyPane();
SwingUtilities.invokeLater(new Runnable() {
@ -193,7 +198,10 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
public void run() {
if (getDesignerEditor().getEditorTarget() != null) {
propertyPane.setSupportCellData(true);
propertyPane.populateChartPropertyPane(getDesignerEditorTarget().update(), formDesigner);
MiddleChartComponent middleChartComponent = getDesignerEditorTarget();
if (null != middleChartComponent) {
propertyPane.populateChartPropertyPane(middleChartComponent.update(), formDesigner);
}
}
}
});

7
designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java

@ -31,6 +31,7 @@ import com.fr.general.FRScreen;
import com.fr.general.IOUtils;
import com.fr.share.ShareConstants;
import com.fr.stable.AssistUtils;
import com.fr.stable.Constants;
import javax.swing.Icon;
@ -108,7 +109,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension scrnsize = toolkit.getScreenSize();
double screenValue = FRScreen.getByDimension(scrnsize).getValue();
if (screenValue != FormArea.DEFAULT_SLIDER) {
if (!AssistUtils.equals(screenValue, FormArea.DEFAULT_SLIDER)) {
this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER);
}
}
@ -167,7 +168,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
* 界面容器大小不是默认的时处理控件的BoundsWidget且避免出现空隙
*/
private Rectangle dealWidgetBound(Rectangle rec) {
if (containerPercent == 1.0) {
if (AssistUtils.equals(1.0, containerPercent)) {
return rec;
}
rec.x = (int) (rec.x / containerPercent);
@ -244,7 +245,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
@Override
public void updateChildBound(int minHeight) {
double prevContainerPercent = FRScreen.getByDimension(toData().getDesigningResolution()).getValue() / FormArea.DEFAULT_SLIDER;
if (toData().getCompState() == 0 && prevContainerPercent != containerPercent) {
if (toData().getCompState() == 0 && !AssistUtils.equals(containerPercent, prevContainerPercent)) {
for (int i = 0; i < this.getComponentCount(); i++) {
XCreator creator = getXCreator(i);
Rectangle rec = new Rectangle(creator.getBounds());

7
designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java

@ -21,6 +21,7 @@ import com.fr.form.ui.container.WLayout;
import com.fr.general.FRLogger;
import com.fr.general.FRScreen;
import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
import edu.emory.mathcs.backport.java.util.Arrays;
import javax.swing.JOptionPane;
@ -72,7 +73,7 @@ public class XWFitLayout extends XLayoutContainer {
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension scrnsize = toolkit.getScreenSize();
double screenValue = FRScreen.getByDimension(scrnsize).getValue();
if(screenValue != FormArea.DEFAULT_SLIDER){
if (!AssistUtils.equals(FormArea.DEFAULT_SLIDER, screenValue)) {
this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER);
}
}
@ -717,7 +718,7 @@ public class XWFitLayout extends XLayoutContainer {
* 界面容器大小不是默认的时处理控件的BoundsWidget且避免出现空隙
*/
private Rectangle dealWidgetBound(Rectangle rec) {
if (containerPercent == 1.0) {
if (AssistUtils.equals(1.0, containerPercent)) {
return rec;
}
rec.x = (int) (rec.x/containerPercent);
@ -731,7 +732,7 @@ public class XWFitLayout extends XLayoutContainer {
* 界面容器大小不是默认的时恢复组件实际大小
*/
private Rectangle dealWgtBound(Rectangle rec) {
if (containerPercent == 1.0) {
if (AssistUtils.equals(1.0, containerPercent)) {
return rec;
}
rec.x = (int) (rec.x * containerPercent);

18
designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java

@ -148,6 +148,9 @@ public class FormCreatorDropTarget extends DropTarget {
// 取消前一个焦点容器的提示渲染器
designer.setPainter(null);
}
if (container == null) {
throw new IllegalArgumentException("container can not be null!");
}
//获取painter的时候要考虑布局之间嵌套的问题
XLayoutContainer xLayoutContainer = container.getTopLayout();
if (xLayoutContainer != null && xLayoutContainer.getParent() != null
@ -215,7 +218,8 @@ public class FormCreatorDropTarget extends DropTarget {
*
* @param dtde 事件
*/
public void dragEnter(DropTargetDragEvent dtde) {
@Override
public synchronized void dragEnter(DropTargetDragEvent dtde) {
Point loc = dtde.getLocation();
this.entering(loc.x, loc.y);
}
@ -225,7 +229,8 @@ public class FormCreatorDropTarget extends DropTarget {
*
* @param dtde 事件
*/
public void dragOver(DropTargetDragEvent dtde) {
@Override
public synchronized void dragOver(DropTargetDragEvent dtde) {
Point loc = dtde.getLocation();
hovering(loc.x, loc.y);
}
@ -235,7 +240,8 @@ public class FormCreatorDropTarget extends DropTarget {
*
* @param dtde 事件
*/
public void dropActionChanged(DropTargetDragEvent dtde) {
@Override
public synchronized void dropActionChanged(DropTargetDragEvent dtde) {
}
/**
@ -243,7 +249,8 @@ public class FormCreatorDropTarget extends DropTarget {
*
* @param dte 事件
*/
public void dragExit(DropTargetEvent dte) {
@Override
public synchronized void dragExit(DropTargetEvent dte) {
this.exiting();
}
@ -252,7 +259,8 @@ public class FormCreatorDropTarget extends DropTarget {
*
* @param dtde 事件
*/
public void drop(DropTargetDropEvent dtde) {
@Override
public synchronized void drop(DropTargetDropEvent dtde) {
Point loc = dtde.getLocation();
this.adding(loc.x, loc.y);
//针对在表单中拖入一个控件直接ctrl+s无反应

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

@ -1368,6 +1368,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
Thread.sleep(1500);
} catch (InterruptedException e) {
FRLogger.getLogger().error(e.getMessage(), e);
Thread.currentThread().interrupt();
}
pane.setLayout(new BorderLayout());

2
designer-form/src/main/java/com/fr/design/mainframe/FormToolBar.java

@ -20,7 +20,7 @@ public class FormToolBar {
}
public void setButtonlist(List<FormToolBarButton> buttonlist) {
if (buttonlist == null || buttonlist.size() < 0) {
if (buttonlist == null) {
this.buttonlist = new ArrayList<FormToolBarButton>();
} else {
this.buttonlist = buttonlist;

2
designer-form/src/main/java/com/fr/design/mainframe/FormToolBarPane.java

@ -118,7 +118,7 @@ public class FormToolBarPane extends BasicBeanPane<ToolBar> {
}
private void setToolBar(List<FormToolBarButton> list) {
if (list == null || list.size() < 0) {
if (list == null) {
return;
}
this.removeAll();

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

@ -765,6 +765,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
Thread.sleep(1500);
} catch (InterruptedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
Thread.currentThread().interrupt();
}
JPanel pane = new JPanel();
pane.setLayout(new BorderLayout());

6
designer-form/src/main/java/com/fr/design/mainframe/widget/UITreeComboBox.java

@ -192,7 +192,11 @@ public class UITreeComboBox extends UIComboBox {
@Override
public boolean equals(Object o) {
return o.getClass() == this.getClass();
if (o != null) {
return o.getClass() == this.getClass();
} else {
return false;
}
}
}

4
designer-realize/src/main/java/com/fr/grid/GridRowUI.java

@ -7,7 +7,7 @@ import java.awt.geom.Rectangle2D;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import com.fr.stable.AssistUtils;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.GraphHelper;
@ -106,7 +106,7 @@ public class GridRowUI extends ComponentUI {
tmpHeight1 += tmpIncreaseHeight;
tmpIncreaseHeight = rowHeightList.get(i).toPixD(resolution);
// check these row wich height is zero.
tmpHeight2 = tmpIncreaseHeight == 0 ? tmpHeight1 + 1 : tmpHeight1 + tmpIncreaseHeight;
tmpHeight2 = AssistUtils.equals(tmpIncreaseHeight,0d) ? tmpHeight1 + 1 : tmpHeight1 + tmpIncreaseHeight;
// check selection bound.
Selection sel = reportPane.getSelection();
int[] selectedRows = sel.getSelectedRows();

9
designer-realize/src/main/java/com/fr/grid/GridUI.java

@ -47,6 +47,7 @@ import com.fr.stable.ColumnRow;
import com.fr.stable.Constants;
import com.fr.stable.script.CalculatorUtils;
import com.fr.stable.unit.FU;
import com.fr.stable.AssistUtils;
import com.fr.third.antlr.ANTLRException;
import javax.swing.JComponent;
@ -617,10 +618,10 @@ public class GridUI extends ComponentUI {
tmpLine2D = (Line2D) paginateLineList.get(j);// 直接强制转换,因为List中肯定都是Line2D型的
for (int k = j + 1; k < paginateLineList.size(); k++) {
tmpLine2D2 = (Line2D) paginateLineList.get(k);
if (tmpLine2D2.getX1() == tmpLine2D.getX1()
&& tmpLine2D2.getX2() == tmpLine2D.getX2()
&& tmpLine2D2.getY1() == tmpLine2D.getY1()
&& tmpLine2D2.getY2() == tmpLine2D.getY2()) {
if (AssistUtils.equals(tmpLine2D2.getX1() ,tmpLine2D.getX1())
&& AssistUtils.equals(tmpLine2D2.getX2() , tmpLine2D.getX2())
&& AssistUtils.equals(tmpLine2D2.getY1() , tmpLine2D.getY1())
&& AssistUtils.equals(tmpLine2D2.getY2() , tmpLine2D.getY2())) {
paginateLineList.remove(k);
}
}

27
designer-realize/src/main/java/com/fr/poly/PolyDesignUI.java

@ -47,7 +47,7 @@ import java.util.ArrayList;
*/
public class PolyDesignUI extends ComponentUI {
private static final Color PAGINATE_LINE_COLOR = Color.GRAY;
private static final double SCROLL_POINT = 50;
private static final int SCROLL_DISTANCE = 15;
private static final int TEN = 10;
@ -65,11 +65,11 @@ public class PolyDesignUI extends ComponentUI {
/**
* 从组件中获取设计器, 并赋值
*
*
* @param c 组件对象
*
*
* @date 2015-2-12-下午2:38:05
*
*
*/
public void installUI(JComponent c) {
designer = ((PolyArea) c).getPolyDesigner();
@ -137,7 +137,7 @@ public class PolyDesignUI extends ComponentUI {
}
}
}
private void changeForbiddenWindowVisibility(BlockCreator creator){
Rectangle pixRec = creator.getBounds();
boolean intersected = designer.intersectsAllBlock(creator);
@ -145,12 +145,12 @@ public class PolyDesignUI extends ComponentUI {
creator.getEditor().hideForbiddenWindow();
return;
}
int x = (int) (designer.getAreaLocationX() + pixRec.getCenterX()*time - designer.getHorizontalValue());
int y = (int) (designer.getAreaLocationY() + pixRec.getCenterY()*time - designer.getVerticalValue());
creator.getEditor().showForbiddenWindow(x, y);
}
private Rectangle getCreatorPixRectangle(BlockCreator creator, Point location){
int width = creator.getWidth();
int height = creator.getHeight();
@ -158,21 +158,22 @@ public class PolyDesignUI extends ComponentUI {
int resy = location.y - height / 2 + designer.getVerticalValue();
return new Rectangle(resx, resy, width, height);
}
@SuppressWarnings("squid:S2142")
private void scrollWhenCreatorAtCorner(final BlockCreator creator){
Thread scrollThread = new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(100);
int rightCornerX = creator.getX() + creator.getWidth();
int rightCornerY = creator.getY() + creator.getHeight();
JScrollBar horizonBar = designer.getHorizontalScrollBar();
JScrollBar verticalBar = designer.getVerticalScrollBar();
int scrollX = designer.getWidth() + horizonBar.getValue();
int scrollY = designer.getHeight() + verticalBar.getValue();
@ -180,7 +181,7 @@ public class PolyDesignUI extends ComponentUI {
if(rightCornerX > scrollX - SCROLL_POINT){
horizonBar.setValue(horizonBar.getValue() + SCROLL_DISTANCE);
}
if(rightCornerY > scrollY - SCROLL_POINT){
verticalBar.setValue(verticalBar.getValue() + SCROLL_DISTANCE);
}
@ -200,7 +201,7 @@ public class PolyDesignUI extends ComponentUI {
GraphHelper.drawString(g, convertUnit(y), 0, resy);
GraphHelper.drawString(g, convertUnit(x), resx, 10);
}
private String convertUnit(int i) {
short unit = designer.getRulerLengthUnit();
// int resolution = ScreenResolution.getScreenResolution();

37
designer-realize/src/main/java/com/fr/poly/creator/BlockCreator.java

@ -54,6 +54,9 @@ public abstract class BlockCreator<T extends TemplateBlock> extends JComponent i
@Override
public boolean equals(Object o) {
if (o == null) {
return false;
}
return ComparatorUtils.equals(o.getClass().getName(), this.getClass().getName());
}
});
@ -81,7 +84,7 @@ public abstract class BlockCreator<T extends TemplateBlock> extends JComponent i
//默认大小, 报表块默认3列6行, 图表块默认330*240
public abstract UnitRectangle getDefaultBlockBounds();
// 不同的Block有不同的显示器
protected abstract JComponent initMonitor();
@ -97,9 +100,9 @@ public abstract class BlockCreator<T extends TemplateBlock> extends JComponent i
/**
* 检测按钮状态
*
*
* @date 2015-2-5-上午11:33:46
*
*
*/
public abstract void checkButtonEnable();
@ -134,31 +137,31 @@ public abstract class BlockCreator<T extends TemplateBlock> extends JComponent i
/**
* 获取当前工具栏组
*
*
* @return 工具栏组
*
*
* @date 2015-2-5-上午11:29:07
*
*
*/
public abstract ToolBarDef[] toolbars4Target();
/**
* 在Form的工具栏组
*
*
* @return 组件数组
*
*
* @date 2015-2-5-上午11:31:46
*
*
*/
public abstract JComponent[] toolBarButton4Form();
/**
* 获取当前菜单栏组
*
*
* @return 菜单栏组
*
*
* @date 2015-2-5-上午11:29:07
*
*
*/
public abstract MenuDef[] menus4Target();
@ -167,12 +170,12 @@ public abstract class BlockCreator<T extends TemplateBlock> extends JComponent i
/**
* 获取菜单里的快捷方式数组
*
*
* @return 菜单里的快捷方式数组
*
*
* @date 2015-2-5-上午11:27:08
*
*
*/
public abstract ShortCut[] shortcut4TemplateMenu();
}
}

53
designer-realize/src/main/java/com/fr/poly/creator/BlockEditor.java

@ -30,20 +30,20 @@ import com.fr.stable.unit.UnitRectangle;
* @since 6.5.4 创建于2011-5-5 聚合报表块编辑器
*/
public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock> extends JComponent{
protected PolyDesigner designer;
protected BlockCreator<U> creator;
protected int resolution = ScreenResolution.getScreenResolution();
protected T editComponent;
private JComponent addHeightTool;// 改变高度的组件
private JComponent addWidthTool; // 改变宽度的组件
private JComponent moveTool; // 拖动聚合块的组件
private boolean isDragging;
private Absorptionline lineInX;
private Absorptionline lineInY;
private BlockForbiddenWindow forbiddenWindow;
public BlockEditor(PolyDesigner designer, BlockCreator<U> creator) {
@ -74,16 +74,16 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
this.moveTool = new BlockControlButton();
this.add(BlockEditorLayout.BOTTOMCORNER, this.moveTool);
this.forbiddenWindow = new BlockForbiddenWindow();
}
/**
* 重置当前鼠标选中状态
*
*
*/
public abstract void resetSelectionAndChooseState();
protected abstract T createEffective();
protected abstract Dimension getAddHeigthPreferredSize();
@ -91,9 +91,9 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
protected abstract Dimension getAddWidthPreferredSize();
protected abstract void initDataChangeListener();
protected abstract RowOperationMouseHandler createRowOperationMouseHandler();
protected abstract ColumnOperationMouseHandler createColumnOperationMouseHandler();
protected void addColumnRowListeners() {
@ -122,28 +122,31 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
initSize();
LayoutUtils.layoutRootContainer(BlockEditor.this);
}
@Override
public boolean equals(Object o) {
if (o == null) {
return false;
}
return ComparatorUtils.equals(o.getClass().getName(), this.getClass().getName());
}
});
}
public void setDragging(boolean isDragging) {
this.isDragging = isDragging;
}
/**
* 当前是否处于拖动状态
*
*
* @return 是否处于拖动状态
*
*
*/
public boolean isDragging() {
return this.isDragging;
}
public void setXAbsorptionline(Absorptionline line) {
this.lineInX = line;
}
@ -151,27 +154,27 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
public void setYAbsorptionline(Absorptionline line) {
this.lineInY = line;
}
/**
* 显示禁止重叠窗口
*
*
* @param x x坐标
* @param y y坐标
*
*
*/
public void showForbiddenWindow(int x, int y){
this.forbiddenWindow.showWindow(x, y);
}
/**
* 隐藏禁止重叠窗口
*
*
*/
public void hideForbiddenWindow(){
this.forbiddenWindow.hideWindow();
}
public void paintAbsorptionline(Graphics g) {
if(lineInX != null) {
lineInX.paint(g,designer);
@ -202,7 +205,7 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
public Dimension getCornerSize() {
return new Dimension();
}
private class BlockControlButton extends UIButton {
@Override
public ButtonUI getUI() {
@ -220,4 +223,4 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
};
}
}
}
}

4
designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java

@ -1,6 +1,7 @@
package com.fr.start.fx;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.log.FineLoggerFactory;
import com.sun.javafx.iio.ImageFrame;
import com.sun.javafx.iio.ImageLoadListener;
import com.sun.javafx.iio.ImageLoader;
@ -79,6 +80,7 @@ class PrismImageLoader2 implements com.sun.javafx.tk.ImageLoader {
}
@Override
@SuppressWarnings("squid:S2142")
public PlatformImage getFrame(int index) {
while (images[index] == null) {
synchronized (this) {
@ -86,7 +88,7 @@ class PrismImageLoader2 implements com.sun.javafx.tk.ImageLoader {
try {
this.wait();
} catch (InterruptedException e) {
e.printStackTrace();
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}

1
designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java

@ -55,6 +55,7 @@ public class SplashFxWindow extends Application {
*
* @return 运行实例
*/
@SuppressWarnings("squid:S2142")
public static SplashFxWindow waitForStartUpTest() {
try {
LATCH.await();

Loading…
Cancel
Save