forked from fanruan/design
Browse Source
* commit '411037b1d384a401b3dae93c2f900e3742767960': (33 commits) 配色 CORE-116 进一步整理Session管理问题&单元测试失败 设计器启动捕获LifecycleFatalError,进程退出 CORE-113 提供自定义AOP注解的接口,可以在各个模块自行定义方便日志记录,文档稍后补充 REPORT-9388 远程设计重构-设计器目录树-工具栏-10.0远程下比9.0多出两个工具栏按钮 rtREPORT-9747 【10.0二轮回归】修改以前的模板无法更改 REPORT-9619 REPORT-9619 REPORT-9619 REPORT-9706 在远程环境下,切换成本地的时候弹出一个错误提示框呢 REPORT-9741【10.0二轮回归】设计器菜单栏-文件-切换至远程服务器 CORE-116 删除LogRecordTime等无用的对象 . 无 CORE-116 fr_username->fine_username等对应的修改,KMS上补充文档,老的保持兼容 REPORT-9246 设计器中有好多配置修改操作 中夹杂了很多的业务逻辑,将业务逻辑和配置修改剥离出来,Configurations.update操作中尽量只包含修改配置的步骤 rt rtREPORT-9747 【10.0二轮回归】修改以前的模板无法更改 . REPORT-9747 【10.0二轮回归】修改以前的模板无法更改 ...master
yaoh.wu
6 years ago
39 changed files with 733 additions and 743 deletions
@ -1,46 +0,0 @@ |
|||||||
package com.fr.design.mainframe.loghandler; |
|
||||||
|
|
||||||
import com.fr.stable.fun.impl.AbstractLogProvider; |
|
||||||
import com.fr.stable.xml.LogRecordTimeProvider; |
|
||||||
|
|
||||||
import java.util.ArrayList; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by Administrator on 2016/1/11 0011. |
|
||||||
*/ |
|
||||||
public class DesignerLogImpl extends AbstractLogProvider{ |
|
||||||
|
|
||||||
private static DesignerLogImpl instance = new DesignerLogImpl(); |
|
||||||
|
|
||||||
public static DesignerLogImpl getInstance(){ |
|
||||||
return instance; |
|
||||||
} |
|
||||||
|
|
||||||
private DesignerLogImpl(){ |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
private List<LogRecordTimeProvider> records = new ArrayList<LogRecordTimeProvider>(); |
|
||||||
|
|
||||||
/** |
|
||||||
* 清除内存中的日志记录 |
|
||||||
*/ |
|
||||||
public void clear(){ |
|
||||||
records.clear(); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 获取所有日志信息 |
|
||||||
* |
|
||||||
* @return 日志信息 |
|
||||||
*/ |
|
||||||
public LogRecordTimeProvider[] getRecorders(){ |
|
||||||
return records.toArray(new LogRecordTimeProvider[records.size()]); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void record(LogRecordTimeProvider logRecordTime) { |
|
||||||
records.add(logRecordTime); |
|
||||||
} |
|
||||||
} |
|
@ -1,97 +0,0 @@ |
|||||||
package com.fr.design.mainframe.chart.gui.style; |
|
||||||
|
|
||||||
import java.awt.*; |
|
||||||
|
|
||||||
import com.fr.chart.base.AttrFillStyle; |
|
||||||
import com.fr.chart.base.ChartConstants; |
|
||||||
import com.fr.design.gui.ilable.UILabel; |
|
||||||
import com.fr.design.layout.TableLayout; |
|
||||||
import com.fr.design.layout.TableLayoutHelper; |
|
||||||
import com.fr.general.Inter; |
|
||||||
|
|
||||||
/** |
|
||||||
* 预定义的图表配色界面, 其中和属性表中ChartFillStylePane 主要的不同就是标签的位置. |
|
||||||
* @author kunsnat E-mail:kunsnat@gmail.com |
|
||||||
* @version 创建时间:2013-8-21 下午03:16:27 |
|
||||||
*/ |
|
||||||
public class ChartPreFillStylePane extends ChartFillStylePane { |
|
||||||
|
|
||||||
public ChartPreFillStylePane() { |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
protected void initLayout() {// 仅仅是服务器预定 风格界面布局, 和属性表 有所不同.
|
|
||||||
customPane.setPreferredSize(new Dimension(200, 200)); |
|
||||||
colorGradient.setPreferredSize(new Dimension(120, 30)); |
|
||||||
|
|
||||||
double p = TableLayout.PREFERRED; |
|
||||||
double[] columnSize = {p, p }; |
|
||||||
double[] rowSize = { p, p, p}; |
|
||||||
Component[][] components = new Component[][]{ |
|
||||||
new Component[]{new UILabel(" " + Inter.getLocText("ColorMatch")), null}, |
|
||||||
new Component[]{null, customPane}, |
|
||||||
}; |
|
||||||
|
|
||||||
this.add(TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize), BorderLayout.WEST); |
|
||||||
} |
|
||||||
|
|
||||||
public void populateBean(AttrFillStyle condition) { |
|
||||||
styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount()-1); |
|
||||||
|
|
||||||
if(condition == null || condition.getColorStyle() == ChartConstants.COLOR_DEFAULT) { |
|
||||||
colorAcc.populateBean(ChartConstants.CHART_COLOR_ARRAY);// 新建时 保持默认样式
|
|
||||||
accButton.setSelected(true); |
|
||||||
gradientButton.setSelected(false); |
|
||||||
cardLayout.show(changeColorSetPane, "acc"); |
|
||||||
|
|
||||||
colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE); |
|
||||||
colorGradient.getSelectColorPointBtnP2().setColorInner(Color.black);// 控件中的位置无效.
|
|
||||||
} else { |
|
||||||
int colorStyle = condition.getColorStyle(); |
|
||||||
gradientButton.setSelected(colorStyle == ChartConstants.COLOR_GRADIENT); |
|
||||||
accButton.setSelected(colorStyle == ChartConstants.COLOR_ACC); |
|
||||||
|
|
||||||
int colorSize = condition.getColorSize(); |
|
||||||
if(colorSize == 2 && gradientButton.isSelected() ) { |
|
||||||
cardLayout.show(changeColorSetPane, "gradient"); |
|
||||||
|
|
||||||
Color endColor = condition.getColorIndex(1); |
|
||||||
Color startColor = condition.getColorIndex(0); |
|
||||||
colorGradient.getSelectColorPointBtnP1().setColorInner(startColor); |
|
||||||
colorGradient.getSelectColorPointBtnP2().setColorInner(endColor); |
|
||||||
colorGradient.repaint(); |
|
||||||
} else if(colorSize > 2 && accButton.isSelected()){ |
|
||||||
cardLayout.show(changeColorSetPane, "acc"); |
|
||||||
|
|
||||||
Color[] colors = new Color[colorSize]; |
|
||||||
for(int i = 0; i < colorSize; i++) { |
|
||||||
colors[i] = condition.getColorIndex(i); |
|
||||||
} |
|
||||||
colorAcc.populateBean(colors); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public AttrFillStyle updateBean() { |
|
||||||
AttrFillStyle condition = new AttrFillStyle(); |
|
||||||
condition.clearColors(); |
|
||||||
|
|
||||||
if(gradientButton.isSelected()) { |
|
||||||
condition.setColorStyle(ChartConstants.COLOR_GRADIENT); |
|
||||||
Color start = colorGradient.getSelectColorPointBtnP1().getColorInner(); |
|
||||||
Color end = colorGradient.getSelectColorPointBtnP2().getColorInner(); |
|
||||||
condition.addFillColor(start); |
|
||||||
condition.addFillColor(end); |
|
||||||
} else { |
|
||||||
condition.setColorStyle(ChartConstants.COLOR_ACC); |
|
||||||
|
|
||||||
Color[] colors = colorAcc.updateBean(); |
|
||||||
for(int i = 0, length = colors.length; i < length; i++) { |
|
||||||
condition.addFillColor(colors[i]); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
return condition; |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,165 @@ |
|||||||
|
package com.fr.design.module; |
||||||
|
|
||||||
|
import com.fr.base.ChartColorMatching; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.gui.ibutton.UIButton; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
|
import com.fr.design.mainframe.chart.gui.style.ChartAccColorPane; |
||||||
|
import com.fr.design.style.background.gradient.FixedGradientBar; |
||||||
|
import com.fr.general.Inter; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.BorderLayout; |
||||||
|
import java.awt.CardLayout; |
||||||
|
import java.awt.Color; |
||||||
|
import java.awt.Component; |
||||||
|
import java.awt.Dimension; |
||||||
|
import java.awt.FlowLayout; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
import java.awt.event.ActionListener; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 预定义的图表配色界面. |
||||||
|
* @author kunsnat E-mail:kunsnat@gmail.com |
||||||
|
* @version 创建时间:2013-8-21 下午03:16:27 |
||||||
|
*/ |
||||||
|
public class ChartPreFillStylePane extends BasicBeanPane<ChartColorMatching> { |
||||||
|
|
||||||
|
private JPanel changeColorSetPane; |
||||||
|
private CardLayout cardLayout; |
||||||
|
|
||||||
|
private UIButton accButton; |
||||||
|
private UIButton gradientButton; |
||||||
|
|
||||||
|
private ChartAccColorPane colorAcc; |
||||||
|
private FixedGradientBar colorGradient; |
||||||
|
|
||||||
|
public ChartPreFillStylePane() { |
||||||
|
|
||||||
|
initComponents(); |
||||||
|
|
||||||
|
initListener(); |
||||||
|
} |
||||||
|
|
||||||
|
private void initComponents() { |
||||||
|
|
||||||
|
JPanel customPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
|
||||||
|
JPanel buttonPane = new JPanel(); |
||||||
|
buttonPane.setLayout(new FlowLayout(FlowLayout.LEFT)); |
||||||
|
buttonPane.add(accButton = new UIButton(Inter.getLocText("FR-Designer_Chart_Acc_Set"))); |
||||||
|
buttonPane.add(gradientButton = new UIButton(Inter.getLocText("FR-Designer_Gradient-Color"))); |
||||||
|
customPane.add(buttonPane, BorderLayout.NORTH); |
||||||
|
|
||||||
|
changeColorSetPane = new JPanel(cardLayout = new CardLayout()); |
||||||
|
changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 130), "gradient"); |
||||||
|
changeColorSetPane.add(colorAcc = new ChartAccColorPane(), "acc"); |
||||||
|
cardLayout.show(changeColorSetPane, "acc"); |
||||||
|
customPane.add(changeColorSetPane, BorderLayout.CENTER); |
||||||
|
|
||||||
|
accButton.setSelected(true); |
||||||
|
|
||||||
|
customPane.setPreferredSize(new Dimension(200, 200)); |
||||||
|
colorGradient.setPreferredSize(new Dimension(120, 30)); |
||||||
|
colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE); |
||||||
|
colorGradient.getSelectColorPointBtnP2().setColorInner(Color.black); |
||||||
|
|
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double[] columnSize = {p, p}; |
||||||
|
double[] rowSize = {p, p, p}; |
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{new UILabel(" " + Inter.getLocText("ColorMatch")), null}, |
||||||
|
new Component[]{null, customPane}, |
||||||
|
}; |
||||||
|
|
||||||
|
this.setLayout(new BorderLayout()); |
||||||
|
this.add(TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize), BorderLayout.WEST); |
||||||
|
} |
||||||
|
|
||||||
|
private void initListener() { |
||||||
|
|
||||||
|
accButton.addActionListener(new ActionListener() { |
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
accButton.setSelected(true); |
||||||
|
gradientButton.setSelected(false); |
||||||
|
cardLayout.show(changeColorSetPane, "acc"); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
gradientButton.addActionListener(new ActionListener() { |
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
gradientButton.setSelected(true); |
||||||
|
accButton.setSelected(false); |
||||||
|
cardLayout.show(changeColorSetPane, "gradient"); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String title4PopupWindow() { |
||||||
|
return Inter.getLocText("ServerM-Predefined_Styles"); |
||||||
|
} |
||||||
|
|
||||||
|
public void populateBean(ChartColorMatching condition) { |
||||||
|
if (condition == null) { |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
boolean isGradient = condition.getGradient(); |
||||||
|
List<Color> colorList = condition.getColorList(); |
||||||
|
if (isGradient) { |
||||||
|
gradientButton.setSelected(true); |
||||||
|
accButton.setSelected(false); |
||||||
|
cardLayout.show(changeColorSetPane, "gradient"); |
||||||
|
|
||||||
|
if (colorList.size() == 2) { |
||||||
|
colorGradient.getSelectColorPointBtnP1().setColorInner(colorList.get(0)); |
||||||
|
colorGradient.getSelectColorPointBtnP2().setColorInner(colorList.get(1)); |
||||||
|
colorGradient.repaint(); |
||||||
|
} |
||||||
|
} else { |
||||||
|
accButton.setSelected(true); |
||||||
|
gradientButton.setSelected(false); |
||||||
|
cardLayout.show(changeColorSetPane, "acc"); |
||||||
|
|
||||||
|
if (colorList.size() > 0) { |
||||||
|
colorAcc.populateBean(colorList.toArray(new Color[colorList.size()])); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public ChartColorMatching updateBean() { |
||||||
|
ChartColorMatching chartColorMatching = new ChartColorMatching(); |
||||||
|
|
||||||
|
List<Color> colorList = new ArrayList<Color>(); |
||||||
|
|
||||||
|
if(gradientButton.isSelected()) { |
||||||
|
chartColorMatching.setGradient(true); |
||||||
|
|
||||||
|
Color start = colorGradient.getSelectColorPointBtnP1().getColorInner(); |
||||||
|
Color end = colorGradient.getSelectColorPointBtnP2().getColorInner(); |
||||||
|
colorList.add(start); |
||||||
|
colorList.add(end); |
||||||
|
} else { |
||||||
|
chartColorMatching.setGradient(false); |
||||||
|
|
||||||
|
Color[] colors = colorAcc.updateBean(); |
||||||
|
for(Color color : colors) { |
||||||
|
colorList.add(color); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
chartColorMatching.setColorList(colorList); |
||||||
|
|
||||||
|
return chartColorMatching; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue