Browse Source

修改新增一些方法便于OEM

master
hugh 8 years ago
parent
commit
fb3a4724cb
  1. 73
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  2. 2
      designer_base/src/com/fr/start/BaseDesigner.java

73
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -115,7 +115,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private int contentWidth = (int) (Toolkit.getDefaultToolkit().getScreenSize().getWidth()); private int contentWidth = (int) (Toolkit.getDefaultToolkit().getScreenSize().getWidth());
private int contentHeight = (int) (Toolkit.getDefaultToolkit().getScreenSize().getHeight()); private int contentHeight = (int) (Toolkit.getDefaultToolkit().getScreenSize().getHeight());
private WindowAdapter windowAdapter = new WindowAdapter() { private WindowAdapter windowAdapter = new WindowAdapter() {
public void windowOpened(WindowEvent e) { public void windowOpened(WindowEvent e) {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setComposite(); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setComposite();
@ -166,11 +166,52 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
protected DesktopCardPane getCenterTemplateCardPane() { protected DesktopCardPane getCenterTemplateCardPane() {
return centerTemplateCardPane; return centerTemplateCardPane;
} }
/**
* 生成frame的方法
* @param ad
* @return
*/
public static DesignerFrame getNewInstance(ToolBarMenuDock ad){
DesignerFrame frame = new DesignerFrame(ad);
frame.initMenuPane(ad);
return frame;
}
/**
* 初始menuPane的方法 方便OEM时修改该组件
* @param ad
*/
protected void initMenuPane(ToolBarMenuDock ad){
menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
menuPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
menuPane.add(initNorthEastPane(ad), BorderLayout.EAST);
basePane.add(menuPane, BorderLayout.NORTH);
this.resetToolkitByPlus(null);
}
/** /**
* Constructor. * @param ad
* @return
*/ */
public DesignerFrame(ToolBarMenuDock ad) { protected JPanel initNorthEastPane(final ToolBarMenuDock ad){
//hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor == null) {
processor = new DefaultTitlePlace();
}
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane());
}
});
return northEastPane;
}
protected DesignerFrame(ToolBarMenuDock ad) {
setName(DESIGNER_FRAME_NAME); setName(DESIGNER_FRAME_NAME);
this.ad = ad; this.ad = ad;
this.initTitleIcon(); this.initTitleIcon();
@ -182,9 +223,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
// the content pane // the content pane
basePane.setLayout(new BorderLayout()); basePane.setLayout(new BorderLayout());
menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
menuPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
menuPane.add(initNorthEastPane(ad), BorderLayout.EAST);
toolbarPane = new JPanel() { toolbarPane = new JPanel() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
@ -211,7 +250,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
centerPane.add(centerTemplateCardPane = new DesktopCardPane(), BorderLayout.CENTER); centerPane.add(centerTemplateCardPane = new DesktopCardPane(), BorderLayout.CENTER);
centerPane.add(toolbarPane, BorderLayout.NORTH); centerPane.add(toolbarPane, BorderLayout.NORTH);
basePane.add(menuPane, BorderLayout.NORTH);
basePane.add(centerPane, BorderLayout.CENTER); basePane.add(centerPane, BorderLayout.CENTER);
laoyoutWestPane(); laoyoutWestPane();
basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST); basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST);
@ -222,7 +261,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
// 调整Window大小 // 调整Window大小
modWindowBounds(); modWindowBounds();
this.resetToolkitByPlus(null);
// p:检查所有按钮的可见性和是否可以编辑性. // p:检查所有按钮的可见性和是否可以编辑性.
checkToolbarMenuEnable(); checkToolbarMenuEnable();
@ -256,22 +295,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png"));
} }
} }
private JPanel initNorthEastPane(final ToolBarMenuDock ad){
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor == null) {
processor = new DefaultTitlePlace();
}
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane());
}
});
return northEastPane;
}
private void addWindowListeners(ArrayList<WindowListener> listeners){ private void addWindowListeners(ArrayList<WindowListener> listeners){
for(WindowListener listener : listeners){ for(WindowListener listener : listeners){

2
designer_base/src/com/fr/start/BaseDesigner.java

@ -148,7 +148,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
} }
protected DesignerFrame createDesignerFrame() { protected DesignerFrame createDesignerFrame() {
return new DesignerFrame(this); return DesignerFrame.getNewInstance(this);
} }
protected int getStartPort() { protected int getStartPort() {

Loading…
Cancel
Save