Browse Source

Merge branch 'feature/10.0' of ssh://cloud.finedevelop.com:7999/~zheng/C-design into feature/10.0

research/11.0
shine 5 years ago
parent
commit
8ad58d3b26
  1. 2
      designer-base/src/main/java/com/fr/design/dialog/JWizardPanel.java
  2. 12
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  3. 14
      designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java
  4. 6
      designer-base/src/main/java/com/fr/design/gui/ibutton/UITabButton.java
  5. 4
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java
  6. 21
      designer-base/src/main/java/com/fr/design/gui/icombobox/LineComboBox.java
  7. 4
      designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxButton.java
  8. 2
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java
  9. 42
      designer-base/src/main/java/com/fr/design/gui/imenu/UIBasicMenuItemUI.java
  10. 3
      designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTable.java
  11. 2
      designer-base/src/main/java/com/fr/design/gui/iprogressbar/UIProgressBorder.java
  12. 44
      designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIBasicScrollBarUI.java
  13. 8
      designer-base/src/main/java/com/fr/design/gui/iscrollbar/UISBChooser.java
  14. 2
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxView.java
  15. 4
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/TokenIterator.java
  16. 9
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/WrappedSyntaxView.java
  17. 2
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java
  18. 2
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java
  19. 6
      designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java
  20. 8
      designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java
  21. 40
      designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java
  22. 4
      designer-realize/src/main/java/com/fr/grid/GridUI.java
  23. 2
      designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java

2
designer-base/src/main/java/com/fr/design/dialog/JWizardPanel.java

