Browse Source

Merge pull request #1 in ~WIM.ZHAI/xdesign from release/10.0 to 10.0

* commit 'aa983470dcf3f24da3f4d1cc86fa9d6ab53d9c6c':
  CHART-3043
  CHART-3043
  暂无JIRA任务,修复区间配置最下面颜色被遮挡的问题
  revert code
  revert code
  CHART-3044 新增构造器,初始化自定义颜色
master
Wim.Zhai 6 years ago
parent
commit
911aeebe44
  1. 106
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java
  2. 26
      designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java

106
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java

@ -18,18 +18,18 @@ import java.awt.Color;
*/
public class ColorBackgroundQuickPane extends BackgroundQuickPane {
private NewColorSelectPane detailColorSelectPane;
private boolean isBackGroundColor;
private NewColorSelectPane detailColorSelectPane;
private boolean isBackGroundColor;
public ColorBackgroundQuickPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
public ColorBackgroundQuickPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
detailColorSelectPane = new NewColorSelectPane();
this.add(detailColorSelectPane, BorderLayout.NORTH);
}
detailColorSelectPane = new NewColorSelectPane();
this.add(detailColorSelectPane, BorderLayout.NORTH);
}
public void populateBean(Background background) {
ColorBackground colorBackgroud = (ColorBackground) background;
public void populateBean(Background background) {
ColorBackground colorBackgroud = (ColorBackground) background;
populateColor(colorBackgroud.getColor());
}
@ -47,48 +47,48 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane {
return this.detailColorSelectPane.getNotNoneColor();
}
public boolean isBackGroundColor(){
return isBackGroundColor;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(final UIObserverListener listener) {
detailColorSelectPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
isBackGroundColor = true;
listener.doChange();
isBackGroundColor = false;
}
});
}
@Override
/**
* 是否为ColorBackground 类型
*
* @param background 背景
* @return 同上
*
*/
public boolean accept(Background background) {
return background instanceof ColorBackground;
}
@Override
/**
* 窗口名称
* @return 同上
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color");
}
@Override
public void reset() {
this.detailColorSelectPane.setColor(null);
}
public boolean isBackGroundColor() {
return isBackGroundColor;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(final UIObserverListener listener) {
detailColorSelectPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
isBackGroundColor = true;
listener.doChange();
isBackGroundColor = false;
}
});
}
@Override
/**
* 是否为ColorBackground 类型
*
* @param background 背景
* @return 同上
*
*/
public boolean accept(Background background) {
return background instanceof ColorBackground;
}
@Override
/**
* 窗口名称
* @return 同上
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color");
}
@Override
public void reset() {
this.detailColorSelectPane.setColor(null);
}
}

26
designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java

@ -1,9 +1,9 @@
package com.fr.van.chart.range.component;
import com.fr.chart.chartglyph.MapHotAreaColor;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
@ -16,7 +16,7 @@ import java.awt.Dimension;
* Created by Mitisky on 16/10/20.
* 没有主题颜色,自动的时候没有划分阶段
*/
public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithFormula{
public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithFormula {
private BoldFontTextLabel numLabel;
public SectionIntervalConfigPaneWithOutNum(AbstractAttrNoScrollPane container) {
@ -24,7 +24,7 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF
getDesignTypeButtonGroup().addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if(getDesignTypeButtonGroup().getSelectedIndex() == 0){
if (getDesignTypeButtonGroup().getSelectedIndex() == 0) {
setRegionVisible(false);
} else {
setRegionVisible(true);
@ -33,15 +33,16 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF
});
}
protected JPanel getUpControlPane (Component[][] components) {
@Override
protected JPanel getUpControlPane(Component[][] components) {
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH;
double[] columnSize = {d, e};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSIze (), columnSize);
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSIze(), columnSize);
return panel;
}
private void setRegionVisible(boolean visible){
private void setRegionVisible(boolean visible) {
getRegionNumPane().setVisible(visible);
numLabel.setVisible(visible);
}
@ -53,13 +54,20 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF
setRegionVisible(false);
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Range_Num")),getDesignTypeButtonGroup()},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Range_Num")), getDesignTypeButtonGroup()},
new Component[]{numLabel, getRegionNumPane()},
};
}
public Dimension getPreferredSize(){
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
return new Dimension((int)dim.getWidth(), (int) dim.getHeight() - (numLabel.isVisible() ? 0 : 30));
return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (numLabel.isVisible() ? 0 : 30));
}
@Override
public void populateBean(MapHotAreaColor hotAreaColor) {
super.populateBean(hotAreaColor);
setRegionVisible(hotAreaColor.getUseType() == 1);
}
}

Loading…
Cancel
Save