Browse Source

Merge pull request #1101 in DESIGN/design from ~BRUCE.DENG/design:feature/10.0 to feature/10.0

* commit '938dea53769770b90b2d53f9391f9fd371540a31':
  无jira任务,sonar问题修复
research/11.0
Bruce.Deng 5 years ago
parent
commit
47b262e7b1
  1. 13
      designer-base/src/main/java/com/fr/design/layout/TableLayout.java
  2. 3
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionCellEditor.java
  3. 3
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionCellRender.java
  4. 3
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  5. 9
      designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java

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

@ -322,7 +322,6 @@ public class TableLayout implements LayoutManager2, Serializable {
this row/column. */
public static final double MINIMUM = -3.0;
public static final double EPSILON = 0.0000001;
//******************************************************************************
//** Constructors ***
@ -1808,8 +1807,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 (Math.abs(crSpec[z][counter] - PREFERRED) < EPSILON ||
Math.abs(crSpec[z][counter] - MINIMUM) < EPSILON) {
else if (AssistUtils.equals(crSpec[z][counter], PREFERRED) ||
AssistUtils.equals(crSpec[z][counter], MINIMUM)) {
scalableSize -= crPrefMin[counter];
}
@ -1825,13 +1824,13 @@ public class TableLayout implements LayoutManager2, Serializable {
// Add scaled size to relativeWidth
relativeSize += crSpec[z][counter];
// Cr is fill
else if (Math.abs(crSpec[z][counter] - FILL) < EPSILON && Math.abs(fillSizeRatio - 0.0) >= EPSILON)
else if (AssistUtils.equals(crSpec[z][counter], FILL) && !AssistUtils.equals(fillSizeRatio, 0.0))
// Add fill size to relativeWidth
relativeSize += fillSizeRatio;
}
// Determine the total scaled size as estimated by this component
if (Math.abs(relativeSize - 0) < EPSILON)
if (AssistUtils.equals(relativeSize, 0))
temp = 0;
else
temp = (int) (scalableSize / relativeSize + 0.5);
@ -1852,8 +1851,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 (Math.abs(crSpec[z][counter] - PREFERRED) < EPSILON||
Math.abs(crSpec[z][counter] - MINIMUM) < EPSILON) {
else if (AssistUtils.equals(crSpec[z][counter], PREFERRED) ||
AssistUtils.equals(crSpec[z][counter], MINIMUM)) {
// Add preferred/minimum width
totalSize += crPrefMin[counter];
}

3
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionCellEditor.java

@ -10,6 +10,7 @@ import com.fr.design.mainframe.vcs.common.VcsCacheFileNodeFile;
import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils;
import com.fr.report.entity.VcsEntity;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.vcs.VcsOperator;
@ -67,7 +68,7 @@ public class FileVersionCellEditor extends AbstractCellEditor implements TableCe
}
double height = editor.getPreferredSize().getHeight();
if (table.getRowHeight(row) != height) {
if (!AssistUtils.equals(table.getRowHeight(row), height)) {
table.setRowHeight(row, (int) height + VcsHelper.OFFSET);
}
return editor;

3
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionCellRender.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.vcs.ui;
import com.fr.design.mainframe.vcs.common.VcsHelper;
import com.fr.report.entity.VcsEntity;
import com.fr.stable.AssistUtils;
import javax.swing.JPanel;
import javax.swing.JTable;
@ -34,7 +35,7 @@ public class FileVersionCellRender implements TableCellRenderer {
editor.setBackground(isSelected ? TABLE_SELECT_BACKGROUND : TREE_BACKGROUND);
double height = editor.getPreferredSize().getHeight();
if (table.getRowHeight(row) != height) {
if (!AssistUtils.equals(table.getRowHeight(row), height)) {
table.setRowHeight(row, (int) height + VcsHelper.OFFSET);
}
return editor;

3
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java

@ -29,6 +29,7 @@ import com.fr.design.style.color.ColorSelectConfigManager;
import com.fr.design.style.color.ColorSelectDetailPane;
import com.fr.design.style.color.ColorSelectDialog;
import com.fr.design.style.color.ColorSelectable;
import com.fr.stable.AssistUtils;
/**
* TODO:面板缩放的功能没有考虑就是尾值过大导致超过界面显示的情况原来的那个实现完全是个BUG要缩放的情况也比较少就干脆以后弄吧
@ -217,7 +218,7 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl
* @return 同上
*/
public boolean isOriginalPlace() {
return startLabel.getValue() == min && endLabel.getValue() == max;
return AssistUtils.equals(startLabel.getValue(), min) && AssistUtils.equals(endLabel.getValue(), max);
}
/**

9
designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java

@ -31,6 +31,7 @@ import com.fr.design.style.color.ColorFactory;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.style.color.ColorSelectable;
import com.fr.general.FRFont;
import com.fr.stable.AssistUtils;
import com.fr.stable.Constants;
import com.fr.stable.OperatingSystem;
import com.fr.stable.StringUtils;
@ -890,10 +891,10 @@ public final class GUICoreUtils {
* @return 同上
*/
public static boolean isTheSameRect(Rectangle oneRect, Rectangle otherRect) {
return oneRect.getX() == otherRect.getX()
&& oneRect.getY() == otherRect.getY()
&& oneRect.getWidth() == otherRect.getWidth()
&& oneRect.getHeight() == otherRect.getHeight();
return AssistUtils.equals(oneRect.getX(), otherRect.getX())
&& AssistUtils.equals(oneRect.getY(), otherRect.getY())
&& AssistUtils.equals(oneRect.getWidth(), otherRect.getWidth())
&& AssistUtils.equals(oneRect.getHeight(), otherRect.getHeight());
}
/**

Loading…
Cancel
Save