Browse Source

open

master
pioneer 1 year ago
commit
2a2a6ec6ea
  1. 6
      README.md
  2. 128
      build.xml
  3. 35
      plugin.xml
  4. 563
      src/com/fr/plugin/heatpointmapbox/HeatPointMapChart.java
  5. 10
      src/com/fr/plugin/heatpointmapbox/HeatPointMapChartLocaleFinder.java
  6. 11
      src/com/fr/plugin/heatpointmapbox/HeatPointMapChartProvider.java
  7. 44
      src/com/fr/plugin/heatpointmapbox/HeatPointMapChartUI.java
  8. 146
      src/com/fr/plugin/heatpointmapbox/data/HeatPointMapDataConfig.java
  9. 74
      src/com/fr/plugin/heatpointmapbox/data/HeatPointMapDataPane.java
  10. 74
      src/com/fr/plugin/heatpointmapbox/data/HeatPointMapReportDataPane.java
  11. BIN
      src/com/fr/plugin/heatpointmapbox/images/demo.png
  12. BIN
      src/com/fr/plugin/heatpointmapbox/images/icon.png
  13. BIN
      src/com/fr/plugin/heatpointmapbox/images/layout_bottom_left.png
  14. BIN
      src/com/fr/plugin/heatpointmapbox/images/layout_bottom_right.png
  15. BIN
      src/com/fr/plugin/heatpointmapbox/images/layout_top_left.png
  16. BIN
      src/com/fr/plugin/heatpointmapbox/images/layout_top_right.png
  17. 85
      src/com/fr/plugin/heatpointmapbox/locale/heatpointmapbox.properties
  18. 85
      src/com/fr/plugin/heatpointmapbox/locale/heatpointmapbox_zh_CN.properties
  19. 75
      src/com/fr/plugin/heatpointmapbox/ui/CustomChartFillStylePane.java
  20. 45
      src/com/fr/plugin/heatpointmapbox/ui/CustomColorSchemeComboBox.java
  21. 55
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapHyperLink.java
  22. 141
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapPointCondListPane.java
  23. 223
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapPointStyleCreator.java
  24. 115
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleBaseMapPane.java
  25. 159
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleHeatMapPane.java
  26. 209
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleLabelsPane.java
  27. 139
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleLegendPane.java
  28. 84
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleOtherPane.java
  29. 39
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStylePane.java
  30. 126
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStylePointMapPane.java
  31. 163
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleTipsPane.java
  32. 142
      src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleTitlePane.java
  33. 136
      src/com/fr/plugin/heatpointmapbox/ui/ImageChooserPane.java
  34. 42
      src/com/fr/plugin/heatpointmapbox/ui/ImageEntity.java
  35. 94
      src/com/fr/plugin/heatpointmapbox/ui/MapUtil.java
  36. 23
      src/com/fr/plugin/heatpointmapbox/vo/CustomJsonObject.java
  37. 14
      src/com/fr/plugin/heatpointmapbox/vo/PointMapStyleJson.java
  38. 0
      src/com/fr/plugin/heatpointmapbox/web/HeatPointMapChart.css
  39. 609
      src/com/fr/plugin/heatpointmapbox/web/HeatPointMapChartWrapper.js
  40. 19
      src/com/fr/plugin/heatpointmapbox/web/HeatPointMapCssFilePlaceHolder.java
  41. 17
      src/com/fr/plugin/heatpointmapbox/web/HeatPointMapJsFilePlaceHolder.java

6
README.md

@ -0,0 +1,6 @@
# JSD-11669
JSD-9934 热力地图和点地图支持组合叠加【增补/变更需求】\
免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\
仅作为开发者学习参考使用!禁止用于任何商业用途!\
为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系【pioneer】处理。

128
build.xml

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="jar" name="plugin">
<!-- JDK路径,根据自己机器上实际位置修改-->
<property name="jdk.home" value="C:/Program Files/Java/jdk1.8.0_181"/>
<property name="libs" value="${basedir}/lib"/>
<property name="publicLibs" value=""/>
<property name="reportLibs" value="${basedir}/../../webroot/WEB-INF/lib"/>
<property name="destLoc" value="."/>
<property name="classes" value="classes"/>
<xmlproperty file="${basedir}/plugin.xml"/>
<property name="current-version" value="${plugin.version}"/>
<!-- 插件版本-->
<property name="plugin-version" value="${current-version}"/>
<!-- 插件名字-->
<property name="plugin-name" value="heatpointmapbox"/>
<property name="plugin-jar" value="fr-plugin-${plugin-name}-${plugin-version}.jar"/>
<target name="prepare">
<delete dir="${classes}"/>
<delete dir="fr-plugin-${plugin-name}-${plugin-version}"/>
<xmlproperty file="${basedir}/plugin.xml"/>
<delete dir="${destLoc}/${plugin.name}"/>
</target>
<path id="compile.classpath">
<fileset dir="${libs}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${publicLibs}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${reportLibs}">
<include name="**/*.jar"/>
</fileset>
</path>
<patternset id="resources4Jar">
<exclude name="**/.settings/**"/>
<exclude name=".classpath"/>
<exclude name=".project"/>
<exclude name="**/*.java"/>
<exclude name="**/*.db"/>
<exclude name="**/*.g"/>
<exclude name="**/package.html"/>
</patternset>
<target name="copy_resources">
<echo message="从${resources_from}拷贝图片,JS,CSS等资源文件"/>
<delete dir="tmp"/>
<copy todir="tmp">
<fileset dir="${resources_from}/src">
<patternset refid="resources4Jar"/>
</fileset>
</copy>
<copy todir="${classes}">
<fileset dir="tmp"/>
</copy>
<delete dir="tmp"/>
</target>
<target name="compile_javas">
<echo message="编译${compile_files}下的Java文件"/>
<javac destdir="${classes}" debug="false" optimize="on" source="${source_jdk_version}"
target="${target_jdk_version}"
fork="true" memoryMaximumSize="512m" listfiles="false" srcdir="${basedir}"
executable="${compile_jdk_version}/bin/javac">
<src path="${basedir}/src"/>
<exclude name="**/.svn/**"/>
<compilerarg line="-encoding UTF8 "/>
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="jar_classes">
<echo message="打Jar包:${jar_name}"/>
<delete file="${basedir}/${jar_name}"/>
<jar jarfile="${basedir}/${jar_name}">
<fileset dir="${classes}">
</fileset>
</jar>
</target>
<target name="super_jar" depends="prepare">
<antcall target="copy_resources">
<param name="resources_from" value="${basedir}"/>
</antcall>
<antcall target="compile_javas">
<param name="source_jdk_version" value="1.8"/>
<param name="target_jdk_version" value="1.8"/>
<param name="compile_jdk_version" value="${jdk.home}"/>
<param name="compile_files" value="${basedir}/src"/>
</antcall>
<echo message="compile plugin success!"/>
<antcall target="jar_classes">
<param name="jar_name" value="${plugin-jar}"/>
</antcall>
<delete dir="${classes}"/>
</target>
<target name="jar" depends="super_jar">
<antcall target="zip"/>
</target>
<target name="zip">
<property name="plugin-folder" value="fr-plugin-${plugin-name}-${plugin-version}"/>
<echo message="----------zip files----------"/>
<mkdir dir="${plugin-folder}"/>
<copy todir="${plugin-folder}">
<fileset dir=".">
<include name="${plugin-jar}"/>
<include name="plugin.xml"/>
</fileset>
<fileset dir="${libs}">
<include name="*.jar"/>
<include name="*.dll"/>
</fileset>
</copy>
<zip destfile="${basedir}/${plugin-folder}.zip" basedir=".">
<include name="${plugin-folder}/*.jar"/>
<include name="${plugin-folder}/*.dll"/>
<include name="${plugin-folder}/plugin.xml"/>
</zip>
<xmlproperty file="${basedir}/plugin.xml"/>
<move file="${plugin-folder}.zip" todir="${destLoc}/install"/>
<delete file="fr-plugin-${plugin-name}-${plugin-version}.jar"/>
</target>
</project>

35
plugin.xml

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<plugin>
<main-package>com.fr.plugin.heatpointmapbox</main-package>
<id>com.fr.plugin.heatpointmapbox.v10</id>
<name><![CDATA[热力点组合图_MapBox定制_EK]]></name>
<active>yes</active>
<version>1.0.0</version>
<env-version>10.0~11.0</env-version>
<jartime>2021-04-24</jartime>
<vendor >fr.open</vendor>
<description><![CDATA[<p>热力点组合图_MapBox定制_EK</p>]]></description>
<change-notes><![CDATA[<p>[2022-12-21]开发1.0版本</p>]]></change-notes>
<extra-report>
<StylePlaceHolder class="com.fr.plugin.heatpointmapbox.web.HeatPointMapCssFilePlaceHolder"/>
<JavaScriptPlaceHolder class="com.fr.plugin.heatpointmapbox.web.HeatPointMapJsFilePlaceHolder"/>
</extra-report>
<extra-form>
<StylePlaceHolder class="com.fr.plugin.heatpointmapbox.web.HeatPointMapCssFilePlaceHolder"/>
<JavaScriptPlaceHolder class="com.fr.plugin.heatpointmapbox.web.HeatPointMapJsFilePlaceHolder"/>
</extra-form>
<extra-designer/>
<extra-platform/>
<extra-core>
<LocaleFinder class="com.fr.plugin.heatpointmapbox.HeatPointMapChartLocaleFinder"/>
</extra-core>
<extra-chart>
<IndependentChartProvider class="com.fr.plugin.heatpointmapbox.HeatPointMapChartProvider"
plotID="HeatPointMapChart"/>
</extra-chart>
<extra-chart-designer>
<IndependentChartUIProvider class="com.fr.plugin.heatpointmapbox.HeatPointMapChartUI"
plotID="HeatPointMapChart"/>
</extra-chart-designer>
<function-recorder class="com.fr.plugin.heatpointmapbox.HeatPointMapChart"/>
</plugin>

563
src/com/fr/plugin/heatpointmapbox/HeatPointMapChart.java

