Browse Source

Merge branch 'feature/x' of https://code.fineres.com/scm/~harrison/design into feature/x

feature/x
Harrison 3 years ago
parent
commit
b095cb9a4d
  1. 2
      designer-base/src/main/java/com/fr/design/gui/style/ReportBackgroundSpecialPane.java
  2. 9
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java
  4. 42
      designer-base/src/main/java/com/fr/design/startup/Install4jStartupNotificationProvider.java
  5. 13
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java

2
designer-base/src/main/java/com/fr/design/gui/style/ReportBackgroundSpecialPane.java

@ -29,7 +29,7 @@ public class ReportBackgroundSpecialPane extends BackgroundPane {
protected BackgroundQuickPane[] supportKindsOfBackgroundUI() { protected BackgroundQuickPane[] supportKindsOfBackgroundUI() {
NullBackgroundQuickPane nullBackgroundPane = new NullBackgroundQuickPane(); NullBackgroundQuickPane nullBackgroundPane = new NullBackgroundQuickPane();
ColorBackgroundQuickPane colorBackgroundPane = new ColorBackgroundQuickPane(); ColorBackgroundQuickPane colorBackgroundPane = new ColorBackgroundQuickPane(true);
colorBackgroundPane.registerChangeListener(new UIObserverListener() { colorBackgroundPane.registerChangeListener(new UIObserverListener() {
@Override @Override
public void doChange() { public void doChange() {

9
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java

@ -16,10 +16,9 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane {
private NewColorSelectBox colorSelectBox; private NewColorSelectBox colorSelectBox;
public ColorBackgroundQuickPane(boolean supportTransparent) {
public ColorBackgroundQuickPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
colorSelectBox = new NewColorSelectBox(100) { colorSelectBox = new NewColorSelectBox(100, supportTransparent) {
@Override @Override
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
// ColorBackgroundQuickPane注册监听器ChangeListenerImpl的逻辑不能丢,因为里面有修改字段backgroundChange的逻辑. // ColorBackgroundQuickPane注册监听器ChangeListenerImpl的逻辑不能丢,因为里面有修改字段backgroundChange的逻辑.
@ -33,6 +32,10 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane {
this.add(colorSelectBox, BorderLayout.NORTH); this.add(colorSelectBox, BorderLayout.NORTH);
} }
public ColorBackgroundQuickPane() {
this(false);
}
public void populateBean(Background background) { public void populateBean(Background background) {
ColorBackground colorBackgroud = (ColorBackground) background; ColorBackground colorBackgroud = (ColorBackground) background;
populateColor(colorBackgroud.getColor()); populateColor(colorBackgroud.getColor());

2
designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java

@ -37,7 +37,7 @@ public class MonitorAdvice implements DesignerAnalyzerAdvice {
private static final Pattern P = Pattern.compile("-?\\d+"); private static final Pattern P = Pattern.compile("-?\\d+");
private static final int MIN_ERROR_CODE = 10000000; private static final int MIN_ERROR_CODE = 10000000;
private static ExecutorService executorService = FineExecutors.newCachedThreadPool(new public static ExecutorService executorService = FineExecutors.newCachedThreadPool(new
NamedThreadFactory(MonitorAdvice.class)); NamedThreadFactory(MonitorAdvice.class));
@Advice.OnMethodEnter @Advice.OnMethodEnter

42
designer-base/src/main/java/com/fr/design/startup/Install4jStartupNotificationProvider.java

@ -1,6 +1,10 @@
package com.fr.design.startup; package com.fr.design.startup;
import com.install4j.api.launcher.StartupNotification; import com.fr.invoke.Reflect;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
/** /**
* @author Starryi * @author Starryi
@ -18,18 +22,30 @@ public class Install4jStartupNotificationProvider implements FineStartupNotifica
@Override @Override
public void registerStartupListener(Listener listener) { public void registerStartupListener(Listener listener) {
boolean supported = false; Class<?> StartupNotificationListenerClass = Reflect.on("com.install4j.api.launcher.StartupNotification$Listener").type();
try { if (StartupNotificationListenerClass == null) {
supported = Class.forName("com.install4j.api.launcher.StartupNotification") != null; return;
} catch (Throwable ignored) {} }
if (supported) { ListenerHandler mHandler = new ListenerHandler(listener);
StartupNotification.registerStartupListener(new StartupNotification.Listener() { Object listenerCallbackInstance = Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] { StartupNotificationListenerClass }, mHandler);
@Override Reflect.on("com.install4j.api.launcher.StartupNotification").call("registerStartupListener", listenerCallbackInstance);
public void startupPerformed(String parameters) { }
listener.startupPerformed(parameters);
} private static class ListenerHandler implements InvocationHandler {
}); private final Listener listener;
public ListenerHandler(Listener listener) {
this.listener = listener;
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (args[0] instanceof String) {
String parameters = (String) args[0];
listener.startupPerformed(parameters);
}
return null;
} }
} }
} }

13
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java

@ -20,13 +20,20 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObs
private static final long serialVersionUID = 2782150678943960557L; private static final long serialVersionUID = 2782150678943960557L;
private Color color; private Color color;
private NewColorSelectPane colorPane = new NewColorSelectPane(false); private NewColorSelectPane colorPane;
private UIObserverListener uiObserverListener; private UIObserverListener uiObserverListener;
private String newColorSelectBoxName = ""; private String newColorSelectBoxName = "";
private GlobalNameListener globalNameListener = null; private GlobalNameListener globalNameListener = null;
private boolean supportTransparent;
public NewColorSelectBox(int preferredWidth) { public NewColorSelectBox(int preferredWidth) {
initBox(preferredWidth); this(preferredWidth, false);
}
public NewColorSelectBox(int preferredWidth, boolean supportTransparent) {
this.colorPane = new NewColorSelectPane(supportTransparent);
this.supportTransparent = supportTransparent;
initBox(preferredWidth);
iniListener(); iniListener();
} }
@ -58,7 +65,7 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObs
*/ */
public JPanel initWindowPane(double preferredWidth) { public JPanel initWindowPane(double preferredWidth) {
// 下拉的时候重新生成面板,以刷新最近使用颜色 // 下拉的时候重新生成面板,以刷新最近使用颜色
colorPane = new NewColorSelectPane(false); colorPane = new NewColorSelectPane(this.supportTransparent);
colorPane.setColor(this.getSelectObject()); colorPane.setColor(this.getSelectObject());
colorPane.addChangeListener(new ChangeListener() { colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {

Loading…
Cancel
Save