Browse Source

Merge branch 'feature/10.0' of http://cloud.finedevelop.com:2015/scm/~harrison/design into feature/10.0

research/11.0
Harrison 5 years ago
parent
commit
ae191cba9a
  1. 2
      designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/SpecialUIButton.java
  3. 1
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java
  4. 8
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java
  5. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java
  6. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIPasswordField.java
  7. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIPreviewButton.java
  8. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UITabButton.java
  9. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java
  10. 18
      designer-base/src/main/java/com/fr/design/gui/icombobox/ComboCheckBox.java
  11. 1
      designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java
  12. 10
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  13. 22
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java
  14. 2
      designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java
  15. 3
      designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java
  16. 4
      designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java
  17. 4
      designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java
  18. 21
      designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java
  19. 16
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java
  20. 29
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java
  21. 8
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java
  22. 8
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java
  23. 9
      designer-chart/src/main/java/com/fr/design/chartx/component/CategorySeriesFilterPane.java
  24. 1
      designer-chart/src/main/java/com/fr/design/chartx/component/MultiComboBoxPane.java
  25. 17
      designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java
  26. 3
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelCellDataFieldsPane.java
  27. 1
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java
  28. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeCellDataFieldsPane.java
  29. 6
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java
  30. 12
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java
  31. 10
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiPieDataSetFieldsPane.java
  32. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/ScatterCellDataFieldsPane.java
  33. 10
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/ScatterDataSetFieldsPane.java
  34. 1
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java
  35. 1
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudDataSetFieldsPane.java
  36. 6
      designer-chart/src/main/java/com/fr/design/chartx/single/CellDataPane.java
  37. 12
      designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java
  38. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  39. 5
      designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java
  40. 22
      designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java
  41. 21
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java
  42. 7
      designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java
  43. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  44. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  45. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  46. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java
  47. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java
  48. 16
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  49. 8
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java
  50. 14
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/type/VanChartFunnelTypePane.java
  51. 8
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/type/VanChartGanttPlotPane.java
  52. 24
      designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java
  53. 26
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugePlotPane.java
  54. 7
      designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java
  55. 8
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java
  56. 15
      designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java
  57. 8
      designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPane.java
  58. 14
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java
  59. 13
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java
  60. 33
      designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java
  61. 14
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/type/VanChartWordCloudTypePane.java
  62. 1
      designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java

2
designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java

@ -330,7 +330,9 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
g.drawLine(x + 1, y + h - 2, x + w - 3, y + h - 2); // bottom
}
@Override
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) {
// do nothing
}
/**

2
designer-base/src/main/java/com/fr/design/gui/ibutton/SpecialUIButton.java

@ -25,6 +25,8 @@ public class SpecialUIButton extends JButton {
*
* @see javax.swing.AbstractButton#setUI(ButtonUI)
*/
@Override
public void setUI(ButtonUI ui) {
// do nothing
}
}

1
designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java