@ -0,0 +1,563 @@
package com.fr.plugin.heatpointmapbox;
import com.fr.base.Base64;
import com.fr.extended.chart.AbstractChart;
import com.fr.extended.chart.HyperLinkPara;
import com.fr.extended.chart.StringFormula;
import com.fr.extended.chart.ToHyperlinkJSONHelper;
import com.fr.general.ComparatorUtils;
import com.fr.js.NameJavaScript;
import com.fr.js.NameJavaScriptGroup;
import com.fr.json.*;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.heatpointmapbox.data.HeatPointMapDataConfig;
import com.fr.plugin.transform.ExecuteFunctionRecord;
import com.fr.plugin.transform.FunctionRecorder;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.web.Repository;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
import java.util.ArrayList;
import java.util.List;
/**
* @author xx
* @date 2022/12/21
*/
@FunctionRecorder
public class HeatPointMapChart extends AbstractChart<HeatPointMapDataConfig> {
private static final String ID = "HeatPointMapChart";
private static final String NAME = "热力点组合图_MapBox定制版_EK";
private JSONObject titleConf;
private JSONObject mapConf;
private JSONObject pointConf;
private JSONObject heatConf;
private JSONObject legendConf;
private JSONObject labelConf;
private JSONObject tipsConf;
private JSONArray pointStyleCond;
private NameJavaScriptGroup linkNameGroup;
@Override
protected String getChartID() {
return ID;
}
@Override
public String getChartName() {
return NAME;
}
@ExecuteFunctionRecord
@Override
protected void addJSON(HeatPointMapDataConfig dataConfig, JSONObject jsonObject, Repository repository, JSONPara jsonPara) throws JSONException {
jsonObject.put("titleConf", getTitleConf());
jsonObject.put("mapConf", getMapConf());
jsonObject.put("pointConf", getPointConf());
jsonObject.put("heatConf", getHeatConf());
jsonObject.put("legendConf", getLegendConf());
jsonObject.put("labelConf", getLabelConf());
jsonObject.put("tipsConf", getTipsConf());
jsonObject.put("pointStyleCond", getPointStyleCond());
addAutoLinkJSON(jsonObject, jsonPara);
jsonObject.put("data", makeChartData(dataConfig, repository));
}
private JSONArray makeChartData(HeatPointMapDataConfig dataConfig, Repository repository) {
JSONArray dataArr = JSONFactory.createJSON(JSON.ARRAY);
if (null == dataConfig || null == dataConfig.getDatatype()) {
return dataArr;
}
List<Object> layertype = dataConfig.getLayertype().getValues();
List<Object> datatype = dataConfig.getDatatype().getValues();
List<Object> lng = dataConfig.getLng().getValues();
List<Object> lat = dataConfig.getLat().getValues();
List<Object> name = dataConfig.getName().getValues();
List<Object> val = dataConfig.getVal().getValues();
List<Object> desc = dataConfig.getDesc().getValues();
for (int i = 0; i < datatype.size(); i++) {
try {
JSONObject dataObj = JSONFactory.createJSON(JSON.OBJECT);
if(null == layertype || layertype.isEmpty()) {
continue;
}
if(null == datatype || datatype.isEmpty()) {
continue;
}
if(null == lng || lng.isEmpty() || null == lat || lat.isEmpty()) {
continue;
}
if(null != layertype && !layertype.isEmpty()) {
dataObj.put("layertype", layertype.get(i));
} else {
dataObj.put("layertype", "");
}
if(null != datatype && !datatype.isEmpty()) {
dataObj.put("datatype", datatype.get(i));
} else {
dataObj.put("datatype", "");
}
if(null != lng && !lng.isEmpty()) {
dataObj.put("lng", lng.get(i));
} else {
dataObj.put("lng", "");
}
if(null != lat && !lat.isEmpty()) {
dataObj.put("lat", lat.get(i));
} else {
dataObj.put("lat", "");
}
if(null != name && !name.isEmpty()) {
dataObj.put("name", name.get(i));
} else {
dataObj.put("name", "");
}
if(null != val && !val.isEmpty()) {
dataObj.put("val", val.get(i));
} else {
dataObj.put("val", "");
}
if(null != desc && !desc.isEmpty()) {
dataObj.put("desc", desc.get(i));
} else {
dataObj.put("desc", "");
}
dataArr.put(dataObj);
} catch (Exception e) {
FineLoggerFactory.getLogger().error("热力点组合图_MapBox定制_EK,数据处理有错误," + e.getMessage(), e);
}
}
return dataArr;
}
@Override
protected String[] requiredJS() {
return new String[]{
"com/fr/plugin/heatpointmapbox/web/HeatPointMapChartWrapper.js"
};
}
@Override
protected String[] requiredCSS() {
return new String[]{
"com/fr/plugin/heatpointmapbox/web/HeatPointMapChart.css"
};
}
@Override
protected String wrapperName() {
return "HeatPointMapChartWrapper";
}
private void addAutoLinkJSON(JSONObject paramJSONObject, JSONPara paramAbstractChart)
throws JSONException {
ToHyperlinkJSONHelper.addECNameToLinkGroup(paramAbstractChart.ecName, paramAbstractChart.sheetIndex, this.getLinkNameGroup());
paramJSONObject.put("pointLink", ToHyperlinkJSONHelper.addAutoLinkJSON(this.getLinkNameGroup(), hyperLinkParas()));
}
@Override
public NameJavaScriptGroup getHotHyperlink(String s) {
NameJavaScriptGroup retLinkGroup = new NameJavaScriptGroup();
for (int i = 0; i < linkNameGroup.size(); i++) {
NameJavaScript hyperlink = linkNameGroup.getNameHyperlink(i);
if ("pointLink".equals(s)) {
try {
retLinkGroup.addNameHyperlink((NameJavaScript)hyperlink.clone());
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
}
}
return retLinkGroup;
}
@Override
protected HyperLinkPara[] hyperLinkParas() {
return new HyperLinkPara[]{
new HyperLinkPara() {
@Override
public String getName() {
return "类型";
}
@Override
public String getFormulaContent() {
return "DATATYPE";
}
@Override
public String[] getProps() {
return new String[]{"datatype"};
}
},
new HyperLinkPara() {
@Override
public String getName() {
return "名称";
}
@Override
public String getFormulaContent() {
return "POINTNAME";
}
@Override
public String[] getProps() {
return new String[]{"name"};
}
},
new HyperLinkPara() {
@Override
public String getName() {
return "经度";
}
@Override
public String getFormulaContent() {
return "POINTLNG";
}
@Override
public String[] getProps() {
return new String[]{"lng"};
}
},
new HyperLinkPara() {
@Override
public String getName() {
return "纬度";
}
@Override
public String getFormulaContent() {
return "POINTLAT";
}
@Override
public String[] getProps() {
return new String[]{"lat"};
}
},
new HyperLinkPara() {
@Override
public String getName() {
return "描述";
}
@Override
public String getFormulaContent() {
return "POINTDESC";
}
@Override
public String[] getProps() {
return new String[]{"desc"};
}
}
};
}
@Override
protected void readAttr(XMLableReader xmLableReader) {
super.readAttr(xmLableReader);
String jsonStr = xmLableReader.getAttrAsString("titleConf", "");
if (StringUtils.isNotEmpty(jsonStr)) {
this.setTitleConf(new JSONObject(jsonStr));
}
jsonStr = xmLableReader.getAttrAsString("mapConf", "");
if (StringUtils.isNotEmpty(jsonStr)) {
this.setMapConf(new JSONObject(jsonStr));
}
jsonStr = xmLableReader.getAttrAsString("pointConf", "");
if (StringUtils.isNotEmpty(jsonStr)) {
this.setPointConf(new JSONObject(jsonStr));
}
jsonStr = xmLableReader.getAttrAsString("heatConf", "");
if (StringUtils.isNotEmpty(jsonStr)) {
this.setHeatConf(new JSONObject(jsonStr));
}
jsonStr = xmLableReader.getAttrAsString("legendConf", "");
if (StringUtils.isNotEmpty(jsonStr)) {
this.setLegendConf(new JSONObject(jsonStr));
}
jsonStr = xmLableReader.getAttrAsString("labelConf", "");
if (StringUtils.isNotEmpty(jsonStr)) {
this.setLabelConf(new JSONObject(jsonStr));
}
jsonStr = xmLableReader.getAttrAsString("tipsConf", "");
if (StringUtils.isNotEmpty(jsonStr)) {
this.setTipsConf(new JSONObject(jsonStr));
}
jsonStr = xmLableReader.getAttrAsString("pointStyleCond", "");
if (StringUtils.isNotEmpty(jsonStr)) {
this.setPointStyleCond(new JSONArray(new String(Base64.decode(jsonStr))));
}
if (null == linkNameGroup) {
linkNameGroup = (NameJavaScriptGroup)xmLableReader.readXMLObject(new NameJavaScriptGroup());
}
}
@Override
protected void writeAttr(XMLPrintWriter xmlPrintWriter) {
super.writeAttr(xmlPrintWriter);
if (null != titleConf) {
xmlPrintWriter.attr("titleConf", titleConf.toString());
}
if (null != mapConf) {
xmlPrintWriter.attr("mapConf", mapConf.toString());
}
if (null != pointConf) {
xmlPrintWriter.attr("pointConf", pointConf.toString());
}
if (null != heatConf) {
xmlPrintWriter.attr("heatConf", heatConf.toString());
}
if (null != legendConf) {
xmlPrintWriter.attr("legendConf", legendConf.toString());
}
if (null != labelConf) {
xmlPrintWriter.attr("labelConf", labelConf.toString());
}
if (null != tipsConf) {
xmlPrintWriter.attr("tipsConf", tipsConf.toString());
}
if (null != pointStyleCond) {
xmlPrintWriter.attr("pointStyleCond", Base64.encode(pointStyleCond.toString().getBytes()));
}
if (null != linkNameGroup) {
linkNameGroup.writeXML(xmlPrintWriter);
}
}
@Override
public boolean equals(Object o) {
boolean isEq = super.equals(o)
&& o instanceof HeatPointMapChart
&& ComparatorUtils.equals(((HeatPointMapChart) o).getTitleConf(), this.titleConf)
&& ComparatorUtils.equals(((HeatPointMapChart) o).getMapConf(), this.mapConf)
&& ComparatorUtils.equals(((HeatPointMapChart) o).getPointConf(), this.pointConf)
&& ComparatorUtils.equals(((HeatPointMapChart) o).getHeatConf(), this.heatConf)
&& ComparatorUtils.equals(((HeatPointMapChart) o).getLegendConf(), this.legendConf)
&& ComparatorUtils.equals(((HeatPointMapChart) o).getLabelConf(), this.labelConf)
&& ComparatorUtils.equals(((HeatPointMapChart) o).getTipsConf(), this.tipsConf)
&& ComparatorUtils.equals(((HeatPointMapChart) o).getPointStyleCond(), this.pointStyleCond)
&& ComparatorUtils.equals(((HeatPointMapChart) o).getLinkNameGroup(), this.linkNameGroup)
;
return isEq;
}
@Override
public int hashCode() {
return super.hashCode() + AssistUtils.hashCode(new Object[]{this.titleConf, this.mapConf,this.pointConf,this.heatConf,this.legendConf,this.labelConf, this.tipsConf, this.pointStyleCond});
}
@Override
public HeatPointMapChart clone() throws CloneNotSupportedException {
HeatPointMapChart chart = (HeatPointMapChart)super.clone();
if (this.linkNameGroup != null) {
chart.setLinkNameGroup((NameJavaScriptGroup) this.getLinkNameGroup().clone());
}
return chart;
}
@Override
protected List<StringFormula> formulas() {
List<StringFormula> formulaList = new ArrayList<StringFormula>();
return formulaList;
}
@Override
protected String demoImagePath() {
return "com/fr/plugin/lzljgdmap/images/demo.png";
}
public JSONObject getTitleConf() {
if (null == titleConf) {
titleConf = new JSONObject();
titleConf.put("titlevisiable", false);
titleConf.put("titlename", "热力点组合图");
titleConf.put("titleposition", 0);
titleConf.put("titlesize", 13);
titleConf.put("titlestyle", 1);
titleConf.put("titlefamily", "微软雅黑");
titleConf.put("titlecolor", "#ffffff");
titleConf.put("titlebgcolor", "#000000");
titleConf.put("titleBgOpacity", 55);
}
return titleConf;
}
public void setTitleConf(JSONObject titleConf) {
this.titleConf = titleConf;
}
public JSONObject getTipsConf() {
if (null == tipsConf) {
tipsConf = new JSONObject();
tipsConf.put("showPointTips", true);
tipsConf.put("tipBgColor", "#000000");
tipsConf.put("tipBgOpacity", 70.0);
tipsConf.put("showLayerType", true);
tipsConf.put("showDataType", true);
tipsConf.put("showDesc", true);
tipsConf.put("showLat", true);
tipsConf.put("showLng", true);
tipsConf.put("showName", true);
tipsConf.put("tipfamily", "微软雅黑");
tipsConf.put("tipstyle", 0);
tipsConf.put("tipsize", 12);
tipsConf.put("tipcolor", "#ffcc00");
}
return tipsConf;
}
public void setTipsConf(JSONObject tipsConf) {
this.tipsConf = tipsConf;
}
public JSONArray getPointStyleCond() {
if (null == pointStyleCond || pointStyleCond.size() == 0) {
pointStyleCond = JSONArray.create();
}
return pointStyleCond;
}
public void setPointStyleCond(JSONArray pointStyleCond) {
this.pointStyleCond = pointStyleCond;
}
public JSONObject getMapConf() {
if (null == mapConf) {
mapConf = new JSONObject();
mapConf.put("centerx", "");
mapConf.put("centery", "");
mapConf.put("mapStyle", "");
mapConf.put("mapKey", "");
mapConf.put("mapzoom", 10);
}
return mapConf;
}
public void setMapConf(JSONObject mapConf) {
this.mapConf = mapConf;
}
public JSONObject getPointConf() {
if (null == pointConf) {
pointConf = new JSONObject();
pointConf.put("clusterBgOpacity", 100);
pointConf.put("clusterBorderColor", "#3366ff");
pointConf.put("clusterFillColor", "#1fade5");
pointConf.put("clusterMaxZoom", 12);
pointConf.put("clusterPointSize", 32);
pointConf.put("clusterTextColor", "#ffffff");
pointConf.put("pointSize", 32);
pointConf.put("pointimg", "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAD60lEQVR4nO1YMWgUQRTd4mb2orYiJpnZw84gaGEhImIhCJJC0gixEQVJmiAowcJCECSdSRrRoGIhGAVNYWEhpEiCAdOI3u1tjhAbG1OoIMTu/D+5O3f3Ljszyc3MBefBh2V3/p/3/v75M7ue5+Dg4ODg4GAKqwUvX+G0b5n7/WAjNevHe/jMNj8tiHjuVMTprTL358ucVrPNn8ex6GOb946xHNABELUgFr2lLWAM2zqUEfWQoyGjz3cgPGEYC2Pa1iWFckAvlRn53i7xDcOYENu2vkxEgX+j7cJThnPY1tkSEaMXdYtvJAHmsq03AezYpsQ3ktApu0SJ0SOwba2YTwBdwblt6/e22e3XoYw/wJ7/AG3zmq6rxsG5rYqv7fMKpMn7MMidbHXiw3v4DMeoxLR6TigrHXLIhHxcMqGQhAWdGrfEMs+flSW5cijPVeOjj3QVABcdGjMBE4/JkCux3Om0b8jJNXi2BPYLmtmXkNO3rbY29JVMwpgZ1THUBIjKfjzuA+v1MNx/l+HzEb8Kk/OQcYkELBkVjw1LgtTvz91drO4DJ7jzcO+nyA8rIp4EjIGxRH5GP6WRoFBIQBfjPiDsqUJje5HwhVgin3TlaAX+wBCKYPRxfXxYyBcUxKP9KfZ5tO6PsUQ+yMlkAkbECSDDjQT05s4oJqCKPv8SQIYlEjBiLAFAaEgoIPZGdpqAUKriyJCxBGye2ASEAnq7Pl6mZ2RWAMQSjgdOxhJQ3O/tkxDxKu6D3V0hAd/ivhhL5IOcjCVggxQjs1mEQHAlKYLcl377nN6J+2IsQfnPGhWPKHH/ungZkCtxH7j3UmLpPEn4QAyRD3Ixqx5QLJBjqqWMiLj/cIuxP+DN30uPxxjC8gcuZlQ3k5sRkcMDUNrva7DnIJZ53UqMXvh0wNubHid5eJoxo7YFQuafk1nTpYBcVY2NPlL9Ajjo0CYNIDEt1dygUclsVRtbrKDBxmzahMZswqqHnIC+gaPt3TCgA1FvVw8aXuO9jWcKseJnBauAtfpMKQltMJzTtu4GKgVywnQCcE7buhOA8/ojU+JxLtt6m1D75F01kIBVnMu23pYIGbms/e3DHLZ1ZkLxz49q42s6VHUcNC6Fzi39NHQshY4v/TTauRR2RemngeUq/I6XE1/ZNaWfhtS/PFHpm/zbqwNh4N/ctnjwtc2/LYi4P6Ve+v6Ubd5tw+ZPVH9OPgH+nPGfnLoB3/jHQdiahPg1HGubrxbAd/+geN3TQds8tQJEjmYkYNQ2PyOIOJlsbnpk0jYvo4gYfd0QD9e2+RhH1fNyIaOLaHhtm48VFLvzHM02DwcHBwcHh/8UfwE/2Xk+00CsAAAAAABJRU5ErkJggg==");
pointConf.put("pointimgh", 64);
pointConf.put("pointimgw", 64);
pointConf.put("pointimgtype", "png");
pointConf.put("pointShape", "三角形");
pointConf.put("pointColorList", "#63b2ee|#76da91|#f8cb7f|#f89588|#7cd6cf|#9192ab|#7898e1|#efa666|#eddd86|#9987ce");
pointConf.put("pointColorCustom", true);
pointConf.put("pointColorName", "");
pointConf.put("pointStyleType", 1);
}
return pointConf;
}
public void setPointConf(JSONObject pointConf) {
this.pointConf = pointConf;
}
public JSONObject getHeatConf() {
if (null == heatConf) {
heatConf = new JSONObject();
heatConf.put("bgOpacity", 100);
heatConf.put("interval", 4);
heatConf.put("intervalColors", "#0000ff|#0000ff|#00ff00|#ffea00|#ff0000");
heatConf.put("intervalPos", "0.0|0.1849315|0.47945204|0.760274|1.0");
heatConf.put("maxValue", 1);
heatConf.put("radius", 10);
}
return heatConf;
}
public void setHeatConf(JSONObject heatConf) {
this.heatConf = heatConf;
}
public JSONObject getLegendConf() {
if (null == legendConf) {
legendConf = new JSONObject();
legendConf.put("isLegendVisable", true);
legendConf.put("legendPosition", 1);
legendConf.put("legendsize", 12);
legendConf.put("legendstyle", 0);
legendConf.put("legendfamily", "微软雅黑");
legendConf.put("legendcolor", "#333333");
}
return legendConf;
}
public void setLegendConf(JSONObject legendConf) {
this.legendConf = legendConf;
}
public JSONObject getLabelConf() {
if (null == labelConf) {
labelConf = new JSONObject();
labelConf.put("labelBgColor", "transparent");
labelConf.put("labelJsPane", "");
labelConf.put("labelType", 1);
labelConf.put("labelcolor", "#ff0000");
labelConf.put("labelfamily", "微软雅黑");
labelConf.put("labelsize", 9);
labelConf.put("labelstyle", 0);
labelConf.put("showDataType", true);
labelConf.put("showDesc", false);
labelConf.put("showLat", false);
labelConf.put("showLng", false);
labelConf.put("showLayerType", false);
labelConf.put("showName", false);
labelConf.put("showPointLabel", true);
labelConf.put("showLabelZoom", 13);
}
return labelConf;
}
public void setLabelConf(JSONObject labelConf) {
this.labelConf = labelConf;
}
public NameJavaScriptGroup getLinkNameGroup() {
return linkNameGroup;
}
public void setLinkNameGroup(NameJavaScriptGroup linkNameGroup) {
this.linkNameGroup = linkNameGroup;
}
}

10
src/com/fr/plugin/heatpointmapbox/HeatPointMapChartLocaleFinder.java

@ -0,0 +1,10 @@
package com.fr.plugin.heatpointmapbox;
import com.fr.stable.fun.impl.AbstractLocaleFinder;
public class HeatPointMapChartLocaleFinder extends AbstractLocaleFinder {
@Override
public String find() {
return "com/fr/plugin/heatpointmapbox/locale/heatpointmapbox";
}
}

11
src/com/fr/plugin/heatpointmapbox/HeatPointMapChartProvider.java

@ -0,0 +1,11 @@
package com.fr.plugin.heatpointmapbox;
import com.fr.extended.chart.AbstractChart;
import com.fr.extended.chart.AbstractExtentChartProvider;
public class HeatPointMapChartProvider extends AbstractExtentChartProvider {
@Override
protected AbstractChart createChart() {
return new HeatPointMapChart();
}
}

44
src/com/fr/plugin/heatpointmapbox/HeatPointMapChartUI.java

@ -0,0 +1,44 @@
package com.fr.plugin.heatpointmapbox;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.extended.chart.AbstractExtendedChartTableDataPane;
import com.fr.extended.chart.AbstractExtendedChartUIProvider;
import com.fr.plugin.heatpointmapbox.data.HeatPointMapDataPane;
import com.fr.plugin.heatpointmapbox.data.HeatPointMapReportDataPane;
import com.fr.plugin.heatpointmapbox.ui.HeatPointMapStylePane;
/**
* @author xx
* @date 2022/8/19
*/
public class HeatPointMapChartUI extends AbstractExtendedChartUIProvider {
@Override
protected AbstractExtendedChartTableDataPane getTableDataSourcePane() {
return new HeatPointMapDataPane();
}
@Override
protected AbstractReportDataContentPane getReportDataSourcePane() {
return new HeatPointMapReportDataPane();
}
@Override
public String getIconPath() {
return "com/fr/plugin/heatpointmapbox/images/icon.png";
}
@Override
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener attributeChangeListener) {
return new AbstractChartAttrPane[]{
new HeatPointMapStylePane(attributeChangeListener)
};
}
@Override
public String[] getDemoImagePath() {
return new String[]{"com/fr/plugin/heatpointmapbox/images/demo.png"};
}
}

146
src/com/fr/plugin/heatpointmapbox/data/HeatPointMapDataConfig.java

