Browse Source

Merge pull request #324 in BA/design from ~HUGH_FINEREPORT.COM/design:master to master

* commit 'd3be97ae904da93c6b69d176ab284167d3fe5c24':
  更正修改
  为了方便OEM设计器右上的工具栏做一些修改
  修改新增一些方法便于OEM
master
superman 8 years ago
parent
commit
17ff8e3e8c
  1. 59
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java

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

@ -168,24 +168,48 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} }
/** /**
* Constructor. * 初始menuPane的方法 方便OEM时修改该组件
* @param ad
*/ */
protected void initMenuPane(){
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);
}
/**
* @param ad
* @return
*/
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;
}
public DesignerFrame(ToolBarMenuDock ad) { public DesignerFrame(ToolBarMenuDock ad) {
setName(DESIGNER_FRAME_NAME); setName(DESIGNER_FRAME_NAME);
this.ad = ad; this.ad = ad;
this.initTitleIcon(); this.initTitleIcon();
this.setTitle();// james:因为有默认的了 this.setTitle();// james:因为有默认的了
// set this to context. // set this to context.
DesignerContext.setDesignerFrame(this); DesignerContext.setDesignerFrame(this);
// 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() {
Dimension dim = super.getPreferredSize(); Dimension dim = super.getPreferredSize();
@ -211,7 +235,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 +246,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
// 调整Window大小 // 调整Window大小
modWindowBounds(); modWindowBounds();
this.resetToolkitByPlus(null);
// p:检查所有按钮的可见性和是否可以编辑性. // p:检查所有按钮的可见性和是否可以编辑性.
checkToolbarMenuEnable(); checkToolbarMenuEnable();
@ -243,6 +267,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.setExtendedState(JFrame.MAXIMIZED_BOTH); this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setDropTarget(new DropTarget(this, DnDConstants.ACTION_MOVE, new FileDropTargetListener(), true)); this.setDropTarget(new DropTarget(this, DnDConstants.ACTION_MOVE, new FileDropTargetListener(), true));
closeMode = UIConstants.CLOSE_OF_AUTHORITY; closeMode = UIConstants.CLOSE_OF_AUTHORITY;
initMenuPane();
} }
public void initTitleIcon() { public void initTitleIcon() {
@ -257,22 +282,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} }
} }
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){
this.addWindowListener(listener); this.addWindowListener(listener);

Loading…
Cancel
Save