Browse Source

no fix disable enable bugs

master
独行之狼 3 years ago
parent
commit
e96f91fe81
  1. BIN
      fr-plugin-CharCartnoon-1.0/fr-plugin-CharCartnoon-1.0.jar
  2. 3
      fr-plugin-CharCartnoon-1.0/plugin.xml
  3. BIN
      install/fr-plugin-CharCartnoon-1.0.zip
  4. 3
      plugin.xml
  5. 22
      src/com/fr/plugin/cool/cartnoon/CartUtils.java
  6. 3
      src/com/fr/plugin/cool/cartnoon/FRAnimateArraow.java
  7. 3
      src/com/fr/plugin/cool/cartnoon/FRBlurText.java
  8. 2
      src/com/fr/plugin/cool/cartnoon/FRCartnoonFunctions.java
  9. 2
      src/com/fr/plugin/cool/cartnoon/FRClockTime.java
  10. 1
      src/com/fr/plugin/cool/cartnoon/FRCountUp.java
  11. 2
      src/com/fr/plugin/cool/cartnoon/FRCustomAnimation.java
  12. 2
      src/com/fr/plugin/cool/cartnoon/FRDissolveText.java
  13. 2
      src/com/fr/plugin/cool/cartnoon/FRMasaicText.java
  14. 5
      src/com/fr/plugin/cool/cartnoon/FRPrintText.java
  15. 2
      src/com/fr/plugin/cool/cartnoon/FRRotateText.java
  16. 9
      src/com/fr/plugin/cool/cartnoon/web/ImageViewer.java

BIN
fr-plugin-CharCartnoon-1.0/fr-plugin-CharCartnoon-1.0.jar

Binary file not shown.

3
fr-plugin-CharCartnoon-1.0/plugin.xml

@ -6,9 +6,10 @@
<env-version>10.0</env-version>
<jartime>2018-07-31</jartime>
<vendor>all100</vendor>
<description><![CDATA[以数字或文字为内容生成一些动画特效,如旋转、浮动等,注意:单元格显示内容设置为用HTML显示内容。]]></description>
<description><![CDATA[以数字或文字为内容生成一些动画特效,如旋转、浮动、溶解、模糊、时钟、打字、箭头、计数、马赛克、自定义等,注意:单元格显示内容设置为用HTML显示内容。]]></description>
<change-notes><![CDATA[
[2021-8-19]初始化插件。<br/>
[2021-10-24]完成第一版。<br/>
]]></change-notes>
<extra-core>

BIN
install/fr-plugin-CharCartnoon-1.0.zip

Binary file not shown.

3
plugin.xml

@ -6,9 +6,10 @@
<env-version>10.0</env-version>
<jartime>2018-07-31</jartime>
<vendor>all100</vendor>
<description><![CDATA[以数字或文字为内容生成一些动画特效,如旋转、浮动等,注意:单元格显示内容设置为用HTML显示内容。]]></description>
<description><![CDATA[以数字或文字为内容生成一些动画特效,如旋转、浮动、溶解、模糊、时钟、打字、箭头、计数、马赛克、自定义等,注意:单元格显示内容设置为用HTML显示内容。]]></description>
<change-notes><![CDATA[
[2021-8-19]初始化插件。<br/>
[2021-10-24]完成第一版。<br/>
]]></change-notes>
<extra-core>

22
src/com/fr/plugin/cool/cartnoon/CartUtils.java

