|
|
@ -22,7 +22,6 @@ import com.fr.design.gui.imenu.UIMenuHighLight; |
|
|
|
import com.fr.design.gui.iscrollbar.UIScrollBar; |
|
|
|
import com.fr.design.gui.iscrollbar.UIScrollBar; |
|
|
|
import com.fr.design.gui.itoolbar.UIToolbar; |
|
|
|
import com.fr.design.gui.itoolbar.UIToolbar; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.mainframe.hold.DefaultTitlePlace; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.loghandler.LogMessageBar; |
|
|
|
import com.fr.design.mainframe.loghandler.LogMessageBar; |
|
|
|
import com.fr.design.mainframe.toolbar.ToolBarMenuDock; |
|
|
|
import com.fr.design.mainframe.toolbar.ToolBarMenuDock; |
|
|
|
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; |
|
|
|
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; |
|
|
@ -37,6 +36,7 @@ import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
import com.fr.general.env.EnvContext; |
|
|
|
import com.fr.plugin.context.PluginContext; |
|
|
|
import com.fr.plugin.context.PluginContext; |
|
|
|
import com.fr.plugin.injectable.PluginModule; |
|
|
|
import com.fr.plugin.injectable.PluginModule; |
|
|
|
import com.fr.plugin.manage.PluginFilter; |
|
|
|
import com.fr.plugin.manage.PluginFilter; |
|
|
@ -65,15 +65,13 @@ import java.util.List; |
|
|
|
import java.util.logging.Level; |
|
|
|
import java.util.logging.Level; |
|
|
|
|
|
|
|
|
|
|
|
public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener { |
|
|
|
public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener { |
|
|
|
|
|
|
|
public static final String DESIGNER_FRAME_NAME = "designer_frame"; |
|
|
|
|
|
|
|
public static final Dimension MIN_SIZE = new Dimension(100, 100); |
|
|
|
private static final long serialVersionUID = -8732559571067484460L; |
|
|
|
private static final long serialVersionUID = -8732559571067484460L; |
|
|
|
private static final int LEFT_ALIGN_GAP = -5; |
|
|
|
private static final int LEFT_ALIGN_GAP = -5; |
|
|
|
private static final int MENU_HEIGHT = 26; |
|
|
|
private static final int MENU_HEIGHT = 26; |
|
|
|
private static final Integer SECOND_LAYER = new Integer(100); |
|
|
|
private static final Integer SECOND_LAYER = new Integer(100); |
|
|
|
private static final Integer TOP_LAYER = new Integer((200)); |
|
|
|
private static final Integer TOP_LAYER = new Integer((200)); |
|
|
|
|
|
|
|
|
|
|
|
public static final String DESIGNER_FRAME_NAME = "designer_frame"; |
|
|
|
|
|
|
|
public static final Dimension MIN_SIZE = new Dimension(100, 100); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static java.util.List<App<?>> appList = new java.util.ArrayList<App<?>>(); |
|
|
|
private static java.util.List<App<?>> appList = new java.util.ArrayList<App<?>>(); |
|
|
|
|
|
|
|
|
|
|
|
private ToolBarMenuDock ad; |
|
|
|
private ToolBarMenuDock ad; |
|
|
@ -140,81 +138,45 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
private MouseListener closeMouseListener = new MouseAdapter() { |
|
|
|
* 注册app. |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
* |
|
|
|
closeMode = UIConstants.CLOSE_PRESS_AUTHORITY; |
|
|
|
* @param app |
|
|
|
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); |
|
|
|
* 注册app. |
|
|
|
closeButton.repaint(); |
|
|
|
*/ |
|
|
|
|
|
|
|
public static void registApp(App<?> app) { |
|
|
|
|
|
|
|
if (app != null) { |
|
|
|
|
|
|
|
appList.add(app); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void removeApp(App<?> app) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (app != null) { |
|
|
|
|
|
|
|
appList.remove(app); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected DesktopCardPane getCenterTemplateCardPane() { |
|
|
|
|
|
|
|
return centerTemplateCardPane; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
* 初始menuPane的方法 方便OEM时修改该组件 |
|
|
|
closeMode = UIConstants.CLOSE_OF_AUTHORITY; |
|
|
|
*/ |
|
|
|
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); |
|
|
|
protected void initMenuPane(){ |
|
|
|
closeButton.repaint(); |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
public void mouseMoved(MouseEvent e) { |
|
|
|
* @param ad |
|
|
|
closeMode = UIConstants.CLOSE_OVER_AUTHORITY; |
|
|
|
* @return |
|
|
|
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); |
|
|
|
*/ |
|
|
|
closeButton.repaint(); |
|
|
|
protected JPanel initNorthEastPane(final ToolBarMenuDock ad) { |
|
|
|
|
|
|
|
//hugh: private修改为protected方便oem的时候修改右上的组件构成
|
|
|
|
|
|
|
|
//顶部日志+登陆按钮
|
|
|
|
|
|
|
|
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
|
|
|
//优先级为-1,保证最后全面刷新一次
|
|
|
|
|
|
|
|
GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void on(PluginEvent event) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
refreshNorthEastPane(northEastPane, ad); |
|
|
|
|
|
|
|
DesignUtils.refreshDesignerFrame(FRContext.getCurrentEnv()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, new PluginFilter() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void mouseReleased(MouseEvent e) { |
|
|
|
public boolean accept(PluginContext context) { |
|
|
|
if (BaseUtils.isAuthorityEditing()) { |
|
|
|
|
|
|
|
BaseUtils.setAuthorityEditing(false); |
|
|
|
return context.contain(PluginModule.ExtraDesign); |
|
|
|
WestRegionContainerPane.getInstance().replaceDownPane( |
|
|
|
|
|
|
|
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); |
|
|
|
|
|
|
|
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); |
|
|
|
|
|
|
|
DesignerContext.getDesignerFrame().resetToolkitByPlus( |
|
|
|
|
|
|
|
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus()); |
|
|
|
|
|
|
|
needToAddAuhtorityPaint(); |
|
|
|
|
|
|
|
refreshDottedLine(); |
|
|
|
|
|
|
|
fireAuthorityStateToNomal(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
refreshNorthEastPane(northEastPane, ad); |
|
|
|
|
|
|
|
return northEastPane; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void refreshNorthEastPane(JPanel northEastPane, ToolBarMenuDock ad) { |
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
|
|
|
|
closeMode = UIConstants.CLOSE_OVER_AUTHORITY; |
|
|
|
northEastPane.removeAll(); |
|
|
|
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); |
|
|
|
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING); |
|
|
|
closeButton.repaint(); |
|
|
|
if (processor == null) { |
|
|
|
|
|
|
|
processor = new DefaultTitlePlace(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane()); |
|
|
|
|
|
|
|
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { |
|
|
|
|
|
|
|
northEastPane.add(ad.createAlphafinePane(), BorderLayout.CENTER); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
public DesignerFrame(ToolBarMenuDock ad) { |
|
|
|
public DesignerFrame(ToolBarMenuDock ad) { |
|
|
|
|
|
|
|
|
|
|
@ -240,7 +202,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
eastCenterPane.add(combineUp = combineUpTooBar(null), BorderLayout.NORTH); |
|
|
|
eastCenterPane.add(combineUp = combineUpTooBar(null), BorderLayout.NORTH); |
|
|
|
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
panel.add(newWorkBookPane =ad.getNewTemplatePane(), BorderLayout.WEST); |
|
|
|
panel.add(newWorkBookPane = ad.getNewTemplatePane(), BorderLayout.WEST); |
|
|
|
panel.add(MutilTempalteTabPane.getInstance(), BorderLayout.CENTER); |
|
|
|
panel.add(MutilTempalteTabPane.getInstance(), BorderLayout.CENTER); |
|
|
|
eastCenterPane.add(panel, BorderLayout.CENTER); |
|
|
|
eastCenterPane.add(panel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
@ -255,11 +217,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
|
|
|
|
|
|
|
|
basePane.add(centerPane, BorderLayout.CENTER); |
|
|
|
basePane.add(centerPane, BorderLayout.CENTER); |
|
|
|
laoyoutWestPane(); |
|
|
|
laoyoutWestPane(); |
|
|
|
// JPanel eastRegionPane = new JPanel(new BorderLayout());
|
|
|
|
|
|
|
|
// eastRegionPane.add(EastRegionContainerPane.getInstance(), BorderLayout.CENTER);
|
|
|
|
|
|
|
|
// eastRegionPane.add(JSliderPane.getInstance(), BorderLayout.SOUTH);
|
|
|
|
|
|
|
|
// basePane.add(eastRegionPane, BorderLayout.EAST);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST); |
|
|
|
basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST); |
|
|
|
basePane.setBounds(0, 0, contentWidth, contentHeight); |
|
|
|
basePane.setBounds(0, 0, contentWidth, contentHeight); |
|
|
|
|
|
|
|
|
|
|
@ -269,7 +226,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
modWindowBounds(); |
|
|
|
modWindowBounds(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// p:检查所有按钮的可见性和是否可以编辑性.
|
|
|
|
// p:检查所有按钮的可见性和是否可以编辑性.
|
|
|
|
checkToolbarMenuEnable(); |
|
|
|
checkToolbarMenuEnable(); |
|
|
|
|
|
|
|
|
|
|
@ -292,6 +248,83 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
initMenuPane(); |
|
|
|
initMenuPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 注册app. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param app 注册app. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static void registApp(App<?> app) { |
|
|
|
|
|
|
|
if (app != null) { |
|
|
|
|
|
|
|
appList.add(app); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void removeApp(App<?> app) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (app != null) { |
|
|
|
|
|
|
|
appList.remove(app); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected DesktopCardPane getCenterTemplateCardPane() { |
|
|
|
|
|
|
|
return centerTemplateCardPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 初始menuPane的方法 方便OEM时修改该组件 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
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(); |
|
|
|
|
|
|
|
//优先级为-1,保证最后全面刷新一次
|
|
|
|
|
|
|
|
GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void on(PluginEvent event) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
refreshNorthEastPane(northEastPane, ad); |
|
|
|
|
|
|
|
DesignUtils.refreshDesignerFrame(FRContext.getCurrentEnv()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, new PluginFilter() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean accept(PluginContext context) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return context.contain(PluginModule.ExtraDesign); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
refreshNorthEastPane(northEastPane, ad); |
|
|
|
|
|
|
|
return northEastPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void refreshNorthEastPane(JPanel northEastPane, ToolBarMenuDock ad) { |
|
|
|
|
|
|
|
northEastPane.removeAll(); |
|
|
|
|
|
|
|
northEastPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0)); |
|
|
|
|
|
|
|
northEastPane.add(LogMessageBar.getInstance()); |
|
|
|
|
|
|
|
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING); |
|
|
|
|
|
|
|
if (processor != null) { |
|
|
|
|
|
|
|
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
northEastPane.add(ad.createAlphaFinePane()); |
|
|
|
|
|
|
|
if (!DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { |
|
|
|
|
|
|
|
ad.createAlphaFinePane().setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
northEastPane.add(ad.createBBSLoginPane()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void initTitleIcon() { |
|
|
|
public void initTitleIcon() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
@SuppressWarnings("unchecked") |
|
|
@ -304,20 +337,20 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected ArrayList<WindowListener> getFrameListeners(){ |
|
|
|
protected ArrayList<WindowListener> getFrameListeners() { |
|
|
|
ArrayList<WindowListener> arrayList = new ArrayList<WindowListener>(); |
|
|
|
ArrayList<WindowListener> arrayList = new ArrayList<WindowListener>(); |
|
|
|
arrayList.add(windowAdapter); |
|
|
|
arrayList.add(windowAdapter); |
|
|
|
return arrayList; |
|
|
|
return arrayList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void laoyoutWestPane(){ |
|
|
|
protected void laoyoutWestPane() { |
|
|
|
basePane.add(WestRegionContainerPane.getInstance(), BorderLayout.WEST); |
|
|
|
basePane.add(WestRegionContainerPane.getInstance(), BorderLayout.WEST); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -402,46 +435,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
addDottedLine(); |
|
|
|
addDottedLine(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private MouseListener closeMouseListener = new MouseAdapter() { |
|
|
|
|
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
|
|
|
closeMode = UIConstants.CLOSE_PRESS_AUTHORITY; |
|
|
|
|
|
|
|
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); |
|
|
|
|
|
|
|
closeButton.repaint(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
|
|
|
closeMode = UIConstants.CLOSE_OF_AUTHORITY; |
|
|
|
|
|
|
|
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); |
|
|
|
|
|
|
|
closeButton.repaint(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void mouseMoved(MouseEvent e) { |
|
|
|
|
|
|
|
closeMode = UIConstants.CLOSE_OVER_AUTHORITY; |
|
|
|
|
|
|
|
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); |
|
|
|
|
|
|
|
closeButton.repaint(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void mouseReleased(MouseEvent e) { |
|
|
|
|
|
|
|
if (BaseUtils.isAuthorityEditing()) { |
|
|
|
|
|
|
|
BaseUtils.setAuthorityEditing(false); |
|
|
|
|
|
|
|
WestRegionContainerPane.getInstance().replaceDownPane( |
|
|
|
|
|
|
|
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); |
|
|
|
|
|
|
|
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); |
|
|
|
|
|
|
|
DesignerContext.getDesignerFrame().resetToolkitByPlus( |
|
|
|
|
|
|
|
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus()); |
|
|
|
|
|
|
|
needToAddAuhtorityPaint(); |
|
|
|
|
|
|
|
refreshDottedLine(); |
|
|
|
|
|
|
|
fireAuthorityStateToNomal(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
|
|
|
|
closeMode = UIConstants.CLOSE_OVER_AUTHORITY; |
|
|
|
|
|
|
|
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); |
|
|
|
|
|
|
|
closeButton.repaint(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 刷新CloseButton |
|
|
|
* 刷新CloseButton |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -499,9 +492,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
return combineUp; |
|
|
|
return combineUp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void addExtraButtons(){ |
|
|
|
private void addExtraButtons() { |
|
|
|
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
if(jt == null){ |
|
|
|
if (jt == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -515,9 +508,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void addShareButton(){ |
|
|
|
private void addShareButton() { |
|
|
|
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
if(jt == null){ |
|
|
|
if (jt == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -531,10 +524,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 检查 |
|
|
|
* 检查 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param flag |
|
|
|
* @param flag 组件是否可见 |
|
|
|
* 组件是否可见 |
|
|
|
* @param al 组件名称 |
|
|
|
* @param al |
|
|
|
|
|
|
|
* 组件名称 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void checkCombineUp(boolean flag, ArrayList<String> al) { |
|
|
|
public void checkCombineUp(boolean flag, ArrayList<String> al) { |
|
|
|
combineUp.checkComponentsByNames(flag, al); |
|
|
|
combineUp.checkComponentsByNames(flag, al); |
|
|
@ -551,8 +542,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 重置相关的工具条. |
|
|
|
* 重置相关的工具条. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param plus |
|
|
|
* @param plus 工具条中相关信息 |
|
|
|
* 工具条中相关信息 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void resetToolkitByPlus(ToolBarMenuDockPlus plus) { |
|
|
|
public void resetToolkitByPlus(ToolBarMenuDockPlus plus) { |
|
|
|
if (plus == null) { |
|
|
|
if (plus == null) { |
|
|
@ -715,16 +705,16 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
editingTemplate.saveTemplate(); |
|
|
|
editingTemplate.saveTemplate(); |
|
|
|
FRLogger.getLogger().log( |
|
|
|
FRLogger.getLogger().log( |
|
|
|
Level.INFO, |
|
|
|
Level.INFO, |
|
|
|
Inter.getLocText(new String[] { "Template", "already-saved" }, new String[] { |
|
|
|
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(); |
|
|
|
FRLogger.getLogger().log( |
|
|
|
FRLogger.getLogger().log( |
|
|
|
Level.INFO, |
|
|
|
Level.INFO, |
|
|
|
Inter.getLocText(new String[] { "Template", "already-saved" }, new String[] { |
|
|
|
Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{ |
|
|
|
editingTemplate.getEditingFILE().getName(), "." })); |
|
|
|
editingTemplate.getEditingFILE().getName(), "."})); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -741,8 +731,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 添加 模板, 并激活. |
|
|
|
* 添加 模板, 并激活. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param jt |
|
|
|
* @param jt 添加的模板. |
|
|
|
* 添加的模板. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addAndActivateJTemplate(JTemplate<?, ?> jt) { |
|
|
|
public void addAndActivateJTemplate(JTemplate<?, ?> jt) { |
|
|
|
if (jt == null || jt.getEditingFILE() == null) { |
|
|
|
if (jt == null || jt.getEditingFILE() == null) { |
|
|
@ -758,8 +747,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 激活已经存在的模板 |
|
|
|
* 激活已经存在的模板 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param jt |
|
|
|
* @param jt 模板 |
|
|
|
* 模板 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void activateJTemplate(JTemplate<?, ?> jt) { |
|
|
|
public void activateJTemplate(JTemplate<?, ?> jt) { |
|
|
|
if (jt == null || jt.getEditingFILE() == null) { |
|
|
|
if (jt == null || jt.getEditingFILE() == null) { |
|
|
@ -773,8 +761,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 对象侦听 |
|
|
|
* 对象侦听 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param e |
|
|
|
* @param e 事件 |
|
|
|
* 事件 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void targetModified(TargetModifiedEvent e) { |
|
|
|
public void targetModified(TargetModifiedEvent e) { |
|
|
|
this.checkToolbarMenuEnable(); |
|
|
|
this.checkToolbarMenuEnable(); |
|
|
@ -783,8 +770,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 模板关闭时 处理. |
|
|
|
* 模板关闭时 处理. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param jt |
|
|
|
* @param jt 模板 |
|
|
|
* 模板 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void templateClosed(JTemplate<?, ?> jt) { |
|
|
|
public void templateClosed(JTemplate<?, ?> jt) { |
|
|
|
} |
|
|
|
} |
|
|
@ -792,8 +778,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 模板打开时 处理. |
|
|
|
* 模板打开时 处理. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param jt |
|
|
|
* @param jt 模板 |
|
|
|
* 模板 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void templateOpened(JTemplate<?, ?> jt) { |
|
|
|
public void templateOpened(JTemplate<?, ?> jt) { |
|
|
|
} |
|
|
|
} |
|
|
@ -801,8 +786,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 模板保存时 处理. |
|
|
|
* 模板保存时 处理. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param jt |
|
|
|
* @param jt 模板 |
|
|
|
* 模板 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void templateSaved(JTemplate<?, ?> jt) { |
|
|
|
public void templateSaved(JTemplate<?, ?> jt) { |
|
|
|
this.checkToolbarMenuEnable(); |
|
|
|
this.checkToolbarMenuEnable(); |
|
|
@ -811,8 +795,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 打开模板文件,如果是已经打开的就激活此模板所对应的JInternalFrame |
|
|
|
* 打开模板文件,如果是已经打开的就激活此模板所对应的JInternalFrame |
|
|
|
* |
|
|
|
* |
|
|
|
* @param tplFile |
|
|
|
* @param tplFile 文件 |
|
|
|
* 文件 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void openTemplate(FILE tplFile) { |
|
|
|
public void openTemplate(FILE tplFile) { |
|
|
|
// 测试连接,如果连接失败,则提示
|
|
|
|
// 测试连接,如果连接失败,则提示
|
|
|
@ -821,8 +804,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
&& !FRContext.getCurrentEnv().testServerConnectionWithOutShowMessagePane()) { |
|
|
|
&& !FRContext.getCurrentEnv().testServerConnectionWithOutShowMessagePane()) { |
|
|
|
JOptionPane.showMessageDialog( |
|
|
|
JOptionPane.showMessageDialog( |
|
|
|
DesignerContext.getDesignerFrame(), |
|
|
|
DesignerContext.getDesignerFrame(), |
|
|
|
Inter.getLocText(new String[] { "FR-Chart-Server_disconnected", "FR-Server-Design_template_unopened" }, new String[] { |
|
|
|
Inter.getLocText(new String[]{"FR-Chart-Server_disconnected", "FR-Server-Design_template_unopened"}, new String[]{ |
|
|
|
",", "!" }), Inter.getLocText("FR-Server-All_Error"), JOptionPane.ERROR_MESSAGE); |
|
|
|
",", "!"}), Inter.getLocText("FR-Server-All_Error"), JOptionPane.ERROR_MESSAGE); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
@ -849,12 +832,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否不合版本的设计器 |
|
|
|
* 是否不合版本的设计器 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param jt |
|
|
|
* @param jt 当前模板 |
|
|
|
* 当前模板 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return 是否不合版本 |
|
|
|
* @return 是否不合版本 |
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-10-14-下午6:30:37 |
|
|
|
* @date 2014-10-14-下午6:30:37 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean inValidDesigner(JTemplate jt) { |
|
|
|
private boolean inValidDesigner(JTemplate jt) { |
|
|
@ -864,10 +843,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 打开指定的文件 |
|
|
|
* 打开指定的文件 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param tplFile |
|
|
|
* @param tplFile 指定的文件 |
|
|
|
* 指定的文件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-10-14-下午6:31:05 |
|
|
|
* @date 2014-10-14-下午6:31:05 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void openFile(FILE tplFile) { |
|
|
|
private void openFile(FILE tplFile) { |
|
|
@ -913,17 +889,13 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 激活指定的模板 |
|
|
|
* 激活指定的模板 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param tplFile |
|
|
|
* @param tplFile 模板文件 |
|
|
|
* 模板文件 |
|
|
|
* @param jt 当前报表 |
|
|
|
* @param jt |
|
|
|
|
|
|
|
* 当前报表 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-10-14-下午6:31:23 |
|
|
|
* @date 2014-10-14-下午6:31:23 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void activeTemplate(FILE tplFile, JTemplate jt) { |
|
|
|
private void activeTemplate(FILE tplFile, JTemplate jt) { |
|
|
|
// 如果该模板已经打开,则进行激活就可以了
|
|
|
|
// 如果该模板已经打开,则进行激活就可以了
|
|
|
|
String fullName = StableUtils.pathJoin(new String[] { ProjectConstants.REPORTLETS_NAME, tplFile.getName() }); |
|
|
|
String fullName = StableUtils.pathJoin(new String[]{ProjectConstants.REPORTLETS_NAME, tplFile.getName()}); |
|
|
|
if (tplFile instanceof FileNodeFILE) { |
|
|
|
if (tplFile instanceof FileNodeFILE) { |
|
|
|
fullName = ((FileNodeFILE) tplFile).getEnvPath() + "/" + tplFile.getPath(); |
|
|
|
fullName = ((FileNodeFILE) tplFile).getEnvPath() + "/" + tplFile.getPath(); |
|
|
|
} |
|
|
|
} |
|
|
@ -931,7 +903,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
if (tplFile instanceof FileFILE) { |
|
|
|
if (tplFile instanceof FileFILE) { |
|
|
|
fullName = tplFile.getPath(); |
|
|
|
fullName = tplFile.getPath(); |
|
|
|
} |
|
|
|
} |
|
|
|
fullName = fullName.replaceAll("/", "\\\\"); |
|
|
|
fullName = OperatingSystem.isWindows() ? fullName.replaceAll("/", "\\\\") : fullName.replaceAll("\\\\", "/"); |
|
|
|
int index = HistoryTemplateListPane.getInstance().contains(fullName); |
|
|
|
int index = HistoryTemplateListPane.getInstance().contains(fullName); |
|
|
|
List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); |
|
|
|
List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); |
|
|
|
if (index != -1) { |
|
|
|
if (index != -1) { |
|
|
@ -939,7 +911,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.addAndActivateJTemplate(jt); |
|
|
|
this.addAndActivateJTemplate(jt); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//REPORT-5084:激活后刷新一下右側面板
|
|
|
|
|
|
|
|
jt.refreshEastPropertiesPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -976,8 +949,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
|
|
|
|
|
|
|
|
Env currentEnv = FRContext.getCurrentEnv(); |
|
|
|
Env currentEnv = FRContext.getCurrentEnv(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
EnvContext.fireBeforeSignOut(); |
|
|
|
currentEnv.signOut(); |
|
|
|
currentEnv.signOut(); |
|
|
|
GeneralContext.fireEnvSignOutListener(); |
|
|
|
EnvContext.fireAfterSignOut(); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
FRContext.getLogger().error(e.getMessage(), e); |
|
|
|
FRContext.getLogger().error(e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|