Browse Source

REPORT-4604 设计器视觉修改

缩放的JSpinner的UI改了下
master
momeak 7 years ago
parent
commit
197e290fe3
  1. 10
      designer_base/src/com/fr/design/gui/ispinner/UISpinnerUI.java
  2. 2
      designer_base/src/com/fr/design/mainframe/JSliderPane.java

10
designer_base/src/com/fr/design/gui/ispinner/UISpinnerUI.java

@ -5,7 +5,9 @@
package com.fr.design.gui.ispinner; package com.fr.design.gui.ispinner;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.SpecialUIButton; import com.fr.design.gui.ibutton.SpecialUIButton;
import com.fr.design.gui.ibutton.UIButton;
import javax.swing.*; import javax.swing.*;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
@ -42,8 +44,8 @@ public class UISpinnerUI extends BasicSpinnerUI {
} }
protected Component createPreviousButton() { protected Component createPreviousButton() {
JButton b = new SpecialUIButton(new UISpinnerButtonUI(SwingConstants.SOUTH)); // JButton b = new SpecialUIButton(new UISpinnerButtonUI(SwingConstants.SOUTH));
JButton b = new UIButton(UIConstants.ARROW_DOWN_ICON);
b.putClientProperty("isSpinnerButton", Boolean.TRUE); b.putClientProperty("isSpinnerButton", Boolean.TRUE);
b.setFocusable(false); b.setFocusable(false);
b.addActionListener(PREVIOUS_BUTTON_HANDLER); b.addActionListener(PREVIOUS_BUTTON_HANDLER);
@ -53,8 +55,8 @@ public class UISpinnerUI extends BasicSpinnerUI {
} }
protected Component createNextButton() { protected Component createNextButton() {
JButton b = new SpecialUIButton(new UISpinnerButtonUI(SwingConstants.NORTH)); // JButton b = new SpecialUIButton(new UISpinnerButtonUI(SwingConstants.NORTH));
JButton b = new UIButton(UIConstants.ARROW_UP_ICON);
b.putClientProperty("isSpinnerButton", Boolean.TRUE); b.putClientProperty("isSpinnerButton", Boolean.TRUE);
b.setFocusable(false); b.setFocusable(false);
b.addActionListener(NEXT_BUTTON_HANDLER); b.addActionListener(NEXT_BUTTON_HANDLER);

2
designer_base/src/com/fr/design/mainframe/JSliderPane.java

@ -8,6 +8,7 @@ import com.fr.design.gui.ibutton.UISliderButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.islider.UISlider; import com.fr.design.gui.islider.UISlider;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinnerUI;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -132,6 +133,7 @@ public class JSliderPane extends JPanel {
return new Point(event.getX(), event.getY() - TOOLTIP_Y); return new Point(event.getX(), event.getY() - TOOLTIP_Y);
} }
}; };
showValSpinner.setUI(new UISpinnerUI());
showValSpinner.setEnabled(true); showValSpinner.setEnabled(true);
showValSpinner.addChangeListener(showValSpinnerChangeListener); showValSpinner.addChangeListener(showValSpinnerChangeListener);
showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT)); showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT));

Loading…
Cancel
Save