|
|
|
@ -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,7 +35,7 @@ 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 { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected ColorSchemeComboBox styleSelectBox; |
|
|
|
@ -124,6 +128,8 @@ public class VanChartFillStylePane extends BasicBeanPane<AttrFillStyle> {
|
|
|
|
|
VanChartFillStylePane.this.revalidate(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
DesignerContext.setDesignerBean("vanChartFillStyle", this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void initLayout() { |
|
|
|
@ -231,7 +237,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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|