forked from fanruan/design
Browse Source
* commit 'fd2c37ad581a6efdb850fc1acdf43a815c441d90': (51 commits) REPORT-14624【0123回归】输出内置数据集到设计器工作目录覆盖原文件,导出失败 这里转OutputStream时,需要保留原文件,否则覆盖自身时会找不到文件 CHART-3017 为区域段图例面板指定Parent 传FR10 代码质量:从源头返回空list REPORT-14465 【10.0冒烟】 数字控件“双精度型” 全部展开显示,最底端文字被遮挡 REPORT-14569 10.0release的alphafine显示问题 定位到是多线程的bug,某些情况下list里放入了之前的线程搜索的结果。目前策略是各线程各自维护一个列表,获取结果后再赋给全局变量 REPORT-14103 单元格控件设置左父格自动消失 10.0 同步 & REPORT-14558 【回归测试】单元格属性--修改自动调整属性,控件会消失 CHART-3856 自动播放界面问题 CHART-3791 从其他图表切换至地图,重置地图数据配置 pmd REPORT-14667 支持通过插件扩展目录树支持的文件后缀 REPORT-13094 oracle远程设计获取表问题 REPORT-13094 oracle远程设计获取表问题 删除无用 import MOBILE-19684 同时安装顶部参数插件和导航参数插件时设计器显示重复值 REPORT-14515 环境切换后模板另存面板没有刷新 REPORT-13225 移动插件脚本下载位置,并删除无用temp文件 代码质量 代码质量 REPORT-13094 设计器远程,选项中没有设置显示oracle所有表,有一部分逻辑不走服务器 CHART-2809 大屏自动播放 design ...research/10.0
neil
6 years ago
79 changed files with 1185 additions and 548 deletions
@ -0,0 +1,63 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.file.FILE; |
||||
import com.fr.stable.CoreConstants; |
||||
import com.fr.third.javax.annotation.Nonnull; |
||||
import com.fr.third.javax.annotation.Nullable; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
public final class JTemplateFactory { |
||||
private static final List<App<?>> ALL_APP = new ArrayList<App<?>>(); |
||||
|
||||
private JTemplateFactory() { |
||||
} |
||||
|
||||
/** |
||||
* 生成设计器编辑模板对象 |
||||
* |
||||
* @param file 包含了模板名称,类型以及内容的文件 |
||||
* @return 设计器编辑的模板对象 |
||||
*/ |
||||
@Nullable |
||||
public static JTemplate<?, ?> createJTemplate(@Nonnull FILE file) { |
||||
|
||||
String fileName = file.getName(); |
||||
int indexOfLastDot = fileName.lastIndexOf(CoreConstants.DOT); |
||||
if (indexOfLastDot < 0) { |
||||
return null; |
||||
} |
||||
String fileExtension = fileName.substring(indexOfLastDot + 1); |
||||
for (App<?> app : ALL_APP) { |
||||
String[] defaultAppExtensions = app.defaultExtensions(); |
||||
for (String defaultAppExtension : defaultAppExtensions) { |
||||
if (defaultAppExtension.equalsIgnoreCase(fileExtension)) { |
||||
JTemplate<?, ?> jt = app.openTemplate(file); |
||||
if (jt != null) { |
||||
return jt; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 注册app. |
||||
* |
||||
* @param app 注册app. |
||||
*/ |
||||
public static void register(App<?> app) { |
||||
if (app != null) { |
||||
ALL_APP.add(app); |
||||
} |
||||
} |
||||
|
||||
public static void remove(App<?> app) { |
||||
if (app != null) { |
||||
ALL_APP.remove(app); |
||||
} |
||||
} |
||||
} |
@ -1 +1,24 @@
|
||||
package com.fr.design.parameter;
import com.fr.base.Parameter;
public interface ParaDefinitePane {
public Parameter[] getNoRepeatParas(Parameter[] paras);
public void setParameterArray(Parameter[] ps);
public Parameter[] getParameterArray();
public void refreshParameter();
public boolean isWithQueryButton();
public void addingParameter2Editor(Parameter p);
public void addingParameter2EditorWithQueryButton(Parameter p);
public void addingAllParameter2Editor();
} |
||||
package com.fr.design.parameter; |
||||
|
||||
import com.fr.base.Parameter; |
||||
|
||||
|
||||
public interface ParaDefinitePane { |
||||
|
||||
Parameter[] getNoRepeatParas(Parameter[] paras); |
||||
|
||||
void setParameterArray(Parameter[] ps); |
||||
|
||||
Parameter[] getParameterArray(); |
||||
|
||||
void refreshParameter(); |
||||
|
||||
boolean isWithQueryButton(); |
||||
|
||||
void addingParameter2Editor(Parameter p); |
||||
|
||||
void addingParameter2EditorWithQueryButton(Parameter p); |
||||
|
||||
void addingAllParameter2Editor(); |
||||
|
||||
} |
@ -0,0 +1,51 @@
|
||||
package com.fr.design.widget; |
||||
|
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.utils.gui.UIComponentUtils; |
||||
|
||||
/** |
||||
* 创建 widget 的静态工厂 |
||||
* Created by plough on 2019/1/15. |
||||
*/ |
||||
public class FRWidgetFactory { |
||||
// 不可实例化
|
||||
private FRWidgetFactory() { |
||||
throw new AssertionError(); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个可换行的 UILabel |
||||
* @param text 标签文字 |
||||
* @return com.fr.design.gui.ilable.UILabel |
||||
*/ |
||||
public static UILabel createLineWrapLabel(String text) { |
||||
UILabel label = new UILabel(text); |
||||
UIComponentUtils.setLineWrap(label); |
||||
return label; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个可换行的 UILabel |
||||
* @param text 标签文字 |
||||
* @param lineWidth 最大行宽 |
||||
* @return com.fr.design.gui.ilable.UILabel |
||||
*/ |
||||
public static UILabel createLineWrapLabel(String text, int lineWidth) { |
||||
UILabel label = new UILabel(text); |
||||
UIComponentUtils.setLineWrap(label, lineWidth); |
||||
return label; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个可换行可调整水平对齐的 UILabel |
||||
* @param text |
||||
* @param lineWidth |
||||
* @param horizontalAlignment |
||||
* @return com.fr.design.gui.ilable.UILabel |
||||
*/ |
||||
public static UILabel createLineWrapLabel(String text, int lineWidth, int horizontalAlignment) { |
||||
UILabel label = createLineWrapLabel(text, lineWidth); |
||||
label.setHorizontalAlignment(horizontalAlignment); |
||||
return label; |
||||
} |
||||
} |
@ -0,0 +1,106 @@
|
||||
package com.fr.file; |
||||
|
||||
import javax.swing.Icon; |
||||
import javax.transaction.NotSupportedException; |
||||
import java.io.ByteArrayInputStream; |
||||
import java.io.InputStream; |
||||
import java.io.OutputStream; |
||||
|
||||
/** |
||||
* 切换环境用于暂存的文件类型 |
||||
*/ |
||||
public class StashedFILE implements FILE { |
||||
|
||||
private FILE file; |
||||
private byte[] content; |
||||
|
||||
public StashedFILE(FILE file, byte[] content) { |
||||
this.file = file; |
||||
this.content = content; |
||||
} |
||||
|
||||
@Override |
||||
public String prefix() { |
||||
return file.prefix(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isDirectory() { |
||||
return file.isDirectory(); |
||||
} |
||||
|
||||
@Override |
||||
public String getName() { |
||||
return file.getName(); |
||||
} |
||||
|
||||
@Override |
||||
public Icon getIcon() { |
||||
return file.getIcon(); |
||||
} |
||||
|
||||
@Override |
||||
public String getPath() { |
||||
return file.getPath(); |
||||
} |
||||
|
||||
@Override |
||||
public void setPath(String path) { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public FILE getParent() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public FILE[] listFiles() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean createFolder(String name) { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean mkfile() throws Exception { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean exists() { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public void closeTemplate() throws Exception { |
||||
// do nothing
|
||||
} |
||||
|
||||
@Override |
||||
public InputStream asInputStream() throws Exception { |
||||
return new ByteArrayInputStream(content); |
||||
} |
||||
|
||||
@Override |
||||
public OutputStream asOutputStream() throws Exception { |
||||
throw new NotSupportedException(); |
||||
} |
||||
|
||||
@Override |
||||
public String getEnvFullName() { |
||||
return file.getEnvFullName(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isMemFile() { |
||||
return true; |
||||
} |
||||
|
||||
@Override |
||||
public boolean isEnvFile() { |
||||
return false; |
||||
} |
||||
} |
After Width: | Height: | Size: 26 MiB |
Loading…
Reference in new issue