@ -0,0 +1,146 @@
package com.fr.plugin.heatpointmapbox.data;
import com.fr.extended.chart.AbstractDataConfig;
import com.fr.extended.chart.ExtendedField;
import com.fr.stable.AssistUtils;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
/**
* @author xx
* @date 2022/12/25
*/
public class HeatPointMapDataConfig extends AbstractDataConfig {
private ExtendedField layertype = new ExtendedField();
private ExtendedField datatype = new ExtendedField();
private ExtendedField lng = new ExtendedField();
private ExtendedField lat = new ExtendedField();
private ExtendedField name = new ExtendedField();
private ExtendedField val = new ExtendedField();
private ExtendedField desc = new ExtendedField();
@Override
protected void readAttr(XMLableReader xmLableReader) {
readExtendedField(layertype, "layertype", xmLableReader);
readExtendedField(datatype, "datatype", xmLableReader);
readExtendedField(lng, "lng", xmLableReader);
readExtendedField(lat, "lat", xmLableReader);
readExtendedField(name, "name", xmLableReader);
readExtendedField(val, "val", xmLableReader);
readExtendedField(desc, "desc", xmLableReader);
}
@Override
protected void writeAttr(XMLPrintWriter xmlPrintWriter) {
writeExtendedField(layertype, "layertype", xmlPrintWriter);
writeExtendedField(datatype, "datatype", xmlPrintWriter);
writeExtendedField(lng, "lng", xmlPrintWriter);
writeExtendedField(lat, "lat", xmlPrintWriter);
writeExtendedField(name, "name", xmlPrintWriter);
writeExtendedField(val, "val", xmlPrintWriter);
writeExtendedField(desc, "desc", xmlPrintWriter);
}
@Override
public ExtendedField[] dataSetFields() {
return new ExtendedField[]{
layertype,
datatype,
lng,
lat,
name,
val,
desc
};
}
@Override
public HeatPointMapDataConfig clone() throws CloneNotSupportedException {
HeatPointMapDataConfig result = new HeatPointMapDataConfig();
result.setLayertype(this.getLayertype().clone());
result.setDatatype(this.getDatatype().clone());
result.setLng(this.getLng().clone());
result.setLat(this.getLat().clone());
result.setName(this.getName().clone());
result.setVal(this.getVal().clone());
result.setDesc(this.getDesc().clone());
return result;
}
@Override
public int hashCode() {
return super.hashCode() + AssistUtils.hashCode(this.getLayertype(), this.getDatatype(), this.getLng(), this.getLat(), this.getName(),this.getVal(),this.getDesc());
}
@Override
public boolean equals(Object obj) {
return super.equals(obj)
&& obj instanceof HeatPointMapDataConfig
&& AssistUtils.equals(this.getLayertype(), ((HeatPointMapDataConfig) obj).getLayertype())
&& AssistUtils.equals(this.getDatatype(), ((HeatPointMapDataConfig) obj).getDatatype())
&& AssistUtils.equals(this.getLng(), ((HeatPointMapDataConfig) obj).getLng())
&& AssistUtils.equals(this.getLat(), ((HeatPointMapDataConfig) obj).getLat())
&& AssistUtils.equals(this.getName(), ((HeatPointMapDataConfig) obj).getName())
&& AssistUtils.equals(this.getVal(), ((HeatPointMapDataConfig) obj).getVal())
&& AssistUtils.equals(this.getDesc(), ((HeatPointMapDataConfig) obj).getDesc())
;
}
public ExtendedField getDatatype() {
return datatype;
}
public void setDatatype(ExtendedField datatype) {
this.datatype = datatype;
}
public ExtendedField getLayertype() {
return layertype;
}
public void setLayertype(ExtendedField layertype) {
this.layertype = layertype;
}
public ExtendedField getLng() {
return lng;
}
public void setLng(ExtendedField lng) {
this.lng = lng;
}
public ExtendedField getLat() {
return lat;
}
public void setLat(ExtendedField lat) {
this.lat = lat;
}
public ExtendedField getName() {
return name;
}
public void setName(ExtendedField name) {
this.name = name;
}
public ExtendedField getVal() {
return val;
}
public void setVal(ExtendedField val) {
this.val = val;
}
public ExtendedField getDesc() {
return desc;
}
public void setDesc(ExtendedField desc) {
this.desc = desc;
}
}

74
src/com/fr/plugin/heatpointmapbox/data/HeatPointMapDataPane.java

@ -0,0 +1,74 @@
package com.fr.plugin.heatpointmapbox.data;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.extended.chart.AbstractExtendedChartTableDataPane;
/**
* @author xx
* @date 2022/8/25
*/
public class HeatPointMapDataPane extends AbstractExtendedChartTableDataPane<HeatPointMapDataConfig> {
private UIComboBox layertype;
private UIComboBox datatype;
private UIComboBox lng;
private UIComboBox lat;
private UIComboBox name;
private UIComboBox val;
private UIComboBox desc;
@Override
protected String[] fieldLabels() {
return new String[]{
Toolkit.i18nText("Plugin_HeatPointMap_layertype"),
Toolkit.i18nText("Plugin_HeatPointMap_datatype"),
Toolkit.i18nText("Plugin_HeatPointMap_lng"),
Toolkit.i18nText("Plugin_HeatPointMap_lat"),
Toolkit.i18nText("Plugin_HeatPointMap_name"),
Toolkit.i18nText("Plugin_HeatPointMap_val"),
Toolkit.i18nText("Plugin_HeatPointMap_desc")
};
}
@Override
protected UIComboBox[] filedComboBoxes() {
if (null == datatype) {
layertype = new UIComboBox();
datatype = new UIComboBox();
lng = new UIComboBox();
lat = new UIComboBox();
name = new UIComboBox();
val = new UIComboBox();
desc = new UIComboBox();
}
return new UIComboBox[]{
layertype, datatype, lng, lat, name, val, desc
};
}
@Override
protected void populate(HeatPointMapDataConfig dataConfig) {
populateField(layertype, dataConfig.getLayertype());
populateField(datatype, dataConfig.getDatatype());
populateField(lng, dataConfig.getLng());
populateField(lat, dataConfig.getLat());
populateField(name, dataConfig.getName());
populateField(val, dataConfig.getVal());
populateField(desc, dataConfig.getDesc());
}
@Override
protected HeatPointMapDataConfig update() {
HeatPointMapDataConfig dataConfig = new HeatPointMapDataConfig();
updateField(layertype, dataConfig.getLayertype());
updateField(datatype, dataConfig.getDatatype());
updateField(lng, dataConfig.getLng());
updateField(lat, dataConfig.getLat());
updateField(name, dataConfig.getName());
updateField(val, dataConfig.getVal());
updateField(desc, dataConfig.getDesc());
return dataConfig;
}
}

74
src/com/fr/plugin/heatpointmapbox/data/HeatPointMapReportDataPane.java

@ -0,0 +1,74 @@
package com.fr.plugin.heatpointmapbox.data;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.i18n.Toolkit;
import com.fr.extended.chart.AbstractExtendedChartReportDataPane;
/**
* @author xx
* @date 2022/8/25
*/
public class HeatPointMapReportDataPane extends AbstractExtendedChartReportDataPane<HeatPointMapDataConfig> {
private TinyFormulaPane layertype;
private TinyFormulaPane datatype;
private TinyFormulaPane lng;
private TinyFormulaPane lat;
private TinyFormulaPane name;
private TinyFormulaPane val;
private TinyFormulaPane desc;
@Override
protected String[] fieldLabel() {
return new String[]{
Toolkit.i18nText("Plugin_HeatPointMap_layertype"),
Toolkit.i18nText("Plugin_HeatPointMap_datatype"),
Toolkit.i18nText("Plugin_HeatPointMap_lng"),
Toolkit.i18nText("Plugin_HeatPointMap_lat"),
Toolkit.i18nText("Plugin_HeatPointMap_name"),
Toolkit.i18nText("Plugin_HeatPointMap_val"),
Toolkit.i18nText("Plugin_HeatPointMap_desc")
};
}
@Override
protected TinyFormulaPane[] formulaPanes() {
if (null == datatype) {
layertype = new TinyFormulaPane();
datatype = new TinyFormulaPane();
lng = new TinyFormulaPane();
lat = new TinyFormulaPane();
name = new TinyFormulaPane();
val = new TinyFormulaPane();
desc = new TinyFormulaPane();
}
return new TinyFormulaPane[]{
layertype, datatype, lng, lat, name, val, desc
};
}
@Override
protected void populate(HeatPointMapDataConfig dataConfig) {
populateField(layertype, dataConfig.getLayertype());
populateField(datatype, dataConfig.getDatatype());
populateField(lng, dataConfig.getLng());
populateField(lat, dataConfig.getLat());
populateField(name, dataConfig.getName());
populateField(val, dataConfig.getVal());
populateField(desc, dataConfig.getDesc());
}
@Override
protected HeatPointMapDataConfig update() {
HeatPointMapDataConfig dataConfig = new HeatPointMapDataConfig();
updateField(layertype, dataConfig.getLayertype());
updateField(datatype, dataConfig.getDatatype());
updateField(lng, dataConfig.getLng());
updateField(lat, dataConfig.getLat());
updateField(name, dataConfig.getName());
updateField(val, dataConfig.getVal());
updateField(desc, dataConfig.getDesc());
return dataConfig;
}
}

BIN
src/com/fr/plugin/heatpointmapbox/images/demo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

BIN
src/com/fr/plugin/heatpointmapbox/images/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
src/com/fr/plugin/heatpointmapbox/images/layout_bottom_left.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/com/fr/plugin/heatpointmapbox/images/layout_bottom_right.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/com/fr/plugin/heatpointmapbox/images/layout_top_left.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/com/fr/plugin/heatpointmapbox/images/layout_top_right.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

85
src/com/fr/plugin/heatpointmapbox/locale/heatpointmapbox.properties

@ -0,0 +1,85 @@
Plugin_HeatPointMap_layertype=\u6570\u636E\u5206\u7C7B
Plugin_HeatPointMap_datatype=\u6570\u636E\u7C7B\u578B
Plugin_HeatPointMap_lng=\u7ECF\u5EA6
Plugin_HeatPointMap_lat=\u7EAC\u5EA6
Plugin_HeatPointMap_name=\u540D\u79F0
Plugin_HeatPointMap_val=\u6570\u503C
Plugin_HeatPointMap_desc=\u63CF\u8FF0
Plugin-HeatPointMap-isVisiableTitle=\u663E\u793A\u6807\u9898
Plugin-HeatPointMap-titleBgColor=\u80CC\u666F\u989C\u8272
Plugin-HeatPointMap-titleBgOpacity=\u4E0D\u900F\u660E\u5EA6
Plugin-HeatPointMap-TitleText=\u540D\u79F0
Plugin-HeatPointMap-TitlePosition=\u4F4D\u7F6E
Plugin-HeatPointMap-TitleExpand=\u6807\u9898\u8BBE\u7F6E
Plugin-HeatPointMap-TitleStyle=\u6807\u9898\u6837\u5F0F
Plugin-HeatPointMap-maptitle=\u5730\u56FE
Plugin-HeatPointMap-mapzoom=\u5730\u56FE\u7EA7\u522B
Plugin-HeatPointMap-centerx=\u4E2D\u5FC3\u70B9\u7ECF\u5EA6
Plugin-HeatPointMap-centery=\u4E2D\u5FC3\u70B9\u7EAC\u5EA6
Plugin-HeatPointMap-mapStyle=\u5730\u56FE\u6837\u5F0F
Plugin-HeatPointMap-mapKey=\u5730\u56FELicense
Plugin-HeatPointMap-BaseMapExpand=\u5730\u56FE\u53C2\u6570\u8BBE\u7F6E
Plugin-HeatPointMap-pointtitle=\u70B9\u5730\u56FE
Plugin-HeatPointMap-pointSize=\u70B9\u5927\u5C0F
Plugin-HeatPointMap-pointMapExpand=\u70B9\u6837\u5F0F\u914D\u7F6E
Plugin-HeatPointMap-pointStyleType=\u70B9\u56FE\u6807\u65B9\u6848
Plugin-HeatPointMap-pointStyleTypeImg=\u56FE\u7247
Plugin-HeatPointMap-pointStyleTypeColor=\u989C\u8272
Plugin-HeatPointMap-pointShape=\u5F62\u72B6
Plugin-HeatPointMap-heattitle=\u70ED\u529B\u56FE
Plugin-HeatPointMap-heatradius=\u534A\u5F84
Plugin-HeatPointMap-heatmaxValue=\u6700\u5927\u503C
Plugin-HeatPointMap-heatbgOpacity=\u4E0D\u900F\u660E\u5EA6
Plugin-HeatPointMap-heatinterval=\u5212\u5206\u9636\u6BB5
Plugin-HeatPointMap-heatMapExpand=\u70ED\u529B\u6837\u5F0F\u914D\u7F6E
Plugin-HeatPointMap-showPointLabel=\u663E\u793A\u70B9\u6807\u7B7E
Plugin-HeatPointMap-labelBgColor=\u80CC\u666F\u989C\u8272
Plugin-HeatPointMap-labelstitle=\u6807\u7B7E
Plugin-HeatPointMap-labelTypeCheck=\u9009\u9879
Plugin-HeatPointMap-labelTypeJS=JS\u811A\u672C
Plugin-HeatPointMap-showName=\u540D\u79F0
Plugin-HeatPointMap-showLng=\u7ECF\u5EA6
Plugin-HeatPointMap-showLat=\u7EAC\u5EA6
Plugin-HeatPointMap-showDesc=\u63CF\u8FF0
Plugin-HeatPointMap-labelType=\u53D6\u503C\u65B9\u5F0F
Plugin-HeatPointMap-labelAlignExpand=\u6807\u7B7E\u65B9\u5F0F
Plugin-HeatPointMap-LabelsTextStyle=\u6587\u672C\u6837\u5F0F
Plugin-HeatPointMap-showLabelZoom=\u663E\u793A\u6807\u7B7E\u5C42\u7EA7
Plugin-HeatPointMap-showPointTips=\u663E\u793A\u60AC\u6D6E\u63D0\u793A\u6846
Plugin-HeatPointMap-tipstitle=\u63D0\u793A
Plugin-HeatPointMap-showLayerType=\u6570\u636E\u5206\u7C7B
Plugin-HeatPointMap-showDataType=\u6570\u636E\u7C7B\u578B
Plugin-HeatPointMap-tipBgColor=\u80CC\u666F\u989C\u8272
Plugin-HeatPointMap-tipBgOpacity=\u4E0D\u900F\u660E\u5EA6
Plugin-HeatPointMap-tipsAlignExpand=\u63D0\u793A\u80CC\u666F
Plugin-HeatPointMap-tipsTextStyle=\u63D0\u793A\u6587\u672C
Plugin-HeatPointMap-otherstitle=\u7279\u6548
Plugin-HeatPointMap-LinkExpand=\u8D85\u7EA7\u94FE\u63A5\u914D\u7F6E
Plugin-HeatPointMap-pointStyleCondExpand=\u6761\u4EF6\u5C5E\u6027\u914D\u7F6E
Plugin-HeatPointMap-Cond-pointStyle=\u70B9\u6837\u5F0F
Plugin-HeatPointMap-Cond-AddCondtion=\u6DFB\u52A0
Plugin-HeatPointMap-Cond-pointMapTitle=\u5730\u56FE\u70B9\u6761\u4EF6\u5C5E\u6027
Plugin-HeatPointMap-Cond-pointSize=\u70B9\u5927\u5C0F
Plugin-HeatPointMap-Cond-PointMapStyleExpand=\u6837\u5F0F\u914D\u7F6E
Plugin-HeatPointMap-Cond-typeNameLabel=\u6570\u636E\u5206\u7C7B
Plugin-HeatPointMap-Cond-dataTypeLabel=\u6570\u636E\u7C7B\u578B
Plugin-HeatPointMap-Cond-valueNameLabel=\u6570\u503C
Plugin-HeatPointMap-Cond-addButton=\u6DFB\u52A0
Plugin-HeatPointMap-Cond-clearButton=\u6E05\u7A7A\u6761\u4EF6
Plugin-HeatPointMap-Cond-condTaskStyleTitle=\u6761\u4EF6\u914D\u7F6E
Plugin-HeatPointMap-isLegendVisable=\u663E\u793A\u56FE\u4F8B
Plugin-HeatPointMap-Alignment-LeftTop=\u5DE6\u4E0A
Plugin-HeatPointMap-Alignment-RightTop=\u53F3\u4E0A
Plugin-HeatPointMap-Alignment-RightBottom=\u53F3\u4E0B
Plugin-HeatPointMap-Alignment-LeftBottom=\u5DE6\u4E0B
Plugin-HeatPointMap-legendPosition=\u4F4D\u7F6E
Plugin-HeatPointMap-legendPositionExpand=\u56FE\u4F8B\u5E03\u5C40
Plugin-HeatPointMap-LegendStyle=\u56FE\u4F8B\u6837\u5F0F

85
src/com/fr/plugin/heatpointmapbox/locale/heatpointmapbox_zh_CN.properties

