Browse Source

Merge pull request #2559 in DESIGN/design from feature/10.0 to research/10.0

* commit 'c8eca91e1f1a6b5b5e5e6602aaa3f7f72d0a0d44':
  代码修改
  代码修改
  删除多余的赋值
  CHART-16009 标签纵向时无边框
  CHART-15965 无边框设置界面时,border宽度设置为0
  CHART-15990 富文本自动自定义切换时不改变content
  CHART-16031 完善仪表盘富文本参数
  CHART-16036 完善多层饼图富文本参数
  CHART-15946 标签边框颜色支持自动
  CHART-15999 完善地图富文本参数解析
  CHART-16038 完善框架图提示的富文本参数
  CHART-16058 完善漏斗图提示的富文本参数
  REPORT-40001 【预定义样式】应该是我们修改某个样式,就显示在样式最前
  CHART-15944 标签形状选择后三种时,圆角灰化
  CHART-15942 标签边框线形选择为无时,其余面板隐藏
  REPORT-35149 预定义样式优化及与图表统一
  REPORT-40216 修改
  REPORT-40216 用双击选中的下标
  REPORT-40216 数据集-数据库数据集-复制数据集并修改名称后,单元格中的原数据集会被自动修改
research/10.0
superman 4 years ago
parent
commit
9cd98f54d0
  1. 5
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  2. 46
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java
  4. 30
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java
  5. 70
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleListControlPane.java
  6. 17
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/cell/CustomPredefinedStylePane.java
  7. 5
      designer-base/src/main/java/com/fr/design/object/NameObject.java
  8. 24
      designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java
  9. 198
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java
  10. 22
      designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/TooltipContentPaneWithOutSeries.java
  11. 29
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  12. 21
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java
  13. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java
  14. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java
  15. 2
      designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java
  16. 1
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java
  17. 1
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java
  18. 22
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java
  19. 2
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  20. 4
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  21. 6
      designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java
  22. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java
  23. 4
      designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java
  24. 8
      designer-realize/src/main/java/com/fr/grid/Grid.java

