Browse Source

Merge pull request #1562 in DESIGN/design from ~BJORN/design:release/10.0 to release/10.0

* commit '4646b8e6e19cec3297cc9024e5c4b8dff8a1b598':
  CHART-13274 && CHART-13285 自定义配色的调整
  CHART-13222 英文环境下的数据面板
feature/big-screen
Bjorn 5 years ago
parent
commit
896f23c8db
  1. 4
      designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java
  2. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java
  3. 13
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java
  4. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java

4
designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java

@ -14,6 +14,7 @@ import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
@ -130,6 +131,9 @@ public class ColorSchemeComboBox extends UIComboBox {
NORMAL NORMAL
} }
public Set<String> getItems() {
return colorSchemes.keySet();
}
public class ColorInfo { public class ColorInfo {

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java

@ -9,10 +9,12 @@ import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -59,11 +61,16 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane<ChartCollection> {
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);
dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); dataScreeningPane = new ChartDataFilterPane(this.initplot, parent);
JPanel panel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane); JPanel panel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane);
panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,10)); panel.setBorder(BorderFactory.createEmptyBorder(0,5,0,5));
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5)); dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5));
this.add(panel, BorderLayout.SOUTH); this.add(panel, BorderLayout.SOUTH);
} }
protected UIComboBox createComboBox() {
UIComboBox uiComboBox = new UIComboBox();
UIComponentUtils.setPreferedWidth(uiComboBox, 100);
return uiComboBox;
}
/** /**
* 检查box 是否使用, hasUse, 表示上层已经使用, 否则, 则此界面都可使用 * 检查box 是否使用, hasUse, 表示上层已经使用, 否则, 则此界面都可使用
* @param hasUse 是否使用 * @param hasUse 是否使用

13
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java

@ -58,8 +58,6 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver {
private ChangeListener changeListener; private ChangeListener changeListener;
public ChartColorAdjustPane() { public ChartColorAdjustPane() {
this(DEFAULT_COLORS); this(DEFAULT_COLORS);
} }
@ -70,10 +68,6 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver {
createContentPane(); createContentPane();
} }
public void updateColor() {
updateColor(DEFAULT_COLORS);
}
public void updateColor(Color[] colors) { public void updateColor(Color[] colors) {
createColorButton(colors); createColorButton(colors);
relayout(); relayout();
@ -124,8 +118,9 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver {
private void createColorButton(Color[] colors) { private void createColorButton(Color[] colors) {
colorButtons.clear(); colorButtons.clear();
for (Color color : colors) { int size = Math.min(colors.length, MAX_BUTTON);
colorButtons.add(createColorButton(color)); for (int i = 0; i < size; i++) {
colorButtons.add(createColorButton(colors[i]));
} }
} }
@ -219,7 +214,9 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver {
hidePopupMenu(); hidePopupMenu();
Color color = ((ColorSelectPane) e.getSource()).getColor(); Color color = ((ColorSelectPane) e.getSource()).getColor();
fireDisplayComponent(ColorBackground.getInstance(color)); fireDisplayComponent(ColorBackground.getInstance(color));
if(colorButtons.size() < MAX_BUTTON) {
colorButtons.add(createColorButton(color)); colorButtons.add(createColorButton(color));
}
ChartColorAdjustPane.this.stateChanged(); ChartColorAdjustPane.this.stateChanged();
relayout(); relayout();
} }

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java

@ -155,7 +155,7 @@ public class VanChartFillStylePane extends BasicBeanPane<AttrFillStyle> {
@Override @Override
public void populateBean(AttrFillStyle condition) { public void populateBean(AttrFillStyle condition) {
String fillStyleName = condition == null ? "" : condition.getFillStyleName(); String fillStyleName = condition == null ? "" : condition.getFillStyleName();
if (StringUtils.isBlank(fillStyleName)) {//兼容处理 if (StringUtils.isBlank(fillStyleName) || !styleSelectBox.getItems().contains(fillStyleName)) {//兼容处理
if (condition == null || condition.getColorStyle() == ChartConstants.COLOR_DEFAULT) { if (condition == null || condition.getColorStyle() == ChartConstants.COLOR_DEFAULT) {
styleSelectBox.setSelectType(ColorSchemeComboBox.SelectType.DEFAULT);//默认 styleSelectBox.setSelectType(ColorSchemeComboBox.SelectType.DEFAULT);//默认
} else { } else {

Loading…
Cancel
Save