Browse Source

Merge branch 'bugfix/10.0' of https://code.fineres.com/scm/~lucian.chen/design into bugfix/10.0

bugfix/10.0
lucian 4 years ago
parent
commit
38b3c136ba
  1. 47
      designer-base/src/main/java/com/fr/design/DesignModelAdapter.java
  2. 1
      designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java
  3. 16
      designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java
  4. 2
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  5. 1
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  6. 12
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  7. 1
      designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java
  8. 30
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  9. 8
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  10. 15
      designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java
  11. 0
      designer-base/src/main/resources/com/fr/design/images/control/edit_disabled.svg
  12. 0
      designer-base/src/main/resources/com/fr/design/images/control/remove_disabled.svg
  13. 0
      designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg
  14. 64
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java
  15. 10
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  16. 4
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  17. 4
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js
  18. 10
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  19. 18
      designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java
  20. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  21. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  22. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  23. 23
      designer-realize/src/main/java/com/fr/design/style/BorderUtils.java

47
designer-base/src/main/java/com/fr/design/DesignModelAdapter.java

@ -21,6 +21,8 @@ import com.fr.stable.StringUtils;
import com.fr.stable.js.WidgetName;
import com.fr.util.ParameterApplyHelper;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@ -281,6 +283,12 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
TableData tableData,
Map<String, ParameterProvider> map,
Filter<ParameterProvider> filter) {
// 处理初始化添加
if (tableDataParametersMap.isEmpty()) {
addTableDataParameters(map, filter);
return;
}
ParameterProvider[] providers = null;
@ -303,13 +311,13 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
} else {
parameterProviders = entry.getValue();
}
updateParaMap(map, parameterProviders, filter);
}
if (filter != null) {
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter);
} else {
ParameterApplyHelper.addPara2Map(map, parameterProviders);
}
// 处理非初始化(已存在数据集参数)时 添加逻辑
if (!tableDataParametersMap.containsKey(tdName)) {
providers = DataOperator.getInstance().getTableDataParameters(tableData);
updateParaMap(map, providers, filter);
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
@ -321,6 +329,33 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
}
}
/**
* 更新全部参数中的数据集参数
*/
private void updateParaMap(Map<String, ParameterProvider> map, ParameterProvider[] parameterProviders, Filter<ParameterProvider> filter) {
if (filter != null) {
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter);
} else {
ParameterApplyHelper.addPara2Map(map, parameterProviders);
}
}
public void removeTableDataParameters(String tdName) {
ParameterProvider[] tableDataParameters = tableDataParametersMap.remove(tdName);
List<Parameter> allParameterList = new ArrayList<>(Arrays.asList(parameters));
List<Parameter> tableDataParameterList = new ArrayList<>();
for (ParameterProvider parameterProvider : tableDataParameters) {
tableDataParameterList.add((Parameter) parameterProvider);
}
allParameterList.removeAll(tableDataParameterList);
parameters = allParameterList.toArray(new Parameter[0]);
}
public void updateAllParameters() {
parameters = getLatestParameters();
}
protected void addGlobalParameters(Map<String, ParameterProvider> map) {
// 添加全局参数
Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters();

1
designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java

@ -60,6 +60,7 @@ public class TableDataSourceAction extends TemplateComponentAction<JTemplate<?,
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
TableDataSourceAction.this.getEditingComponent().fireTargetModified();
fireDSChanged(tableDataPane.getDsNameChangedMap());
DesignModelAdapter.getCurrentModelAdapter().updateAllParameters();
}
});
reportTableDataDialog.setVisible(true);

16
designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java

