Browse Source

REPORT-20328 sonar问题修复

research/11.0
jinbokai 5 years ago
parent
commit
1236223619
  1. 6
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
  2. 6
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  3. 10
      designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java
  4. 30
      designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java
  5. 31
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java
  6. 1
      designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/ZoomPaneWithOutMode.java
  7. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java
  8. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java
  9. 1
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java
  10. 1
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java

6
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java

@ -98,7 +98,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
} }
protected void addKeyMonitor() { protected void addKeyMonitor() {
//do nothing
} }
protected JPanel createCheckBoxgroupPane() { protected JPanel createCheckBoxgroupPane() {
@ -137,7 +137,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
/** /**
* itemComboBox 加上 itemListener * itemComboBox 加上 itemListener
* *
* @param itemListener * @param itemListener
*/ */
public void addItemListener(ItemListener itemListener) { public void addItemListener(ItemListener itemListener) {
@ -214,7 +214,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
public static interface DoubleClickSelectedNodeOnTreeListener { public static interface DoubleClickSelectedNodeOnTreeListener {
/** /**
* 处理双击事件 * 处理双击事件
* *
* @param target * @param target
*/ */
public void actionPerformed(TableProcedure target); public void actionPerformed(TableProcedure target);

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

@ -101,10 +101,10 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
@Override @Override
protected void addKeyMonitor() { protected void addKeyMonitor() {
searchField.addKeyListener(new KeyListener() { searchField.addKeyListener(new KeyListener() {
@Override @Override
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
//do nothing
} }
@Override @Override
@ -117,7 +117,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
@Override @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
//do nothing
} }
}); });
} }

10
designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java

@ -44,6 +44,7 @@ public class ChartIcon implements Icon, XMLable {
* @param x 缩略图的起始坐标x * @param x 缩略图的起始坐标x
* @param y 缩略图的起始坐标y * @param y 缩略图的起始坐标y
*/ */
@Override
public void paintIcon(Component c, Graphics g, int x, int y) { public void paintIcon(Component c, Graphics g, int x, int y) {
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
@ -66,6 +67,7 @@ public class ChartIcon implements Icon, XMLable {
* *
* @return int 缩略图宽度 * @return int 缩略图宽度
*/ */
@Override
public int getIconWidth() { public int getIconWidth() {
return WIDTH; return WIDTH;
} }
@ -75,6 +77,7 @@ public class ChartIcon implements Icon, XMLable {
* *
* @return int 缩略图高度 * @return int 缩略图高度
*/ */
@Override
public int getIconHeight() { public int getIconHeight() {
return HEIGHT; return HEIGHT;
} }
@ -94,18 +97,21 @@ public class ChartIcon implements Icon, XMLable {
} }
@Override
public void readXML(XMLableReader reader) { public void readXML(XMLableReader reader) {
//do nothing
} }
@Override
public void writeXML(XMLPrintWriter writer) { public void writeXML(XMLPrintWriter writer) {
//do nothing
} }
/** /**
* @return 克隆后的对象 * @return 克隆后的对象
* @throws CloneNotSupportedException 如果克隆失败则抛出此异常 * @throws CloneNotSupportedException 如果克隆失败则抛出此异常
*/ */
@Override
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
ChartIcon cloned = (ChartIcon) super.clone(); ChartIcon cloned = (ChartIcon) super.clone();
cloned.imagePath = this.imagePath; cloned.imagePath = this.imagePath;

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

@ -55,12 +55,12 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
this(); this();
populate(cc); populate(cc);
} }
public ChartComponent(BaseChartCollection cc) { public ChartComponent(BaseChartCollection cc) {
this(); this();
populate(cc); populate(cc);
} }
public ChartComponent(ChartCollection cc, PropertyChangeListener l) { public ChartComponent(ChartCollection cc, PropertyChangeListener l) {
this(); this();
populate(cc); populate(cc);
@ -72,6 +72,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
* 右键编辑 图表编辑层的监听事件, 在停止编辑时 响应整个编辑模板(form, sheet)的改变. * 右键编辑 图表编辑层的监听事件, 在停止编辑时 响应整个编辑模板(form, sheet)的改变.
* @param l 监听事件 * @param l 监听事件
*/ */
@Override
public void addStopEditingListener(PropertyChangeListener l) { public void addStopEditingListener(PropertyChangeListener l) {
if (!listeners.contains(l)) { if (!listeners.contains(l)) {
listeners.add(l); listeners.add(l);
@ -87,6 +88,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
/** /**
* 停止编辑, 通知事情, 刷新画出新界面. * 停止编辑, 通知事情, 刷新画出新界面.
*/ */
@Override
public void reset() { public void reset() {
fireStopEditing(); fireStopEditing();
@ -97,6 +99,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
repaint(); repaint();
} }
@Override
public void populate(BaseChartCollection cc) { // kunsnat_bug: 5471 实现设置的即时预览 public void populate(BaseChartCollection cc) { // kunsnat_bug: 5471 实现设置的即时预览
try {// clone 为了判断编辑前后的值. try {// clone 为了判断编辑前后的值.
this.chartCollection4Design = (ChartCollection)cc; this.chartCollection4Design = (ChartCollection)cc;
@ -107,6 +110,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
reset(); reset();
} }
@Override
public BaseChartCollection update() { public BaseChartCollection update() {
return this.chartCollection4Design; return this.chartCollection4Design;
} }
@ -180,53 +184,63 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
* @param event 鼠标事件 * @param event 鼠标事件
* 不设置鼠标点击跳转事件 * 不设置鼠标点击跳转事件
*/ */
@Override
public void mouseClicked(MouseEvent event) { public void mouseClicked(MouseEvent event) {
//do nothing
} }
/** /**
* 鼠标按压 * 鼠标按压
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
@Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
//do nothing
} }
/** /**
* 鼠标松开 * 鼠标松开
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
public void mouseReleased(MouseEvent e) { @Override
public void mouseReleased(MouseEvent e) {
//do nothing
} }
/** /**
* 鼠标进入 * 鼠标进入
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
@Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
//do nothing
} }
/** /**
* 鼠标退出 * 鼠标退出
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
@Override
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
//do nothing
} }
/** /**
* 鼠标拖拽 * 鼠标拖拽
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
public void mouseDragged(MouseEvent e) { @Override
public void mouseDragged(MouseEvent e) {
//do nothing
} }
/** /**
* 鼠标移动 * 鼠标移动
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
@Override
public void mouseMoved(MouseEvent e) { public void mouseMoved(MouseEvent e) {
//do nothing
} }
private boolean needRefreshChartGlyph() { private boolean needRefreshChartGlyph() {

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

@ -25,7 +25,7 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
private static final long serialVersionUID = 2595221900000305396L; private static final long serialVersionUID = 2595221900000305396L;
private static final int GISMAP = 0; private static final int GISMAP = 0;
private UITextField keyInput; private UITextField keyInput;
public GisMapPlotPane(){ public GisMapPlotPane(){
@ -34,7 +34,7 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
Component[][] components = null; Component[][] components = null;
styleList = createStyleList(); styleList = createStyleList();
checkDemosBackground(); checkDemosBackground();
JPanel layoutPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4); JPanel layoutPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4);
@ -45,7 +45,7 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
tmp.setDemoGroup(styleList.toArray(new ChartSelectDemoPane[styleList.size()])); tmp.setDemoGroup(styleList.toArray(new ChartSelectDemoPane[styleList.size()]));
} }
} }
keyInput = new UITextField(); keyInput = new UITextField();
double[] columnSize = { f }; double[] columnSize = { f };
@ -58,16 +58,16 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
new Component[]{keyInput}, new Component[]{keyInput},
}; };
} }
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
} }
@Override @Override
public void reLayout(String chartID){ public void reLayout(String chartID){
//do nothing
} }
@Override @Override
@ -88,7 +88,8 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
return ChartConstants.GIS_CHAER; return ChartConstants.GIS_CHAER;
} }
protected String[] getTypeLayoutPath() { @Override
protected String[] getTypeLayoutPath() {
return new String[]{"/com/fr/design/images/chart/GisMapPlot/layout/0.png", return new String[]{"/com/fr/design/images/chart/GisMapPlot/layout/0.png",
"/com/fr/design/images/chart/GisMapPlot/layout/1.png", "/com/fr/design/images/chart/GisMapPlot/layout/1.png",
}; };
@ -105,6 +106,7 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
/** /**
* 保存界面属性 * 保存界面属性
*/ */
@Override
public void updateBean(Chart chart) { public void updateBean(Chart chart) {
if(needsResetChart(chart)){ if(needsResetChart(chart)){
resetChart(chart); resetChart(chart);
@ -121,14 +123,14 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
} else { } else {
plot = new GisMapPlot(); plot = new GisMapPlot();
} }
try { try {
chart.switchPlot((Plot)plot.clone()); chart.switchPlot((Plot)plot.clone());
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error("Error In LineChart"); FineLoggerFactory.getLogger().error("Error In LineChart");
chart.switchPlot(new GisMapPlot()); chart.switchPlot(new GisMapPlot());
} }
plot = (GisMapPlot) chart.getPlot(); plot = (GisMapPlot) chart.getPlot();
boolean index = plot.isGisType(); boolean index = plot.isGisType();
if(styleList.get(BAIDU).isPressing){ if(styleList.get(BAIDU).isPressing){
@ -136,7 +138,7 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
}else{ }else{
plot.setGisType(false); plot.setGisType(false);
} }
if(index != plot.isGisType()){ if(index != plot.isGisType()){
if(plot.isGisType()){ if(plot.isGisType()){
this.keyInput.setText(plot.getBaiduKey()); this.keyInput.setText(plot.getBaiduKey());
@ -156,15 +158,16 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
/** /**
* 更新界面内容 * 更新界面内容
*/ */
@Override
public void populateBean(Chart chart) { public void populateBean(Chart chart) {
typeDemo.get(0).isPressing = true; typeDemo.get(0).isPressing = true;
GisMapPlot plot = (GisMapPlot) chart.getPlot(); GisMapPlot plot = (GisMapPlot) chart.getPlot();
if(plot.isGisType()){ if(plot.isGisType()){
styleList.get(BAIDU).isPressing = true; styleList.get(BAIDU).isPressing = true;
styleList.get(GOOGLE).isPressing = false; styleList.get(GOOGLE).isPressing = false;
keyInput.setText(plot.getBaiduKey()); keyInput.setText(plot.getBaiduKey());
}else{ }else{
styleList.get(GOOGLE).isPressing = true; styleList.get(GOOGLE).isPressing = true;
styleList.get(BAIDU).isPressing =false; styleList.get(BAIDU).isPressing =false;
@ -178,6 +181,7 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
* 界面标题 * 界面标题
* @return 标题 * @return 标题
*/ */
@Override
public String title4PopupWindow() { public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_GIS_Map_OLD"); return Toolkit.i18nText("Fine-Design_Chart_GIS_Map_OLD");
} }
@ -191,7 +195,8 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
} }
public Chart getDefaultChart() { @Override
public Chart getDefaultChart() {
return GisMapIndependentChart.gisChartTypes[0]; return GisMapIndependentChart.gisChartTypes[0];
} }
} }

1
designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/ZoomPaneWithOutMode.java

@ -13,5 +13,6 @@ public class ZoomPaneWithOutMode extends ZoomPane {
@Override @Override
protected void initCustomModePane(double[] columnSize, double p) { protected void initCustomModePane(double[] columnSize, double p) {
//do nothing
} }
} }

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java

@ -57,6 +57,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
super(isXAxis); super(isXAxis);
} }
@Override
protected JPanel createContentPane(boolean isXAxis){ protected JPanel createContentPane(boolean isXAxis){
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
@ -81,6 +82,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
@Override @Override
protected void addOverlapGroupButton(JPanel panel) { protected void addOverlapGroupButton(JPanel panel) {
//do nothing
} }
private JPanel createValueDefinition(){ private JPanel createValueDefinition(){
@ -93,6 +95,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
return PlotFactory.createAutoFormatPane(); return PlotFactory.createAutoFormatPane();
} }
@Override
protected void checkFormatType() { protected void checkFormatType() {
valueFormat.setComboBoxModel(true); valueFormat.setComboBoxModel(true);
} }
@ -104,6 +107,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
timeMinMaxValuePane.update(timeAxis); timeMinMaxValuePane.update(timeAxis);
} }
@Override
public VanChartTimeAxis updateBean(String axisName, int position) { public VanChartTimeAxis updateBean(String axisName, int position) {
VanChartTimeAxis axis = new VanChartTimeAxis(axisName, VanChartConstants.AXIS_BOTTOM); VanChartTimeAxis axis = new VanChartTimeAxis(axisName, VanChartConstants.AXIS_BOTTOM);
updateBean(axis); updateBean(axis);

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java

@ -38,6 +38,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
super(isXAxis); super(isXAxis);
} }
@Override
protected JPanel createContentPane(boolean isXAxis){ protected JPanel createContentPane(boolean isXAxis){
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
@ -62,6 +63,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
@Override @Override
protected void addOverlapGroupButton(JPanel panel) { protected void addOverlapGroupButton(JPanel panel) {
//do nothing
} }
protected JPanel createMinMaxValuePane(double[] row, double[] col){ protected JPanel createMinMaxValuePane(double[] row, double[] col){
@ -126,6 +128,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Axis"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Axis");
} }
@Override
public void populateBean(VanChartAxis axis){ public void populateBean(VanChartAxis axis){
VanChartValueAxis valueAxis = (VanChartValueAxis)axis; VanChartValueAxis valueAxis = (VanChartValueAxis)axis;
super.populateBean(valueAxis); super.populateBean(valueAxis);
@ -153,6 +156,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
} }
} }
@Override
public VanChartValueAxis updateBean(String axisName, int position){ public VanChartValueAxis updateBean(String axisName, int position){
VanChartValueAxis axis = new VanChartValueAxis(axisName, position); VanChartValueAxis axis = new VanChartValueAxis(axisName, position);
updateBean(axis); updateBean(axis);

1
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java

@ -54,6 +54,7 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane {
return new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); return new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
} }
@Override
protected JPanel createMinMaxValuePane(double[] row, double[] col) { protected JPanel createMinMaxValuePane(double[] row, double[] col) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;

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

@ -242,6 +242,7 @@ public class FormCreatorDropTarget extends DropTarget {
*/ */
@Override @Override
public synchronized void dropActionChanged(DropTargetDragEvent dtde) { public synchronized void dropActionChanged(DropTargetDragEvent dtde) {
//do nothing
} }
/** /**

Loading…
Cancel
Save