5
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -97,7 +97,7 @@ public abstract class DesignTableDataManager {
*/
private static void fireDsChanged() {
fireDsChanged(globalDsListeners);
for (Iterator<Entry<String, List<ChangeListener>>> entryIterator = dsListenersMap.entrySet().iterator(); entryIterator.hasNext();) {
for (Iterator<Entry<String, List<ChangeListener>>> entryIterator = dsListenersMap.entrySet().iterator(); entryIterator.hasNext(); ) {
List<ChangeListener> dsListeners = entryIterator.next().getValue();
fireDsChanged(dsListeners);
}
@ -190,6 +190,7 @@ public abstract class DesignTableDataManager {
}
dsListeners.add(l);
}
/**
* 获取数据源source中dsName的所有字段
*
@ -280,7 +281,7 @@ public abstract class DesignTableDataManager {
Entry<String, TableDataWrapper> entry = entryIt.next();
list.add(entry.getKey());
}
return list.toArray(new String[list.size()]);
return list.toArray(new String[0]);
}
/**

46
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -7,6 +7,7 @@ import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.data.BasicTableDataUtils;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.NameInspector;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilist.ListModelElement;
@ -34,7 +35,7 @@ import java.util.Map;
*/
public class TableDataPaneListPane extends JListControlPane implements TableDataPaneController {
private boolean isNamePermitted = true;
private Map<String, String> dsNameChangedMap = new HashMap<String, String>();
private Map<String, String> dsNameChangedMap = new HashMap<>();
public TableDataPaneListPane() {
super();
@ -43,11 +44,16 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
@Override
public void propertyChange() {
isNamePermitted = true;
String tempName = getEditingName();
if (ComparatorUtils.equals(tempName, selectedName)) {
//说明双击之后又取消了,啥也不用做
return;
}
TableDataSource source = DesignTableDataManager.getEditingTableDataSource();
String[] allDSNames = DesignTableDataManager.getAllDSNames(source);
String[] allListNames = nameableList.getAllNames();
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY;
String tempName = getEditingName();
allListNames[editingIndex] = StringUtils.EMPTY;
Object editingType = getEditingType();
if (!BasicTableDataUtils.checkName(tempName)) {
@ -61,15 +67,14 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
isNamePermitted = false;
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this),
Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"),
Toolkit.i18nText("Fine-Design_Report_Alert"),
JOptionPane.WARNING_MESSAGE);
Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"),
Toolkit.i18nText("Fine-Design_Report_Alert"),
JOptionPane.WARNING_MESSAGE);
setIllegalIndex(editingIndex);
return;
}
if (!ComparatorUtils.equals(tempName, selectedName)
&& isNameRepeated(new List[]{Arrays.asList(allDSNames), Arrays.asList(allListNames)}, tempName)) {
boolean isRepeated = isNameRepeated(new List[]{Arrays.asList(allDSNames), Arrays.asList(allListNames)}, tempName);
if (isRepeated) {
isNamePermitted = false;
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", tempName));
@ -81,11 +86,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
setIllegalIndex(editingIndex);
}
if (nameableList.getSelectedValue() instanceof ListModelElement) {
Nameable selected = ((ListModelElement) nameableList.getSelectedValue()).wrapper;
if (!ComparatorUtils.equals(tempName, selected.getName()) && !isNameRepeated(new List[]{Arrays.asList(allDSNames), Arrays.asList(allListNames)}, tempName)) {
rename(selected.getName(), tempName);
}
rename(selectedName, isRepeated ? NameInspector.ILLEGAL_NAME_HOLDER : tempName);
}
}
});
@ -93,6 +94,13 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
@Override
public void rename(String oldName, String newName) {
//如果a改成了b,b又被改成了c,就认为是a改成了c
for (Map.Entry<String, String> entry : dsNameChangedMap.entrySet()) {
if (StringUtils.equals(oldName, entry.getValue())) {
oldName = entry.getKey();
}
}
dsNameChangedMap.put(oldName, newName);
}
@ -148,7 +156,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
String[] allDsNames = DesignTableDataManager.getAllDSNames(source);
// richer:生成的名字从1开始. kunsnat: 添加属性从0开始.
int count = 1;
int count = 1;
while (isDsNameRepeated(prefix + count, allDsNames)) {
count++;
}
@ -192,7 +200,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
}
}
populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
populate(nameObjectList.toArray(new NameObject[0]));
}
/**
@ -209,10 +217,10 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
}
while (procedurenameIt.hasNext()) {
String name = procedurenameIt.next();
nameObjectList.add(new NameObject(name, ProcedureConfig.getInstance().getProcedure(name)));
nameObjectList.add(new NameObject(name, ProcedureConfig.getInstance().getProcedure(name)));
}
populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
populate(nameObjectList.toArray(new NameObject[0]));
}
@Override
@ -220,7 +228,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
tableDataConfig.removeAllTableData();
ProcedureConfig.getInstance().removeAllProcedure();
Nameable[] tableDataArray = this.update();
Map<String,TableData> tableDataMap = new LinkedHashMap<String,TableData>();
Map<String, TableData> tableDataMap = new LinkedHashMap<String, TableData>();
for (int i = 0; i < tableDataArray.length; i++) {
NameObject nameObject = (NameObject) tableDataArray[i];
tableDataMap.put(nameObject.getName(), (TableData) nameObject.getObject());

2
designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java

@ -65,7 +65,7 @@ class ListControlPaneHelper {
res.add(((ListModelElement) listModel.getElementAt(i)).wrapper);
}
return res.toArray(new Nameable[res.size()]);
return res.toArray(new Nameable[0]);
}
/**

30
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java

@ -28,6 +28,9 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Created by kerry on 2020-08-26
@ -245,7 +248,8 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
return false;
}
config.add(previewObject);
ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config);
PredefinedStyleConfig sortedConfig = resortConfigStyles(previewObject, config);
ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(sortedConfig);
selectPane.refreshPane();
return true;
}
@ -275,4 +279,28 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
return true;
}
private PredefinedStyleConfig resortConfigStyles(PredefinedStyle priorityStyle, PredefinedStyleConfig config){
PredefinedStyleConfig sortedConfig = new PredefinedStyleConfig();
PredefinedStyle defaultStyle = config.getDefaultPredefinedStyle();
if (defaultStyle != null) {
sortedConfig.add(defaultStyle);
config.removeStyle(defaultStyle.getStyleName());
sortedConfig.setDefaultPredefinedStyle(defaultStyle.getStyleName());
}
if (priorityStyle != null && !priorityStyle.isDefaultStyle()) {
sortedConfig.add(priorityStyle);
config.removeStyle(priorityStyle.getStyleName());
}
Iterator<PredefinedStyle> iterator = config.getPredefinedStyleIterator();
while (iterator.hasNext()) {
PredefinedStyle entry = iterator.next();
sortedConfig.add(entry);
}
sortedConfig.setCompatibleStyleName(config.getCompatibleStyleName());
return sortedConfig;
}
}

70
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleListControlPane.java

@ -6,6 +6,7 @@ import com.fr.config.predefined.PredefinedCellStyle;
import com.fr.config.predefined.PredefinedCellStyleConfig;
import com.fr.design.actions.UpdateAction;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.NameInspector;
import com.fr.design.gui.controlpane.JListControlPane;
@ -15,6 +16,8 @@ import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.gui.style.AlignmentPane;
import com.fr.design.gui.style.FormatPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.predefined.ui.detail.cell.CustomPredefinedStylePane;
@ -83,8 +86,16 @@ public class CellStyleListControlPane extends JListControlPane {
@Override
public NameableCreator[] createNameableCreators() {
return new NameableCreator[]{new CellStyleNameObjectCreator(Toolkit.i18nText("Fine-Design_Predefined_Cell_New_Style"),
PredefinedCellStyle.class, CustomPredefinedStylePane.class)};
return new NameableCreator[]{
new CellStyleNameObjectCreator(Toolkit.i18nText("Fine-Design_Predefined_Cell_New_Style"),
PredefinedCellStyle.class, CustomPredefinedStylePaneNoBorder.class) {
@Override
public boolean acceptDefaultNameObject(Object ob) {
return ((PredefinedCellStyle) ob).isDefaultStyle();
}
},
new CellStyleNameObjectCreator(Toolkit.i18nText("Fine-Design_Predefined_Cell_New_Style"),
PredefinedCellStyle.class, CustomPredefinedStylePane.class)};
}
@Override
@ -113,13 +124,45 @@ public class CellStyleListControlPane extends JListControlPane {
protected ShortCut4JControlPane[] createShortcuts() {
return new ShortCut4JControlPane[]{
shortCutFactory.addItemShortCut(),
createAddItemShortCut4JControlPane(),
new RemoveItemShortCut4JControlPane(new RemoveItemAction())
};
}
public class RemoveItemShortCut4JControlPane extends ShortCut4JControlPane {
private static class CustomPredefinedStylePaneNoBorder extends CustomPredefinedStylePane {
@Override
protected List<BasicPane> initPaneList() {
paneList = new ArrayList<BasicPane>();
paneList.add(new FormatPane());
paneList.add(new AlignmentPane());
return paneList;
}
}
private ShortCut4JControlPane createAddItemShortCut4JControlPane (){
ShortCut shortCut = shortCutFactory.createAddItemUpdateAction(new NameableCreator[]{
new CellStyleNameObjectCreator(Toolkit.i18nText("Fine-Design_Predefined_Cell_New_Style"),
PredefinedCellStyle.class, CustomPredefinedStylePane.class)});
return new AddItemShortCut4JControlPane(shortCut);
}
private class AddItemShortCut4JControlPane extends ShortCut4JControlPane{
AddItemShortCut4JControlPane(ShortCut shortCut) {
this.shortCut = shortCut;
}
@Override
public void checkEnable() {
this.shortCut.setEnabled(true);
}
}
private class RemoveItemShortCut4JControlPane extends ShortCut4JControlPane {
RemoveItemShortCut4JControlPane(ShortCut shortCut) {
this.shortCut = shortCut;
}
@ -180,6 +223,25 @@ public class CellStyleListControlPane extends JListControlPane {
}
return null;
}
/**
*
* @param ob
* @return
*/
public Object acceptObject2Populate(Object ob) {
if (ob instanceof NameObject) {
ob = ((NameObject) ob).getObject();
}
if (clazzOfObject != null && clazzOfObject.isInstance(ob) && acceptDefaultNameObject(ob)) {
doSthChanged4Icon(ob);
return ob;
}
return null;
}
public boolean acceptDefaultNameObject(Object ob) {
return !((PredefinedCellStyle) ob).isDefaultStyle();
}
}

17
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/cell/CustomPredefinedStylePane.java

@ -49,14 +49,6 @@ public class CustomPredefinedStylePane extends MultiTabPane<PredefinedCellStyle>
tabPane.setLayout(new GridLayout(1, 3, 0, 0));
}
public static CustomPredefinedStylePane createPredefinedStylePane() {
return new CustomPredefinedStylePane();
}
public static CustomPredefinedStylePane createDefaultPredefinedStylePane() {
return new CustomPredefinedStylePaneNoBorder();
}
/**
* @return
*/
@ -172,16 +164,7 @@ public class CustomPredefinedStylePane extends MultiTabPane<PredefinedCellStyle>
}
private static class CustomPredefinedStylePaneNoBorder extends CustomPredefinedStylePane {
@Override
protected List<BasicPane> initPaneList() {
paneList = new ArrayList<BasicPane>();
paneList.add(new FormatPane());
paneList.add(new AlignmentPane());
return paneList;
}
}
/**
* 预览Style的面板

5
designer-base/src/main/java/com/fr/design/object/NameObject.java

@ -2,6 +2,7 @@ package com.fr.design.object;
import com.fr.base.BaseUtils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StableUtils;
/**
*
@ -60,10 +61,10 @@ public class NameObject<T> {
return "Name:" + this.getName() + "\tObject:" + this.getObject();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SuppressWarnings({ "rawtypes"})
public Object clone() throws CloneNotSupportedException {
NameObject newNameObject = (NameObject)super.clone();
newNameObject.object = BaseUtils.cloneObject(this.object);
newNameObject.object = StableUtils.cloneObject(this.object);
return newNameObject;
}

24
designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java

@ -0,0 +1,24 @@
package com.fr.design.data.datapane;
import org.junit.Test;
import java.util.Map;
import static org.junit.Assert.*;
/**
* @author Yyming
* @version 10.0
* Created by Yyming on 2020/9/29
*/
public class TableDataPaneListPaneTest {
@Test
public void rename() {
TableDataPaneListPane listPane = new TableDataPaneListPane();
listPane.rename("111", "222");
listPane.rename("222", "333");
Map<String, String> dsNameChangedMap = listPane.getDsNameChangedMap();
assertEquals(1, dsNameChangedMap.size());
}
}

198
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java

@ -1,58 +1,210 @@
package com.fr.van.chart.designer.component.border;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.chartglyph.Marker;
import com.fr.chart.chartglyph.MarkerFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.xcombox.MarkerComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.AttrBorderWithShape;
import com.fr.plugin.chart.marker.type.MarkerType;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class VanChartBorderWithShapePane extends VanChartBorderWithRadiusPane {
public class VanChartBorderWithShapePane extends BasicPane {
private static final int RECTANGULAR_INDEX = 0;
private static final int DIALOG_INDEX = 1;
private MarkerComboBox shapePane;
private static final int AUTO_COLOR = 0;
private static final int CUSTOM_COLOR = 1;
protected void initComponents() {
shapePane = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers());
super.initComponents();
private LineComboBox lineTypeBox;
private UIButtonGroup<Integer> lineColorButton;
private ColorSelectBox lineColorBox;
private MarkerComboBox borderShape;
private UISpinner borderRadius;
private JPanel detailPane;
private JPanel colorBoxPane;
public VanChartBorderWithShapePane() {
initComponents();
createBorderPane();
}
private void initComponents() {
lineTypeBox = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
lineColorButton = new UIButtonGroup<>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Automatic"),
Toolkit.i18nText("Fine-Design_Chart_Custom")
});
lineColorBox = new ColorSelectBox(100);
borderShape = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers());
borderRadius = new UISpinner(0, 1000, 1, 0);
}
private void createBorderPane() {
this.setLayout(new BorderLayout());
detailPane = createDetailPane();
this.add(createLineTypePane(), BorderLayout.CENTER);
this.add(detailPane, BorderLayout.SOUTH);
initLineTypeListener();
initLineColorListener();
initShapeListener();
}
private void initLineTypeListener() {
lineTypeBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkDetailPane();
}
});
}
private void checkDetailPane() {
detailPane.setVisible(lineTypeBox.getSelectedLineStyle() != Constants.LINE_NONE);
}
protected Component[][] getUseComponent() {
return new Component[][]{
private void initLineColorListener() {
lineColorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkColorPane();
}
});
}
private void checkColorPane() {
colorBoxPane.setVisible(lineColorButton.getSelectedIndex() == CUSTOM_COLOR);
}
private void initShapeListener() {
borderShape.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkRadiusPane();
}
});
}
private void checkRadiusPane() {
borderRadius.setEnabled(borderShape.getSelectedIndex() == RECTANGULAR_INDEX || borderShape.getSelectedIndex() == DIALOG_INDEX);
}
private JPanel createLineTypePane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), currentLineColorPane},
UIComponentUtils.wrapWithBorderLayoutPane(lineTypeBox)}};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
}
private JPanel createDetailPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")),
UIComponentUtils.wrapWithBorderLayoutPane(shapePane)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), getRadius()}
UIComponentUtils.wrapWithBorderLayoutPane(borderShape)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), borderRadius}
};
JPanel center = createLineColorPane();
JPanel south = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
JPanel panel = new JPanel(new BorderLayout());
panel.add(center, BorderLayout.CENTER);
panel.add(south, BorderLayout.SOUTH);
return panel;
}
protected double[] getRowSize() {
private JPanel createLineColorPane() {
double p = TableLayout.PREFERRED;
return new double[]{p, p, p, p, p};
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] center = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), lineColorButton}
};
Component[][] south = new Component[][]{
new Component[]{null, null},
new Component[]{null, lineColorBox}
};
colorBoxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(south, rowSize, columnSize);
JPanel panel = new JPanel(new BorderLayout());
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(center, rowSize, columnSize), BorderLayout.CENTER);
panel.add(colorBoxPane, BorderLayout.SOUTH);
return panel;
}
public void populate(AttrBorder border) {
super.populate(border);
protected String title4PopupWindow() {
return null;
}
if (border instanceof AttrBorderWithShape) {
shapePane.setSelectedMarker((Marker.createMarker(((AttrBorderWithShape) border).getShape())));
public void populate(AttrBorderWithShape border) {
if (border == null) {
return;
}
}
public void update(AttrBorder border) {
super.update(border);
lineTypeBox.setSelectedLineStyle(border.getBorderStyle());
lineColorButton.setSelectedIndex(border.isAutoColor() ? AUTO_COLOR : CUSTOM_COLOR);
lineColorBox.setSelectObject(border.getBorderColor());
borderShape.setSelectedMarker((Marker.createMarker(border.getShape())));
borderRadius.setValue(border.getRoundRadius());
if (border instanceof AttrBorderWithShape) {
((AttrBorderWithShape) border).setShape(MarkerType.parse(shapePane.getSelectedMarkder().getMarkerType()));
checkDetailPane();
checkColorPane();
checkRadiusPane();
}
public void update(AttrBorderWithShape border) {
if (border == null) {
return;
}
border.setBorderStyle(lineTypeBox.getSelectedLineStyle());
border.setAutoColor(lineColorButton.getSelectedIndex() == AUTO_COLOR);
border.setBorderColor(lineColorBox.getSelectObject());
border.setShape(MarkerType.parse(borderShape.getSelectedMarkder().getMarkerType()));
border.setRoundRadius((int) borderRadius.getValue());
}
}

22
designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/TooltipContentPaneWithOutSeries.java

@ -1,6 +1,10 @@
package com.fr.van.chart.designer.component.tooltip;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.base.format.AttrTooltipFormat;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
@ -36,4 +40,22 @@ public class TooltipContentPaneWithOutSeries extends VanChartTooltipContentPane
new Component[]{getRichTextPercentFormatPane(), null}
};
}
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) {
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{
getRichTextCategoryNameFormatPane(),
getRichTextValueFormatPane(),
getRichTextPercentFormatPane()
};
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{
attrTooltipContent.getRichTextCategoryFormat(),
attrTooltipContent.getRichTextValueFormat(),
attrTooltipContent.getRichTextPercentFormat()
};
setRichTextAttr(new AttrTooltipRichText());
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
}
}