@ -43,6 +43,7 @@ public class UIBasicButtonUI extends MetalButtonUI {
private boolean isDefault;
public UIBasicButtonUI() {
// do nothing
}
/**

8
designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java

@ -36,7 +36,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G
private EventListenerList colorChangeListenerList = new EventListenerList();
private boolean isEventBanned = false;
private String colorButtonName = "";
private UIObserverListener uiObserverListener;
private UIObserverListener uiColorObserverListener;
private GlobalNameListener globalNameListener = null;
public UIColorButton() {
@ -60,13 +60,13 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G
this.addColorChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (uiObserverListener == null) {
if (uiColorObserverListener == null) {
return;
}
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(colorButtonName);
}
uiObserverListener.doChange();
uiColorObserverListener.doChange();
}
});
}
@ -199,7 +199,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G
* @param listener 观察者监听事件
*/
public void registerChangeListener(UIObserverListener listener) {
uiObserverListener = listener;
uiColorObserverListener = listener;
}
/**

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java

@ -25,7 +25,7 @@ public class UIHeadGroup extends JPanel {
protected int selectedIndex = -1;
protected void tabChanged(int newSelectedIndex) {
// do nothing
}
public UIHeadGroup(String[] textArray) {

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIPasswordField.java

@ -1 +1 @@
package com.fr.design.gui.ibutton; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import javax.swing.*; /** * Author : Shockway * Date: 13-10-21 * Time: 下午3:23 */ public class UIPasswordField extends JPasswordField implements UIObserver { public void registerChangeListener(UIObserverListener listener) { } public boolean shouldResponseChangeListener() { return false; } }
package com.fr.design.gui.ibutton; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import javax.swing.*; /** * Author : Shockway * Date: 13-10-21 * Time: 下午3:23 */ public class UIPasswordField extends JPasswordField implements UIObserver { public void registerChangeListener(UIObserverListener listener) { // do nothing } public boolean shouldResponseChangeListener() { return false; } }

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIPreviewButton.java

@ -1 +1 @@
package com.fr.design.gui.ibutton; import com.fr.design.constants.UIConstants; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * Author : daisy * Date: 13-8-1 * Time: 下午3:41 */ public class UIPreviewButton extends JPanel { private static final int START_X = -7; protected UIButton upButton; protected UIButton downButton; protected void upButtonClickEvent() { } protected void downButtonClickEvent() { } public UIPreviewButton() { this(new UIButton(), new UIButton()); } public UIPreviewButton(UIButton up, UIButton down) { upButton = up; downButton = down; upButton.setRoundBorder(true, Constants.CENTER); downButton.setRoundBorder(true, Constants.CENTER); upButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { downButton.getModel().setPressed(true); downButton.getModel().setSelected(true); downButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { downButton.getModel().setPressed(false); downButton.getModel().setSelected(false); downButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { upButtonClickEvent(); } }); downButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { upButton.getModel().setPressed(true); upButton.getModel().setSelected(true); upButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { upButton.getModel().setPressed(false); upButton.getModel().setSelected(false); upButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { downButtonClickEvent(); } }); this.setLayout(new FlowLayout(FlowLayout.CENTER,5,0)); this.add(upButton); this.add(downButton); } public UIPreviewButton(Icon left, Icon right) { this(); upButton.setIcon(left); downButton.setIcon(right); } public UIButton getUpButton() { return upButton; } public void setExtraPainted(boolean isExtraPainted) { if (!isExtraPainted) { upButton.setBackground(null); downButton.setBackground(null); upButton.setOpaque(false); downButton.setOpaque(false); } } public UIButton getDownButton() { return downButton; } public void set4Toolbar() { upButton.setNormalPainted(false); downButton.setNormalPainted(false); upButton.setBorderPaintedOnlyWhenPressed(true); downButton.setBorderPaintedOnlyWhenPressed(true); } protected void showPopWindow(JPopupMenu menu) { GUICoreUtils.showPopupMenu(menu, this, START_X, getY() + getHeight() - 3); } public static void main(String... args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel content = (JPanel) jf.getContentPane(); content.setLayout(null); UIPreviewButton bb = new UIPreviewButton(UIConstants.PAGE_BIG_ICON, UIConstants.PREVIEW_DOWN); bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height); content.add(bb); GUICoreUtils.centerWindow(jf); jf.setSize(100, 100); jf.setVisible(true); } }
package com.fr.design.gui.ibutton; import com.fr.design.constants.UIConstants; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * Author : daisy * Date: 13-8-1 * Time: 下午3:41 */ public class UIPreviewButton extends JPanel { private static final int START_X = -7; protected UIButton upButton; protected UIButton downButton; protected void upButtonClickEvent() { // do nothing } protected void downButtonClickEvent() { // do nothing } public UIPreviewButton() { this(new UIButton(), new UIButton()); } public UIPreviewButton(UIButton up, UIButton down) { upButton = up; downButton = down; upButton.setRoundBorder(true, Constants.CENTER); downButton.setRoundBorder(true, Constants.CENTER); upButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { downButton.getModel().setPressed(true); downButton.getModel().setSelected(true); downButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { downButton.getModel().setPressed(false); downButton.getModel().setSelected(false); downButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { upButtonClickEvent(); } }); downButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { upButton.getModel().setPressed(true); upButton.getModel().setSelected(true); upButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { upButton.getModel().setPressed(false); upButton.getModel().setSelected(false); upButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { downButtonClickEvent(); } }); this.setLayout(new FlowLayout(FlowLayout.CENTER,5,0)); this.add(upButton); this.add(downButton); } public UIPreviewButton(Icon left, Icon right) { this(); upButton.setIcon(left); downButton.setIcon(right); } public UIButton getUpButton() { return upButton; } public void setExtraPainted(boolean isExtraPainted) { if (!isExtraPainted) { upButton.setBackground(null); downButton.setBackground(null); upButton.setOpaque(false); downButton.setOpaque(false); } } public UIButton getDownButton() { return downButton; } public void set4Toolbar() { upButton.setNormalPainted(false); downButton.setNormalPainted(false); upButton.setBorderPaintedOnlyWhenPressed(true); downButton.setBorderPaintedOnlyWhenPressed(true); } protected void showPopWindow(JPopupMenu menu) { GUICoreUtils.showPopupMenu(menu, this, START_X, getY() + getHeight() - 3); } public static void main(String... args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel content = (JPanel) jf.getContentPane(); content.setLayout(null); UIPreviewButton bb = new UIPreviewButton(UIConstants.PAGE_BIG_ICON, UIConstants.PREVIEW_DOWN); bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height); content.add(bb); GUICoreUtils.centerWindow(jf); jf.setSize(100, 100); jf.setVisible(true); } }

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UITabButton.java

@ -175,7 +175,7 @@ public class UITabButton extends UILabel implements UISelectedComponent {
}
protected void paintOther(Graphics2D g2d, int w, int h) {
// do nothing
}
}

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java

@ -187,7 +187,7 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
@Override
protected void fireStateChanged() {
// do nothing
}

18
designer-base/src/main/java/com/fr/design/gui/icombobox/ComboCheckBox.java

@ -77,8 +77,8 @@ public class ComboCheckBox extends UIComboBox {
protected ComboCheckBox comboBox;
protected JScrollPane scrollPane;
protected MouseListener mouseListener;
protected MouseMotionListener mouseMotionListener;
protected MouseListener checkListMouseListener;
protected MouseMotionListener checkListMouseMotionListener;
public CheckListPopup(JComboBox comboBox) {
this.comboBox = (ComboCheckBox) comboBox;
@ -157,22 +157,22 @@ public class ComboCheckBox extends UIComboBox {
@Override
public MouseListener getMouseListener() {
if (mouseListener == null) {
mouseListener = new InvocationMouseHandler();
if (checkListMouseListener == null) {
checkListMouseListener = new InvocationMouseHandler();
}
return mouseListener;
return checkListMouseListener;
}
public MouseMotionListener getMouseMotionListener() {
if (mouseMotionListener == null) {
mouseMotionListener = new MouseMotionAdapter() {
if (checkListMouseMotionListener == null) {
checkListMouseMotionListener = new MouseMotionAdapter() {
};
}
return mouseMotionListener;
return checkListMouseMotionListener;
}
public void uninstallingUI() {
// do nothing
}
protected class InvocationMouseHandler extends MouseAdapter {

1
designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java

@ -318,6 +318,7 @@ public class FRTreeComboBox extends UIComboBox {
@Override
public void mouseClicked(MouseEvent e) {
// do nothing
}
@Override

10
designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -1,12 +1,11 @@
package com.fr.design.gui.icontainer;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
import javax.swing.*;
import java.awt.*;
@ -174,6 +173,7 @@ public class UIEastResizableContainer extends JPanel {
@Override
public void addLayoutComponent(String name, Component comp) {
// do nothing
}
};
@ -238,6 +238,7 @@ public class UIEastResizableContainer extends JPanel {
* 伸缩右子面板时触发此方法
*/
public void onResize() {
// do nothing here
}
private class TopToolPane extends JPanel {
@ -261,6 +262,7 @@ public class UIEastResizableContainer extends JPanel {
@Override
public void mouseDragged(MouseEvent e) {
// do nothing
}
});
addMouseListener(new MouseAdapter() {
@ -282,7 +284,7 @@ public class UIEastResizableContainer extends JPanel {
}
onResize();
refreshContainer();
if (DesignerMode.isAuthorityEditing()) {
if (DesignModeContext.isAuthorityEditing()) {
DesignerContext.getDesignerFrame().doResize();
}
}

22
designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java

@ -1,6 +1,7 @@
package com.fr.design.gui.icontainer;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
@ -85,7 +86,7 @@ public class UIModeControlContainer extends JLayeredPane {
public void needToShowCoverAndHidPane() {
if (DesignerMode.isAuthorityEditing()) {
if (DesignModeContext.isAuthorityEditing()) {
this.remove(coverPane);
this.remove(hidePane);
} else {
@ -128,7 +129,7 @@ public class UIModeControlContainer extends JLayeredPane {
if (isHideMode || !upEditMode) {
return;
}
if (DesignerMode.isAuthorityEditing()) {
if (DesignModeContext.isAuthorityEditing()) {
return;
}
setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
@ -151,11 +152,12 @@ public class UIModeControlContainer extends JLayeredPane {
MouseMotionListener mouseMotionListener = new MouseMotionListener() {
@Override
public void mouseMoved(MouseEvent e) {
//do nothing
}
@Override
public void mouseDragged(MouseEvent e) {
if (DesignerMode.isAuthorityEditing()) {
if (DesignModeContext.isAuthorityEditing()) {
return;
}
boolean notUpEditMode = isHideMode || !upEditMode;
@ -174,7 +176,7 @@ public class UIModeControlContainer extends JLayeredPane {
@Override
public void removeLayoutComponent(Component comp) {
//do nothing
}
@Override
@ -234,11 +236,12 @@ public class UIModeControlContainer extends JLayeredPane {
@Override
public void addLayoutComponent(String name, Component comp) {
// do nothing
}
};
protected void onModeChanged() {
//do nothing here
}
/**
@ -309,7 +312,7 @@ public class UIModeControlContainer extends JLayeredPane {
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// do nothing
}
});
}
@ -319,6 +322,7 @@ public class UIModeControlContainer extends JLayeredPane {
@Override
public void removeLayoutComponent(Component comp) {
// do nothing
}
@Override
@ -333,10 +337,12 @@ public class UIModeControlContainer extends JLayeredPane {
@Override
public void layoutContainer(Container parent) {
// do nothing
}
@Override
public void addLayoutComponent(String name, Component comp) {
// do nothing
}
};
@ -366,7 +372,7 @@ public class UIModeControlContainer extends JLayeredPane {
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// do nothing
}
});
@ -407,6 +413,7 @@ public class UIModeControlContainer extends JLayeredPane {
@Override
public void removeLayoutComponent(Component comp) {
// do nothing
}
@Override
@ -437,6 +444,7 @@ public class UIModeControlContainer extends JLayeredPane {
@Override
public void addLayoutComponent(String name, Component comp) {
// do nothing
}
};

2
designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java

@ -562,7 +562,7 @@ public class FRGUIPaneFactory {
double n = (double)(width + WIDTH_OFFSET_N ) / (double)WIDTH_PARA_F;
double i = Math.abs(((double) ((int) m + (int) (m + 1)) / WIDTHABS_PARA_F) - m);
double j = Math.abs(((double) ((int) n + (int) (n + 1)) / WIDTHABS_PARA_F) - n);
double x = i > j ? i : j;
double x = Math.max(i,j);
if (AssistUtils.equals(x, i)) {
w = (int) (Math.round(m) * WIDTH_PARA_INT - WIDTH_OFFSET_M);
} else if (AssistUtils.equals(x, j)) {

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

@ -372,7 +372,8 @@ public class TableLayoutHelper {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
JPanel jp1 = TableLayoutHelper.createTableLayoutPane(createTestComponents("jp1"), TableLayoutHelper.FILL_NONE);
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp2"), TableLayoutHelper.FILL_LASTCOL_AND_ROW, (double)2 * TEN, (double)2 * TEN);
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp2"),
TableLayoutHelper.FILL_LASTCOL_AND_ROW, (double)2 * TEN, (double)2 * TEN);
JPanel jp3 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp3"),
new double[]{f, p, f, p}, new double[]{f, f}, 4, 4);
JPanel jp4 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp4"),

4
designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java

@ -54,7 +54,7 @@ public class TemplateInfoTest {
TemplateInfo templateInfo = TemplateInfo.newInstance(templateID);
assertEquals(templateID, templateInfo.getTemplateID());
assertEquals(StringUtils.EMPTY, Reflect.on(templateInfo).field("originID").get());
assertEquals(0, Reflect.on(templateInfo).field("idleDayCount").get());
assertEquals(0, (int) Reflect.on(templateInfo).field("idleDayCount").get());
assertEquals("{}", templateInfo.getProcessMapJsonString());
Map<String, Object> consumingMap = Reflect.on(templateInfo).field("consumingMap").get();
@ -77,7 +77,7 @@ public class TemplateInfoTest {
TemplateInfo templateInfo = TemplateInfo.newInstance(templateID, originID, originTime);
assertEquals(templateID, templateInfo.getTemplateID());
assertEquals(originID, Reflect.on(templateInfo).field("originID").get());
assertEquals(0, Reflect.on(templateInfo).field("idleDayCount").get());
assertEquals(0, (int) Reflect.on(templateInfo).field("idleDayCount").get());
assertEquals("{}", templateInfo.getProcessMapJsonString());
Map<String, Object> consumingMap = Reflect.on(templateInfo).field("consumingMap").get();

4
designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java

@ -7,9 +7,9 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.stable.AssistUtils;
import java.awt.BorderLayout;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.awt.BorderLayout;
/**
* Created by shine on 2019/4/15.
@ -45,9 +45,7 @@ public abstract class AbstractChartDataPane<T extends ChartDataDefinitionProvide
ChartDataDefinitionProvider dataSetCollection = vanChart.getChartDataDefinition();
if (isMatchedDataType(dataSetCollection)) {
populate((T) dataSetCollection);
}
this.initAllListeners();
this.validate();

21
designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java

@ -3,6 +3,8 @@ package com.fr.design.chartx;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.CustomChartDataDefinition;
import com.fr.design.chartx.fields.diff.FunnelCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.FunnelDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.GaugeCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.GaugeDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane;
@ -41,6 +43,9 @@ import java.util.Map;
*/
public class CustomChartDataPane extends ChartDataPane {
private static final int HGAP = 0;
private static final int VGAP = 6;
public CustomChartDataPane(AttributeChangeListener listener) {
super(listener);
}
@ -92,10 +97,18 @@ public class CustomChartDataPane extends ChartDataPane {
case SCATTER:
case BUBBLE:
return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane());
case PIE:
case SAME_PIE:
case DIFFERENT_PIE:
case POINTER_180:
case POINTER_360:
return new SingleDataPane(new FunnelDataSetFieldsPane(), new FunnelCellDataFieldsPane());
default:
return StringUtils.equals(CustomStyle.CUSTOM.toString(), plot.getCustomType()) ?
new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane()) :
new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
if (StringUtils.equals(CustomStyle.CUSTOM.toString(), plot.getCustomType())){
return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
} else {
return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
}
}
}
@ -147,7 +160,7 @@ public class CustomChartDataPane extends ChartDataPane {
JPanel tabPanel = new JPanel(new BorderLayout());
tabPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, getBackground()));
tabPanel.add(tabPane, BorderLayout.CENTER);
this.setLayout(new BorderLayout(0, 6));
this.setLayout(new BorderLayout(HGAP, VGAP));
this.add(tabPanel, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
}

16
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java

@ -22,11 +22,13 @@ import com.fr.stable.StringUtils;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
/**
* Created by shine on 2018/9/12.
@ -148,9 +150,18 @@ public abstract class AbstractCustomFieldComboBoxPane<T> extends UIComboBoxPane<
private void initComponents() {
series = new UIComboBox();
value = valueComboBoxHasNone() ? new UIComboBoxWithNone() : new UIComboBox();
value.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
function.setEnabled(value.getSelectedItem() != null);
}
});
function = new CalculateComboBox();
function.setEnabled(false);
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name"), SwingConstants.LEFT), series},
@ -171,7 +182,6 @@ public abstract class AbstractCustomFieldComboBoxPane<T> extends UIComboBoxPane<
public void checkBoxUse(boolean hasUse) {
series.setEnabled(hasUse);
value.setEnabled(hasUse);
function.setEnabled(hasUse);
}
public void clearAllBoxList() {

29
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java

@ -10,13 +10,13 @@ import com.fr.general.IOUtils;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
/**
@ -34,6 +34,7 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
private List<T> categoryComponentList = new ArrayList<T>();
private boolean categoryAxis = true;
protected abstract T createFirstFieldComponent();
@ -43,6 +44,16 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
protected abstract void updateField(T component, ColumnField field);
public void setCategoryAxis(boolean categoryAxis) {
this.categoryAxis = categoryAxis;
if(!categoryAxis){
addButton.setEnabled(false);
for (JComponent component : categoryComponentList) {
component.setEnabled(false);
}
}
}
public AbstractMultiComponentPane() {
UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category"));
@ -126,7 +137,7 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
}
private boolean canAdd() {
return categoryComponentList.size() < 2;
return categoryComponentList.size() < 2 && categoryAxis;
}
public List<T> componentList() {
@ -168,4 +179,16 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
updateField(comboBox, temp);
}
}
public void checkEnable(boolean hasUse) {
//增加按钮是否灰化要根据是否选择了数据源,是否分类轴,分类数量是否超标三个判断
boolean buttonUse = hasUse && categoryAxis && categoryComponentList.size() < 2;
//额外的分类是否灰化根据是否选择了数据源,是否分类轴判断
boolean categoryUse = hasUse && categoryAxis;
addButton.setEnabled(buttonUse);
for (JComponent component : categoryComponentList) {
component.setEnabled(categoryUse);
}
}
}

8
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java

@ -11,10 +11,10 @@ import com.fr.stable.AssistUtils;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* Created by shine on 2019/6/18.
@ -148,4 +148,8 @@ public abstract class AbstractMultiComponentPaneWithUISpinner<T extends JCompone
updateField(comboBox, temp);
}
}
public void checkEnable(boolean hasUse){
levelNumSpinner.setEnabled(hasUse);
}
}

8
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java

@ -76,7 +76,7 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
JPanel panel1 = new JPanel(new BorderLayout());
JPanel panel2 = new JPanel(new BorderLayout());
panel1.add(useTopCheckBox, BorderLayout.NORTH);
topNumTextField = new UITextField();
topNumTextField = new UITextField("0");
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
mergeOtherCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
mergeOtherCheckBox.setSelected(true);
@ -108,7 +108,11 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
fire();
}
};
JPanel presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present"), present);
JPanel presentPane = new JPanel(new BorderLayout(30, 0));
presentPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present")), BorderLayout.WEST);
presentPane.add(present,BorderLayout.CENTER);
presentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
panel2.add(presentPane, BorderLayout.SOUTH);
double[] column = {f};

9
designer-chart/src/main/java/com/fr/design/chartx/component/CategorySeriesFilterPane.java

@ -8,9 +8,10 @@ import com.fr.design.i18n.Toolkit;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.map.designer.VanChartGroupPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.List;
import java.awt.BorderLayout;
/**
* @author shine
@ -36,14 +37,14 @@ public class CategorySeriesFilterPane extends JPanel {
}
};
JPanel groupPane = new VanChartGroupPane(new String[]{seriesFilterPane.title4PopupWindow(), categoryFilterPane.title4PopupWindow()}
, new JPanel[]{seriesFilterPane, categoryFilterPane}) {
JPanel groupPane = new VanChartGroupPane(new String[]{categoryFilterPane.title4PopupWindow(), seriesFilterPane.title4PopupWindow()}
, new JPanel[]{categoryFilterPane, seriesFilterPane}) {
};
JPanel contentPane = new JPanel(new BorderLayout());
contentPane.add(new JPanel(), BorderLayout.NORTH);
contentPane.add(groupPane, BorderLayout.CENTER);
groupPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
this.setLayout(new BorderLayout());
this.add(TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), contentPane), BorderLayout.CENTER);
}

1
designer-chart/src/main/java/com/fr/design/chartx/component/MultiComboBoxPane.java

@ -14,6 +14,7 @@ import java.util.List;
public class MultiComboBoxPane extends AbstractMultiComponentPane<UIComboBox> {
private List currentBoxItems = new ArrayList();
public void setCurrentBoxItems(List currentBoxItems) {
this.currentBoxItems = currentBoxItems;
}

17
designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java

@ -17,10 +17,12 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.Arrays;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import static com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper.refreshBoxItems;
@ -95,7 +97,7 @@ public abstract class AbstractDataSetFieldsPane<T extends AbstractColumnFieldCol
protected abstract UIComboBox[] filedComboBoxes();
public void checkBoxUse(boolean hasUse) {
for (Component component : fieldComponents()) {
for (Component component : filedComboBoxes()) {
component.setEnabled(hasUse);
}
}
@ -145,4 +147,13 @@ public abstract class AbstractDataSetFieldsPane<T extends AbstractColumnFieldCol
return StringUtils.EMPTY;
}
public void initValueAndCalComboBox(final UIComboBox value, final CalculateComboBox function) {
value.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
function.setEnabled(value.getSelectedItem() != null);
}
});
function.setEnabled(false);
}
}

3
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelCellDataFieldsPane.java

@ -13,6 +13,7 @@ import java.awt.BorderLayout;
/**
* Created by Wim on 2019/10/23.
* 饼图多指针仪表盘 在组合图中 没有分类配置项, 也用这个
*/
public class FunnelCellDataFieldsPane extends AbstractCellDataFieldsWithSeriesValuePane<ColumnFieldCollectionWithSeriesValue> {
@ -54,7 +55,7 @@ public class FunnelCellDataFieldsPane extends AbstractCellDataFieldsWithSeriesVa
ColumnFieldCollectionWithSeriesValue fieldCollection = new ColumnFieldCollectionWithSeriesValue();
updateSeriesValuePane(fieldCollection);
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = fieldCollection.getSeriesValueCorrelationDefinition();
filterPane.updateBean(seriesValueCorrelationDefinition.getFilterProperties());
seriesValueCorrelationDefinition.setFilterProperties(filterPane.updateBean());
return fieldCollection;
}

1
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java

@ -14,6 +14,7 @@ import java.awt.BorderLayout;
/**
* Created by Wim on 2019/10/23.
* 饼图多指针仪表盘 在组合图中 没有分类配置项, 也用这个
*/
public class FunnelDataSetFieldsPane extends AbstractDataSetFieldsWithSeriesValuePane<ColumnFieldCollectionWithSeriesValue> {

2
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeCellDataFieldsPane.java

@ -69,7 +69,7 @@ public class GaugeCellDataFieldsPane extends AbstractCellDataFieldsPane<GaugeCol
GaugeColumnFieldCollection gauge = new GaugeColumnFieldCollection();
updateField(category, gauge.getCategory());
updateField(value, gauge.getValue());
filterPane.updateBean(gauge.getCategory().getFilterProperties());
gauge.getCategory().setFilterProperties(filterPane.updateBean());
return gauge;
}

6
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java

@ -8,8 +8,8 @@ import com.fr.design.formula.TinyFormulaPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.List;
import java.awt.BorderLayout;
/**
* Created by shine on 2019/4/12.
@ -72,4 +72,8 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS
return fieldCollection;
}
public void setCategoryAxis(boolean categoryAxis){
multiCategoryPane.setCategoryAxis(categoryAxis);
}
}

12
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java

@ -9,8 +9,8 @@ import com.fr.design.gui.icombobox.UIComboBox;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.util.List;
import java.awt.BorderLayout;
/**
@ -49,6 +49,12 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer
return list.toArray(new UIComboBox[list.size()]);
}
@Override
public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse);
multiCategoryPane.checkEnable(hasUse);
}
@Override
public void refreshBoxListWithSelectTableData(List columnNameList) {
super.refreshBoxListWithSelectTableData(columnNameList);
@ -80,4 +86,8 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer
return columnFieldCollection;
}
public void setCategoryAxis(boolean categoryAxis){
multiCategoryPane.setCategoryAxis(categoryAxis);
}
}

10
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiPieDataSetFieldsPane.java

@ -16,9 +16,9 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.SwingConstants;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.List;
/**
* Created by shine on 2019/6/18.
@ -38,6 +38,8 @@ public class MultiPieDataSetFieldsPane extends AbstractDataSetFieldsPane<MultiPi
levelComboBoxPane = new MultiComboBoxPaneWithUISpinner();
value = new UIComboBox();
function = new CalculateComboBox();
initValueAndCalComboBox(value, function);
super.initComponents();
}
@ -90,6 +92,12 @@ public class MultiPieDataSetFieldsPane extends AbstractDataSetFieldsPane<MultiPi
return result;
}
@Override
public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse);
levelComboBoxPane.checkEnable(hasUse);
}
@Override
public void refreshBoxListWithSelectTableData(List columnNameList) {
super.refreshBoxListWithSelectTableData(columnNameList);

2
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/ScatterCellDataFieldsPane.java

@ -76,11 +76,13 @@ public class ScatterCellDataFieldsPane extends AbstractCellDataFieldsPane<Bubble
public BubbleColumnFieldCollection updateBean() {
BubbleColumnFieldCollection collection = new BubbleColumnFieldCollection();
seriesXYValueCorrelationPane.updateBean(collection);
collection.setFilterProperties(filterPane.updateBean());
return collection;
}
@Override
public void populateBean(BubbleColumnFieldCollection ob) {
seriesXYValueCorrelationPane.populateBean(ob);
filterPane.populateBean(ob.getFilterProperties());
}
}

10
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/ScatterDataSetFieldsPane.java

@ -75,22 +75,26 @@ public class ScatterDataSetFieldsPane extends AbstractDataSetFieldsPane<BubbleCo
@Override
public BubbleColumnFieldCollection updateBean() {
BubbleColumnFieldCollection collection = new BubbleColumnFieldCollection();
BubbleColumnField field = collection.getBubbleColumnField(0);
BubbleColumnField field = new BubbleColumnField();
updateField(series, field.getSeriesName());
updateField(xField, field.getXField());
updateField(yField, field.getYField());
updateField(size, field.getSizeField());
field.getSeriesName().setFilterProperties(filterPane.updateBean());
collection.setFilterProperties(filterPane.updateBean());
collection.add(field);
return collection;
}
@Override
public void populateBean(BubbleColumnFieldCollection ob) {
if (ob.getList().isEmpty()){
return;
}
BubbleColumnField field = ob.getBubbleColumnField(0);
populateField(series, field.getSeriesName());
populateField(xField, field.getXField());
populateField(yField, field.getYField());
populateField(size, field.getSizeField());
filterPane.populateBean(field.getSeriesName().getFilterProperties());
filterPane.populateBean(ob.getFilterProperties());
}
}

1
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java

@ -32,6 +32,7 @@ public class StructureDataSetFieldsPane extends AbstractDataSetFieldsPane<Struct
nodeValue = new UIComboBox();
calculateCombox = new CalculateComboBox();
initValueAndCalComboBox(nodeValue, calculateCombox);
super.initComponents();
}

1
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudDataSetFieldsPane.java

@ -25,6 +25,7 @@ public class WordCloudDataSetFieldsPane extends AbstractDataSetFieldsPane<WordCl
wordValue = new UIComboBox();
calculateCombox = new CalculateComboBox();
initValueAndCalComboBox(wordValue, calculateCombox);
super.initComponents();
}

6
designer-chart/src/main/java/com/fr/design/chartx/single/CellDataPane.java

@ -4,11 +4,8 @@ import com.fr.chartx.data.CellDataDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chartx.fields.AbstractCellDataFieldsPane;
import com.fr.design.i18n.Toolkit;
import com.fr.stable.AssistUtils;
import java.awt.BorderLayout;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
/**
* Created by shine on 2019/5/21.
@ -51,11 +48,8 @@ public class CellDataPane extends FurtherBasicBeanPane<CellDataDefinition> {
return;
}
Type dataType = ((ParameterizedType) cellDataFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0];
if (AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) {
cellDataFieldsPane.populateBean(ob.getColumnFieldCollection());
}
}
@Override
public CellDataDefinition updateBean() {

12
designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java

@ -11,13 +11,10 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.stable.AssistUtils;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
/**
* Created by shine on 2019/5/21.
@ -53,6 +50,7 @@ public class DataSetPane extends FurtherBasicBeanPane<DataSetDefinition> {
this.setLayout(new BorderLayout());
this.add(tableDataPane, BorderLayout.NORTH);
this.add(dataSetFieldsPane, BorderLayout.CENTER);
checkBoxUse();
}
/**
@ -105,14 +103,12 @@ public class DataSetPane extends FurtherBasicBeanPane<DataSetDefinition> {
}
refreshBoxList();
checkBoxUse();
tableDataPane.populateBean(ob.getNameTableData());
Type dataType = ((ParameterizedType) dataSetFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0];
if (AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) {
dataSetFieldsPane.populateBean(ob.getColumnFieldCollection());
}
checkBoxUse();
}
@Override

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -25,6 +25,9 @@ import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
@ -41,9 +44,6 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
/**
* 图表 类型 增删 控制按钮界面.
@ -438,6 +438,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
private void changeChartName(String name) {
this.setText(name);
this.setToolTipText(name);
buttonName = name;
}

5
designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java

@ -14,6 +14,11 @@ public class UIComboBoxWithNone extends UIComboBox {
return Toolkit.i18nText("Fine-Design_Chart_Use_None");
}
public UIComboBoxWithNone() {
super();
addDefaultItem();
}
@Override
public void refreshBoxItems(List list) {
super.refreshBoxItems(list);

22
designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java

@ -1,7 +1,6 @@
package com.fr.van.chart.bubble;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
@ -21,7 +20,6 @@ import com.fr.design.mainframe.chart.gui.data.report.BubblePlotReportDataContent
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.bubble.data.VanChartBubblePlotTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane;
@ -127,24 +125,12 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
VanChartBubblePlot plot;
@Override
public void populate(ChartCollection collection) {
if (collection == null) {
return;
}
VanChart chart = collection.getSelectedChartProvider(VanChart.class);
if (chart == null) {
return;
}
plot = chart.getPlot();
super.populate(collection);
}
@Override
protected SingleDataPane createSingleDataPane() {
VanChartBubblePlot plot = null;
if (getVanChart() != null) {
plot = getVanChart().getPlot();
}
if (plot != null && plot.isForceBubble()) {
return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
}

21
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java

@ -7,7 +7,13 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.attr.ZoomAttribute;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.BubbleColumnFieldCollection;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.bubble.BubbleIndependentVanChart;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
@ -112,6 +118,7 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
/**
* 气泡图相同图表类型之间切换的时候chart的部分属性也需要重置
*
* @param chart
*/
@Override
@ -120,4 +127,18 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
//重置监控刷新选项
resetRefreshMoreLabelAttr((VanChart) chart);
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if (definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
boolean isForce = ((VanChartBubblePlot) vanChartPlot).isForceBubble();
if (isForce) {
return columnFieldCollection instanceof MultiCategoryColumnFieldCollection;
}
return columnFieldCollection instanceof BubbleColumnFieldCollection;
}
return false;
}
}

7
designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java

@ -7,11 +7,13 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.CustomChartDataDefinition;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.custom.CustomDefinition;
@ -295,4 +297,9 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
}
}
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
return definition instanceof CustomDefinition;
}
}

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -176,7 +176,7 @@ public class VanChartPlotLegendPane extends BasicPane {
initPositionListener();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), panel);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel);
}
private void initPositionListener(){

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -160,7 +160,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
initPositionListener();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout"), panel);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel);
}
private JPanel createTitleStylePane(){

6
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -118,7 +118,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
new Component[]{createLabelPane(new double[]{p, p}, column), null},
new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null},
new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null},
new Component[]{createDisplayStrategy(new double[]{p, p, p}, columnSize), null},
new Component[]{createDisplayStrategy(), null},
new Component[]{createValueStylePane(), null},
};
@ -326,7 +326,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
}
}
protected JPanel createDisplayStrategy(double[] row, double[] col){
protected JPanel createDisplayStrategy(){
limitPane = new LimitPane();
return limitPane;
}
@ -385,8 +385,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected void checkAllUse() {
checkCardPane();
checkLabelPane();
if (limitPane != null){
limitPane.checkMaxProPortionUse();
}
}
protected void checkCardPane() {
if(centerPane != null && valueFormatStyle != null){

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java

@ -73,7 +73,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
new Component[]{createValueDefinition(),null},
new Component[]{createLineStylePane(new double[]{p, p,p,p,p}, columnSize),null},
new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis),null},
new Component[]{createDisplayStrategy(new double[]{p, p,p}, columnSize),null},
new Component[]{createDisplayStrategy(),null},
new Component[]{createValueStylePane(),null},
};

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java

@ -54,7 +54,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
new Component[]{createMinMaxValuePane(new double[]{p, p}, columnSize), null},
new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null},
new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null},
new Component[]{createDisplayStrategy(new double[]{p, p, p}, columnSize), null},
new Component[]{createDisplayStrategy(), null},
new Component[]{createValueStylePane(), null},
};

16
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -8,6 +8,10 @@ import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chart.chartglyph.DataSheet;
import com.fr.chartx.attr.ZoomAttribute;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.MultilineLabel;
@ -107,6 +111,18 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Cha
newPlot.setCategoryNum(oldPlot.getCategoryNum());
}
if(chart instanceof VanChart
&& !acceptDefinition(((VanChart) chart).getChartDataDefinition(), newPlot)) {
((VanChart) chart).setChartDataDefinition(null);
}
}
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if(definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection instanceof MultiCategoryColumnFieldCollection;
}
return false;
}
protected void resetChartAttr4SamePlot(Chart chart){

8
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java

@ -2,9 +2,12 @@ package com.fr.van.chart.drillmap.designer.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChart;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.drillmap.data.DrillMapDefinition;
import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.type.ZoomLevel;
import com.fr.van.chart.map.designer.type.VanChartMapPlotPane;
@ -66,4 +69,9 @@ public class VanChartDrillMapPlotPane extends VanChartMapPlotPane {
drillMapPlot.setLayerLevelList(new ArrayList<ZoomLevel>());
drillMapPlot.setLayerMapTypeList(new ArrayList<MapType>());
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
return definition instanceof DrillMapDefinition;
}
}

14
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/type/VanChartFunnelTypePane.java

@ -2,7 +2,12 @@ package com.fr.van.chart.funnel.designer.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.ColumnFieldCollectionWithSeriesValue;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.funnel.FunnelIndependentVanChart;
import com.fr.plugin.chart.funnel.VanChartFunnelPlot;
@ -43,4 +48,13 @@ public class VanChartFunnelTypePane extends AbstractVanChartTypePane {
public Chart getDefaultChart() {
return FunnelIndependentVanChart.FunnelVanChartTypes[0];
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if (definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection.getClass().equals(ColumnFieldCollectionWithSeriesValue.class);
}
return false;
}
}

8
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/type/VanChartGanttPlotPane.java

@ -2,7 +2,10 @@ package com.fr.van.chart.gantt.designer.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.GanttChartDataDefinition;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.gantt.GanttIndependentVanChart;
import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -33,4 +36,9 @@ public class VanChartGanttPlotPane extends AbstractVanChartTypePane {
}
return cloned;
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
return definition instanceof GanttChartDataDefinition;
}
}

24
designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java

@ -1,6 +1,5 @@
package com.fr.van.chart.gauge;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
@ -22,7 +21,6 @@ import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContent
import com.fr.design.mainframe.chart.gui.data.table.MeterPlotTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.custom.component.CategoryCustomPlotTableDataContentPane;
import com.fr.van.chart.custom.component.MeterCustomPlotReportDataContentPane;
import com.fr.van.chart.custom.component.MeterCustomPlotTableDataContentPane;
@ -104,6 +102,7 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha
/**
* 图表的属性界面数组
*
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
@ -119,25 +118,12 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
VanChartGaugePlot gaugePlot;
@Override
public void populate(ChartCollection collection) {
if (collection == null) {
return;
}
VanChart chart = collection.getSelectedChartProvider(VanChart.class);
if (chart == null) {
return;
}
gaugePlot = chart.getPlot();
super.populate(collection);
}
@Override
protected SingleDataPane createSingleDataPane() {
VanChartGaugePlot gaugePlot = null;
if (getVanChart() != null) {
gaugePlot = getVanChart().getPlot();
}
if (gaugePlot != null && !gaugePlot.isMultiPointer()) {
return new SingleDataPane(new GaugeDataSetFieldsPane(), new GaugeCellDataFieldsPane());
}

26
designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugePlotPane.java

@ -2,9 +2,16 @@ package com.fr.van.chart.gauge;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.GaugeColumnFieldCollection;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.gauge.GaugeIndependentVanChart;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
/**
@ -73,4 +80,23 @@ public class VanChartGaugePlotPane extends AbstractVanChartTypePane {
}
}
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if(definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
GaugeStyle gaugeStyle = ((VanChartGaugePlot) vanChartPlot).getGaugeStyle();
switch (gaugeStyle) {
case RING:
case SLOT:
case THERMOMETER:
return columnFieldCollection instanceof GaugeColumnFieldCollection;
case POINTER:
case POINTER_SEMI:
default:
return columnFieldCollection instanceof MultiCategoryColumnFieldCollection;
}
}
return false;
}
}

7
designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java

@ -2,8 +2,10 @@ package com.fr.van.chart.heatmap.designer.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.heatmap.HeatMapIndependentVanChart;
import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot;
@ -70,4 +72,9 @@ public class VanChartHeatMapTypePane extends VanChartMapPlotPane {
public Chart getDefaultChart() {
return HeatMapIndependentVanChart.HeatMapVanCharts[0];
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
return false;
}
}

8
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java

@ -2,9 +2,12 @@ package com.fr.van.chart.map.designer.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.MapChartDataDefinition;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.map.MapIndependentVanChart;
import com.fr.plugin.chart.map.VanChartMapPlot;
@ -89,6 +92,7 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
/**
* 不同地图类型的超链不需要复制
*
* @param oldPlot
* @param newPlot
* @throws CloneNotSupportedException
@ -146,4 +150,8 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
return this.sourceChoosePane;
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
return definition instanceof MapChartDataDefinition;
}
}

15
designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java

@ -2,7 +2,12 @@ package com.fr.van.chart.multilayer;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.MultiPieColumnFieldCollection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.multilayer.MultiPieIndependentVanChart;
import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot;
@ -43,6 +48,7 @@ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane {
/**
* 防止新建其他图表从而切换很卡
*
* @return
*/
public Chart getDefaultChart() {
@ -59,4 +65,13 @@ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane {
tools.setExport(false);
}
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if (definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection instanceof MultiPieColumnFieldCollection;
}
return false;
}
}

8
designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPane.java

@ -3,8 +3,9 @@ package com.fr.van.chart.range.component;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
import com.fr.design.style.color.ColorSelectBox;
import java.awt.Component;
@ -34,4 +35,9 @@ public class SectionIntervalConfigPane extends MapColorPickerPaneWithFormula {
};
}
@Override
protected ColorSelectBox getColorSelectBox() {
return new ColorSelectBoxWithOutTransparent(100);
}
}

14
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java

@ -5,7 +5,12 @@ import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.BubbleColumnFieldCollection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.scatter.ScatterIndependentVanChart;
@ -81,4 +86,13 @@ public class VanChartScatterPlotPane extends AbstractVanChartTypePane {
}
}
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if(definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection instanceof BubbleColumnFieldCollection;
}
return false;
}
}

13
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java

@ -2,7 +2,12 @@ package com.fr.van.chart.structure.desinger.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.StructureColumnFieldCollection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.structure.StructureIndependentVanChart;
import com.fr.plugin.chart.structure.VanChartStructurePlot;
@ -54,4 +59,12 @@ public class VanChartStructureTypePane extends AbstractVanChartTypePane {
return WordCloudIndependentVanChart.WordCloudVanCharts[0];
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if(definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection instanceof StructureColumnFieldCollection;
}
return false;
}
}

33
designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java

@ -1,6 +1,7 @@
package com.fr.van.chart.vanchart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
@ -14,7 +15,13 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa
import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.type.AxisType;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.data.VanChartMoreCateReportDataContentPane;
import com.fr.van.chart.designer.data.VanChartMoreCateTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane;
@ -68,9 +75,33 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependen
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
MultiCategoryDataSetFieldsPane multiCategoryDataSetFieldsPane;
MultiCategoryCellDataFieldsPane multiCategoryCellDataFieldsPane;
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
multiCategoryDataSetFieldsPane = new MultiCategoryDataSetFieldsPane();
multiCategoryCellDataFieldsPane = new MultiCategoryCellDataFieldsPane();
return new SingleDataPane(multiCategoryDataSetFieldsPane, multiCategoryCellDataFieldsPane);
}
@Override
public void populate(ChartCollection collection) {
super.populate(collection);
VanChart vanChart = this.getVanChart();
if (vanChart == null) {
return;
}
VanChartRectanglePlot plot = vanChart.getPlot();
VanChartAxis axis = plot.getDefaultXAxis();
if (plot instanceof VanChartColumnPlot
&& ((VanChartColumnPlot) plot).isBar()) {
axis = plot.getDefaultYAxis();
}
multiCategoryDataSetFieldsPane.setCategoryAxis(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY));
multiCategoryCellDataFieldsPane.setCategoryAxis(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY));
}
};
}

14
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/type/VanChartWordCloudTypePane.java

@ -2,7 +2,12 @@ package com.fr.van.chart.wordcloud.designer.type;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.WordCloudColumnFieldCollection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot;
import com.fr.plugin.chart.wordcloud.WordCloudIndependentVanChart;
@ -63,4 +68,13 @@ public class VanChartWordCloudTypePane extends AbstractVanChartTypePane {
public Chart getDefaultChart() {
return WordCloudIndependentVanChart.WordCloudVanCharts[0];
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if(definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection instanceof WordCloudColumnFieldCollection;
}
return false;
}
}

1
designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java

@ -106,7 +106,6 @@ public class FormWidgetDefinePaneFactoryBase {
defineMap.put(FreeButton.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(FormSubmitButton.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(WFitLayout.class, new Appearance(FRFitLayoutDefinePane.class, "wFitLayout"));
defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "wCardMainBorderLayout"));
if (StableFactory.getMarkedClass(BridgeMark.CHART_EDITOR, AbstractBorderStyleWidget.class) != null) {
defineMap.put(StableFactory.getMarkedClass(BridgeMark.CHART_EDITOR, AbstractBorderStyleWidget.class), new Appearance(BorderStyleWidgetDefinePane.class, "chartEditor"));
}

Loading…
Cancel
Save