Browse Source

Merge pull request #1078 in BA/design from ~MOMEAK/design9.0:release/9.0 to release/9.0

* commit '8c7e35b81eae46b43266e74f7e9731b8cb7881d2':
  REPORT-3738 [9.0一轮回归]样式中单元格颜色下拉框点击异常
  REPORT-3738 [9.0一轮回归]样式中单元格颜色下拉框点击异常
master
superman 7 years ago
parent
commit
bfca3e9e34
  1. 4
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java
  2. 18
      designer_base/src/com/fr/design/style/AbstractSelectBox.java
  3. 2
      designer_base/src/com/fr/design/utils/gui/GUIPaintUtils.java

4
designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java

@ -57,12 +57,12 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener {
super.paint(g, c);
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Color linecolor = UIConstants.TITLED_BORDER_COLOR;
Color linecolor = UIConstants.POP_DIALOG_BORDER;
if (comboBox.isPopupVisible()) {
arrowButton.setSelected(true);
} else {
linecolor = UIConstants.TITLED_BORDER_COLOR;
linecolor = UIConstants.POP_DIALOG_BORDER;
arrowButton.setSelected(false);
}
g2d.setColor(linecolor);

18
designer_base/src/com/fr/design/style/AbstractSelectBox.java

@ -38,12 +38,10 @@ public abstract class AbstractSelectBox<T> extends AbstractPopBox implements Mou
displayComponent.setEmptyBackground();
displayComponent.setBorder(new TriggleLineBorder());
triggleButton = new UIToggleButton(UIConstants.ARROW_DOWN_ICON);
triggleButton.setRoundBorder(true, Constants.LEFT);
triggleButton.setPreferredSize(new Dimension(21, 20));
triggleButton.setPreferredSize(new Dimension(20, 20));
JPanel displayPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
displayPane.add(displayComponent, BorderLayout.CENTER);
displayComponent.setPreferredSize(new Dimension(preWidth, displayPane.getPreferredSize().height));
displayComponent.addMouseListener(mouseListener);
@ -59,7 +57,6 @@ public abstract class AbstractSelectBox<T> extends AbstractPopBox implements Mou
}
public void ancestorRemoved(AncestorEvent evt) {
hidePopupMenu();
}
public void ancestorMoved(AncestorEvent event) {
@ -75,8 +72,6 @@ public abstract class AbstractSelectBox<T> extends AbstractPopBox implements Mou
triggleButton.setEnabled(enabled);
}
@Override
public JPanel initWindowPane(double preWidth) {
// TODO Auto-generated method stub
@ -88,8 +83,8 @@ public abstract class AbstractSelectBox<T> extends AbstractPopBox implements Mou
super.paint(g);
Graphics2D g2d = (Graphics2D)g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(UIConstants.LINE_COLOR);
g2d.drawRoundRect(0, 0, this.getWidth() , this.getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
g2d.setColor(UIConstants.POP_DIALOG_BORDER);
g2d.drawRoundRect(0, 0, this.getWidth() - 1 , this.getHeight() - 1, 4, 4);
triggleButton.setSelected(isPopupVisible());
}
@ -105,15 +100,12 @@ public abstract class AbstractSelectBox<T> extends AbstractPopBox implements Mou
private class TriggleLineBorder extends AbstractBorder {
private static final long serialVersionUID = 1065857667981063530L;
protected Insets borderInsets = new Insets(0, 0, 0, 1);
protected Insets borderInsets = new Insets(0, 0, 0, 0);
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
g.translate(x, y);
g.setColor(UIConstants.LINE_COLOR);
g.drawLine(3, 0, w-2, 0);
g.drawLine(3, h - 1, w-2, h - 1);
g.drawLine(w - 1, 0, w - 1, h);
g.setColor(UIConstants.POP_DIALOG_BORDER);
g.translate(-x, -y);
}

2
designer_base/src/com/fr/design/utils/gui/GUIPaintUtils.java

@ -19,7 +19,7 @@ public class GUIPaintUtils {
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
g2d.setColor(UIConstants.AUTHORITY_LINE_COLOR);
} else {
g2d.setColor(UIConstants.TITLED_BORDER_COLOR);
g2d.setColor(UIConstants.POP_DIALOG_BORDER);
}
if (isRound) {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

Loading…
Cancel
Save