29
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -36,6 +36,8 @@ import java.awt.Component;
public class VanChartPlotLabelDetailPane extends BasicPane {
private static final long serialVersionUID = -22438250307946275L;
private static final int HORIZONTAL_INDEX = 0;
private BasicBeanPane<AttrTooltipContent> dataLabelContentPane;
private UIButtonGroup<Integer> position;
@ -51,6 +53,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
private JPanel positionPane;
private Integer[] oldPositionValues;
private JPanel borderPaneWithTitle;
private JPanel backgroundPaneWithTitle;
private VanChartStylePane parent;
private Plot plot;
@ -125,8 +130,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
private JPanel createLabelBorderPane() {
borderPane = new VanChartBorderWithShapePane();
borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);
return borderPaneWithTitle;
}
private JPanel createLabelBackgroundPane() {
@ -142,7 +148,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
};
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane);
backgroundPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane);
return backgroundPaneWithTitle;
}
protected double[] getLabelStyleRowSize(double p) {
@ -227,6 +235,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"),
});
orientation.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
checkOrientation();
}
});
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation);
}
@ -309,6 +323,16 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
tractionLine.setSelected(position.getSelectedItem() == Constants.OUTSIDE);
checkPositionEnabled();
}
private void checkOrientation() {
if (orientation != null && borderPaneWithTitle != null && backgroundPaneWithTitle != null) {
boolean horizontal = orientation.getSelectedIndex() == HORIZONTAL_INDEX;
borderPaneWithTitle.setVisible(horizontal);
backgroundPaneWithTitle.setVisible(horizontal);
}
}
private void checkPositionEnabled() {
tractionLinePane.setVisible(position.getSelectedItem() == Constants.OUTSIDE);
}
@ -344,6 +368,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
checkAllUse();
checkOrientation();
}

21
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java

@ -1,6 +1,8 @@
package com.fr.van.chart.funnel.designer.style;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.base.format.AttrTooltipFormat;
import com.fr.plugin.chart.base.format.AttrTooltipNameFormat;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
@ -9,6 +11,7 @@ import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckB
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
@ -58,6 +61,24 @@ public class VanChartFunnelTooltipContentPane extends VanChartTooltipContentPane
setRichTextPercentFormatPane(new FunnelPercentFormatPaneWithoutCheckBox(parent, showOnPane));
}
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) {
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{
getRichTextSeriesNameFormatPane(),
getRichTextValueFormatPane(),
getRichTextPercentFormatPane()
};
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{
attrTooltipContent.getRichTextSeriesFormat(),
attrTooltipContent.getRichTextValueFormat(),
attrTooltipContent.getRichTextPercentFormat()
};
setRichTextAttr(new AttrTooltipRichText());
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
}
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent();
attrTooltipContent.getCategoryFormat().setEnable(false);

2
designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java

@ -45,6 +45,8 @@ public class VanChartMapLabelContentPane extends VanChartLabelContentPane {
AttrTooltipContent content = new AttrTooltipContent();
content.setCategoryFormat(new AttrTooltipAreaNameFormat());
content.setValueFormat(new AttrTooltipMapValueFormat());
content.setRichTextCategoryFormat(new AttrTooltipAreaNameFormat());
content.setRichTextValueFormat(new AttrTooltipMapValueFormat());
return content;
}
}

