Browse Source

REPORT-9565 部署集成-远程-设计器上方路径显示异常

master
hzzz 7 years ago
parent
commit
6c1067c19b
  1. 65
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

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

@ -51,14 +51,30 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.image4j.codec.ico.ICODecoder; import com.fr.stable.image4j.codec.ico.ICODecoder;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.connect.WorkspaceConnection;
import javax.swing.*;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import javax.swing.border.MatteBorder; import javax.swing.border.MatteBorder;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable; import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants; import java.awt.dnd.DnDConstants;
@ -173,7 +189,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
g.setColor(UIConstants.NORMAL_BACKGROUND); g.setColor(UIConstants.NORMAL_BACKGROUND);
g.fillArc(0, 0, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH, g.fillArc(0, 0, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH,
0, 360); 0, 360);
closeMode.paintIcon(this, g, 0, 0); closeMode.paintIcon(this, g, 0, 0);
} }
}; };
@ -206,10 +222,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
BaseUtils.setAuthorityEditing(false); BaseUtils.setAuthorityEditing(false);
WestRegionContainerPane.getInstance().replaceDownPane( WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
DesignerContext.getDesignerFrame().resetToolkitByPlus( DesignerContext.getDesignerFrame().resetToolkitByPlus(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus()); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus());
needToAddAuhtorityPaint(); needToAddAuhtorityPaint();
refreshDottedLine(); refreshDottedLine();
fireAuthorityStateToNomal(); fireAuthorityStateToNomal();
@ -415,7 +431,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
try { try {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<BufferedImage> image = ICODecoder.read(DesignerFrame.class List<BufferedImage> image = ICODecoder.read(DesignerFrame.class
.getResourceAsStream("/com/fr/base/images/oem/logo.ico")); .getResourceAsStream("/com/fr/base/images/oem/logo.ico"));
this.setIconImages(image); this.setIconImages(image);
} catch (IOException e) { } catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
@ -460,11 +476,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
public void populateAuthorityArea() { public void populateAuthorityArea() {
int centerWidth = contentWidth - WestRegionContainerPane.getInstance().getContainerWidth() int centerWidth = contentWidth - WestRegionContainerPane.getInstance().getContainerWidth()
- EastRegionContainerPane.getInstance().getContainerWidth(); - EastRegionContainerPane.getInstance().getContainerWidth();
// 上面的虚线 // 上面的虚线
upDottedLine = new DottedLine(UIScrollBar.HORIZONTAL, centerWidth); upDottedLine = new DottedLine(UIScrollBar.HORIZONTAL, centerWidth);
upDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), MENU_HEIGHT - 1, centerWidth, upDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), MENU_HEIGHT - 1, centerWidth,
3); 3);
// 下面的虚线 // 下面的虚线
downDottedLine = new DottedLine(UIScrollBar.HORIZONTAL, centerWidth); downDottedLine = new DottedLine(UIScrollBar.HORIZONTAL, centerWidth);
@ -542,7 +558,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
int x = contentWidth - EastRegionContainerPane.getInstance().getContainerWidth() - closeMode.getIconWidth() / 2; int x = contentWidth - EastRegionContainerPane.getInstance().getContainerWidth() - closeMode.getIconWidth() / 2;
int y = MENU_HEIGHT - closeMode.getIconHeight() / 2; int y = MENU_HEIGHT - closeMode.getIconHeight() / 2;
closeButton.setBounds(x, y, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH, closeButton.setBounds(x, y, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH,
UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH); UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH);
} }
/** /**
@ -721,8 +737,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName);
String username = null; String username = null;
if (info != null){ if (info != null) {
username = info.getName(); WorkspaceConnection connection = info.getConnection();
username = connection == null ? StringUtils.EMPTY : connection.getUserName();
} }
defaultTitleSB.append(username).append("@").append(envName).append("[").append(workspace.getDescription()).append("]"); defaultTitleSB.append(username).append("@").append(envName).append("[").append(workspace.getDescription()).append("]");
if (editingTemplate != null) { if (editingTemplate != null) {
@ -808,19 +825,19 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
editingTemplate.stopEditing(); editingTemplate.stopEditing();
if (!editingTemplate.getEditingFILE().exists()) { if (!editingTemplate.getEditingFILE().exists()) {
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText("Utils-Would_you_like_to_save") + " \"" + editingTemplate.getEditingFILE() Inter.getLocText("Utils-Would_you_like_to_save") + " \"" + editingTemplate.getEditingFILE()
+ "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_OPTION, + "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE); JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION && editingTemplate.saveTemplate()) { if (returnVal == JOptionPane.YES_OPTION && editingTemplate.saveTemplate()) {
editingTemplate.saveTemplate(); editingTemplate.saveTemplate();
FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{ FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{
editingTemplate.getEditingFILE().getName(), "."})); editingTemplate.getEditingFILE().getName(), "."}));
} }
} else { } else {
if (editingTemplate.saveTemplate()) { if (editingTemplate.saveTemplate()) {
editingTemplate.saveTemplate(); editingTemplate.saveTemplate();
FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{ FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{
editingTemplate.getEditingFILE().getName(), "."})); editingTemplate.getEditingFILE().getName(), "."}));
} }
} }
} }
@ -930,7 +947,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
// p:判断一下,如何文件为空或者文件不存在,直接返回. // p:判断一下,如何文件为空或者文件不存在,直接返回.
if (tplFile == null || !tplFile.exists()) { if (tplFile == null || !tplFile.exists()) {
JOptionPane.showMessageDialog(this, Inter.getLocText("Warning-Template_Do_Not_Exsit"), JOptionPane.showMessageDialog(this, Inter.getLocText("Warning-Template_Do_Not_Exsit"),
ProductConstants.PRODUCT_NAME, JOptionPane.INFORMATION_MESSAGE); ProductConstants.PRODUCT_NAME, JOptionPane.INFORMATION_MESSAGE);
DesignerFrameFileDealerPane.getInstance().refresh(); DesignerFrameFileDealerPane.getInstance().refresh();
return; return;
} }
@ -986,7 +1003,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
if (inValidDesigner(jt)) { if (inValidDesigner(jt)) {
this.addAndActivateJTemplate(); this.addAndActivateJTemplate();
MutilTempalteTabPane.getInstance().setTemTemplate( MutilTempalteTabPane.getInstance().setTemTemplate(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
} else { } else {
activeTemplate(tplFile, jt); activeTemplate(tplFile, jt);
} }
@ -1049,16 +1066,16 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} }
DesignerEnvManager.getEnvManager().setLastOpenFile( DesignerEnvManager.getEnvManager().setLastOpenFile(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath()); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath());
DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneY( DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneY(
WestRegionContainerPane.getInstance().getToolPaneY()); WestRegionContainerPane.getInstance().getToolPaneY());
DesignerEnvManager.getEnvManager().setLastWestRegionContainerWidth( DesignerEnvManager.getEnvManager().setLastWestRegionContainerWidth(
WestRegionContainerPane.getInstance().getContainerWidth()); WestRegionContainerPane.getInstance().getContainerWidth());
DesignerEnvManager.getEnvManager().setLastEastRegionToolPaneY( DesignerEnvManager.getEnvManager().setLastEastRegionToolPaneY(
EastRegionContainerPane.getInstance().getToolPaneY()); EastRegionContainerPane.getInstance().getToolPaneY());
DesignerEnvManager.getEnvManager().setLastEastRegionContainerWidth( DesignerEnvManager.getEnvManager().setLastEastRegionContainerWidth(
EastRegionContainerPane.getInstance().getContainerWidth()); EastRegionContainerPane.getInstance().getContainerWidth());
DesignerEnvManager.getEnvManager().saveXMLFile(); DesignerEnvManager.getEnvManager().saveXMLFile();

Loading…
Cancel
Save