@ -13,12 +13,14 @@ import javax.swing.KeyStroke;
import java.awt.event.KeyEvent;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArraySet;
/**
* 插入单元格元素和插入悬浮元素的一些集合方法
@ -27,8 +29,8 @@ import java.util.concurrent.ConcurrentMap;
* @version 2017年11月17日14点39分
*/
public class ActionFactory {
private static LinkedHashSet<Class<?>> actionClasses = new LinkedHashSet<>();
private static LinkedHashSet<Class<?>> floatActionClasses = new LinkedHashSet<>();
private static Set<Class<?>> actionClasses = new CopyOnWriteArraySet<>();
private static Set<Class<?>> floatActionClasses = new CopyOnWriteArraySet<>();
private static Class chartCollectionClass = null;
/**
* 无需每次实例化的悬浮元素编辑器
@ -256,14 +258,14 @@ public class ActionFactory {
*/
public static void registerCellInsertActionClass(Class<?>[] cls) {
if (cls != null) {
Collections.addAll(actionClasses, cls);
actionClasses.addAll(Arrays.asList(cls));
}
}
public static void referCellInsertActionClass(Class<?>[] cls) {
if (cls != null) {
actionClasses.clear();
Collections.addAll(actionClasses, cls);
actionClasses.addAll(Arrays.asList(cls));
}
}
@ -321,14 +323,14 @@ public class ActionFactory {
*/
public static void registerFloatInsertActionClass(Class<?>[] cls) {
if (cls != null) {
Collections.addAll(floatActionClasses, cls);
floatActionClasses.addAll(Arrays.asList(cls));
}
}
public static void referFloatInsertActionClass(Class<?>[] cls) {
if (cls != null) {
floatActionClasses.clear();
Collections.addAll(floatActionClasses, cls);
floatActionClasses.addAll(Arrays.asList(cls));
}
}

2
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -86,6 +86,8 @@ public final class WebPreviewUtils {
if (!jt.saveAsTemplate()) {
return;
}
} else {
return;
}
currentTemplate = jt.getEditingFILE();
}

1
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -288,6 +288,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
fireDSChanged();
checkButtonEnabled();
DesignTableDataManager.removeSelectedColumnNames(selectedNO.getName());
DesignModelAdapter.getCurrentModelAdapter().removeTableDataParameters(selectedNO.getName());
}
}
}

12
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -99,6 +99,8 @@ public class JDBCDefPane extends JPanel {
private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor();
private IntegerEditor DBCP_MINEVICTABLEIDLETIMEMILLIS = new IntegerEditor();
private JDBCDatabaseConnection jdbcDatabase;
public JDBCDefPane() {
this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":"));
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
@ -202,6 +204,8 @@ public class JDBCDefPane extends JPanel {
if (jdbcDatabase == null) {
jdbcDatabase = new JDBCDatabaseConnection();
}
this.jdbcDatabase = jdbcDatabase;
this.dbtypeComboBox.removeActionListener(dbtypeActionListener);
if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver")
&& jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) {
this.dbtypeComboBox.setSelectedItem("Access");
@ -226,6 +230,7 @@ public class JDBCDefPane extends JPanel {
this.dbtypeComboBox.setSelectedItem(OTHER_DB);
}
}
this.dbtypeComboBox.addActionListener(dbtypeActionListener);
this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver());
this.urlTextField.setText(jdbcDatabase.getURL());
this.userNameTextField.setText(jdbcDatabase.getUser());
@ -235,6 +240,7 @@ public class JDBCDefPane extends JPanel {
if (dbcpAttr == null) {
dbcpAttr = new DBCPConnectionPoolAttr();
jdbcDatabase.setDbcpAttr(dbcpAttr);
this.jdbcDatabase.setDbcpAttr(dbcpAttr);
}
this.DBCP_INITIAL_SIZE.setValue(dbcpAttr.getInitialSize());
this.DBCP_MAX_ACTIVE.setValue(dbcpAttr.getMaxActive());
@ -251,7 +257,9 @@ public class JDBCDefPane extends JPanel {
}
public JDBCDatabaseConnection update() {
JDBCDatabaseConnection jdbcDatabase = new JDBCDatabaseConnection();
if (jdbcDatabase == null) {
jdbcDatabase = new JDBCDatabaseConnection();
}
Object driveItem = this.driverComboBox.getSelectedItem();
jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString());
jdbcDatabase.setURL(this.urlTextField.getText().trim());
@ -297,6 +305,8 @@ public class JDBCDefPane extends JPanel {
urlTextField.setText(dus[i].getURL());
}
}
// 更改数据库类型后 数据库名称置空和之前逻辑保持一致
jdbcDatabase.setDatabase(StringUtils.EMPTY);
}
};

1
designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java

@ -4,7 +4,6 @@ import com.fr.base.Utils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;

30
designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java