2
designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java

@ -45,6 +45,8 @@ public class VanChartMapTooltipContentPane extends VanChartTooltipContentPane {
AttrTooltipContent content = new AttrTooltipContent();
content.setCategoryFormat(new AttrTooltipAreaNameFormat());
content.setValueFormat(new AttrTooltipMapValueFormat());
content.setRichTextCategoryFormat(new AttrTooltipAreaNameFormat());
content.setRichTextValueFormat(new AttrTooltipMapValueFormat());
return content;
}
}

2
designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java

@ -43,6 +43,8 @@ public class VanChartLineMapTooltipContentPane extends VanChartTooltipContentPan
AttrTooltipContent content = new AttrTooltipContent();
content.setCategoryFormat(new AttrTooltipStartAndEndNameFormat());
content.setValueFormat(new AttrTooltipValueFormat());
content.setRichTextCategoryFormat(new AttrTooltipStartAndEndNameFormat());
content.setRichTextValueFormat(new AttrTooltipValueFormat());
return content;
}

1
designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java

@ -38,6 +38,7 @@ public class VanChartMultiPieLabelContentPane extends VanChartLabelContentPane {
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent content = new AttrTooltipContent();
content.setCategoryFormat(new AttrTooltipMultiLevelNameFormat());
content.setRichTextCategoryFormat(new AttrTooltipMultiLevelNameFormat());
return content;
}
}

1
designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java

@ -39,6 +39,7 @@ public class VanChartMultiPieTooltipContentPane extends VanChartTooltipContentPa
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent content = new AttrTooltipContent();
content.setCategoryFormat(new AttrTooltipMultiLevelNameFormat());
content.setRichTextCategoryFormat(new AttrTooltipMultiLevelNameFormat());
return content;
}

22
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java

@ -3,6 +3,8 @@ package com.fr.van.chart.structure.desinger.style;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.base.format.AttrTooltipFormat;
import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
@ -13,6 +15,7 @@ import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckB
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
@ -87,10 +90,29 @@ public class VanChartStructureTooltipContentPane extends VanChartTooltipContentP
setRichTextPercentFormatPane(richTextPercentFormatPane);
}
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) {
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{
getRichTextCategoryNameFormatPane(),
getRichTextSeriesNameFormatPane(),
getRichTextValueFormatPane()
};
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{
attrTooltipContent.getRichTextCategoryFormat(),
attrTooltipContent.getRichTextSeriesFormat(),
attrTooltipContent.getRichTextValueFormat()
};
setRichTextAttr(new AttrTooltipRichText());
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
}
@Override
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent();
attrTooltipContent.setCategoryFormat(new AttrTooltipMultiLevelNameFormat());
attrTooltipContent.setRichTextCategoryFormat(new AttrTooltipMultiLevelNameFormat());
return attrTooltipContent;
}
}

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

