Browse Source

Merge pull request #468 in BA/design from ~ZACK/design:dev to dev

* commit '9d8b573195c040ad5638993e9f4240f0afaeee11':
  d
  无JIRA任务 组件共享的帮助信息改变交互
master
superman 8 years ago
parent
commit
a65354f9a3
  1. 7
      designer_base/src/com/fr/design/mainframe/HelpDialogManager.java
  2. 6
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  3. 42
      designer_form/src/com/fr/design/mainframe/CoverReportPane.java
  4. 10
      designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java

7
designer_base/src/com/fr/design/mainframe/HelpDialogManager.java

@ -35,11 +35,4 @@ public class HelpDialogManager {
}
return THIS;
}
public void destroyDialog() {
if (handler != null) {
handler.destroyHelpDialog();
}
handler = null;
}
}

6
designer_form/src/com/fr/design/designer/creator/XElementCase.java

@ -282,12 +282,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
* @param e 点击事件
*/
public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){
HelpDialogManager.getInstance().setPane(coverPanel);
super.respondClick(editingMouseListener, e);
if (this.isHelpBtnOnFocus()) {
coverPanel.setMsgDisplay(e);
}else {
coverPanel.destroyHelpDialog();
switchTab(e,editingMouseListener);
} else {
switchTab(e, editingMouseListener);
}
}

42
designer_form/src/com/fr/design/mainframe/CoverReportPane.java

@ -1,8 +1,6 @@
package com.fr.design.mainframe;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.icon.IconPathConstants;
import com.fr.form.share.ShareConstants;
@ -13,6 +11,8 @@ import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
/**
* 报表块的封面如果后面所有的组件都有帮助信息的话就抽接口吧
@ -43,18 +43,6 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{
public CoverReportPane(String helpMsg) {
super();
this.helpMsg = helpMsg;
add(controlButton);
// if (WidgetPropertyPane.getInstance().getEditingFormDesigner() != null) {
// WidgetPropertyPane.getInstance().getEditingFormDesigner().addDesignerEditListener(new DesignerEditListener() {
// @Override
// public void fireCreatorModified(DesignerEvent evt) {
// if (evt.getCreatorEventID() == (DesignerEvent.CREATOR_DELETED)
// || evt.getCreatorEventID() == (DesignerEvent.CREATOR_RESIZED)) {
// destroyHelpDialog();
// }
// }
// });
// }
}
public String getHelpMsg() {
@ -63,12 +51,16 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{
public void setHelpMsg(String helpMsg) {
this.helpMsg = helpMsg;
//帮助信息为空就不显示帮助按钮
if (StringUtils.isNotEmpty(helpMsg)) {
add(controlButton);
}
}
public void setMsgDisplay(MouseEvent e) {
if (helpDialog == null) {
controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_CLOSE_ICON_PATH);
controlButton.repaint();
// controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_CLOSE_ICON_PATH);
controlButton.setVisible(false);
helpDialog = new ElementCaseHelpDialog(DesignerContext.getDesignerFrame(), helpMsg);
double screenValue = FRScreen.getByDimension(Toolkit.getDefaultToolkit().getScreenSize()).getValue();
int offsetX = 0;
@ -80,12 +72,14 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{
int rY = 165 + e.getY();//165是设计器最上面几个面板的高度
helpDialog.setLocationRelativeTo(DesignerContext.getDesignerFrame(), rX, rY);
helpDialog.showWindow();
HelpDialogManager.getInstance().setPane(this);
} else {
controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_HELP_ICON_PATH);
controlButton.repaint();
helpDialog.dispose();
helpDialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
helpDialog = null;
controlButton.setVisible(true);
}
});
HelpDialogManager.getInstance().setPane(this);
}
}
@ -135,8 +129,8 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{
@Override
public void setVisible(boolean aFlag) {
super.setVisible(aFlag);
if (aFlag) {
HelpDialogManager.getInstance().setPane(this);
}
// if (aFlag) {
// HelpDialogManager.getInstance().setPane(this);
// }
}
}

10
designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe;
import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
@ -15,7 +16,7 @@ import java.awt.*;
public class ElementCaseHelpDialog extends UIDialog {
private static final int OUTER_WIDTH = 190;
private static final int OUTER_HEIGHT = 120;
private static final int OUTER_HEIGHT = 280;
private String helpMsg;
@ -25,7 +26,6 @@ public class ElementCaseHelpDialog extends UIDialog {
public ElementCaseHelpDialog(Frame parent, String helpMsg) {
super(parent);
this.helpMsg = helpMsg;
setUndecorated(true);
initHelpArea();
JPanel panel = (JPanel) getContentPane();
initComponents(panel);
@ -37,21 +37,23 @@ public class ElementCaseHelpDialog extends UIDialog {
textArea.setEditable(false);
textArea.setBorder(null);
helpArea = new UIScrollPane(textArea);
helpArea.setBounds(0, 0, 190, 120);
helpArea.setBounds(0, 0, OUTER_WIDTH, OUTER_HEIGHT);
helpArea.setBorder(null);
}
private void initComponents(JPanel contentPane) {
contentPane.setLayout(new BorderLayout());
add(helpArea, BorderLayout.CENTER);
this.applyClosingAction();
this.setTitle(Inter.getLocText("FR-Designer_Help"));
}
/**
* 打开帮助框
*/
public void showWindow() {
setVisible(true);
this.setResizable(false);
setVisible(true);
}
/**

Loading…
Cancel
Save