@ -0,0 +1,85 @@
Plugin_HeatPointMap_layertype=\u6570\u636E\u5206\u7C7B
Plugin_HeatPointMap_datatype=\u6570\u636E\u7C7B\u578B
Plugin_HeatPointMap_lng=\u7ECF\u5EA6
Plugin_HeatPointMap_lat=\u7EAC\u5EA6
Plugin_HeatPointMap_name=\u540D\u79F0
Plugin_HeatPointMap_val=\u6570\u503C
Plugin_HeatPointMap_desc=\u63CF\u8FF0
Plugin-HeatPointMap-isVisiableTitle=\u663E\u793A\u6807\u9898
Plugin-HeatPointMap-titleBgColor=\u80CC\u666F\u989C\u8272
Plugin-HeatPointMap-titleBgOpacity=\u4E0D\u900F\u660E\u5EA6
Plugin-HeatPointMap-TitleText=\u540D\u79F0
Plugin-HeatPointMap-TitlePosition=\u4F4D\u7F6E
Plugin-HeatPointMap-TitleExpand=\u6807\u9898\u8BBE\u7F6E
Plugin-HeatPointMap-TitleStyle=\u6807\u9898\u6837\u5F0F
Plugin-HeatPointMap-maptitle=\u5730\u56FE
Plugin-HeatPointMap-mapzoom=\u5730\u56FE\u7EA7\u522B
Plugin-HeatPointMap-centerx=\u4E2D\u5FC3\u70B9\u7ECF\u5EA6
Plugin-HeatPointMap-centery=\u4E2D\u5FC3\u70B9\u7EAC\u5EA6
Plugin-HeatPointMap-mapStyle=\u5730\u56FE\u6837\u5F0F
Plugin-HeatPointMap-mapKey=\u5730\u56FELicense
Plugin-HeatPointMap-BaseMapExpand=\u5730\u56FE\u53C2\u6570\u8BBE\u7F6E
Plugin-HeatPointMap-pointtitle=\u70B9\u5730\u56FE
Plugin-HeatPointMap-pointSize=\u70B9\u5927\u5C0F
Plugin-HeatPointMap-pointMapExpand=\u70B9\u6837\u5F0F\u914D\u7F6E
Plugin-HeatPointMap-pointStyleType=\u70B9\u56FE\u6807\u65B9\u6848
Plugin-HeatPointMap-pointStyleTypeImg=\u56FE\u7247
Plugin-HeatPointMap-pointStyleTypeColor=\u989C\u8272
Plugin-HeatPointMap-pointShape=\u5F62\u72B6
Plugin-HeatPointMap-heattitle=\u70ED\u529B\u56FE
Plugin-HeatPointMap-heatradius=\u534A\u5F84
Plugin-HeatPointMap-heatmaxValue=\u6700\u5927\u503C
Plugin-HeatPointMap-heatbgOpacity=\u4E0D\u900F\u660E\u5EA6
Plugin-HeatPointMap-heatinterval=\u5212\u5206\u9636\u6BB5
Plugin-HeatPointMap-heatMapExpand=\u70ED\u529B\u6837\u5F0F\u914D\u7F6E
Plugin-HeatPointMap-showPointLabel=\u663E\u793A\u70B9\u6807\u7B7E
Plugin-HeatPointMap-labelBgColor=\u80CC\u666F\u989C\u8272
Plugin-HeatPointMap-labelstitle=\u6807\u7B7E
Plugin-HeatPointMap-labelTypeCheck=\u9009\u9879
Plugin-HeatPointMap-labelTypeJS=JS\u811A\u672C
Plugin-HeatPointMap-showName=\u540D\u79F0
Plugin-HeatPointMap-showLng=\u7ECF\u5EA6
Plugin-HeatPointMap-showLat=\u7EAC\u5EA6
Plugin-HeatPointMap-showDesc=\u63CF\u8FF0
Plugin-HeatPointMap-labelType=\u53D6\u503C\u65B9\u5F0F
Plugin-HeatPointMap-labelAlignExpand=\u6807\u7B7E\u65B9\u5F0F
Plugin-HeatPointMap-LabelsTextStyle=\u6587\u672C\u6837\u5F0F
Plugin-HeatPointMap-showLabelZoom=\u663E\u793A\u6807\u7B7E\u5C42\u7EA7
Plugin-HeatPointMap-showPointTips=\u663E\u793A\u60AC\u6D6E\u63D0\u793A\u6846
Plugin-HeatPointMap-tipstitle=\u63D0\u793A
Plugin-HeatPointMap-showLayerType=\u6570\u636E\u5206\u7C7B
Plugin-HeatPointMap-showDataType=\u6570\u636E\u7C7B\u578B
Plugin-HeatPointMap-tipBgColor=\u80CC\u666F\u989C\u8272
Plugin-HeatPointMap-tipBgOpacity=\u4E0D\u900F\u660E\u5EA6
Plugin-HeatPointMap-tipsAlignExpand=\u63D0\u793A\u80CC\u666F
Plugin-HeatPointMap-tipsTextStyle=\u63D0\u793A\u6587\u672C
Plugin-HeatPointMap-otherstitle=\u7279\u6548
Plugin-HeatPointMap-LinkExpand=\u8D85\u7EA7\u94FE\u63A5\u914D\u7F6E
Plugin-HeatPointMap-pointStyleCondExpand=\u6761\u4EF6\u5C5E\u6027\u914D\u7F6E
Plugin-HeatPointMap-Cond-pointStyle=\u70B9\u6837\u5F0F
Plugin-HeatPointMap-Cond-AddCondtion=\u6DFB\u52A0
Plugin-HeatPointMap-Cond-pointMapTitle=\u5730\u56FE\u70B9\u6761\u4EF6\u5C5E\u6027
Plugin-HeatPointMap-Cond-pointSize=\u70B9\u5927\u5C0F
Plugin-HeatPointMap-Cond-PointMapStyleExpand=\u6837\u5F0F\u914D\u7F6E
Plugin-HeatPointMap-Cond-typeNameLabel=\u6570\u636E\u5206\u7C7B
Plugin-HeatPointMap-Cond-dataTypeLabel=\u6570\u636E\u7C7B\u578B
Plugin-HeatPointMap-Cond-valueNameLabel=\u6570\u503C
Plugin-HeatPointMap-Cond-addButton=\u6DFB\u52A0
Plugin-HeatPointMap-Cond-clearButton=\u6E05\u7A7A\u6761\u4EF6
Plugin-HeatPointMap-Cond-condTaskStyleTitle=\u6761\u4EF6\u914D\u7F6E
Plugin-HeatPointMap-isLegendVisable=\u663E\u793A\u56FE\u4F8B
Plugin-HeatPointMap-Alignment-LeftTop=\u5DE6\u4E0A
Plugin-HeatPointMap-Alignment-RightTop=\u53F3\u4E0A
Plugin-HeatPointMap-Alignment-RightBottom=\u53F3\u4E0B
Plugin-HeatPointMap-Alignment-LeftBottom=\u5DE6\u4E0B
Plugin-HeatPointMap-legendPosition=\u4F4D\u7F6E
Plugin-HeatPointMap-legendPositionExpand=\u56FE\u4F8B\u5E03\u5C40
Plugin-HeatPointMap-LegendStyle=\u56FE\u4F8B\u6837\u5F0F

75
src/com/fr/plugin/heatpointmapbox/ui/CustomChartFillStylePane.java

@ -0,0 +1,75 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.chart.base.AttrFillStyle;
import com.fr.design.gui.icombobox.ColorSchemeComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerBean;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.predefined.ui.detail.ColorFillStylePane;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
/**
* @author xx
* @date 2022/10/11
*/
public class CustomChartFillStylePane extends ColorFillStylePane implements DesignerBean {
public static final String name = "customChartFillStyle";
public CustomChartFillStylePane() {
DesignerContext.setDesignerBean("customChartFillStyle", this);
}
@Override
protected void styleSelectBoxChange() {
super.styleSelectBoxChange();
}
@Override
protected ColorSchemeComboBox createColorSchemeComboBox() {
return new CustomColorSchemeComboBox();
}
@Override
protected void initLayout() {
super.initLayout();
this.add(this.getContentPane(), "Center");
}
@Override
protected JPanel getContentPane() {
JPanel var1 = super.getContentPane();
var1.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
return var1;
}
@Override
protected Component[][] contentPaneComponents() {
return new Component[][]{{null, null}, {new UILabel(Toolkit.i18nText("Fine-Design_Chart_Match_Color_Scheme")), this.getStyleSelectBox()}, {null, this.getCustomPane()}};
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Color");
}
public void populateBean(AttrFillStyle var1) {
this.populateBean(var1.getColorFillStyle());
}
public void updateBean(AttrFillStyle var1) {
var1.setColorFillStyle(this.updateBean());
}
@Override
public void refreshBeanElement() {
AttrFillStyle var1 = new AttrFillStyle();
this.updateBean(var1);
this.getStyleSelectBox().refresh();
this.populateBean(var1);
GUICoreUtils.repaint(this);
}
}

45
src/com/fr/plugin/heatpointmapbox/ui/CustomColorSchemeComboBox.java

@ -0,0 +1,45 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.design.gui.icombobox.ColorSchemeComboBox;
import com.fr.design.i18n.Toolkit;
import java.util.Map;
/**
* @author xx
* @date 2022/10/11
*/
public class CustomColorSchemeComboBox extends ColorSchemeComboBox {
@Override
protected Map<String, ColorInfo> getColorSchemesFromConfig() {
Map<String, ColorInfo> schemesConfig = super.getColorSchemesFromConfig();
schemesConfig.remove(Toolkit.i18nText("Fine-Design_Chart_Custom_Gradient"));
return schemesConfig;
}
@Override
public SelectType getSelectType() {
int var1 = this.getSelectedIndex();
int var2 = this.getItemCount();
if (var1 == var2 - 1) {
return SelectType.COMBINATION_COLOR;
} else {
return SelectType.NORMAL;
}
}
@Override
public void setSelectType(SelectType var1) {
int var2 = this.getItemCount();
switch(var1) {
case DEFAULT:
this.setSelectedIndex(0);
break;
case COMBINATION_COLOR:
this.setSelectedIndex(var2 - 1);
}
}
}

55
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapHyperLink.java

@ -0,0 +1,55 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.base.BaseFormula;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.js.NameJavaScriptGroup;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import com.fr.van.chart.custom.component.VanChartHyperLinkPane;
import java.util.Map;
public class HeatPointMapHyperLink extends VanChartHyperLinkPane {
private HeatPointMapChart chart;
public void populateBean(HeatPointMapChart paramAbstractECharts) {
this.chart = paramAbstractECharts;
populate(paramAbstractECharts.getPlot());
}
public void updateBean(HeatPointMapChart paramAbstractECharts) {
update(paramAbstractECharts.getPlot());
}
@Override
public NameableCreator[] createNameableCreators() {
return super.createNameableCreators();
}
@Override
public BasicBeanPane createPaneByCreators(NameableCreator nameableCreator) {
return super.createPaneByCreators(nameableCreator);
}
@Override
protected Map<String, BaseFormula> getHyperLinkEditorMap() {
return this.chart.getHyperLinkEditorMap();
}
@Override
public void refreshNameableCreator(NameableCreator[] nameableCreators) {
super.refreshNameableCreator(nameableCreators);
}
@Override
protected NameJavaScriptGroup populateHotHyperLink(Plot paramPlot) {
return this.chart.getLinkNameGroup();
}
@Override
protected void updateHotHyperLink(Plot paramPlot, NameJavaScriptGroup paramNameJavaScriptGroup) {
this.chart.setLinkNameGroup(paramNameJavaScriptGroup);
}
}

141
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapPointCondListPane.java

@ -0,0 +1,141 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.i18n.Toolkit;
import com.fr.general.NameObject;
import com.fr.json.JSONArray;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import com.fr.plugin.heatpointmapbox.vo.CustomJsonObject;
import com.fr.plugin.heatpointmapbox.vo.PointMapStyleJson;
import com.fr.stable.ListMap;
import com.fr.stable.Nameable;
import com.fr.van.chart.designer.component.VanChartUIListControlPane;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
/**
* @author xx
*/
public class HeatPointMapPointCondListPane extends VanChartUIListControlPane {
private HeatPointMapChart chart;
private HashMap paneMap;
private HashMap jsonMap;
public HeatPointMapPointCondListPane() {
paneMap = new HashMap(6);
paneMap.put(CustomJsonObject.POINT_MAP_TITLE, HeatPointMapPointStyleCreator.class);
jsonMap = new HashMap(6);
jsonMap.put(CustomJsonObject.POINT_MAP_TITLE, PointMapStyleJson.class);
}
@Override
protected void update(Plot plot) {
}
public void populateStyle(HeatPointMapChart chart) {
this.chart = chart;
JSONArray pointStyleCond = chart.getPointStyleCond();
ArrayList noList = new ArrayList();
for (int i = 0; null != pointStyleCond && i < pointStyleCond.size(); i++) {
JSONObject line = pointStyleCond.getJSONObject(i);
if (null != line) {
try {
CustomJsonObject json = (CustomJsonObject)this.getJsonByTitle(line.getString("title")).newInstance();
json.put(line);
UIMenuNameableCreator var11 = new UIMenuNameableCreator(line.getString("titleName"), json, this.getEditPaneByTitle(line.getString("title")));
noList.add(new NameObject(var11.getName(), var11.getObj()));
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
this.populate((Nameable[])noList.toArray(new NameObject[noList.size()]));
this.doLayout();
}
public void updateStyle(HeatPointMapChart chart) {
Nameable[] nameables = this.update();
JSONArray objConf = JSONArray.create();
for (int i = 0; i < nameables.length; i++) {
CustomJsonObject noObj = (CustomJsonObject)((NameObject)nameables[i]).getObject();
if (null == noObj) {
noObj = new CustomJsonObject();
noObj.put(JSONObject.create());
}
if (null == noObj.get()) {
noObj.put(JSONObject.create());
}
noObj.get().put("titleName", ((NameObject)nameables[i]).getName());
objConf.add(noObj.get());
}
chart.setPointStyleCond(objConf);
}
@Override
public NameableCreator[] createNameableCreators() {
ListMap creatorMap = new ListMap();
NameableCreator mon = new NameObjectCreator(Toolkit.i18nText("Plugin-HeatPointMap-Cond-pointStyle"), PointMapStyleJson.class, HeatPointMapPointStyleCreator.class);
creatorMap.put(mon.menuName(), mon);
return (NameableCreator[])creatorMap.values().toArray(new NameableCreator[creatorMap.size()]);
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Plugin-HeatPointMap-Cond-AddCondtion");
}
@Override
protected String getAddItemText() {
return Toolkit.i18nText("Plugin-HeatPointMap-Cond-AddCondtion");
}
@Override
public BasicBeanPane createPaneByCreators(NameableCreator nameableCreator) {
Constructor var2 = null;
try {
var2 = nameableCreator.getUpdatePane().getConstructor();
return (BasicBeanPane)var2.newInstance();
} catch (InstantiationException var4) {
FineLoggerFactory.getLogger().error(var4.getMessage(), var4);
} catch (IllegalAccessException var5) {
FineLoggerFactory.getLogger().error(var5.getMessage(), var5);
} catch (NoSuchMethodException var6) {
return super.createPaneByCreators(nameableCreator);
} catch (InvocationTargetException var7) {
FineLoggerFactory.getLogger().error(var7.getMessage(), var7);
}
return null;
}
private Class<? extends BasicBeanPane> getEditPaneByTitle(String title) {
return (Class)paneMap.get(title);
}
private Class getJsonByTitle(String title) {
return (Class)jsonMap.get(title);
}
}

223
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapPointStyleCreator.java

@ -0,0 +1,223 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.json.JSONObject;
import com.fr.plugin.heatpointmapbox.vo.CustomJsonObject;
import com.fr.plugin.heatpointmapbox.vo.PointMapStyleJson;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author xx
*/
public class HeatPointMapPointStyleCreator extends AbstractVanChartScrollPane<CustomJsonObject> {
private UITextArea condition;
private UITextField legendName;
private UISpinner pointSize;
private ImageChooserPane pointPane;
@Override
protected JPanel createContentPane() {
return new ContentPane();
}
@Override
public void populateBean(CustomJsonObject json) {
JSONObject chartConf = null;
if (null != json) {
chartConf = json.get();
}
if (null != chartConf) {
this.legendName.setText(chartConf.getString("legendName"));
this.pointSize.setValue(chartConf.getDouble("pointSize"));
this.condition.setText(chartConf.getString("condition"));
ImageEntity imgEnt = new ImageEntity();
imgEnt.setImagestr(chartConf.getString("pointimg"));
imgEnt.setImagetype(chartConf.getString("pointimgtype"));
imgEnt.setWidth(chartConf.getInt("pointimgw"));
imgEnt.setHeight(chartConf.getInt("pointimgh"));
this.pointPane.populateBean(imgEnt);
}
}
@Override
public CustomJsonObject updateBean() {
JSONObject chartConf = JSONObject.create();
chartConf.put("legendName", this.legendName.getText());
chartConf.put("pointSize", this.pointSize.getValue());
chartConf.put("condition", this.condition.getText());
ImageEntity imgEnt = this.pointPane.updateBean();
if (null != imgEnt) {
chartConf.put("pointimg", imgEnt.getImagestr());
chartConf.put("pointimgtype", imgEnt.getImagetype());
chartConf.put("pointimgw", imgEnt.getWidth());
chartConf.put("pointimgh", imgEnt.getHeight());
}
PointMapStyleJson json = new PointMapStyleJson();
chartConf.put("title", json.getTilte());
json.put(chartConf);
return json;
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Plugin-HeatPointMap-Cond-pointMapTitle");
}
protected class ContentPane extends JPanel {
public ContentPane() {
initComponents();
}
private void initComponents() {
this.setLayout(new BorderLayout());
JPanel condPane = createConditionPane();
JPanel stylePane = createStylePane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] acomponents = new Component[][]{
new Component[]{condPane},
new Component[]{stylePane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(acomponents, rowSize, columnSize);
this.add(panel, BorderLayout.CENTER);
this.setVisible(true);
}
}
private JPanel createStylePane() {
this.legendName = new UITextField();
this.pointSize = new UISpinner(0, 1000, 1, 32);
this.pointPane = new ImageChooserPane();
Component[][] components = new Component[][]{
{null, null},
//new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-Cond-legendName")), this.legendName},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-Cond-pointSize")), this.pointSize}
};
double p = TableLayout.PREFERRED;
double[] columnSize = {TableLayout.PREFERRED, TableLayout.FILL};
double[] rowSize = {p, p, p};
JPanel sizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
Component[][] comp1 = new Component[][]{
new Component[]{sizePane},
new Component[]{pointPane}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(comp1, new double[]{p, p, p}, new double[]{TableLayout.FILL});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-Cond-PointMapStyleExpand"), panel);
}
private JPanel createConditionPane() {
condition = new UITextArea(3, 6);
final UITextField typevalue = new UITextField();
final UIComboBox typecond = new UIComboBox(new String[]{"=="});
UILabel type = new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-Cond-typeNameLabel"));
UIButton addType = new UIButton(Toolkit.i18nText("Plugin-HeatPointMap-Cond-addButton"));
final UITextField datavalue = new UITextField();
final UIComboBox datacond = new UIComboBox(new String[]{"=="});
UILabel data = new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-Cond-dataTypeLabel"));
UIButton addData = new UIButton(Toolkit.i18nText("Plugin-HeatPointMap-Cond-addButton"));
final UITextField value = new UITextField();
final UIComboBox cond = new UIComboBox(new String[]{"==", ">", "<"});
UILabel name = new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-Cond-valueNameLabel"));
UIButton add = new UIButton(Toolkit.i18nText("Plugin-HeatPointMap-Cond-addButton"));
UIButton clear = new UIButton(Toolkit.i18nText("Plugin-HeatPointMap-Cond-clearButton"));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
Component[][] components = new Component[][]{
new Component[]{type, typecond, typevalue, addType, null},
new Component[]{data, datacond, datavalue, addData, null},
new Component[]{name, cond, value, add, clear}
};
JPanel condPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p, p, p}, new double[]{p, p, f, p, p});
Component[][] comp1 = new Component[][]{
new Component[]{condition}
};
JPanel areaPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comp1, new double[]{p}, new double[]{f});
Component[][] comp = new Component[][]{
new Component[]{condPane},
new Component[]{areaPane}
};
JPanel sumPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comp, new double[]{p, p}, new double[]{f});
condition.setEnabled(false);
add.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String srcStr = condition.getText();
if (null != srcStr && !"".equals(srcStr)) {
srcStr += " && ";
}
String condstr = "{数值} " + cond.getSelectedItem() + " " + value.getText();
condition.setText(srcStr + condstr);
}
});
addData.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String srcStr = condition.getText();
if (null != srcStr && !"".equals(srcStr)) {
srcStr += " && ";
}
String condstr = "'{数据类型}' " + datacond.getSelectedItem() + " '" + datavalue.getText() + "'";
condition.setText(srcStr + condstr);
}
});
addType.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String srcStr = condition.getText();
if (null != srcStr && !"".equals(srcStr)) {
srcStr += " && ";
}
String condstr = "'{数据分类}' " + typecond.getSelectedItem() + " '" + typevalue.getText() + "'";
condition.setText(srcStr + condstr);
}
});
clear.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
condition.setText("");
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-Cond-condTaskStyleTitle"), sumPane);
}
}

