|
|
|
@ -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(); |
|
|
|
|