|
|
|
@ -13,13 +13,17 @@ import com.fr.design.gui.ilable.UILabel;
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.mainframe.DesignerBean; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartColorAdjustPane; |
|
|
|
|
import com.fr.design.style.background.gradient.FixedGradientBar; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.CardLayout; |
|
|
|
|
import java.awt.Color; |
|
|
|
@ -31,8 +35,9 @@ import java.awt.event.ActionListener;
|
|
|
|
|
/** |
|
|
|
|
* Created by mengao on 2017/8/17. |
|
|
|
|
*/ |
|
|
|
|
public class VanChartFillStylePane extends BasicBeanPane<AttrFillStyle> { |
|
|
|
|
public class VanChartFillStylePane extends BasicBeanPane<AttrFillStyle> implements DesignerBean { |
|
|
|
|
|
|
|
|
|
public static final String name = "vanChartFillStyle"; |
|
|
|
|
|
|
|
|
|
protected ColorSchemeComboBox styleSelectBox; |
|
|
|
|
protected JPanel customPane; |
|
|
|
@ -71,6 +76,8 @@ public class VanChartFillStylePane extends BasicBeanPane<AttrFillStyle> {
|
|
|
|
|
customPane.add(changeColorSetPane, BorderLayout.CENTER); |
|
|
|
|
initListener(); |
|
|
|
|
initLayout(); |
|
|
|
|
DesignerContext.setDesignerBean(name, this); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initListener() { |
|
|
|
@ -231,7 +238,31 @@ public class VanChartFillStylePane extends BasicBeanPane<AttrFillStyle> {
|
|
|
|
|
def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem())); |
|
|
|
|
return def; |
|
|
|
|
} else { |
|
|
|
|
return updateDefaultColor(); |
|
|
|
|
return updateModifyColor(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private AttrFillStyle updateModifyColor() { |
|
|
|
|
AttrFillStyle condition = new AttrFillStyle(); |
|
|
|
|
condition.clearColors(); |
|
|
|
|
ColorSchemeComboBox.ColorInfo selectColorInfo = styleSelectBox.getSelectColorInfo(); |
|
|
|
|
boolean isGradient = selectColorInfo.isGradient(); |
|
|
|
|
List<Color> colors = selectColorInfo.getColors(); |
|
|
|
|
condition.setColorList(colors); |
|
|
|
|
condition.setCustomFillStyle(true); |
|
|
|
|
condition.setColorStyle(isGradient ? ChartConstants.COLOR_GRADIENT : ChartConstants.COLOR_ACC); |
|
|
|
|
return condition; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 刷新组件对象 |
|
|
|
|
*/ |
|
|
|
|
public void refreshBeanElement() { |
|
|
|
|
AttrFillStyle attrFillStyle = updateBean(); |
|
|
|
|
|
|
|
|
|
styleSelectBox.refresh(); |
|
|
|
|
|
|
|
|
|
populateBean(attrFillStyle); |
|
|
|
|
GUICoreUtils.repaint(this); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|