Browse Source

REPORT-19945 启动画面&修复frm工具栏不变化的问题

persist/11.0
vito 5 years ago
parent
commit
99e9199f03
  1. 10
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  2. 42
      designer-realize/src/main/java/com/fr/start/common/SplashWindow.java

10
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -745,13 +745,13 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
resetCombineUpTooBar(ad.resetUpToolBar(plus)); resetCombineUpTooBar(ad.resetUpToolBar(plus));
// 颜色,字体那些按钮的工具栏 if (toolbarComponent != null) {
if (toolbarComponent == null) { toolbarPane.remove(toolbarComponent);
toolbarPane.add(toolbarComponent = ad.resetToolBar(null, plus), BorderLayout.CENTER);
} else {
ad.resetToolBar(toolbarComponent, plus);
} }
// 颜色,字体那些按钮的工具栏
toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER);
this.checkToolbarMenuEnable(); this.checkToolbarMenuEnable();
this.validate(); this.validate();
layeredPane.repaint(); layeredPane.repaint();

42
designer-realize/src/main/java/com/fr/start/common/SplashWindow.java

@ -1,11 +1,19 @@
package com.fr.start.common; package com.fr.start.common;
import com.fr.base.BaseUtils;
import com.fr.design.fun.OemProcessor;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.image4j.codec.ico.ICODecoder;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.start.OemHandler;
import com.sun.awt.AWTUtilities; import com.sun.awt.AWTUtilities;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.image.*;
import java.io.IOException;
import java.util.List;
/** /**
* 启动画面窗口 * 启动画面窗口
@ -22,6 +30,8 @@ public class SplashWindow extends JFrame {
// alex:必须设置这个属性为true,才可以用透明背景 // alex:必须设置这个属性为true,才可以用透明背景
System.setProperty("sun.java2d.noddraw", "true"); System.setProperty("sun.java2d.noddraw", "true");
initTitleIcon();
//slash pane //slash pane
this.splash = new SplashPane(); this.splash = new SplashPane();
@ -41,6 +51,32 @@ public class SplashWindow extends JFrame {
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
} }
/**
* 设置任务栏图标主要用于Windows
*/
@SuppressWarnings("unchecked")
private void initTitleIcon() {
try {
OemProcessor oemProcessor = OemHandler.findOem();
List<BufferedImage> image = null;
if (oemProcessor != null) {
try {
image = oemProcessor.createTitleIcon();
} catch (Throwable e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
if (image == null) {
image = ICODecoder.read(SplashWindow.class
.getResourceAsStream("/com/fr/base/images/oem/logo.ico"));
}
this.setIconImages(image);
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png"));
}
}
/** /**
* 注销窗口 * 注销窗口
*/ */
@ -61,10 +97,4 @@ public class SplashWindow extends JFrame {
void updateThanksLog(String text) { void updateThanksLog(String text) {
splash.updateThanksLog(text); splash.updateThanksLog(text);
} }
public static void main(String[] args) {
SplashWindow splashWindow = new SplashWindow();
splashWindow.setVisible(true);
}
} }

Loading…
Cancel
Save