forked from fanruan/design
Browse Source
* commit '9843263ea817202e2971a657ed9b7ee7019a7425': (386 commits) REPORT-28351 强转问题 同步到final REPORT-29003 错误报告问题 REPORT-28830 提示优化 REPORT-28894 多次切换远程的问题 && xml不可读处理 fix mac下不用awt的库读写 REPORT-28873 REPORT-28792 表单添加tab块问题 fix dock name fix 遗漏 REPORT-28846 && REPORT-28830 && REPORT-27109 REPORT-27106 && REPORT-28229 CHART-13052 为仪表盘坐标轴轴标签htmlPane分配parentPane CHART-13064 修改含有自动button的颜色选择器高度 fix import REPORT-27106 && REPORT-27144 CHART-13065 调整字符间距 CHART-13063 修改试管仪表盘布局文案 REPORT-28186 mac出现短暂原生java图标问题 REPORT-28368 死锁问题 常量不需要每次读取 REPORT-28257 && REPORT-28257 ...bugfix/10.0
neil
5 years ago
513 changed files with 15786 additions and 4161 deletions
@ -0,0 +1,59 @@
|
||||
package com.fr.common.detect; |
||||
|
||||
import com.fr.concurrent.NamedThreadFactory; |
||||
import com.fr.design.DesignerEnvManager; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.module.ModuleContext; |
||||
import com.fr.web.WebSocketConfig; |
||||
|
||||
import java.net.Socket; |
||||
import java.util.concurrent.ExecutorService; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/3/10 |
||||
*/ |
||||
public class CommonPortDetector { |
||||
|
||||
private static final CommonPortDetector INSTANCE = new CommonPortDetector(); |
||||
private ExecutorService service = ModuleContext.getExecutor().newSingleThreadExecutor(new NamedThreadFactory("CommonPortDetector")); |
||||
|
||||
public static CommonPortDetector getInstance() { |
||||
return INSTANCE; |
||||
} |
||||
|
||||
public void execute() { |
||||
service.submit(new Runnable() { |
||||
@Override |
||||
public void run() { |
||||
detectTomcatPort(); |
||||
detectWebSocketPort(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
private void detectTomcatPort() { |
||||
int port = DesignerEnvManager.getEnvManager().getEmbedServerPort(); |
||||
if (checkPort(port)) { |
||||
FineLoggerFactory.getLogger().error("EmbedTomcat Port: {} is not available, maybe occupied by other programs, please check it!", port); |
||||
} |
||||
} |
||||
|
||||
private void detectWebSocketPort() { |
||||
Integer[] ports = WebSocketConfig.getInstance().getPort(); |
||||
for (int port : ports) { |
||||
if (checkPort(port)) { |
||||
FineLoggerFactory.getLogger().error("WebSocKet Port: {} is not available, maybe occupied by other programs, please check it!", port); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private boolean checkPort(int port) { |
||||
try (Socket socket = new Socket("localhost", port)) { |
||||
return true; |
||||
} catch (Exception e) { |
||||
return false; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,21 @@
|
||||
package com.fr.common.report; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/3/27 |
||||
*/ |
||||
public enum ReportState { |
||||
|
||||
STOP("stop"), ACTIVE("active"); |
||||
|
||||
private String value; |
||||
|
||||
ReportState(String value) { |
||||
this.value = value; |
||||
} |
||||
|
||||
public String getValue() { |
||||
return this.value; |
||||
} |
||||
} |
@ -0,0 +1,94 @@
|
||||
package com.fr.design.dialog; |
||||
|
||||
import com.fr.design.gui.ibutton.UIButton; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.utils.gui.GUICoreUtils; |
||||
import com.fr.general.FRFont; |
||||
|
||||
import javax.swing.JDialog; |
||||
import javax.swing.JPanel; |
||||
import javax.swing.JTextArea; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Dimension; |
||||
import java.awt.FlowLayout; |
||||
import java.awt.Font; |
||||
import java.awt.Frame; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.ActionListener; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/1/8 |
||||
*/ |
||||
public abstract class ErrorDialog extends JDialog implements ActionListener { |
||||
|
||||
private UIButton okButton; |
||||
private UIButton restartButton; |
||||
|
||||
|
||||
public ErrorDialog(Frame parent, String message, String title, String detail) { |
||||
super(parent, true); |
||||
JPanel northPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
JPanel messagePane = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); |
||||
UILabel boldFontLabel = new UILabel(message); |
||||
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Send_Report_To_Us")); |
||||
Font font = FRFont.getInstance("Dialog", Font.BOLD, 20); |
||||
boldFontLabel.setFont(font); |
||||
messagePane.add(boldFontLabel); |
||||
messagePane.add(label); |
||||
northPane.add(messagePane); |
||||
|
||||
JTextArea area = new JTextArea(detail); |
||||
area.setPreferredSize(new Dimension(400, 100)); |
||||
area.setEnabled(true); |
||||
area.setEditable(false); |
||||
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
UILabel detailLabel = new UILabel(Toolkit.i18nText("Fine-Design_Problem_Detail_Message")); |
||||
centerPane.add(detailLabel, BorderLayout.NORTH); |
||||
centerPane.add(area, BorderLayout.CENTER); |
||||
|
||||
JPanel southPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 0)); |
||||
okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Ok")); |
||||
okButton.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
okEvent(); |
||||
} |
||||
}); |
||||
buttonPane.add(okButton); |
||||
restartButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Restart")); |
||||
restartButton.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
restartEvent(); |
||||
} |
||||
}); |
||||
buttonPane.add(restartButton); |
||||
controlPane.add(buttonPane, BorderLayout.EAST); |
||||
southPane.add(controlPane); |
||||
|
||||
this.setTitle(title); |
||||
this.setResizable(false); |
||||
this.add(northPane, BorderLayout.NORTH); |
||||
this.add(centerPane, BorderLayout.CENTER); |
||||
this.add(southPane, BorderLayout.SOUTH); |
||||
this.setSize(new Dimension(600, 500)); |
||||
GUICoreUtils.centerWindow(this); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
dispose(); |
||||
} |
||||
|
||||
protected abstract void okEvent(); |
||||
|
||||
protected abstract void restartEvent(); |
||||
|
||||
} |
@ -0,0 +1,290 @@
|
||||
package com.fr.design.dialog; |
||||
|
||||
import com.fr.invoke.Reflect; |
||||
|
||||
import javax.swing.Icon; |
||||
import javax.swing.JDialog; |
||||
import javax.swing.JOptionPane; |
||||
import java.awt.Component; |
||||
import java.awt.HeadlessException; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author Joe |
||||
* @version 10.0 |
||||
* Created by Joe on 12/5/2019 |
||||
*/ |
||||
public class FineJOptionPane extends JOptionPane { |
||||
|
||||
public final static String[] OPTION_DEFAULT = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_OK") }; |
||||
public final static String[] OPTION_YES_NO = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes"), |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No") }; |
||||
public final static String[] OPTION_YES_NO_CANCEL = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes"), |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Cancel") }; |
||||
public final static String[] OPTION_OK_CANCEL = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_OK"), |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Cancel") }; |
||||
|
||||
//选项类型optionType 和 选项字符串数组 一一对应
|
||||
private final static Map<Integer, String[]> OPTION_MAP = new HashMap<>(); |
||||
|
||||
static { |
||||
OPTION_MAP.put(DEFAULT_OPTION, OPTION_DEFAULT); |
||||
OPTION_MAP.put(YES_NO_OPTION, OPTION_YES_NO); |
||||
OPTION_MAP.put(YES_NO_CANCEL_OPTION, OPTION_YES_NO_CANCEL); |
||||
OPTION_MAP.put(OK_CANCEL_OPTION, OPTION_OK_CANCEL); |
||||
} |
||||
|
||||
private final static String MESSAGE_DIALOG_TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Message"); |
||||
private final static String CONFIRM_DIALOG_TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"); |
||||
private final static String INPUT_DIALOG_TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"); |
||||
|
||||
/** |
||||
* 使用默认 标题 和 消息类型 的消息提示弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static void showMessageDialog(Component parentComponent, Object message) |
||||
throws HeadlessException { |
||||
showMessageDialog(parentComponent, message, MESSAGE_DIALOG_TITLE, |
||||
INFORMATION_MESSAGE); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 Icon 的消息提示弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param messageType 消息类型 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static void showMessageDialog(Component parentComponent, Object message, |
||||
String title, int messageType) |
||||
throws HeadlessException { |
||||
showMessageDialog(parentComponent, message, title, messageType, null); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 选项类型、选项 和 初始选项 的消息提示弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param messageType 消息类型 |
||||
* @param icon 图标 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static void showMessageDialog(Component parentComponent, Object message, |
||||
String title, int messageType, Icon icon) |
||||
throws HeadlessException { |
||||
showMessageDialog(parentComponent, message, title, DEFAULT_OPTION, |
||||
messageType, icon, OPTION_DEFAULT, null); |
||||
} |
||||
|
||||
/** |
||||
* 自定义的消息提示弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param optionType 选项类型 |
||||
* @param messageType 消息类型 |
||||
* @param icon 图标 |
||||
* @param options 选项 |
||||
* @param initialValue 初始选项 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static void showMessageDialog(Component parentComponent, Object message, |
||||
String title, int optionType, int messageType, |
||||
Icon icon, Object[] options, Object initialValue) |
||||
throws HeadlessException { |
||||
showOptionDialog(parentComponent, message, title, optionType, |
||||
messageType, icon, options, initialValue); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 标题 和 选项类型 的确认弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static int showConfirmDialog(Component parentComponent, Object message) |
||||
throws HeadlessException { |
||||
return showConfirmDialog(parentComponent, message, |
||||
CONFIRM_DIALOG_TITLE, |
||||
YES_NO_CANCEL_OPTION); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 消息类型 的确认弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param optionType 选项类型 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static int showConfirmDialog(Component parentComponent, Object message, |
||||
String title, int optionType) throws HeadlessException { |
||||
return showConfirmDialog(parentComponent, message, title, optionType, |
||||
QUESTION_MESSAGE); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 Icon 的确认弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param optionType 选项类型 |
||||
* @param messageType 消息类型 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static int showConfirmDialog(Component parentComponent, Object message, |
||||
String title, int optionType, int messageType) |
||||
throws HeadlessException { |
||||
return showConfirmDialog(parentComponent, message, title, optionType, |
||||
messageType, null); |
||||
} |
||||
|
||||
/** |
||||
* 根据 选项类型 获取对应 选项 ,且使用默认 初始选项 的确认弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param optionType 选项类型 |
||||
* @param messageType 消息类型 |
||||
* @param icon 图标 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static int showConfirmDialog(Component parentComponent, Object message, |
||||
String title, int optionType, int messageType, Icon icon) |
||||
throws HeadlessException { |
||||
String[] options = OPTION_MAP.get(optionType); |
||||
return showConfirmDialog(parentComponent, message, title, optionType, |
||||
messageType, icon, options, options[0]); |
||||
} |
||||
|
||||
/** |
||||
* 自定义的确认弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param optionType 选项类型 |
||||
* @param messageType 消息类型 |
||||
* @param icon 图标 |
||||
* @param options 选项 |
||||
* @param initialValue 初始选项 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static int showConfirmDialog(Component parentComponent, Object message, |
||||
String title, int optionType, int messageType, Icon icon, |
||||
Object[] options, Object initialValue) |
||||
throws HeadlessException { |
||||
return showOptionDialog(parentComponent, message, title, optionType, |
||||
messageType, icon, options, initialValue); |
||||
} |
||||
|
||||
/** |
||||
* 指定消息内容的输入弹出框 |
||||
* @param message 消息内容 |
||||
* @return |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static String showInputDialog(Object message) |
||||
throws HeadlessException { |
||||
return showInputDialog(null, message); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 标题 和 消息类型 的输入弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 消息内容 |
||||
* @return |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static String showInputDialog(Component parentComponent, |
||||
Object message) throws HeadlessException { |
||||
return showInputDialog(parentComponent, message, INPUT_DIALOG_TITLE, QUESTION_MESSAGE); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 标题、消息类型、Icon 和 选项 的输入弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 消息类型 |
||||
* @param initialSelectionValue 初始选项 |
||||
* @return |
||||
*/ |
||||
public static String showInputDialog(Component parentComponent, Object message, |
||||
Object initialSelectionValue) { |
||||
return (String)showInputDialog(parentComponent, message, |
||||
INPUT_DIALOG_TITLE, QUESTION_MESSAGE, null, null, |
||||
initialSelectionValue); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 父容器、消息内容 和 初始选项 的输入弹出框 |
||||
* @param message 消息内容 |
||||
* @param initialSelectionValue 初始选项 |
||||
* @return |
||||
*/ |
||||
public static String showInputDialog(Object message, Object initialSelectionValue) { |
||||
return showInputDialog(null, message, initialSelectionValue); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 Icon、选项 和 初始选项 的输入弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 消息内容 |
||||
* @param title 标题 |
||||
* @param messageType 消息类型 |
||||
* @return |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static String showInputDialog(Component parentComponent, |
||||
Object message, String title, int messageType) |
||||
throws HeadlessException { |
||||
return (String)showInputDialog(parentComponent, message, title, |
||||
messageType, null, null, null); |
||||
} |
||||
|
||||
/** |
||||
* 自定义的输入弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 消息内容 |
||||
* @param title 标题 |
||||
* @param messageType 消息类型 |
||||
* @param icon 图标 |
||||
* @param selectionValues 选项 |
||||
* @param initialSelectionValue 初始选项 |
||||
* @return |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static Object showInputDialog(Component parentComponent, |
||||
Object message, String title, int messageType, Icon icon, |
||||
Object[] selectionValues, Object initialSelectionValue) |
||||
throws HeadlessException { |
||||
JOptionPane pane = new JOptionPane(message, messageType, |
||||
OK_CANCEL_OPTION, icon, |
||||
OPTION_OK_CANCEL, null); |
||||
|
||||
pane.setWantsInput(true); |
||||
pane.setSelectionValues(selectionValues); |
||||
pane.setInitialSelectionValue(initialSelectionValue); |
||||
pane.setComponentOrientation(((parentComponent == null) ? |
||||
getRootFrame() : parentComponent).getComponentOrientation()); |
||||
|
||||
int style = Reflect.on(JOptionPane.class).call("styleFromMessageType", messageType).get(); |
||||
JDialog dialog = Reflect.on(pane).call("createDialog", parentComponent, title, style).get(); |
||||
|
||||
pane.selectInitialValue(); |
||||
dialog.show(); |
||||
dialog.dispose(); |
||||
|
||||
Object value = pane.getInputValue(); |
||||
|
||||
if (value == UNINITIALIZED_VALUE) { |
||||
return null; |
||||
} |
||||
return value; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,98 @@
|
||||
package com.fr.design.dialog; |
||||
|
||||
import com.fr.design.gui.ibutton.UIButton; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.utils.gui.GUICoreUtils; |
||||
import com.fr.general.IOUtils; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Dimension; |
||||
import java.awt.FlowLayout; |
||||
import java.awt.Frame; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.ActionListener; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/1/8 |
||||
*/ |
||||
public abstract class TipDialog extends JDialog implements ActionListener { |
||||
|
||||
private UIButton endButton; |
||||
private UIButton cancelButton; |
||||
|
||||
public TipDialog(Frame parent, String type, String tip, String endText, String cancelText) { |
||||
super(parent, true); |
||||
JPanel northPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
JPanel iconPane = new JPanel(); |
||||
UILabel iconLabel = new UILabel(); |
||||
iconLabel.setIcon(IOUtils.readIcon("com/fr/design/images/error/error2.png")); |
||||
iconPane.add(iconLabel); |
||||
iconPane.setPreferredSize(new Dimension(50, 50)); |
||||
JPanel tipPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
UILabel tipLabel = new UILabel(tip); |
||||
tipPane.add(tipLabel); |
||||
northPane.add(iconPane, BorderLayout.WEST); |
||||
northPane.add(tipPane, BorderLayout.CENTER); |
||||
|
||||
JTextPane area = new JTextPane(); |
||||
UILabel typeLabel = new UILabel(type); |
||||
area.insertComponent(typeLabel); |
||||
if (StringUtils.isNotEmpty(type)) { |
||||
UILabel logoIconLabel = new UILabel(); |
||||
logoIconLabel.setIcon(IOUtils.readIcon("com/fr/base/images/oem/logo.png")); |
||||
area.insertComponent(logoIconLabel); |
||||
} |
||||
area.setPreferredSize(new Dimension(400, 100)); |
||||
area.setEnabled(true); |
||||
area.setEditable(false); |
||||
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
centerPane.add(area); |
||||
|
||||
JPanel southPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 0)); |
||||
endButton = new UIButton(endText); |
||||
endButton.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
endEvent(); |
||||
} |
||||
}); |
||||
buttonPane.add(endButton); |
||||
cancelButton = new UIButton(cancelText); |
||||
cancelButton.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
cancelEvent(); |
||||
} |
||||
}); |
||||
buttonPane.add(cancelButton); |
||||
controlPane.add(buttonPane, BorderLayout.EAST); |
||||
southPane.add(controlPane); |
||||
|
||||
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Error_Tittle")); |
||||
this.setResizable(false); |
||||
this.add(northPane, BorderLayout.NORTH); |
||||
this.add(centerPane, BorderLayout.CENTER); |
||||
this.add(southPane, BorderLayout.SOUTH); |
||||
this.setSize(new Dimension(600, 500)); |
||||
GUICoreUtils.centerWindow(this); |
||||
|
||||
} |
||||
|
||||
protected abstract void endEvent(); |
||||
|
||||
protected abstract void cancelEvent(); |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
dispose(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.fr.design.event; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/3/19 |
||||
*/ |
||||
public interface RemoveListener { |
||||
|
||||
void doRemoveAction(); |
||||
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,34 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.form.ui.mobile.MobileBookMarkStyle; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
/** |
||||
* 移动端书签样式扩展接口 |
||||
* |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/12/23 |
||||
*/ |
||||
public interface MobileBookMarkStyleProvider extends Mutable { |
||||
|
||||
String XML_TAG = "MobileBookMarkStyleProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 书签样式 |
||||
* @return |
||||
*/ |
||||
Class<? extends MobileBookMarkStyle> classForMobileBookMarkStyle(); |
||||
|
||||
/** |
||||
* 书签样式面板 |
||||
* @return |
||||
*/ |
||||
Class<? extends BasicBeanPane<MobileBookMarkStyle>> classForMobileBookMarkStyleAppearance(); |
||||
|
||||
String displayName(); |
||||
|
||||
} |
@ -0,0 +1,23 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.common.annotations.Open; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@Open |
||||
public interface MultiStyleUIConfigProvider extends Mutable { |
||||
String XML_TAG = "MultiStyleUIConfigProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 获取配置项list |
||||
* |
||||
* @return 配置项list |
||||
*/ |
||||
List<StyleUIConfigProvider> getConfigList(); |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.base.Style; |
||||
import com.fr.common.annotations.Open; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@Open |
||||
public interface StyleUIConfigProvider extends Mutable { |
||||
String XML_TAG = "CustomStyleUIConfigProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* @return 配置名 |
||||
*/ |
||||
String configName(); |
||||
|
||||
/** |
||||
* @param changeListener 需要添加的listener |
||||
* @return 对应的component |
||||
*/ |
||||
JComponent uiComponent(ChangeListener changeListener); |
||||
|
||||
/** |
||||
* @return 更新后的样式 |
||||
*/ |
||||
Style updateConfig(); |
||||
|
||||
/** |
||||
* @param style 待渲染的样式 |
||||
*/ |
||||
void populateConfig(Style style); |
||||
} |
@ -0,0 +1,24 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.MobileBookMarkStyleProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/12/24 |
||||
*/ |
||||
@API(level = MobileBookMarkStyleProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractMobileBookMarkStyleProvider extends AbstractProvider implements MobileBookMarkStyleProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.StyleUIConfigProvider; |
||||
import com.fr.design.fun.MultiStyleUIConfigProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@API(level = MultiStyleUIConfigProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractMultiStyleUIConfigProvider extends AbstractProvider implements MultiStyleUIConfigProvider { |
||||
@Override |
||||
public List<StyleUIConfigProvider> getConfigList() { |
||||
return new ArrayList<StyleUIConfigProvider>(); |
||||
} |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,41 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.base.Style; |
||||
import com.fr.design.fun.StyleUIConfigProvider; |
||||
import com.fr.stable.StringUtils; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@API(level = StyleUIConfigProvider.CURRENT_LEVEL) |
||||
public class AbstractStyleUIConfigProvider extends AbstractProvider implements StyleUIConfigProvider { |
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String configName() { |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
@Override |
||||
public JComponent uiComponent(ChangeListener changeListener) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public Style updateConfig() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void populateConfig(Style style) { |
||||
|
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue