Browse Source

无JIRA任务,解决冲突

persist/11.0
白岳 4 years ago
parent
commit
9c3b1000ae
  1. 5
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  2. 58
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  3. 7
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java
  4. 2
      designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java
  5. 25
      designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java
  6. 54
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  7. 20
      designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java
  8. 54
      designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java
  9. 9
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  10. 47
      designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java
  11. 49
      designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java
  12. 31
      designer-base/src/main/java/com/fr/design/menu/SnapChatUtil.java
  13. 22
      designer-base/src/main/java/com/fr/design/notification/AbstractSnapChat.java
  14. 4
      designer-base/src/main/java/com/fr/design/notification/SnapChat.java
  15. 32
      designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java
  16. 11
      designer-base/src/main/java/com/fr/design/notification/SnapChatKey.java
  17. 5
      designer-base/src/main/java/com/fr/design/object/NameObject.java
  18. 26
      designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java
  19. 2
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java
  20. 22
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java
  21. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java
  22. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java
  23. 21
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java
  24. 42
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  25. 198
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java
  26. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/label/GaugeLabelContentPane.java
  27. 24
      designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/TooltipContentPaneWithOutSeries.java
  28. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java
  29. 33
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  30. 6
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java
  31. 32
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java
  32. 4
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java
  33. 2
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java
  34. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java
  35. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java
  36. 2
      designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java
  37. 1
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java
  38. 1
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java
  39. 3
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java
  40. 2
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java
  41. 4
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java
  42. 24
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java
  43. 1
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java
  44. 37
      designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html
  45. 2
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  46. 4
      designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java
  47. 8
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.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]);
}
/**

58
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;
@ -23,18 +24,20 @@ import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* TableDataList Pane.
*/
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 +46,15 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
@Override
public void propertyChange() {
isNamePermitted = true;
TableDataSource source = DesignTableDataManager.getEditingTableDataSource();
String[] allDSNames = DesignTableDataManager.getAllDSNames(source);
String[] allListNames = nameableList.getAllNames();
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY;
String tempName = getEditingName();
if (ComparatorUtils.equals(tempName, selectedName)) {
//说明双击之后又取消了,啥也不用做
return;
}
Set<String> allDSNames = DesignTableDataManager.getGlobalDataSet().keySet();
String[] allListNames = nameableList.getAllNames();
allListNames[editingIndex] = StringUtils.EMPTY;
Object editingType = getEditingType();
if (!BasicTableDataUtils.checkName(tempName)) {
@ -61,15 +68,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 Collection[]{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 +87,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,7 +95,19 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
@Override
public void rename(String oldName, String newName) {
dsNameChangedMap.put(oldName, newName);
//如果a改成了b,b又被改成了c,就认为是a改成了c
for (Map.Entry<String, String> entry : dsNameChangedMap.entrySet()) {
if (StringUtils.equals(oldName, entry.getValue())) {
oldName = entry.getKey();
break;
}
}
if (StringUtils.equals(oldName, newName)) {
//a -> b;b -> a,说明没改
dsNameChangedMap.remove(oldName);
} else {
dsNameChangedMap.put(oldName, newName);
}
}
/**
@ -148,7 +162,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 +206,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
}
}
populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
populate(nameObjectList.toArray(new NameObject[0]));
}
/**
@ -209,10 +223,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 +234,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());

7
designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

@ -27,6 +27,7 @@ import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.Collection;
public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider {
private static final String LIST_NAME = "JControl_List";
@ -190,9 +191,9 @@ public abstract class JListControlPane extends JControlPane implements ListContr
return getHelper().getSelectedName();
}
protected boolean isNameRepeated(java.util.List[] list, String name) {
for (int i = 0; i < list.length; i++) {
if (list[i].contains(name)) {
protected boolean isNameRepeated(Collection[] collections, String name) {
for (int i = 0; i < collections.length; i++) {
if (collections[i].contains(name)) {
isNameRepeated = true;
return true;
}

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]);
}
/**

25
designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java

@ -25,10 +25,20 @@ import com.fr.general.FRFont;
import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.RenderingHints;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Vector;
@ -67,11 +77,20 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
private UIToggleButton subPane;
private JPanel linePane;
private int italic_bold;
/**
* LeftPane和RightPane之间的间隙也是fontSizeStyleComboBox与fontSizeComboBox之间的间隙之前的默认值为VGAP_LARGE
*/
private int hGapBetweenLeftPaneAndRightPane = LayoutConstants.VGAP_LARGE;
public FRFontPane() {
this.initComponents();
}
public FRFontPane(int hGapBetweenLeftPaneAndRightPane) {
this.hGapBetweenLeftPaneAndRightPane = hGapBetweenLeftPaneAndRightPane;
this.initComponents();
}
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@ -345,7 +364,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
private JPanel createPane() {
JPanel createPane = new JPanel(new BorderLayout());
createPane.add(fontNameComboBox, BorderLayout.NORTH);
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{createLeftPane(), createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{createLeftPane(), createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, hGapBetweenLeftPaneAndRightPane, LayoutConstants.VGAP_LARGE);
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
createPane.add(jPanel, BorderLayout.CENTER);
return createPane;

54
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -12,6 +12,8 @@ import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.icontainer.UIEastResizableContainer;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.menu.SnapChatUtil;
import com.fr.design.notification.SnapChat;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils;
@ -171,7 +173,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
updateAllPropertyPane();
}
}); }
});
}
}, filter);
PluginListenerRegistration.getInstance().listen(
PluginEventType.BeforeStop,
@ -221,11 +224,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
String key = provider.key();
PropertyItemBean itemBean = provider.getItem();
PropertyItem propertyItem = new PropertyItem(itemBean.getName(),
itemBean.getTitle(),
itemBean.getBtnIconName(),
itemBean.getBtnIconBaseDir(),
itemBean.getVisibleModes(),
itemBean.getEnableModes());
itemBean.getTitle(),
itemBean.getBtnIconName(),
itemBean.getBtnIconBaseDir(),
itemBean.getVisibleModes(),
itemBean.getEnableModes(),
itemBean.getSnapChat(),
itemBean.getPromptWindow());
UIButton button = propertyItem.getButton();
List<ActionListener> buttonListeners = itemBean.getButtonListeners();
if (buttonListeners != null) {
@ -324,6 +329,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
cellElement.popupDialog.showDefaultPane();
}
}
// 禁用单元格元素tab
private void enableCellElementPane(PropertyItem cellElement) {
cellElement.setEnabled(true);
@ -381,7 +387,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
/**
* 可通过此方法判断当前的编辑模式
* */
*/
public PropertyMode getCurrentMode() {
return currentMode;
}
@ -527,7 +533,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
propertyItemMap.get(KEY_WIDGET_SETTINGS).replaceHeaderPane(paraPane);
}
public static void main(String[] args){
public static void main(String[] args) {
JFrame jf = new JFrame("test");
// jf = new JFrame("test");
@ -549,7 +555,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// leftPane.add(b2);
// leftPane.setLayout(new BoxLayout(leftPane, BoxLayout.Y_AXIS));
JPanel content = (JPanel)jf.getContentPane();
JPanel content = (JPanel) jf.getContentPane();
// content.setLayout(null);
content.add(cc, BorderLayout.CENTER);
content.add(new EastRegionContainerPane(), BorderLayout.EAST);
@ -657,6 +663,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
class PropertyItem {
private SnapChat snapChat;
private UIButton button;
private String name; // 用于 card 切换
private String title; // 用于显示
@ -667,6 +674,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private FixedPopupPane popupPane; // 左侧固定弹出框
private PopupToolPane popupToolPane; // 弹出工具条
private PopupDialog popupDialog; // 弹出框
private PromptWindow promptWindow; //提示窗
private boolean isPoppedOut = false; // 是否弹出
private boolean isVisible = true; // 是否可见
private boolean replace = false; // 是否被替代
@ -687,14 +695,16 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) {
this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes);
this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, null, null);
}
public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes) {
public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat, PromptWindow promptWindow) {
this.name = name;
this.title = title;
this.btnIconName = btnIconName;
this.iconBaseDir = iconBaseDir;
this.snapChat = snapChat;
this.promptWindow = promptWindow;
initButton();
initPropertyPanel();
initModes(visibleModes, enableModes);
@ -835,7 +845,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
if (isRightPaneVisible()) {
hideCurrentPopupPane();
replaceContentPane(contentPane);
} else if(popupPane != null && popupPane.isVisible()) {
} else if (popupPane != null && popupPane.isVisible()) {
popupPane.replaceContentPane(contentArea);
}
}
@ -872,9 +882,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public Dimension getPreferredSize() {
return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT);
}
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
if (snapChat != null && !snapChat.hasRead()) {
SnapChatUtil.paintPropertyItemPoint(g, getBounds());
}
}
};
button.set4LargeToolbarButton();
@ -902,6 +916,12 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
popupFixedPane();
}
setTabButtonSelected();
if (snapChat != null && !snapChat.hasRead()) {
snapChat.markRead();
if (promptWindow != null) {
promptWindow.showWindow();
}
}
}
});
button.setToolTipText(title);
@ -1015,8 +1035,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
/**
* @Description:刷新currentPopupPane面板位置当设计器缩放时会调用这个函数
* @param
* @Description:刷新currentPopupPane面板位置当设计器缩放时会调用这个函数
* @return:
* @Author: Henry.Wang
* @date: 2020/7/30 11:39
@ -1031,8 +1051,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
/**
* @Description:清空currentPopupPane数据当切换模板时会调用这个函数
* @param
* @Description:清空currentPopupPane数据当切换模板时会调用这个函数
* @return:
* @Author: Henry.Wang
* @date: 2020/7/30 11:42
@ -1071,12 +1091,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
repaint();
}
@Override
public void mouseClicked(MouseEvent e) {
if (e.getX() >= ARROW_RANGE_START) {
onPop();
}
}
@Override
public void mouseReleased(MouseEvent e) {
mouseDownCompCoords = null;
@ -1084,6 +1106,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
contentPane.setBackground(originColor);
}
}
@Override
public void mousePressed(MouseEvent e) {
if (e.getX() < ARROW_RANGE_START) {
@ -1105,6 +1128,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
repaint();
}
@Override
public void mouseDragged(MouseEvent e) {
if (isMovable && mouseDownCompCoords != null) {
@ -1217,6 +1241,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private Container contentPane;
private JPanel defaultPane; // 无可用配置项
private PropertyItem propertyItem;
public PopupDialog(PropertyItem propertyItem) {
super(DesignerContext.getDesignerFrame());
container = getContentPane();
@ -1319,6 +1344,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
mouseDownCompCoords = e.getLocationOnScreen();
}
}
@Override
public void mouseReleased(MouseEvent e) {
mouseDownCompCoords = null;

20
designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java

@ -0,0 +1,20 @@
package com.fr.design.mainframe;
import javax.swing.JWindow;
/**
* @Author: Yuan.Wang
* @Date: 2020/10/9
* 只关心Window的显示和隐藏操作时可以实现该接口
*/
public interface PromptWindow {
/**
* 显示弹窗
*/
void showWindow();
/**
* 隐藏弹窗
*/
void hideWindow();
}

54
designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe;
import com.fr.design.notification.SnapChat;
import java.awt.event.ActionListener;
import java.util.List;
@ -7,71 +9,89 @@ import java.util.List;
* created by Harrison on 2020/03/23
**/
public class PropertyItemBean {
private String name;
private String title;
private String btnIconName;
private String btnIconBaseDir;
private SnapChat snapChat;
private PromptWindow promptWindow;
private EastRegionContainerPane.PropertyMode[] visibleModes;
private EastRegionContainerPane.PropertyMode[] enableModes;
private List<ActionListener> buttonListeners;
public PropertyItemBean() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getBtnIconName() {
return btnIconName;
}
public void setBtnIconName(String btnIconName) {
this.btnIconName = btnIconName;
}
public String getBtnIconBaseDir() {
return btnIconBaseDir;
}
public void setBtnIconBaseDir(String btnIconBaseDir) {
this.btnIconBaseDir = btnIconBaseDir;
}
public SnapChat getSnapChat() {
return snapChat;
}
public void setSnapChat(SnapChat snapChat) {
this.snapChat = snapChat;
}
public PromptWindow getPromptWindow() {
return promptWindow;
}
public void setPromptWindow(PromptWindow promptWindow) {
this.promptWindow = promptWindow;
}
public EastRegionContainerPane.PropertyMode[] getVisibleModes() {
return visibleModes;
}
public void setVisibleModes(EastRegionContainerPane.PropertyMode[] visibleModes) {
this.visibleModes = visibleModes;
}
public EastRegionContainerPane.PropertyMode[] getEnableModes() {
return enableModes;
}
public void setEnableModes(EastRegionContainerPane.PropertyMode[] enableModes) {
this.enableModes = enableModes;
}
public List<ActionListener> getButtonListeners() {
return buttonListeners;
}
public void setButtonListeners(List<ActionListener> buttonListeners) {
this.buttonListeners = buttonListeners;
}

9
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -54,9 +54,7 @@ import com.fr.design.mainframe.ToolBarNewTemplatePane;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.SnapChatMenuDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.notification.SnapChatAllTypes;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.remote.action.RemoteDesignAuthManagerAction;
import com.fr.design.update.actions.SoftwareUpdateAction;
@ -655,11 +653,8 @@ public abstract class ToolBarMenuDock {
}
public MenuDef createCommunityMenuDef() {
MenuDef menuDef = new SnapChatMenuDef(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community"),
'C',
SnapChatAllTypes.Menu.BBS);
MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community"), 'C');
ShortCut[] otherCommunityShortCuts = createCommunityShortCuts();
for (ShortCut shortCut : otherCommunityShortCuts) {
menuDef.addShortCut(shortCut);

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

@ -4,6 +4,7 @@ import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.gui.imenu.UIScrollMenu;
import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatConfig;
import com.fr.design.notification.SnapChatFactory;
import com.fr.design.notification.SnapChatKey;
import javax.swing.JMenu;
@ -19,47 +20,49 @@ import java.awt.image.BufferedImage;
* created by Harrison on 2020/03/16
**/
public class SnapChatMenuDef extends MenuDef implements SnapChat {
private SnapChatKey uniqueKey;
private SnapChatMenuUI menuUI = new SnapChatMenuUI(this);
private SnapChat snapChat ;
public SnapChatMenuDef(String name, SnapChatKey uniqueKey) {
super(name);
this.uniqueKey = uniqueKey;
snapChat = SnapChatFactory.createSnapChat(true, uniqueKey);
}
public SnapChatMenuDef(Boolean rePaint, SnapChatKey uniqueKey) {
super(rePaint);
this.uniqueKey = uniqueKey;
snapChat = SnapChatFactory.createSnapChat(true, uniqueKey);
}
public SnapChatMenuDef(String name, char mnemonic, SnapChatKey uniqueKey) {
super(name, mnemonic);
this.uniqueKey = uniqueKey;
snapChat = SnapChatFactory.createSnapChat(true, uniqueKey);
}
@Override
public boolean hasRead() {
String calcKey = calcKey();
Boolean val = SnapChatConfig.getInstance().hasRead(calcKey);
// 默认读过了。
return val == null ? defaultStatus() : val;
return snapChat.hasRead();
}
@Override
public void markRead() {
String calcKey = calcKey();
SnapChatConfig.getInstance().markRead(calcKey);
snapChat.markRead();
}
@Override
public boolean defaultStatus() {
return true;
return snapChat.defaultStatus();
}
@Override
public SnapChatKey key() {
return snapChat.key();
}
@Override
public void addShortCut(ShortCut shortCut) {
@ -74,13 +77,6 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat {
super.insertShortCut(index, shortCut);
}
@Override
public SnapChatKey key() {
return this.uniqueKey;
}
@Override
protected MenuListener createMenuListener() {
@ -97,17 +93,12 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat {
if (shortCut instanceof SnapChatUpdateAction) {
SnapChatUpdateAction action = (SnapChatUpdateAction) shortCut;
if (!action.hasRead()) {
String calcKey = calcKey();
String calcKey = snapChat.calcKey();
SnapChatConfig.getInstance().resetRead(calcKey);
}
}
}
private String calcKey() {
return key().calc();
}
@Override
protected UIMenu createJMenu0() {

49
designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java

@ -3,7 +3,7 @@ package com.fr.design.menu;
import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatConfig;
import com.fr.design.notification.SnapChatFactory;
import com.fr.design.notification.SnapChatKey;
import java.awt.event.ActionEvent;
@ -12,57 +12,46 @@ import java.awt.event.ActionEvent;
* created by Harrison on 2020/03/22
**/
public abstract class SnapChatUpdateAction extends UpdateAction implements SnapChat {
private SnapChatKey uniqueKey;
private SnapChat snapChat ;
public SnapChatUpdateAction(SnapChatKey uniqueKey) {
this.uniqueKey = uniqueKey;
snapChat = SnapChatFactory.createSnapChat(false, uniqueKey);
}
@Override
public final void actionPerformed(ActionEvent e) {
markRead();
actionPerformed0(e);
}
protected abstract void actionPerformed0(ActionEvent e);
@Override
public boolean hasRead() {
String calcKey = calcKey();
Boolean val = SnapChatConfig.getInstance().hasRead(calcKey);
return val == null ? defaultStatus() : val;
return snapChat.hasRead();
}
@Override
public void markRead() {
String calcKey = calcKey();
SnapChatConfig.getInstance().markRead(calcKey);
snapChat.markRead();
}
@Override
public boolean defaultStatus() {
return false;
return snapChat.defaultStatus();
}
@Override
public SnapChatKey key() {
return this.uniqueKey;
}
private String calcKey() {
return key().calc();
return snapChat.key();
}
@Override
public UIMenuItem createMenuItem() {
Object object = this.getValue(UIMenuItem.class.getName());
if (object == null && !(object instanceof UIMenuItem)) {
UIMenuItem menuItem = new UIMenuItem(this);
@ -70,10 +59,10 @@ public abstract class SnapChatUpdateAction extends UpdateAction implements SnapC
menuItem.setName(getName());
menuItem.setUI(new SnapChatMenuItemUI(this));
object = menuItem;
this.putValue(UIMenuItem.class.getName(), object);
}
return (UIMenuItem) object;
}
}

31
designer-base/src/main/java/com/fr/design/menu/SnapChatUtil.java

@ -10,24 +10,31 @@ import java.awt.geom.Ellipse2D;
* created by Harrison on 2020/03/22
**/
public class SnapChatUtil {
private static final int WIDTH = 4;
private static final int HEIGHT = 4;
private static final int TOP_GAP = 4;
private static final int RIGHT_GAP = 6;
/**
* 绘制菜单项的小红点
*/
public static void paintSnapChat(Graphics g, Rectangle textRect) {
Color oldColor = g.getColor();
double x = textRect.getWidth();
x += textRect.getX();
x += 2;
double x = textRect.getWidth() + textRect.getX() + 2;
double y = textRect.getY();
paintRedPoint(g, new Ellipse2D.Double(x, y, WIDTH, HEIGHT));
}
public static void paintPropertyItemPoint(Graphics g, Rectangle bounds) {
double x = bounds.getWidth() - RIGHT_GAP;
paintRedPoint(g, new Ellipse2D.Double(x, TOP_GAP, WIDTH, HEIGHT));
}
private static void paintRedPoint(Graphics g, Ellipse2D.Double shape) {
Color oldColor = g.getColor();
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(Color.red);
Ellipse2D.Double shape =
new Ellipse2D.Double(x, y, 4, 4);
g2d.fill(shape);
g2d.draw(shape);
g2d.setColor(oldColor);
}
}

22
designer-base/src/main/java/com/fr/design/notification/AbstractSnapChat.java

@ -0,0 +1,22 @@
package com.fr.design.notification;
/**
* @Author: Yuan.Wang
* @Date: 2020/9/27
*/
public abstract class AbstractSnapChat implements SnapChat {
@Override
public boolean hasRead() {
String calcKey = calcKey();
Boolean val = SnapChatConfig.getInstance().hasRead(calcKey);
return val == null ? defaultStatus() : val;
}
@Override
public void markRead() {
String calcKey = calcKey();
SnapChatConfig.getInstance().markRead(calcKey);
}
}

4
designer-base/src/main/java/com/fr/design/notification/SnapChat.java

@ -32,4 +32,8 @@ public interface SnapChat {
* @return 字符标志
*/
SnapChatKey key();
default String calcKey() {
return key().calc();
}
}

32
designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java

@ -0,0 +1,32 @@
package com.fr.design.notification;
import com.fr.plugin.context.PluginContext;
/**
* @Author: Yuan.Wang
* @Date: 2020/10/10
*/
public class SnapChatFactory {
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey) {
return createSnapChat(defaultStatus, snapChatKey, null);
}
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey, PluginContext context) {
return new AbstractSnapChat() {
@Override
public boolean defaultStatus() {
return defaultStatus;
}
@Override
public SnapChatKey key() {
return snapChatKey;
}
@Override
public String calcKey() {
return context == null ? key().calc() : key().calc(context);
}
};
}
}

11
designer-base/src/main/java/com/fr/design/notification/SnapChatKey.java

@ -1,9 +1,18 @@
package com.fr.design.notification;
import com.fr.plugin.context.PluginContext;
/**
* created by Harrison on 2020/03/16
**/
public interface SnapChatKey {
String calc();
/**
* 插件刚被安装时不能通过PluginContexts.getContext()方法获取插件上下文因此加一个接口
*/
default String calc(PluginContext context) {
throw new UnsupportedOperationException();
}
}

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;
}

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

@ -0,0 +1,26 @@
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());
listPane.rename("333","111");
assertEquals(0, dsNameChangedMap.size());
}
}

2
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java

@ -308,6 +308,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
checkRichEditorState(attrTooltipContent);
}
}

22
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java

@ -1,6 +1,9 @@
package com.fr.van.chart.column;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane;
@ -14,4 +17,23 @@ public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPa
protected boolean hasLabelOrientationPane() {
return !((VanChartColumnPlot) this.getPlot()).isBar();
}
private void checkOrientationEnable(AttrLabelDetail detail) {
AttrTooltipContent content = detail.getContent();
UIButtonGroup<Integer> orientation = getOrientation();
if (orientation != null) {
orientation.setEnabled(content != null && !content.isRichText());
}
}
public void populate(AttrLabelDetail detail) {
super.populate(detail);
checkOrientationEnable(detail);
}
public void update(AttrLabelDetail detail) {
super.update(detail);
checkOrientationEnable(detail);
}
}

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java

@ -148,11 +148,12 @@ public class VanChartHtmlLabelPane extends JPanel{
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { p, f };
double[] rowSize = { p, p};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{isCustomWidth, customWidth},
new Component[]{isCustomHeight, customHeight},
new Component[] {null, null}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java

@ -18,7 +18,8 @@ public class VanChartRichEditorDialog extends BasicDialog {
this.setTitle(Toolkit.i18nText("Fine-Design_Report_RichTextEditor"));
this.setBasicDialogSize(DEFAULT);
GUICoreUtils.centerWindow(this);
this.setResizable(false);
this.setResizable(true);
this.setModal(true);
}
protected void applyEnterAction() {

21
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java

@ -69,18 +69,27 @@ public class VanChartRichEditorPane {
paramsStr.deleteCharAt(len - 1);
}
return new RichEditorModel(richText.getContent(), richText.isAuto(), paramsStr.toString());
String content = richText.getContent();
String initParams = StringUtils.EMPTY;
if (content.contains("data-id") && !content.contains("class")) {
initParams = richText.getInitParamsContent();
}
return new RichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams);
}
public static class RichEditorModel {
private String content;
private boolean auto;
private String params;
private String initParams;
public RichEditorModel(String content, boolean auto, String params) {
public RichEditorModel(String content, boolean auto, String params, String initParams) {
this.content = content;
this.auto = auto;
this.params = params;
this.initParams = initParams;
}
public String getContent() {
@ -106,5 +115,13 @@ public class VanChartRichEditorPane {
public void setParams(String params) {
this.params = params;
}
public String getInitParams() {
return initParams;
}
public void setInitParams(String initParams) {
this.initParams = initParams;
}
}
}

42
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

@ -9,11 +9,14 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.ui.ModernUIPane;
import com.fr.general.ComparatorUtils;
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.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox;
@ -32,7 +35,6 @@ import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheck
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
@ -246,7 +248,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
} else if (content.getSelectedIndex() == RICH_EDITOR_INDEX) {
return editorPanel.getPreferredSize();
} else {
return htmlPanel.getPreferredSize();
return new Dimension(commonPanel.getPreferredSize().width, htmlLabelPane.getPreferredSize().height);
}
}
};
@ -262,7 +264,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
if (content.getSelectedIndex() == COMMON_INDEX) {
return commonPanel.getPreferredSize();
} else {
return htmlPanel.getPreferredSize();
return new Dimension(commonPanel.getPreferredSize().width, htmlLabelPane.getPreferredSize().height);
}
}
};
@ -407,7 +409,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private void fireRichEditor() {
final ModernUIPane<VanChartRichEditorPane.RichEditorModel> pane = VanChartRichEditorPane.createRichEditorPane(richText);
BasicDialog dialog = new VanChartRichEditorDialog(new JFrame(), pane);
BasicDialog dialog = new VanChartRichEditorDialog(DesignerContext.getDesignerFrame(), pane);
pane.populate(VanChartRichEditorPane.getRichEditorModel(richText));
@ -604,12 +606,12 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
htmlLabelPane.populate(attrTooltipContent.getHtmlLabel());
if(!attrTooltipContent.isCommon()){
if (!(attrTooltipContent.isCommon() || attrTooltipContent.isRichText())) {
setDirty(false);
}
checkCardPane();
checkStylePane();
checkCardPane();
}
private void populateTypeButton(AttrTooltipContent attrTooltipContent) {
@ -683,6 +685,8 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
richText = new AttrTooltipRichText();
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
checkRichEditorState(attrTooltipContent);
}
protected void populateRichTextFormat(VanChartFormatPaneWithCheckBox[] formatPaneGroup, AttrTooltipFormat[] formatGroup) {
@ -702,6 +706,14 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
protected void populateRichText(AttrTooltipRichText tooltipRichText) {
if (tooltipRichText != null) {
updateLocalRichText(tooltipRichText.getContent(), tooltipRichText.isAuto());
richText.setInitParamsContent(tooltipRichText.getInitParamsContent());
}
}
protected void checkRichEditorState(AttrTooltipContent attrTooltipContent) {
if (ComparatorUtils.equals(richText.getInitParamsContent(), StringUtils.EMPTY)) {
richText.setContent(attrTooltipContent.getRichTextDefaultContent());
richText.setInitParamsContent(attrTooltipContent.getRichTextDefaultParams());
}
}
@ -719,8 +731,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
attrTooltipContent.setTextAttr(this.textAttrPane.update());
}
updateFormatsWithPaneWidth(attrTooltipContent);
htmlLabelPane.update(attrTooltipContent.getHtmlLabel());
return attrTooltipContent;
@ -793,20 +803,8 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
if (attrTooltipContent != null) {
AttrTooltipRichText tooltipRichText = attrTooltipContent.getRichTextAttr();
tooltipRichText.setContent(richText.getContent());
tooltipRichText.setInitParamsContent(richText.getInitParamsContent());
tooltipRichText.setAuto(richText.isAuto());
}
}
/**
* CHART-1295
* 通过格式的面板宽度来判断在自定义js代码中是否显示this.seriesName字符串
* 图表对于其他的格式有要求也可以在这里继续添加
* @param attrTooltipContent
*/
private void updateFormatsWithPaneWidth (AttrTooltipContent attrTooltipContent) {
int paneWidth = seriesNameFormatPane.getWidth();
if (paneWidth == 0) {
attrTooltipContent.getSeriesFormat().setEnable(false);
}
}
}
}

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());
}
}

4
designer-chart/src/main/java/com/fr/van/chart/designer/component/label/GaugeLabelContentPane.java

@ -2,7 +2,7 @@ package com.fr.van.chart.designer.component.label;
import com.fr.design.i18n.Toolkit;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.VanChartLabelContentPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
@ -10,7 +10,7 @@ import javax.swing.JPanel;
/**
* Created by mengao on 2017/8/13.
*/
public class GaugeLabelContentPane extends VanChartTooltipContentPane {
public class GaugeLabelContentPane extends VanChartLabelContentPane {
public GaugeLabelContentPane(VanChartStylePane parent, JPanel showOnPane) {
super(parent, showOnPane);

24
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,24 @@ 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());
checkRichEditorState(attrTooltipContent);
}
}

5
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java

@ -64,11 +64,14 @@ public class VanChartLabelPane extends AbstractVanChartScrollPane<Chart> {
return;
}
ConditionAttr attrList = chart.getPlot().getConditionCollection().getDefaultAttr();
// labelPane中颜色选择器会触发listener.doChange(),导致style界面update两次,
// 为了避免递归updateBean时,remove与add不匹配,调整一下labelPane.update()的位置
AttrLabel attrLabel = labelPane.update();
DataSeriesCondition attr = ((VanChartPlot)chart.getPlot()).getAttrLabelFromConditionCollection();
if(attr != null) {
attrList.remove(attr);
}
AttrLabel attrLabel = labelPane.update();
if (attrLabel != null) {
attrList.addDataSeriesCondition(attrLabel);
}

33
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;
@ -83,6 +88,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
return plot;
}
public UIButtonGroup<Integer> getOrientation() {
return orientation;
}
//默认从factory中取
protected void initToolTipContentPane(Plot plot) {
dataLabelContentPane = PlotFactory.createPlotLabelContentPane(plot, parent, VanChartPlotLabelDetailPane.this);
@ -125,8 +134,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 +152,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 +239,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 +327,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 +372,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
checkAllUse();
checkOrientation();
}

6
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java

@ -77,13 +77,19 @@ public class VanChartFunnelLabelContentPane extends VanChartLabelContentPane {
setRichTextAttr(new AttrTooltipRichText());
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
checkRichEditorState(attrTooltipContent);
}
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent();
attrTooltipContent.getCategoryFormat().setEnable(false);
attrTooltipContent.getRichTextCategoryFormat().setEnable(false);
attrTooltipContent.setSeriesFormat(new AttrTooltipNameFormat());
attrTooltipContent.setRichTextSeriesFormat(new AttrTooltipNameFormat());
return attrTooltipContent;
}

32
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,12 +61,39 @@ 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());
checkRichEditorState(attrTooltipContent);
}
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent();
attrTooltipContent.getCategoryFormat().setEnable(false);
attrTooltipContent.setSeriesFormat(new AttrTooltipNameFormat());
attrTooltipContent.setRichTextSeriesFormat(new AttrTooltipNameFormat());
attrTooltipContent.getCategoryFormat().setEnable(false);
attrTooltipContent.getSeriesFormat().setEnable(true);
attrTooltipContent.getValueFormat().setEnable(true);
attrTooltipContent.getRichTextCategoryFormat().setEnable(false);
attrTooltipContent.getRichTextSeriesFormat().setEnable(true);
attrTooltipContent.getRichTextValueFormat().setEnable(true);
return attrTooltipContent;
}
}

4
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java

@ -3,7 +3,7 @@ package com.fr.van.chart.gantt.designer.style.label;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.VanChartLabelContentPane;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
@ -16,7 +16,7 @@ import java.awt.Component;
/**
* Created by hufan on 2017/1/13.
*/
public class VanChartGanttLabelContentPane extends VanChartTooltipContentPane {
public class VanChartGanttLabelContentPane extends VanChartLabelContentPane {
private VanChartFormatPaneWithCheckBox processesFormatPane;
private VanChartDateFormatPaneWithCheckBox startTimeFormatPane;

2
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java

@ -167,6 +167,8 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane
richTextProgressFormatPane.updateFormatParams(params, progressFormat.getJs());
populateRichText(attrTooltipContent.getRichTextAttr());
checkRichEditorState(attrTooltipContent);
}
}

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;
}

3
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.scatter;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPaneWithBackGroundLabel;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
@ -17,7 +18,7 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont
@Override
protected VanChartHtmlLabelPane createHtmlLabelPane() {
return new VanChartHtmlLabelPane();
return new VanChartHtmlLabelPaneWithBackGroundLabel();
}
}

2
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java

@ -128,6 +128,8 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa
setRichTextAttr(new AttrTooltipRichText());
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
checkRichEditorState(attrTooltipContent);
}
}

4
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java

@ -4,7 +4,7 @@ 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.multilayer.style.AttrTooltipMultiLevelNameFormat;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.VanChartLabelContentPane;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox;
@ -17,7 +17,7 @@ import java.awt.Component;
/**
* Created by shine on 2017/2/15.
*/
public class VanChartStructureLabelContentPane extends VanChartTooltipContentPane {
public class VanChartStructureLabelContentPane extends VanChartLabelContentPane {
public VanChartStructureLabelContentPane(VanChartStylePane parent, JPanel showOnPane) {
super(parent, showOnPane);
}

24
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,31 @@ 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());
checkRichEditorState(attrTooltipContent);
}
@Override
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent();
attrTooltipContent.setCategoryFormat(new AttrTooltipMultiLevelNameFormat());
attrTooltipContent.setRichTextCategoryFormat(new AttrTooltipMultiLevelNameFormat());
return attrTooltipContent;
}
}

1
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java

@ -81,6 +81,7 @@ public class VanChartWordCloudTooltipContentPane extends VanChartTooltipContentP
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent();
attrTooltipContent.setSeriesFormat(new AttrTooltipNameFormat());
attrTooltipContent.setRichTextSeriesFormat(new AttrTooltipNameFormat());
return attrTooltipContent;
}
}

37
designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html

@ -40,6 +40,7 @@
var content = Pool.data.getContent();
var isAuto = Pool.data.isAuto();
var params = Pool.data.getParams();
var initParams = Pool.data.getInitParams();
var getDimensionIds = function (params) {
var result = [];
@ -57,8 +58,29 @@
return result;
}
var getInitContent = function (params, initParams) {
var editorService = BI.Services.getService("bi.service.design.chart.common.editor");
var paramGroup = params.split("-");
content = "";
for (var i = 0, len = paramGroup.length; i < len; i++) {
var [key, value] = paramGroup[i].split(":");
if (initParams.indexOf(value) > -1) {
content += '<p style="text-align: center;">' + editorService.getEditorParamImage(key) + '<br></p>';
}
}
return content;
}
var dimensionIds = getDimensionIds(params);
if (initParams) {
content = getInitContent(params, initParams);
}
var rich_editor = BI.createWidget({
type: "bi.design.chart.common.editor",
element: "body",
@ -92,10 +114,19 @@
});
Pool.dispatch = function () {
var content = Pool.data.getContent();
var isAuto = Pool.data.isAuto();
var params = Pool.data.getParams();
var initParams = Pool.data.getInitParams();
if (initParams) {
content = getInitContent(params, initParams);
}
rich_editor.setValue({
content: Pool.data.getContent(),
isAuto: Pool.data.isAuto(),
dimensionIds: getDimensionIds(Pool.data.getParams())
content: content,
isAuto: isAuto,
dimensionIds: getDimensionIds(params)
});
}

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

@ -107,7 +107,7 @@
_cleanHtml: function (value) {
var editorService = BI.Services.getService("bi.service.design.chart.common.editor");
var dimensionIds = this.options.dimensionIds;
var dimensionIds = this.model.dimensionIds;
var dataIdMap = {};
for (var i = 0, len = dimensionIds.length; i < len; i++) {

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

@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer;
import com.fr.base.BaseUtils;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
@ -58,7 +59,8 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Left")
, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Center"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Right")});
frFontPane = new FRFontPane();
// 字体大小是浮点数,因为涉及很多字体计算,不太好修改,为了完整显示字体,将FRFontPane中的fontSizeComboBox拉长一点
frFontPane = new FRFontPane(LayoutConstants.VGAP_MEDIUM);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p};

8
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java

@ -133,14 +133,6 @@ public class MobileTabCommonSettingPane extends BasicPane {
tableConfigJPanel.add(dotIndicatorSettingPanel, BorderLayout.CENTER);
this.add(tableConfigJPanel, BorderLayout.CENTER);
tabSlideCheck.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
showTabDotIndicatorCheck.setVisible(tabSlideCheck.isSelected());
dotIndicatorSettingPanel.setVisible(tabSlideCheck.isSelected() && showTabDotIndicatorCheck.isSelected());
}
});
showTabDotIndicatorCheck.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {

Loading…
Cancel
Save