Browse Source

CHART-20536 图表预定义配色,升级兼容后,主题配色面板内容固定不变

【问题原因】
1. 兼容主题支持当前图表预定义配色
2. 图表预定义配色的数量导致主题色中实际颜色的数量可能
超过八个(但用户在界面上只能看到并编辑前八个),因此
需要调整下颜色选择面板等组件

【改动思路】
同上
persist/11.0
Starryi 3 years ago
parent
commit
e26869085a
  1. 7
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListExtendedPane.java
  2. 11
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

7
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListExtendedPane.java

@ -66,10 +66,7 @@ public class ColorListExtendedPane extends JPanel implements MouseListener {
public void populate(List<Color> colors) {
if (colors.size() > 0) {
colorList.clear();
for (int i = 0; i < colorCount; i++) {
Color color = colors.get(i % colorCount);
colorList.add(color);
}
colorList.addAll(colors);
repaint();
}
}
@ -132,7 +129,7 @@ public class ColorListExtendedPane extends JPanel implements MouseListener {
super.paint(g);
Color oldColor = g.getColor();
for (int i = 0; i < colorList.size(); i++) {
for (int i = 0; i < colorCount; i++) {
int x = i * (boxSize + boxGap);
for (int j = 0; j < extendedCount; j++) {
Color color = extendedColorComputer.computeExtendedColor(colorList.get(i), j, extendedCount);

11
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java

@ -88,10 +88,13 @@ public class ColorListPane extends JPanel implements UIObserver {
}
public void populate(List<Color> colors) {
for (int i = 0; i < colors.size() && i < colorList.size(); i++) {
Color color = colors.get(i % colorCount);
colorList.set(i, color);
colorButtons.get(i).setSelectObject(color);
colorList.clear();
for (int i = 0; i < colors.size(); i++) {
Color color = colors.get(i);
colorList.add(color);
if (i < colorCount) {
colorButtons.get(i).setSelectObject(color);
}
}
}

2
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

@ -206,7 +206,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
}
}
}
if (standardColors == null || standardColors.size() != 8) {
if (standardColors == null || standardColors.size() < 8) {
return;
}

Loading…
Cancel
Save