Browse Source

Merge branch 'release/11.0' of ssh://code.fineres.com:7999/~carlson/design into release/11.0

release/11.0
Carlson 1 year ago
parent
commit
c17243b639
  1. 17
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  2. 11
      designer-base/src/main/java/com/fr/design/jxbrowser/MimeType.java
  3. 14
      designer-base/src/main/java/com/fr/design/jxbrowser/NxInterceptRequestCallback.java
  4. 14
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  5. 37
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java
  6. 31
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsNewPane.java
  7. 9
      designer-base/src/test/java/com/fr/design/jxbrowser/MimeTypeTest.java
  8. 77
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  9. 30
      designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java
  10. 4
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java
  11. 2
      designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java
  12. 6
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

17
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -239,11 +239,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
String reportPath = reportletsTree.getSelectedTemplatePath();
final String selectedFilePath = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, reportPath);
String lock = node.getLock();
boolean showLockInfo = LockInfoUtils.isCompatibleOperator()
|| LockInfoUtils.unableGetLockInfo()
|| WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(selectedFilePath)
? (lock != null && !lock.equals(node.getUserID()))
: WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath);
boolean showLockInfo = needShowLockInfo(lock, selectedFilePath, node);
if (showLockInfo) {
UserInfo userInfo = WorkContext.getCurrent().get(LockInfoOperator.class).getUserInfo(selectedFilePath);
node.setLock(UUID.randomUUID().toString());
@ -257,6 +253,17 @@ public class TemplateTreePane extends JPanel implements FileOperations {
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(selectedFilePath, false)));
}
/**
* 是否需要展示锁定信息
*/
public static boolean needShowLockInfo(String lock, String selectedFilePath, FileNode node) {
return LockInfoUtils.isCompatibleOperator()
|| LockInfoUtils.unableGetLockInfo()
|| WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(selectedFilePath)
? (lock != null && !lock.equals(node.getUserID()))
: WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath);
}
private void checkDevelopForBiddenTemplate(String selectedFilePath) {
JTemplate<?, ?> template = getOpenedTemplate(selectedFilePath);
if (template != null && template.isForbidden()) {

11
designer-base/src/main/java/com/fr/design/jxbrowser/MimeType.java

@ -83,21 +83,20 @@ public enum MimeType {
* 如果没有尝试使用 Files.probeContentType 检测
* 如果没有默认返回 text/html
*
* @param url url路径
* @param resourcePath 资源路径
* @return MimeType
*/
public static String parseMimeType(String url) {
if (StringUtils.isBlank(url)) {
public static String parseMimeType(String resourcePath) {
if (StringUtils.isBlank(resourcePath)) {
return HTML.mimeType;
}
String finalPath = url.split("\\?")[0];
Optional<MimeType> mimeType = Arrays.stream(values())
.filter(type -> finalPath.endsWith(type.suffix))
.filter(type -> resourcePath.endsWith(type.suffix))
.findFirst();
if (mimeType.isPresent()) {
return mimeType.get().mimeType;
} else {
return getFileMimeType(finalPath);
return getFileMimeType(resourcePath);
}
}

14
designer-base/src/main/java/com/fr/design/jxbrowser/NxInterceptRequestCallback.java

@ -20,6 +20,7 @@ import com.teamdev.jxbrowser.net.callback.InterceptUrlRequestCallback;
import org.jetbrains.annotations.NotNull;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
@ -80,8 +81,9 @@ public class NxInterceptRequestCallback implements InterceptUrlRequestCallback {
protected Optional<UrlRequestJob> generateFileProtocolUrlRequestJob(Params params, String path) {
try {
InputStream inputStream = getResourceStream(path);
String mimeType = MimeType.parseMimeType(path);
String resourcePath = getResourcePath(path);
InputStream inputStream = getResourceStream(resourcePath);
String mimeType = MimeType.parseMimeType(resourcePath);
byte[] bytes;
if (isHtml(mimeType)) {
String text = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8);
@ -104,7 +106,11 @@ public class NxInterceptRequestCallback implements InterceptUrlRequestCallback {
* @return 输入流
* @throws Exception IO异常
*/
private InputStream getResourceStream(String path) throws Exception {
private InputStream getResourceStream(String path) {
return IOUtils.readResource(path);
}
private static String getResourcePath(String path) throws UnsupportedEncodingException {
int index = path.indexOf("=");
if (index > 0) {
path = path.substring(index + 1);
@ -115,7 +121,7 @@ public class NxInterceptRequestCallback implements InterceptUrlRequestCallback {
// 通过自定义协议之后的url会自动encode一些中文字符,这里做一个decode,否则会导致路径访问失败
path = URLDecoder.decode(path, StandardCharsets.UTF_8.name());
}
return IOUtils.readResource(path);
return path;
}
private boolean isHtml(String mimeType) {

14
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -255,13 +255,17 @@ public class VcsHelper implements JTemplateActionListener {
VcsOperator operator = WorkContext.getCurrent().get(VcsOperator.class);
String oldPath = oldName.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY);
List<VcsEntity> oldVcsEntities = operator.getVersions(oldPath);
String replaceName = newName.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY);
for (VcsEntity oldVcsEntity : oldVcsEntities) {
operator.saveVersion(oldVcsEntity.getUsername(), newName.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY), oldVcsEntity.getCommitMsg(), oldVcsEntity.getVersion());
operator.deleteVersion(oldPath, oldVcsEntity.getVersion());
if (!VcsHelper.getInstance().isLegacyMode()) {
operator.renameVersion(oldVcsEntity, replaceName);
} else {
operator.saveVersion(oldVcsEntity.getUsername(), replaceName, oldVcsEntity.getCommitMsg(), oldVcsEntity.getVersion());
operator.deleteVersion(oldPath, oldVcsEntity.getVersion());
}
}
FineLoggerFactory.getLogger().debug("moveVcs success. from {} to {}", oldName, newName);
if (GcConfig.getInstance().isGcEnable()) {
FineLoggerFactory.getLogger().debug("moveVcs success. from {} to {}", oldName, replaceName);
if (GcConfig.getInstance().isGcEnable() && VcsHelper.getInstance().isLegacyMode()) {
operator.gc();
}
}

37
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java

@ -4,8 +4,10 @@ import com.fr.base.svg.IconUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.lock.LockInfoUtils;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.vcs.VcsOperatorWorker;
@ -15,6 +17,7 @@ import com.fr.design.mainframe.vcs.common.VcsCloseTemplateHelper;
import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode;
import com.fr.report.entity.VcsEntity;
import com.fr.report.lock.LockInfoOperator;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
@ -25,10 +28,13 @@ import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.SwingWorker;
import javax.swing.UIManager;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
/**
@ -148,12 +154,35 @@ public class VcsCenterPane extends VcsNewPane {
if (o instanceof VcsTableEntity) {
VcsEntity entity = ((VcsTableEntity) o).getEntity();
saveSettingAndCloseDialog();
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(getTemplateTruePath(entity.getFilename()), false)));
showTemplate(entity.getFilename(), new FileNode(getTemplateTruePath(entity.getFilename()), false));
}
}
});
}
private void showTemplate(String filename, FileNode node) {
new SwingWorker<Boolean, Void>() {
@Override
protected Boolean doInBackground() throws Exception {
String selectedFilePath = getTemplateTruePath(filename);
String lock = node.getLock();
return TemplateTreePane.needShowLockInfo(lock, selectedFilePath, node);
}
@Override
protected void done() {
try {
if (!get()) {
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(node));
} else {
FineJOptionPane.showMessageDialog(VcsCenterPane.this, Toolkit.i18nText("Fine-Design_Vcs_Open_Lock_Tip"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE);
}
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
}
}.execute();
}
private void initManagerListener() {
manager.addMouseListener(new MouseAdapter() {
@Override
@ -212,12 +241,6 @@ public class VcsCenterPane extends VcsNewPane {
return TITLE;
}
private String getTemplateTruePath(String filename) {
return StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, filename);
}
@Override
protected String getDeleteTip(int size) {
return Toolkit.i18nText("Fine-Design_Vcs_Delete_Select_All_Version");

31
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsNewPane.java

@ -4,6 +4,7 @@ import com.fr.base.svg.IconUtils;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.MultiTemplateTabPane;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
@ -16,10 +17,15 @@ import com.fr.design.mainframe.vcs.common.VcsCacheFileNodeFile;
import com.fr.design.mainframe.vcs.common.VcsHelper;
import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode;
import com.fr.file.filetree.FileNodes;
import com.fr.io.utils.ResourceIOUtils;
import com.fr.report.InconsistentLockException;
import com.fr.report.entity.VcsEntity;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.resource.WorkResource;
import com.fr.workspace.server.vcs.VcsFileUtils;
import com.fr.workspace.server.vcs.VcsOperator;
import com.fr.workspace.server.vcs.v2.VcsTaskResult;
@ -29,6 +35,7 @@ import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.SwingWorker;
import javax.swing.UIManager;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@ -179,9 +186,12 @@ public class VcsNewPane extends RecyclePane {
@Override
protected VcsTaskResult doInBackground() throws Exception {
String path = VcsHelper.getInstance().getFilePath(entity);
if (!ResourceIOUtils.exist(path)) {
if (!WorkContext.getCurrent().get(WorkResource.class).exist(path)) {
return new VcsTaskResult(false, new FileNotFoundException());
}
if (checkLock(entity.getFilename())) {
return new VcsTaskResult(false, new InconsistentLockException());
}
//step1.设置还原的用户名
entity.setUsername(VcsHelper.getInstance().getCurrentUsername());
//step2.rollback到指定版本
@ -206,7 +216,11 @@ public class VcsNewPane extends RecyclePane {
}
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(filePath, false)));
} else {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Warning_Template_Do_Not_Exsit"));
if (result.getException() instanceof FileNotFoundException) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Warning_Template_Do_Not_Exsit"));
} else {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Vcs_Open_Lock_Tip"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE);
}
}
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
@ -215,6 +229,19 @@ public class VcsNewPane extends RecyclePane {
}.execute();
}
private boolean checkLock(String filename) {
String selectedFilePath = getTemplateTruePath(filename);
FileNode node = new FileNode(getTemplateTruePath(filename), false);
String lock = node.getLock();
return TemplateTreePane.needShowLockInfo(lock, selectedFilePath, node);
}
/**
* 获取模板的路径
*/
public String getTemplateTruePath(String filename) {
return StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, filename);
}
private void initDeleteListener() {
delete.addMouseListener(new MouseAdapter() {

9
designer-base/src/test/java/com/fr/design/jxbrowser/MimeTypeTest.java

@ -13,9 +13,10 @@ public class MimeTypeTest {
@Test
public void getMimeType() {
Assert.assertEquals("text/html", MimeType.parseMimeType("http://a.html"));
Assert.assertEquals("text/html", MimeType.parseMimeType("http://a.html?a=ji"));
Assert.assertEquals("text/html", MimeType.parseMimeType("http://a.xml?a=ji"));
Assert.assertEquals("image/jpeg", MimeType.parseMimeType("http://a.jpg?a=ji"));
Assert.assertEquals("image/jpeg", MimeType.parseMimeType("http://a.jpeg?a=ji"));
Assert.assertEquals("truetype",
MimeType.parseMimeType("emb://com/fr/web/ui/resources?path=/com/fr/web/ui/font/iconfont.ttf"));
Assert.assertEquals("font/woff",
MimeType.parseMimeType("http://a.html?path=com/fr/ui/a.woff"));
// 对资源来说不存在http://a.jpg?a=ji这种情况,之前多虑了
}
}

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

@ -11,6 +11,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.plugin.chart.base.GisLayer;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.server.MapLayerConfigManager;
@ -29,6 +30,7 @@ import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.util.Locale;
/**
* @author Bjorn
@ -39,8 +41,16 @@ public class GisLayerPane extends JPanel implements UIObserver {
private UIButtonGroup gisButton;
private JPanel layerPaneCheckPane;
private UIComboBox gisGaoDeLayer;
private UIComboBox gisLayer;
/**
* 标准图层
*/
private UIComboBox standardLayers;
/**
* 自定义图层
*/
private UIComboBox customLayers;
private JPanel layerCardPane;
private WMSLayerPane wmsLayerPane;
@ -48,7 +58,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
private UIComboBox zoomLevel;
private String[] layers = MapLayerConfigManager.getLayerItems();
private String[] layers = MapLayerConfigManager.getCustomLayerItems();
public GisLayerPane() {
initComps();
@ -86,15 +96,12 @@ public class GisLayerPane extends JPanel implements UIObserver {
gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"),
Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")});
gisButton.setSelectedIndex(ChartEditContext.supportTheme() ? 0 : 1);
gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems());
gisButton.addActionListener(event -> {
refreshZoomLevel();
checkLayerCardPane();
});
gisGaoDeLayer.addItemListener(event -> refreshZoomLevel());
initCustomGISLayerPane();
initLayer();
initLayerCardPane();
layerPaneCheckPane = new JPanel(new CardLayout()) {
@ -104,15 +111,15 @@ public class GisLayerPane extends JPanel implements UIObserver {
return new Dimension(0, 0);
}
if (isStandardGis()) {
return gisGaoDeLayer.getPreferredSize();
return standardLayers.getPreferredSize();
} else {
return gisLayer.getPreferredSize();
return customLayers.getPreferredSize();
}
}
};
layerPaneCheckPane.add(new JPanel(), "auto");
layerPaneCheckPane.add(gisGaoDeLayer, "standard");
layerPaneCheckPane.add(gisLayer, "custom");
layerPaneCheckPane.add(standardLayers, "standard");
layerPaneCheckPane.add(customLayers, "custom");
double p = TableLayout.PREFERRED;
@ -142,7 +149,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
if (isStandardGis() || isAuto()) {
return new Dimension(0, 0);
}
String itemName = Utils.objectToString(gisLayer.getSelectedItem());
String itemName = Utils.objectToString(customLayers.getSelectedItem());
if (MapLayerConfigManager.isCustomLayer(itemName)) {
return tileLayerPane.getPreferredSize();
} else if (MapLayerConfigManager.isCustomWmsLayer(itemName)) {
@ -163,10 +170,12 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
}
private void initCustomGISLayerPane() {
gisLayer = new UIComboBox(layers);
private void initLayer() {
standardLayers = new UIComboBox(MapLayerConfigManager.getStandardLayerItems());
customLayers = new UIComboBox(layers);
gisLayer.addItemListener(e ->
standardLayers.addItemListener(event -> refreshZoomLevel());
customLayers.addItemListener(e ->
{
if (e.getStateChange() == ItemEvent.SELECTED) {
checkCustomLayerCardPane();
@ -175,7 +184,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
);
gisLayer.addPopupMenuListener(new PopupMenuListener() {
customLayers.addPopupMenuListener(new PopupMenuListener() {
public void popupMenuCanceled(PopupMenuEvent e) {
}
@ -184,12 +193,12 @@ public class GisLayerPane extends JPanel implements UIObserver {
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
String selected = Utils.objectToString(gisLayer.getSelectedItem());
String selected = Utils.objectToString(customLayers.getSelectedItem());
ZoomLevel zoomSelected = (ZoomLevel) zoomLevel.getSelectedItem();
gisLayer.setModel(new DefaultComboBoxModel(MapLayerConfigManager.getLayerItems()));
customLayers.setModel(new DefaultComboBoxModel(MapLayerConfigManager.getCustomLayerItems()));
gisLayer.setSelectedItem(selected);
customLayers.setSelectedItem(selected);
zoomLevel.setSelectedItem(zoomSelected);
}
});
@ -201,15 +210,15 @@ public class GisLayerPane extends JPanel implements UIObserver {
if (isAuto()) {
levels = MapStatusPane.ZOOM_LEVELS;
} else if (isStandardGis()) {
if (gisGaoDeLayer.getSelectedIndex() == gisGaoDeLayer.getItemCount() - 1) {
if (standardLayers.getSelectedIndex() == standardLayers.getItemCount() - 1) {
levels = MapStatusPane.ZOOM_LEVELS;
} else {
levels = MapStatusPane.GAODE_ZOOM_LEVELS;
}
} else {
if (ComparatorUtils.equals(gisLayer.getSelectedItem(), Toolkit.i18nText("Fine-Design_Chart_Layer_Blue"))) {
if (ComparatorUtils.equals(customLayers.getSelectedItem(), Toolkit.i18nText("Fine-Design_Chart_Layer_Blue"))) {
levels = MapStatusPane.BLUE_ZOOM_LEVELS;
} else if (ComparatorUtils.equals(gisLayer.getSelectedItem(), Toolkit.i18nText("Fine-Design_Chart_Layer_GaoDe"))) {
} else if (ComparatorUtils.equals(customLayers.getSelectedItem(), Toolkit.i18nText("Fine-Design_Chart_Layer_GaoDe"))) {
levels = MapStatusPane.GAODE_ZOOM_LEVELS;
} else {
levels = MapStatusPane.ZOOM_LEVELS;
@ -233,7 +242,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
private void checkCustomLayerCardPane() {
CardLayout cardLayout = (CardLayout) layerCardPane.getLayout();
cardLayout.show(layerCardPane, Utils.objectToString(gisLayer.getSelectedItem()));
cardLayout.show(layerCardPane, Utils.objectToString(customLayers.getSelectedItem()));
}
public void resetGisLayer(VanChartMapPlot mapPlot) {
@ -256,8 +265,12 @@ public class GisLayerPane extends JPanel implements UIObserver {
switch (layer.getGisLayerType()) {
case AUTO:
gisButton.setSelectedIndex(0);
layer.setGisLayerType(GISLayerType.AUTO);
layer.setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));
//dealWithTemplateTheme(layer);
break;
case GAO_DE_API:
populateStandardGis(layer);
case LAYER_NULL:
populateStandardGis(layer);
break;
@ -272,16 +285,22 @@ public class GisLayerPane extends JPanel implements UIObserver {
private void populateStandardGis(GisLayer layer) {
gisButton.setSelectedIndex(1);
String layerName = layer.getLayerName();
if (layer.getGisLayerType() == GISLayerType.LAYER_NULL) {
gisGaoDeLayer.setSelectedIndex(gisGaoDeLayer.getItemCount() - 1);
standardLayers.setSelectedIndex(standardLayers.getItemCount() - 1);
} else {
gisGaoDeLayer.setSelectedItem(layer.getGaoDeGisType().getTypeName());
if(Locale.CHINA.equals(GeneralContext.getLocale())) {
standardLayers.setSelectedItem(layerName);
layer.setGaoDeGisType(GaoDeGisType.parseByLocaleName(layerName));
} else {
standardLayers.setSelectedItem(layerName);
}
}
}
private void populateCustomGis(GisLayer layer) {
gisButton.setSelectedIndex(2);
gisLayer.setSelectedItem(layer.getShowItemName());
customLayers.setSelectedItem(layer.getShowItemName());
switch (layer.getGisLayerType()) {
case CUSTOM_WMS_LAYER:
@ -305,9 +324,9 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
private void updateStandardGis(GisLayer layer) {
String layerName = Utils.objectToString(gisGaoDeLayer.getSelectedItem());
String layerName = Utils.objectToString(standardLayers.getSelectedItem());
layer.setLayerName(layerName);
if (gisGaoDeLayer.getSelectedIndex() == gisGaoDeLayer.getItemCount() - 1) {
if (standardLayers.getSelectedIndex() == standardLayers.getItemCount() - 1) {
layer.setGisLayerType(MapLayerConfigManager.getGisLayerType(layerName));
} else {
layer.setGisLayerType(GISLayerType.GAO_DE_API);
@ -316,7 +335,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
private void updateCustomGis(GisLayer layer) {
String layerName = Utils.objectToString(gisLayer.getSelectedItem());
String layerName = Utils.objectToString(customLayers.getSelectedItem());
layer.setLayerName(layerName);
layer.setGisLayerType(MapLayerConfigManager.getGisLayerType(layerName));

30
designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java

@ -1,25 +1,17 @@
package com.fr.design.report;
import com.fr.base.CustomConfig;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.LocaleLinkProvider;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.BrowseUtils;
import com.fr.io.attr.ReportExportAttr;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* 通用
@ -42,7 +34,6 @@ public class ExportUniversalPane extends BasicPane {
private static final String HELP_URL = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT);
private UICheckBox specialCharacterExport;
// 密码支持公式
private UICheckBox passwordSupportFormula;
@ -51,25 +42,6 @@ public class ExportUniversalPane extends BasicPane {
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel outerNorthPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Config"));
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel specialCharacterExportPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
specialCharacterExport = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Special_Character"));
specialCharacterExport.setSelected(true);
specialCharacterExportPane.add(specialCharacterExport);
northPane.add(specialCharacterExportPane);
JPanel labelPane = new JPanel(new BorderLayout());
labelPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
UILabel centerLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Special_Character_Tip"));
centerLabel.setForeground(Color.GRAY);
ActionLabel rightLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Report_Universal_Export_More_Alternative_Fonts"), UIConstants.FLESH_BLUE);
rightLabel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
BrowseUtils.browser(HELP_URL);
}
});
labelPane.add(centerLabel, BorderLayout.CENTER);
labelPane.add(rightLabel, BorderLayout.EAST);
northPane.add(labelPane);
JPanel passwordSupportPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
passwordSupportFormula = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Password_Support_Formula"));
passwordSupportFormula.setSelected(false);
@ -90,7 +62,6 @@ public class ExportUniversalPane extends BasicPane {
* @param reportExportAttr 报表导出属性
*/
public void populate(ReportExportAttr reportExportAttr) {
this.specialCharacterExport.setSelected(CustomConfig.getInstance().isOptimizedSpecialCharacterExport());
this.passwordSupportFormula.setSelected(reportExportAttr.isPwdSupportFormula());
}
@ -103,7 +74,6 @@ public class ExportUniversalPane extends BasicPane {
Configurations.modify(new WorkerFacade(CustomConfig.class) {
@Override
public void run() {
CustomConfig.getInstance().setOptimizedSpecialCharacterExport(specialCharacterExport.isSelected());
reportExportAttr.setPwdSupportFormula(passwordSupportFormula.isSelected());
}
});

4
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -815,10 +815,6 @@ public class CellSelection extends Selection {
return cellElements;
}
public Set<TemplateCellElement> getCellElements() {
return cellElements;
}
@Override
public void populatePropertyPane(ElementCasePane ePane) {
CellElementPropertyPane.getInstance().reInit(ePane);

2
designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

@ -442,7 +442,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
CellSelection cs = (CellSelection) tc.getSelection();
TemplateElementCase editingElementCase = tc.getEditingElementCase();
Set<TemplateCellElement> allCellElements = cs.getCellElements();
Set<TemplateCellElement> allCellElements = cs.getAllCellElements(editingElementCase);
Style oldStyle = cellElement == null ? Style.DEFAULT_STYLE : cellElement.getStyle();
Style style = formatPane.update(oldStyle);
for (TemplateCellElement cellElement : allCellElements) {

6
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -241,7 +241,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
dataPane.update(cellElement);
CellSelection selection = (CellSelection) tc.getSelection();
Set<TemplateCellElement> allCellElements = selection.getCellElements();
Set<TemplateCellElement> allCellElements = selection.getAllCellElements(tc.getEditingElementCase());
groupPane.update(allCellElements);
}
@ -319,7 +319,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
@Override
public void itemStateChanged(ItemEvent e) {
CellSelection selection = (CellSelection) tc.getSelection();
Set<TemplateCellElement> allCellElements = selection.getCellElements();
Set<TemplateCellElement> allCellElements = selection.getAllCellElements(tc.getEditingElementCase());
if (e == null || e.getStateChange() == ItemEvent.DESELECTED) {
//分组-高级-自定义点确定的时候传进来null的e,但是这时候应该触发保存
groupPane.update(allCellElements);
@ -351,7 +351,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
if (!selectedOneCell) {
// 只有在批量操作的时候才需要判断是否隐藏条件面板
CellSelection selection = (CellSelection) tc.getSelection();
boolean sameDSName = checkSameDSName(selection.getCellElements());
boolean sameDSName = checkSameDSName(selection.getAllCellElements(tc.getEditingElementCase()));
conditionPane.setVisible(sameDSName);
} else {
conditionPane.setVisible(true);

Loading…
Cancel
Save