From 3bc76994650757f860fb5032de93e135d5efc3fb Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Mon, 22 Aug 2016 16:46:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E8=89=B2=E7=9A=84=E6=B8=90=E5=8F=98?= =?UTF-8?q?=E8=89=B2=E6=BB=91=E5=9D=97=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/gradient/FixedGradientBar.java | 19 +++++++++++++++++++ .../chart/gui/style/ChartFillStylePane.java | 5 +++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 designer_base/src/com/fr/design/style/background/gradient/FixedGradientBar.java diff --git a/designer_base/src/com/fr/design/style/background/gradient/FixedGradientBar.java b/designer_base/src/com/fr/design/style/background/gradient/FixedGradientBar.java new file mode 100644 index 0000000000..33df00bc59 --- /dev/null +++ b/designer_base/src/com/fr/design/style/background/gradient/FixedGradientBar.java @@ -0,0 +1,19 @@ +package com.fr.design.style.background.gradient; + +import com.fr.design.style.background.gradient.GradientBar; + +/** + * 这个bar不能拖拽滑动 + */ +public class FixedGradientBar extends GradientBar { + private static final long serialVersionUID = 2787525421995954889L; + + public FixedGradientBar(int minvalue, int maxvalue) { + super(minvalue, maxvalue); + } + + @Override + protected void addMouseDragListener() { + //不添加拖拽事件 + } +} \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java index 5de599d9a5..fbe5d1171d 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java @@ -12,6 +12,7 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.background.gradient.FixedGradientBar; import com.fr.design.style.background.gradient.GradientBar; import com.fr.general.Inter; import com.fr.stable.StringUtils; @@ -33,7 +34,7 @@ public class ChartFillStylePane extends BasicBeanPane{ protected UIComboBox styleSelectBox; protected JPanel customPane; protected JPanel changeColorSetPane; - protected GradientBar colorGradient; + protected FixedGradientBar colorGradient; protected CardLayout cardLayout; @@ -55,7 +56,7 @@ public class ChartFillStylePane extends BasicBeanPane{ customPane.add(buttonPane, BorderLayout.NORTH); changeColorSetPane = new JPanel(cardLayout = new CardLayout()); - changeColorSetPane.add(colorGradient = new GradientBar(4, 130), "gradient"); + changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 130), "gradient"); changeColorSetPane.add(colorAcc = new ChartAccColorPane(), "acc"); cardLayout.show(changeColorSetPane, "acc"); customPane.add(changeColorSetPane, BorderLayout.CENTER);