Browse Source

alphafine 广告

master
XiaXiang 8 years ago
parent
commit
d5d7349d1b
  1. 7
      designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  2. 17
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  3. 4
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java
  4. 3
      designer_base/src/com/fr/design/actions/help/alphafine/RemindPane.java

7
designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

@ -8,12 +8,15 @@ import com.fr.stable.StringUtils;
* Created by XiaXiang on 2017/5/8.
*/
public class AlphaFineHelper {
private static AlphaFineDialog dialog;
/**
* 弹出alphafine搜索面板
*/
public static void showAlphaFineDialog() {
AlphaFineDialog dialog = new AlphaFineDialog(DesignerContext.getDesignerFrame());
public static void showAlphaFineDialog(boolean forceOpen) {
if (dialog == null) {
dialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen);
}
dialog.setVisible(true);
}

17
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -67,8 +67,10 @@ public class AlphaFineDialog extends UIDialog {
private JList searchResultList;
private SearchListModel searchListModel;
private SwingWorker searchWorker;
//是否强制打开,因为面板是否dispose绑定了全局鼠标事件,这里需要处理一下
private boolean foreOpen;
public AlphaFineDialog(Frame parent) {
public AlphaFineDialog(Frame parent, boolean foreOpen) {
super(parent);
initProperties();
initListener();
@ -485,9 +487,9 @@ public class AlphaFineDialog extends UIDialog {
Point p = k.getLocationOnScreen();
Rectangle dialogRectangle = AlphaFineDialog.this.getBounds();
Rectangle paneRectangle = new Rectangle(AlphaFinePane.createAlphaFinePane().getLocationOnScreen(), AlphaFinePane.createAlphaFinePane().getSize());
if (!dialogRectangle.contains(p) && !paneRectangle.contains(p)) {
if (!dialogRectangle.contains(p) && !paneRectangle.contains(p) && !foreOpen) {
AlphaFineDialog.this.dispose();
System.out.print(p + "\n");
foreOpen = false;
}
}
}
@ -518,7 +520,7 @@ public class AlphaFineDialog extends UIDialog {
}
private static void doClickAction() {
AlphaFineHelper.showAlphaFineDialog();
AlphaFineHelper.showAlphaFineDialog(false);
}
@ -667,4 +669,11 @@ public class AlphaFineDialog extends UIDialog {
}
public boolean isForeOpen() {
return foreOpen;
}
public void setForeOpen(boolean foreOpen) {
this.foreOpen = foreOpen;
}
}

4
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java

@ -39,13 +39,13 @@ public class AlphaFinePane extends BasicPane {
refreshButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
AlphaFineHelper.showAlphaFineDialog();
AlphaFineHelper.showAlphaFineDialog(false);
}
});
AlphafineContext.addAlphafineContextListener(new AlphafineListener() {
@Override
public void showDialog() {
AlphaFineHelper.showAlphaFineDialog();
AlphaFineHelper.showAlphaFineDialog(true);
}
});
}

3
designer_base/src/com/fr/design/actions/help/alphafine/RemindPane.java

@ -46,10 +46,9 @@ public class RemindPane extends JPanel {
openButton.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
System.out.print(e.getLocationOnScreen() + "\n");
//manager.setOperateCount(0);
dialog.dispose();
AlphafineContext.fireAlphaFineContextListener();
}
});
backgroundLabel = new UILabel(Inter.getLocText("FR-Designer-Alphafine_No_Remind"));

Loading…
Cancel
Save