Browse Source

预览按钮背景色

master
hzzz 8 years ago
parent
commit
ada421c6a8
  1. 51
      designer/src/com/fr/start/Designer.java

51
designer/src/com/fr/start/Designer.java

@ -135,30 +135,31 @@ public class Designer extends BaseDesigner {
public UILargeToolbar createLargeToolbar() { public UILargeToolbar createLargeToolbar() {
UILargeToolbar largeToolbar = super.createLargeToolbar(); UILargeToolbar largeToolbar = super.createLargeToolbar();
largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4)); largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4));
largeToolbar.add(new JPanel() { largeToolbar.add(generateEmptyGap(1));
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.width = 1;
return dim;
}
});
createRunButton(largeToolbar); createRunButton(largeToolbar);
largeToolbar.add(run); largeToolbar.add(run);
run.setBackground(UIConstants.TREE_BACKGROUND); run.setBackground(Color.WHITE);
largeToolbar.add(new JPanel() { largeToolbar.add(generateEmptyGap(GAP));
largeToolbar.addSeparator(new Dimension(2, 42));
largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR));
return largeToolbar;
}
private JPanel generateEmptyGap(int width) {
JPanel panel = new JPanel() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize(); Dimension dim = super.getPreferredSize();
dim.width = GAP; dim.width = width;
return dim; return dim;
} }
}); };
largeToolbar.addSeparator(new Dimension(2, 42)); panel.setBackground(Color.WHITE);
largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR)); return panel;
return largeToolbar;
} }
/** /**
* 创建上面一排的工具栏按钮 * 创建上面一排的工具栏按钮
*
* @return 按钮 * @return 按钮
*/ */
public UIButton[] createUp() { public UIButton[] createUp() {
@ -290,6 +291,7 @@ public class Designer extends BaseDesigner {
/** /**
* 生成工具栏 * 生成工具栏
*
* @param toolbarComponent 工具栏 * @param toolbarComponent 工具栏
* @param plus 对象 * @param plus 对象
* @return 更新后的toolbar * @return 更新后的toolbar
@ -336,10 +338,9 @@ public class Designer extends BaseDesigner {
* 创建论坛登录面板, chart那边不需要 * 创建论坛登录面板, chart那边不需要
* *
* @return 面板组件 * @return 面板组件
*
*/ */
public Component createBBSLoginPane(){ public Component createBBSLoginPane() {
if (userInfoPane == null){ if (userInfoPane == null) {
userInfoPane = new UserInfoPane(); userInfoPane = new UserInfoPane();
} }
return userInfoPane; return userInfoPane;
@ -361,7 +362,6 @@ public class Designer extends BaseDesigner {
/** /**
* 收集用户信息吗 * 收集用户信息吗
*
*/ */
protected void collectUserInformation() { protected void collectUserInformation() {
//定制的就不弹出来了 //定制的就不弹出来了
@ -372,13 +372,13 @@ public class Designer extends BaseDesigner {
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
final String key = envManager.getActivationKey(); final String key = envManager.getActivationKey();
//本地验证通过 //本地验证通过
if(ActiveKeyGenerator.localVerify(key)){ if (ActiveKeyGenerator.localVerify(key)) {
onLineVerify(envManager, key); onLineVerify(envManager, key);
UserInfoLabel.showBBSDialog(); UserInfoLabel.showBBSDialog();
return; return;
} }
if(StableUtils.checkDesignerActive(readOldKey())){ if (StableUtils.checkDesignerActive(readOldKey())) {
//只要有老的key, 就不弹窗, 下次启动的时候, 在线验证下就行. //只要有老的key, 就不弹窗, 下次启动的时候, 在线验证下就行.
String newKey = ActiveKeyGenerator.generateActiveKey(); String newKey = ActiveKeyGenerator.generateActiveKey();
envManager.setActivationKey(newKey); envManager.setActivationKey(newKey);
@ -391,7 +391,7 @@ public class Designer extends BaseDesigner {
activeDialog.setVisible(true); activeDialog.setVisible(true);
} }
private void onLineVerify(DesignerEnvManager envManager, final String key){ private void onLineVerify(DesignerEnvManager envManager, final String key) {
int status = envManager.getActiveKeyStatus(); int status = envManager.getActiveKeyStatus();
//没有联网验证过 //没有联网验证过
if (status != 0) { if (status != 0) {
@ -406,7 +406,7 @@ public class Designer extends BaseDesigner {
} }
} }
private File getOldEnvFile(String folderName){ private File getOldEnvFile(String folderName) {
String userHome = System.getProperty("user.home"); String userHome = System.getProperty("user.home");
if (userHome == null) { if (userHome == null) {
userHome = System.getProperty("userHome"); userHome = System.getProperty("userHome");
@ -415,7 +415,7 @@ public class Designer extends BaseDesigner {
return new File(filePath); return new File(filePath);
} }
private String getOldActiveKeyFromFile(File envFile){ private String getOldActiveKeyFromFile(File envFile) {
if (!envFile.exists()) { if (!envFile.exists()) {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }
@ -430,7 +430,7 @@ public class Designer extends BaseDesigner {
} }
//默认只从7.0和711的设计器里读取key //默认只从7.0和711的设计器里读取key
private String readOldKey(){ private String readOldKey() {
File file71 = getOldEnvFile(OLD_ENV_FOLDER_71); File file71 = getOldEnvFile(OLD_ENV_FOLDER_71);
if (!file71.exists()) { if (!file71.exists()) {
File file70 = getOldEnvFile(OLD_ENV_FOLDER_70); File file70 = getOldEnvFile(OLD_ENV_FOLDER_70);
@ -442,9 +442,8 @@ public class Designer extends BaseDesigner {
/** /**
* 设计器退出时, 做的一些操作. * 设计器退出时, 做的一些操作.
*
*/ */
public void shutDown(){ public void shutDown() {
InformationCollector collector = InformationCollector.getInstance(); InformationCollector collector = InformationCollector.getInstance();
collector.collectStopTime(); collector.collectStopTime();
collector.saveXMLFile(); collector.saveXMLFile();

Loading…
Cancel
Save