Browse Source

Pull request #5591: REPORT-58225 && CHART-20385 【11.0】图例主题颜色控件展示异常;【主题切换】除图表外所有渐变色设置,打开颜色控件显示不正确

Merge in DESIGN/design from ~KERRY/design_10.0:feature/x to feature/x

* commit 'e08a30471164eeb45871a4a07b4e2b9cc033023b':
  代码修改
  REPORT-58225【主题切换】除图表外所有渐变色设置,打开颜色控件显示不正确
research/11.0
kerry 3 years ago
parent
commit
fbe446717b
  1. 8
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java
  2. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartSeriesStylePane.java
  3. 39
      designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarNoTheme.java
  4. 53
      designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarWithPopMenu.java
  5. 43
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  6. 5
      designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java
  7. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ColorSelectPaneWithOutTransparent.java

8
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java

@ -15,7 +15,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.background.gradient.FixedGradientBar; import com.fr.design.style.background.gradient.FixedGradientBarNoTheme;
import com.fr.design.style.color.ColorAdjustPane; import com.fr.design.style.color.ColorAdjustPane;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -40,7 +40,7 @@ public class ColorFillStylePane extends BasicBeanPane<ColorFillStyle> {
private ColorSchemeComboBox styleSelectBox; private ColorSchemeComboBox styleSelectBox;
private JPanel customPane; private JPanel customPane;
private JPanel changeColorSetPane; private JPanel changeColorSetPane;
private FixedGradientBar colorGradient; private FixedGradientBarNoTheme colorGradient;
private CardLayout cardLayout; private CardLayout cardLayout;
@ -69,8 +69,8 @@ public class ColorFillStylePane extends BasicBeanPane<ColorFillStyle> {
}; };
changeColorSetPane = new JPanel(cardLayout = new CardLayout()); changeColorSetPane = new JPanel(cardLayout = new CardLayout());
changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 130), "gradient"); changeColorSetPane.add(colorGradient = new FixedGradientBarNoTheme(4, 130), "gradient");
gradientColors = new Color[]{Color.WHITE, FixedGradientBar.NEW_CHARACTER}; gradientColors = new Color[]{Color.WHITE, FixedGradientBarNoTheme.NEW_CHARACTER};
changeColorSetPane.add(colorAdjustPane = new ColorAdjustPane(), "acc"); changeColorSetPane.add(colorAdjustPane = new ColorAdjustPane(), "acc");
accColors = ColorAdjustPane.DEFAULT_COLORS; accColors = ColorAdjustPane.DEFAULT_COLORS;
cardLayout.show(changeColorSetPane, "acc"); cardLayout.show(changeColorSetPane, "acc");

6
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartSeriesStylePane.java

@ -5,7 +5,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog; import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog;
import com.fr.design.style.background.gradient.FixedGradientBarWithPopMenu; import com.fr.design.style.background.gradient.FixedGradientBar;
import java.util.List; import java.util.List;
import java.awt.Color; import java.awt.Color;
@ -22,12 +22,12 @@ import java.awt.event.ActionListener;
public class ChartSeriesStylePane extends AbstractChartStylePane { public class ChartSeriesStylePane extends AbstractChartStylePane {
private UIButtonGroup<Integer> colorTypeButton; private UIButtonGroup<Integer> colorTypeButton;
private FixedGradientBarWithPopMenu gradientBar; private FixedGradientBar gradientBar;
protected void initComponents() { protected void initComponents() {
colorTypeButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), colorTypeButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"),
Toolkit.i18nText("Fine-Design_Chart_Legend_Gradual")}); Toolkit.i18nText("Fine-Design_Chart_Legend_Gradual")});
gradientBar = new FixedGradientBarWithPopMenu(4, 130); gradientBar = new FixedGradientBar(4, 130);
initListener(); initListener();
} }

39
designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarNoTheme.java

@ -0,0 +1,39 @@
package com.fr.design.style.background.gradient;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.style.color.ColorSelectDetailPane;
import com.fr.design.style.color.ColorSelectDialog;
import javax.swing.JPanel;
import java.awt.Color;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2021-08-19
*/
public class FixedGradientBarNoTheme extends FixedGradientBar {
public FixedGradientBarNoTheme(int minvalue, int maxvalue) {
super(minvalue, maxvalue);
}
protected void clickButton(int select) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
Color selectColor = getList().get(select).getColorInner() == null ? Color.WHITE : getList().get(select).getColorInner();
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, FixedGradientBarNoTheme.this);
Color color = FixedGradientBarNoTheme.this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
getList().get(select).setColorInner(color);
stateChanged();
FixedGradientBarNoTheme.this.repaint();
}
}
public JPanel initWindowPane(double preWidth) {
return null;
}
}

