You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
8 years ago
|
package com.fr.aspectj.designerbase;
|
||
|
|
||
8 years ago
|
import com.fr.design.DesignerEnvManager;
|
||
8 years ago
|
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
|
||
8 years ago
|
import com.fr.design.actions.help.alphafine.RemindDialog;
|
||
8 years ago
|
import com.fr.design.mainframe.DesignerContext;
|
||
|
|
||
8 years ago
|
import java.awt.event.ActionEvent;
|
||
|
|
||
|
/**
|
||
|
* Created by XiaXiang on 2017/5/25.
|
||
|
*/
|
||
|
public aspect AlphaFineReminder {
|
||
|
pointcut onActionPerformed(ActionEvent e) :
|
||
|
execution(* actionPerformed(ActionEvent)) && args(e);
|
||
|
|
||
|
before(ActionEvent e) : onActionPerformed(e) {
|
||
|
String point = thisJoinPoint.toString();
|
||
|
if (e != null && e.getSource().toString().contains("javax.swing.Timer")) {
|
||
|
return;
|
||
|
}
|
||
|
if (e != null && e.getSource().getClass().getName().equals("com.fr.design.gui.imenu.UIMenuItem") && point.contains("com.fr.design.actions")) {
|
||
8 years ago
|
remind();
|
||
8 years ago
|
}
|
||
|
|
||
|
|
||
|
}
|
||
8 years ago
|
|
||
|
/**
|
||
|
* 判断是否弹出广告框
|
||
|
*/
|
||
|
private static void remind() {
|
||
8 years ago
|
AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
|
||
8 years ago
|
|
||
|
if (manager.isNeedRemind()) {
|
||
|
if (manager.getOperateCount() > 4) {
|
||
|
showReminderDialog();
|
||
|
} else {
|
||
|
manager.setOperateCount(manager.getOperateCount() + 1);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 弹框提醒使用AlphaFine
|
||
|
*/
|
||
|
private static void showReminderDialog() {
|
||
|
RemindDialog remindDialog = new RemindDialog(DesignerContext.getDesignerFrame());
|
||
|
remindDialog.setVisible(true);
|
||
|
}
|
||
|
|
||
|
|
||
8 years ago
|
}
|