115
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleBaseMapPane.java

@ -0,0 +1,115 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.extended.chart.ExtendedScrollPane;
import com.fr.json.JSONObject;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*;
/**
* @author xx
*/
public class HeatPointMapStyleBaseMapPane extends ExtendedScrollPane<HeatPointMapChart> {
private UISpinner mapzoom;
private UITextField centerx;
private UITextField centery;
private UITextField mapStyle;
private UITextField mapKey;
@Override
protected JPanel createContentPane() {
return new ContentPane();
}
@Override
public void populateBean(HeatPointMapChart chart) {
JSONObject regionConf = chart.getMapConf();
this.mapzoom.setValue(regionConf.getDouble("mapzoom"));
this.centerx.setText(regionConf.getString("centerx"));
this.centery.setText(regionConf.getString("centery"));
this.mapStyle.setText(regionConf.getString("mapStyle"));
this.mapKey.setText(regionConf.getString("mapKey"));
}
@Override
public void updateBean(HeatPointMapChart chart) {
JSONObject regionConf = JSONObject.create();
regionConf.put("mapzoom", this.mapzoom.getValue());
regionConf.put("centerx", this.centerx.getText());
regionConf.put("centery", this.centery.getText());
regionConf.put("mapStyle", this.mapStyle.getText());
regionConf.put("mapKey", this.mapKey.getText());
chart.setMapConf(regionConf);
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Plugin-HeatPointMap-maptitle");
}
private class ContentPane extends JPanel {
public ContentPane() {
initComponents();
}
private void initComponents() {
this.setLayout(new BorderLayout());
JPanel mapContentPane = createMapContentPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] acomponents = new Component[][]{
new Component[]{mapContentPane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(acomponents,rowSize,columnSize);
this.add(panel,BorderLayout.CENTER);
this.setVisible(true);
}
}
private JPanel createMapContentPane(){
mapzoom = new UISpinner(1, 18, 1, 1);
centerx = new UITextField();
centery = new UITextField();
mapStyle = new UITextField();
mapKey = new UITextField();
Component[][] components = new Component[][]{
{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-mapzoom")), this.mapzoom},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-centerx")), this.centerx},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-centery")), this.centery},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-mapStyle")), this.mapStyle},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-mapKey")), this.mapKey}
} ;
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
JPanel pane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p, p, p, p, p}, new double[]{p, f});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-BaseMapExpand"), pane);
}
}

159
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleHeatMapPane.java

@ -0,0 +1,159 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.extended.chart.ExtendedScrollPane;
import com.fr.json.JSONObject;
import com.fr.plugin.chart.range.GradualIntervalConfig;
import com.fr.plugin.chart.range.glyph.GradualColorDist;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.range.component.LegendGradientBar;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.util.ArrayList;
/**
* @author xx
*/
public class HeatPointMapStyleHeatMapPane extends ExtendedScrollPane<HeatPointMapChart> {
private UISpinner radius;
private UISpinner maxValue;
private UINumberDragPane bgOpacity;
private UINumberDragPane interval;
private LegendGradientBar intervalLegend;
@Override
protected JPanel createContentPane() {
return new ContentPane();
}
@Override
public void populateBean(HeatPointMapChart chart) {
JSONObject heatConf = chart.getHeatConf();
this.radius.setValue(heatConf.getDouble("radius"));
this.maxValue.setValue(heatConf.getDouble("maxValue"));
this.bgOpacity.populateBean(heatConf.getDouble("bgOpacity"));
this.interval.populateBean(heatConf.getDouble("interval"));
GradualIntervalConfig intervalConfig = new GradualIntervalConfig();
String intervalColors = heatConf.getString("intervalColors");
String intervalPos = heatConf.getString("intervalPos");
if (StringUtils.isNotEmpty(intervalColors)
&& StringUtils.isNotEmpty(intervalPos)) {
String[] intervalArr = intervalColors.split("\\|");
String[] intervalPosArr = intervalPos.split("\\|");
ArrayList<GradualColorDist> colorsList = new ArrayList();
for (int i = 0; i < intervalArr.length; i++) {
colorsList.add(new GradualColorDist(Float.parseFloat(intervalPosArr[i]), MapUtil.toColor(intervalArr[i])));
}
intervalConfig.setDivStage(intervalArr.length - 1);
intervalConfig.setGradualColorDistList(colorsList);
}
intervalLegend.populate(intervalConfig);
}
@Override
public void updateBean(HeatPointMapChart chart) {
JSONObject heatConf = JSONObject.create();
heatConf.put("radius", this.radius.getValue());
heatConf.put("maxValue", this.maxValue.getValue());
heatConf.put("bgOpacity", this.bgOpacity.updateBean());
heatConf.put("interval", this.interval.updateBean());
GradualIntervalConfig intervalConfig = new GradualIntervalConfig();
intervalLegend.update(intervalConfig);
ArrayList<GradualColorDist> colorsList = intervalConfig.getGradualColorDistList();
String intervalColors = "";
String intervalPos = "";
if (null != colorsList && colorsList.size() > 0) {
for (int i = 0; i < colorsList.size(); i++) {
if (i > 0) {
intervalColors += "|";
intervalPos += "|";
}
intervalColors += MapUtil.toHex(colorsList.get(i).getColor());
intervalPos += colorsList.get(i).getPosition();
}
}
heatConf.put("intervalColors", intervalColors);
heatConf.put("intervalPos", intervalPos);
chart.setHeatConf(heatConf);
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Plugin-HeatPointMap-heattitle");
}
private class ContentPane extends JPanel {
public ContentPane() {
initComponents();
}
private void initComponents() {
this.setLayout(new BorderLayout());
JPanel regionContentPane = createHeatContentPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] acomponents = new Component[][]{
new Component[]{regionContentPane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(acomponents, rowSize, columnSize);
this.add(panel, BorderLayout.CENTER);
this.setVisible(true);
}
}
private JPanel createHeatContentPane() {
radius = new UISpinner(1, 10000, 1, 30);
maxValue = new UISpinner(1, 10000000, 1, 1);
bgOpacity = new UINumberDragPane(0, 100);
interval = new UINumberDragPane(1, 6);
intervalLegend = new LegendGradientBar();
interval.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
Double num = interval.updateBean();
intervalLegend.refreshColorSelectionBtnNum(num.intValue());
}
});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
Component[][] components = new Component[][]{
{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-heatradius")), this.radius},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-heatmaxValue")), this.maxValue},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-heatbgOpacity")), this.bgOpacity},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-heatinterval")), this.interval},
new Component[]{null, this.intervalLegend}
};
JPanel sizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p, p, p, p, p}, new double[]{p, f});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-heatMapExpand"), sizePane);
}
}

209
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleLabelsPane.java

@ -0,0 +1,209 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.chart.base.TextAttr;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.extended.chart.ExtendedScrollPane;
import com.fr.general.FRFont;
import com.fr.json.JSONObject;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
/**
* @author xx
*/
public class HeatPointMapStyleLabelsPane extends ExtendedScrollPane<HeatPointMapChart> {
private UICheckBox showPointLabel;
private ColorSelectBox labelBgColor;
private UIButtonGroup<Integer> labelType;
private UICheckBox showLayerType;
private UICheckBox showDataType;
private UICheckBox showName;
private UICheckBox showLng;
private UICheckBox showLat;
private UICheckBox showDesc;
private UITextArea labelJsPane;
private CardLayout cardLayout;
private JPanel cardPane;
private ChartTextAttrPane textAttrPane;
private UISpinner showLabelZoom;
@Override
protected JPanel createContentPane() {
return new ContentPane();
}
@Override
public void populateBean(HeatPointMapChart chart) {
JSONObject labelConf = chart.getLabelConf();
this.showPointLabel.setSelected(labelConf.getBoolean("showPointLabel"));
this.showLabelZoom.setValue(labelConf.getDouble("showLabelZoom"));
this.labelBgColor.setSelectObject(MapUtil.toColor(labelConf.getString("labelBgColor")));
this.labelType.setSelectedItem(labelConf.getInt("labelType"));
this.showLayerType.setSelected(labelConf.getBoolean("showLayerType"));
this.showDataType.setSelected(labelConf.getBoolean("showDataType"));
this.showName.setSelected(labelConf.getBoolean("showName"));
this.showLng.setSelected(labelConf.getBoolean("showLng"));
this.showLat.setSelected(labelConf.getBoolean("showLat"));
this.showDesc.setSelected(labelConf.getBoolean("showDesc"));
labelJsPane.setText(labelConf.getString("labelJsPane"));
FRFont labelFont = FRFont.getInstance(labelConf.getString("labelfamily"),
labelConf.getInt("labelstyle"),
labelConf.getInt("labelsize"),
MapUtil.toColor(labelConf.getString("labelcolor")));
this.textAttrPane.populate(labelFont);
if (labelConf.getInt("labelType") == 2) {
this.cardLayout.show(cardPane, "js");
}
}
@Override
public void updateBean(HeatPointMapChart chart) {
JSONObject labelConf = JSONObject.create();
labelConf.put("showPointLabel", this.showPointLabel.isSelected());
labelConf.put("showLabelZoom", this.showLabelZoom.getValue());
labelConf.put("labelBgColor", MapUtil.toHex(this.labelBgColor.getSelectObject()));
labelConf.put("labelType", this.labelType.getSelectedItem());
labelConf.put("showLayerType", this.showLayerType.isSelected());
labelConf.put("showDataType", this.showDataType.isSelected());
labelConf.put("showName", this.showName.isSelected());
labelConf.put("showLng", this.showLng.isSelected());
labelConf.put("showLat", this.showLat.isSelected());
labelConf.put("showDesc", this.showDesc.isSelected());
labelConf.put("labelJsPane", this.labelJsPane.getText());
TextAttr labelAttr = this.textAttrPane.update();
labelConf.put("labelsize", labelAttr.getFRFont().getSize());
labelConf.put("labelstyle", labelAttr.getFRFont().getStyle());
labelConf.put("labelfamily", labelAttr.getFRFont().getFamily());
labelConf.put("labelcolor", MapUtil.toHex(labelAttr.getFRFont().getForeground()));
chart.setLabelConf(labelConf);
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Plugin-HeatPointMap-labelstitle");
}
private class ContentPane extends JPanel {
public ContentPane() {
initComponents();
}
private void initComponents() {
this.setLayout(new BorderLayout());
JPanel toolContentPane = createLabelContentPane();
JPanel textStylePane = createLabelTextStylePane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p};
Component[][] acomponents = new Component[][]{
new Component[]{showPointLabel},
new Component[]{toolContentPane},
new Component[]{textStylePane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(acomponents, rowSize, columnSize);
this.add(panel, BorderLayout.CENTER);
this.setVisible(true);
}
}
private JPanel createLabelContentPane() {
showPointLabel = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showPointLabel"));
labelBgColor = new ColorSelectBox(100);
showLabelZoom = new UISpinner(0, 20, 1, 15);
labelType = new UIButtonGroup<Integer>(new String[]{
Toolkit.i18nText("Plugin-HeatPointMap-labelTypeCheck"),
Toolkit.i18nText("Plugin-HeatPointMap-labelTypeJS")
},
new Integer[]{1, 2}
);
labelType.setSelectedItem(1);
showLayerType = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showLayerType"));
showDataType = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showDataType"));
showName = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showName"));
showLng = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showLng"));
showLat = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showLat"));
showDesc = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showDesc"));
labelJsPane = new UITextArea(6, 6);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
Component[][] compLabel = new Component[][]{
{null, null},
//new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-showLabelZoom")), this.showLabelZoom},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-labelBgColor")), this.labelBgColor},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-labelType")), this.labelType}
};
JPanel labelTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(compLabel, new double[]{p, p, p, p, p}, new double[]{p, f});
Component[][] compCheck = new Component[][]{
new Component[]{showDataType, showName},
new Component[]{showLng, showLat},
new Component[]{showDesc, null}
};
final JPanel checkPane = TableLayout4VanChartHelper.createGapTableLayoutPane(compCheck, new double[]{p, p, p, p}, new double[]{p, f});
cardPane = new JPanel(this.cardLayout = new CardLayout()){
@Override
public Dimension getPreferredSize() {
if (null != labelType.getSelectedItem() && labelType.getSelectedItem() == 2) {
return labelJsPane.getPreferredSize();
} else {
return checkPane.getPreferredSize();
}
}
};
cardPane.add(checkPane, "check");
cardPane.add(labelJsPane, "js");
this.cardLayout.show(cardPane, "check");
labelType.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent var1x) {
if (labelType.getSelectedItem() == 1) {
cardLayout.show(cardPane, "check");
} else {
cardLayout.show(cardPane, "js");
}
}
});
Component[][] comp = new Component[][]{
new Component[]{labelTypePane},
new Component[]{cardPane}
};
JPanel pane = TableLayout4VanChartHelper.createGapTableLayoutPane(comp, new double[]{p, p, p}, new double[]{f});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-labelAlignExpand"), pane);
}
private JPanel createLabelTextStylePane() {
this.textAttrPane = new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-LabelsTextStyle"), this.textAttrPane);
}
}

