Browse Source

REPORT-104017 海外版本地图组件的GIS图层优化-fvs下切换gis图层配置时自动会由mapbox变为黑色

new-design
obo 1 year ago
parent
commit
3109cda04d
  1. 25
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

25
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -62,6 +62,11 @@ public class GisLayerPane extends JPanel implements UIObserver {
private String[] layers = MapLayerConfigManager.getCustomLayerItems(); private String[] layers = MapLayerConfigManager.getCustomLayerItems();
/**
* fvs的具体类型
*/
private String FVS_TEMPLATE_CLASS = "class com.fr.plugin.wysiwyg.report.JDuchamp";
public GisLayerPane() { public GisLayerPane() {
initComps(); initComps();
} }
@ -291,7 +296,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
if (layer.getGisLayerType() == GISLayerType.LAYER_NULL) { if (layer.getGisLayerType() == GISLayerType.LAYER_NULL) {
standardLayers.setSelectedIndex(standardLayers.getItemCount() - 1); standardLayers.setSelectedIndex(standardLayers.getItemCount() - 1);
} else { } else {
if(Locale.CHINA.equals(GeneralContext.getLocale())) { if (Locale.CHINA.equals(GeneralContext.getLocale())) {
standardLayers.setSelectedItem(layerName); standardLayers.setSelectedItem(layerName);
layer.setGaoDeGisType(GaoDeGisType.parseByLocaleName(layerName)); layer.setGaoDeGisType(GaoDeGisType.parseByLocaleName(layerName));
} else { } else {
@ -358,22 +363,16 @@ public class GisLayerPane extends JPanel implements UIObserver {
* @param layer 图层 * @param layer 图层
*/ */
private void adaptEditingTemplateTheme(GisLayer layer) { private void adaptEditingTemplateTheme(GisLayer layer) {
if (Locale.CHINA.equals(GeneralContext.getLocale())) { if (GeneralContext.isSimpleChineseEnv()) {
return; return;
} }
JTemplate<?, ?> currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
String defaultTabOperator = "DefaultTabOperator"; //用于判断是否为fvs,fvs没有主题,但会返回深色主题导致mapbox切换为black if (JTemplate.isValid(currentEditingTemplate)) {
if (FVS_TEMPLATE_CLASS.equals(currentEditingTemplate.getClass().toString())) {
if(JTemplate.isValid(currentEditingTemplate)) { return;
boolean dark = currentEditingTemplate.getTemplateTheme().isDark();
String name;
String mapbox = Toolkit.i18nText("Fine-Design_Chart_Layer_MapBox");
String black = Toolkit.i18nText("Fine-Design_Chart_Layer_Black");
if(defaultTabOperator.equals(currentEditingTemplate.getTemplateTabOperatorType())) {
name = dark ? black : mapbox;
} else {
name = mapbox;
} }
boolean dark = currentEditingTemplate.getTemplateTheme().isDark();
String name = dark ? Toolkit.i18nText("Fine-Design_Chart_Layer_Black") : Toolkit.i18nText("Fine-Design_Chart_Layer_MapBox");
layer.setLayerName(name); layer.setLayerName(name);
} }
} }

Loading…
Cancel
Save