|
|
@ -63,6 +63,7 @@ import com.fr.start.OemHandler; |
|
|
|
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.WorkspaceConnectionInfo; |
|
|
|
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
|
|
|
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.Icon; |
|
|
|
import javax.swing.Icon; |
|
|
|
import javax.swing.JComponent; |
|
|
|
import javax.swing.JComponent; |
|
|
@ -169,6 +170,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
|
|
|
|
|
|
|
|
private WindowAdapter windowAdapter = new WindowAdapter() { |
|
|
|
private WindowAdapter windowAdapter = new WindowAdapter() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void windowOpened(WindowEvent e) { |
|
|
|
public void windowOpened(WindowEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -194,6 +196,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
|
|
|
|
|
|
|
|
private JComponent closeButton = new JComponent() { |
|
|
|
private JComponent closeButton = new JComponent() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
protected void paintComponent(Graphics g) { |
|
|
|
protected void paintComponent(Graphics g) { |
|
|
|
|
|
|
|
|
|
|
|
g.setColor(UIConstants.NORMAL_BACKGROUND); |
|
|
|
g.setColor(UIConstants.NORMAL_BACKGROUND); |
|
|
@ -205,6 +208,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
|
|
|
|
|
|
|
|
private MouseListener closeMouseListener = new MouseAdapter() { |
|
|
|
private MouseListener closeMouseListener = new MouseAdapter() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
closeMode = UIConstants.CLOSE_PRESS_AUTHORITY; |
|
|
|
closeMode = UIConstants.CLOSE_PRESS_AUTHORITY; |
|
|
@ -212,6 +216,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
closeButton.repaint(); |
|
|
|
closeButton.repaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
closeMode = UIConstants.CLOSE_OF_AUTHORITY; |
|
|
|
closeMode = UIConstants.CLOSE_OF_AUTHORITY; |
|
|
@ -219,6 +224,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
closeButton.repaint(); |
|
|
|
closeButton.repaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void mouseMoved(MouseEvent e) { |
|
|
|
public void mouseMoved(MouseEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
closeMode = UIConstants.CLOSE_OVER_AUTHORITY; |
|
|
|
closeMode = UIConstants.CLOSE_OVER_AUTHORITY; |
|
|
@ -226,12 +232,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
closeButton.repaint(); |
|
|
|
closeButton.repaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void mouseReleased(MouseEvent e) { |
|
|
|
public void mouseReleased(MouseEvent e) { |
|
|
|
if (DesignModeContext.isAuthorityEditing()) { |
|
|
|
if (DesignModeContext.isAuthorityEditing()) { |
|
|
|
closeAuthorityEditing(); |
|
|
|
closeAuthorityEditing(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
closeMode = UIConstants.CLOSE_OVER_AUTHORITY; |
|
|
|
closeMode = UIConstants.CLOSE_OVER_AUTHORITY; |
|
|
@ -255,6 +263,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
basePane.setLayout(new BorderLayout()); |
|
|
|
basePane.setLayout(new BorderLayout()); |
|
|
|
toolbarPane = new JPanel() { |
|
|
|
toolbarPane = new JPanel() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Dimension getPreferredSize() { |
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
|
|
|
|
|
|
|
Dimension dim = super.getPreferredSize(); |
|
|
|
Dimension dim = super.getPreferredSize(); |
|
|
@ -266,7 +275,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
JPanel eastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel eastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
eastPane.add(ad.createLargeToolbar(), BorderLayout.WEST); |
|
|
|
eastPane.add(ad.createLargeToolbar(), BorderLayout.WEST); |
|
|
|
eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
eastCenterPane.add(combineUp = combineUpTooBar(null), BorderLayout.NORTH); |
|
|
|
combineUpTooBar(); |
|
|
|
|
|
|
|
eastCenterPane.add(combineUp, 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); |
|
|
@ -300,6 +310,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
|
|
|
|
|
|
|
|
this.addComponentListener(new ComponentAdapter() { |
|
|
|
this.addComponentListener(new ComponentAdapter() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void componentResized(ComponentEvent e) { |
|
|
|
public void componentResized(ComponentEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
reCalculateFrameSize(); |
|
|
|
reCalculateFrameSize(); |
|
|
@ -333,7 +344,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus()); |
|
|
|
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus()); |
|
|
|
needToAddAuhtorityPaint(); |
|
|
|
needToAddAuhtorityPaint(); |
|
|
|
refreshDottedLine(); |
|
|
|
refreshDottedLine(); |
|
|
|
fireAuthorityStateToNomal(); |
|
|
|
fireAuthorityStateToNormal(); |
|
|
|
EventDispatcher.fire(DesignAuthorityEventType.StopEdit, DesignerFrame.this); |
|
|
|
EventDispatcher.fire(DesignAuthorityEventType.StopEdit, DesignerFrame.this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -603,13 +614,13 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 退出权限编辑时,将所有的做过权限编辑的状态,作为一个状态赋给报、报表主体 |
|
|
|
* 退出权限编辑时,将所有的做过权限编辑的状态,作为一个状态赋给报、报表主体 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void fireAuthorityStateToNomal() { |
|
|
|
private void fireAuthorityStateToNormal() { |
|
|
|
|
|
|
|
|
|
|
|
java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); |
|
|
|
java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); |
|
|
|
for (int i = 0; i < opendedTemplate.size(); i++) { |
|
|
|
for (JTemplate<?, ?> jTemplate : opendedTemplate) { |
|
|
|
// 如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表
|
|
|
|
// 如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表
|
|
|
|
if (opendedTemplate.get(i).isDoSomethingInAuthority()) { |
|
|
|
if (jTemplate.isDoSomethingInAuthority()) { |
|
|
|
opendedTemplate.get(i).fireAuthorityStateToNomal(); |
|
|
|
jTemplate.fireAuthorityStateToNomal(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -619,31 +630,47 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
this.closeMode = closeMode; |
|
|
|
this.closeMode = closeMode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private UIToolbar combineUpTooBar(JComponent[] toolbar4Form) { |
|
|
|
/** |
|
|
|
|
|
|
|
* 创建上工具栏 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void combineUpTooBar() { |
|
|
|
combineUp = new UIToolbar(FlowLayout.LEFT); |
|
|
|
combineUp = new UIToolbar(FlowLayout.LEFT); |
|
|
|
combineUp.setBorder(new MatteBorder(new Insets(0, LEFT_ALIGN_GAP, 1, 0), UIConstants.LINE_COLOR)); |
|
|
|
combineUp.setBorder(new MatteBorder(new Insets(0, LEFT_ALIGN_GAP, 1, 0), UIConstants.LINE_COLOR)); |
|
|
|
combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 2)); |
|
|
|
combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 2)); |
|
|
|
|
|
|
|
setUpUpToolBar(null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 重置上工具栏 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void resetCombineUpTooBar(JComponent[] toolbar4Form) { |
|
|
|
|
|
|
|
combineUp.removeAll(); |
|
|
|
|
|
|
|
setUpUpToolBar(toolbar4Form); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 填充上工具栏的中的工具 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param toolbar4Form 目标组件 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void setUpUpToolBar(@Nullable JComponent[] toolbar4Form) { |
|
|
|
UIButton[] fixButtons = ad.createUp(); |
|
|
|
UIButton[] fixButtons = ad.createUp(); |
|
|
|
for (int i = 0; i < fixButtons.length; i++) { |
|
|
|
for (UIButton fixButton : fixButtons) { |
|
|
|
combineUp.add(fixButtons[i]); |
|
|
|
combineUp.add(fixButton); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!DesignerMode.isAuthorityEditing()) { |
|
|
|
if (!DesignerMode.isAuthorityEditing()) { |
|
|
|
combineUp.addSeparator(new Dimension(2, 16)); |
|
|
|
combineUp.addSeparator(new Dimension(2, 16)); |
|
|
|
if (toolbar4Form != null) { |
|
|
|
if (toolbar4Form != null) { |
|
|
|
for (int i = 0; i < toolbar4Form.length; i++) { |
|
|
|
for (JComponent jComponent : toolbar4Form) { |
|
|
|
combineUp.add(toolbar4Form[i]); |
|
|
|
combineUp.add(jComponent); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//添加分享按钮
|
|
|
|
//添加分享按钮
|
|
|
|
addShareButton(); |
|
|
|
addShareButton(); |
|
|
|
|
|
|
|
|
|
|
|
//添加插件中的按钮
|
|
|
|
//添加插件中的按钮
|
|
|
|
addExtraButtons(); |
|
|
|
addExtraButtons(); |
|
|
|
|
|
|
|
|
|
|
|
return combineUp; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void addExtraButtons() { |
|
|
|
private void addExtraButtons() { |
|
|
@ -655,8 +682,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UIButton[] extraButtons = jt.createExtraButtons(); |
|
|
|
UIButton[] extraButtons = jt.createExtraButtons(); |
|
|
|
for (int i = 0; i < extraButtons.length; i++) { |
|
|
|
for (UIButton extraButton : extraButtons) { |
|
|
|
combineUp.add(extraButtons[i]); |
|
|
|
combineUp.add(extraButton); |
|
|
|
} |
|
|
|
} |
|
|
|
if (extraButtons.length > 0) { |
|
|
|
if (extraButtons.length > 0) { |
|
|
|
combineUp.addSeparator(new Dimension(2, 16)); |
|
|
|
combineUp.addSeparator(new Dimension(2, 16)); |
|
|
@ -672,8 +699,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
|
|
|
|
|
|
|
|
combineUp.addSeparator(new Dimension(2, 16)); |
|
|
|
combineUp.addSeparator(new Dimension(2, 16)); |
|
|
|
UIButton[] shareButtons = jt.createShareButton(); |
|
|
|
UIButton[] shareButtons = jt.createShareButton(); |
|
|
|
for (int i = 0; i < shareButtons.length; i++) { |
|
|
|
for (UIButton shareButton : shareButtons) { |
|
|
|
combineUp.add(shareButtons[i]); |
|
|
|
combineUp.add(shareButton); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -710,25 +737,20 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
|
|
|
|
|
|
|
|
DesignState designState = new DesignState(plus); |
|
|
|
DesignState designState = new DesignState(plus); |
|
|
|
MenuManager.getInstance().setMenus4Designer(designState); |
|
|
|
MenuManager.getInstance().setMenus4Designer(designState); |
|
|
|
if (menuBar != null) { |
|
|
|
if (menuBar == null) { |
|
|
|
menuPane.remove(menuBar); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
menuPane.add(menuBar = ad.createJMenuBar(plus), BorderLayout.CENTER); |
|
|
|
menuPane.add(menuBar = ad.createJMenuBar(plus), BorderLayout.CENTER); |
|
|
|
|
|
|
|
} else { |
|
|
|
if (combineUp != null) { |
|
|
|
ad.resetJMenuBar(menuBar, plus); |
|
|
|
eastCenterPane.remove(combineUp); |
|
|
|
|
|
|
|
combineUp = null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 保存撤销那些按钮的面板
|
|
|
|
resetCombineUpTooBar(ad.resetUpToolBar(plus)); |
|
|
|
eastCenterPane.add(combineUp = combineUpTooBar(ad.resetUpToolBar(plus)), BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (toolbarComponent != null) { |
|
|
|
|
|
|
|
toolbarPane.remove(toolbarComponent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 颜色,字体那些按钮的工具栏
|
|
|
|
// 颜色,字体那些按钮的工具栏
|
|
|
|
toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER); |
|
|
|
if (toolbarComponent == null) { |
|
|
|
|
|
|
|
toolbarPane.add(toolbarComponent = ad.resetToolBar(null, plus), BorderLayout.CENTER); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
ad.resetToolBar(toolbarComponent, plus); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.checkToolbarMenuEnable(); |
|
|
|
this.checkToolbarMenuEnable(); |
|
|
|
this.validate(); |
|
|
|
this.validate(); |
|
|
@ -751,7 +773,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
Set<ShortCut> extraShortCuts = ExtraDesignClassManager.getInstance().getExtraShortCuts(); |
|
|
|
Set<ShortCut> extraShortCuts = ExtraDesignClassManager.getInstance().getExtraShortCuts(); |
|
|
|
for (ShortCut shortCut : extraShortCuts) { |
|
|
|
for (ShortCut shortCut : extraShortCuts) { |
|
|
|
if (shortCut instanceof AbstractTemplateTreeShortCutProvider) { |
|
|
|
if (shortCut instanceof AbstractTemplateTreeShortCutProvider) { |
|
|
|
((AbstractTemplateTreeShortCutProvider) shortCut).notifyFromAuhtorityChange(DesignerMode.isAuthorityEditing()); |
|
|
|
shortCut.notifyFromAuhtorityChange(DesignerMode.isAuthorityEditing()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -949,6 +971,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
* |
|
|
|
* |
|
|
|
* @param e 事件 |
|
|
|
* @param e 事件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
public void targetModified(TargetModifiedEvent e) { |
|
|
|
public void targetModified(TargetModifiedEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
this.checkToolbarMenuEnable(); |
|
|
|
this.checkToolbarMenuEnable(); |
|
|
@ -959,6 +982,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
* |
|
|
|
* |
|
|
|
* @param jt 模板 |
|
|
|
* @param jt 模板 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
public void templateClosed(JTemplate<?, ?> jt) { |
|
|
|
public void templateClosed(JTemplate<?, ?> jt) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -968,6 +992,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
* |
|
|
|
* |
|
|
|
* @param jt 模板 |
|
|
|
* @param jt 模板 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
public void templateOpened(JTemplate<?, ?> jt) { |
|
|
|
public void templateOpened(JTemplate<?, ?> jt) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -977,6 +1002,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
* |
|
|
|
* |
|
|
|
* @param jt 模板 |
|
|
|
* @param jt 模板 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
public void templateSaved(JTemplate<?, ?> jt) { |
|
|
|
public void templateSaved(JTemplate<?, ?> jt) { |
|
|
|
|
|
|
|
|
|
|
|
this.checkToolbarMenuEnable(); |
|
|
|
this.checkToolbarMenuEnable(); |
|
|
|