Browse Source
Merge in DESIGN/design from ~JEO/report-design:final/10.0 to final/10.0 * commit 'f76ff103b4d988c688d3363ae16960eb127b2c33': (184 commits) CHART-14983 根据数据类型调整箱型图数据点提示面板内容 REPORT-37289 处理下npe CHART-15112 刻度单位调整 CHART-15056 使用LinkedHashMap保证条件属性顺序 REPORT-37289 【10.0.9冒烟】frm模板tab,在设计器内进行多次来回点击切换,发现会偶然的点击失效或卡顿 CHART-15112 时间轴英文环境少单位 REPORT-37460 && REPORT-37526 【frm设计界面支持缩放】模板放大后,点击报表块编辑,双击才能生效,缩小模板100%,单击就可以 REPORT-37487 && REPORT-37484 1、回复 result 默认为 $$$ 。 2、和产品沟通,将两个面板分别默认展示 = 和不展示 = 3、恢复数据的联动 CHART-14800 图表的模块加载慢导致了服务菜单第一次点击缺少图表菜单 CHART-15096 注解 CHART-15096 条件属性数据表样式问题 CHART-15054 调整数据面板标签宽度 问题修复 REPORT-37353【frm设计界面支持缩放】缩放过程中,如果进行图表编辑,拖动滚动条,就会重叠 REPORT-36778 【配合平台】版本号规范FR适配任务 去除多处的空格 REPORT-36778 【配合平台】版本号规范FR适配任务 去除多处的空格 REPORT-27497 编辑单元格输入韩文时字会缺失 使用java自带方式判断 + 漏传代码 REPORT-27497 编辑单元格输入韩文时字会缺失 REPORT-36862 去掉无效的import REPORT-36862 新加工具类,把方法放到工具类里面,新加单元测试 ...final/10.0
Kara
5 years ago
205 changed files with 7094 additions and 2582 deletions
@ -0,0 +1,48 @@ |
|||||||
|
package com.fr.design.actions.community; |
||||||
|
|
||||||
|
import com.fr.base.BaseUtils; |
||||||
|
import com.fr.design.actions.UpdateAction; |
||||||
|
import com.fr.design.locale.impl.BugNeedMark; |
||||||
|
import com.fr.design.menu.MenuKeySet; |
||||||
|
import com.fr.design.utils.BrowseUtils; |
||||||
|
import com.fr.general.locale.LocaleCenter; |
||||||
|
import com.fr.general.locale.LocaleMark; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/7/28 |
||||||
|
*/ |
||||||
|
public class BugNeedAction extends UpdateAction { |
||||||
|
public BugNeedAction() { |
||||||
|
this.setMenuKeySet(BugAndNeed); |
||||||
|
this.setName(getMenuKeySet().getMenuName()); |
||||||
|
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||||
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/need.png")); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
LocaleMark<String> localeMark = LocaleCenter.getMark(BugNeedMark.class); |
||||||
|
BrowseUtils.browser(localeMark.getValue()); |
||||||
|
} |
||||||
|
|
||||||
|
public static final MenuKeySet BugAndNeed = new MenuKeySet() { |
||||||
|
@Override |
||||||
|
public char getMnemonic() { |
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getMenuName() { |
||||||
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_BugAndNeed"); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public KeyStroke getKeyStroke() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,49 @@ |
|||||||
|
package com.fr.design.actions.community; |
||||||
|
|
||||||
|
import com.fr.base.BaseUtils; |
||||||
|
import com.fr.design.actions.UpdateAction; |
||||||
|
import com.fr.design.locale.impl.TechSupportMark; |
||||||
|
import com.fr.design.menu.MenuKeySet; |
||||||
|
import com.fr.design.utils.BrowseUtils; |
||||||
|
import com.fr.general.locale.LocaleCenter; |
||||||
|
import com.fr.general.locale.LocaleMark; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/7/28 |
||||||
|
*/ |
||||||
|
public class TechSupportAction extends UpdateAction { |
||||||
|
public TechSupportAction() { |
||||||
|
this.setMenuKeySet(TechSupport); |
||||||
|
this.setName(getMenuKeySet().getMenuName()); |
||||||
|
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||||
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/support.png")); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
LocaleMark<String> localeMark = LocaleCenter.getMark(TechSupportMark.class); |
||||||
|
String str=localeMark.getValue(); |
||||||
|
BrowseUtils.browser(localeMark.getValue()); |
||||||
|
} |
||||||
|
|
||||||
|
public static final MenuKeySet TechSupport = new MenuKeySet() { |
||||||
|
@Override |
||||||
|
public char getMnemonic() { |
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getMenuName() { |
||||||
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_TechSupport"); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public KeyStroke getKeyStroke() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
package com.fr.design.cell; |
||||||
|
|
||||||
|
import com.fr.design.designer.TargetComponent; |
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author zack |
||||||
|
* @version 10.0 |
||||||
|
* Created by zack on 2020/7/14 |
||||||
|
*/ |
||||||
|
public abstract class AbstractCellElementPropertyPane extends BasicPane implements CellElementPropertyComponent { |
||||||
|
@Override |
||||||
|
public JPanel toPanel() { |
||||||
|
return this; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean accept(TargetComponent tc) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
package com.fr.design.cell; |
||||||
|
|
||||||
|
import com.fr.design.designer.TargetComponent; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
|
||||||
|
/** |
||||||
|
* 单元格属性配置面板接口 |
||||||
|
* @author zack |
||||||
|
* @version 10.0 |
||||||
|
* Created by zack on 2020/7/14 |
||||||
|
*/ |
||||||
|
public interface CellElementPropertyComponent { |
||||||
|
|
||||||
|
/** |
||||||
|
* 判断当前编辑的对象是否显示当前实现 |
||||||
|
* @param tc |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
boolean accept(TargetComponent tc); |
||||||
|
|
||||||
|
/** |
||||||
|
* 加载数据 |
||||||
|
* @param tc |
||||||
|
*/ |
||||||
|
void populate(TargetComponent tc); |
||||||
|
|
||||||
|
/** |
||||||
|
* 返回当前属性面板,默认返回this |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
JPanel toPanel(); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
package com.fr.design.event; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/7/29 |
||||||
|
*/ |
||||||
|
public interface StateChangeListener { |
||||||
|
public void stateChange(); |
||||||
|
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,100 @@ |
|||||||
|
package com.fr.design.formula; |
||||||
|
|
||||||
|
import com.fr.base.BaseFormula; |
||||||
|
import com.fr.design.gui.itextfield.DictionaryTextField; |
||||||
|
import com.fr.stable.StringUtils; |
||||||
|
|
||||||
|
import javax.swing.text.Document; |
||||||
|
|
||||||
|
/** |
||||||
|
* 公式展示时使用。 |
||||||
|
* 展示 String. |
||||||
|
* 但实际保存的是 BaseFormula。 |
||||||
|
* 从而保留公式的形态。 |
||||||
|
* |
||||||
|
* created by Harrison on 2020/08/03 |
||||||
|
**/ |
||||||
|
public class FormulaTextField extends DictionaryTextField<BaseFormula> { |
||||||
|
|
||||||
|
private static final String EMPTY_STRING = "="; |
||||||
|
|
||||||
|
private static final BaseFormula EMPTY_FORMULA = BaseFormula.createFormulaBuilder().build(EMPTY_STRING); |
||||||
|
|
||||||
|
public FormulaTextField() { |
||||||
|
} |
||||||
|
|
||||||
|
public FormulaTextField(int columns) { |
||||||
|
super(columns); |
||||||
|
} |
||||||
|
|
||||||
|
public FormulaTextField(String text, int columns, BaseFormula value) { |
||||||
|
super(text, columns, value); |
||||||
|
} |
||||||
|
|
||||||
|
public FormulaTextField(String text, BaseFormula value) { |
||||||
|
super(text, value); |
||||||
|
} |
||||||
|
|
||||||
|
public FormulaTextField(Document doc, String text, int columns, BaseFormula value) { |
||||||
|
super(doc, text, columns, value); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public BaseFormula getValue() { |
||||||
|
|
||||||
|
if (this.value == null) { |
||||||
|
this.value = createDefault(); |
||||||
|
} |
||||||
|
//保持联动
|
||||||
|
linkValueByText(); |
||||||
|
return value; |
||||||
|
} |
||||||
|
|
||||||
|
private void linkValueByText() { |
||||||
|
|
||||||
|
String content = getText(); |
||||||
|
this.value.setContent(content); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 设置值时,会将展示的公式值一同设置进去 |
||||||
|
* |
||||||
|
* @param value 公式值 |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public void setValue(BaseFormula value) { |
||||||
|
|
||||||
|
this.value = value; |
||||||
|
if (this.value == null) { |
||||||
|
this.value = createDefault(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 是需要设置不带 = 号,还是带 = 号。 |
||||||
|
* |
||||||
|
* @param value 值 |
||||||
|
* @param isPure 带不带 = 号, 是 = 不带, 否 = 带。 |
||||||
|
*/ |
||||||
|
public void setValueAndText(BaseFormula value, boolean isPure) { |
||||||
|
|
||||||
|
setValue(value); |
||||||
|
String content = null; |
||||||
|
if (isPure) { |
||||||
|
content = this.value.getPureContent(); |
||||||
|
} else { |
||||||
|
content = this.value.getContent(); |
||||||
|
} |
||||||
|
setText(content); |
||||||
|
} |
||||||
|
|
||||||
|
private BaseFormula createDefault() { |
||||||
|
|
||||||
|
String text = getText(); |
||||||
|
if (StringUtils.isNotEmpty(text)) { |
||||||
|
return BaseFormula.createFormulaBuilder().build(text); |
||||||
|
} else { |
||||||
|
return EMPTY_FORMULA; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,18 @@ |
|||||||
|
package com.fr.design.fun; |
||||||
|
|
||||||
|
import com.fr.design.cell.CellElementPropertyComponent; |
||||||
|
|
||||||
|
/** |
||||||
|
* 单元格设置(属性)扩展接口 |
||||||
|
* @author zack |
||||||
|
* @version 10.0 |
||||||
|
* Created by zack on 2020/7/14 |
||||||
|
*/ |
||||||
|
public interface CellPropertyPaneProvider extends PropertyItemPaneProvider { |
||||||
|
|
||||||
|
/** |
||||||
|
* 构造单元格属性面板,面板实现需要使用单例模式实现 |
||||||
|
* @return 面板类 |
||||||
|
*/ |
||||||
|
CellElementPropertyComponent getSingletonCelPropertyPane(); |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
package com.fr.design.fun.impl; |
||||||
|
|
||||||
|
import com.fr.design.fun.CellPropertyPaneProvider; |
||||||
|
import com.fr.stable.fun.mark.API; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by zhouping on 2015/11/11. |
||||||
|
*/ |
||||||
|
@API(level = CellPropertyPaneProvider.CURRENT_LEVEL) |
||||||
|
public abstract class AbstractCellPropertyPaneProvider extends AbstractPropertyItemPaneProvider implements CellPropertyPaneProvider { |
||||||
|
|
||||||
|
public int currentAPILevel() { |
||||||
|
return CellPropertyPaneProvider.CURRENT_LEVEL; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,45 @@ |
|||||||
|
package com.fr.design.gui.itextfield; |
||||||
|
|
||||||
|
import javax.swing.text.Document; |
||||||
|
|
||||||
|
/** |
||||||
|
* 文字 ui. |
||||||
|
* 保存实际值,展示值。 |
||||||
|
* 允许实际值和展示值不同。 |
||||||
|
* |
||||||
|
* created by Harrison on 2020/08/03 |
||||||
|
**/ |
||||||
|
public class DictionaryTextField<T> extends UITextField { |
||||||
|
|
||||||
|
protected T value; |
||||||
|
|
||||||
|
public DictionaryTextField() { |
||||||
|
} |
||||||
|
|
||||||
|
public DictionaryTextField(int columns) { |
||||||
|
super(columns); |
||||||
|
} |
||||||
|
|
||||||
|
public DictionaryTextField(String text, int columns, T value) { |
||||||
|
super(text, columns); |
||||||
|
this.value = value; |
||||||
|
} |
||||||
|
|
||||||
|
public DictionaryTextField(String text, T value) { |
||||||
|
super(text); |
||||||
|
this.value = value; |
||||||
|
} |
||||||
|
|
||||||
|
public DictionaryTextField(Document doc, String text, int columns, T value) { |
||||||
|
super(doc, text, columns); |
||||||
|
this.value = value; |
||||||
|
} |
||||||
|
|
||||||
|
public T getValue() { |
||||||
|
return value; |
||||||
|
} |
||||||
|
|
||||||
|
public void setValue(T value) { |
||||||
|
this.value = value; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
package com.fr.design.locale.impl; |
||||||
|
|
||||||
|
import com.fr.general.CloudCenter; |
||||||
|
import com.fr.general.GeneralContext; |
||||||
|
import com.fr.general.locale.LocaleMark; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.Locale; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/7/29 |
||||||
|
*/ |
||||||
|
public class BugNeedMark implements LocaleMark<String> { |
||||||
|
private Map<Locale, String> map = new HashMap<>(); |
||||||
|
private static final String TW_BUG_AND_NEEDS = CloudCenter.getInstance().acquireUrlByKind("bbs.bug.needs.zh_TW"); |
||||||
|
|
||||||
|
public BugNeedMark() { |
||||||
|
map.put(Locale.TAIWAN, TW_BUG_AND_NEEDS); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getValue() { |
||||||
|
String result = map.get(GeneralContext.getLocale()); |
||||||
|
return result == null ? TW_BUG_AND_NEEDS : result; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
package com.fr.design.locale.impl; |
||||||
|
|
||||||
|
import com.fr.general.CloudCenter; |
||||||
|
import com.fr.general.GeneralContext; |
||||||
|
import com.fr.general.locale.LocaleMark; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.Locale; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/7/29 |
||||||
|
*/ |
||||||
|
public class TechSupportMark implements LocaleMark<String> { |
||||||
|
private Map<Locale, String> map = new HashMap<>(); |
||||||
|
private static final String EN_TECH_SUPPORT = CloudCenter.getInstance().acquireUrlByKind("bbs.tech.support.en_US"); |
||||||
|
private static final String TW_TECH_SUPPORT = CloudCenter.getInstance().acquireUrlByKind("bbs.tech.support.zh_TW"); |
||||||
|
|
||||||
|
public TechSupportMark() { |
||||||
|
map.put(Locale.US, EN_TECH_SUPPORT); |
||||||
|
map.put(Locale.TAIWAN, TW_TECH_SUPPORT); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getValue() { |
||||||
|
String result = map.get(GeneralContext.getLocale()); |
||||||
|
return result == null ? EN_TECH_SUPPORT : result; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,39 @@ |
|||||||
|
package com.fr.design.os.impl; |
||||||
|
|
||||||
|
import com.fr.design.gui.controlpane.UIListControlPane; |
||||||
|
import com.fr.stable.os.OperatingSystem; |
||||||
|
import com.fr.stable.os.support.OSBasedAction; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* linux下超链弹窗等保存问题 |
||||||
|
* |
||||||
|
* @author hades |
||||||
|
* @version 10.0 |
||||||
|
* Created by hades on 2020/7/21 |
||||||
|
*/ |
||||||
|
public class PopupDialogSaveAction implements OSBasedAction { |
||||||
|
|
||||||
|
private UIListControlPane currentControlPane; |
||||||
|
private Window popupDialog; |
||||||
|
|
||||||
|
@Override |
||||||
|
public void execute(Object... objects) { |
||||||
|
boolean canSave = OperatingSystem.isLinux() && popupDialog != null && popupDialog.isVisible() && currentControlPane != null; |
||||||
|
if (canSave) { |
||||||
|
currentControlPane.saveSettings(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void register(UIListControlPane currentControlPane, Window popupDialog) { |
||||||
|
this.currentControlPane = currentControlPane; |
||||||
|
this.popupDialog = popupDialog; |
||||||
|
} |
||||||
|
|
||||||
|
public void unregister() { |
||||||
|
this.currentControlPane = null; |
||||||
|
this.popupDialog = null; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,61 @@ |
|||||||
|
package com.fr.design.utils; |
||||||
|
|
||||||
|
import com.fr.base.Parameter; |
||||||
|
import com.fr.base.ParameterHelper; |
||||||
|
import com.fr.general.ComparatorUtils; |
||||||
|
import com.fr.stable.ArrayUtils; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.Arrays; |
||||||
|
import java.util.Iterator; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/8/11 |
||||||
|
*/ |
||||||
|
public class ParameterUtils { |
||||||
|
/** |
||||||
|
* 获得新的参数集合,返回的集合中的参数的顺序为:新增参数全部放在后面,以保证原有参数的相对顺序 |
||||||
|
* |
||||||
|
* @param paramTexts sql语句 |
||||||
|
* @param oldParameters 旧的参数集合 |
||||||
|
* @return 新参数集合 |
||||||
|
*/ |
||||||
|
public static Parameter[] analyzeAndUnionParameters(String[] paramTexts, Parameter[] oldParameters) { |
||||||
|
Parameter[] newParameters = ParameterHelper.analyze4Parameters(paramTexts, false); |
||||||
|
return unionParametersInRelativeOrder(oldParameters, newParameters); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 合并新旧参数集合,新增参数全部放在后面,以保证原有参数的相对顺序 |
||||||
|
* |
||||||
|
* @param oldParameters 旧的参数集合 |
||||||
|
* @param newParameters 新的参数集合 |
||||||
|
* @return 新参数集合 |
||||||
|
*/ |
||||||
|
private static Parameter[] unionParametersInRelativeOrder(Parameter[] oldParameters, Parameter[] newParameters) { |
||||||
|
if (ArrayUtils.isEmpty(newParameters) || ArrayUtils.isEmpty(oldParameters)) { |
||||||
|
return newParameters; |
||||||
|
} |
||||||
|
|
||||||
|
Parameter[] result = new Parameter[newParameters.length]; |
||||||
|
List<Parameter> newParameterList = new ArrayList<>(Arrays.asList(newParameters)); |
||||||
|
int i = 0; |
||||||
|
//遍历旧参数数组中的参数,如果新参数list中存在同名参数,将该参数加入到result里,同时删除list中的同名参数
|
||||||
|
for (Parameter oldParameter : oldParameters) { |
||||||
|
Iterator<Parameter> iterator = newParameterList.listIterator(); |
||||||
|
while (iterator.hasNext()) { |
||||||
|
Parameter newParameter = iterator.next(); |
||||||
|
if (ComparatorUtils.equals(oldParameter.getName(), newParameter.getName())) { |
||||||
|
result[i++] = oldParameter; |
||||||
|
iterator.remove(); |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
//将新参数list中的剩余参数添加到result中
|
||||||
|
System.arraycopy(newParameterList.toArray(new Parameter[0]), 0, result, i, newParameterList.size()); |
||||||
|
return result; |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 385 B |
@ -0,0 +1,28 @@ |
|||||||
|
package com.fr.design.formula; |
||||||
|
|
||||||
|
import com.fr.base.BaseFormula; |
||||||
|
import org.junit.Assert; |
||||||
|
import org.junit.Test; |
||||||
|
|
||||||
|
import static org.junit.Assert.*; |
||||||
|
|
||||||
|
public class FormulaTextFieldTest { |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testSet() { |
||||||
|
|
||||||
|
FormulaTextField field = new FormulaTextField(); |
||||||
|
BaseFormula aaaa = BaseFormula.createFormulaBuilder().build("aaaa"); |
||||||
|
field.setValueAndText(aaaa, true); |
||||||
|
|
||||||
|
Assert.assertEquals("aaaa", field.getText()); |
||||||
|
|
||||||
|
field.setValueAndText(aaaa, false); |
||||||
|
Assert.assertEquals("=aaaa", field.getText()); |
||||||
|
|
||||||
|
field.setText("bbbb"); |
||||||
|
BaseFormula formula = field.getValue(); |
||||||
|
Assert.assertEquals("bbbb", formula.getPureContent()); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,39 @@ |
|||||||
|
package com.fr.design.mainframe; |
||||||
|
|
||||||
|
import com.fr.invoke.Reflect; |
||||||
|
import org.junit.Assert; |
||||||
|
import org.junit.Test; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by kerry on 2020-07-28 |
||||||
|
*/ |
||||||
|
public class JFormSliderPaneTest { |
||||||
|
|
||||||
|
|
||||||
|
@Test |
||||||
|
public void testGetPreferredValue() { |
||||||
|
JFormSliderPane sliderPane = new JFormSliderPane(); |
||||||
|
int result = Reflect.on(sliderPane).call("getPreferredValue", 100).get(); |
||||||
|
Assert.assertEquals(100, result); |
||||||
|
result = Reflect.on(sliderPane).call("getPreferredValue", 0).get(); |
||||||
|
Assert.assertEquals(10, result); |
||||||
|
result = Reflect.on(sliderPane).call("getPreferredValue", 1000).get(); |
||||||
|
Assert.assertEquals(400, result); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testCalSliderValue() { |
||||||
|
JFormSliderPane sliderPane = new JFormSliderPane(); |
||||||
|
int result = Reflect.on(sliderPane).call("calSliderValue", 10).get(); |
||||||
|
Assert.assertEquals(0, result); |
||||||
|
result = Reflect.on(sliderPane).call("calSliderValue", 90).get(); |
||||||
|
Assert.assertEquals(44, result); |
||||||
|
result = Reflect.on(sliderPane).call("calSliderValue", 100).get(); |
||||||
|
Assert.assertEquals(50, result); |
||||||
|
result = Reflect.on(sliderPane).call("calSliderValue", 200).get(); |
||||||
|
Assert.assertEquals(66, result); |
||||||
|
result = Reflect.on(sliderPane).call("calSliderValue", 400).get(); |
||||||
|
Assert.assertEquals(100, result); |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,38 @@ |
|||||||
|
package com.fr.design.utils; |
||||||
|
|
||||||
|
import com.fr.base.Parameter; |
||||||
|
import junit.framework.TestCase; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/8/11 |
||||||
|
*/ |
||||||
|
public class ParameterUtilsTest extends TestCase { |
||||||
|
public void testAnalyzeAndUnionParameters() { |
||||||
|
String[] paramTexts = {"${a}${b}${d}", ""}; |
||||||
|
Parameter[] oldParameters = new Parameter[]{new Parameter("c"), new Parameter("b"), new Parameter("a")}; |
||||||
|
Parameter[] rightResult = new Parameter[]{new Parameter("b"), new Parameter("a"), new Parameter("d")}; |
||||||
|
Parameter[] result = ParameterUtils.analyzeAndUnionParameters(paramTexts, oldParameters); |
||||||
|
assertEquals(result.length, rightResult.length); |
||||||
|
for (int i = 0; i < rightResult.length; i++) { |
||||||
|
assertEquals(rightResult[i].getName(), result[i].getName()); |
||||||
|
} |
||||||
|
|
||||||
|
paramTexts = new String[]{"${a}${b}${d}", ""}; |
||||||
|
oldParameters = new Parameter[]{}; |
||||||
|
rightResult = new Parameter[]{new Parameter("a"), new Parameter("b"), new Parameter("d")}; |
||||||
|
result = ParameterUtils.analyzeAndUnionParameters(paramTexts, oldParameters); |
||||||
|
assertEquals(result.length,rightResult.length); |
||||||
|
|
||||||
|
paramTexts = new String[]{"${b}", ""}; |
||||||
|
oldParameters = new Parameter[]{new Parameter("b"), new Parameter("a"), new Parameter("d")}; |
||||||
|
rightResult = new Parameter[]{new Parameter("b")}; |
||||||
|
result = ParameterUtils.analyzeAndUnionParameters(paramTexts, oldParameters); |
||||||
|
assertEquals(result.length,rightResult.length); |
||||||
|
assertEquals(result.length, rightResult.length); |
||||||
|
for (int i = 0; i < rightResult.length; i++) { |
||||||
|
assertEquals(rightResult[i].getName(), result[i].getName()); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,142 @@ |
|||||||
|
package com.fr.design.module; |
||||||
|
|
||||||
|
import com.fr.base.ChartColorMatching; |
||||||
|
import com.fr.base.ChartPreStyleConfig; |
||||||
|
import com.fr.base.Utils; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.gui.controlpane.JListControlPane; |
||||||
|
import com.fr.design.gui.controlpane.NameObjectCreator; |
||||||
|
import com.fr.design.gui.controlpane.NameableCreator; |
||||||
|
import com.fr.design.gui.controlpane.ShortCut4JControlPane; |
||||||
|
import com.fr.design.gui.ilist.ModNameActionListener; |
||||||
|
import com.fr.design.menu.ShortCut; |
||||||
|
import com.fr.general.NameObject; |
||||||
|
import com.fr.stable.Nameable; |
||||||
|
|
||||||
|
import javax.swing.event.ListSelectionEvent; |
||||||
|
import javax.swing.event.ListSelectionListener; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.Iterator; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Bjorn |
||||||
|
* @version 10.0 |
||||||
|
* Created by Bjorn on 2020-07-08 |
||||||
|
*/ |
||||||
|
public class ChartPreStyleListPane extends JListControlPane { |
||||||
|
|
||||||
|
ChartPreStyleManagerPane chartPreStyleManagerPane; |
||||||
|
|
||||||
|
public ChartPreStyleListPane(ChartPreStyleManagerPane chartPreStyleManagerPane) { |
||||||
|
super(); |
||||||
|
this.chartPreStyleManagerPane = chartPreStyleManagerPane; |
||||||
|
initListener(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建有名字的creator |
||||||
|
* |
||||||
|
* @return 有名字的creator数组 |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public NameableCreator[] createNameableCreators() { |
||||||
|
return new NameableCreator[]{ |
||||||
|
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_PreStyle_Duplicate"), |
||||||
|
ChartColorMatching.class, ChartPreStylePane.class) |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String title4PopupWindow() { |
||||||
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_PreStyle"); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public BasicBeanPane createPaneByCreators(NameableCreator creator) { |
||||||
|
return new ChartPreStylePane() { |
||||||
|
@Override |
||||||
|
protected void refreshWhenStyleChange(ChartColorMatching preStyle) { |
||||||
|
super.refreshWhenStyleChange(preStyle); |
||||||
|
chartPreStyleManagerPane.refreshDefaultColorBox(); |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
protected ShortCut4JControlPane[] createShortcuts() { |
||||||
|
return new ShortCut4JControlPane[]{ |
||||||
|
shortCutFactory.addItemShortCut(), |
||||||
|
createRemoveItemShortCut(), |
||||||
|
shortCutFactory.copyItemShortCut(), |
||||||
|
shortCutFactory.moveUpItemShortCut(), |
||||||
|
shortCutFactory.moveDownItemShortCut(), |
||||||
|
shortCutFactory.sortItemShortCut() |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
private ShortCut4JControlPane createRemoveItemShortCut() { |
||||||
|
ShortCut4JControlPane shortCut4JControlPane = shortCutFactory.removeItemShortCut(); |
||||||
|
//替换删除按钮的check事件。
|
||||||
|
ShortCut shortCut = shortCut4JControlPane.getShortCut(); |
||||||
|
shortCut4JControlPane = new MoreThanOneShortCut(shortCut); |
||||||
|
return shortCut4JControlPane; |
||||||
|
} |
||||||
|
|
||||||
|
public void initListener() { |
||||||
|
nameableList.addListSelectionListener(new ListSelectionListener() { |
||||||
|
@Override |
||||||
|
public void valueChanged(ListSelectionEvent e) { |
||||||
|
chartPreStyleManagerPane.refreshDefaultColorBox(); |
||||||
|
} |
||||||
|
}); |
||||||
|
nameableList.addModNameActionListener(new ModNameActionListener() { |
||||||
|
@Override |
||||||
|
public void nameModed(int index, String oldName, String newName) { |
||||||
|
chartPreStyleManagerPane.refreshDefaultColorBox(oldName, newName); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
public void populateBean() { |
||||||
|
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance().mirror(); |
||||||
|
ArrayList list = new ArrayList(); |
||||||
|
|
||||||
|
Iterator keys = config.names(); |
||||||
|
while (keys.hasNext()) { |
||||||
|
Object key = keys.next(); |
||||||
|
ChartColorMatching value = (ChartColorMatching) config.getPreStyle(key); |
||||||
|
|
||||||
|
list.add(new NameObject(Utils.objectToString(key), value)); |
||||||
|
} |
||||||
|
|
||||||
|
Nameable[] values = (Nameable[]) list.toArray(new Nameable[list.size()]); |
||||||
|
populate(values); |
||||||
|
|
||||||
|
if (config.containsName(config.getCurrentStyle())) { |
||||||
|
this.setSelectedName(config.getCurrentStyle()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void updateBean() { |
||||||
|
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); |
||||||
|
|
||||||
|
Nameable[] values = update(); |
||||||
|
config.clearAllPreStyle(); |
||||||
|
|
||||||
|
for (Nameable value : values) { |
||||||
|
config.putPreStyle(value.getName(), ((NameObject) value).getObject()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private class MoreThanOneShortCut extends ShortCut4JControlPane { |
||||||
|
public MoreThanOneShortCut(ShortCut shortCut) { |
||||||
|
this.shortCut = shortCut; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@Override |
||||||
|
public void checkEnable() { |
||||||
|
this.shortCut.setEnabled(nameableList.getModel().getSize() > 1); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,96 @@ |
|||||||
|
package com.fr.van.chart.box; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Chart; |
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.condition.ConditionAttributesPane; |
||||||
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
import com.fr.design.mainframe.chart.AbstractChartAttrPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.ChartDataPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.ChartStylePane; |
||||||
|
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; |
||||||
|
import com.fr.plugin.chart.attr.plot.VanChartPlot; |
||||||
|
import com.fr.van.chart.box.data.report.BoxPlotReportDataContentPane; |
||||||
|
import com.fr.van.chart.box.data.table.BoxPlotTableDataContentPane; |
||||||
|
import com.fr.van.chart.designer.other.AutoRefreshPane; |
||||||
|
import com.fr.van.chart.designer.other.AutoRefreshPaneWithoutTooltip; |
||||||
|
import com.fr.van.chart.designer.other.VanChartInteractivePane; |
||||||
|
import com.fr.van.chart.designer.other.VanChartOtherPane; |
||||||
|
import com.fr.van.chart.designer.other.zoom.ZoomPane; |
||||||
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
||||||
|
import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; |
||||||
|
|
||||||
|
import java.awt.Component; |
||||||
|
|
||||||
|
public class BoxIndependentVanChartInterface extends AbstractIndependentVanChartUI { |
||||||
|
|
||||||
|
public String getName() { |
||||||
|
return Toolkit.i18nText("Fine-Design_Chart_New_Box"); |
||||||
|
} |
||||||
|
|
||||||
|
public String[] getSubName() { |
||||||
|
return new String[]{ |
||||||
|
Toolkit.i18nText("Fine-Design_Chart_New_Box") |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
public String[] getDemoImagePath() { |
||||||
|
return new String[]{ |
||||||
|
"com/fr/plugin/chart/demo/image/box.png" |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
public String getIconPath() { |
||||||
|
return "com/fr/design/images/form/toolbar/box.png"; |
||||||
|
} |
||||||
|
|
||||||
|
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { |
||||||
|
return new BoxPlotTableDataContentPane(plot, parent); |
||||||
|
} |
||||||
|
|
||||||
|
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { |
||||||
|
return new BoxPlotReportDataContentPane(plot, parent); |
||||||
|
} |
||||||
|
|
||||||
|
public AbstractChartTypePane getPlotTypePane() { |
||||||
|
return new VanChartBoxPlotPane(); |
||||||
|
} |
||||||
|
|
||||||
|
public ConditionAttributesPane getPlotConditionPane(Plot plot) { |
||||||
|
return new VanChartBoxConditionPane(plot); |
||||||
|
} |
||||||
|
|
||||||
|
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) { |
||||||
|
return new VanChartBoxSeriesPane(parent, plot); |
||||||
|
} |
||||||
|
|
||||||
|
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) { |
||||||
|
VanChartStylePane stylePane = new VanChartBoxStylePane(listener); |
||||||
|
VanChartOtherPane otherPane = new VanChartOtherPane() { |
||||||
|
|
||||||
|
protected BasicBeanPane<Chart> createInteractivePane() { |
||||||
|
return new VanChartInteractivePane() { |
||||||
|
|
||||||
|
protected Component[][] createToolBarComponents() { |
||||||
|
return createToolBarComponentsWithOutSort(); |
||||||
|
} |
||||||
|
|
||||||
|
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) { |
||||||
|
boolean isLargeModel = largeModel(plot); |
||||||
|
return new AutoRefreshPaneWithoutTooltip(chart, isLargeModel); |
||||||
|
} |
||||||
|
|
||||||
|
protected ZoomPane createZoomPane() { |
||||||
|
return new ZoomPane(); |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
return new AbstractChartAttrPane[]{stylePane, otherPane}; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,83 @@ |
|||||||
|
package com.fr.van.chart.box; |
||||||
|
|
||||||
|
import com.fr.base.background.ColorBackground; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.gui.ispinner.UISpinner; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.plugin.chart.base.AttrBorderWithWidth; |
||||||
|
import com.fr.stable.StringUtils; |
||||||
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
||||||
|
import com.fr.van.chart.designer.component.background.VanChartMarkerBackgroundPane; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.BorderLayout; |
||||||
|
import java.awt.Component; |
||||||
|
|
||||||
|
public class VanChartBoxBorderPane extends BasicBeanPane<AttrBorderWithWidth> { |
||||||
|
|
||||||
|
private VanChartMarkerBackgroundPane colorBackground; |
||||||
|
private UISpinner lineWidth; |
||||||
|
|
||||||
|
public VanChartBoxBorderPane() { |
||||||
|
colorBackground = new VanChartMarkerBackgroundPane() { |
||||||
|
|
||||||
|
protected Component[][] getPaneComponents() { |
||||||
|
return new Component[][]{ |
||||||
|
new Component[]{null, null}, |
||||||
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), typeComboBox}, |
||||||
|
new Component[]{null, centerPane}, |
||||||
|
}; |
||||||
|
} |
||||||
|
}; |
||||||
|
lineWidth = new UISpinner(0.5, Double.MAX_VALUE, 0.5, 0.5); |
||||||
|
|
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{null, null}, |
||||||
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")), lineWidth}, |
||||||
|
new Component[]{colorBackground, null} |
||||||
|
}; |
||||||
|
|
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double f = TableLayout.FILL; |
||||||
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
||||||
|
|
||||||
|
double[] columnSize = {f, e}; |
||||||
|
double[] rowSize = {p, p, p}; |
||||||
|
|
||||||
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
||||||
|
this.setLayout(new BorderLayout()); |
||||||
|
this.add(panel, BorderLayout.CENTER); |
||||||
|
} |
||||||
|
|
||||||
|
public void populateBean(AttrBorderWithWidth border) { |
||||||
|
if (border.getBorderColor() != null) { |
||||||
|
this.colorBackground.populate(ColorBackground.getInstance(border.getBorderColor())); |
||||||
|
} |
||||||
|
|
||||||
|
this.lineWidth.setValue(border.getLineWidth()); |
||||||
|
} |
||||||
|
|
||||||
|
public AttrBorderWithWidth updateBean() { |
||||||
|
AttrBorderWithWidth border = new AttrBorderWithWidth(); |
||||||
|
|
||||||
|
ColorBackground colorBackground = this.colorBackground.update(); |
||||||
|
|
||||||
|
if (colorBackground == null) { |
||||||
|
border.setBorderColor(null); |
||||||
|
} else { |
||||||
|
border.setBorderColor(colorBackground.getColor()); |
||||||
|
} |
||||||
|
|
||||||
|
if (this.lineWidth != null) { |
||||||
|
border.setLineWidth(this.lineWidth.getValue()); |
||||||
|
} |
||||||
|
|
||||||
|
return border; |
||||||
|
} |
||||||
|
|
||||||
|
protected String title4PopupWindow() { |
||||||
|
return StringUtils.EMPTY; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,62 @@ |
|||||||
|
package com.fr.van.chart.box; |
||||||
|
|
||||||
|
import com.fr.chart.base.AttrAlpha; |
||||||
|
import com.fr.chart.base.AttrBackground; |
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; |
||||||
|
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; |
||||||
|
import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane; |
||||||
|
import com.fr.plugin.chart.base.AttrBorderWithWidth; |
||||||
|
import com.fr.plugin.chart.box.VanChartAttrNormalMarker; |
||||||
|
import com.fr.plugin.chart.box.VanChartAttrOutlierMarker; |
||||||
|
import com.fr.plugin.chart.box.VanChartBoxPlot; |
||||||
|
import com.fr.plugin.chart.type.ConditionKeyType; |
||||||
|
import com.fr.van.chart.box.condition.VanChartBoxBorderConditionPane; |
||||||
|
import com.fr.van.chart.box.condition.VanChartBoxNormalMarkerConditionPane; |
||||||
|
import com.fr.van.chart.box.condition.VanChartBoxOutlierMarkerConditionPane; |
||||||
|
import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; |
||||||
|
|
||||||
|
import java.awt.Dimension; |
||||||
|
|
||||||
|
public class VanChartBoxConditionPane extends DataSeriesConditionPane { |
||||||
|
|
||||||
|
public VanChartBoxConditionPane(Plot plot) { |
||||||
|
super(plot); |
||||||
|
} |
||||||
|
|
||||||
|
protected void initComponents() { |
||||||
|
super.initComponents(); |
||||||
|
|
||||||
|
liteConditionPane.setPreferredSize(new Dimension(300, 400)); |
||||||
|
} |
||||||
|
|
||||||
|
protected void addBasicAction() { |
||||||
|
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); |
||||||
|
classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); |
||||||
|
classPaneMap.put(AttrBorderWithWidth.class, new VanChartBoxBorderConditionPane(this)); |
||||||
|
|
||||||
|
if (((VanChartBoxPlot) plot).isDetailed()) { |
||||||
|
classPaneMap.put(VanChartAttrNormalMarker.class, new VanChartBoxNormalMarkerConditionPane(this)); |
||||||
|
classPaneMap.put(VanChartAttrOutlierMarker.class, new VanChartBoxOutlierMarkerConditionPane(this)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
protected void addStyleAction() { |
||||||
|
} |
||||||
|
|
||||||
|
protected ChartConditionPane createListConditionPane() { |
||||||
|
|
||||||
|
return new ChartConditionPane() { |
||||||
|
|
||||||
|
@Override |
||||||
|
protected ConditionKeyType[] conditionKeyTypes() { |
||||||
|
return ConditionKeyType.BOX_CONDITION_KEY_TYPES; |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public Class<? extends Plot> class4Correspond() { |
||||||
|
return VanChartBoxPlot.class; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,51 @@ |
|||||||
|
package com.fr.van.chart.box; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Chart; |
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.log.FineLoggerFactory; |
||||||
|
import com.fr.plugin.chart.base.VanChartTools; |
||||||
|
import com.fr.plugin.chart.box.BoxIndependentVanChart; |
||||||
|
import com.fr.plugin.chart.box.VanChartBoxPlot; |
||||||
|
import com.fr.van.chart.designer.type.AbstractVanChartTypePane; |
||||||
|
|
||||||
|
public class VanChartBoxPlotPane extends AbstractVanChartTypePane { |
||||||
|
|
||||||
|
protected String[] getTypeIconPath() { |
||||||
|
return new String[]{"/com/fr/van/chart/box.images/box.png" |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
protected Plot getSelectedClonedPlot() { |
||||||
|
VanChartBoxPlot newPlot = null; |
||||||
|
|
||||||
|
Chart[] boxChartGroup = BoxIndependentVanChart.BoxVanChartTypes; |
||||||
|
|
||||||
|
for (int i = 0, len = boxChartGroup.length; i < len; i++) { |
||||||
|
if (typeDemo.get(i).isPressing) { |
||||||
|
newPlot = boxChartGroup[i].getPlot(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
Plot cloned = null; |
||||||
|
|
||||||
|
try { |
||||||
|
if (newPlot != null) { |
||||||
|
cloned = (Plot) newPlot.clone(); |
||||||
|
} |
||||||
|
} catch (CloneNotSupportedException e) { |
||||||
|
FineLoggerFactory.getLogger().error("Error In ColumnChart"); |
||||||
|
} |
||||||
|
|
||||||
|
return cloned; |
||||||
|
} |
||||||
|
|
||||||
|
public Chart getDefaultChart() { |
||||||
|
return BoxIndependentVanChart.BoxVanChartTypes[0]; |
||||||
|
} |
||||||
|
|
||||||
|
protected VanChartTools createVanChartTools() { |
||||||
|
VanChartTools tools = new VanChartTools(); |
||||||
|
tools.setSort(false); |
||||||
|
return tools; |
||||||
|
} |
||||||
|
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue