Browse Source

Merge pull request #5866 in DESIGN/design from bugfix/10.0 to release/10.0

* commit '7fc3164d985b2bef03b7c3502d84fb8628b86fd2':
  REPORT-58252 报表块单元格行列标识去掉后的弥补方案
  REPORT-59099 给帮助文档的网址补上默认值
  REPORT-58227 远程设计 设计器切换已经打开的模板卡顿
  REPORT-58588 FR11-二轮回归-设计器菜单栏-社区-帮助文档跳转地址的首页面不正确
  REPORT-58200 初次安装的10.0设计器,用户目录下会生成.finereport80缓存文件
  REPORT-56602 页面设置的纸张大小与实际分页精度不符
  REPORT-56602 页面设置的纸张大小与实际分页精度不符
  REPORT-55048 https远程连接时,设计器上无法获取服务器推送过来的eventhread线程日志
zheng-1641779399395
superman 3 years ago
parent
commit
7a54145372
  1. 3
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 7
      designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java
  3. 44
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
  4. 47
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java
  5. 11
      designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java
  6. 20
      designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java
  7. 78
      designer-realize/src/main/java/com/fr/grid/GridUI.java

3
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -390,9 +390,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
}
File envHome = new File(userHome + File.separator + "." + ProductConstants.APP_NAME + version);
if (!envHome.exists()) {
StableUtils.mkdirs(envHome);
}
return envHome.getAbsolutePath();
}

7
designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java

