forked from fanruan/design
Browse Source
Merge in DESIGN/design from final/10.0 to bugfix/10.0 * commit '5d1dc866ca8087a4c62ea078c72d622d1ac79550': (334 commits) CHART-14399 坐标轴切换类型时,保留网格线类型和颜色 同步到final REPORT-34222 报表设计器给容器插件开个复制粘贴的接口 同步到final MOBILE-27698 移动端控件类插件设置边框不生效 REPORT-33599 设计器菜单栏导出txt,当修改导出的参数时模版会被刷新为待保存状态 && REPORT-33525 删除引用的Js或者css 有歧义 REPORT-33616 填报属性设置-智能添加单元格,确认和取消效果一样 CHART-14104 坐标轴切换前后,传递网格线属性 import设置不对 REPORT-33858 日志死循环的问题 CHART-13666 国际化修改 CHART-13666 CHART-13666 图表自动类型推荐 删除无用方法 代码简化 REPORT-31758【frm自适应重构05.25周】frm设计界面支持缩放 REPORT-33575 改下方法名称 REPORT-33575 远程连接启用https的环境,服务器关掉之后没有跳出切换工作目录的弹窗 && REPORT-33454 切换远程目录成功,弹窗提示切换失败 REPORT-33731 带参存储过程预览没有弹出参数输入框 MOBILE-27532 单选/复选按钮组自适应高度 REPORT-33459 启动后 设计器显示异常 CHART-14264 修改配色面板样式 ...bugfix/10.0
403 changed files with 12962 additions and 3724 deletions
@ -0,0 +1,82 @@
|
||||
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel |
||||
|
||||
plugins { |
||||
id 'java' |
||||
id 'java-library' |
||||
id 'com.fr.common' version '1.0-SNAPSHOT' |
||||
} |
||||
|
||||
// 模块参数 |
||||
ext { |
||||
frVersion = "" |
||||
outputPath = "build" |
||||
ignoreTestFailureSetting = true |
||||
languageLevelSetting = 1.8 |
||||
} |
||||
|
||||
applyGlobalConfigPathIfExist() |
||||
|
||||
if (versions.frVersion) { |
||||
frVersion = versions.frVersion |
||||
} |
||||
def frDevVersion = "DEV" + frVersion |
||||
|
||||
dependencies { |
||||
api project(':designer-base') |
||||
api project(':designer-chart') |
||||
api project(':designer-form') |
||||
api project(':designer-realize') |
||||
} |
||||
|
||||
allprojects { |
||||
apply plugin: 'java' |
||||
apply plugin: 'java-library' |
||||
apply plugin: 'idea' |
||||
|
||||
group 'com.fr.design' |
||||
version frDevVersion |
||||
sourceCompatibility = languageLevelSetting |
||||
targetCompatibility = languageLevelSetting |
||||
|
||||
tasks.withType(JavaCompile) { |
||||
options.encoding = "UTF-8" |
||||
} |
||||
|
||||
repositories { |
||||
mavenLocal() |
||||
} |
||||
|
||||
idea { |
||||
module { |
||||
inheritOutputDirs = false |
||||
outputDir = file(outputPath +"/classes") |
||||
testOutputDir = file(outputPath +"/test-classes") |
||||
languageLevel = new IdeaLanguageLevel(sourceCompatibility) |
||||
targetBytecodeVersion = targetCompatibility |
||||
} |
||||
} |
||||
|
||||
dependencies { |
||||
implementation 'com.fr.third:jxbrowser:6.23' |
||||
implementation 'com.fr.third:jxbrowser-swing:6.23' |
||||
implementation 'com.fr.third:jxbrowser-mac:6.23' |
||||
implementation 'com.fr.third:jxbrowser-win64:6.23' |
||||
implementation 'com.fr.third.server:servlet-api:3.0' |
||||
implementation 'org.swingexplorer:swexpl:2.0.1' |
||||
implementation 'org.swingexplorer:swag:1.0' |
||||
implementation 'net.java.dev.jna:jna:5.4.0' |
||||
implementation 'org.apache.tomcat:tomcat-catalina:8.5.32' |
||||
implementation 'io.socket:socket.io-client:0.7.0' |
||||
implementation 'com.fr.third:fine-third:' + frVersion |
||||
implementation 'com.fr.core:fine-core:' + frDevVersion |
||||
implementation 'com.fr.activator:fine-activator:' + frVersion |
||||
implementation 'com.fr.datasource:fine-datasource:' + frVersion |
||||
implementation 'com.fr.decision:fine-decision:' + frVersion |
||||
implementation 'com.fr.schedule:fine-schedule:' + frVersion |
||||
implementation 'com.fr.report:fine-report-engine:' + frDevVersion |
||||
testImplementation 'org.easymock:easymock:3.5.1' |
||||
testImplementation 'org.powermock:powermock-module-junit4:1.7.1' |
||||
testImplementation 'org.powermock:powermock-api-easymock:1.7.1' |
||||
testImplementation 'junit:junit:4.12' |
||||
} |
||||
} |
@ -0,0 +1,50 @@
|
||||
package com.fr.design.base.clipboard; |
||||
|
||||
import com.fr.design.ExtraDesignClassManager; |
||||
import com.fr.design.fun.ClipboardHandlerProvider; |
||||
import com.fr.plugin.injectable.PluginModule; |
||||
|
||||
import java.util.Set; |
||||
|
||||
/** |
||||
* created by Harrison on 2020/05/14 |
||||
**/ |
||||
@SuppressWarnings({"rawtypes", "unchecked"}) |
||||
public abstract class ClipboardFilter { |
||||
|
||||
public static <T> T cut(T selection) { |
||||
|
||||
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); |
||||
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); |
||||
for (ClipboardHandlerProvider provider : providers) { |
||||
if (provider.support(selection)) { |
||||
selection = ((ClipboardHandlerProvider<T>) provider).cut(selection); |
||||
} |
||||
} |
||||
return selection; |
||||
} |
||||
|
||||
public static <T> T copy(T selection) { |
||||
|
||||
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); |
||||
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); |
||||
for (ClipboardHandlerProvider provider : providers) { |
||||
if (provider.support(selection)) { |
||||
selection = ((ClipboardHandlerProvider<T>) provider).copy(selection); |
||||
} |
||||
} |
||||
return selection; |
||||
} |
||||
|
||||
public static <T> T paste(T selection) { |
||||
|
||||
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); |
||||
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); |
||||
for (ClipboardHandlerProvider provider : providers) { |
||||
if (provider.support(selection)) { |
||||
selection = ((ClipboardHandlerProvider<T>) provider).paste(selection); |
||||
} |
||||
} |
||||
return selection; |
||||
} |
||||
} |
@ -0,0 +1,68 @@
|
||||
package com.fr.design.base.clipboard; |
||||
|
||||
import java.awt.datatransfer.Clipboard; |
||||
import java.awt.datatransfer.ClipboardOwner; |
||||
import java.awt.datatransfer.DataFlavor; |
||||
import java.awt.datatransfer.FlavorListener; |
||||
import java.awt.datatransfer.Transferable; |
||||
import java.awt.datatransfer.UnsupportedFlavorException; |
||||
import java.io.IOException; |
||||
|
||||
/** |
||||
* created by Harrison on 2020/05/11 |
||||
**/ |
||||
public class DesignerClipboard extends Clipboard { |
||||
|
||||
private Clipboard clipboard; |
||||
|
||||
public DesignerClipboard(Clipboard clipboard) { |
||||
super(clipboard.getName()); |
||||
this.clipboard = clipboard; |
||||
} |
||||
|
||||
@Override |
||||
public synchronized void setContents(Transferable contents, ClipboardOwner owner) { |
||||
//处理 contents/owner
|
||||
Transferable filtered = ClipboardFilter.copy(contents); |
||||
clipboard.setContents(filtered, owner); |
||||
} |
||||
|
||||
@Override |
||||
public synchronized Transferable getContents(Object requestor) { |
||||
Transferable contents = clipboard.getContents(requestor); |
||||
//处理 contents
|
||||
Transferable filtered = ClipboardFilter.paste(contents); |
||||
return filtered; |
||||
} |
||||
|
||||
@Override |
||||
public DataFlavor[] getAvailableDataFlavors() { |
||||
return clipboard.getAvailableDataFlavors(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isDataFlavorAvailable(DataFlavor flavor) { |
||||
return clipboard.isDataFlavorAvailable(flavor); |
||||
} |
||||
|
||||
@Override |
||||
public Object getData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { |
||||
return clipboard.getData(flavor); |
||||
} |
||||
|
||||
@Override |
||||
public synchronized void addFlavorListener(FlavorListener listener) { |
||||
clipboard.addFlavorListener(listener); |
||||
} |
||||
|
||||
@Override |
||||
public synchronized void removeFlavorListener(FlavorListener listener) { |
||||
clipboard.removeFlavorListener(listener); |
||||
} |
||||
|
||||
@Override |
||||
public synchronized FlavorListener[] getFlavorListeners() { |
||||
return clipboard.getFlavorListeners(); |
||||
} |
||||
|
||||
} |
@ -1,234 +0,0 @@
|
||||
package com.fr.design.extra; |
||||
|
||||
import com.fr.design.dialog.FineJOptionPane; |
||||
import com.fr.general.CloudCenter; |
||||
import com.fr.general.ComparatorUtils; |
||||
import com.fr.general.IOUtils; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import javafx.application.Platform; |
||||
import javafx.beans.property.BooleanProperty; |
||||
import javafx.beans.property.SimpleBooleanProperty; |
||||
import javafx.beans.value.ChangeListener; |
||||
import javafx.beans.value.ObservableValue; |
||||
import javafx.concurrent.Worker; |
||||
import javafx.embed.swing.JFXPanel; |
||||
import javafx.event.ActionEvent; |
||||
import javafx.event.EventHandler; |
||||
import javafx.scene.Group; |
||||
import javafx.scene.Node; |
||||
import javafx.scene.Scene; |
||||
import javafx.scene.control.ButtonBuilder; |
||||
import javafx.scene.control.LabelBuilder; |
||||
import javafx.scene.input.MouseEvent; |
||||
import javafx.scene.layout.BorderPane; |
||||
import javafx.scene.layout.HBox; |
||||
import javafx.scene.layout.HBoxBuilder; |
||||
import javafx.scene.paint.Color; |
||||
import javafx.scene.web.WebEngine; |
||||
import javafx.scene.web.WebEvent; |
||||
import javafx.scene.web.WebView; |
||||
import javafx.stage.Modality; |
||||
import javafx.stage.Screen; |
||||
import javafx.stage.Stage; |
||||
import javafx.stage.StageStyle; |
||||
import javafx.stage.WindowEvent; |
||||
import javafx.util.Callback; |
||||
import netscape.javascript.JSObject; |
||||
|
||||
import javax.swing.JOptionPane; |
||||
import javax.swing.SwingUtilities; |
||||
import java.awt.Toolkit; |
||||
|
||||
/** |
||||
* Created by zhaohehe on 16/7/28. |
||||
*/ |
||||
public class QQLoginWebPane extends JFXPanel { |
||||
|
||||
private WebEngine webEngine; |
||||
private String url; |
||||
|
||||
private static JSObject window; |
||||
|
||||
private static int DEFAULT_PRIMARYSTAGE_WIDTH = 100; |
||||
private static int DEFAULT_PRIMARYSTAGE_HEIGHT = 100; |
||||
|
||||
private static int DEFAULT_CONFIRM_WIDTH = 450; |
||||
private static int DEFAULT_CONFIRM_HEIGHT = 160; |
||||
private static int DEFAULT_OFFEST = 20; |
||||
|
||||
class Delta { |
||||
double x, y; |
||||
} |
||||
|
||||
public QQLoginWebPane(final String installHome) { |
||||
Platform.setImplicitExit(false); |
||||
Platform.runLater(new Runnable() { |
||||
@Override |
||||
public void run() { |
||||
BorderPane root = new BorderPane(); |
||||
Scene scene = new Scene(root); |
||||
QQLoginWebPane.this.setScene(scene); |
||||
final WebView webView = new WebView(); |
||||
webEngine = webView.getEngine(); |
||||
url = "file:///" + installHome + "/scripts/qqLogin.html"; |
||||
webEngine.load(url); |
||||
|
||||
final Stage primaryStage = new Stage(); |
||||
|
||||
HBox layout = new HBox(); |
||||
try { |
||||
primaryStage.initStyle(StageStyle.TRANSPARENT); |
||||
primaryStage.setScene(new Scene(layout)); |
||||
webView.getScene().getStylesheets().add(IOUtils.getResource("modal-dialog.css", getClass()).toExternalForm()); |
||||
primaryStage.initStyle(StageStyle.UTILITY); |
||||
primaryStage.setScene(new Scene(new Group(), DEFAULT_PRIMARYSTAGE_WIDTH, DEFAULT_PRIMARYSTAGE_HEIGHT)); |
||||
primaryStage.setX(0); |
||||
primaryStage.setY(Screen.getPrimary().getBounds().getHeight() + DEFAULT_PRIMARYSTAGE_HEIGHT); |
||||
primaryStage.show(); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().info(e.getMessage()); |
||||
} |
||||
webEngine.setConfirmHandler(new Callback<String, Boolean>() { |
||||
@Override |
||||
public Boolean call(String msg) { |
||||
Boolean confirmed = confirm(primaryStage, msg, webView); |
||||
return confirmed; |
||||
} |
||||
}); |
||||
configWebEngine(); |
||||
webView.setContextMenuEnabled(false);//屏蔽右键
|
||||
root.setCenter(webView); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
private void configWebEngine() { |
||||
|
||||
webEngine.locationProperty().addListener(new ChangeListener<String>() { |
||||
@Override |
||||
public void changed(ObservableValue<? extends String> observable, final String oldValue, String newValue) { |
||||
disableLink(webEngine); |
||||
// webView好像默认以手机版显示网页,浏览器里过滤掉这个跳转
|
||||
if (ComparatorUtils.equals(newValue, url) || ComparatorUtils.equals(newValue, CloudCenter.getInstance().acquireUrlByKind("bbs.mobile"))) { |
||||
return; |
||||
} |
||||
LoginWebBridge.getHelper().openUrlAtLocalWebBrowser(webEngine, newValue); |
||||
} |
||||
}); |
||||
|
||||
webEngine.setOnAlert(new EventHandler<WebEvent<String>>() { |
||||
@Override |
||||
public void handle(WebEvent<String> event) { |
||||
showAlert(event.getData()); |
||||
} |
||||
}); |
||||
|
||||
webEngine.getLoadWorker().stateProperty().addListener( |
||||
new ChangeListener<Worker.State>() { |
||||
public void changed(ObservableValue ov, Worker.State oldState, Worker.State newState) { |
||||
if (newState == Worker.State.SUCCEEDED) { |
||||
window = (JSObject) webEngine.executeScript("window"); |
||||
window.setMember("QQLoginHelper", LoginWebBridge.getHelper()); |
||||
} |
||||
} |
||||
} |
||||
); |
||||
} |
||||
|
||||
private void showAlert(final String message) { |
||||
SwingUtilities.invokeLater(new Runnable() { |
||||
@Override |
||||
public void run() { |
||||
FineJOptionPane.showMessageDialog(QQLoginWebPane.this, message); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
private void disableLink(final WebEngine eng) { |
||||
try { |
||||
// webView端不跳转 虽然webView可以指定本地浏览器打开某个链接,但是当本地浏览器跳转到指定链接的同时,webView也做了跳转,
|
||||
// 为了避免出现在一个600*400的资讯框里加载整个网页的情况,webView不跳转到新网页
|
||||
Platform.runLater(new Runnable() { |
||||
@Override |
||||
public void run() { |
||||
eng.executeScript("location.reload()"); |
||||
LoginWebBridge.getHelper().closeQQWindow(); |
||||
} |
||||
}); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
|
||||
private Boolean confirm(final Stage parent, String msg, final WebView webView) { |
||||
final BooleanProperty confirmationResult = new SimpleBooleanProperty(); |
||||
// initialize the confirmation dialog
|
||||
final Stage dialog = new Stage(StageStyle.UTILITY); |
||||
dialog.setX(Toolkit.getDefaultToolkit().getScreenSize().getWidth() / 2 - DEFAULT_CONFIRM_WIDTH / 2.0D + DEFAULT_OFFEST); |
||||
dialog.setY(Toolkit.getDefaultToolkit().getScreenSize().getHeight() / 2 + DEFAULT_OFFEST); |
||||
dialog.setHeight(DEFAULT_CONFIRM_HEIGHT); |
||||
dialog.setWidth(DEFAULT_CONFIRM_WIDTH); |
||||
dialog.setIconified(false); |
||||
dialog.initOwner(parent); |
||||
dialog.initModality(Modality.WINDOW_MODAL); |
||||
dialog.setScene( |
||||
new Scene( |
||||
HBoxBuilder.create().styleClass("modal-dialog").children( |
||||
LabelBuilder.create().text(msg).build(), |
||||
ButtonBuilder.create().text(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Switch_Account")).defaultButton(true).onAction(new EventHandler<ActionEvent>() { |
||||
@Override |
||||
public void handle(ActionEvent actionEvent) { |
||||
// take action and close the dialog.
|
||||
confirmationResult.set(true); |
||||
webView.getEngine().reload(); |
||||
dialog.close(); |
||||
} |
||||
}).build(), |
||||
ButtonBuilder.create().text(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Cancel")).cancelButton(true).onAction(new EventHandler<ActionEvent>() { |
||||
@Override |
||||
public void handle(ActionEvent actionEvent) { |
||||
// abort action and close the dialog.
|
||||
confirmationResult.set(false); |
||||
dialog.close(); |
||||
} |
||||
}).build() |
||||
).build() |
||||
, Color.TRANSPARENT |
||||
) |
||||
); |
||||
configDrag(dialog); |
||||
// style and show the dialog.
|
||||
dialog.getScene().getStylesheets().add(IOUtils.getResource("modal-dialog.css", getClass()).toExternalForm()); |
||||
dialog.setOnCloseRequest(new EventHandler<WindowEvent>() { |
||||
@Override |
||||
public void handle(WindowEvent event) { |
||||
event.consume(); |
||||
dialog.close(); |
||||
} |
||||
}); |
||||
dialog.showAndWait(); |
||||
return confirmationResult.get(); |
||||
} |
||||
|
||||
private void configDrag(final Stage dialog) { |
||||
// allow the dialog to be dragged around.
|
||||
final Node root = dialog.getScene().getRoot(); |
||||
final Delta dragDelta = new Delta(); |
||||
|
||||
root.setOnMousePressed(new EventHandler<MouseEvent>() { |
||||
@Override |
||||
public void handle(MouseEvent mouseEvent) { |
||||
// record a delta distance for the drag and drop operation.
|
||||
dragDelta.x = dialog.getX() - mouseEvent.getScreenX(); |
||||
dragDelta.y = dialog.getY() - mouseEvent.getScreenY(); |
||||
} |
||||
}); |
||||
root.setOnMouseDragged(new EventHandler<MouseEvent>() { |
||||
@Override |
||||
public void handle(MouseEvent mouseEvent) { |
||||
dialog.setX(mouseEvent.getScreenX() + dragDelta.x); |
||||
dialog.setY(mouseEvent.getScreenY() + dragDelta.y); |
||||
} |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.report.cell.TemplateCellElement; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
/** |
||||
* @author yaohwu |
||||
* created by yaohwu at 2020/4/26 15:50 |
||||
*/ |
||||
public interface CellExpandAttrPanelProvider extends Mutable { |
||||
|
||||
String MARK_STRING = "CellExpandAttrPanelProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* @return 创建单元格属性-扩展设置中的额外面板 |
||||
*/ |
||||
BasicBeanPane<TemplateCellElement> createPanel(); |
||||
|
||||
/** |
||||
* 是否应该展示 |
||||
* |
||||
* @return return {@code true} if extra panel is displayable |
||||
*/ |
||||
boolean isDisplayable(); |
||||
} |
@ -0,0 +1,14 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2020-06-12 |
||||
*/ |
||||
public interface ChartWidgetOptionProvider extends ParameterWidgetOptionProvider { |
||||
|
||||
String XML_TAG = "ChartWidgetOptionProvider"; |
||||
|
||||
//在图表区域的开头还是结尾插入
|
||||
boolean isBefore(); |
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
/** |
||||
* created by Harrison on 2020/05/14 |
||||
**/ |
||||
public interface ClipboardHandlerProvider<T> extends Mutable { |
||||
|
||||
String XML_TAG = "ClipboardHandlerProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 剪切 |
||||
* |
||||
* @param selection 选中 |
||||
* @return 处理后的内容 |
||||
*/ |
||||
T cut(T selection); |
||||
|
||||
/** |
||||
* 复制 |
||||
* |
||||
* @param selection 选中 |
||||
* @return 处理后的内容 |
||||
*/ |
||||
T copy(T selection); |
||||
|
||||
/** |
||||
* 粘贴 |
||||
* |
||||
* @param selection 选中 |
||||
* @return 处理后的内容 |
||||
*/ |
||||
T paste(T selection); |
||||
|
||||
/** |
||||
* 支持的类型 |
||||
* |
||||
* @param selection 内容 |
||||
* @return 是否 |
||||
*/ |
||||
boolean support(Object selection); |
||||
} |
@ -0,0 +1,57 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.gui.icombobox.UIComboBox; |
||||
import com.fr.design.gui.icontainer.UIScrollPane; |
||||
import com.fr.design.mainframe.DockingView; |
||||
import com.fr.stable.fun.mark.Immutable; |
||||
|
||||
import javax.swing.JPanel; |
||||
|
||||
/** |
||||
* 组件库面板处理器 |
||||
* |
||||
* created by Harrison on 2020/03/16 |
||||
**/ |
||||
public interface ComponentLibraryPaneProcessor extends Immutable { |
||||
|
||||
String XML_TAG = "ComponentLibraryPaneProcessor"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 创建展示面板 |
||||
* |
||||
* @param isEdit 是否可以编辑 |
||||
* @return 展示面板 |
||||
*/ |
||||
UIScrollPane createShowPanel(boolean isEdit); |
||||
|
||||
/** |
||||
* 创建菜单的上部面板 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
JPanel createMenuNorthPane(); |
||||
|
||||
/** |
||||
* 创建复选框 |
||||
* |
||||
* @return 复选框 |
||||
*/ |
||||
UIComboBox createMenuComBox(); |
||||
|
||||
void parentView(DockingView dockingView); |
||||
|
||||
/** |
||||
* 父面板 |
||||
* |
||||
* @param panel 面板 |
||||
*/ |
||||
void parentPane(JPanel panel); |
||||
|
||||
/** |
||||
* 创建完成 |
||||
*/ |
||||
void complete(); |
||||
|
||||
} |
@ -0,0 +1,23 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.stable.fun.mark.Mutable; |
||||
import com.fr.start.BaseDesigner; |
||||
|
||||
/** |
||||
* 设计器启动类替换接口 |
||||
* |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/5/7 |
||||
*/ |
||||
|
||||
public interface DesignerStartClassProcessor extends Mutable { |
||||
|
||||
String MARK_STRING = "DesignerStartClassProcessor"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
|
||||
Class<? extends BaseDesigner> transform(); |
||||
|
||||
} |
@ -0,0 +1,40 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.design.menu.ShortCut; |
||||
import com.fr.stable.fun.mark.Immutable; |
||||
|
||||
import javax.swing.JComponent; |
||||
import java.awt.Dimension; |
||||
import java.awt.image.BufferedImage; |
||||
|
||||
|
||||
/** |
||||
* Created by kerry on 2020-04-09 |
||||
* 临时接口,后续自适应内置后删除 |
||||
*/ |
||||
public interface FormAdaptiveConfigUIProcessor extends Immutable { |
||||
|
||||
String MARK_STRING = "FormAdaptiveConfigUIProcessor"; |
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 获取表单自适应配置菜单 |
||||
* @return 表单自适应配置菜单 |
||||
*/ |
||||
ShortCut getConfigShortCut(JTemplate jTemplate); |
||||
|
||||
/** |
||||
* 是否开启表单滑块缩放功能 |
||||
* @return 是否开启表单滑块缩放 |
||||
*/ |
||||
boolean openFormSliderZoom(); |
||||
|
||||
/** |
||||
* 获取新自适应下字体显示的dpi |
||||
* @return dpi |
||||
*/ |
||||
int fontResolution(); |
||||
|
||||
} |
||||
|
@ -0,0 +1,25 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.general.cardtag.mobile.MobileTemplateStyle; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/3/31 |
||||
*/ |
||||
public interface MobileTemplateStyleProvider extends Mutable { |
||||
|
||||
String XML_TAG = "MobileTemplateStyleProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
Class<? extends MobileTemplateStyle> classFroMobileTemplateStyle(); |
||||
|
||||
|
||||
Class<? extends BasicBeanPane<MobileTemplateStyle>> classFroMobileTemplateStyleAppearance(); |
||||
|
||||
String displayName(); |
||||
|
||||
} |
@ -0,0 +1,50 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.mainframe.PaneHolder; |
||||
import com.fr.design.mainframe.PropertyItemBean; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
import org.jetbrains.annotations.Nullable; |
||||
|
||||
/** |
||||
* created by Harrison on 2020/03/23 |
||||
**/ |
||||
public interface PropertyItemPaneProvider<T> extends Mutable { |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
String XML_TAG = "PropertyItemPaneProvider"; |
||||
|
||||
int FIRST = 100; |
||||
|
||||
int LAST = -100; |
||||
|
||||
/** |
||||
* 独一无二的标志 |
||||
* |
||||
* @return 标志 |
||||
*/ |
||||
String key(); |
||||
|
||||
/** |
||||
* 配置属性 |
||||
* |
||||
* @return 熟悉 |
||||
*/ |
||||
PropertyItemBean getItem(); |
||||
|
||||
/** |
||||
* 面板持有者 |
||||
* |
||||
* @param clazz 类型 |
||||
* @return 持有者 |
||||
*/ |
||||
@Nullable |
||||
PaneHolder<T> getPaneHolder(Class<?> clazz); |
||||
|
||||
/** |
||||
* 想要替代的类型 |
||||
* |
||||
* @return 替代类型 |
||||
*/ |
||||
String replaceKey(); |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.stable.fun.mark.Mutable; |
||||
import com.fr.stable.unit.UNIT; |
||||
|
||||
/** |
||||
* Created by kerry on 2020-04-09 |
||||
*/ |
||||
public interface ReportLengthUNITProvider extends Mutable { |
||||
String MARK_STRING = "ReportLengthUNITProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 标尺单位显示字符 |
||||
* @return 标尺单位字符 |
||||
*/ |
||||
String unitText(); |
||||
|
||||
/** |
||||
* 标尺单位类型(之前是将int类型的值直接保存在数据库里面的) |
||||
* @return 返回标尺单位类型 |
||||
*/ |
||||
int unitType(); |
||||
|
||||
/** |
||||
* UNIT转标尺单位值 |
||||
* @param value UNIT |
||||
* @return 标尺单位值 |
||||
*/ |
||||
float unit2Value4Scale(UNIT value); |
||||
|
||||
/** |
||||
* 标尺单位值转UNIT |
||||
* @param value 标尺单位值 |
||||
* @return UNIT |
||||
*/ |
||||
UNIT float2UNIT(float value); |
||||
} |
@ -0,0 +1,43 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.fun.CellExpandAttrPanelProvider; |
||||
import com.fr.report.cell.TemplateCellElement; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author yaohwu |
||||
* created by yaohwu at 2020/4/26 16:08 |
||||
*/ |
||||
@API(level = CellExpandAttrPanelProvider.CURRENT_LEVEL) |
||||
public class AbstractCellExpandAttrPanelProvider implements CellExpandAttrPanelProvider { |
||||
|
||||
/** |
||||
* 当前接口的API等级,用于判断是否需要升级插件 |
||||
* |
||||
* @return API等级 |
||||
*/ |
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CellExpandAttrPanelProvider.CURRENT_LEVEL; |
||||
} |
||||
|
||||
/** |
||||
* 获取当前provider的标记(可以使用类路径保证唯一)以避免provider的重复加载 |
||||
* |
||||
* @return 当前provider的标记 |
||||
*/ |
||||
@Override |
||||
public String mark4Provider() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BasicBeanPane<TemplateCellElement> createPanel() { |
||||
return null; |
||||
} |
||||
|
||||
public boolean isDisplayable() { |
||||
return true; |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.ChartWidgetOptionProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2020-06-12 |
||||
*/ |
||||
@API(level = ChartWidgetOptionProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractChartWidgetOptionProvider extends AbstractProvider implements ChartWidgetOptionProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isBefore() { |
||||
return false; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.ClipboardHandlerProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* created by Harrison on 2020/05/14 |
||||
**/ |
||||
@API(level = ClipboardHandlerProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractClipboardHandlerProvider<T> extends AbstractProvider implements ClipboardHandlerProvider<T> { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return ClipboardHandlerProvider.CURRENT_LEVEL; |
||||
} |
||||
} |
@ -0,0 +1,23 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.DesignerStartClassProcessor; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/5/7 |
||||
*/ |
||||
@API(level = DesignerStartClassProcessor.CURRENT_LEVEL) |
||||
public abstract class AbstractDesignerStartClassProcessorProcessor implements DesignerStartClassProcessor { |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
} |
@ -0,0 +1,23 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
|
||||
import com.fr.design.fun.FormAdaptiveConfigUIProcessor; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* Created by kerry on 2020-04-09 |
||||
*/ |
||||
@API(level = FormAdaptiveConfigUIProcessor.CURRENT_LEVEL) |
||||
public abstract class AbstractFormAdaptiveConfigUIProcessor implements FormAdaptiveConfigUIProcessor { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,25 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.MobileTemplateStyleProvider; |
||||
import com.fr.design.fun.MobileWidgetStyleProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/3/31 |
||||
*/ |
||||
@API(level = MobileWidgetStyleProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractMobileTemplateStyleProvider extends AbstractProvider implements MobileTemplateStyleProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.PropertyItemPaneProvider; |
||||
import com.fr.design.mainframe.PaneHolder; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* created by Harrison on 2020/03/23 |
||||
**/ |
||||
@API(level = PropertyItemPaneProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractPropertyItemPaneProvider<T> extends AbstractProvider implements PropertyItemPaneProvider<T> { |
||||
|
||||
@Override |
||||
public PaneHolder<T> getPaneHolder(Class<?> clazz) { |
||||
|
||||
if (sign().equals(clazz)) { |
||||
return getPathHolder0(); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
protected abstract PaneHolder<T> getPathHolder0(); |
||||
|
||||
protected abstract Class<T> sign(); |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return PropertyItemPaneProvider.CURRENT_LEVEL; |
||||
} |
||||
} |
@ -0,0 +1,42 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
|
||||
import com.fr.design.fun.ReportLengthUNITProvider; |
||||
import com.fr.stable.StringUtils; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
import com.fr.stable.unit.UNIT; |
||||
|
||||
/** |
||||
* Created by kerry on 2020-04-09 |
||||
*/ |
||||
@API(level = ReportLengthUNITProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractReportLengthUNITProvider extends AbstractProvider implements ReportLengthUNITProvider { |
||||
|
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String unitText() { |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
@Override |
||||
public int unitType() { |
||||
return 0; |
||||
} |
||||
|
||||
@Override |
||||
public float unit2Value4Scale(UNIT value) { |
||||
return 0; |
||||
} |
||||
|
||||
@Override |
||||
public UNIT float2UNIT(float value) { |
||||
return UNIT.ZERO; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,103 @@
|
||||
package com.fr.design.gui.ifilechooser; |
||||
|
||||
import javax.swing.filechooser.FileFilter; |
||||
import java.awt.*; |
||||
import java.io.File; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/3/31 |
||||
*/ |
||||
public abstract class AbstractFileChooser { |
||||
|
||||
/** |
||||
* 返回当前目录 |
||||
* |
||||
*/ |
||||
public abstract File getCurrentDirectory(); |
||||
|
||||
/** |
||||
* 返回当前的文件选择过滤器 |
||||
* |
||||
*/ |
||||
public abstract FileFilter getFileFilter(); |
||||
|
||||
/** |
||||
* 返回选择的文件 |
||||
* |
||||
*/ |
||||
public abstract File getSelectedFile(); |
||||
|
||||
/** |
||||
* 多文件选择模式下 返回选择的多个文件 |
||||
* |
||||
*/ |
||||
public abstract File[] getSelectedFiles(); |
||||
|
||||
/** |
||||
* 是否可以选择多个文件 |
||||
* |
||||
*/ |
||||
public abstract boolean isMultiSelectionEnabled(); |
||||
|
||||
/** |
||||
* 设置当前选择的目录 |
||||
* |
||||
*/ |
||||
public abstract void setCurrentDirectory(File dir); |
||||
|
||||
/** |
||||
* 设置左上角标题 |
||||
* |
||||
*/ |
||||
public abstract void setDialogTitle(String title); |
||||
|
||||
/** |
||||
* 设置当前的文件过滤器 |
||||
* |
||||
*/ |
||||
public abstract void setFileFilter(final FileFilter filter); |
||||
|
||||
/** |
||||
* 设置文件选择器模式 |
||||
* |
||||
* JFileChooser.FILES_ONLY |
||||
* JFileChooser.DIRECTORIES_ONLY |
||||
* JFileChooser.FILES_AND_DIRECTORIES |
||||
*/ |
||||
public abstract void setFileSelectionMode(int selectionMode); |
||||
|
||||
/** |
||||
* 设置是否允许选择多个文件 |
||||
* |
||||
*/ |
||||
public abstract void setMultiSelectionEnabled(boolean multiple); |
||||
|
||||
/** |
||||
* 设置选择的文件 用于showSaveDialog |
||||
* |
||||
*/ |
||||
public abstract void setSelectedFile(File file); |
||||
|
||||
/** |
||||
* 弹出文件选择器 打开文件 |
||||
* |
||||
*/ |
||||
public abstract int showOpenDialog(Component parent); |
||||
|
||||
/** |
||||
* 弹出文件选择器 保存文件 |
||||
* |
||||
*/ |
||||
public abstract int showSaveDialog(Component parent); |
||||
|
||||
|
||||
/** |
||||
* https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4031440
|
||||
* |
||||
* 设置文件名后缀 起到文件过滤的作用 形如 "*.jpg;*.jpeg" |
||||
* |
||||
*/ |
||||
public abstract void setExtensionFilter(String file); |
||||
} |
@ -0,0 +1,154 @@
|
||||
package com.fr.design.gui.ifilechooser; |
||||
|
||||
import com.fr.design.gui.ifilechooser.AbstractFileChooser; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.stable.os.OperatingSystem; |
||||
|
||||
import javax.swing.*; |
||||
import javax.swing.filechooser.FileFilter; |
||||
import java.awt.*; |
||||
import java.io.File; |
||||
import java.io.FilenameFilter; |
||||
|
||||
|
||||
/** |
||||
* 系统原生风格的文件选择器 |
||||
* |
||||
* jdk问题: |
||||
* https://bugs.openjdk.java.net/browse/JDK-4811090 不支持文件扩展选择
|
||||
* https://stackoverflow.com/questions/40713398/filter-not-working-in-filedialog windows下 setFilenameFilter不work
|
||||
* |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/3/31 |
||||
*/ |
||||
public class UINativeFileChooser extends AbstractFileChooser { |
||||
|
||||
private final FileDialog fileDialog; |
||||
private FileFilter fileFilter; |
||||
private int selectionMode; |
||||
|
||||
public UINativeFileChooser(File file) { |
||||
fileDialog = new FileDialog(DesignerContext.getDesignerFrame()); |
||||
if (file != null) { |
||||
fileDialog.setDirectory(file.getAbsolutePath()); |
||||
fileDialog.setFile(file.toString()); |
||||
} |
||||
} |
||||
|
||||
public UINativeFileChooser() { |
||||
this(null); |
||||
} |
||||
|
||||
@Override |
||||
public File getCurrentDirectory() { |
||||
return new File(fileDialog.getDirectory()); |
||||
} |
||||
|
||||
@Override |
||||
public FileFilter getFileFilter() { |
||||
return fileFilter; |
||||
} |
||||
|
||||
@Override |
||||
public File getSelectedFile() { |
||||
return new File(fileDialog.getDirectory() + fileDialog.getFile()); |
||||
} |
||||
|
||||
@Override |
||||
public File[] getSelectedFiles() { |
||||
return fileDialog.getFiles(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isMultiSelectionEnabled() { |
||||
return fileDialog.isMultipleMode(); |
||||
} |
||||
|
||||
@Override |
||||
public void setCurrentDirectory(File f) { |
||||
fileDialog.setDirectory(f.toString()); |
||||
} |
||||
|
||||
@Override |
||||
public void setDialogTitle(String title) { |
||||
fileDialog.setTitle(title); |
||||
} |
||||
|
||||
@Override |
||||
public void setFileFilter(final FileFilter cff) { |
||||
FilenameFilter filter = new FilenameFilter() { |
||||
@Override |
||||
public boolean accept(File Directory, String fileName) { |
||||
return cff.accept(new File(Directory.getAbsolutePath() + fileName)); |
||||
} |
||||
}; |
||||
fileDialog.setFilenameFilter(filter); |
||||
fileFilter = cff; |
||||
} |
||||
|
||||
@Override |
||||
public void setFileSelectionMode(int selectionMode) { |
||||
this.selectionMode = selectionMode; |
||||
} |
||||
|
||||
@Override |
||||
public void setMultiSelectionEnabled(boolean multiple) { |
||||
fileDialog.setMultipleMode(multiple); |
||||
} |
||||
|
||||
@Override |
||||
public void setSelectedFile(File file) { |
||||
fileDialog.setDirectory(file.getAbsolutePath()); |
||||
fileDialog.setFile(file.getName()); |
||||
} |
||||
|
||||
@Override |
||||
public int showOpenDialog(Component parent) { |
||||
boolean appleProperty = OperatingSystem.isMacos() && selectionMode == JFileChooser.DIRECTORIES_ONLY; |
||||
if (appleProperty) { |
||||
System.setProperty("apple.awt.fileDialogForDirectories", "true"); |
||||
} |
||||
try { |
||||
fileDialog.setLocale(JComponent.getDefaultLocale()); |
||||
fileDialog.setMode(FileDialog.LOAD); |
||||
fileDialog.setVisible(true); |
||||
return fileDialog.getFile() == null ? JFileChooser.CANCEL_OPTION : JFileChooser.APPROVE_OPTION; |
||||
} finally { |
||||
if (appleProperty) { |
||||
System.setProperty("apple.awt.fileDialogForDirectories", "false"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public int showSaveDialog(Component parent) { |
||||
fileDialog.setLocale(JComponent.getDefaultLocale()); |
||||
fileDialog.setMode(FileDialog.SAVE); |
||||
fileDialog.setVisible(true); |
||||
return fileDialog.getFile() == null ? JFileChooser.CANCEL_OPTION : JFileChooser.APPROVE_OPTION; |
||||
} |
||||
|
||||
@Override |
||||
public void setExtensionFilter(String file) { |
||||
fileDialog.setFile(file); |
||||
} |
||||
|
||||
/** |
||||
* 确认本地文件选择器是否支持选择模式 |
||||
* @param selectionMode 选择模式 |
||||
* @return 是否支持选择模式 |
||||
*/ |
||||
public static boolean supportsSelectionMode(int selectionMode) { |
||||
switch (selectionMode) { |
||||
case JFileChooser.FILES_AND_DIRECTORIES: |
||||
return false; |
||||
case JFileChooser.DIRECTORIES_ONLY: |
||||
return OperatingSystem.isMacos(); |
||||
case JFileChooser.FILES_ONLY: |
||||
default: |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,81 @@
|
||||
package com.fr.design.gui.imenu; |
||||
|
||||
import com.fr.design.constants.UIConstants; |
||||
import com.fr.design.utils.gui.GUIPaintUtils; |
||||
import com.fr.stable.Constants; |
||||
import sun.swing.SwingUtilities2; |
||||
|
||||
import javax.swing.ButtonModel; |
||||
import javax.swing.JMenu; |
||||
import javax.swing.JMenuItem; |
||||
import javax.swing.UIManager; |
||||
import javax.swing.plaf.basic.BasicMenuItemUI; |
||||
import java.awt.Color; |
||||
import java.awt.FontMetrics; |
||||
import java.awt.Graphics; |
||||
import java.awt.Graphics2D; |
||||
import java.awt.Rectangle; |
||||
|
||||
/** |
||||
* created by Harrison on 2020/03/22 |
||||
**/ |
||||
public class UIMenuItemUI extends BasicMenuItemUI { |
||||
|
||||
@Override |
||||
protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { |
||||
if (menuItem.getIcon() == null) { |
||||
super.paintBackground(g, menuItem, bgColor); |
||||
return; |
||||
} |
||||
ButtonModel model = menuItem.getModel(); |
||||
Color oldColor = g.getColor(); |
||||
int menuWidth = menuItem.getWidth(); |
||||
int menuHeight = menuItem.getHeight(); |
||||
|
||||
g.setColor(UIConstants.NORMAL_BACKGROUND); |
||||
g.fillRect(0, 0, menuWidth, menuHeight); |
||||
if (menuItem.isOpaque()) { |
||||
if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { |
||||
GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); |
||||
} else { |
||||
GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); |
||||
} |
||||
g.setColor(oldColor); |
||||
} else if (model.isArmed() || (menuItem instanceof JMenu && |
||||
model.isSelected())) { |
||||
GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); |
||||
g.setColor(oldColor); |
||||
} |
||||
} |
||||
|
||||
protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { |
||||
ButtonModel model = menuItem.getModel(); |
||||
FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g); |
||||
int mnemIndex = menuItem.getDisplayedMnemonicIndex(); |
||||
|
||||
if (!model.isEnabled()) { |
||||
// *** paint the text disabled
|
||||
if (UIManager.get("MenuItem.disabledForeground") instanceof Color) { |
||||
g.setColor(UIManager.getColor("MenuItem.disabledForeground")); |
||||
SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, |
||||
-1, textRect.x, textRect.y + fm.getAscent()); |
||||
} else { |
||||
g.setColor(menuItem.getBackground().brighter()); |
||||
SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, |
||||
-1, textRect.x, textRect.y + fm.getAscent()); |
||||
g.setColor(menuItem.getBackground().darker()); |
||||
SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, |
||||
-1, textRect.x - 1, textRect.y + |
||||
fm.getAscent() - 1); |
||||
} |
||||
} else { |
||||
// *** paint the text normally
|
||||
if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { |
||||
g.setColor(Color.WHITE); // Uses protected field.
|
||||
} |
||||
SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, |
||||
-1, textRect.x, textRect.y + fm.getAscent()); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import javax.swing.JPanel; |
||||
|
||||
/** |
||||
* created by Harrison on 2020/03/23 |
||||
**/ |
||||
public interface PaneHolder<T> { |
||||
|
||||
/** |
||||
* 得到 Pane |
||||
* |
||||
* @param arg 参数 |
||||
* @return 面板 |
||||
*/ |
||||
JPanel getInstance(T arg); |
||||
} |
@ -0,0 +1,78 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import java.awt.event.ActionListener; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* created by Harrison on 2020/03/23 |
||||
**/ |
||||
public class PropertyItemBean { |
||||
|
||||
private String name; |
||||
private String title; |
||||
private String btnIconName; |
||||
private String btnIconBaseDir; |
||||
private EastRegionContainerPane.PropertyMode[] visibleModes; |
||||
private EastRegionContainerPane.PropertyMode[] enableModes; |
||||
private List<ActionListener> buttonListeners; |
||||
|
||||
public PropertyItemBean() { |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public String getTitle() { |
||||
return title; |
||||
} |
||||
|
||||
public void setTitle(String title) { |
||||
this.title = title; |
||||
} |
||||
|
||||
public String getBtnIconName() { |
||||
return btnIconName; |
||||
} |
||||
|
||||
public void setBtnIconName(String btnIconName) { |
||||
this.btnIconName = btnIconName; |
||||
} |
||||
|
||||
public String getBtnIconBaseDir() { |
||||
|
||||
return btnIconBaseDir; |
||||
} |
||||
|
||||
public void setBtnIconBaseDir(String btnIconBaseDir) { |
||||
this.btnIconBaseDir = btnIconBaseDir; |
||||
} |
||||
|
||||
public EastRegionContainerPane.PropertyMode[] getVisibleModes() { |
||||
return visibleModes; |
||||
} |
||||
|
||||
public void setVisibleModes(EastRegionContainerPane.PropertyMode[] visibleModes) { |
||||
this.visibleModes = visibleModes; |
||||
} |
||||
|
||||
public EastRegionContainerPane.PropertyMode[] getEnableModes() { |
||||
return enableModes; |
||||
} |
||||
|
||||
public void setEnableModes(EastRegionContainerPane.PropertyMode[] enableModes) { |
||||
this.enableModes = enableModes; |
||||
} |
||||
|
||||
public List<ActionListener> getButtonListeners() { |
||||
return buttonListeners; |
||||
} |
||||
|
||||
public void setButtonListeners(List<ActionListener> buttonListeners) { |
||||
this.buttonListeners = buttonListeners; |
||||
} |
||||
} |
@ -0,0 +1,122 @@
|
||||
package com.fr.design.mainframe.mobile.ui; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.design.constants.LayoutConstants; |
||||
import com.fr.design.gui.ibutton.UIColorButton; |
||||
import com.fr.design.gui.ibutton.UIToggleButton; |
||||
import com.fr.design.gui.icombobox.UIComboBox; |
||||
import com.fr.design.gui.icombobox.UIComboBoxRenderer; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.utils.gui.GUICoreUtils; |
||||
import com.fr.general.FRFont; |
||||
import com.fr.stable.Constants; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
import javax.swing.DefaultComboBoxModel; |
||||
import javax.swing.JLabel; |
||||
import javax.swing.JList; |
||||
import javax.swing.JPanel; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Component; |
||||
import java.awt.Dimension; |
||||
import java.awt.FlowLayout; |
||||
import java.awt.Font; |
||||
import java.util.Vector; |
||||
|
||||
public class MobileStyleFontConfigPane extends JPanel { |
||||
public static final int FONT_NONE = 0; |
||||
private static final int MAX_FONT_SIZE = 18; |
||||
private static final int MIN_FONT_SIZE = 12; |
||||
private static final Dimension BUTTON_SIZE = new Dimension(20, 18); |
||||
|
||||
public static Vector<Integer> getFontSizes() { |
||||
Vector<Integer> FONT_SIZES = new Vector<Integer>(); |
||||
for (int i = MIN_FONT_SIZE; i <= MAX_FONT_SIZE; i++) { |
||||
FONT_SIZES.add(i); |
||||
} |
||||
return FONT_SIZES; |
||||
} |
||||
|
||||
private UIComboBox fontSizeComboBox; |
||||
private UIColorButton color; |
||||
private UIToggleButton italic; |
||||
private UIToggleButton bold; |
||||
|
||||
public MobileStyleFontConfigPane() { |
||||
this.initComponent(); |
||||
} |
||||
|
||||
private void initComponent() { |
||||
|
||||
fontSizeComboBox = new UIComboBox(); |
||||
fontSizeComboBox.setModel(new DefaultComboBoxModel(getFontSizes())); |
||||
fontSizeComboBox.setSelectedItem(16); |
||||
fontSizeComboBox.setPreferredSize(new Dimension(60, 20)); |
||||
fontSizeComboBox.setRenderer(new LineCellRenderer()); |
||||
color = new UIColorButton(); |
||||
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); |
||||
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); |
||||
|
||||
this.setButtonsTips(); |
||||
this.setButtonsSize(BUTTON_SIZE); |
||||
|
||||
Component[] components_font = new Component[]{ |
||||
fontSizeComboBox, color, italic, bold |
||||
}; |
||||
|
||||
JPanel buttonPane = new JPanel(new BorderLayout()); |
||||
buttonPane.add(GUICoreUtils.createFlowPane(components_font, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE)); |
||||
|
||||
this.setLayout(new BorderLayout(0,0)); |
||||
this.add(buttonPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
private void setButtonsTips() { |
||||
color.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Foreground")); |
||||
italic.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Italic")); |
||||
bold.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bold")); |
||||
} |
||||
|
||||
private void setButtonsSize(Dimension size) { |
||||
color.setPreferredSize(size); |
||||
italic.setPreferredSize(size); |
||||
bold.setPreferredSize(size); |
||||
} |
||||
|
||||
|
||||
public void populateBean(FRFont frFont) { |
||||
fontSizeComboBox.setSelectedItem(frFont.getSize()); |
||||
color.setColor(frFont.getForeground()); |
||||
bold.setSelected(frFont.isBold()); |
||||
italic.setSelected(frFont.isItalic()); |
||||
} |
||||
|
||||
public FRFont updateBean() { |
||||
int style = Font.PLAIN; |
||||
style += this.bold.isSelected() ? Font.BOLD : Font.PLAIN; |
||||
style += this.italic.isSelected() ? Font.ITALIC : Font.PLAIN; |
||||
return FRFont.getInstance( |
||||
FRFont.DEFAULT_FONTNAME, |
||||
style, |
||||
Float.parseFloat(fontSizeComboBox.getSelectedItem().toString()), |
||||
color.getColor(), |
||||
Constants.LINE_NONE |
||||
); |
||||
} |
||||
|
||||
private class LineCellRenderer extends UIComboBoxRenderer { |
||||
public LineCellRenderer() { |
||||
super(); |
||||
} |
||||
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
||||
JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
||||
int currentValue = ((Integer) value).intValue(); |
||||
if (currentValue == MobileStyleFontConfigPane.FONT_NONE) { |
||||
renderer.setText(StringUtils.BLANK + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None")); |
||||
} |
||||
return renderer; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,251 @@
|
||||
package com.fr.design.mainframe.mobile.ui; |
||||
|
||||
import com.fr.design.constants.LayoutConstants; |
||||
import com.fr.design.designer.IntervalConstants; |
||||
import com.fr.design.gui.ibutton.UIColorButton; |
||||
import com.fr.design.gui.icombobox.LineComboBox; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.gui.ispinner.UnsignedIntUISpinner; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.layout.TableLayoutHelper; |
||||
import com.fr.design.mainframe.widget.MobileTabFontConfPane; |
||||
import com.fr.design.mainframe.widget.UITitleSplitLine; |
||||
import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane; |
||||
import com.fr.design.style.color.ColorSelectBox; |
||||
import com.fr.design.style.color.NewColorSelectBox; |
||||
import com.fr.form.ui.container.cardlayout.WCardTagLayout; |
||||
import com.fr.general.cardtag.mobile.MobileTemplateStyle; |
||||
import com.fr.general.cardtag.mobile.TabFontConfig; |
||||
import com.fr.general.cardtag.mobile.UniteStyle; |
||||
import com.fr.stable.CoreConstants; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane { |
||||
private static final int SPLIT_LINE_WIDTH = 520; |
||||
private static final int SPLIT_LINE_HEIGHT = 20; |
||||
|
||||
private static final int TOGGLE_BUTTON_WIDTH = 20; |
||||
private static final int LABEL_WIDTH = 75; |
||||
private static final int LINE_COMPONENT_WIDTH = 157; |
||||
private static final int LINE_COMPONENT_HEIGHT = 20; |
||||
|
||||
private UnsignedIntUISpinner paddingLeftSpinner; |
||||
private UnsignedIntUISpinner paddingRightSpinner; |
||||
private UnsignedIntUISpinner paddingTopSpinner; |
||||
private UnsignedIntUISpinner paddingBottomSpinner; |
||||
|
||||
private NewColorSelectBox initialBackgroundColorBox; |
||||
private NewColorSelectBox selectedBackgroundColorBox; |
||||
|
||||
private LineComboBox borderWidthComboBox; |
||||
private ColorSelectBox borderColorBox; |
||||
private UnsignedIntUISpinner borderRadiusSpinner; |
||||
|
||||
private MobileTabFontConfPane tabFontConfPane; |
||||
private UIColorButton selectedFontColorButton; |
||||
|
||||
public UniteStyleDefinePane(WCardTagLayout tagLayout) { |
||||
super(tagLayout); |
||||
} |
||||
|
||||
@Override |
||||
protected void createBuiltinConfPane(JPanel centerPane) { |
||||
// ignore builtin conf pane
|
||||
} |
||||
|
||||
@Override |
||||
protected void createExtraConfPane(JPanel centerPane) { |
||||
UITitleSplitLine paddingSplit = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Button_Padding"), SPLIT_LINE_WIDTH); |
||||
paddingSplit.setPreferredSize(new Dimension(SPLIT_LINE_WIDTH, SPLIT_LINE_HEIGHT)); |
||||
centerPane.add(paddingSplit); |
||||
centerPane.add(this.createPaddingConfPane()); |
||||
|
||||
UITitleSplitLine backgroundSplit = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Button_Background"), SPLIT_LINE_WIDTH); |
||||
backgroundSplit.setPreferredSize(new Dimension(SPLIT_LINE_WIDTH, SPLIT_LINE_HEIGHT)); |
||||
centerPane.add(backgroundSplit); |
||||
centerPane.add(this.createBackgroundColorConfPanel()); |
||||
|
||||
UITitleSplitLine borderSplit = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Border"), SPLIT_LINE_WIDTH); |
||||
borderSplit.setPreferredSize(new Dimension(SPLIT_LINE_WIDTH, SPLIT_LINE_HEIGHT)); |
||||
centerPane.add(borderSplit); |
||||
centerPane.add(this.createBorderConfPanel()); |
||||
|
||||
UITitleSplitLine fontSplit = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Char"), SPLIT_LINE_WIDTH); |
||||
fontSplit.setPreferredSize(new Dimension(SPLIT_LINE_WIDTH, SPLIT_LINE_HEIGHT)); |
||||
centerPane.add(fontSplit); |
||||
centerPane.add(this.createFontConfPanel()); |
||||
} |
||||
|
||||
private JPanel createPaddingConfPane() { |
||||
this.paddingTopSpinner = new UnsignedIntUISpinner(0, 30, 1, UniteStyle.DEFAULT_PADDING_TOP); |
||||
this.paddingTopSpinner.setPreferredSize(new Dimension(62, LINE_COMPONENT_HEIGHT)); |
||||
this.paddingBottomSpinner = new UnsignedIntUISpinner(0, 30, 1, UniteStyle.DEFAULT_PADDING_BOTTOM); |
||||
this.paddingBottomSpinner.setPreferredSize(new Dimension(62, LINE_COMPONENT_HEIGHT)); |
||||
|
||||
UILabel paddingTopLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Base_Top") + ":", SwingConstants.RIGHT); |
||||
paddingTopLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
UILabel paddingBottomLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Base_Bottom") + ":", SwingConstants.RIGHT); |
||||
paddingBottomLabel.setPreferredSize(new Dimension(LABEL_WIDTH / 2, LINE_COMPONENT_HEIGHT)); |
||||
|
||||
this.paddingLeftSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, UniteStyle.DEFAULT_PADDING_LEFT); |
||||
this.paddingLeftSpinner.setPreferredSize(new Dimension(62, LINE_COMPONENT_HEIGHT)); |
||||
this.paddingRightSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, UniteStyle.DEFAULT_PADDING_RIGHT); |
||||
this.paddingRightSpinner.setPreferredSize(new Dimension(62, LINE_COMPONENT_HEIGHT)); |
||||
|
||||
UILabel paddingLeftLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":", SwingConstants.RIGHT); |
||||
paddingLeftLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
UILabel paddingRightLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Right") + ":", SwingConstants.RIGHT); |
||||
paddingLeftLabel.setPreferredSize(new Dimension(LABEL_WIDTH / 2, LINE_COMPONENT_HEIGHT)); |
||||
|
||||
JPanel paddingPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
||||
new Component[]{ paddingTopLabel, paddingTopSpinner, paddingBottomLabel, paddingBottomSpinner}, |
||||
new Component[]{ paddingLeftLabel, paddingLeftSpinner, paddingRightLabel,paddingRightSpinner} |
||||
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); |
||||
paddingPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 20)); |
||||
|
||||
return paddingPanel; |
||||
} |
||||
|
||||
private JPanel createBackgroundColorConfPanel() { |
||||
this.initialBackgroundColorBox = new NewColorSelectBox(LINE_COMPONENT_WIDTH); |
||||
this.initialBackgroundColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
this.selectedBackgroundColorBox = new NewColorSelectBox(LINE_COMPONENT_WIDTH); |
||||
this.selectedBackgroundColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
|
||||
UILabel initialBackgroundColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Init_Fill") + ":", SwingConstants.RIGHT); |
||||
initialBackgroundColorLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
UILabel selectedBackgroundColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Select_Fill") + ":", SwingConstants.RIGHT); |
||||
selectedBackgroundColorLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
|
||||
JPanel backgroundColorPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
||||
new Component[]{ initialBackgroundColorLabel, initialBackgroundColorBox }, |
||||
new Component[]{ selectedBackgroundColorLabel, selectedBackgroundColorBox } |
||||
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); |
||||
backgroundColorPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 20)); |
||||
|
||||
return backgroundColorPanel; |
||||
} |
||||
|
||||
private JPanel createBorderConfPanel() { |
||||
this.borderWidthComboBox = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY); |
||||
this.borderWidthComboBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
this.borderColorBox = new ColorSelectBox(LINE_COMPONENT_WIDTH); |
||||
this.borderColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
this.borderRadiusSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, UniteStyle.DEFAULT_BORDER_RADIUS); |
||||
this.borderRadiusSpinner.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
|
||||
UILabel borderSizeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_FRFont_Line_Style") + ":", SwingConstants.RIGHT); |
||||
borderSizeLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
UILabel borderColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Colors") + ":", SwingConstants.RIGHT); |
||||
borderColorLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
UILabel borderRadiusLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius") + ":", SwingConstants.RIGHT); |
||||
borderRadiusLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
|
||||
JPanel borderPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
||||
new Component[]{ borderSizeLabel, borderWidthComboBox}, |
||||
new Component[]{ borderColorLabel, borderColorBox }, |
||||
new Component[]{ borderRadiusLabel, borderRadiusSpinner } |
||||
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); |
||||
borderPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 20)); |
||||
|
||||
return borderPanel; |
||||
} |
||||
|
||||
private JPanel createFontConfPanel() { |
||||
this.tabFontConfPane = new MobileTabFontConfPane(); |
||||
this.selectedFontColorButton = new UIColorButton(); |
||||
this.selectedFontColorButton.setPreferredSize(new Dimension(TOGGLE_BUTTON_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
JPanel selectedFontColorPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
||||
selectedFontColorPanel.add(this.selectedFontColorButton); |
||||
|
||||
UILabel initialFontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Init_Char") + ":", SwingConstants.RIGHT); |
||||
initialFontLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
UILabel selectedFontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Select_Char") + ":", SwingConstants.RIGHT); |
||||
selectedFontLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); |
||||
|
||||
JPanel fontPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
||||
new Component[]{ initialFontLabel, tabFontConfPane }, |
||||
new Component[]{ selectedFontLabel, selectedFontColorPanel } |
||||
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); |
||||
fontPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 20)); |
||||
|
||||
return fontPanel; |
||||
} |
||||
|
||||
@Override |
||||
protected void initDefaultConfig() { |
||||
this.paddingTopSpinner.setValue(UniteStyle.DEFAULT_PADDING_TOP); |
||||
this.paddingBottomSpinner.setValue(UniteStyle.DEFAULT_PADDING_BOTTOM); |
||||
this.paddingLeftSpinner.setValue(UniteStyle.DEFAULT_PADDING_LEFT); |
||||
this.paddingRightSpinner.setValue(UniteStyle.DEFAULT_PADDING_RIGHT); |
||||
|
||||
this.initialBackgroundColorBox.setSelectObject(UniteStyle.DEFAULT_INITIAL_BACKGROUND_COLOR); |
||||
this.selectedBackgroundColorBox.setSelectObject(UniteStyle.DEFAULT_SELECTED_BACKGROUND_COLOR); |
||||
|
||||
this.borderWidthComboBox.setSelectedLineStyle(UniteStyle.DEFAULT_BORDER_LINE.getLineStyle()); |
||||
this.borderColorBox.setSelectObject(UniteStyle.DEFAULT_BORDER_LINE.getColor()); |
||||
this.borderRadiusSpinner.setValue(UniteStyle.DEFAULT_BORDER_RADIUS); |
||||
|
||||
this.tabFontConfPane.populate(UniteStyle.DEFAULT_TAB_FONT.getFont()); |
||||
this.selectedFontColorButton.setColor(UniteStyle.DEFAULT_TAB_FONT.getSelectColor()); |
||||
} |
||||
|
||||
@Override |
||||
protected MobileTemplatePreviewPane createPreviewPane() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
protected MobileTemplateStyle getDefaultTemplateStyle() { |
||||
return new UniteStyle(); |
||||
} |
||||
|
||||
@Override |
||||
public void populateSubStyle(MobileTemplateStyle ob) { |
||||
UniteStyle style = (UniteStyle) ob; |
||||
this.paddingTopSpinner.setValue(style.getPaddingTop()); |
||||
this.paddingBottomSpinner.setValue(style.getPaddingBottom()); |
||||
this.paddingLeftSpinner.setValue(style.getPaddingLeft()); |
||||
this.paddingRightSpinner.setValue(style.getPaddingRight()); |
||||
|
||||
this.initialBackgroundColorBox.setSelectObject(style.getInitialColor()); |
||||
this.selectedBackgroundColorBox.setSelectObject(style.getSelectColor()); |
||||
|
||||
this.borderWidthComboBox.setSelectedLineStyle(style.getBorderLineStyle()); |
||||
this.borderColorBox.setSelectObject(style.getBorderColor()); |
||||
this.borderRadiusSpinner.setValue(style.getBorderRadius()); |
||||
|
||||
this.tabFontConfPane.populate(style.getTabFontConfig().getFont()); |
||||
this.selectedFontColorButton.setColor(style.getTabFontConfig().getSelectColor()); |
||||
} |
||||
|
||||
@Override |
||||
public MobileTemplateStyle updateSubStyle() { |
||||
UniteStyle style = new UniteStyle(); |
||||
style.setPaddingTop((int) this.paddingTopSpinner.getValue()); |
||||
style.setPaddingBottom((int) this.paddingBottomSpinner.getValue()); |
||||
style.setPaddingLeft((int) this.paddingLeftSpinner.getValue()); |
||||
style.setPaddingRight((int) this.paddingRightSpinner.getValue()); |
||||
|
||||
style.setInitialColor(this.initialBackgroundColorBox.getSelectObject()); |
||||
style.setSelectColor(this.selectedBackgroundColorBox.getSelectObject()); |
||||
|
||||
style.setBorderLineStyle(this.borderWidthComboBox.getSelectedLineStyle()); |
||||
style.setBorderColor(this.borderColorBox.getSelectObject()); |
||||
style.setBorderRadius((int) this.borderRadiusSpinner.getValue()); |
||||
|
||||
TabFontConfig config = new TabFontConfig(); |
||||
config.setFont(this.tabFontConfPane.update()); |
||||
config.setSelectColor(this.selectedFontColorButton.getColor()); |
||||
style.setTabFontConfig(config); |
||||
|
||||
return style; |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return null; |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue