From 8bc46c380e3584b1def9fbffa5f1745be49004f6 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 6 Dec 2017 10:24:06 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-5944=20=E7=BC=A9=E6=94=BE=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E6=9D=A1=E6=BB=91=E5=9D=97=E5=9B=BE=E6=A0=87=E4=B8=8E?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E4=B8=8D=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../images/control/icon_thumb_normal.png | Bin 0 -> 173 bytes .../com/fr/design/mainframe/JSliderPane.java | 25 +++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/control/icon_thumb_normal.png diff --git a/designer_base/src/com/fr/design/images/control/icon_thumb_normal.png b/designer_base/src/com/fr/design/images/control/icon_thumb_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..7fea2e657267fbc40a23baf578e4a0635a2327cd GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|(mh=qLo5W7 z6C^SYbev{XQ&XGA!_%`_;nV-i=jK>$mYp4?meV9)cr5b&|Nqk&6I&c-tSXdZxX5v_ z;f$L(({jcaT!kOqc@q*OjwBv9apDJySm}wJ84^9m9=HC_ROl5r`~Px+6q`IR!~QQ) V5}Qv&1^}&O@O1TaS?83{1OPkjJ<0$8 literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index d056551399..c2f4da0e7f 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -19,11 +19,14 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.plaf.basic.BasicSliderUI; -import javax.swing.text.BadLocationException; import javax.swing.text.DefaultFormatterFactory; import javax.swing.text.NumberFormatter; import java.awt.*; -import java.awt.event.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseEvent; import java.math.BigDecimal; /** @@ -31,6 +34,7 @@ import java.math.BigDecimal; */ public class JSliderPane extends JPanel { + public static final Image APPFIT_V0 = BaseUtils.readImage("com/fr/design/images/control/icon_thumb_normal.png"); private static final double ONEPOINTEIGHT = 1.8; private static final int SIX = 6; private static final int TEN = 10; @@ -433,8 +437,8 @@ public class JSliderPane extends JPanel { class JSliderPaneUI extends BasicSliderUI { private static final Color BACK_COLOR = new Color(245, 245, 247); - private static final int VERTICAL_WIDTH = 11; - private static final int VERTICAL_HEIGHT = 16; + private static final int THUMB_XOFFSET = 8; + private static final int THUMB_YOFFSET = 3; private static final int FOUR = 4; private static final int FIVE = 5; private static final int SIX = 6; @@ -451,13 +455,9 @@ class JSliderPaneUI extends BasicSliderUI { public void paintThumb(Graphics g) { Rectangle knobBounds = thumbRect; - int w = knobBounds.width; - int h = knobBounds.height; Graphics2D g2d = (Graphics2D) g; - - g2d.translate(knobBounds.x, knobBounds.y); - g2d.setColor(new Color(51, 51, 52)); - g2d.fillRoundRect(0, SIX, FOUR, 9, 2, 2); + g2d.drawImage(JSliderPane.APPFIT_V0, knobBounds.x - THUMB_XOFFSET, knobBounds.y + THUMB_YOFFSET, null); + g2d.dispose(); } /** */ @@ -481,6 +481,11 @@ class JSliderPaneUI extends BasicSliderUI { } } + public void setThumbLocation(int x, int y) { + super.setThumbLocation(x, y); + slider.repaint(); + } + } class PopupPane extends JPopupMenu {