@ -232,7 +232,7 @@
content = this.editor.getValue(BI.NicEditor.FormatType.ESCAPE),
origin = content;
if (isAuto) {
content = this._switchToAutoStyle();
// content = this._switchToAutoStyle();
this.setFocus();
} else if (editorService.isRichTextEqual(content, this.options.placeholder)) {
content = "";

4
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -12,6 +12,7 @@ import com.fr.design.designer.creator.XWScaleLayout;
import com.fr.design.designer.properties.items.FRFitConstraintsItems;
import com.fr.design.designer.properties.items.FRLayoutTypeItems;
import com.fr.design.designer.properties.items.Item;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
@ -194,11 +195,14 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
try {
if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) {
WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body");
String predefinedName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
Component[] components = xWFitLayout.getComponents();
xWFitLayout.removeAll();
layout.resetStyle();
layout.setNameBackground(NameFormBackground.createPredefinedStyle(predefinedName));
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = xWFitLayout.getBackupParent() == null ? new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)) : (XWAbsoluteBodyLayout) xWFitLayout.getBackupParent();
xwAbsoluteBodyLayout.initWidgetPredefinedInfo(predefinedName);
xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
for (Component component : components) {
XCreator xCreator = (XCreator) component;

6
designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -11,7 +11,7 @@ import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.DefaultPredefinedTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -59,7 +59,7 @@ public class CellWidgetPropertyPane extends BasicPane {
public void populate(TemplateCellElement cellElement) {
if (cellElement == null) {// 利用默认的CellElement.
cellElement = new DefaultTemplateCellElement(0, 0, null);
cellElement = new DefaultPredefinedTemplateCellElement(0, 0, null);
}
Widget cellWidget = cellElement.getWidget();
@ -88,7 +88,7 @@ public class CellWidgetPropertyPane extends BasicPane {
final TemplateElementCase tplEC = ePane.getEditingElementCase();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
editCellElement = new DefaultPredefinedTemplateCellElement(cs.getColumn(), cs.getRow());
}
this.cellElement = editCellElement;
this.populate(editCellElement);

4
designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java

@ -14,7 +14,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.DefaultPredefinedTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -112,7 +112,7 @@ public class CellElementEditPane extends BasicPane {
CellElement cellElement = elementCase.getCellElement(cs.getColumn(), cs.getRow());
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
cellElement = new DefaultPredefinedTemplateCellElement(cs.getColumn(), cs.getRow());
//默认选中的是A1单元格,所以若是A1单元格没有加到列表时要加上,否则在聚合报表时会出错
if (cs.isSelectedOneCell(elementCasePane) && (cs.getColumn() + cs.getRow() == 0)) {
elementCase.addCellElement((TemplateCellElement) cellElement);

4
designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java

@ -12,7 +12,7 @@ import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.DefaultPredefinedTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.highlight.DefaultHighlight;
import com.fr.report.cell.cellattr.highlight.Highlight;
@ -82,7 +82,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
final TemplateElementCase tplEC = ePane.getEditingElementCase();
editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
editCellElement = new DefaultPredefinedTemplateCellElement(cs.getColumn(), cs.getRow());
}
SheetUtils.calculateDefaultParent(tplEC); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里

8
designer-realize/src/main/java/com/fr/grid/Grid.java

@ -28,7 +28,7 @@ import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.ReportHelper;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.DefaultPredefinedTemplateCellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellGUIAttr;
@ -865,7 +865,7 @@ public class Grid extends BaseGridComponent {
}
// 必须保证editingCellElement不是null。
if (editingCellElement == null) {
editingCellElement = new DefaultTemplateCellElement(column, row);
editingCellElement = new DefaultPredefinedTemplateCellElement(column, row);
}
editorComponent = getCellEditingComp();
if (editorComponent == null) {
@ -1029,7 +1029,7 @@ public class Grid extends BaseGridComponent {
}
// 必须保证editingCellElement不是null。
if (editingCellElement == null) {
editingCellElement = new DefaultTemplateCellElement(editingColumn, editingRow);
editingCellElement = new DefaultPredefinedTemplateCellElement(editingColumn, editingRow);
tplEC.addCellElement(editingCellElement);
}
if (setValue4EditingElement(newValue)) {
@ -1455,4 +1455,4 @@ public class Grid extends BaseGridComponent {
this.paginateLineShowType = paginateLineShowType;
this.getElementCasePane().repaint();
}
}
}

Loading…
Cancel
Save