Browse Source

REPORT-3738 [9.0一轮回归]样式中单元格颜色下拉框点击异常

master
MoMeak 7 years ago
parent
commit
e37f47eaef
  1. 4
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java
  2. 3
      designer_base/src/com/fr/design/gui/itextfield/UITextFieldUI.java
  3. 18
      designer_base/src/com/fr/design/style/AbstractSelectBox.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); super.paint(g, c);
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Color linecolor = UIConstants.TITLED_BORDER_COLOR; Color linecolor = UIConstants.POP_DIALOG_BORDER;
if (comboBox.isPopupVisible()) { if (comboBox.isPopupVisible()) {
arrowButton.setSelected(true); arrowButton.setSelected(true);
} else { } else {
linecolor = UIConstants.TITLED_BORDER_COLOR; linecolor = UIConstants.POP_DIALOG_BORDER;
arrowButton.setSelected(false); arrowButton.setSelected(false);
} }
g2d.setColor(linecolor); g2d.setColor(linecolor);

3
designer_base/src/com/fr/design/gui/itextfield/UITextFieldUI.java

@ -67,7 +67,8 @@ public class UITextFieldUI extends BasicTextFieldUI {
g2d.setColor(UIConstants.TEXT_FILED_BORDER_SELECTED); g2d.setColor(UIConstants.TEXT_FILED_BORDER_SELECTED);
g2d.drawRect(0, 0, width - 1, height - 1); g2d.drawRect(0, 0, width - 1, height - 1);
} else { } else {
GUIPaintUtils.drawBorder(g2d, 0, 0, width, height, isRound, rectDirection); g2d.setColor(UIConstants.POP_DIALOG_BORDER);
g2d.drawRect(0, 0, width - 1, height - 1);
} }
} }

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

Loading…
Cancel
Save