139
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleLegendPane.java

@ -0,0 +1,139 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.base.BaseUtils;
import com.fr.chart.base.TextAttr;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.extended.chart.ExtendedScrollPane;
import com.fr.general.FRFont;
import com.fr.json.JSONObject;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*;
public class HeatPointMapStyleLegendPane extends ExtendedScrollPane<HeatPointMapChart> {
private UICheckBox isLegendVisable;
private UIButtonGroup<Integer> legendPosition;
private ChartTextAttrPane textAttrPane;
@Override
protected JPanel createContentPane() {
return new ContentPane();
}
@Override
public void populateBean(HeatPointMapChart chart) {
JSONObject legendConf = chart.getLegendConf();
this.isLegendVisable.setSelected(legendConf.getBoolean("isLegendVisable"));
this.legendPosition.setSelectedItem(legendConf.getInt("legendPosition"));
FRFont titleFont = FRFont.getInstance(legendConf.getString("legendfamily"),
legendConf.getInt("legendstyle"),
legendConf.getInt("legendsize"),
MapUtil.toColor(legendConf.getString("legendcolor")));
this.textAttrPane.populate(titleFont);
}
@Override
public void updateBean(HeatPointMapChart chart) {
JSONObject legendConf = JSONObject.create();
legendConf.put("isLegendVisable", this.isLegendVisable.isSelected());
legendConf.put("legendPosition", legendPosition.getSelectedItem());
TextAttr titleAttr = this.textAttrPane.update();
legendConf.put("legendsize", titleAttr.getFRFont().getSize());
legendConf.put("legendstyle", titleAttr.getFRFont().getStyle());
legendConf.put("legendfamily", titleAttr.getFRFont().getFamily());
legendConf.put("legendcolor", MapUtil.toHex(titleAttr.getFRFont().getForeground()));
chart.setLegendConf(legendConf);
}
@Override
protected String title4PopupWindow() {
return PaneTitleConstants.CHART_STYLE_LEGNED_TITLE;
}
private class ContentPane extends JPanel {
public ContentPane() {
initComponents();
}
private void initComponents() {
this.setLayout(new BorderLayout());
// 内容
JPanel titleContentPane = createLegendContentPane();
// 样式
JPanel stylePane = createLegendStylePane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p};
Component[][] acomponents = new Component[][]{
new Component[]{isLegendVisable},
new Component[]{titleContentPane},
new Component[]{stylePane}
} ;
JPanel panel = TableLayoutHelper.createTableLayoutPane(acomponents,rowSize,columnSize);
this.add(panel,BorderLayout.CENTER);
this.setVisible(true);
}
}
private JPanel createLegendContentPane(){
// 内容
this.isLegendVisable = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-isLegendVisable"));
String[] tips = new String[]{
Toolkit.i18nText("Plugin-HeatPointMap-Alignment-LeftTop"),
Toolkit.i18nText("Plugin-HeatPointMap-Alignment-RightTop"),
Toolkit.i18nText("Plugin-HeatPointMap-Alignment-RightBottom"),
Toolkit.i18nText("Plugin-HeatPointMap-Alignment-LeftBottom")
};
Integer[] vals = new Integer[]{1, 2, 3, 4};
Icon[] icons = new Icon[]{
BaseUtils.readIcon("/com/fr/plugin/heatpointmapbox/images/layout_top_left.png"),
BaseUtils.readIcon("/com/fr/plugin/heatpointmapbox/images/layout_top_right.png"),
BaseUtils.readIcon("/com/fr/plugin/heatpointmapbox/images/layout_bottom_right.png"),
BaseUtils.readIcon("/com/fr/plugin/heatpointmapbox/images/layout_bottom_left.png")
};
this.legendPosition = new UIButtonGroup(icons, vals);
this.legendPosition.setAllToolTips(tips);
Component[][] components = new Component[][]{
{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-legendPosition"), 2), this.legendPosition}
} ;
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-legendPositionExpand"), components);
}
private JPanel createLegendStylePane() {
this.textAttrPane = new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-LegendStyle"), this.textAttrPane);
}
}

84
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleOtherPane.java

@ -0,0 +1,84 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.extended.chart.ExtendedScrollPane;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*;
public class HeatPointMapStyleOtherPane extends ExtendedScrollPane<HeatPointMapChart> {
private HeatPointMapHyperLink hyperLink;
private HeatPointMapPointCondListPane pointCondListPane;
@Override
protected JPanel createContentPane() {
return new ContentPane();
}
@Override
public void populateBean(HeatPointMapChart chart) {
hyperLink.populateBean(chart);
pointCondListPane.populateStyle(chart);
}
@Override
public void updateBean(HeatPointMapChart chart) {
hyperLink.updateBean(chart);
pointCondListPane.updateStyle(chart);
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Plugin-HeatPointMap-otherstitle");
}
private class ContentPane extends JPanel {
public ContentPane() {
initComponents();
}
private void initComponents() {
this.setLayout(new BorderLayout());
JPanel linkPane = createLinkPane();
JPanel pointCondPane = createPointStyleCondPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] acomponents = new Component[][]{
new Component[]{linkPane},
new Component[]{pointCondPane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(acomponents,rowSize,columnSize);
this.add(panel,BorderLayout.CENTER);
this.setVisible(true);
}
}
private JPanel createLinkPane() {
this.hyperLink = new HeatPointMapHyperLink();
Component[][] components = new Component[][]{
new Component[]{hyperLink}
};
double p = TableLayout.PREFERRED;
double[] columnSize = {TableLayout.FILL};
double[] rowSize = {p, p};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-LinkExpand"), panel);
}
private JPanel createPointStyleCondPane() {
this.pointCondListPane = new HeatPointMapPointCondListPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-pointStyleCondExpand"), this.pointCondListPane);
}
}

39
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStylePane.java

@ -0,0 +1,39 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.extended.chart.AbstractExtendedStylePane;
import com.fr.extended.chart.ExtendedScrollPane;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import java.util.ArrayList;
import java.util.List;
/**
* @author xx
* @date 2022/8/19
*/
public class HeatPointMapStylePane extends AbstractExtendedStylePane<HeatPointMapChart> {
private AttributeChangeListener attributeChangeListener;
public HeatPointMapStylePane(){
super();
}
public HeatPointMapStylePane(AttributeChangeListener attributeChangeListener){
super(attributeChangeListener);
}
@Override
protected List<ExtendedScrollPane<HeatPointMapChart>> initPaneList() {
List<ExtendedScrollPane<HeatPointMapChart>> list = new ArrayList<ExtendedScrollPane<HeatPointMapChart>>();
list.add(new HeatPointMapStyleTitlePane());
list.add(new HeatPointMapStyleBaseMapPane());
list.add(new HeatPointMapStylePointMapPane());
list.add(new HeatPointMapStyleHeatMapPane());
list.add(new HeatPointMapStyleLegendPane());
list.add(new HeatPointMapStyleLabelsPane());
list.add(new HeatPointMapStyleTipsPane());
list.add(new HeatPointMapStyleOtherPane());
return list;
}
}

126
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStylePointMapPane.java

@ -0,0 +1,126 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.bulenkov.iconloader.util.Base64Converter;
import com.fr.config.predefined.ColorFillStyle;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.extended.chart.ExtendedScrollPane;
import com.fr.general.xml.GeneralXMLTools;
import com.fr.json.JSONObject;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
/**
* @author xx
*/
public class HeatPointMapStylePointMapPane extends ExtendedScrollPane<HeatPointMapChart> {
private UISpinner pointSize;
private ImageChooserPane pointPane;
@Override
protected JPanel createContentPane() {
return new ContentPane();
}
@Override
public void populateBean(HeatPointMapChart chart) {
JSONObject pointConf = chart.getPointConf();
this.pointSize.setValue(pointConf.getDouble("pointSize"));
ImageEntity imgEnt = new ImageEntity();
imgEnt.setImagestr(pointConf.getString("pointimg"));
imgEnt.setImagetype(pointConf.getString("pointimgtype"));
imgEnt.setWidth(pointConf.getInt("pointimgw"));
imgEnt.setHeight(pointConf.getInt("pointimgh"));
this.pointPane.populateBean(imgEnt);
}
@Override
public void updateBean(HeatPointMapChart chart) {
JSONObject pointConf = JSONObject.create();
pointConf.put("pointSize", this.pointSize.getValue());
ImageEntity imgEnt = this.pointPane.updateBean();
if (null != imgEnt) {
pointConf.put("pointimg", imgEnt.getImagestr());
pointConf.put("pointimgtype", imgEnt.getImagetype());
pointConf.put("pointimgw", imgEnt.getWidth());
pointConf.put("pointimgh", imgEnt.getHeight());
}
chart.setPointConf(pointConf);
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Plugin-HeatPointMap-pointtitle");
}
private class ContentPane extends JPanel {
public ContentPane() {
initComponents();
}
private void initComponents() {
this.setLayout(new BorderLayout());
JPanel pointContentPane = createPointContentPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] acomponents = new Component[][]{
new Component[]{pointContentPane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(acomponents, rowSize, columnSize);
this.add(panel, BorderLayout.CENTER);
this.setVisible(true);
}
}
private JPanel createPointContentPane() {
pointSize = new UISpinner(1, 200, 1, 32);
pointPane = new ImageChooserPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
Component[][] compType = new Component[][]{
{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-pointSize")), this.pointSize}
};
JPanel pointStyleTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(compType, new double[]{p, p, p, p}, new double[]{p, f});
Component[][] comp1 = new Component[][]{
new Component[]{pointPane}
};
JPanel imgPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comp1, new double[]{p, p, p}, new double[]{f});
Component[][] comp = new Component[][]{
new Component[]{pointStyleTypePane},
new Component[]{imgPane}
};
JPanel pane = TableLayout4VanChartHelper.createGapTableLayoutPane(comp, new double[]{p, p, p}, new double[]{f});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-pointMapExpand"), pane);
}
}

163
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleTipsPane.java

@ -0,0 +1,163 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.chart.base.TextAttr;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.extended.chart.ExtendedScrollPane;
import com.fr.general.FRFont;
import com.fr.json.JSONObject;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*;
/**
* @author xx
*/
public class HeatPointMapStyleTipsPane extends ExtendedScrollPane<HeatPointMapChart> {
private UICheckBox showPointTips;
private ColorSelectBox tipBgColor;
private UINumberDragPane tipBgOpacity;
private UICheckBox showLayerType;
private UICheckBox showDataType;
private UICheckBox showName;
private UICheckBox showLng;
private UICheckBox showLat;
private UICheckBox showDesc;
private ChartTextAttrPane textAttrPane;
@Override
protected JPanel createContentPane() {
return new ContentPane();
}
@Override
public void populateBean(HeatPointMapChart chart) {
JSONObject tipsConf = chart.getTipsConf();
this.showPointTips.setSelected(tipsConf.getBoolean("showPointTips"));
this.tipBgColor.setSelectObject(MapUtil.toColor(tipsConf.getString("tipBgColor")));
this.tipBgOpacity.populateBean(tipsConf.getDouble("tipBgOpacity"));
this.showLayerType.setSelected(tipsConf.getBoolean("showLayerType"));
this.showDataType.setSelected(tipsConf.getBoolean("showDataType"));
this.showName.setSelected(tipsConf.getBoolean("showName"));
this.showLng.setSelected(tipsConf.getBoolean("showLng"));
this.showLat.setSelected(tipsConf.getBoolean("showLat"));
this.showDesc.setSelected(tipsConf.getBoolean("showDesc"));
FRFont tipFont = FRFont.getInstance(tipsConf.getString("tipfamily"),
tipsConf.getInt("tipstyle"),
tipsConf.getInt("tipsize"),
MapUtil.toColor(tipsConf.getString("tipcolor")));
this.textAttrPane.populate(tipFont);
}
@Override
public void updateBean(HeatPointMapChart chart) {
JSONObject tipsConf = JSONObject.create();
tipsConf.put("showPointTips", this.showPointTips.isSelected());
tipsConf.put("tipBgColor", MapUtil.toHex(this.tipBgColor.getSelectObject()));
tipsConf.put("tipBgOpacity", this.tipBgOpacity.updateBean());
tipsConf.put("showLayerType", this.showLayerType.isSelected());
tipsConf.put("showDataType", this.showDataType.isSelected());
tipsConf.put("showName", this.showName.isSelected());
tipsConf.put("showLng", this.showLng.isSelected());
tipsConf.put("showLat", this.showLat.isSelected());
tipsConf.put("showDesc", this.showDesc.isSelected());
TextAttr labelAttr = this.textAttrPane.update();
tipsConf.put("tipsize", labelAttr.getFRFont().getSize());
tipsConf.put("tipstyle", labelAttr.getFRFont().getStyle());
tipsConf.put("tipfamily", labelAttr.getFRFont().getFamily());
tipsConf.put("tipcolor", MapUtil.toHex(labelAttr.getFRFont().getForeground()));
chart.setTipsConf(tipsConf);
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Plugin-HeatPointMap-tipstitle");
}
private class ContentPane extends JPanel {
public ContentPane() {
initComponents();
}
private void initComponents() {
this.setLayout(new BorderLayout());
JPanel contentPane = createTipsContentPane();
JPanel textStylePane = createTipsTextStylePane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p};
Component[][] comps = new Component[][]{
new Component[]{showPointTips},
new Component[]{contentPane},
new Component[]{textStylePane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize);
this.add(panel, BorderLayout.CENTER);
this.setVisible(true);
}
}
private JPanel createTipsContentPane() {
showPointTips = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showPointTips"));
tipBgColor = new ColorSelectBox(100);
tipBgOpacity = new UINumberDragPane(0, 100);
showLayerType = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showLayerType"));
showDataType = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showDataType"));
showName = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showName"));
showLng = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showLng"));
showLat = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showLat"));
showDesc = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-showDesc"));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
Component[][] compLabel = new Component[][]{
{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-tipBgColor")), this.tipBgColor},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-tipBgOpacity")), this.tipBgOpacity}
};
JPanel bgPane = TableLayout4VanChartHelper.createGapTableLayoutPane(compLabel, new double[]{p, p, p}, new double[]{p, f});
Component[][] compCheck = new Component[][]{
new Component[]{showDataType, showName},
new Component[]{showLng, showLat},
new Component[]{showDesc, null}
};
JPanel checkPane = TableLayout4VanChartHelper.createGapTableLayoutPane(compCheck, new double[]{p, p, p, p}, new double[]{p, f});
Component[][] comp = new Component[][]{
new Component[]{bgPane},
new Component[]{checkPane}
};
JPanel pane = TableLayout4VanChartHelper.createGapTableLayoutPane(comp, new double[]{p, p, p}, new double[]{f});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-tipsAlignExpand"), pane);
}
private JPanel createTipsTextStylePane() {
this.textAttrPane = new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-tipsTextStyle"), this.textAttrPane);
}
}

142
src/com/fr/plugin/heatpointmapbox/ui/HeatPointMapStyleTitlePane.java

@ -0,0 +1,142 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.fr.base.BaseUtils;
import com.fr.chart.base.TextAttr;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.extended.chart.ExtendedScrollPane;
import com.fr.general.FRFont;
import com.fr.json.JSONObject;
import com.fr.plugin.heatpointmapbox.HeatPointMapChart;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*;
public class HeatPointMapStyleTitlePane extends ExtendedScrollPane<HeatPointMapChart> {
private UICheckBox isTitleVisable;
private ColorSelectBox titleBgColor;
private UINumberDragPane titleBgOpacity;
private TinyFormulaPane titleName;
private UIButtonGroup<Integer> titleAlignment;
private ChartTextAttrPane textAttrPane;
@Override
protected JPanel createContentPane() {
return new ContentPane();
}
@Override
public void populateBean(HeatPointMapChart chart) {
JSONObject titleConf = chart.getTitleConf();
this.isTitleVisable.setSelected(titleConf.getBoolean("titlevisiable"));
this.titleBgColor.setSelectObject(MapUtil.toColor(titleConf.getString("titlebgcolor")));
this.titleBgOpacity.populateBean(titleConf.getDouble("titleBgOpacity"));
this.titleName.populateBean(titleConf.getString("titlename"));
this.titleAlignment.setSelectedItem(titleConf.getInt("titleposition"));
FRFont titleFont = FRFont.getInstance(titleConf.getString("titlefamily"),
titleConf.getInt("titlestyle"),
titleConf.getInt("titlesize"),
MapUtil.toColor(titleConf.getString("titlecolor")));
this.textAttrPane.populate(titleFont);
}
@Override
public void updateBean(HeatPointMapChart chart) {
JSONObject titleConf = JSONObject.create();
titleConf.put("titlevisiable", this.isTitleVisable.isSelected());
titleConf.put("titlebgcolor", MapUtil.toHex(this.titleBgColor.getSelectObject()));
titleConf.put("titleBgOpacity", this.titleBgOpacity.updateBean());
titleConf.put("titlename", this.titleName.updateBean());
titleConf.put("titleposition", titleAlignment.getSelectedItem());
TextAttr titleAttr = this.textAttrPane.update();
titleConf.put("titlesize", titleAttr.getFRFont().getSize());
titleConf.put("titlestyle", titleAttr.getFRFont().getStyle());
titleConf.put("titlefamily", titleAttr.getFRFont().getFamily());
titleConf.put("titlecolor", MapUtil.toHex(titleAttr.getFRFont().getForeground()));
chart.setTitleConf(titleConf);
}
@Override
protected String title4PopupWindow() {
return PaneTitleConstants.CHART_STYLE_TITLE_TITLE;
}
private class ContentPane extends JPanel {
public ContentPane() {
initComponents();
}
private void initComponents() {
this.setLayout(new BorderLayout());
// 内容
JPanel titleContentPane = createTitleContentPane();
// 样式
JPanel stylePane = createTitleStylePane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p};
Component[][] acomponents = new Component[][]{
new Component[]{isTitleVisable},
new Component[]{titleContentPane},
new Component[]{stylePane}
} ;
JPanel panel = TableLayoutHelper.createTableLayoutPane(acomponents,rowSize,columnSize);
this.add(panel,BorderLayout.CENTER);
this.setVisible(true);
}
}
private JPanel createTitleContentPane(){
// 内容
this.isTitleVisable = new UICheckBox(Toolkit.i18nText("Plugin-HeatPointMap-isVisiableTitle"));
this.titleBgColor = new ColorSelectBox(100);
this.titleBgOpacity = new UINumberDragPane(0, 100);
this.titleName = new TinyFormulaPane();
// 位置
Icon[] titlePositonIcons = new Icon[]{BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")};
Integer[] titlePositionVal = new Integer[]{2, 0, 4};
this.titleAlignment = new UIButtonGroup(titlePositonIcons, titlePositionVal);
Component[][] components = new Component[][]{
{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-titleBgColor")), this.titleBgColor},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-titleBgOpacity")), this.titleBgOpacity},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-TitleText")), this.titleName},
new Component[]{new UILabel(Toolkit.i18nText("Plugin-HeatPointMap-TitlePosition"), 2), this.titleAlignment}
} ;
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-TitleExpand"), components);
}
private JPanel createTitleStylePane() {
this.textAttrPane = new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Plugin-HeatPointMap-TitleStyle"), this.textAttrPane);
}
}

136
src/com/fr/plugin/heatpointmapbox/ui/ImageChooserPane.java

@ -0,0 +1,136 @@
package com.fr.plugin.heatpointmapbox.ui;
import com.bulenkov.iconloader.util.Base64Converter;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.background.image.ImageFileChooser;
import com.fr.design.style.background.image.ImagePreviewPane;
import com.fr.design.utils.ImageUtils;
import com.fr.general.ImageWithSuffix;
import com.fr.general.xml.GeneralXMLTools;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
public class ImageChooserPane extends BasicBeanPane<ImageEntity> {
private ImageFileChooser imageChooser;
private ImagePreviewPane imagePreview;
private UIButton imagebtn;
private ImageEntity imageEntity;
public ImageChooserPane() {
this.setLayout(new BorderLayout());
imagePreview = new ImagePreviewPane();
imageEntity = new ImageEntity();
imagebtn = new UIButton("选择图标");
UILabel imageLab = new UILabel("点图标");
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] acomponents = new Component[][]{
new Component[]{imageLab, imagebtn},
new Component[]{null, imagePreview}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(acomponents, rowSize, columnSize);
this.add(panel, BorderLayout.CENTER);
this.setVisible(true);
imageChooser = new ImageFileChooser();
imageChooser.setMultiSelectionEnabled(false);
initLiseners();
}
private void initLiseners() {
this.imagebtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
int returnVal = imageChooser.showOpenDialog(ImageChooserPane.this);
if (returnVal != JFileChooser.CANCEL_OPTION) {
dealWithImageFile();
}
}
});
}
private void dealWithImageFile() {
final File selectedFile = imageChooser.getSelectedFile();
if (selectedFile != null && selectedFile.isFile()) {
BufferedImage image = BaseUtils.readImage(selectedFile.getPath());
if (null == image) {
return;
}
if (image.getWidth() > 300 || image.getHeight() > 300) {
JOptionPane.showMessageDialog(null,
"图片太大,请重新选择!大小不超过300*300,当前尺寸:" + image.getWidth() + "*" + image.getHeight(),
"信息提示",
JOptionPane.ERROR_MESSAGE);
return;
}
String type = ImageUtils.getImageType(selectedFile);
String iconBase64 = Base64Converter.encode(GeneralXMLTools.imageEncode(image, type));
if (null == this.imageEntity) {
this.imageEntity = new ImageEntity();
}
this.imageEntity.setImagestr(iconBase64);
this.imageEntity.setImagetype(type);
this.imageEntity.setWidth(image.getWidth());
this.imageEntity.setHeight(image.getHeight());
if (imagePreview != null) {
ImageWithSuffix imageWithSuffix = new ImageWithSuffix(image, type);
imagePreview.setImageStyle(Style.getInstance());
imagePreview.setImageWithSuffix(imageWithSuffix);
imagePreview.repaint();
}
}
}
@Override
public void populateBean(ImageEntity ob) {
if (null == ob || null == ob.getImagestr() || "".equals(ob.getImagestr())) {
this.imageEntity = new ImageEntity();
this.imagePreview.setImage(null);
this.imagePreview.repaint();
new ImagePreviewPane();
return;
}
this.imageEntity = ob;
BufferedImage image = (BufferedImage) GeneralXMLTools.imageDecode(Base64Converter.decode(ob.getImagestr().getBytes()));
if (imagePreview != null && null != image) {
ImageWithSuffix imageWithSuffix = new ImageWithSuffix(image, ob.getImagetype());
imagePreview.setImageStyle(Style.getInstance());
imagePreview.setImageWithSuffix(imageWithSuffix);
imagePreview.repaint();
}
}
@Override
public ImageEntity updateBean() {
return this.imageEntity;
}
@Override
protected String title4PopupWindow() {
return "点图标设置";
}
}

42
src/com/fr/plugin/heatpointmapbox/ui/ImageEntity.java