@ -168,7 +168,7 @@ public class JWizardPanel extends BasicPane {
public void addNotify() { public void addNotify() {
if (firstNotify) { if (firstNotify) {
Font font = stepTitleLabel.getFont(); Font font = stepTitleLabel.getFont();
font = font.deriveFont(Font.BOLD, font.getSize() * 14 / 10.0F); font = font.deriveFont(Font.BOLD, (float) (font.getSize() * 14 / 10.0D));
stepTitleLabel.setFont(font); stepTitleLabel.setFont(font);
firstNotify = false; firstNotify = false;
} }

12
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -398,8 +398,8 @@ public class MutilTempalteTabPane extends JComponent {
//画下面的那条线 //画下面的那条线
if (templateStartX < maxWidth) { if (templateStartX < maxWidth) {
GeneralPath generalPath = new GeneralPath(Path2D.WIND_EVEN_ODD, 2); GeneralPath generalPath = new GeneralPath(Path2D.WIND_EVEN_ODD, 2);
generalPath.moveTo((float) templateStartX, getHeight() - 1.0F); generalPath.moveTo((float) templateStartX, (float) (getHeight() - 1.0D));
generalPath.lineTo((float) maxWidth, getHeight() - 1.0F); generalPath.lineTo((float) maxWidth, (float) (getHeight() - 1.0D));
g2d.fill(generalPath); g2d.fill(generalPath);
//TODO hzzz delete //TODO hzzz delete
// g2d.setPaint(UIConstants.LINE_COLOR); // g2d.setPaint(UIConstants.LINE_COLOR);
@ -409,7 +409,7 @@ public class MutilTempalteTabPane extends JComponent {
private void paintDefaultBackground(Graphics2D g2d) { private void paintDefaultBackground(Graphics2D g2d) {
//画默认背景 //画默认背景
g2d.setPaint(new GradientPaint(1, 1, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND, 1, getHeight() - 1.0F, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND)); g2d.setPaint(new GradientPaint(1, 1, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND, 1, (float) (getHeight() - 1.0D), UIConstants.TEMPLATE_TAB_PANE_BACKGROUND));
g2d.fillRect(0, 0, getWidth(), getHeight()); g2d.fillRect(0, 0, getWidth(), getHeight());
} }
@ -535,7 +535,7 @@ public class MutilTempalteTabPane extends JComponent {
double[] x = {templateStartX, templateStartX, templateStartX + realWidth, templateStartX + realWidth, templateStartX}; double[] x = {templateStartX, templateStartX, templateStartX + realWidth, templateStartX + realWidth, templateStartX};
double[] y = {1, getHeight() + 1, getHeight() + 1, 1, 1}; double[] y = {1, getHeight() + 1, getHeight() + 1, 1, 1};
RoundRectangle2D.Double rect1 = new RoundRectangle2D.Double(templateStartX, 1, this.getWidth(), this.getHeight(), 7, 7); RoundRectangle2D.Double rect1 = new RoundRectangle2D.Double(templateStartX, 1, this.getWidth(), this.getHeight(), 7, 7);
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, getHeight() - 1.0F, UIConstants.SELECT_TAB)); g2d.setPaint(new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, (float) (getHeight() - 1.0D), UIConstants.SELECT_TAB));
//选了30度和60度的特殊角度的x,y作为经过的两个点的坐标 //选了30度和60度的特殊角度的x,y作为经过的两个点的坐标
double specialLocation1 = 2.5; double specialLocation1 = 2.5;
double specialLocation2 = 4.330127; double specialLocation2 = 4.330127;
@ -590,9 +590,9 @@ public class MutilTempalteTabPane extends JComponent {
double[] x = {templateStartX, templateStartX, templateStartX + realWidth, templateStartX + realWidth, templateStartX}; double[] x = {templateStartX, templateStartX, templateStartX + realWidth, templateStartX + realWidth, templateStartX};
double[] y = {-1, getHeight() - 1, getHeight() - 1, -1, -1}; double[] y = {-1, getHeight() - 1, getHeight() - 1, -1, -1};
if (selfIndex == mouseOveredIndex) { if (selfIndex == mouseOveredIndex) {
g2d.setPaint(new GradientPaint(1, 1, UIConstants.HOVER_BLUE, 1, getHeight() - 1.0F, UIConstants.HOVER_BLUE)); g2d.setPaint(new GradientPaint(1, 1, UIConstants.HOVER_BLUE, 1, (float) (getHeight() - 1.0D), UIConstants.HOVER_BLUE));
} else { } else {
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, getHeight() - 1.0F, UIConstants.SHADOW_GREY)); g2d.setPaint(new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, (float) (getHeight() - 1.0D), UIConstants.SHADOW_GREY));
} }

14
designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java

@ -176,11 +176,11 @@ 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) { private void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp; GradientPaint gp;
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) { if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1f, UIConstants.AUTHORITY_DARK_BLUE); gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1F, UIConstants.AUTHORITY_DARK_BLUE);
} else if (isPressedPainted) { } else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1, UIConstants.SELECT_TAB); gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1F, UIConstants.SELECT_TAB);
}else{ }else{
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER); gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1F, UIConstants.POP_DIALOG_BORDER);
} }
fillPaint(g2d, x, y, width, height, isRound, rectDirection, gp, UIConstants.ARC); fillPaint(g2d, x, y, width, height, isRound, rectDirection, gp, UIConstants.ARC);
@ -189,11 +189,11 @@ public class UISliderButtonUI extends BasicButtonUI {
private void fillRollOver(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) { private void fillRollOver(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp; GradientPaint gp;
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) { if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.HOVER_BLUE); gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1F, UIConstants.HOVER_BLUE);
} else if (isPressedPainted) { } else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER); gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1F, UIConstants.POP_DIALOG_BORDER);
}else { }else {
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER); gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1F, UIConstants.POP_DIALOG_BORDER);
} }
fillPaint(g2d, x, y, width, height, isRound, rectDirection, gp, UIConstants.ARC); fillPaint(g2d, x, y, width, height, isRound, rectDirection, gp, UIConstants.ARC);
} }
@ -225,4 +225,4 @@ public class UISliderButtonUI extends BasicButtonUI {
g2d.setColor(oldColor); g2d.setColor(oldColor);
} }
} }

6
designer-base/src/main/java/com/fr/design/gui/ibutton/UITabButton.java

@ -162,12 +162,12 @@ public class UITabButton extends UILabel implements UISelectedComponent {
Color blue = UIConstants.LIGHT_BLUE; Color blue = UIConstants.LIGHT_BLUE;
g2d.setColor(blue); g2d.setColor(blue);
g2d.fillRect(0, 1, w - 1, h / 2); g2d.fillRect(0, 1, w - 1, h / 2);
GradientPaint gp = new GradientPaint(1, 1, UIConstants.OCEAN_BLUE, 1, h - 1, blue); GradientPaint gp = new GradientPaint(1, 1, UIConstants.OCEAN_BLUE, 1, h - 1F, blue);
g2d.setPaint(gp); g2d.setPaint(gp);
g2d.fillRect(0, h / 2, w - 1, h / 2); g2d.fillRect(0, h / 2, w - 1, h / 2);
this.setForeground(UIConstants.FONT_COLOR); this.setForeground(UIConstants.FONT_COLOR);
} else if (!isSelected() && !isRollover) { } else if (!isSelected() && !isRollover) {
GradientPaint gp = new GradientPaint(1, 1, TOP, 1, h - 1, DOWN); GradientPaint gp = new GradientPaint(1, 1, TOP, 1, h - 1F, DOWN);
g2d.setPaint(gp); g2d.setPaint(gp);
g2d.fillRect(0, h / 2, w - 1, h / 2); g2d.fillRect(0, h / 2, w - 1, h / 2);
this.setForeground(UIConstants.FONT_COLOR); this.setForeground(UIConstants.FONT_COLOR);
@ -178,4 +178,4 @@ public class UITabButton extends UILabel implements UISelectedComponent {
} }
} }

