Browse Source

REPORT-20329 sonar问题修复

persist/11.0
Hugh.C 5 years ago
parent
commit
0b4c7d51fd
  1. 3
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java
  2. 3
      designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java
  3. 3
      designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotReportDataContentPane.java
  4. 3
      designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java
  5. 3
      designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java
  6. 3
      designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarPlotPane.java
  7. 3
      designer-chart/src/main/java/com/fr/van/chart/range/component/LegendGradientBar.java
  8. 3
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java
  9. 3
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java
  10. 3
      designer-chart/src/main/java/com/fr/van/chart/treemap/VanChartTreeMapPlotPane.java
  11. 3
      designer-form/src/main/java/com/fr/design/designer/beans/AdapterBus.java
  12. 28
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  13. 7
      designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java
  14. 7
      designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java

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

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

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

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

Loading…
Cancel
Save