Browse Source

Merge pull request #1098 in DESIGN/design from ~MAKSIM/design:feature/10.0 to feature/10.0

* commit '178ae5f8366533de85a397024775dd0c6a76f851':
  REPORT-20323 sonar问题修复
research/11.0
Maksim 5 years ago
parent
commit
39a5873b89
  1. 2
      designer-realize/src/main/java/com/fr/design/actions/cell/style/AlignmentAction.java
  2. 3
      designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontSizeAction.java
  3. 4
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java
  4. 2
      designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java
  5. 5
      designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java
  6. 7
      designer-realize/src/main/java/com/fr/design/mainframe/AuthorityEditToolBarPane.java
  7. 2
      designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java
  8. 5
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  9. 3
      designer-realize/src/main/java/com/fr/design/mainframe/SheetAuthorityEditPane.java

2
designer-realize/src/main/java/com/fr/design/actions/cell/style/AlignmentAction.java

@ -110,9 +110,11 @@ public class AlignmentAction extends ButtonGroupAction implements StyleActionInt
group.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Left"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Center"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Right")}); group.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Left"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Center"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Right")});
} }
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
if (group != null) {
group.getButton(i).setRoundBorder(true, UIConstants.ARC); group.getButton(i).setRoundBorder(true, UIConstants.ARC);
group.getButton(i).setBorderPainted(true); group.getButton(i).setBorderPainted(true);
} }
}
return group; return group;
} }

3
designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontSizeAction.java