@ -217,18 +217,36 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
int lineStyle = currentLineCombo.getSelectedLineStyle();
Color lineColor = currentLineColorPane.getSelectObject();
CellBorderStyle cellBorderStyle = new CellBorderStyle();
cellBorderStyle.setTopColor(lineColor);
if (topToggleButton.isSelected()) {
cellBorderStyle.setTopColor(lineColor);
}
cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setBottomColor(lineColor);
if (bottomToggleButton.isSelected()) {
cellBorderStyle.setBottomColor(lineColor);
}
cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setLeftColor(lineColor);
if (leftToggleButton.isSelected()) {
cellBorderStyle.setLeftColor(lineColor);
}
cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setRightColor(lineColor);
if (rightToggleButton.isSelected()) {
cellBorderStyle.setRightColor(lineColor);
}
cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setVerticalColor(lineColor);
if (verticalToggleButton.isSelected()) {
cellBorderStyle.setVerticalColor(lineColor);
}
cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setHorizontalColor(lineColor);
if (horizontalToggleButton.isSelected()) {
cellBorderStyle.setHorizontalColor(lineColor);
}
cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()) {
outerToggleButton.setSelected(true);
} else {

8
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -598,7 +598,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
});
// 重名提示
warnLabel = new UILabel();
warnLabel.setPreferredSize(new Dimension(300, 30));
warnLabel.setPreferredSize(new Dimension(300, 50));
warnLabel.setHorizontalAlignment(SwingConstants.LEFT);
warnLabel.setVerticalAlignment(SwingConstants.TOP);
warnLabel.setForeground(Color.RED);
@ -641,7 +641,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
new Component[]{midPanel},
new Component[]{buttonsPane}
},
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.PREFERRED},
new double[]{TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED},
new double[]{TableLayout.FILL}
),
BorderLayout.CENTER);
@ -803,7 +803,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
});
// 重名提示
warnLabel = new UILabel();
warnLabel.setPreferredSize(new Dimension(300, 30));
warnLabel.setPreferredSize(new Dimension(300, 50));
warnLabel.setHorizontalAlignment(SwingConstants.LEFT);
warnLabel.setVerticalAlignment(SwingConstants.TOP);
warnLabel.setForeground(Color.RED);
@ -848,7 +848,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
new Component[]{midPanel},
new Component[]{bottomPanel}
},
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.PREFERRED},
new double[]{TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED},
new double[]{TableLayout.FILL}
),
BorderLayout.CENTER);

15
designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java