@ -2,18 +2,15 @@ package com.fr.plugin.cool.cartnoon;
import com.fr.base.BaseUtils;
import com.fr.base.io.BaseBook;
import com.fr.base.operator.common.CommonOperator;
import com.fr.design.mainframe.JTemplate;
import com.fr.general.FArray;
import com.fr.general.GeneralUtils;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.cool.cartnoon.utils.AnimatedGifEncoder;
import com.fr.plugin.cool.cartnoon.web.ImageViewer;
import com.fr.script.AbstractFunction;
import com.fr.stable.ColumnRow;
import com.fr.stable.fun.Authorize;
import com.fr.workspace.WorkContext;
import sun.font.FontDesignMetrics;
import javax.imageio.ImageIO;
@ -23,15 +20,28 @@ import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Authorize(callSignKey = CartUtils.PLUGIN_ID)
public class CartUtils {
static final String PLUGIN_ID = "com.fr.plugin.cool.cartnoon";
private static Map<String,byte[]> gifData =new ConcurrentHashMap<>();
public static void setGifData(String k,byte[] v){
gifData.put(k, v);
}
public static byte[] getGifData(String k){
return gifData.get(k);
}
static boolean CheckArgs(Object[] args,int num) {
return args.length==num;
}
@ -119,7 +129,7 @@ public class CartUtils {
e.finish();
byte[] data = out.toByteArray();
ImageViewer.gifData.put(id,data);
CartUtils.setGifData(id,data);
}
static String GetCellId(AbstractFunction calculator){
final ColumnRow currentColumnRow = calculator.getCalculator().getCurrentColumnRow();

3
src/com/fr/plugin/cool/cartnoon/FRAnimateArraow.java

@ -8,7 +8,6 @@ import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.cool.cartnoon.utils.AnimatedGifEncoder;
import com.fr.plugin.cool.cartnoon.utils.DrawValueLine;
import com.fr.plugin.cool.cartnoon.web.ImageViewer;
import com.fr.plugin.manage.PluginManager;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.script.AbstractFunction;
@ -76,7 +75,7 @@ public class FRAnimateArraow extends AbstractFunction {
e.finish();
byte[] data = out.toByteArray();
ImageViewer.gifData.put(id,data);
CartUtils.setGifData(id,data);
}
//生成箭头
private BufferedImage setFilter(BufferedImage src,int arraLen, float stroke, double alh,Color color) {

3
src/com/fr/plugin/cool/cartnoon/FRBlurText.java

@ -7,7 +7,6 @@ import com.fr.plugin.PluginLicense;
import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.cool.cartnoon.utils.AnimatedGifEncoder;
import com.fr.plugin.cool.cartnoon.web.ImageViewer;
import com.fr.plugin.manage.PluginManager;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.script.AbstractFunction;
@ -80,7 +79,7 @@ public class FRBlurText extends AbstractFunction {
e.finish();
byte[] data = out.toByteArray();
ImageViewer.gifData.put(id,data);
CartUtils.setGifData(id,data);
}
//图像上执行高斯模糊
private BufferedImage setFilter(BufferedImage src,float radius) {

2
src/com/fr/plugin/cool/cartnoon/FRCartnoonFunctions.java

@ -17,7 +17,7 @@ public class FRCartnoonFunctions extends AbstractFunctionDefContainer {
new FunctionDef("FRDissolveText", "生成溶解文本动画效果。\n参数说明:\n参数1:字符型,要溶解的文本。\n参数2:整型,文本宽度。\n参数3:整型,文本高度。\n参数4:整型,文本字号。\n参数5:整型,动画刷新频率(毫秒)。\n示例:FRDissolveText(\"88888888888\",180,50,25,300,\"ff0000\")", FRDissolveText.class.getName()),
new FunctionDef("FRRotateText", "生成旋转文本动画效果。\n参数说明:\n参数1:字符型,要旋转的文本。\n参数2:整型,文本宽度。\n参数3:整型,文本高度。\n参数4:整型,文本字号。\n参数5:整型,动画刷新频率(毫秒)。\n示例:FRRotateText(\"你好,世界\",180,180,25,300,\"ff0000\")", FRRotateText.class.getName()),
new FunctionDef("FRAnimateArraow", "生成箭头动画效果。\n参数说明:\n参数1:整型,页面占用宽度。\n参数2:整型,页面占用高度。\n参数3:文本,箭头颜色,如FF0000。\n参数4:整型,箭头粗细。\n示例:FRAnimateArraow(300,200,\"ff0000\",10)", FRAnimateArraow.class.getName()),
new FunctionDef("FRCountUp", "生成数字计数动画效果。\n参数说明:\n参数1:整型,要计数的数字。\n参数2:整型,显示宽度。\n参数3:整型,显示高度。\n参数4:整型,文本字号。\n参数5:整型,动画刷新频率(毫秒)。\n示例:FRCountUp(\"123456790\",500,100,20,100,\"ffff00\")", FRCountUp.class.getName()),
new FunctionDef("FRCountUp", "生成数字计数动画效果。\n参数说明:\n参数1:整型,要计数的数字。\n参数2:整型,显示宽度。\n参数3:整型,显示高度。\n参数4:整型,文本字号。\n参数5:整型,动画刷新频率(毫秒)。\n示例:FRCountUp(123456,500,100,20,100,\"ffff00\")", FRCountUp.class.getName()),
new FunctionDef("FRClockTime", "生成时钟动画效果。\n参数说明:\n参数1:文本,时间,用HH:MM表示。\n参数2:整型,显示宽度。\n参数3:整型,显示高度。\n参数4:整型,动画刷新频率(毫秒)。\n示例:FRClockTime(\"6:30\",100,100,20)", FRClockTime.class.getName()),
new FunctionDef("FRMasaicText", "生成马塞克动画效果。\n参数说明:\n参数1:显示的文本。\n参数2:整型,显示宽度。\n参数3:整型,显示高度。\n参数4:整型,动画刷新频率(毫秒)。\n示例:FRMasaicText(\"你好,世界\", 180, 180, 25, 100, \"ff0000\")", FRMasaicText.class.getName()),
new FunctionDef("FRBlurText", "生成高斯模糊动画效果。\n参数说明:\n参数1:显示的文本。\n参数2:整型,显示宽度。\n参数3:整型,显示高度。\n参数4:整型,动画刷新频率(毫秒)。\n示例:FRBlurText(\"你好,世界\", 180, 180, 25, 60, \"ff0000\")", FRBlurText.class.getName()),

2
src/com/fr/plugin/cool/cartnoon/FRClockTime.java

@ -106,7 +106,7 @@ public class FRClockTime extends AbstractFunction {
g2d.dispose();
encoder.finish();
byte[] data = out.toByteArray();
ImageViewer.gifData.put(id,data);
CartUtils.setGifData(id,data);
}
//设置图像旋转缩放
private static BufferedImage setFilter(BufferedImage src, float scale, float rotate) throws IOException {

1
src/com/fr/plugin/cool/cartnoon/FRCountUp.java

@ -11,7 +11,6 @@ import com.fr.record.analyzer.EnableMetrics;
import com.fr.script.AbstractFunction;
import com.fr.stable.Primitive;
import com.fr.stable.fun.Authorize;
import java.awt.*;
@EnableMetrics

2
src/com/fr/plugin/cool/cartnoon/FRCustomAnimation.java

@ -74,7 +74,7 @@ public class FRCustomAnimation extends AbstractFunction {
e.finish();
byte[] data = out.toByteArray();
ImageViewer.gifData.put(id,data);
CartUtils.setGifData(id,data);
}
private BufferedImage setSize(BufferedImage src, int width, int height) throws IOException {

2
src/com/fr/plugin/cool/cartnoon/FRDissolveText.java

@ -72,7 +72,7 @@ public class FRDissolveText extends AbstractFunction {
e.finish();
byte[] data = out.toByteArray();
ImageViewer.gifData.put(id,data);
CartUtils.setGifData(id,data);
}
//设置图像溶解效果
private BufferedImage setFilter(BufferedImage src, float density, float softness) {

2
src/com/fr/plugin/cool/cartnoon/FRMasaicText.java

@ -81,7 +81,7 @@ public class FRMasaicText extends AbstractFunction {
e.finish();
byte[] data = out.toByteArray();
ImageViewer.gifData.put(id,data);
CartUtils.setGifData(id,data);
}
//设置图像马赛克
private BufferedImage setFilter(BufferedImage src, int blockSize) {

5
src/com/fr/plugin/cool/cartnoon/FRPrintText.java

@ -3,12 +3,10 @@ package com.fr.plugin.cool.cartnoon;
import com.fr.intelli.record.Focus;
import com.fr.intelli.record.Original;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.PluginLicense;
import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.cool.cartnoon.utils.AnimatedGifEncoder;
import com.fr.plugin.cool.cartnoon.web.ImageViewer;
import com.fr.plugin.manage.PluginManager;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.script.AbstractFunction;
@ -76,8 +74,7 @@ public class FRPrintText extends AbstractFunction {
e.finish();
byte[] data = out.toByteArray();
ImageViewer.gifData.put(id,data);
CartUtils.setGifData(id,data);
}

2
src/com/fr/plugin/cool/cartnoon/FRRotateText.java

@ -79,7 +79,7 @@ public class FRRotateText extends AbstractFunction {
e.finish();
byte[] data = out.toByteArray();
ImageViewer.gifData.put(id,data);
CartUtils.setGifData(id,data);
}
//设置图像旋转缩放
private BufferedImage setFilter(BufferedImage src, float scale, float rotate) throws IOException {

9
src/com/fr/plugin/cool/cartnoon/web/ImageViewer.java

@ -1,15 +1,16 @@
package com.fr.plugin.cool.cartnoon.web;
import com.fr.decision.fun.impl.BaseHttpHandler;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.cool.cartnoon.CartUtils;
import com.fr.third.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.HashMap;
public class ImageViewer extends BaseHttpHandler {
public static HashMap<String,byte[]> gifData =new HashMap<>();
@Override
public RequestMethod getMethod() {
return RequestMethod.GET;
@ -34,8 +35,8 @@ public class ImageViewer extends BaseHttpHandler {
// 回写
response.setContentType("image/gif");
output.write(gifData.get(id));
FineLoggerFactory.getLogger().info("web-id:{}",id.hashCode()+":"+id);
output.write(CartUtils.getGifData(id));
output.flush();
output.close();

Loading…
Cancel
Save