4
designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java

@ -220,7 +220,7 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
protected void paintOtherBorder(Graphics g) { protected void paintOtherBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(UIConstants.BS); g2d.setStroke(UIConstants.BS);
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(UIConstants.LINE_COLOR); g2d.setColor(UIConstants.LINE_COLOR);
g2d.draw(shape); g2d.draw(shape);
} }
@ -252,4 +252,4 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
return true; return true;
} }
} }

21
designer-base/src/main/java/com/fr/design/gui/icombobox/LineComboBox.java

@ -3,6 +3,11 @@
*/ */
package com.fr.design.gui.icombobox; package com.fr.design.gui.icombobox;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.general.FRFont;
import com.fr.stable.Constants;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font; import java.awt.Font;
@ -11,18 +16,10 @@ import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.geom.GeneralPath; import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JList; import javax.swing.JList;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.general.FRFont;
import com.fr.stable.Constants;
/** /**
* Combobox for selecting line styles. * Combobox for selecting line styles.
@ -88,13 +85,13 @@ public class LineComboBox extends UIComboBox {
FontMetrics fm = GraphHelper.getFontMetrics(rfont); FontMetrics fm = GraphHelper.getFontMetrics(rfont);
if (style == Constants.LINE_NONE) { if (style == Constants.LINE_NONE) {
//draw "none" string //draw "none" string
GraphHelper.drawString(g2d, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None"), 4, (d.height - fm.getHeight()) / 2 + fm.getAscent()); GraphHelper.drawString(g2d, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None"), 4, (d.height - fm.getHeight()) / 2D + fm.getAscent());
} else { } else {
GraphHelper.drawLine(g2d, 4, d.height / 2, d.width - 8, d.height / 2, style); GraphHelper.drawLine(g2d, 4, d.height / 2D, d.width - 8D, d.height / 2D, style);
} }
if(isShowAxisWithLineStyle()) { // 带有坐标轴箭头的样式. if(isShowAxisWithLineStyle()) { // 带有坐标轴箭头的样式.
drawArrow(g2d, new Point2D.Double(4, d.height / 2), new Point2D.Double(d.width - 8, d.height/2)); drawArrow(g2d, new Point2D.Double(4, d.height / 2D), new Point2D.Double(d.width - 8D, d.height / 2D));
} }
} }
@ -142,4 +139,4 @@ public class LineComboBox extends UIComboBox {
private int style = Constants.LINE_NONE; private int style = Constants.LINE_NONE;
} }
} }

4
designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxButton.java

@ -172,11 +172,9 @@ public class UIComboBoxButton extends JButton {
} }
c.setBackground(UIManager.getColor("ComboBox.focusBackground")); c.setBackground(UIManager.getColor("ComboBox.focusBackground"));
if (c instanceof JComponent) { if (c instanceof JComponent) {
mustResetOpaque = true;
JComponent jc = (JComponent) c; JComponent jc = (JComponent) c;
savedOpaque = jc.isOpaque(); jc.isOpaque();
jc.setOpaque(true); jc.setOpaque(true);
paintFocus = true;
} }
} else { } else {
c.setForeground(comboBox.getForeground()); c.setForeground(comboBox.getForeground());

2
designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java

@ -46,7 +46,7 @@ public class UIModeControlContainer extends JLayeredPane {
private boolean isHideMode = false; private boolean isHideMode = false;
private boolean isSheeetCovered = false; private boolean isSheeetCovered = false;
private AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 30 / 100.0F); private AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f);
public UIModeControlContainer() { public UIModeControlContainer() {
this(new JPanel(), new JPanel()); this(new JPanel(), new JPanel());

42
designer-base/src/main/java/com/fr/design/gui/imenu/UIBasicMenuItemUI.java

@ -287,7 +287,7 @@ public class UIBasicMenuItemUI extends MenuItemUI {
View v = (View) c.getClientProperty(BasicHTML.propertyKey); View v = (View) c.getClientProperty(BasicHTML.propertyKey);
if (v != null) { if (v != null) {
d = getPreferredSize(c); d = getPreferredSize(c);
d.width -= v.getPreferredSpan(View.X_AXIS) - v.getMinimumSpan(View.X_AXIS); d.width -= (double) v.getPreferredSpan(View.X_AXIS) - (double) v.getMinimumSpan(View.X_AXIS);
} }
return d; return d;
} }
@ -345,7 +345,7 @@ public class UIBasicMenuItemUI extends MenuItemUI {
View v = (View) c.getClientProperty(BasicHTML.propertyKey); View v = (View) c.getClientProperty(BasicHTML.propertyKey);
if (v != null) { if (v != null) {
d = getPreferredSize(c); d = getPreferredSize(c);
d.width += v.getMaximumSpan(View.X_AXIS) - v.getPreferredSpan(View.X_AXIS); d.width += (double) v.getMaximumSpan(View.X_AXIS) - (double) v.getPreferredSpan(View.X_AXIS);
} }
return d; return d;
} }
@ -816,7 +816,6 @@ public class UIBasicMenuItemUI extends MenuItemUI {
// get Accelerator text // get Accelerator text
KeyStroke accelerator = b.getAccelerator(); KeyStroke accelerator = b.getAccelerator();
String acceleratorText = ""; String acceleratorText = "";
drawMenu(acceleratorText, accelerator, c, ic, maxValue, offset, paintIcon, b);
String text = layoutMenuItem(fm, b.getText(), fmAccel, acceleratorText, ic, null, String text = layoutMenuItem(fm, b.getText(), fmAccel, acceleratorText, ic, null,
arrowIcon, b.getVerticalAlignment(), b.getHorizontalAlignment(), arrowIcon, b.getVerticalAlignment(), b.getHorizontalAlignment(),
b.getVerticalTextPosition(), b.getHorizontalTextPosition(), viewRect, b.getVerticalTextPosition(), b.getHorizontalTextPosition(), viewRect,
@ -834,43 +833,6 @@ public class UIBasicMenuItemUI extends MenuItemUI {
g.setFont(holdf); g.setFont(holdf);
} }
private void drawMenu(String acceleratorText, KeyStroke accelerator, JComponent c,
Icon ic, int maxValue, int offset, Icon paintIcon, JMenuItem b) {
if (accelerator != null) {
int modifiers = accelerator.getModifiers();
if (modifiers > 0) {
acceleratorText = KeyEvent.getKeyModifiersText(modifiers);
//acceleratorText += "-";
acceleratorText += acceleratorDelimiter;
}
int keyCode = accelerator.getKeyCode();
if (keyCode != 0) {
acceleratorText += KeyEvent.getKeyText(keyCode);
} else {
acceleratorText += accelerator.getKeyChar();
}
}
if (!isTopLevelMenu()) {
if (c instanceof JCheckBoxMenuItem || c instanceof JRadioButtonMenuItem) {
ic = checkIcon;
if (checkIcon.getIconWidth() < maxValue) {
ic = new EmptyIcon(maxValue, checkIcon.getIconHeight());
offset = (maxValue - checkIcon.getIconWidth()) / 2;
}
paintIcon = null;
} else if (c instanceof JMenuItem) {
if (ic == null || ic.getIconWidth() < maxValue) {
int height = (ic == null) ? 2 : b.getIcon().getIconHeight();
int width = (ic == null) ? 2 : b.getIcon().getIconWidth();
offset = (maxValue - width) / 2;
ic = new EmptyIcon(maxValue, height);
}
}
}
}
private void drawAccText(String acceleratorText, Graphics g, JComponent p, ButtonModel model, FontMetrics fmAccel, JComponent c) { private void drawAccText(String acceleratorText, Graphics g, JComponent p, ButtonModel model, FontMetrics fmAccel, JComponent c) {
if (acceleratorText != null && !ComparatorUtils.equals(acceleratorText, "")) { if (acceleratorText != null && !ComparatorUtils.equals(acceleratorText, "")) {
//Get the maxAccWidth from the parent to calculate the offset. //Get the maxAccWidth from the parent to calculate the offset.

3
designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTable.java

@ -157,8 +157,7 @@ public class UIMenuTable extends JTable {
@Override @Override
public TableCellRenderer getDefaultRenderer(Class<?> columnClass) { public TableCellRenderer getDefaultRenderer(Class<?> columnClass) {
columnClass = UITable.class; return super.getDefaultRenderer(UITable.class);
return super.getDefaultRenderer(columnClass);
} }
private class UITableRender implements TableCellRenderer { private class UITableRender implements TableCellRenderer {

2
designer-base/src/main/java/com/fr/design/gui/iprogressbar/UIProgressBorder.java

@ -72,6 +72,7 @@ public class UIProgressBorder extends UIRoundedBorder {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
} }
@SuppressWarnings("squid:S2164")
private void paintBorderShadow(Graphics2D g2, int shadowWidth, int x, int y, int width, int height) { private void paintBorderShadow(Graphics2D g2, int shadowWidth, int x, int y, int width, int height) {
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
shadowWidth = Math.max(shadowWidth, 2); shadowWidth = Math.max(shadowWidth, 2);
@ -85,6 +86,7 @@ public class UIProgressBorder extends UIRoundedBorder {
} }
} }
@SuppressWarnings("squid:S2164")
private static Color getMixedColor(Color c1, float pct1, Color c2, float pct2) { private static Color getMixedColor(Color c1, float pct1, Color c2, float pct2) {
float[] clr1 = c1.getComponents(null); float[] clr1 = c1.getComponents(null);
float[] clr2 = c2.getComponents(null); float[] clr2 = c2.getComponents(null);

44
designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIBasicScrollBarUI.java

@ -165,50 +165,6 @@ public class UIBasicScrollBarUI extends BasicScrollBarUI {
// drawColorAndLength(g, t, x2, y2, color); // drawColorAndLength(g, t, x2, y2, color);
} }
private void drawColorAndLength(Graphics g, Rectangle t, int x2, int y2, Color color) {
if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
int y1 = t.y + (t.height) / 2 - 4;
y2 = Math.min(y1 + 8, t.y + t.height - 5);
int y = y1;
// we take only saturation & brightness and apply them
// to the background color (normal/rollover/pressed)
g.setColor(UISBChooser.getAdjustedColor(color, 0, 71));
while (y < y2) {
g.drawLine(5, y, 11, y);
y += 2;
}
y = y1 + 1;
g.setColor(UISBChooser.getAdjustedColor(color, 0, -13));
while (y < y2) {
g.drawLine(6, y, 12, y);
y += 2;
}
} else {
int x1 = t.x + (t.width) / 2 - 4;
x2 = Math.min(x1 + 8, t.x + t.width - 5);
int x = x1 + 1;
// we take only saturation & brightness and apply them
// to the background color (normal/rollover/pressed)
g.setColor(UISBChooser.getAdjustedColor(color, 0, 71));
while (x < x2) {
g.drawLine(x, 5, x, 11);
x += 2;
}
x = x1;
g.setColor(UISBChooser.getAdjustedColor(color, 0, -13));
while (x < x2) {
g.drawLine(x, 6, x, 12);
x += 2;
}
}
}
private void drawVertical(Graphics g, Rectangle t, int xs, int ys, int x2, private void drawVertical(Graphics g, Rectangle t, int xs, int ys, int x2,
Color pressedColor, Color rolloverColor, Color pressedColor, Color rolloverColor,
Color normalColor) { Color normalColor) {

8
designer-base/src/main/java/com/fr/design/gui/iscrollbar/UISBChooser.java

@ -90,6 +90,7 @@ public class UISBChooser extends JDialog {
(frame.getHeight() - getSize().height) / 2); (frame.getHeight() - getSize().height) / 2);
} }
@SuppressWarnings("squid:S1226")
private void initP3(JPanel p3, JPanel p1) { private void initP3(JPanel p3, JPanel p1) {
p3 = new JPanel(new FlowLayout(FlowLayout.LEFT, 3, 8)); p3 = new JPanel(new FlowLayout(FlowLayout.LEFT, 3, 8));
p3.add(new JLabel("R:")); p3.add(new JLabel("R:"));
@ -198,6 +199,7 @@ public class UISBChooser extends JDialog {
twoColorField.setUpperColor(outColor); twoColorField.setUpperColor(outColor);
} }
@SuppressWarnings("squid:S2164")
public static Color getAdjustedColor(Color inColor, int sat, int bri) { public static Color getAdjustedColor(Color inColor, int sat, int bri) {
Color briColor = inColor; Color briColor = inColor;
@ -219,9 +221,9 @@ public class UISBChooser extends JDialog {
int dg = briColor.getGreen() - satColor.getGreen(); int dg = briColor.getGreen() - satColor.getGreen();
int db = briColor.getBlue() - satColor.getBlue(); int db = briColor.getBlue() - satColor.getBlue();
r = briColor.getRed() - (int) Math.round(dr * sat / VALUE * 1.0); r = briColor.getRed() - (int) Math.round(dr * sat / (VALUE * 1.0));
g = briColor.getGreen() - (int) Math.round(dg * sat / VALUE * 1.0); g = briColor.getGreen() - (int) Math.round(dg * sat / (VALUE * 1.0));
b = briColor.getBlue() - (int) Math.round(db * sat / VALUE * 1.0); b = briColor.getBlue() - (int) Math.round(db * sat / (VALUE * 1.0));
} else { } else {
float d = ColorRoutines.getGreyValue(briColor); float d = ColorRoutines.getGreyValue(briColor);
float dr = briColor.getRed() - d; float dr = briColor.getRed() - d;

2
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxView.java

@ -656,7 +656,7 @@ public class SyntaxView extends View implements TabExpander,
if (tabSize == 0) if (tabSize == 0)
return x; return x;
int ntabs = (((int) x) - tabBase) / tabSize; int ntabs = (((int) x) - tabBase) / tabSize;
return tabBase + ((ntabs + 1) * tabSize); return (float) (tabBase + ((ntabs + 1) * tabSize));
} }

4
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/TokenIterator.java

@ -9,6 +9,7 @@
package com.fr.design.gui.syntax.ui.rsyntaxtextarea; package com.fr.design.gui.syntax.ui.rsyntaxtextarea;
import java.util.Iterator; import java.util.Iterator;
import java.util.NoSuchElementException;
/** /**
@ -73,6 +74,9 @@ class TokenIterator implements Iterator<Token> {
token = null; token = null;
} }
} }
else {
throw new NoSuchElementException();
}
return t; return t;
} }

9
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/WrappedSyntaxView.java

@ -268,7 +268,7 @@ public class WrappedSyntaxView extends BoxView implements TabExpander,
if (host.getEOLMarkersVisible()) { if (host.getEOLMarkersVisible()) {
g.setColor(host.getForegroundForTokenType(Token.WHITESPACE)); g.setColor(host.getForegroundForTokenType(Token.WHITESPACE));
g.setFont(host.getFontForTokenType(Token.WHITESPACE)); g.setFont(host.getFontForTokenType(Token.WHITESPACE));
g.drawString("\u00B6", x, y-fontHeight); g.drawString("\u00B6", x, (float) (y-fontHeight));
} }
} }
@ -458,7 +458,7 @@ public class WrappedSyntaxView extends BoxView implements TabExpander,
if (host.getEOLMarkersVisible()) { if (host.getEOLMarkersVisible()) {
g.setColor(host.getForegroundForTokenType(Token.WHITESPACE)); g.setColor(host.getForegroundForTokenType(Token.WHITESPACE));
g.setFont(host.getFontForTokenType(Token.WHITESPACE)); g.setFont(host.getFontForTokenType(Token.WHITESPACE));
g.drawString("\u00B6", x, y-fontHeight); g.drawString("\u00B6", x, (float) (y-fontHeight));
} }
} }
@ -841,10 +841,11 @@ public class WrappedSyntaxView extends BoxView implements TabExpander,
* @return the tab stop, measured in points >= 0 * @return the tab stop, measured in points >= 0
*/ */
public float nextTabStop(float x, int tabOffset) { public float nextTabStop(float x, int tabOffset) {
if (tabSize == 0) if (tabSize == 0) {
return x; return x;
}
int ntabs = ((int) x - tabBase) / tabSize; int ntabs = ((int) x - tabBase) / tabSize;
return tabBase + ((ntabs + 1) * tabSize); return (float) (tabBase + ((ntabs + 1) * tabSize));
} }