@ -4,12 +4,15 @@ import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.stable.Constants;
import com.fr.stable.os.OperatingSystem;
import java.awt.*;
import java.awt.geom.GeneralPath;
import java.awt.geom.RoundRectangle2D;
public class GUIPaintUtils {
private static boolean macos = OperatingSystem.isMacos();
public static final void drawBorder(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection) {
drawBorder(g2d, x, y, width, height, isRound, rectDirection, false);
}
@ -39,10 +42,14 @@ public class GUIPaintUtils {
g2d.drawLine(x, y, x, height - 1);
g2d.drawLine(x, height - 1, x + 3, height - 1);
} else {
double offsetX = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleX() - 1, 0.5d);
double offsetY = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleY() - 1, 0.5d);
Shape shape = new RoundRectangle2D.Double(x + offsetX, y + offsetY, width - 1d, height - 1d, UIConstants.ARC, UIConstants.ARC);
g2d.draw(shape);
if (macos) {
g2d.drawRoundRect(x, y, width - 1, height - 1, UIConstants.ARC, UIConstants.ARC);
} else {
double offsetX = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleX() - 1, 0.5d);
double offsetY = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleY() - 1, 0.5d);
Shape shape = new RoundRectangle2D.Double(x + offsetX, y + offsetY, width - 1d, height - 1d, UIConstants.ARC, UIConstants.ARC);
g2d.draw(shape);
}
}
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
} else {

0
designer-base/src/main/resources/com/fr/design/images/control/edit_disable.svg → designer-base/src/main/resources/com/fr/design/images/control/edit_disabled.svg

Before

Width:  |  Height:  |  Size: 864 B

After

Width:  |  Height:  |  Size: 864 B

0
designer-base/src/main/resources/com/fr/design/images/control/remove_disable.svg → designer-base/src/main/resources/com/fr/design/images/control/remove_disabled.svg

Before

Width:  |  Height:  |  Size: 804 B

After

Width:  |  Height:  |  Size: 804 B

0
designer-base/src/main/resources/com/fr/design/images/m_file/preview_disable.svg → designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

64
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

@ -10,7 +10,6 @@ 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.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.FontAutoType;
@ -50,7 +49,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
}
public GaugeStyle getGaugeStyle() {
return ((VanChartGaugePlot)this.getPlot()).getGaugeStyle();
return ((VanChartGaugePlot) this.getPlot()).getGaugeStyle();
}
public void setGaugeStyle(GaugeStyle gaugeStyle) {
@ -127,15 +126,13 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) {
if (hasLabelAlignPane()) {
return new Component[][]{
new Component[]{getDataLabelContentPane(), null},
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Vertical"), plot), null},
new Component[]{createLabelAlignPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Horizontal")), null},
new Component[]{createLabelPositionPane(getVerticalTitle(), plot), null},
new Component[]{createLabelAlignPane(), null},
new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot), null},
};
} else {
return new Component[][]{
new Component[]{getDataLabelContentPane(), null},
new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot), null},
@ -143,50 +140,37 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
}
}
private JPanel createLabelAlignPane(String title) {
JPanel panel = new JPanel(new BorderLayout());
alignPane = new JPanel();
checkAlignPane(title);
panel.add(alignPane, BorderLayout.CENTER);
return panel;
private JPanel createLabelAlignPane() {
alignPane = new JPanel(new BorderLayout());
checkAlignPane();
return alignPane;
}
protected void checkAlignPane(String title) {
if (alignPane == null && !hasLabelAlign(getPlot())) {
protected void checkAlignPane() {
if (!hasLabelAlignPane()) {
return;
}
if (alignPane != null && !hasLabelAlign(getPlot())) {
oldAlignValues = null;
if (!hasLabelAlign()) {
alignPane.removeAll();
return;
}
if (alignPane == null && hasLabelAlign(getPlot())) {
alignPane = new JPanel();
if (alignPane.getComponents().length > 0) {
return;
}
TwoTuple<String[], Integer[]> result = getAlignNamesAndValues();
String[] names = result.getFirst();
Integer[] values = result.getSecond();
if (ComparatorUtils.equals(values, oldAlignValues)) {
return;
}
oldAlignValues = values;
align = new UIButtonGroup<Integer>(names, values);
align = new UIButtonGroup<>(names, values);
Component[][] comps = new Component[2][2];
comps[0] = new Component[]{null, null};
comps[1] = new Component[]{new UILabel(title, SwingConstants.LEFT), align};
comps[1] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Horizontal"), SwingConstants.LEFT), align};
double[] row = new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED};
double[] col = new double[]{TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
alignPane.removeAll();
alignPane.setLayout(new BorderLayout());
alignPane.add(getLabelPositionPane(comps, row, col), BorderLayout.CENTER);
if (getParentPane() != null) {
@ -214,12 +198,16 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
}
protected void checkPane() {
String verticalTitle = hasLabelAlign(getPlot())
? Toolkit.i18nText("Fine-Design_Chart_Layout_Vertical")
: Toolkit.i18nText("Fine-Design_Chart_Layout_Position");
String verticalTitle = getVerticalTitle();
checkPositionPane(verticalTitle);
checkAlignPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Horizontal"));
checkAlignPane();
}
private String getVerticalTitle() {
return hasLabelAlign()
? Toolkit.i18nText("Fine-Design_Chart_Layout_Vertical")
: Toolkit.i18nText("Fine-Design_Chart_Layout_Position");
}
protected void checkStyleUse() {
@ -227,8 +215,8 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
textFontPane.setPreferredSize(new Dimension(0, TEXT_FONT_PANE_HEIGHT));
}
protected boolean hasLabelAlign(Plot plot) {
return getGaugeStyle() == GaugeStyle.THERMOMETER && !((VanChartGaugePlot) plot).getGaugeDetailStyle().isHorizontalLayout();
protected boolean hasLabelAlign() {
return getGaugeStyle() == GaugeStyle.THERMOMETER && !((VanChartGaugePlot) getPlot()).getGaugeDetailStyle().isHorizontalLayout();
}
protected boolean hasLabelAlignPane() {
@ -240,7 +228,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
style.setSelectedIndex(1);
textFontPane.populate(detail.getTextAttr());
if (hasLabelAlign(this.getPlot()) && align != null) {
if (hasLabelAlign() && align != null) {
align.setSelectedItem(detail.getAlign());
}

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

@ -79,6 +79,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
private JPanel createGISLayerPane() {
gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")});
gisButton.setSelectedIndex(0);
gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems());
gisButton.addActionListener(event -> {
refreshZoomLevel();
@ -221,12 +222,9 @@ public class GisLayerPane extends JPanel implements UIObserver {
/* mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO);
mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));*/
GaoDeGisType gaoDeGisType= mapPlot.getDefaultGisLayerType();
mapPlot.getGisLayer().setGisLayerType(GISLayerType.GAO_DE_API);
mapPlot.getGisLayer().setLayerName(gaoDeGisType.getTypeName());
mapPlot.getGisLayer().setGaoDeGisType(gaoDeGisType);
populate(mapPlot.getGisLayer());
GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer();
mapPlot.setGisLayer(defaultGisLayer);
populate(defaultGisLayer);
}
public void populate(GisLayer layer) {

4
designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

@ -74,10 +74,10 @@
}],
layouts: [{
type: "bi.left",
rgap: 5
rgap: 2
}],
value: this.model.mode,
width: 125
width: 170
}, this._getToolBar()],
height: 24
}, {

4
designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js

@ -18,7 +18,7 @@
return [{
type: "bi.single_select_radio_item",
text: BI.i18nText("BI-Basic_Auto"),
width: 50,
width: 70,
logic: {
dynamic: true
},
@ -27,7 +27,7 @@
}, {
type: "bi.single_select_radio_item",
text: BI.i18nText("BI-Basic_Custom"),
width: 60,
width: 80,
logic: {
dynamic: true
},

10
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -347,15 +347,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
//拖拽组件原大小、位置
Rectangle backupBound = creator.getBackupBound();
backupBound.x -= container.getX();
// REPORT-34739 对绝对画布块的backupBound.y的调整还需要考虑一下参数面板块的高度造成的偏移
int paraHeight = 0;
if (creator.acceptType(XWAbsoluteLayout.class)) {
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate instanceof JForm) {
paraHeight = ((JForm) jTemplate).getFormDesign().getParaHeight();
}
}
backupBound.y -= (container.getY() - paraHeight);
backupBound.y -= container.getY();
//当前拖拽组件的位置
int x = creator.getX();
int y = creator.getY();

18
designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java

@ -12,6 +12,7 @@ import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.Widget;
@ -270,7 +271,9 @@ public class FormSelection {
LayoutAdapter layoutAdapter = AdapterBus.searchLayoutAdapter(designer, creator);
if (layoutAdapter != null) {
if (creator.acceptType(XWAbsoluteLayout.class) && recs.size() > i) {
creator.setBackupBound(recs.get(i));
Rectangle rectangle = recs.get(i);
check4ParaPane(rectangle);
creator.setBackupBound(rectangle);
} else {
creator.setBackupBound(backupBounds);
}
@ -280,6 +283,19 @@ public class FormSelection {
}
}
/**
* 检查下有没有参数面板如果存在处理下参数面板造成的偏移量
* @param rectangle
*/
private void check4ParaPane(Rectangle rectangle) {
int paraHeight = 0;
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate instanceof JForm) {
paraHeight = ((JForm) jTemplate).getFormDesign().getParaHeight();
}
rectangle.y += paraHeight;
}
private void removeCreatorFromContainer(XCreator creator) {
XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(creator);
if (parent == null) {

5
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe.cell.settingpane;
import com.fr.base.Style;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.cell.settingpane.style.StylePane;
import com.fr.design.style.BorderUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.DefaultTemplateCellElement;
@ -67,6 +68,7 @@ public class CellStylePane extends AbstractCellAttrPane {
@Override
public void updateBeans() {
Object[] selectionCellBorderObjects = BorderUtils.createCellBorderObject(elementCasePane);
if (stylePane.getSelectedIndex() == 1) {
Style s = stylePane.updateBean();
TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
@ -110,7 +112,8 @@ public class CellStylePane extends AbstractCellAttrPane {
}
}
}
stylePane.updateBorder();// border必须特别处理
// border必须特别处理
stylePane.updateBorder(selectionCellBorderObjects);
}
}

4
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java

@ -136,8 +136,8 @@ public class CustomStylePane extends MultiTabPane<Style> {
/**
*
*/
public void updateBorder() {
BorderUtils.update(reportPane, ((BorderPane) paneList.get(ONE_INDEX)).update());
public void updateBorder(Object[] selectionCellBorderObjects) {
BorderUtils.update(reportPane, selectionCellBorderObjects, ((BorderPane) paneList.get(ONE_INDEX)).update());
}
/**

5
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java

@ -38,10 +38,9 @@ public class StylePane extends UIComboBoxPane<Style> {
customStylePane.addTabChangeListener(changeListener);
}
public void updateBorder() {
public void updateBorder(Object[] selectionCellBorderObjects) {
if (getSelectedIndex() == 0 && customStylePane.isBorderPaneSelected()) {
customStylePane.updateBorder();
customStylePane.updateBorder(selectionCellBorderObjects);
}
}

23
designer-realize/src/main/java/com/fr/design/style/BorderUtils.java

@ -464,8 +464,13 @@ public abstract class BorderUtils {
* changed, need to support undo/redo
*/
public static boolean update(ElementCasePane reportPane, CellBorderStyle newCellBorderStyle) {
Object[] selectionCellBorderObjects = createCellBorderObject(reportPane);
return update(reportPane, selectionCellBorderObjects, newCellBorderStyle);
}
public static boolean update(ElementCasePane reportPane, Object[] selectionCellBorderObjects, CellBorderStyle newCellBorderStyle) {
boolean isBorderColorStyleChanged = false;
Object[] fourObjectArray = createCellBorderObject(reportPane);
Object[] fourObjectArray = selectionCellBorderObjects;
if (fourObjectArray == null || fourObjectArray.length < NUMBER) {
return false;
}
@ -526,44 +531,60 @@ public abstract class BorderUtils {
if (cellBorderStyle.getLeftStyle() != newCellBorderStyle.getLeftStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getLeftColor(), newCellBorderStyle.getLeftColor())) {
style = style.deriveBorderLeft(newCellBorderStyle.getLeftStyle(), newCellBorderStyle.getLeftColor());
} else {
style = style.deriveBorderLeft(cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor());
}
} else {
if (cellBorderStyle.getVerticalStyle() != newCellBorderStyle.getVerticalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getVerticalColor(), newCellBorderStyle.getVerticalColor())) {
style = style.deriveBorderLeft(newCellBorderStyle.getVerticalStyle(), newCellBorderStyle.getVerticalColor());
} else {
style = style.deriveBorderLeft(cellBorderStyle.getVerticalStyle(), cellBorderStyle.getVerticalColor());
}
}
if (tmpCellElement.getColumn() + tmpCellElement.getColumnSpan() == column + columnSpan) {
if (cellBorderStyle.getRightStyle() != newCellBorderStyle.getRightStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getRightColor(), newCellBorderStyle.getRightColor())) {
style = style.deriveBorderRight(newCellBorderStyle.getRightStyle(), newCellBorderStyle.getRightColor());
} else {
style = style.deriveBorderRight(cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor());
}
} else {
if (cellBorderStyle.getVerticalStyle() != newCellBorderStyle.getVerticalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getVerticalColor(), newCellBorderStyle.getVerticalColor())) {
style = style.deriveBorderRight(newCellBorderStyle.getVerticalStyle(), newCellBorderStyle.getVerticalColor());
} else {
style = style.deriveBorderRight(cellBorderStyle.getVerticalStyle(), cellBorderStyle.getVerticalColor());
}
}
if (tmpCellElement.getRow() == row) {
if (cellBorderStyle.getTopStyle() != newCellBorderStyle.getTopStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getTopColor(), newCellBorderStyle.getTopColor())) {
style = style.deriveBorderTop(newCellBorderStyle.getTopStyle(), newCellBorderStyle.getTopColor());
} else {
style = style.deriveBorderTop(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor());
}
} else {
if (cellBorderStyle.getHorizontalStyle() != newCellBorderStyle.getHorizontalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getHorizontalColor(), newCellBorderStyle.getHorizontalColor())) {
style = style.deriveBorderTop(newCellBorderStyle.getHorizontalStyle(), newCellBorderStyle.getHorizontalColor());
} else {
style = style.deriveBorderTop(cellBorderStyle.getHorizontalStyle(), cellBorderStyle.getHorizontalColor());
}
}
if (tmpCellElement.getRow() + tmpCellElement.getRowSpan() == row + rowSpan) {
if (cellBorderStyle.getBottomStyle() != newCellBorderStyle.getBottomStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getBottomColor(), newCellBorderStyle.getBottomColor())) {
style = style.deriveBorderBottom(newCellBorderStyle.getBottomStyle(), newCellBorderStyle.getBottomColor());
} else {
style = style.deriveBorderBottom(cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor());
}
} else {
if (cellBorderStyle.getHorizontalStyle() != newCellBorderStyle.getHorizontalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getHorizontalColor(), newCellBorderStyle.getHorizontalColor())) {
style = style.deriveBorderBottom(newCellBorderStyle.getHorizontalStyle(), newCellBorderStyle.getHorizontalColor());
} else {
style = style.deriveBorderBottom(cellBorderStyle.getHorizontalStyle(), cellBorderStyle.getHorizontalColor());
}
}
return style;

Loading…
Cancel
Save