@ -1,5 +1,6 @@
package com.fr.design.actions.help;
import com.fr.design.i18n.Toolkit;
import com.fr.design.login.AbstractDesignerSSO;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.CloudCenter;
@ -27,7 +28,11 @@ public class TutorialAction extends AbstractDesignerSSO {
@Override
public String getJumpUrl() {
return CloudCenter.getInstance().acquireUrlByKind(createDocKey());
return CloudCenter.getInstance().acquireUrlByKind(createDocKey(), "http://help.finereport.com");
}
public String getOffLineWarnMessage() {
return Toolkit.i18nText("Fine-Design_Offline_Helptutorial_Msg");
}
// 生成帮助文档 sitecenter key, help.zh_CN.10

44
designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java

@ -25,6 +25,7 @@ import com.fr.design.gui.icombobox.UIComboBoxEditor;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -39,7 +40,16 @@ import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.connection.DBConnectAuth;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.Collections;
import java.util.concurrent.CancellationException;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.SwingWorker;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.PopupMenuEvent;
@ -50,7 +60,6 @@ import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
@ -70,6 +79,9 @@ import java.util.concurrent.FutureTask;
* @since 2012-7-11下午4:49:39
*/
public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refreshable, Previewable, Prepare4DataSourceChange {
private static final List<String> PENDING_CONTENT = new ArrayList<>(Collections.singletonList(Toolkit.i18nText("Fine-Design_Basic_Loading") + "..."));
private static final double COLUMN_SIZE = 24;
/**
@ -91,6 +103,8 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
private SwingWorker populateWorker;
private SwingWorker<List<String>, Void> initWorker;
private PopupMenuListener popupMenuListener = new PopupMenuListener() {
@Override
@ -213,10 +227,34 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
@SuppressWarnings("unchecked")
protected void initDsNameComboBox() {
if (initWorker != null && !initWorker.isDone()) {
initWorker.cancel(true);
}
dsNameComboBox.setRefreshingModel(true);
FilterableComboBoxModel dsNameComboBoxModel = new FilterableComboBoxModel(getHasAuthConnections());
dsNameComboBox.setModel(new FilterableComboBoxModel(PENDING_CONTENT));
initWorker = new SwingWorker<List<String>, Void>() {
@Override
protected List<String> doInBackground() throws Exception {
return getHasAuthConnections();
}
@Override
protected void done() {
try {
FilterableComboBoxModel dsNameComboBoxModel = new FilterableComboBoxModel(get());
String selected = dsNameComboBox.getSelectedItem();
dsNameComboBox.setModel(dsNameComboBoxModel);
dsNameComboBox.setSelectedItem(selected);
dsNameComboBox.setRefreshingModel(false);
} catch (Exception e) {
if (!(e instanceof CancellationException)) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
};
initWorker.execute();
}
protected void initComponentsLayout(PreviewLabel previewLabel, int labelSize) {

47
designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java

@ -3,12 +3,19 @@ package com.fr.design.data.datapane.connect;
import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.*;
import java.awt.*;
import com.fr.log.FineLoggerFactory;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.Iterator;
import java.util.concurrent.CancellationException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
public abstract class ItemEditableComboBoxPanel extends JPanel {
/**
@ -16,6 +23,8 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
*/
private static final long serialVersionUID = 1L;
private static final String PENDING = Toolkit.i18nText("Fine-Design_Basic_Loading") + "...";
protected static final Object EMPTY = new Object() {
public String toString() {
return "";
@ -26,6 +35,8 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
protected UIButton editButton;
protected UIButton refreshButton;
private SwingWorker<Iterator<String>, Void> refreshWorker;
public ItemEditableComboBoxPanel() {
super();
@ -75,26 +86,42 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
* 刷新itemComboBox的内容
*/
protected void refreshItems() {
// 记录原来选中的Item,重新加载后需要再次选中
Object lastSelectedItem = itemComboBox.getSelectedItem();
if (refreshWorker != null && !refreshWorker.isDone()) {
refreshWorker.cancel(true);
}
DefaultComboBoxModel model = ((DefaultComboBoxModel) itemComboBox.getModel());
model.removeAllElements();
// 先加EMPTY,再加items
model.addElement(EMPTY);
model.addElement(PENDING);
java.util.Iterator<String> itemIt = items();
refreshWorker = new SwingWorker<Iterator<String>, Void>() {
@Override
protected Iterator<String> doInBackground() throws Exception {
return items();
}
@Override
protected void done() {
try {
Iterator<String> itemIt = get();
model.removeElement(PENDING);
while(itemIt.hasNext()) {
model.addElement(itemIt.next());
}
itemComboBox.setMaximumRowCount(itemComboBox.getMaximumRowCount() + 1);
} catch (Exception e) {
if (!(e instanceof CancellationException)) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
// 再次选中之前选中的Item
int idx = model.getIndexOf(lastSelectedItem);
if(idx < 0) {
idx = 0;
}
itemComboBox.setSelectedIndex(idx);
};
refreshWorker.execute();
}
/*

11
designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java

@ -6,6 +6,9 @@ import com.fr.design.actions.UpdateAction;
import com.fr.design.login.utils.DesignerLoginUtils;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.utils.BrowseUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import java.awt.event.ActionEvent;
import java.util.HashMap;
import java.util.Map;
@ -21,6 +24,10 @@ public abstract class AbstractDesignerSSO extends UpdateAction {
public void actionPerformed(ActionEvent event) {
String url = getJumpUrl();
if (!DesignerLoginUtils.isOnline()) {
String message = getOffLineWarnMessage();
if (StringUtils.isNotEmpty(message)) {
FineLoggerFactory.getLogger().warn(message);
}
BrowseUtils.browser(url);
return;
}
@ -47,4 +54,8 @@ public abstract class AbstractDesignerSSO extends UpdateAction {
}
public abstract String getJumpUrl();
public String getOffLineWarnMessage() {
return StringUtils.EMPTY;
}
}

20
designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java

@ -152,13 +152,11 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
private ScrollAction PRESS_ACTION = new ScrollAction() {
@Override
public boolean run(MouseEvent evt, int index, double tmpSize1, double tmpSize2, int tmpIncreaseSize, int oldEndValueSize, ElementCase report, DynamicUnitList sizeList) {
// int resolution = ScreenResolution.getScreenResolution();
if (isOnSeparatorLineIncludeZero(evt, tmpSize2, tmpIncreaseSize) || isOnNormalSeparatorLine(evt, tmpSize2)) {
dragType = GridUtils.DRAG_CELL_SIZE;
isDragPermited = true;
dragIndex = index;
showToolTip(evt, createToolTipString(sizeList.get(dragIndex).toPixD(resolution), sizeList.getRangeValue(0, dragIndex + 1).toPixD(resolution)));
showToolTip(evt, createToolTipString(sizeList.get(dragIndex), sizeList.getRangeValue(0, dragIndex + 1)));
return true;
}
if (between(evt, tmpSize1, tmpSize2)) {
@ -302,21 +300,18 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
protected abstract void resetGridSelectionBySelect(int index, ElementCasePane ePane);
private String createToolTipString(double doubleValue, double totalDoubleValue) {
private String createToolTipString(UNIT unitValue, UNIT totalUnitValue) {
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
// int resolution = ScreenResolution.getScreenResolution();
FU ulen = FU.valueOfPix((int) doubleValue, resolution);
FU tulen = FU.valueOfPix((int) totalDoubleValue, resolution);
ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
String unit = lengthUNIT.unitText();
double len = lengthUNIT.unit2Value4Scale(ulen);
double tlen = lengthUNIT.unit2Value4Scale(tulen);
double len = lengthUNIT.unit2Value4Scale(unitValue);
double tlen = lengthUNIT.unit2Value4Scale(totalUnitValue);
StringBuilder sb = new StringBuilder();
sb.append(String.format("%.2f", new Double(len)))
.append('/').append(String.format("%.2f", new Double(tlen)))
.append(unit).append('(')
.append((int)(doubleValue)).append('/')
.append((int)(totalDoubleValue))
.append((int)(unitValue.toPixD(resolution))).append('/')
.append((int)(totalUnitValue.toPixD(resolution)))
.append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px"))
.append(')');
return sb.toString();
@ -416,8 +411,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
iterateScrollBar(ePane, evt, DRAG_ACTION);
DynamicUnitList sizeList = getSizeList(report);
// int resolution = ScreenResolution.getScreenResolution();
this.setToolTipText2(this.createToolTipString(sizeList.get(dragIndex).toPixD(resolution), sizeList.getRangeValue(0, dragIndex + 1).toPixD(resolution)));
this.setToolTipText2(this.createToolTipString(sizeList.get(dragIndex), sizeList.getRangeValue(0, dragIndex + 1)));
}
ePane.repaint();

78
designer-realize/src/main/java/com/fr/grid/GridUI.java

@ -10,12 +10,15 @@ import com.fr.base.background.ColorBackground;
import com.fr.base.background.ImageFileBackground;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.unit.UnitConvertUtil;
import com.fr.general.Background;
import com.fr.general.ComparatorUtils;
import com.fr.grid.selection.CellSelection;
@ -48,6 +51,7 @@ import com.fr.stable.Constants;
import com.fr.stable.script.CalculatorUtils;
import com.fr.stable.unit.FU;
import com.fr.stable.AssistUtils;
import com.fr.stable.unit.UNIT;
import com.fr.third.antlr.ANTLRException;
import com.fr.third.guava.collect.HashMultimap;
@ -365,10 +369,10 @@ public class GridUI extends ComponentUI {
private class DrawVerticalLineHelper extends DrawLineHelper {
DrawVerticalLineHelper(GridRange gridRange, boolean showGridLine, boolean discardExtraGridLine,
DrawVerticalLineHelper(GridRange gridRange, boolean showGridLine, boolean showExtraGridLine,
boolean showPaginateLine, double paperPaintSize,
List paginateLineList, int resolution) {
super(gridRange, showGridLine, discardExtraGridLine, showPaginateLine,
super(gridRange, showGridLine, showExtraGridLine, showPaginateLine,
paperPaintSize, paginateLineList, resolution);
}
@ -384,47 +388,47 @@ public class GridUI extends ComponentUI {
@Override
protected void iterateStart2End(Graphics2D g2d) {
float rowHeight, paperYAxisSumSize = 0, maxXAxisSumSize = 0, yAxisSumSize = 0;
UNIT rowHeight, paperYAxisSumSize = FU.getInstance(0), maxXAxisSumSize = FU.getInstance(0), yAxisSumSize = FU.getInstance(0);
for (int i = 0; i <= gridRange.yEndIndex; i++) {
if (i == 0) {
i = gridRange.yBeginIndex;
for (int k = 0; k < gridRange.yBeginIndex; k++) {
rowHeight = gridRange.rowHeightList.get(k).toPixF(resolution);
paperYAxisSumSize += rowHeight;
if (paperYAxisSumSize >= paperPaintSize) {
rowHeight = gridRange.rowHeightList.get(k);
paperYAxisSumSize = paperYAxisSumSize.add(rowHeight);
if (paperYAxisSumSize.toPixF(resolution) >= paperPaintSize) {
paperYAxisSumSize = rowHeight;
}
}
}
rowHeight = gridRange.rowHeightList.get(i).toPixF(resolution);
paperYAxisSumSize += rowHeight;
rowHeight = gridRange.rowHeightList.get(i);
paperYAxisSumSize = paperYAxisSumSize.add(rowHeight);
if (showGridLine) {
float columnWidth, xAxisSumSize = 0;
UNIT columnWidth, xAxisSumSize = FU.getInstance(0);
for (int j = gridRange.xBeginIndex; j <= gridRange.xEndIndex; j++) {
columnWidth = gridRange.columnWidthList.get(j).toPixF(resolution);
columnWidth = gridRange.columnWidthList.get(j);
if (!mergeCellElementTable.get(CellPosition.value(i - 1, j)).contains(CellPosition.BOTTOM)) {
tmpLine2D.setLine(xAxisSumSize, yAxisSumSize, xAxisSumSize + columnWidth, yAxisSumSize);
tmpLine2D.setLine(xAxisSumSize.toPixF(resolution), yAxisSumSize.toPixF(resolution), xAxisSumSize.add(columnWidth).toPixF(resolution), yAxisSumSize.toPixF(resolution));
g2d.draw(tmpLine2D);
}
xAxisSumSize += columnWidth;
xAxisSumSize = xAxisSumSize.add(columnWidth);
}
if (xAxisSumSize > maxXAxisSumSize) {
if (xAxisSumSize.toPixF(resolution) > maxXAxisSumSize.toPixF(resolution)) {
maxXAxisSumSize = xAxisSumSize;
}
}
if (showPaginateLine && paperYAxisSumSize - paperPaintSize > THRESHOLD) {
paginateLineList.add(getPaginateLine2D((int) yAxisSumSize));
if (showPaginateLine && paperYAxisSumSize.toPixF(resolution) - paperPaintSize > THRESHOLD) {
paginateLineList.add(getPaginateLine2D((int) yAxisSumSize.toPixF(resolution)));
paperYAxisSumSize = rowHeight;
}
yAxisSumSize += rowHeight;
yAxisSumSize = yAxisSumSize.add(rowHeight);
}
// paint 最后一个横线..
if (showGridLine) {
if (showExtraGridLine) {
drawLastLine(g2d, (int) yAxisSumSize);
drawLastLine(g2d, (int) yAxisSumSize.toPixF(resolution));
} else {
GraphHelper.drawLine(g2d, 0, yAxisSumSize, maxXAxisSumSize, yAxisSumSize);
GraphHelper.drawLine(g2d, 0, yAxisSumSize.toPixF(resolution), maxXAxisSumSize.toPixF(resolution), yAxisSumSize.toPixF(resolution));
}
}
}
@ -432,10 +436,10 @@ public class GridUI extends ComponentUI {
private class DrawHorizontalLineHelper extends DrawLineHelper {
DrawHorizontalLineHelper(GridRange gridRange, boolean showGridLine, boolean discardExtraGridLine,
DrawHorizontalLineHelper(GridRange gridRange, boolean showGridLine, boolean showExtraGridLine,
boolean showPaginateLine, double paperPaintSize,
List paginateLineList, int resolution) {
super(gridRange, showGridLine, discardExtraGridLine, showPaginateLine,
super(gridRange, showGridLine, showExtraGridLine, showPaginateLine,
paperPaintSize, paginateLineList, resolution);
}
@ -451,46 +455,46 @@ public class GridUI extends ComponentUI {
@Override
protected void iterateStart2End(Graphics2D g2d) {
float columnWidth, paperXAxisSumSize = 0, maxYAxisSumSize = 0, xAxisSumSize = 0;
UNIT columnWidth, paperXAxisSumSize = FU.getInstance(0), maxYAxisSumSize = FU.getInstance(0), xAxisSumSize = FU.getInstance(0);
for (int i = 0; i <= gridRange.xEndIndex; i++) {
if (i == 0) {
i = gridRange.xBeginIndex;
for (int k = 0; k < gridRange.xBeginIndex; k++) {
columnWidth = gridRange.columnWidthList.get(k).toPixF(resolution);
paperXAxisSumSize += columnWidth;
if (paperXAxisSumSize >= paperPaintSize) {
columnWidth = gridRange.columnWidthList.get(k);
paperXAxisSumSize = paperXAxisSumSize.add(columnWidth);
if (paperXAxisSumSize.toPixF(resolution) >= paperPaintSize) {
paperXAxisSumSize = columnWidth;
}
}
}
columnWidth = gridRange.columnWidthList.get(i).toPixF(resolution);
paperXAxisSumSize += columnWidth;
columnWidth = gridRange.columnWidthList.get(i);
paperXAxisSumSize = paperXAxisSumSize.add(columnWidth);
if (showGridLine) {
float rowHeight, yAxisSumSize = 0;
UNIT rowHeight, yAxisSumSize = FU.getInstance(0);
for (int j = gridRange.yBeginIndex; j <= gridRange.yEndIndex; j++) {
rowHeight = gridRange.rowHeightList.get(j).toPixF(resolution);
rowHeight = gridRange.rowHeightList.get(j);
if (!mergeCellElementTable.get(CellPosition.value(j, i - 1)).contains(CellPosition.RIGHT)) {
tmpLine2D.setLine(xAxisSumSize, yAxisSumSize, xAxisSumSize, yAxisSumSize + rowHeight);
tmpLine2D.setLine(xAxisSumSize.toPixF(resolution), yAxisSumSize.toPixF(resolution), xAxisSumSize.toPixF(resolution), yAxisSumSize.add(rowHeight).toPixF(resolution));
g2d.draw(tmpLine2D);
}
yAxisSumSize += rowHeight;
yAxisSumSize = yAxisSumSize.add(rowHeight);
}
if (yAxisSumSize > maxYAxisSumSize) {
if (yAxisSumSize.toPixF(resolution) > maxYAxisSumSize.toPixF(resolution)) {
maxYAxisSumSize = yAxisSumSize;
}
}
if (showPaginateLine && paperXAxisSumSize - paperPaintSize > THRESHOLD) {
paginateLineList.add(getPaginateLine2D((int) xAxisSumSize));
if (showPaginateLine && paperXAxisSumSize.toPixF(resolution) - paperPaintSize > THRESHOLD) {
paginateLineList.add(getPaginateLine2D((int) xAxisSumSize.toPixF(resolution)));
paperXAxisSumSize = columnWidth;
}
xAxisSumSize += columnWidth;
xAxisSumSize = xAxisSumSize.add(columnWidth);
}
// paint 最后一个横线..
if (showGridLine) {
if (showExtraGridLine) {
drawLastLine(g2d, (int) xAxisSumSize);
drawLastLine(g2d, (int) xAxisSumSize.toPixD(resolution));
} else {
GraphHelper.drawLine(g2d, xAxisSumSize, 0, xAxisSumSize, maxYAxisSumSize);
GraphHelper.drawLine(g2d, xAxisSumSize.toPixF(resolution), 0, xAxisSumSize.toPixF(resolution), maxYAxisSumSize.toPixF(resolution));
}
}
}

Loading…
Cancel
Save