@ -0,0 +1,42 @@
package com.fr.plugin.heatpointmapbox.ui;
import java.io.Serializable;
public class ImageEntity implements Serializable {
private String imagestr;
private String imagetype;
private int width;
private int height;
public String getImagestr() {
return imagestr;
}
public void setImagestr(String imagestr) {
this.imagestr = imagestr;
}
public String getImagetype() {
return imagetype;
}
public void setImagetype(String imagetype) {
this.imagetype = imagetype;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
}

94
src/com/fr/plugin/heatpointmapbox/ui/MapUtil.java

@ -0,0 +1,94 @@
package com.fr.plugin.heatpointmapbox.ui;
import java.awt.*;
import java.util.Map;
/**
* @author xx
*/
public class MapUtil {
public static String getString(Map map, String key) {
return getString(map, key, null);
}
public static String getString(Map map, String key, String def) {
if (null == map) {
return def;
}
if (null != map.get(key)) {
return map.get(key).toString();
} else {
return def;
}
}
public static Integer getInteger(Map map, String key) {
return getInteger(map, key, null);
}
public static Integer getInteger(Map map, String key, Integer def) {
if (null == map) {
return def;
}
if (null != map.get(key)) {
return Integer.parseInt(map.get(key).toString());
} else {
return def;
}
}
public static Double getDouble(Map map, String key) {
return getDouble(map, key, null);
}
public static Double getDouble(Map map, String key, Double def) {
if (null == map) {
return def;
}
if (null != map.get(key)) {
return Double.parseDouble(map.get(key).toString());
} else {
return def;
}
}
public static Boolean getBoolean(Map map, String key) {
return getBoolean(map, key, null);
}
public static Boolean getBoolean(Map map, String key, Boolean def) {
if (null == map) {
return def;
}
String s = getString(map, key);
if (null != s) {
if ("true".equals(s)) {
return true;
} else if ("false".equals(s)){
return false;
} else {
return def;
}
} else {
return def;
}
}
public static String toHex(Color c) {
if (null == c) {
return "transparent";
}
String hex = Integer.toHexString(c.getRGB());
if (hex.length() == 8) {
hex = "#" + hex.substring(2);
}
return hex;
}
public static Color toColor(String c) {
if (null != c && c.startsWith("#")) {
c = c.substring(1);
return new Color(Integer.parseInt(c, 16));
}
return null;
}
}

23
src/com/fr/plugin/heatpointmapbox/vo/CustomJsonObject.java

@ -0,0 +1,23 @@
package com.fr.plugin.heatpointmapbox.vo;
import com.fr.json.JSONObject;
/**
* @author xx
* @date 2022/8/25 18:33
* @description
*/
public class CustomJsonObject {
private JSONObject obj = JSONObject.create();
public JSONObject get() {
return obj;
}
public void put(JSONObject obj) {
this.obj = obj;
}
public static final String POINT_MAP_TITLE = "pointmap";
public static final String CLUSTER_POINT_MAP_TITLE = "clusterpointmap";
}

14
src/com/fr/plugin/heatpointmapbox/vo/PointMapStyleJson.java

@ -0,0 +1,14 @@
package com.fr.plugin.heatpointmapbox.vo;
/**
* @author xx
* @date 2022/8/25 18:35
* @description
*/
public class PointMapStyleJson extends CustomJsonObject {
private String tilte = POINT_MAP_TITLE;
public String getTilte() {
return tilte;
}
}

0
src/com/fr/plugin/heatpointmapbox/web/HeatPointMapChart.css

609
src/com/fr/plugin/heatpointmapbox/web/HeatPointMapChartWrapper.js

@ -0,0 +1,609 @@
HeatPointMapChartWrapper = ExtendedChart.extend({
_init: function (dom, option) {
debugger;
var self = this;
self.chartBaseOption = option;
self.parentLoadRegion = [];
this.width = option.width || $(dom).width();// 补充从dom获取.
this.height = option.height || $(dom).height();
this._$dom = $(dom);
this.chartData = option.data;
this.titleConf = option.titleConf;
this.mapConf = option.mapConf;
this.pointConf = option.pointConf;
this.heatConf = option.heatConf;
this.legendConf = option.legendConf;
this.labelConf = option.labelConf;
this.tipsConf = option.tipsConf;
this.pointStyleCond = option.pointStyleCond;
this.pointLink = option.pointLink;
this.linkParam = option.linkParam;
var chart = this.initChart(dom);
this.baseMap = chart;
window.testChart = chart;
return chart;
},
initTitle: function() {
var self = this;
if (self.titleConf.titlevisiable) {
$('<div>'+self.titleConf.titlename+'</div>').css({
'position': 'absolute',
'left': '0px',
'top': '0px',
'padding': '5px',
'width': '100%',
"background": self.hexToRgba(self.titleConf.titlebgcolor, self.titleConf.titleBgOpacity).rgba,
'color': self.titleConf.titlecolor,
'font-size': self.titleConf.titlesize + 'px',
'text-align': self.getAlign(self.titleConf.titleposition),
'font-family': self.titleConf.titlefamily,
'font-style': self.getFontStyle(self.titleConf.titlestyle),
'font-weight': self.getFontWeight(self.titleConf.titlestyle)
}).appendTo(self._$dom.parent());
}
},
initLegend: function() {
var self = this;
if (self.legendConf.isLegendVisable) {
$('<div class="heatpoint-legend-c"></div>').css({
'position': 'absolute',
'padding': '5px',
'background-color': '#ffffff',
'color': self.legendConf.legendcolor,
'font-size': self.legendConf.legendsize,
'font-family': self.legendConf.legendfamily,
'font-style': self.getFontStyle(self.legendConf.legendstyle),
'font-weight': self.getFontWeight(self.legendConf.legendstyle)
}).appendTo(self._$dom.parent());
var vHtml = '';
var legendIconComm = "data:image/png;base64," + self.pointConf.pointimg;
vHtml += '<div style="display: flex; align-items: center;"><span style="background: url('+legendIconComm+'); background-size: 100% 100%; width:24px; height:24px;"></span><span>普通</span></div>';
if (self.pointStyleCond && self.pointStyleCond.length > 0) {
for (var i = 0; i < self.pointStyleCond.length; i++) {
if (self.pointStyleCond[i].pointimg) {
var legendIcon = "data:image/png;base64," + self.pointStyleCond[i].pointimg;
vHtml += '<div style="display: flex; align-items: center;"><span style="background: url('+legendIcon+'); background-size: 100% 100%; width:24px; height:24px;"></span><span>'+self.pointStyleCond[i].titleName+'</span></div>';
}
}
}
var heatColors = (self.heatConf.intervalColors || '#0000ff|#75d3f8|#00ff00|#ffea00|#ff0000').split("|");
var heatPos = (self.heatConf.intervalPos || '0.5|0.65|0.7|0.9|1.0').split("|");
var heatColorStr = '';
for (var k = 0; k < heatColors.length; k++) {
heatColorStr += "," + heatColors[k];
var pos = Math.round(parseFloat(heatPos[k]) * 100);
heatColorStr += " " + pos + "px ";
}
if (heatColorStr.length > 0) {
heatColorStr = heatColorStr.substring(1);
}
vHtml += '<div style="display: flex;">';
vHtml += '<div style="margin-top:10px; margin-left:9px;padding: 0px; width: 5px; height: 100px; background-image: linear-gradient(to bottom, '+heatColorStr+');"></div>';
vHtml += '<div style="margin-top:10px; margin-left: 3px; display: flex; flex-direction: column;justify-content: space-between;"><span>0</span><span>1</span></div>'
vHtml += '</div>';
self._$dom.parent().find('div.heatpoint-legend-c').html(vHtml);
if (self.legendConf.legendPosition == 1) {
self._$dom.parent().find('div.heatpoint-legend-c').css({
"left": "0px",
"top": "0px"
});
} else if (self.legendConf.legendPosition == 2) {
self._$dom.parent().find('div.heatpoint-legend-c').css({
"right": "0px",
"top": "0px"
});
} else if (self.legendConf.legendPosition == 3) {
self._$dom.parent().find('div.heatpoint-legend-c').css({
"right": "0px",
"bottom": "0px"
});
} else {
self._$dom.parent().find('div.heatpoint-legend-c').css({
"left": "0px",
"bottom": "0px"
});
}
}
},
initChart: function(dom) {
var self = this;
var center = [113.239809,23.143046];
if (self.chartData && self.chartData.length > 0) {
center = [self.chartData[0].lng, self.chartData[0].lat];
}
if (self.mapConf.centerx && self.mapConf.centerx.length > 0
&& self.mapConf.centery && self.mapConf.centery.length > 0) {
center = [self.mapConf.centerx, self.mapConf.centery];
}
var stylepath = self.mapConf.mapStyle || 'mapbox://styles/mapbox/streets-v12';
mapboxgl.accessToken = self.mapConf.mapKey || 'pk.eyJ1IjoiZHVhbmJiIiwiYSI6ImNrYnNudW04czAxdWgyc3N3bHlnanhqOHEifQ.WwaGTBlqeb5tdJRfUAH-7g';
var map = new mapboxgl.Map({
container: dom,
style: stylepath,
center: center,
zoom: self.mapConf.mapzoom || 10
});
map.addControl(new MapboxLanguage({
defaultLanguage: 'zh-Hans'
}));
map.on('load', function(){
// self.initMarker();
// self.initLines();
// self.initAnimation();
self.wrapData();
self.initTitle();
self.initLegend();
self.initEvent();
});
return map;
},
initMarker: function() {
var self = this;
for (var i = 0; i < self.chartData.length; i++) {
var p = self.chartData[i];
self.addMarker(p);
}
},
addMarker: function(p) {
var self = this;
var el = document.createElement('div');
el.className = 'marker';
var psize = self.layerConf.pointsize;
var imgwidth = psize;
var imgheight = psize;
if (!psize || !$.isNumeric(psize) || psize <= 0) {
imgwidth = self.layerConf.imgwidth;
imgheight = self.layerConf.imgheight;
} else {
if (self.layerConf.imgheight > self.layerConf.imgwidth) {
imgwidth = Math.floor(self.layerConf.imgwidth * parseInt(imgheight) / self.layerConf.imgheight);
} else {
imgheight = Math.floor(self.layerConf.imgheight * parseInt(imgwidth) / self.layerConf.imgwidth);
}
}
el.style.width = imgwidth + 'px';
el.style.height = imgheight + 'px';
el.style.backgroundImage = 'url(data:image/' + self.layerConf.pointimgtype + ';base64,' + self.layerConf.pointimg;
//'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABNklEQVR4nGNgwAa2/Ndh2PQ/nWHT30UQDGSDxAiCVf8lgBrmMGz69x87BsqB1GAFG/824NaIhkFqUcDm/6o4FF8H4rsMG/99wJAD6UEyYBOqDf92AMU6Gdb/MgDLb/rbCBRbjWbAJqjmnxpopu+HG7zp31OgQjdgIFZj9SZIL8PG/zFIgp+AiquAms4D6a9AWw8BxfbCDdj0twXVpUC9QEnkUL8MUfjbHuwShPhPIH4DDavLCHGgXhQDNv67A1QUAhS7B6R/IRnwg2Hbf3aot26gGoDqBVDgzIU6txoq9pdh8z+QYc+BcpdRXAb2AkYg/u+HGAD096b/PkCxK4hA/bsYMxCxRePm/8sZNv+thxpkARRbD/TeKuzRiCshgRIPKEw2/ruJNZGhJCSKkzJVMhMyICE7AwCn/eHxoKNCTAAAAABJRU5ErkJggg==)';
el.style.backgroundSize = '100% 100%';
var v1 = new mapboxgl.LngLat(p.lng, p.lat);
var newMarker = new mapboxgl.Marker(el)
.setLngLat(v1)
.addTo(self.baseMap);
el.addEventListener('click', function() {
//window.alert(11);
});
},
initEvent: function() {
var self = this;
self.baseMap.on('click', 'points1', function(params){
console.log(params);
var item = {event: params.originalEvent};
item.lng = params.lngLat.lng;
item.lat = params.lngLat.lat;
var bbox = [
[params.point.x, params.point.y],
[params.point.x, params.point.y],
];
var features = self.baseMap.queryRenderedFeatures(bbox, {
layers: ["points1"],
});
console.log(features);
item.name = features[0].properties.name;
item.val = features[0].properties.val;
item.datatype = features[0].properties.datatype;
item.desc = features[0].properties.desc;
self._customDoLink(item);
});
self.baseMap.on('mouseout', 'points1', function(params){
if (self.popup) {
self.popup.remove();
}
});
self.baseMap.on('mouseover', 'points1', function(params){
console.log(params);
if (self.tipsConf.showPointTips) {
var maxTipStr = '';
var tipHtml = '<div class="heatpoint-tips-popup">';
if (self.tipsConf.showDataType) {
tipHtml += '<div style="padding: 5px;">数据类型:' + params.features[0].properties.datatype + '</div>';
if (params.features[0].properties.datatype.length > maxTipStr.length) {
maxTipStr = params.features[0].properties.datatype;
}
}
if (self.tipsConf.showName) {
tipHtml += '<div style="padding: 5px;">名称:' + params.features[0].properties.name + '</div>';
if (params.features[0].properties.name.length > maxTipStr.length) {
maxTipStr = params.features[0].properties.name;
}
}
if (self.tipsConf.showLng) {
tipHtml += '<div style="padding: 5px;">经度:' + params.lngLat.lng + '</div>';
if (params.lngLat.lng.length > maxTipStr.length) {
maxTipStr = params.lngLat.lng;
}
}
if (self.tipsConf.showLat) {
tipHtml += '<div style="padding: 5px;">纬度:' + params.lngLat.lat + '</div>';
if (params.lngLat.lat.length > maxTipStr.length) {
maxTipStr = params.lngLat.lat;
}
}
if (self.tipsConf.showDesc) {
tipHtml += '<div style="padding: 5px;">描述:' + params.features[0].properties.desc + '</div>';
if (params.features[0].properties.desc.length > maxTipStr.length) {
maxTipStr = params.features[0].properties.desc;
}
}
tipHtml += '</div>';
var v1 = new mapboxgl.LngLat(params.lngLat.lng, params.lngLat.lat);
var tipwidth = self.calTextWidth("名称:" + maxTipStr, self.tipsConf.tipsize);
self.popup = new mapboxgl.Popup({closeButton: false, className: 'heatpoint_tips_bg', anchor: 'bottom', offset: self.pointConf.pointSize / 2, maxWidth: tipwidth[0]+10})
.setLngLat(v1)
.setHTML(tipHtml)
.addTo(self.baseMap);
self._$dom.find('div.heatpoint-tips-popup').css({
"line-height": self.tipsConf.tipsize + "px",
"font-size": self.tipsConf.tipsize + "px",
"color": self.tipsConf.tipcolor,
"font-family": self.tipsConf.tipfamily,
'font-style': self.getFontStyle(self.tipsConf.tipstyle),
'font-weight': self.getFontWeight(self.tipsConf.tipstyle)
});
//setTimeout(function(){
self._$dom.find('div.mapboxgl-popup-content').css({
"background-color": self.hexToRgba(self.tipsConf.tipBgColor, self.tipsConf.tipBgOpacity).rgba,
});
self._$dom.find('div.mapboxgl-popup-tip').css({
"border-top-color": self.hexToRgba(self.tipsConf.tipBgColor, self.tipsConf.tipBgOpacity).rgba,
});
//}, 50);
}
});
},
_customDoLink: function(params) {
params.linkKey = params.linkKey || 'pointLink';
var hyperLink = this.pointLink;
if (params && hyperLink && hyperLink.parasMap) {
params.chartIndex = this.chartIndex || 0;
this._doLinkWithFilter(params, hyperLink);
}
},
findPointCond: function(item, title) {
if (!item || !title) {
return {};
}
var self = this;
if (this.pointStyleCond && this.pointStyleCond.length > 0) {
try {
for (var i = 0; i < this.pointStyleCond.length; i++) {
if (this.pointStyleCond[i].title == title) {
var cond = this.pointStyleCond[i].condition;
cond = cond.replace(/\{数据分类\}/g, item.layertype);
cond = cond.replace(/\{数据类型\}/g, item.datatype);
cond = cond.replace(/\{数值\}/g, (item.val||0));
if (eval(cond)) {
if (!this.pointStyleCond[i].iconname) {
this.pointStyleCond[i].iconname = 'condition' + i;
this.addImageToMap('condition' + i, this.pointStyleCond[i].pointimg);
}
return this.pointStyleCond[i];
}
}
}
} catch (e) {
console.log('条件属性配置错误!请检查条件');
return {};
}
}
return {};
},
addImageToMap: function(name, img) {
var self = this;
self.baseMap.loadImage(
'data:image/png;base64,' + img,
function(err, image) {
if (image) self.baseMap.addImage(name, image);
});
},
wrapData: function(){
var self = this;
//this.chartData.map(function (item) {
//});
self.pointSeriesColorDef = [];
self.pointCondColorDef = [];
self.addImageToMap("commonImg", self.pointConf.pointimg);
var pointDataSource = {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": []
}
};
var heatDataSource = {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": []
}
};
this.chartData.map(function (item) {
if (item.layertype == '热力图') {
heatDataSource.data.features.push({
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [item.lng, item.lat]
},
"properties": {
"title": item.name,
"layertype": item.layertype,
"datatype": item.datatype,
"val": item.val||1,
"desc": item.desc
}
});
}
if (item.layertype == '点图') {
var condPointConf = self.findPointCond(item, 'pointmap');
var title = '';
if (self.labelConf.labelType == "1") {
if (self.labelConf.showDataType && item.datatype) {
title += item.datatype + "|";
}
if (self.labelConf.showName && item.name) {
title += item.name + "|";
}
if (self.labelConf.showLng && item.lng) {
title += item.lng + "|";
}
if (self.labelConf.showLat && item.lat) {
title += item.lat + "|";
}
if (self.labelConf.showDesc && item.desc) {
title += item.desc + "|";
}
if (title.endWith("|")) {
title = title.substr(0, title.length - 1);
}
} else {
try {
title = new Function(self.labelConf.labelJsPane).call(item);
} catch (e) {
title = '';
}
}
if (!self.labelConf.showPointLabel) {
title = '';
}
pointDataSource.data.features.push({
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [item.lng, item.lat]
},
"properties": {
"iconname": condPointConf.iconname || "commonImg",
"title": title,
"name": item.name,
"datatype": item.datatype,
"val": item.val||1,
"desc": item.desc
}
});
}
});
self.baseMap.addSource('heatdata', heatDataSource);
self.baseMap.addSource('pointdata', pointDataSource);
var heatColors = [
"interpolate",
["linear"],
["heatmap-density"]
];
var interPosArr = self.heatConf.intervalPos.split("|");
var interColorArr = self.heatConf.intervalColors.split("|");
for (var i = 0; i < interPosArr.length; i++) {
if (i == 0) {
if (Math.round(parseFloat(interPosArr[i])*100)/100 <= 0) {
heatColors.push(Math.round(parseFloat(interPosArr[i])*100)/100);
heatColors.push(self.hexToRgba(interColorArr[i], 0).rgba);
} else {
heatColors.push(0);
heatColors.push(self.hexToRgba(interColorArr[i], 0).rgba);
heatColors.push(Math.round(parseFloat(interPosArr[i])*100)/100);
heatColors.push(self.hexToRgba(interColorArr[i], self.heatConf.bgOpacity).rgba);
}
} else {
heatColors.push(Math.round(parseFloat(interPosArr[i])*100)/100);
heatColors.push(self.hexToRgba(interColorArr[i], self.heatConf.bgOpacity).rgba);
}
}
self.baseMap.addLayer({
"id": "heatmap1",
"type": "heatmap",
"source": "heatdata",
"maxzoom": 24,
"paint": {
"heatmap-radius": self.heatConf.radius || 10,
"heatmap-weight": [
'interpolate',
['linear'],
['get', 'val'],
0,
0,
parseFloat(self.heatConf.maxValue) || 1,
1
],
"heatmap-color": heatColors
}
});
var iconSize = 1;
if (self.pointConf.pointimgh && self.pointConf.pointimgw) {
var imgsize = parseInt(self.pointConf.pointimgh) > parseInt(self.pointConf.pointimgw) ? parseInt(self.pointConf.pointimgh) : parseInt(self.pointConf.pointimgw);
iconSize = parseInt(self.pointConf.pointSize) / imgsize;
}
self.baseMap.addLayer({
'id': 'points1',
'type': 'symbol',
'maxzoom': 24,
'minzoom': 0,
'source': 'pointdata',
'layout': {
'icon-allow-overlap': true,
'icon-size': iconSize,
'icon-image': ['get', 'iconname'],
'icon-ignore-placement': true,
'text-allow-overlap': true,
'text-ignore-placement': true,
'text-size': self.labelConf.labelsize,
'text-field': ['get', 'title'],
//'text-font': ["微软雅黑", "Open Sans Regular","Arial Unicode MS Regular"],
'text-offset': [0, 1],
'text-anchor': 'top'
},
'paint': {
'text-color': self.labelConf.labelcolor,
'text-halo-color': self.hexToRgba(self.labelConf.labelBgColor, 100).rgba,
'text-halo-width': 10
}
});
},
hexToRgba: function(hex, al) {
var hexColor = /^#/.test(hex) ? hex.slice(1) : hex,
alp = hex === 'transparent' ? 0 : Math.ceil(al),
r, g, b;
hexColor = /^[0-9a-f]{3}|[0-9a-f]{6}$/i.test(hexColor) ? hexColor : 'fffff';
if (hexColor.length === 3) {
hexColor = hexColor.replace(/(\w)(\w)(\w)/gi, '$1$1$2$2$3$3');
}
r = hexColor.slice(0, 2);
g = hexColor.slice(2, 4);
b = hexColor.slice(4, 6);
r = parseInt(r, 16);
g = parseInt(g, 16);
b = parseInt(b, 16);
return {
hex: '#' + hexColor,
alpha: alp,
rgba: 'rgba(' + r + ', ' + g + ', ' + b + ', ' + (alp / 100).toFixed(2) + ')'
};
},
isNullStr: function (val, def) {
if (typeof(val) == undefined || "" == val || null == val || val.length <= 0) {
if (typeof(def) == undefined || "" == def || null == def || def.length <= 0) {
return "";
}
return def;
}
if (val.trim) {
return val.trim();
}
return val;
},
isNullInt: function (val, def) {
if (typeof(val) == undefined || "" == val || null == val || val.length <= 0) {
if (typeof(def) == undefined || "" == def || null == def || def.length <= 0) {
return 0;
}
return parseInt(def);
}
return parseInt(val);
},
isNullBoolean: function (val, def) {
if (typeof(val) == undefined || "" == val || null == val) {
if (typeof(def) == undefined || "" == def || null == def) {
return false;
}
return def;
}
return val;
},
getAlign: function (align) {
if ("2" == align) {
return "left";
} else if ("0" == align) {
return "center";
} else if ("4" == align) {
return "right";
}
},
getFontStyle: function (style) {
if ("2" == style || "3" == style) {
return "italic";
} else {
return "normal";
}
},
getFontWeight: function(style){
if ("1" == style || "3" == style) {
return "bold";
} else {
return "normal";
}
},
calTextWidth: function(str, fontSize) {
var fontSize = fontSize || 12;
var strHtml = $('<span>')
.attr("id", "temp_cal_text_font_size")
.css({
"display": "none",
"font-size": fontSize + "px",
"font-family": "Microsoft YaHei"
}).html(str);
$(document.body).append(strHtml);
var width = $('#temp_cal_text_font_size').width();
var height = $('#temp_cal_text_font_size').height();
$('#temp_cal_text_font_size').remove();
return [width, height];
}
});

19
src/com/fr/plugin/heatpointmapbox/web/HeatPointMapCssFilePlaceHolder.java

@ -0,0 +1,19 @@
package com.fr.plugin.heatpointmapbox.web;
import com.fr.stable.fun.impl.AbstractStylePlaceHolder;
public class HeatPointMapCssFilePlaceHolder extends AbstractStylePlaceHolder {
@Override
public LinkTag[] holderLinks() {
LinkTag tag1 = LinkTag.build();
tag1.rel("stylesheet");
tag1.href("https://api.mapbox.com/mapbox-gl-js/v2.11.0/mapbox-gl.css");
return new LinkTag[]{tag1};
}
@Override
public String mark4Provider() {
return this.getClass().getName();
}
}

17
src/com/fr/plugin/heatpointmapbox/web/HeatPointMapJsFilePlaceHolder.java

@ -0,0 +1,17 @@
package com.fr.plugin.heatpointmapbox.web;
import com.fr.stable.fun.impl.AbstractJavaScriptPlaceHolder;
public class HeatPointMapJsFilePlaceHolder extends AbstractJavaScriptPlaceHolder {
@Override
public ScriptTag[] holderScripts() {
ScriptTag tag1 = ScriptTag.build();
tag1.type("text/javascript");
tag1.src("https://api.mapbox.com/mapbox-gl-js/v2.11.0/mapbox-gl.js");
ScriptTag tag2 = ScriptTag.build();
tag2.type("text/javascript");
tag2.src("https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-language/v1.0.0/mapbox-gl-language.js");
return new ScriptTag[]{tag1, tag2};
}
}
Loading…
Cancel
Save