Browse Source

Merge branch 'release/11.0' of https://code.fineres.com/scm/~john.ying/design into release/11.0

newui
John.Ying 2 years ago
parent
commit
32a6d93539
  1. 3
      designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java
  2. 13
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  3. 11
      designer-base/src/main/java/com/fr/design/extra/PluginUtils.java
  4. 5
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  5. 10
      designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java
  6. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java
  7. 1
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  8. 67
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java

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

@ -1,6 +1,7 @@
package com.fr.design.carton;
import com.fr.concurrent.FineExecutors;
import com.fr.design.ui.util.UIUtil;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
@ -314,7 +315,7 @@ public final class EventDispatchThreadHangMonitor extends EventQueue {
* 将swing中默认的EventQueue换成自己的
*/
public static void initMonitoring() {
Toolkit.getDefaultToolkit().getSystemEventQueue().push(INSTANCE);
UIUtil.invokeLaterIfNeeded(() -> Toolkit.getDefaultToolkit().getSystemEventQueue().push(INSTANCE));
}
/**

13
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -209,7 +209,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
* @return
*/
private boolean needUpdate0(Connection origin, Connection connection) {
return !connection.equals(origin) || !isEmbedConnection(connection);
return !connection.equals(origin) || !isEmbedConnection(connection);
}
/**
@ -257,12 +257,21 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
}
private boolean saveByOldWay(List<String> removedConnNames, List<ConnectionBean> addedOrUpdatedConnections) {
final int remaining = ConnectionConfig.getInstance().getRemainingCon(removedConnNames.size(), addedOrUpdatedConnections.size());
try {
return Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override
public void run() {
removedConnNames.forEach(n -> ConnectionConfig.getInstance().removeConnection(n));
addedOrUpdatedConnections.forEach(cb -> ConnectionConfig.getInstance().addConnection(cb.getName(), cb.getConnection()));
int innerRemaining = remaining;
for (ConnectionBean cb : addedOrUpdatedConnections) {
if (innerRemaining > 0) {
ConnectionConfig.getInstance().addConnectionWithoutCheck(cb.getName(), cb.getConnection());
innerRemaining--;
} else {
break;
}
}
}
});
} catch (Exception e) {

11
designer-base/src/main/java/com/fr/design/extra/PluginUtils.java

@ -10,8 +10,8 @@ import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.PluginVerifyException;
import com.fr.plugin.basic.version.Version;
import com.fr.plugin.basic.version.VersionIntervalType;
import com.fr.plugin.basic.version.VersionIntervalFactory;
import com.fr.plugin.basic.version.VersionIntervalType;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.error.PluginBaseErrorCode;
@ -23,7 +23,7 @@ import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.JOptionPane;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@ -47,9 +47,10 @@ public class PluginUtils {
public static PluginMarker createPluginMarker(String pluginInfo) {
//todo 判空
String[] plugin = pluginInfo.split("_");
return PluginMarker.create(plugin[0], plugin[1]);
int splitIndex = pluginInfo.lastIndexOf("_");
String pluginID = pluginInfo.substring(0, splitIndex);
String version = pluginInfo.substring(splitIndex + 1);
return PluginMarker.create(pluginID, version);
}
public static JSONObject getLatestPluginInfo(String pluginID) throws Exception {

5
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -156,6 +156,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private DefaultCompletionProvider completionProvider;
private static final Map<String, String> PARAM_PREFIX_MAP = new HashMap<>();
public static final int DESCRIPTION_TEXT_AREA_ROW = 16, DESCRIPTION_TEXT_AREA_COLUMN = 27;
public FormulaPane() {
initComponents();
}
@ -1194,8 +1196,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private void initDescriptionTextArea() {
// Description
descriptionTextArea = new UITextArea();
descriptionTextArea = new UITextArea(DESCRIPTION_TEXT_AREA_ROW,DESCRIPTION_TEXT_AREA_COLUMN);
descriptionTextArea.setBackground(Color.white);
descriptionTextArea.setLineWrap(true);
descriptionTextArea.setWrapStyleWord(true);

10
designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java

@ -204,4 +204,14 @@ public class JNullTemplate extends JTemplate {
public int getToolBarHeight() {
return 0;
}
@Override
public String getPath() {
return null;
}
@Override
public void refreshToolArea() {
DesignerContext.getDesignerFrame().resetToolkitByPlus(this);
}
}

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java

@ -161,7 +161,9 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
public void clearAllBoxList(){
field.clear();
seriesDataPane.getTable().clear();
seriesDataPane.getTable().updateUI();
seriesDataPane.validate();
seriesDataPane.repaint();
seriesDataPane.revalidate();
}
private void fireStop() {

1
designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java

@ -51,7 +51,6 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
public XElementCase(ElementCaseEditor widget, Dimension initSize) {
super(widget, initSize);
widget.getElementCaseImage().adjustImageSize(initSize.width, initSize.height, false);
}
protected void initXCreatorProperties() {

67
designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java

@ -3,6 +3,8 @@
*/
package com.fr.design.mainframe.form;
import com.fr.base.DynamicUnitList;
import com.fr.base.GraphHelper;
import com.fr.base.TRL;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
@ -33,11 +35,14 @@ import com.fr.form.FormElementCaseProvider;
import com.fr.form.fit.common.LightTool;
import com.fr.form.main.Form;
import com.fr.grid.Grid;
import com.fr.grid.GridUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.report.ReportHelper;
import com.fr.report.cell.CellElement;
import com.fr.report.elementcase.ElementCase;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.FormElementCase;
import com.fr.report.worksheet.WorkSheet;
@ -132,16 +137,23 @@ public class FormElementCaseDesigner
}
/**
* 获取当前ElementCase的缩略图
* 获取当前ElementCase的缩略图 缩略图中包含所有有内容的单元格
*
* @param size 缩略图的大小
*/
@Override
public BufferedImage getElementCaseImage(Dimension size) {
Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null;
if (grid == null) {
return new BufferedImage(0, 0, BufferedImage.TYPE_INT_RGB);
}
resetGrid(grid);
BufferedImage image = null;
try {
int width = size.width;
int height = size.height;
int width = Math.max(grid.getWidth(), size.width);
int height = Math.max(grid.getHeight(), size.width);
// 使用TYPE_INT_RGB和new Color(255, 255, 255, 1)设置有透明背景buffer image,
// 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0)
@ -157,20 +169,16 @@ public class FormElementCaseDesigner
// 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0)
// 这样不支持透明通道缩略图的旧设计器打开新设计器创建的模版时,就不会创建出拥有黑色背景的缩略图
g2d.setColor(new Color(255, 255, 255, 1));
g2d.fillRect(0, 0, (int) size.getWidth(), (int) size.getHeight());
Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null;
if (grid != null) {
resetGrid(grid);
boolean oldTranslucent = grid.isTranslucent();
boolean oldShowExtraGridLine = grid.isShowExtraGridLine();
// 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景
grid.setTranslucent(true);
grid.setShowExtraGridLine(false);
grid.paint(g2d);
grid.setTranslucent(oldTranslucent);
grid.setShowExtraGridLine(oldShowExtraGridLine);
}
g2d.fillRect(0, 0, width, height);
boolean oldTranslucent = grid.isTranslucent();
boolean oldShowExtraGridLine = grid.isShowExtraGridLine();
// 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景
grid.setTranslucent(true);
grid.setShowExtraGridLine(false);
grid.paint(g2d);
grid.setTranslucent(oldTranslucent);
grid.setShowExtraGridLine(oldShowExtraGridLine);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
@ -180,12 +188,33 @@ public class FormElementCaseDesigner
}
private void resetGrid(Grid grid) {
grid.setResolution(Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION);
grid.updateUI();
grid.setAdsorbHeight(0);
grid.setAdsorbWidth(0);
grid.setVerticalValue(0);
grid.setHorizontalValue(0);
FormElementCasePaneDelegate reportPane = getEditingElementCasePane();
ColumnRow lastColumnRow = GridUtils.getAdjustLastColumnRowOfReportPane(reportPane);
int lastColumn = lastColumnRow.getColumn();
int lastRow = lastColumnRow.getRow();
grid.setVerticalExtent(lastRow);
grid.setHorizontalExtent(lastColumn);
ElementCase report = reportPane.getEditingElementCase();
DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report);
DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report);
int resolution = grid.getResolution();
int width = columnWidthList.getRangeValueFromZero(lastColumn).toPixI(resolution);
int height = rowHeightList.getRangeValueFromZero(lastRow).toPixI(resolution);
int gridLineWidth = GraphHelper.getLineStyleSize(Constants.LINE_THIN);
grid.setSize(width + gridLineWidth, height + gridLineWidth);
grid.updateUI();
}
/**

Loading…
Cancel
Save