@ -15,6 +15,7 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.stable.AssistUtils;
/** /**
@ -51,7 +52,7 @@ public class ReportFontSizeAction extends AbstractStyleAction {
if (style.getFRFont().getSize() == defStyle.getFRFont().getSize()) { if (style.getFRFont().getSize() == defStyle.getFRFont().getSize()) {
style = StyleUtils.setReportFontSize(style, defStyle.getFRFont().getSize()); style = StyleUtils.setReportFontSize(style, defStyle.getFRFont().getSize());
} }
if (selectedFontSize == style.getFRFont().getSize()) { if (AssistUtils.equals(selectedFontSize, style.getFRFont().getSize())){
return style; return style;
} }
style = StyleUtils.setReportFontSize(style, selectedFontSize); style = StyleUtils.setReportFontSize(style, selectedFontSize);

4
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java

@ -247,11 +247,7 @@ public class DSColumnAdvancedPane extends BasicPane {
this.sortOrderComboBox.setSortOrder(new SortOrder(sort)); this.sortOrderComboBox.setSortOrder(new SortOrder(sort));
String sortFormula = dSColumn.getSortFormula(); String sortFormula = dSColumn.getSortFormula();
if (sortFormula != null && sortFormula.length() >= 1) {
sortFormulaTextField.setText(sortFormula); sortFormulaTextField.setText(sortFormula);
} else {
sortFormulaTextField.setText(sortFormula);
}
} }
public void update(CellElement cellElement) { public void update(CellElement cellElement) {

2
designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -263,7 +263,7 @@ public class SelectedDataColumnPane extends BasicPane {
SimpleDSColumn simpleDSColumn = updateColumnPane(); SimpleDSColumn simpleDSColumn = updateColumnPane();
dsColumn.setDSName(Objects.requireNonNull(simpleDSColumn).getDsName()); dsColumn.setDSName(Objects.requireNonNull(simpleDSColumn).getDsName());
dsColumn.setColumn(simpleDSColumn.getColumn()); dsColumn.setColumn(Objects.requireNonNull(simpleDSColumn).getColumn());
dsColumn.setParameters((ps != null && ps.length > 0) ? ps : null); dsColumn.setParameters((ps != null && ps.length > 0) ? ps : null);
} }

5
designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java

@ -140,10 +140,11 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
@Override @Override
public void populateBean(Listener listener) { public void populateBean(Listener listener) {
this.listener = listener; if (listener == null){
if (this.listener == null) {
this.listener = new Listener(); this.listener = new Listener();
return;
} }
this.listener = listener;
this.nameText.setText(listener.getEventName()); this.nameText.setText(listener.getEventName());
JavaScript js = listener.getAction(); JavaScript js = listener.getAction();
for (int i = 0; i < this.cards.size(); i++) { for (int i = 0; i < this.cards.size(); i++) {

7
designer-realize/src/main/java/com/fr/design/mainframe/AuthorityEditToolBarPane.java

@ -13,6 +13,7 @@ import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.webattr.ToolBarButton; import com.fr.design.webattr.ToolBarButton;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -204,7 +205,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void populateType() { public void populateType() {
if (name.getText() == "") { if (StringUtils.isEmpty(name.getText())) {
type.setText(""); type.setText("");
} else { } else {
type.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Toolbar_Button")); type.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Toolbar_Button"));
@ -218,7 +219,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
names += "," + buttonlists.get(i).getNameOption().optionName(); names += "," + buttonlists.get(i).getNameOption().optionName();
} }
} }
if (names != "") { if (StringUtils.isNotEmpty(names)) {
names = names.substring(1); names = names.substring(1);
} }
name.setText(names); name.setText(names);
@ -226,7 +227,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void populateCheckPane() { public void populateCheckPane() {
checkPane.removeAll(); checkPane.removeAll();
if (name.getText() == "") { if (StringUtils.isEmpty(name.getText())) {
return; return;
} }
double f = TableLayout.FILL; double f = TableLayout.FILL;

2
designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java

@ -157,7 +157,7 @@ public class FormatBrushAction extends ElementCaseAction {
} }
Style style = cellElement.getStyle(); Style style = cellElement.getStyle();
if (style == null) { if (style == null) {
style = style.DEFAULT_STYLE; style = Style.DEFAULT_STYLE;
} }
referencedStyle[i][j] = style; referencedStyle[i][j] = style;

5
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -89,6 +89,7 @@ import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.poly.PolyWorkSheet; import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.worksheet.WorkSheet; import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.module.Module; import com.fr.stable.module.Module;
@ -469,7 +470,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
double creatorWidth = blockCreator.getEditorBounds().width; double creatorWidth = blockCreator.getEditorBounds().width;
double areaHeight = polyDezi.polyArea.getHeight(); double areaHeight = polyDezi.polyArea.getHeight();
double areaWidth = polyDezi.polyArea.getWidth(); double areaWidth = polyDezi.polyArea.getWidth();
if (creatorWidth == 0 || creatorHeight == 0) { if(AssistUtils.equals(creatorWidth,0) || AssistUtils.equals(creatorHeight,0)){
return resolution; return resolution;
} }
double time = (areaHeight / creatorHeight) < (areaWidth / creatorWidth) ? (areaHeight / creatorHeight) : (areaWidth / creatorWidth); double time = (areaHeight / creatorHeight) < (areaWidth / creatorWidth) ? (areaHeight / creatorHeight) : (areaWidth / creatorWidth);
@ -486,7 +487,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
int row = reportPane.getSelection().getSelectedRows()[0]; int row = reportPane.getSelection().getSelectedRows()[0];
double rowLength = reportPane.getSelection().getSelectedRows().length; double rowLength = reportPane.getSelection().getSelectedRows().length;
double rowExtent = reportPane.getGrid().getVerticalExtent(); double rowExtent = reportPane.getGrid().getVerticalExtent();
if (columnLength == 0 || rowLength == 0) { if(AssistUtils.equals(columnLength,0) || AssistUtils.equals(rowLength,0)){
return resolution; return resolution;
} }
double time = (columnExtent / columnLength) < (rowExtent / rowLength) ? (columnExtent / columnLength) : (rowExtent / rowLength); double time = (columnExtent / columnLength) < (rowExtent / rowLength) ? (columnExtent / columnLength) : (rowExtent / rowLength);

3
designer-realize/src/main/java/com/fr/design/mainframe/SheetAuthorityEditPane.java

@ -13,6 +13,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.privilege.finegrain.WorkSheetPrivilegeControl; import com.fr.privilege.finegrain.WorkSheetPrivilegeControl;
import com.fr.report.worksheet.WorkSheet; import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -115,7 +116,7 @@ public class SheetAuthorityEditPane extends AuthorityEditPane {
populateName(); populateName();
populateType(); populateType();
checkPane.removeAll(); checkPane.removeAll();
if (name.getText() == "") { if (StringUtils.isEmpty(name.getText())){
return; return;
} }
checkPane.add(populateCheckPane(), BorderLayout.CENTER); checkPane.add(populateCheckPane(), BorderLayout.CENTER);

Loading…
Cancel
Save