2
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java

@ -69,7 +69,7 @@ public class LogHandlerBarUI extends ComponentUI implements MouseListener, Focus
int w = button.getWidth(); int w = button.getWidth();
int h = button.getHeight(); int h = button.getHeight();
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
GradientPaint gp = new GradientPaint(1, 1, darkColor, 1, h - 1, darkColor); GradientPaint gp = new GradientPaint(1, 1, darkColor, 1, h - 1f, darkColor);
g2d.setPaint(gp); g2d.setPaint(gp);
g2d.fillRect(0, 0, w, h); g2d.fillRect(0, 0, w, h);
} }

2
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java

@ -31,7 +31,7 @@ import java.util.List;
public class FileVersionDialog extends UIDialog { public class FileVersionDialog extends UIDialog {
public static final long DELAY = 24 * 60 * 60 * 1000; public static final long DELAY = 24 * 60 * 60 * 1000L;
private UIButton okBtn; private UIButton okBtn;
private UIButton cancelBtn; private UIButton cancelBtn;
private DateEditor dateEditor; private DateEditor dateEditor;

6
designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java

@ -159,15 +159,15 @@ public class PatternBackgroundPane extends BPane {
Dimension d = getSize(); Dimension d = getSize();
this.patternBackground.paint(g2d, new Rectangle2D.Double(0, 0, this.patternBackground.paint(g2d, new Rectangle2D.Double(0, 0,
d.width - 1, d.height - 1)); d.width - 1d, d.height - 1d));
if (this.pIndex == patternIndex) {// it's selected. if (this.pIndex == patternIndex) {// it's selected.
g2d.setPaint(new Color(255, 51, 0)); g2d.setPaint(new Color(255, 51, 0));
} else { } else {
g2d.setPaint(Color.gray); g2d.setPaint(Color.gray);
} }
GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1, GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1d,
d.height - 1)); d.height - 1d));
} }
public Dimension getPreferredSize() { public Dimension getPreferredSize() {

8
designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java

@ -152,8 +152,8 @@ public class TextureBackgroundPane extends BPane {
Dimension d = getSize(); Dimension d = getSize();
g2d.setPaint(this.buttonTexturePaint); g2d.setPaint(this.buttonTexturePaint);
GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, d.width - 1, GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, d.width - 1d,
d.height - 1)); d.height - 1d));
if (ComparatorUtils.equals(texturePaint, this.buttonTexturePaint)) {// it's if (ComparatorUtils.equals(texturePaint, this.buttonTexturePaint)) {// it's
// selected. // selected.
@ -161,8 +161,8 @@ public class TextureBackgroundPane extends BPane {
} else { } else {
g2d.setPaint(Color.gray); g2d.setPaint(Color.gray);
} }
GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1, GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1d,
d.height - 1)); d.height - 1d));
} }
public Dimension getPreferredSize() { public Dimension getPreferredSize() {

40
designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java

@ -332,8 +332,8 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
* @param p The point where the MouseEvent occurred. * @param p The point where the MouseEvent occurred.
*/ */
private void updateS(Point p) { private void updateS(Point p) {
float h = p.x * 1f / IMG_WIDTH; double h = p.x * 1D / IMG_WIDTH;
float b = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT; double b = (IMG_HEIGHT - p.y * 1D) / IMG_HEIGHT;
internalChange = true; internalChange = true;
hSpinner.setValue(new Integer((int) (h * H_MAX))); hSpinner.setValue(new Integer((int) (h * H_MAX)));
@ -349,8 +349,8 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
* @param p The point where the MouseEvent occurred. * @param p The point where the MouseEvent occurred.
*/ */
private void updateB(Point p) { private void updateB(Point p) {
float h = p.x * 1f / IMG_WIDTH; double h = p.x * 1D / IMG_WIDTH;
float s = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT; double s = (IMG_HEIGHT - p.y * 1D) / IMG_HEIGHT;
internalChange = true; internalChange = true;
hSpinner.setValue(new Integer((int) (h * H_MAX))); hSpinner.setValue(new Integer((int) (h * H_MAX)));
@ -523,9 +523,9 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
private void adjustHSLValue(float[] hsbVals) { private void adjustHSLValue(float[] hsbVals) {
if (!spinnerTrigger) { if (!spinnerTrigger) {
hSpinner.setValue(new Integer((int) (hsbVals[0] * HSPINNER_VALUE))); hSpinner.setValue(new Integer((int) ((double) hsbVals[0] * HSPINNER_VALUE)));
sSpinner.setValue(new Integer((int) (hsbVals[1] * SSPINNER_VALUE))); sSpinner.setValue(new Integer((int) ((double) hsbVals[1] * SSPINNER_VALUE)));
bSpinner.setValue(new Integer((int) (hsbVals[2] * LSPINNER_VALUE))); bSpinner.setValue(new Integer((int) ((double) hsbVals[2] * LSPINNER_VALUE)));
} }
switch (locked) { switch (locked) {
case HLOCKED: case HLOCKED:
@ -534,9 +534,9 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
} }
if (!handlingMouse) { if (!handlingMouse) {
gradientPoint.x = (int) ((1 gradientPoint.x = (int) ((1
- ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_WIDTH); - ((Number) sSpinner.getValue()).intValue() / (double) SSPINNER_VALUE) * IMG_WIDTH);
gradientPoint.y = (int) ((1 gradientPoint.y = (int) ((1
- ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); - ((Number) bSpinner.getValue()).intValue() / (double) LSPINNER_VALUE) * IMG_HEIGHT);
} }
break; break;
case SLOCKED: case SLOCKED:
@ -544,9 +544,9 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
slider.setValue(((Number) sSpinner.getValue()).intValue()); slider.setValue(((Number) sSpinner.getValue()).intValue());
} }
if (!handlingMouse) { if (!handlingMouse) {
gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH); gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / (double) HSPINNER_VALUE * IMG_WIDTH);
gradientPoint.y = (int) ((1 gradientPoint.y = (int) ((1
- ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); - ((Number) bSpinner.getValue()).intValue() / (double) LSPINNER_VALUE) * IMG_HEIGHT);
} }
break; break;
case BLOCKED: case BLOCKED:
@ -554,18 +554,18 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
slider.setValue(((Number) bSpinner.getValue()).intValue()); slider.setValue(((Number) bSpinner.getValue()).intValue());
} }
if (!handlingMouse) { if (!handlingMouse) {
gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH); gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / (double) HSPINNER_VALUE * IMG_WIDTH);
gradientPoint.y = (int) ((1 gradientPoint.y = (int) ((1
- ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_HEIGHT); - ((Number) sSpinner.getValue()).intValue() / (double) SSPINNER_VALUE) * IMG_HEIGHT);
} }
break; break;
} }
} }
private void updateImageAndTrack() { private void updateImageAndTrack() {
float h = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; float h = (float) (((Number) hSpinner.getValue()).intValue() / (double) HSPINNER_VALUE);
float s = ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE; float s = (float) (((Number) sSpinner.getValue()).intValue() / (double) SSPINNER_VALUE);
float b = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; float b = (float) (((Number) bSpinner.getValue()).intValue() / (double) LSPINNER_VALUE);
spinnerTrigger = true; spinnerTrigger = true;
getColorSelectionModel().setSelectedColor(new Color(Color.HSBtoRGB(h, s, b))); getColorSelectionModel().setSelectedColor(new Color(Color.HSBtoRGB(h, s, b)));
@ -837,12 +837,12 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
private void updateHLockImage() { private void updateHLockImage() {
int index = 0; int index = 0;
int[] pix = new int[IMG_WIDTH * IMG_HEIGHT]; int[] pix = new int[IMG_WIDTH * IMG_HEIGHT];
float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; float hValue = (float)(((Number) hSpinner.getValue()).intValue() / (double) HSPINNER_VALUE );
for (int j = 0; j < IMG_HEIGHT; j++) { for (int j = 0; j < IMG_HEIGHT; j++) {
for (int i = 0; i < IMG_WIDTH; i++) { for (int i = 0; i < IMG_WIDTH; i++) {
pix[index++] = Color.HSBtoRGB(hValue, (IMG_WIDTH - i * 1f) / IMG_WIDTH, pix[index++] = Color.HSBtoRGB(hValue, (float) ((IMG_WIDTH - i * 1D) / IMG_WIDTH),
(IMG_HEIGHT - j * 1f) / IMG_HEIGHT) | (BINARY_FOR_EIGHT << TWENTY_FOUR); (float) ((IMG_HEIGHT - j * 1D) / IMG_HEIGHT)) | (BINARY_FOR_EIGHT << TWENTY_FOUR);
} }
} }
@ -1076,4 +1076,4 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
public void colorSetted(ColorCell cc) { public void colorSetted(ColorCell cc) {
} }
} }

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

@ -1209,7 +1209,7 @@ public class GridUI extends ComponentUI {
* @return 有效返回true * @return 有效返回true
*/ */
public static boolean validate(Rectangle2D rect) { public static boolean validate(Rectangle2D rect) {
return rect != null && rect.getX() != INVALID_INTEGER; return rect != null && ComparatorUtils.equals(rect.getX(), INVALID_INTEGER);
} }
@ -1268,4 +1268,4 @@ public class GridUI extends ComponentUI {
paginateLineList.add(new Line2D.Double(0, sumHeight, width, sumHeight)); paginateLineList.add(new Line2D.Double(0, sumHeight, width, sumHeight));
} }
} }
} }

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

@ -141,7 +141,7 @@ class PrismImageLoader2 implements com.sun.javafx.tk.ImageLoader {
ImageFrame imageFrame = loader.load(i, w, h, preserveRatio, smooth); ImageFrame imageFrame = loader.load(i, w, h, preserveRatio, smooth);
images[i] = convert(imageFrame); images[i] = convert(imageFrame);
synchronized (this) { synchronized (this) {
this.notify(); notifyAll();
} }
} }
} catch (ImageStorageException e) { } catch (ImageStorageException e) {

Loading…
Cancel
Save