53
designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarWithPopMenu.java

@ -1,53 +0,0 @@
package com.fr.design.style.background.gradient;
import com.fr.base.background.ColorBackground;
import com.fr.design.style.color.NewColorSelectPane;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2021-08-19
*/
public class FixedGradientBarWithPopMenu extends FixedGradientBar {
private NewColorSelectPane colorPane;
public FixedGradientBarWithPopMenu(int minvalue, int maxvalue) {
super(minvalue, maxvalue);
}
protected void clickButton(int select) {
setIndex(select);
showPopupMenu();
}
public JPanel initWindowPane(double preferredWidth) {
// 下拉的时候重新生成面板,刷新最近使用颜色
colorPane = new NewColorSelectPane(false) {
@Override
public void setVisible(boolean b) {
super.setVisible(b);
}
@Override
protected boolean selectRealTime() {
return false;
}
};
colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
hidePopupMenu();
setColor(((NewColorSelectPane) e.getSource()).getColor());
getList().get(getIndex()).setColorInner(getColor());
fireDisplayComponent(ColorBackground.getInstance(getColor()));
FixedGradientBarWithPopMenu.this.stateChanged();
}
});
return colorPane;
}
}

43
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java

@ -1,14 +1,12 @@
package com.fr.design.style.background.gradient; package com.fr.design.style.background.gradient;
import com.fr.design.DesignerEnvManager; import com.fr.base.background.ColorBackground;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.style.color.ColorCell; import com.fr.design.style.color.ColorCell;
import com.fr.design.style.color.ColorSelectDetailPane;
import com.fr.design.style.color.ColorSelectDialog;
import com.fr.design.style.color.ColorSelectable; import com.fr.design.style.color.ColorSelectable;
import com.fr.design.style.color.NewColorSelectPane;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
@ -34,7 +32,7 @@ import java.awt.geom.Point2D;
* TODO:面板缩放的功能没有考虑就是尾值过大导致超过界面显示的情况原来的那个实现完全是个BUG要缩放的情况也比较少就干脆以后弄吧 * TODO:面板缩放的功能没有考虑就是尾值过大导致超过界面显示的情况原来的那个实现完全是个BUG要缩放的情况也比较少就干脆以后弄吧
*/ */
public class GradientBar extends AbstractComponentPopBox implements UIObserver, ColorSelectable { public class GradientBar extends AbstractComponentPopBox implements UIObserver, ColorSelectable {
private NewColorSelectPane colorPane;
/** /**
* *
*/ */
@ -131,20 +129,33 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver,
} }
protected void clickButton(int select) { protected void clickButton(int select) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE); setIndex(select);
Color selectColor = list.get(select).getColorInner() == null ? Color.WHITE : list.get(select).getColorInner(); showPopupMenu();
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, GradientBar.this);
Color color = GradientBar.this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
list.get(select).setColorInner(color);
stateChanged();
GradientBar.this.repaint();
} }
public JPanel initWindowPane(double preferredWidth) {
// 下拉的时候重新生成面板,刷新最近使用颜色
colorPane = new NewColorSelectPane(false) {
@Override
public void setVisible(boolean b) {
super.setVisible(b);
} }
public JPanel initWindowPane(double preWidth) { @Override
return null; protected boolean selectRealTime() {
return false;
}
};
colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
hidePopupMenu();
setColor(((NewColorSelectPane) e.getSource()).getColor());
getList().get(getIndex()).setColorInner(getColor());
fireDisplayComponent(ColorBackground.getInstance(getColor()));
GradientBar.this.stateChanged();
}
});
return colorPane;
} }
protected void addMouseDragListener() { protected void addMouseDragListener() {

5
designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java

@ -115,10 +115,7 @@ public abstract class ColorControlWindowWithAuto extends ColorControlWindow {
} }
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
if (isSupportTransparent()) { return super.getPreferredSize();
return new Dimension(super.getPreferredSize().width, TRANSPARENT_WINDOW_HEIGHT + BUTTON_HEIGHT);
}
return new Dimension(super.getPreferredSize().width, WINDOW_HEIGHT + BUTTON_HEIGHT);
} }
} }

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ColorSelectPaneWithOutTransparent.java

@ -24,8 +24,6 @@ public class ColorSelectPaneWithOutTransparent extends NewColorSelectPane {
menuColorPane.setLayout(new GridLayout(0, 8, 1, 1)); menuColorPane.setLayout(new GridLayout(0, 8, 1, 1));
menuColorPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); menuColorPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
menuColorPane.setPreferredSize(new Dimension(205, 62));
return menuColorPane; return menuColorPane;
} }
} }

Loading…
Cancel
Save