* commit 'f905d03d0e35146c784348f65715e202b8b23355': (41 commits) aspectJ编译 bug fix bug fix rt alphafine 广告 alphafine 广告弹框 bug fix bug fix alphafine 广告弹窗 PMD PMD PMD PMD REPORT-2773 mac中复制快捷键的修复 PMD PMD REPORT-2773 mac中复制快捷键的修复 REPORT-2773 mac中复制快捷键的修复 PMD 局部变量不行..还是改回去吧 ...master
Before Width: | Height: | Size: 369 B |
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 248 B |
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 369 B |
After Width: | Height: | Size: 237 B |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 185 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,69 @@
|
||||
|
||||
apply plugin: 'java' |
||||
tasks.withType(JavaCompile){ |
||||
options.encoding = 'UTF-8' |
||||
} |
||||
//指定构建的jdk版本 |
||||
sourceCompatibility=1.7 |
||||
//指定生成jar包版本 |
||||
version='8.0' |
||||
//生成jar包重命名 |
||||
jar{ |
||||
baseName='fr-designer-core' |
||||
} |
||||
|
||||
|
||||
def srcDir="." |
||||
def baseDir=".." |
||||
|
||||
//指定源码路径 |
||||
sourceSets{ |
||||
main{ |
||||
java{ |
||||
srcDirs=["${srcDir}/src"] |
||||
} |
||||
} |
||||
} |
||||
//获取什么分支名 |
||||
FileTree files =fileTree(dir:'./',include:'build.*.gradle') |
||||
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) |
||||
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) |
||||
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) |
||||
|
||||
//声明外部依赖 |
||||
dependencies{ |
||||
compile fileTree(dir:"../${baseDir}/lib",include:'**/*.jar') |
||||
compile fileTree(dir:"../${baseDir}",include:"**/build/libs/*.jar",exclude:"bi/**/*.jar") |
||||
testCompile 'junit:junit:4.12' |
||||
} |
||||
//复制非.java文件到classes文件夹下参与打包 |
||||
task copyFile(type:Copy,dependsOn:compileJava){ |
||||
copy{ |
||||
from ("${srcDir}/src"){ |
||||
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html' |
||||
} |
||||
into 'build/classes/main' |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
//压缩项目中的js文件 |
||||
task compressJS{ |
||||
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ |
||||
classpath { |
||||
fileset(dir:"../${baseDir}/lib4build",includes:'**/*.jar') |
||||
} |
||||
} |
||||
ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ |
||||
fileset (dir:"${srcDir}/src"){ |
||||
include (name:'**/*.js') |
||||
include (name:'**/*.css') |
||||
} |
||||
|
||||
} |
||||
} |
||||
jar.dependsOn compressJS |
||||
|
||||
|
||||
|
@ -0,0 +1,53 @@
|
||||
package com.fr.aspectj.designerbase; |
||||
|
||||
import com.fr.design.DesignerEnvManager; |
||||
import com.fr.design.actions.help.alphafine.AlphafineConfigManager; |
||||
import com.fr.design.actions.help.alphafine.RemindDialog; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
|
||||
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")) { |
||||
remind(); |
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
/** |
||||
* 判断是否弹出广告框 |
||||
*/ |
||||
private static void remind() { |
||||
AlphafineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphafineConfigManager(); |
||||
|
||||
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); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,21 @@
|
||||
package com.fr.common.inputevent; |
||||
|
||||
import com.fr.stable.OperatingSystem; |
||||
|
||||
import java.awt.event.KeyEvent; |
||||
import java.awt.event.MouseEvent; |
||||
|
||||
/** |
||||
* Created by hzzz on 2017/5/26. |
||||
*/ |
||||
public class InputEventBaseOnOS { |
||||
private static final boolean IS_MACOS = OperatingSystem.isMacOS(); |
||||
|
||||
public static boolean isControlDown(MouseEvent e) { |
||||
return IS_MACOS ? e.isMetaDown() : e.isControlDown(); |
||||
} |
||||
|
||||
public static boolean isControlDown(KeyEvent e) { |
||||
return IS_MACOS ? e.isMetaDown() : e.isControlDown(); |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.fr.design.actions.help.alphafine; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by XiaXiang on 2017/5/27. |
||||
*/ |
||||
public class AlphafineContext { |
||||
private static List<AlphafineListener> fireLoginContextListener = new ArrayList<AlphafineListener>(); |
||||
|
||||
/** |
||||
* 触发AlphaFine弹窗 |
||||
*/ |
||||
public static void fireAlphaFineContextListener() { |
||||
for (AlphafineListener l : fireLoginContextListener) { |
||||
l.showDialog(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 添加一个弹出AlphaFine的监听事件 |
||||
* |
||||
* @param l AlphaFine框弹出监听事件 |
||||
*/ |
||||
public static void addAlphafineContextListener(AlphafineListener l) { |
||||
fireLoginContextListener.add(l); |
||||
} |
||||
} |
@ -0,0 +1,8 @@
|
||||
package com.fr.design.actions.help.alphafine; |
||||
|
||||
/** |
||||
* Created by XiaXiang on 2017/5/27. |
||||
*/ |
||||
public interface AlphafineListener { |
||||
void showDialog(); |
||||
} |
@ -0,0 +1,43 @@
|
||||
package com.fr.design.actions.help.alphafine; |
||||
|
||||
import com.fr.design.DesignerEnvManager; |
||||
import com.fr.design.dialog.UIDialog; |
||||
import com.fr.design.utils.gui.GUICoreUtils; |
||||
|
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by XiaXiang on 2017/5/26. |
||||
*/ |
||||
public class RemindDialog extends UIDialog { |
||||
private RemindPane remindPane; |
||||
private static final int WIDTH = 600; |
||||
private static final int HEIGHT = 400; |
||||
public RemindDialog(Frame parent) { |
||||
super(parent); |
||||
setUndecorated(true); |
||||
setSize(WIDTH, HEIGHT); |
||||
initComponent(); |
||||
GUICoreUtils.centerWindow(this); |
||||
} |
||||
|
||||
private void initComponent() { |
||||
final AlphafineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphafineConfigManager(); |
||||
remindPane = new RemindPane(manager, this); |
||||
this.add(remindPane); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void checkValid() throws Exception { |
||||
|
||||
} |
||||
|
||||
public RemindPane getRemindPane() { |
||||
return remindPane; |
||||
} |
||||
|
||||
public void setRemindPane(RemindPane remindPane) { |
||||
this.remindPane = remindPane; |
||||
} |
||||
} |
@ -0,0 +1,146 @@
|
||||
package com.fr.design.actions.help.alphafine; |
||||
|
||||
import com.fr.design.dialog.UIDialog; |
||||
import com.fr.design.gui.ibutton.UIButton; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.general.IOUtils; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
import java.awt.event.MouseAdapter; |
||||
import java.awt.event.MouseEvent; |
||||
|
||||
/** |
||||
* Created by XiaXiang on 2017/5/26. |
||||
*/ |
||||
public class RemindPane extends JPanel { |
||||
|
||||
private UIButton openButton; |
||||
private JPanel backgroundPane; |
||||
private UILabel noRemindLabel; |
||||
private UILabel checkLabel; |
||||
private Icon checkIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/check.png"); |
||||
private Icon unCheckIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/uncheck.png"); |
||||
private Icon closeIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/remind_close.png"); |
||||
private Icon labelIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/remind.png"); |
||||
private Icon openIcon = IOUtils.readIcon("com/fr/design/mainframe/alphafine/images/open.png"); |
||||
|
||||
private static final int WIDTH = 600; |
||||
private static final int HEIGHT = 400; |
||||
private static final int CLOSE = 30; |
||||
|
||||
private static final Rectangle OPEN = new Rectangle(30, 300, 150, 40); |
||||
private static final Rectangle REMIND = new Rectangle(95, 350, 100, 20); |
||||
private static final Rectangle CHECK = new Rectangle(70, 350, 20, 20); |
||||
public static final Font MEDIUM_FONT = new Font("Song_TypeFace", 0, 12); |
||||
public static final Font LARGE_FONT = new Font("Song_TypeFace", 0, 18); |
||||
|
||||
public JComponent closeButton = new JComponent() { |
||||
protected void paintComponent(Graphics g) { |
||||
closeIcon.paintIcon(this, g, 0, 0); |
||||
} |
||||
}; |
||||
|
||||
public RemindPane(AlphafineConfigManager manager, UIDialog remindDialog) { |
||||
this.setPreferredSize(new Dimension(WIDTH, HEIGHT)); |
||||
initUI(manager, remindDialog); |
||||
this.setLayout(getAbsoluteLayout()); |
||||
} |
||||
|
||||
/** |
||||
* 初始化面板 |
||||
* @param manager |
||||
* @param dialog |
||||
*/ |
||||
private void initUI(final AlphafineConfigManager manager, final UIDialog dialog) { |
||||
|
||||
openButton = new UIButton(); |
||||
openButton.setIcon(openIcon); |
||||
openButton.set4ToolbarButton(); |
||||
openButton.addMouseListener(new MouseAdapter() { |
||||
@Override |
||||
public void mousePressed(MouseEvent e) { |
||||
manager.setOperateCount(0); |
||||
dialog.dispose(); |
||||
AlphafineContext.fireAlphaFineContextListener(); |
||||
|
||||
} |
||||
}); |
||||
noRemindLabel = new UILabel(Inter.getLocText("FR-Designer-Alphafine_No_Remind")); |
||||
noRemindLabel.setFont(MEDIUM_FONT); |
||||
noRemindLabel.setForeground(Color.white); |
||||
checkLabel = new UILabel(); |
||||
checkLabel.setIcon(unCheckIcon); |
||||
checkLabel.addMouseListener(new MouseAdapter() { |
||||
private boolean isCheck = false; |
||||
|
||||
@Override |
||||
public void mousePressed(MouseEvent e) { |
||||
if (isCheck) { |
||||
checkLabel.setIcon(unCheckIcon); |
||||
manager.setNeedRemind(true); |
||||
isCheck = false; |
||||
} else { |
||||
checkLabel.setIcon(checkIcon); |
||||
manager.setNeedRemind(false); |
||||
isCheck = true; |
||||
} |
||||
} |
||||
}); |
||||
backgroundPane = new JPanel(new BorderLayout()); |
||||
backgroundPane.add(new UILabel(labelIcon), BorderLayout.CENTER); |
||||
closeButton.addMouseListener(new MouseAdapter() { |
||||
@Override |
||||
public void mousePressed(MouseEvent e) { |
||||
manager.setOperateCount(0); |
||||
dialog.dispose(); |
||||
|
||||
} |
||||
}); |
||||
add(closeButton, 0); |
||||
add(checkLabel, 1); |
||||
add(openButton, 2); |
||||
add(noRemindLabel, 3); |
||||
add(backgroundPane, 4); |
||||
} |
||||
|
||||
/** |
||||
* 控件排列用绝对布局 |
||||
* @return |
||||
*/ |
||||
protected LayoutManager getAbsoluteLayout() { |
||||
return new LayoutManager() { |
||||
|
||||
@Override |
||||
public void removeLayoutComponent(Component comp) { |
||||
} |
||||
|
||||
@Override |
||||
public Dimension preferredLayoutSize(Container parent) { |
||||
return parent.getPreferredSize(); |
||||
} |
||||
|
||||
@Override |
||||
public Dimension minimumLayoutSize(Container parent) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void layoutContainer(Container parent) { |
||||
int width = parent.getWidth(); |
||||
int height = parent.getHeight(); |
||||
closeButton.setBounds((width - CLOSE), 0, CLOSE, CLOSE); |
||||
openButton.setBounds(OPEN); |
||||
noRemindLabel.setBounds(REMIND); |
||||
checkLabel.setBounds(CHECK); |
||||
backgroundPane.setBounds(0, 0, width, height); |
||||
} |
||||
|
||||
@Override |
||||
public void addLayoutComponent(String name, Component comp) { |
||||
} |
||||
}; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,58 @@
|
||||
package com.fr.design.mainframe.toolbar; |
||||
|
||||
import com.fr.design.actions.UpdateAction; |
||||
|
||||
/** |
||||
* Created by XiaXiang on 2017/5/24. |
||||
*/ |
||||
|
||||
/** |
||||
* action对象 |
||||
*/ |
||||
public class UpdateActionModel { |
||||
private String parentName; |
||||
private String actionName; |
||||
private UpdateAction action; |
||||
|
||||
public UpdateActionModel(String parentName, UpdateAction action) { |
||||
this.parentName = parentName; |
||||
this.action = action; |
||||
this.actionName = action.getName(); |
||||
} |
||||
|
||||
/** |
||||
* 获取上一层级菜单name |
||||
* @return |
||||
*/ |
||||
public String getParentName() { |
||||
return parentName; |
||||
} |
||||
|
||||
public void setParentName(String parentName) { |
||||
this.parentName = parentName; |
||||
} |
||||
|
||||
/** |
||||
* 获取action |
||||
* @return |
||||
*/ |
||||
public UpdateAction getAction() { |
||||
return action; |
||||
} |
||||
|
||||
public void setAction(UpdateAction action) { |
||||
this.action = action; |
||||
} |
||||
|
||||
/** |
||||
* 获取actionName |
||||
* @return |
||||
*/ |
||||
public String getActionName() { |
||||
return actionName; |
||||
} |
||||
|
||||
public void setActionName(String actionName) { |
||||
this.actionName = actionName; |
||||
} |
||||
} |
@ -0,0 +1,69 @@
|
||||
|
||||
apply plugin: 'java' |
||||
tasks.withType(JavaCompile){ |
||||
options.encoding = 'UTF-8' |
||||
} |
||||
//指定构建的jdk版本 |
||||
sourceCompatibility=1.7 |
||||
//指定生成jar包版本 |
||||
version='8.0' |
||||
//生成jar包重命名 |
||||
jar{ |
||||
baseName='fr-designer-chart' |
||||
} |
||||
|
||||
|
||||
def srcDir="." |
||||
def baseDir=".." |
||||
|
||||
//指定源码路径 |
||||
sourceSets{ |
||||
main{ |
||||
java{ |
||||
srcDirs=["${srcDir}/src"] |
||||
} |
||||
} |
||||
} |
||||
//获取什么分支名 |
||||
FileTree files =fileTree(dir:'./',include:'build.*.gradle') |
||||
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) |
||||
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) |
||||
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) |
||||
|
||||
//声明外部依赖 |
||||
dependencies{ |
||||
compile fileTree(dir:"../${baseDir}/lib",include:'**/*.jar') |
||||
compile fileTree(dir:"../${baseDir}",include:"**/build/libs/*.jar",exclude:"bi/**/*.jar") |
||||
testCompile 'junit:junit:4.12' |
||||
} |
||||
//复制非.java文件到classes文件夹下参与打包 |
||||
task copyFile(type:Copy,dependsOn:compileJava){ |
||||
copy{ |
||||
from ("${srcDir}/src"){ |
||||
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html' |
||||
} |
||||
into 'build/classes/main' |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
//压缩项目中的js文件 |
||||
task compressJS{ |
||||
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ |
||||
classpath { |
||||
fileset(dir:"../${baseDir}/lib4build",includes:'**/*.jar') |
||||
} |
||||
} |
||||
ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ |
||||
fileset (dir:"${srcDir}/src"){ |
||||
include (name:'**/*.js') |
||||
include (name:'**/*.css') |
||||
} |
||||
|
||||
} |
||||
} |
||||
jar.dependsOn compressJS |
||||
|
||||
|
||||
|
@ -0,0 +1,83 @@
|
||||
|
||||
apply plugin: 'java' |
||||
tasks.withType(JavaCompile){ |
||||
options.encoding = 'UTF-8' |
||||
} |
||||
//指定构建的jdk版本 |
||||
sourceCompatibility=1.7 |
||||
//指定生成jar包版本 |
||||
version='8.0' |
||||
//生成jar包重命名 |
||||
jar{ |
||||
baseName='fr-designer-report' |
||||
} |
||||
|
||||
|
||||
def srcDir="." |
||||
def baseDir=".." |
||||
|
||||
//指定源码路径 |
||||
sourceSets{ |
||||
main{ |
||||
java{ |
||||
srcDirs=["${srcDir}/src", |
||||
"${srcDir}/../designer/src"] |
||||
} |
||||
} |
||||
} |
||||
//获取什么分支名 |
||||
FileTree files =fileTree(dir:'./',include:'build.*.gradle') |
||||
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) |
||||
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) |
||||
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) |
||||
|
||||
//声明外部依赖 |
||||
dependencies{ |
||||
compile fileTree(dir:"../${baseDir}/lib",include:'**/*.jar') |
||||
compile fileTree(dir:"../${baseDir}",include:"**/build/libs/*.jar",exclude:"bi/**/*.jar") |
||||
testCompile 'junit:junit:4.12' |
||||
} |
||||
//复制非.java文件到classes文件夹下参与打包 |
||||
|
||||
//指明无法编译文件所在路径 |
||||
def dataContent ={def dir -> |
||||
copySpec{ |
||||
from ("${dir}"){ |
||||
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html' |
||||
} |
||||
} |
||||
} |
||||
|
||||
task copyFile(type:Copy,dependsOn:compileJava){ |
||||
copy{ |
||||
with dataContent.call("${srcDir}/src") |
||||
with dataContent.call("${srcDir}/../designer/src") |
||||
into 'build/classes/main' |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
//压缩项目中的js文件 |
||||
task compressJS{ |
||||
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ |
||||
classpath { |
||||
fileset(dir:"../${baseDir}/lib4build",includes:'**/*.jar') |
||||
} |
||||
} |
||||
ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ |
||||
fileset (dir:"${srcDir}/src"){ |
||||
include (name:'**/*.js') |
||||
include (name:'**/*.css') |
||||
} |
||||
fileset (dir:"${srcDir}/../designer/src"){ |
||||
include (name:'**/*.js') |
||||
include (name:'**/*.css') |
||||
} |
||||
|
||||
} |
||||
} |
||||
jar.dependsOn compressJS |
||||
|
||||
|
||||
|