Browse Source

Merge remote-tracking branch 'origin/feature/10.0' into feature/10.0

research/11.0
Bryant 5 years ago
parent
commit
31dfa564d1
  1. 2
      designer-base/src/main/java/com/fr/design/dialog/JWizardPanel.java
  2. 12
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  3. 12
      designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java
  4. 4
      designer-base/src/main/java/com/fr/design/gui/ibutton/UITabButton.java
  5. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java
  6. 19
      designer-base/src/main/java/com/fr/design/gui/icombobox/LineComboBox.java
  7. 4
      designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxButton.java
  8. 2
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java
  9. 42
      designer-base/src/main/java/com/fr/design/gui/imenu/UIBasicMenuItemUI.java
  10. 3
      designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTable.java
  11. 2
      designer-base/src/main/java/com/fr/design/gui/iprogressbar/UIProgressBorder.java
  12. 44
      designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIBasicScrollBarUI.java
  13. 8
      designer-base/src/main/java/com/fr/design/gui/iscrollbar/UISBChooser.java
  14. 6
      designer-base/src/main/java/com/fr/design/gui/itable/UITable.java
  15. 2
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxView.java
  16. 4
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/TokenIterator.java
  17. 9
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/WrappedSyntaxView.java
  18. 2
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java
  19. 2
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java
  20. 6
      designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java
  21. 8
      designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java
  22. 38
      designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java
  23. 32
      designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java
  24. 11
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java
  25. 33
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java
  26. 98
      designer-chart/src/main/java/com/fr/design/chartx/component/CategorySeriesFilterPane.java
  27. 6
      designer-chart/src/main/java/com/fr/design/chartx/component/MultiTinyFormulaPane.java
  28. 72
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java
  29. 79
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java
  30. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java
  31. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java
  32. 1
      designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java
  33. 21
      designer-chart/src/main/java/com/fr/van/chart/bar/BarIndependentVanChartInterface.java
  34. 16
      designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java
  35. 29
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleInteractivePane.java
  36. 5
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java
  37. 10
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java
  38. 26
      designer-chart/src/main/java/com/fr/van/chart/column/VanColumnChartTypeUI.java
  39. 25
      designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java
  40. 85
      designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java
  41. 123
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java
  42. 23
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java
  43. 286
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java
  44. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePaneWithMapZoom.java
  45. 47
      designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/MapZoomPane.java
  46. 224
      designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/ZoomPane.java
  47. 17
      designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/ZoomPaneWithOutMode.java
  48. 48
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  49. 19
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java
  50. 45
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  51. 170
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  52. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java
  53. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java
  54. 85
      designer-chart/src/main/java/com/fr/van/chart/designer/style/component/LimitPane.java
  55. 64
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  56. 111
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  57. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  58. 8
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java
  59. 8
      designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java
  60. 1
      designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java
  61. 89
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java
  62. 25
      designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java
  63. 3
      designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartLineMapConditionPane.java
  64. 14
      designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java
  65. 6
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java
  66. 22
      designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java
  67. 31
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java
  68. 34
      designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java
  69. 13
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java
  70. 2
      designer-realize/src/main/java/com/fr/grid/GridUI.java
  71. 2
      designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java

2
designer-base/src/main/java/com/fr/design/dialog/JWizardPanel.java

@ -168,7 +168,7 @@ public class JWizardPanel extends BasicPane {
public void addNotify() {
if (firstNotify) {
Font font = stepTitleLabel.getFont();
font = font.deriveFont(Font.BOLD, font.getSize() * 14 / 10.0F);
font = font.deriveFont(Font.BOLD, (float) (font.getSize() * 14 / 10.0D));
stepTitleLabel.setFont(font);
firstNotify = false;
}

12
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -398,8 +398,8 @@ public class MutilTempalteTabPane extends JComponent {
//画下面的那条线
if (templateStartX < maxWidth) {
GeneralPath generalPath = new GeneralPath(Path2D.WIND_EVEN_ODD, 2);
generalPath.moveTo((float) templateStartX, getHeight() - 1.0F);
generalPath.lineTo((float) maxWidth, getHeight() - 1.0F);
generalPath.moveTo((float) templateStartX, (float) (getHeight() - 1.0D));
generalPath.lineTo((float) maxWidth, (float) (getHeight() - 1.0D));
g2d.fill(generalPath);
//TODO hzzz delete
// g2d.setPaint(UIConstants.LINE_COLOR);
@ -409,7 +409,7 @@ public class MutilTempalteTabPane extends JComponent {
private void paintDefaultBackground(Graphics2D g2d) {
//画默认背景
g2d.setPaint(new GradientPaint(1, 1, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND, 1, getHeight() - 1.0F, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND));
g2d.setPaint(new GradientPaint(1, 1, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND, 1, (float) (getHeight() - 1.0D), UIConstants.TEMPLATE_TAB_PANE_BACKGROUND));
g2d.fillRect(0, 0, getWidth(), getHeight());
}
@ -535,7 +535,7 @@ public class MutilTempalteTabPane extends JComponent {
double[] x = {templateStartX, templateStartX, templateStartX + realWidth, templateStartX + realWidth, templateStartX};
double[] y = {1, getHeight() + 1, getHeight() + 1, 1, 1};
RoundRectangle2D.Double rect1 = new RoundRectangle2D.Double(templateStartX, 1, this.getWidth(), this.getHeight(), 7, 7);
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, getHeight() - 1.0F, UIConstants.SELECT_TAB));
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, (float) (getHeight() - 1.0D), UIConstants.SELECT_TAB));
//选了30度和60度的特殊角度的x,y作为经过的两个点的坐标
double specialLocation1 = 2.5;
double specialLocation2 = 4.330127;
@ -590,9 +590,9 @@ public class MutilTempalteTabPane extends JComponent {
double[] x = {templateStartX, templateStartX, templateStartX + realWidth, templateStartX + realWidth, templateStartX};
double[] y = {-1, getHeight() - 1, getHeight() - 1, -1, -1};
if (selfIndex == mouseOveredIndex) {
g2d.setPaint(new GradientPaint(1, 1, UIConstants.HOVER_BLUE, 1, getHeight() - 1.0F, UIConstants.HOVER_BLUE));
g2d.setPaint(new GradientPaint(1, 1, UIConstants.HOVER_BLUE, 1, (float) (getHeight() - 1.0D), UIConstants.HOVER_BLUE));
} else {
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, getHeight() - 1.0F, UIConstants.SHADOW_GREY));
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, (float) (getHeight() - 1.0D), UIConstants.SHADOW_GREY));
}

12
designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java

@ -176,11 +176,11 @@ public class UISliderButtonUI extends BasicButtonUI {
private void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp;
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1f, UIConstants.AUTHORITY_DARK_BLUE);
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1F, UIConstants.AUTHORITY_DARK_BLUE);
} else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1, UIConstants.SELECT_TAB);
gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1F, UIConstants.SELECT_TAB);
}else{
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER);
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1F, UIConstants.POP_DIALOG_BORDER);
}
fillPaint(g2d, x, y, width, height, isRound, rectDirection, gp, UIConstants.ARC);
@ -189,11 +189,11 @@ public class UISliderButtonUI extends BasicButtonUI {
private void fillRollOver(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp;
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.HOVER_BLUE);
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1F, UIConstants.HOVER_BLUE);
} else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER);
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1F, UIConstants.POP_DIALOG_BORDER);
}else {
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER);
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1F, UIConstants.POP_DIALOG_BORDER);
}
fillPaint(g2d, x, y, width, height, isRound, rectDirection, gp, UIConstants.ARC);
}

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

@ -162,12 +162,12 @@ public class UITabButton extends UILabel implements UISelectedComponent {
Color blue = UIConstants.LIGHT_BLUE;
g2d.setColor(blue);
g2d.fillRect(0, 1, w - 1, h / 2);
GradientPaint gp = new GradientPaint(1, 1, UIConstants.OCEAN_BLUE, 1, h - 1, blue);
GradientPaint gp = new GradientPaint(1, 1, UIConstants.OCEAN_BLUE, 1, h - 1F, blue);
g2d.setPaint(gp);
g2d.fillRect(0, h / 2, w - 1, h / 2);
this.setForeground(UIConstants.FONT_COLOR);
} else if (!isSelected() && !isRollover) {
GradientPaint gp = new GradientPaint(1, 1, TOP, 1, h - 1, DOWN);
GradientPaint gp = new GradientPaint(1, 1, TOP, 1, h - 1F, DOWN);
g2d.setPaint(gp);
g2d.fillRect(0, h / 2, w - 1, h / 2);
this.setForeground(UIConstants.FONT_COLOR);

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

@ -220,7 +220,7 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
protected void paintOtherBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(UIConstants.BS);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1F, getHeight() - 1F, UIConstants.ARC, UIConstants.ARC);
g2d.setColor(UIConstants.LINE_COLOR);
g2d.draw(shape);
}

19
designer-base/src/main/java/com/fr/design/gui/icombobox/LineComboBox.java

@ -3,6 +3,11 @@
*/
package com.fr.design.gui.icombobox;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.general.FRFont;
import com.fr.stable.Constants;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
@ -11,18 +16,10 @@ import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JLabel;
import javax.swing.JList;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.general.FRFont;
import com.fr.stable.Constants;
/**
* Combobox for selecting line styles.
@ -88,13 +85,13 @@ public class LineComboBox extends UIComboBox {
FontMetrics fm = GraphHelper.getFontMetrics(rfont);
if (style == Constants.LINE_NONE) {
//draw "none" string
GraphHelper.drawString(g2d, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None"), 4, (d.height - fm.getHeight()) / 2 + fm.getAscent());
GraphHelper.drawString(g2d, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None"), 4, (d.height - fm.getHeight()) / 2D + fm.getAscent());
} else {
GraphHelper.drawLine(g2d, 4, d.height / 2, d.width - 8, d.height / 2, style);
GraphHelper.drawLine(g2d, 4, d.height / 2D, d.width - 8D, d.height / 2D, style);
}
if(isShowAxisWithLineStyle()) { // 带有坐标轴箭头的样式.
drawArrow(g2d, new Point2D.Double(4, d.height / 2), new Point2D.Double(d.width - 8, d.height/2));
drawArrow(g2d, new Point2D.Double(4, d.height / 2D), new Point2D.Double(d.width - 8D, d.height / 2D));
}
}

4
designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxButton.java

@ -172,11 +172,9 @@ public class UIComboBoxButton extends JButton {
}
c.setBackground(UIManager.getColor("ComboBox.focusBackground"));
if (c instanceof JComponent) {
mustResetOpaque = true;
JComponent jc = (JComponent) c;
savedOpaque = jc.isOpaque();
jc.isOpaque();
jc.setOpaque(true);
paintFocus = true;
}
} else {
c.setForeground(comboBox.getForeground());

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

@ -46,7 +46,7 @@ public class UIModeControlContainer extends JLayeredPane {
private boolean isHideMode = false;
private boolean isSheeetCovered = false;
private AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 30 / 100.0F);
private AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f);
public UIModeControlContainer() {
this(new JPanel(), new JPanel());

42
designer-base/src/main/java/com/fr/design/gui/imenu/UIBasicMenuItemUI.java

@ -287,7 +287,7 @@ public class UIBasicMenuItemUI extends MenuItemUI {
View v = (View) c.getClientProperty(BasicHTML.propertyKey);
if (v != null) {
d = getPreferredSize(c);
d.width -= v.getPreferredSpan(View.X_AXIS) - v.getMinimumSpan(View.X_AXIS);
d.width -= (double) v.getPreferredSpan(View.X_AXIS) - (double) v.getMinimumSpan(View.X_AXIS);
}
return d;
}
@ -345,7 +345,7 @@ public class UIBasicMenuItemUI extends MenuItemUI {
View v = (View) c.getClientProperty(BasicHTML.propertyKey);
if (v != null) {
d = getPreferredSize(c);
d.width += v.getMaximumSpan(View.X_AXIS) - v.getPreferredSpan(View.X_AXIS);
d.width += (double) v.getMaximumSpan(View.X_AXIS) - (double) v.getPreferredSpan(View.X_AXIS);
}
return d;
}
@ -816,7 +816,6 @@ public class UIBasicMenuItemUI extends MenuItemUI {
// get Accelerator text
KeyStroke accelerator = b.getAccelerator();
String acceleratorText = "";
drawMenu(acceleratorText, accelerator, c, ic, maxValue, offset, paintIcon, b);
String text = layoutMenuItem(fm, b.getText(), fmAccel, acceleratorText, ic, null,
arrowIcon, b.getVerticalAlignment(), b.getHorizontalAlignment(),
b.getVerticalTextPosition(), b.getHorizontalTextPosition(), viewRect,
@ -834,43 +833,6 @@ public class UIBasicMenuItemUI extends MenuItemUI {
g.setFont(holdf);
}
private void drawMenu(String acceleratorText, KeyStroke accelerator, JComponent c,
Icon ic, int maxValue, int offset, Icon paintIcon, JMenuItem b) {
if (accelerator != null) {
int modifiers = accelerator.getModifiers();
if (modifiers > 0) {
acceleratorText = KeyEvent.getKeyModifiersText(modifiers);
//acceleratorText += "-";
acceleratorText += acceleratorDelimiter;
}
int keyCode = accelerator.getKeyCode();
if (keyCode != 0) {
acceleratorText += KeyEvent.getKeyText(keyCode);
} else {
acceleratorText += accelerator.getKeyChar();
}
}
if (!isTopLevelMenu()) {
if (c instanceof JCheckBoxMenuItem || c instanceof JRadioButtonMenuItem) {
ic = checkIcon;
if (checkIcon.getIconWidth() < maxValue) {
ic = new EmptyIcon(maxValue, checkIcon.getIconHeight());
offset = (maxValue - checkIcon.getIconWidth()) / 2;
}
paintIcon = null;
} else if (c instanceof JMenuItem) {
if (ic == null || ic.getIconWidth() < maxValue) {
int height = (ic == null) ? 2 : b.getIcon().getIconHeight();
int width = (ic == null) ? 2 : b.getIcon().getIconWidth();
offset = (maxValue - width) / 2;
ic = new EmptyIcon(maxValue, height);
}
}
}
}
private void drawAccText(String acceleratorText, Graphics g, JComponent p, ButtonModel model, FontMetrics fmAccel, JComponent c) {
if (acceleratorText != null && !ComparatorUtils.equals(acceleratorText, "")) {
//Get the maxAccWidth from the parent to calculate the offset.

3
designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTable.java

@ -157,8 +157,7 @@ public class UIMenuTable extends JTable {
@Override
public TableCellRenderer getDefaultRenderer(Class<?> columnClass) {
columnClass = UITable.class;
return super.getDefaultRenderer(columnClass);
return super.getDefaultRenderer(UITable.class);
}
private class UITableRender implements TableCellRenderer {

2
designer-base/src/main/java/com/fr/design/gui/iprogressbar/UIProgressBorder.java

@ -72,6 +72,7 @@ public class UIProgressBorder extends UIRoundedBorder {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
}
@SuppressWarnings("squid:S2164")
private void paintBorderShadow(Graphics2D g2, int shadowWidth, int x, int y, int width, int height) {
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
shadowWidth = Math.max(shadowWidth, 2);
@ -85,6 +86,7 @@ public class UIProgressBorder extends UIRoundedBorder {
}
}
@SuppressWarnings("squid:S2164")
private static Color getMixedColor(Color c1, float pct1, Color c2, float pct2) {
float[] clr1 = c1.getComponents(null);
float[] clr2 = c2.getComponents(null);

44
designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIBasicScrollBarUI.java

@ -165,50 +165,6 @@ public class UIBasicScrollBarUI extends BasicScrollBarUI {
// drawColorAndLength(g, t, x2, y2, color);
}
private void drawColorAndLength(Graphics g, Rectangle t, int x2, int y2, Color color) {
if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
int y1 = t.y + (t.height) / 2 - 4;
y2 = Math.min(y1 + 8, t.y + t.height - 5);
int y = y1;
// we take only saturation & brightness and apply them
// to the background color (normal/rollover/pressed)
g.setColor(UISBChooser.getAdjustedColor(color, 0, 71));
while (y < y2) {
g.drawLine(5, y, 11, y);
y += 2;
}
y = y1 + 1;
g.setColor(UISBChooser.getAdjustedColor(color, 0, -13));
while (y < y2) {
g.drawLine(6, y, 12, y);
y += 2;
}
} else {
int x1 = t.x + (t.width) / 2 - 4;
x2 = Math.min(x1 + 8, t.x + t.width - 5);
int x = x1 + 1;
// we take only saturation & brightness and apply them
// to the background color (normal/rollover/pressed)
g.setColor(UISBChooser.getAdjustedColor(color, 0, 71));
while (x < x2) {
g.drawLine(x, 5, x, 11);
x += 2;
}
x = x1;
g.setColor(UISBChooser.getAdjustedColor(color, 0, -13));
while (x < x2) {
g.drawLine(x, 6, x, 12);
x += 2;
}
}
}
private void drawVertical(Graphics g, Rectangle t, int xs, int ys, int x2,
Color pressedColor, Color rolloverColor,
Color normalColor) {

8
designer-base/src/main/java/com/fr/design/gui/iscrollbar/UISBChooser.java

@ -90,6 +90,7 @@ public class UISBChooser extends JDialog {
(frame.getHeight() - getSize().height) / 2);
}
@SuppressWarnings("squid:S1226")
private void initP3(JPanel p3, JPanel p1) {
p3 = new JPanel(new FlowLayout(FlowLayout.LEFT, 3, 8));
p3.add(new JLabel("R:"));
@ -198,6 +199,7 @@ public class UISBChooser extends JDialog {
twoColorField.setUpperColor(outColor);
}
@SuppressWarnings("squid:S2164")
public static Color getAdjustedColor(Color inColor, int sat, int bri) {
Color briColor = inColor;
@ -219,9 +221,9 @@ public class UISBChooser extends JDialog {
int dg = briColor.getGreen() - satColor.getGreen();
int db = briColor.getBlue() - satColor.getBlue();
r = briColor.getRed() - (int) Math.round(dr * sat / VALUE * 1.0);
g = briColor.getGreen() - (int) Math.round(dg * sat / VALUE * 1.0);
b = briColor.getBlue() - (int) Math.round(db * sat / VALUE * 1.0);
r = briColor.getRed() - (int) Math.round(dr * sat / (VALUE * 1.0));
g = briColor.getGreen() - (int) Math.round(dg * sat / (VALUE * 1.0));
b = briColor.getBlue() - (int) Math.round(db * sat / (VALUE * 1.0));
} else {
float d = ColorRoutines.getGreyValue(briColor);
float dr = briColor.getRed() - d;

6
designer-base/src/main/java/com/fr/design/gui/itable/UITable.java

@ -291,8 +291,7 @@ public class UITable extends JTable implements UIObserver {
*
*/
public TableCellEditor getDefaultEditor(Class<?> columnClass) {
columnClass = UITable.class;
return super.getDefaultEditor(columnClass);
return super.getDefaultEditor(UITable.class);
}
@Override
@ -300,8 +299,7 @@ public class UITable extends JTable implements UIObserver {
*
*/
public TableCellRenderer getDefaultRenderer(Class<?> columnClass) {
columnClass = UITable.class;
return super.getDefaultRenderer(columnClass);
return super.getDefaultRenderer(UITable.class);
}
/**

2
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxView.java

@ -656,7 +656,7 @@ public class SyntaxView extends View implements TabExpander,
if (tabSize == 0)
return x;
int ntabs = (((int) x) - tabBase) / tabSize;
return tabBase + ((ntabs + 1) * tabSize);
return (float) (tabBase + ((ntabs + 1) * tabSize));
}

4
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/TokenIterator.java

@ -9,6 +9,7 @@
package com.fr.design.gui.syntax.ui.rsyntaxtextarea;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
@ -73,6 +74,9 @@ class TokenIterator implements Iterator<Token> {
token = null;
}
}
else {
throw new NoSuchElementException();
}
return t;
}

9
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/WrappedSyntaxView.java

@ -268,7 +268,7 @@ public class WrappedSyntaxView extends BoxView implements TabExpander,
if (host.getEOLMarkersVisible()) {
g.setColor(host.getForegroundForTokenType(Token.WHITESPACE));
g.setFont(host.getFontForTokenType(Token.WHITESPACE));
g.drawString("\u00B6", x, y-fontHeight);
g.drawString("\u00B6", x, (float) (y-fontHeight));
}
}
@ -458,7 +458,7 @@ public class WrappedSyntaxView extends BoxView implements TabExpander,
if (host.getEOLMarkersVisible()) {
g.setColor(host.getForegroundForTokenType(Token.WHITESPACE));
g.setFont(host.getFontForTokenType(Token.WHITESPACE));
g.drawString("\u00B6", x, y-fontHeight);
g.drawString("\u00B6", x, (float) (y-fontHeight));
}
}
@ -841,10 +841,11 @@ public class WrappedSyntaxView extends BoxView implements TabExpander,
* @return the tab stop, measured in points >= 0
*/
public float nextTabStop(float x, int tabOffset) {
if (tabSize == 0)
if (tabSize == 0) {
return x;
}
int ntabs = ((int) x - tabBase) / tabSize;
return tabBase + ((ntabs + 1) * tabSize);
return (float) (tabBase + ((ntabs + 1) * tabSize));
}

2
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java

@ -69,7 +69,7 @@ public class LogHandlerBarUI extends ComponentUI implements MouseListener, Focus
int w = button.getWidth();
int h = button.getHeight();
Graphics2D g2d = (Graphics2D) g;
GradientPaint gp = new GradientPaint(1, 1, darkColor, 1, h - 1, darkColor);
GradientPaint gp = new GradientPaint(1, 1, darkColor, 1, h - 1f, darkColor);
g2d.setPaint(gp);
g2d.fillRect(0, 0, w, h);
}

2
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java

@ -31,7 +31,7 @@ import java.util.List;
public class FileVersionDialog extends UIDialog {
public static final long DELAY = 24 * 60 * 60 * 1000;
public static final long DELAY = 24 * 60 * 60 * 1000L;
private UIButton okBtn;
private UIButton cancelBtn;
private DateEditor dateEditor;

6
designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java

@ -159,15 +159,15 @@ public class PatternBackgroundPane extends BPane {
Dimension d = getSize();
this.patternBackground.paint(g2d, new Rectangle2D.Double(0, 0,
d.width - 1, d.height - 1));
d.width - 1d, d.height - 1d));
if (this.pIndex == patternIndex) {// it's selected.
g2d.setPaint(new Color(255, 51, 0));
} else {
g2d.setPaint(Color.gray);
}
GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1,
d.height - 1));
GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1d,
d.height - 1d));
}
public Dimension getPreferredSize() {

8
designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java

@ -152,8 +152,8 @@ public class TextureBackgroundPane extends BPane {
Dimension d = getSize();
g2d.setPaint(this.buttonTexturePaint);
GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, d.width - 1,
d.height - 1));
GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, d.width - 1d,
d.height - 1d));
if (ComparatorUtils.equals(texturePaint, this.buttonTexturePaint)) {// it's
// selected.
@ -161,8 +161,8 @@ public class TextureBackgroundPane extends BPane {
} else {
g2d.setPaint(Color.gray);
}
GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1,
d.height - 1));
GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1d,
d.height - 1d));
}
public Dimension getPreferredSize() {

38
designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java

@ -332,8 +332,8 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
* @param p The point where the MouseEvent occurred.
*/
private void updateS(Point p) {
float h = p.x * 1f / IMG_WIDTH;
float b = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT;
double h = p.x * 1D / IMG_WIDTH;
double b = (IMG_HEIGHT - p.y * 1D) / IMG_HEIGHT;
internalChange = true;
hSpinner.setValue(new Integer((int) (h * H_MAX)));
@ -349,8 +349,8 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
* @param p The point where the MouseEvent occurred.
*/
private void updateB(Point p) {
float h = p.x * 1f / IMG_WIDTH;
float s = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT;
double h = p.x * 1D / IMG_WIDTH;
double s = (IMG_HEIGHT - p.y * 1D) / IMG_HEIGHT;
internalChange = true;
hSpinner.setValue(new Integer((int) (h * H_MAX)));
@ -523,9 +523,9 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
private void adjustHSLValue(float[] hsbVals) {
if (!spinnerTrigger) {
hSpinner.setValue(new Integer((int) (hsbVals[0] * HSPINNER_VALUE)));
sSpinner.setValue(new Integer((int) (hsbVals[1] * SSPINNER_VALUE)));
bSpinner.setValue(new Integer((int) (hsbVals[2] * LSPINNER_VALUE)));
hSpinner.setValue(new Integer((int) ((double) hsbVals[0] * HSPINNER_VALUE)));
sSpinner.setValue(new Integer((int) ((double) hsbVals[1] * SSPINNER_VALUE)));
bSpinner.setValue(new Integer((int) ((double) hsbVals[2] * LSPINNER_VALUE)));
}
switch (locked) {
case HLOCKED:
@ -534,9 +534,9 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
}
if (!handlingMouse) {
gradientPoint.x = (int) ((1
- ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_WIDTH);
- ((Number) sSpinner.getValue()).intValue() / (double) SSPINNER_VALUE) * IMG_WIDTH);
gradientPoint.y = (int) ((1
- ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT);
- ((Number) bSpinner.getValue()).intValue() / (double) LSPINNER_VALUE) * IMG_HEIGHT);
}
break;
case SLOCKED:
@ -544,9 +544,9 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
slider.setValue(((Number) sSpinner.getValue()).intValue());
}
if (!handlingMouse) {
gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH);
gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / (double) HSPINNER_VALUE * IMG_WIDTH);
gradientPoint.y = (int) ((1
- ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT);
- ((Number) bSpinner.getValue()).intValue() / (double) LSPINNER_VALUE) * IMG_HEIGHT);
}
break;
case BLOCKED:
@ -554,18 +554,18 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
slider.setValue(((Number) bSpinner.getValue()).intValue());
}
if (!handlingMouse) {
gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH);
gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / (double) HSPINNER_VALUE * IMG_WIDTH);
gradientPoint.y = (int) ((1
- ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_HEIGHT);
- ((Number) sSpinner.getValue()).intValue() / (double) SSPINNER_VALUE) * IMG_HEIGHT);
}
break;
}
}
private void updateImageAndTrack() {
float h = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE;
float s = ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE;
float b = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE;
float h = (float) (((Number) hSpinner.getValue()).intValue() / (double) HSPINNER_VALUE);
float s = (float) (((Number) sSpinner.getValue()).intValue() / (double) SSPINNER_VALUE);
float b = (float) (((Number) bSpinner.getValue()).intValue() / (double) LSPINNER_VALUE);
spinnerTrigger = true;
getColorSelectionModel().setSelectedColor(new Color(Color.HSBtoRGB(h, s, b)));
@ -837,12 +837,12 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
private void updateHLockImage() {
int index = 0;
int[] pix = new int[IMG_WIDTH * IMG_HEIGHT];
float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE;
float hValue = (float)(((Number) hSpinner.getValue()).intValue() / (double) HSPINNER_VALUE );
for (int j = 0; j < IMG_HEIGHT; j++) {
for (int i = 0; i < IMG_WIDTH; i++) {
pix[index++] = Color.HSBtoRGB(hValue, (IMG_WIDTH - i * 1f) / IMG_WIDTH,
(IMG_HEIGHT - j * 1f) / IMG_HEIGHT) | (BINARY_FOR_EIGHT << TWENTY_FOUR);
pix[index++] = Color.HSBtoRGB(hValue, (float) ((IMG_WIDTH - i * 1D) / IMG_WIDTH),
(float) ((IMG_HEIGHT - j * 1D) / IMG_HEIGHT)) | (BINARY_FOR_EIGHT << TWENTY_FOUR);
}
}

32
designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java

@ -11,6 +11,18 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartsConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.type.ui.AreaChartTypeUI;
import com.fr.design.type.ui.BarChartTypeUI;
import com.fr.design.type.ui.BubbleChartTypeUI;
@ -28,18 +40,6 @@ import com.fr.design.type.ui.RadarChartTypeUI;
import com.fr.design.type.ui.RangeChartTypeUI;
import com.fr.design.type.ui.StockChartTypeUI;
import com.fr.design.type.ui.XYScatterChartTypeUI;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartsConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.extended.chart.AbstractChart;
import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
@ -80,7 +80,7 @@ import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.van.chart.area.AreaIndependentVanChartInterface;
import com.fr.van.chart.bar.BarIndependentVanChartInterface;
import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface;
import com.fr.van.chart.column.ColumnIndependentVanChartInterface;
import com.fr.van.chart.column.VanColumnChartTypeUI;
import com.fr.van.chart.custom.CustomIndependentVanChartInterface;
import com.fr.van.chart.drillmap.DrillMapIndependentVanChartInterface;
import com.fr.van.chart.funnel.designer.FunnelIndependentVanChartInterface;
@ -93,7 +93,7 @@ import com.fr.van.chart.multilayer.MultiPieIndependentVanChartInterface;
import com.fr.van.chart.pie.PieIndependentVanChartInterface;
import com.fr.van.chart.radar.RadarIndependentVanChartInterface;
import com.fr.van.chart.scatter.ScatterIndependentVanChartInterface;
import com.fr.van.chart.structure.desinger.StructureIndependentVanChartInterface;
import com.fr.van.chart.structure.desinger.VanStructureChartTypeUI;
import com.fr.van.chart.treemap.TreeMapIndependentVanChartInterface;
import com.fr.van.chart.wordcloud.designer.WordCloudIndependentVanChartInterface;
@ -182,7 +182,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
private static void readVanChart() {
addChartTypeInterface(VAN_CHART_PRIORITY, PiePlot4VanChart.VAN_CHART_PIE_PLOT, new PieIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID, new ColumnIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID, new VanColumnChartTypeUI());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID, new BarIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartLinePlot.VAN_CHART_LINE_PLOT, new LineIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID, new AreaIndependentVanChartInterface());
@ -199,7 +199,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new HeatMapIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new StructureIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new VanStructureChartTypeUI());
}

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

@ -24,7 +24,6 @@ import java.util.List;
* 一列组件<T extends JComponent> 可增可删通过JComponent后面的加减button增删
*/
public abstract class AbstractMultiComponentPane<T extends JComponent> extends JPanel {
private static final int COM_W = 96;
private static final int H = 20;
private static final int ICON_W = 20;
@ -50,7 +49,7 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
firstFieldComponent = createFirstFieldComponent();
firstFieldComponent.setPreferredSize(new Dimension(COM_W, H));
firstFieldComponent.setPreferredSize(new Dimension(componentWidth(), H));
addButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
addButton.setPreferredSize(new Dimension(ICON_W, H));
@ -64,7 +63,7 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
});
final JPanel panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2));
panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 2));
panel.add(label);
panel.add(firstFieldComponent);
@ -78,6 +77,10 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
this.add(boxPane, BorderLayout.CENTER);
}
protected int componentWidth() {
return 96;
}
private JPanel addComboBoxAndButtonToBox(T uiComboBox, UIButton uiButton) {
final JPanel panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2));
@ -93,7 +96,7 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
private void addNewComboBox() {
final T comboBox = createOtherFieldComponent();
comboBox.setPreferredSize(new Dimension(COM_W, H));
comboBox.setPreferredSize(new Dimension(componentWidth(), H));
UIButton delButton = new UIButton(IOUtils.readIcon("com/fr/design/images/toolbarbtn/close.png"));
delButton.setPreferredSize(new Dimension(ICON_W, H));

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

@ -2,10 +2,12 @@ package com.fr.design.chartx.component;
import com.fr.base.Utils;
import com.fr.chartx.data.field.DataFilterProperties;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.data.PresentComboBox;
import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane;
@ -22,7 +24,7 @@ import java.awt.Dimension;
/**
* Created by shine on 2019/07/18.
*/
public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<DataFilterProperties> {
public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<DataFilterProperties> implements UIObserver {
private static final int FIL_HEIGHT = 150;
@ -34,14 +36,12 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
private PresentComboBox present;
private AbstractAttrNoScrollPane parent;
private JPanel topPane;
private UIObserverListener listener;
public AbstractSingleFilterPane() {
super(true);
//todo@shinerefactor present的时候这边可以整理下
// this.parent = parent;
}
@Override
@ -72,13 +72,13 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
private JPanel initPane() {
useTopCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
useTopCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
JPanel panel1 = new JPanel(new BorderLayout());
JPanel panel2 = new JPanel(new BorderLayout());
panel1.add(useTopCheckBox, BorderLayout.NORTH);
topNumTextField = new UITextField();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
mergeOtherCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
mergeOtherCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
mergeOtherCheckBox.setSelected(true);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
@ -94,7 +94,7 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
//默认不显示
topPane.setVisible(false);
panel1.add(topPane, BorderLayout.CENTER);
hideNullCheckBox = new UICheckBox(title4PopupWindow() + " is null, hidden");
hideNullCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Null_Hide", title4PopupWindow(), title4PopupWindow()));
panel2.add(hideNullCheckBox, BorderLayout.NORTH);
useTopCheckBox.addChangeListener(new ChangeListener() {
@ -120,10 +120,19 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
return TableLayout4VanChartHelper.createGapTableLayoutPane(coms, row, column);
}
@Override
public void registerChangeListener(UIObserverListener listener) {
this.listener = listener;
}
@Override
public boolean shouldResponseChangeListener() {
return true;
}
private void fire() {
if (this.parent != null) {
parent.attributeChanged();
if (this.listener != null) {
listener.doChange();
}
}

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

@ -0,0 +1,98 @@
package com.fr.design.chartx.component;
import com.fr.chartx.data.field.ColumnField;
import com.fr.chartx.data.field.DataFilterProperties;
import com.fr.chartx.data.field.SeriesValueCorrelationDefinition;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.i18n.Toolkit;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.map.designer.VanChartGroupPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.List;
/**
* @author shine
* @version 10.0
* Created by shine on 2019/9/26
*/
public class CategorySeriesFilterPane extends JPanel {
private AbstractSingleFilterPane seriesFilterPane;
private AbstractSingleFilterPane categoryFilterPane;
public CategorySeriesFilterPane() {
seriesFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Series");
}
};
categoryFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Style_Category");
}
};
JPanel groupPane = new VanChartGroupPane(new String[]{seriesFilterPane.title4PopupWindow(), categoryFilterPane.title4PopupWindow()}
, new JPanel[]{seriesFilterPane, categoryFilterPane}) {
};
JPanel contentPane = new JPanel(new BorderLayout());
contentPane.add(new JPanel(), BorderLayout.NORTH);
contentPane.add(groupPane, BorderLayout.CENTER);
this.setLayout(new BorderLayout());
this.add(TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), contentPane), BorderLayout.CENTER);
}
public void populateMultiCategoryFieldCollection(MultiCategoryColumnFieldCollection fieldCollection) {
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = fieldCollection.getSeriesValueCorrelationDefinition();
if (seriesValueCorrelationDefinition != null) {
populateSeries(seriesValueCorrelationDefinition.getFilterProperties());
}
List<ColumnField> categoryList = fieldCollection.getCategoryList();
if (!categoryList.isEmpty()) {
populateCategory(categoryList.get(0).getFilterProperties());
}
}
public void updateMultiCategoryFieldCollection(MultiCategoryColumnFieldCollection fieldCollection) {
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = fieldCollection.getSeriesValueCorrelationDefinition();
if (seriesValueCorrelationDefinition != null) {
seriesValueCorrelationDefinition.setFilterProperties(updateSeries());
}
List<ColumnField> categoryList = fieldCollection.getCategoryList();
if (!categoryList.isEmpty()) {
categoryList.get(0).setFilterProperties(updateCategory());
}
}
private void populateSeries(DataFilterProperties series) {
seriesFilterPane.populateBean(series);
}
private void populateCategory(DataFilterProperties category) {
categoryFilterPane.populateBean(category);
}
private DataFilterProperties updateSeries() {
return seriesFilterPane.updateBean();
}
private DataFilterProperties updateCategory() {
return categoryFilterPane.updateBean();
}
}

6
designer-chart/src/main/java/com/fr/design/chartx/component/MultiTinyFormulaPane.java

@ -8,6 +8,12 @@ import com.fr.design.formula.TinyFormulaPane;
* Created by shine on 2019/4/12.
*/
public class MultiTinyFormulaPane extends AbstractMultiComponentPane<TinyFormulaPane> {
@Override
protected int componentWidth() {
return 116;
}
@Override
protected TinyFormulaPane createFirstFieldComponent() {
return new TinyFormulaPane();

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

@ -1,14 +1,14 @@
package com.fr.design.chartx.fields.diff;
import com.fr.chartx.data.field.ColumnField;
import com.fr.chartx.data.field.SeriesValueCorrelationDefinition;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.chartx.component.AbstractSingleFilterPane;
import com.fr.design.chartx.component.CategorySeriesFilterPane;
import com.fr.design.chartx.component.MultiTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.van.chart.map.designer.VanChartGroupPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.List;
/**
@ -18,43 +18,21 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS
private MultiTinyFormulaPane multiCategoryPane;
private AbstractSingleFilterPane seriesFilterPane;
private AbstractSingleFilterPane categoryFilterPane;
private void createMultiFormulaPane() {
if (multiCategoryPane == null) {
multiCategoryPane = new MultiTinyFormulaPane();
}
}
private CategorySeriesFilterPane filterPane;
@Override
protected JPanel createNorthPane() {
protected void initComponents() {
multiCategoryPane = new MultiTinyFormulaPane();
filterPane = new CategorySeriesFilterPane();
createMultiFormulaPane();
JPanel northPane = new JPanel(new BorderLayout(0, 6));
northPane.add(multiCategoryPane, BorderLayout.NORTH);
northPane.add(createCenterPane(), BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 8));
return multiCategoryPane;
}
@Override
protected JPanel createSouthPane() {
if (seriesFilterPane == null) {
seriesFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
//todo@shinerefactor
return "series";
}
};
categoryFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
return "category";
}
};
}
return new VanChartGroupPane(new String[]{seriesFilterPane.title4PopupWindow(), categoryFilterPane.title4PopupWindow()}
, new JPanel[]{seriesFilterPane, categoryFilterPane}) {
};
this.setLayout(new BorderLayout(0, 6));
this.add(northPane, BorderLayout.NORTH);
this.add(filterPane, BorderLayout.CENTER);
}
@Override
@ -64,9 +42,6 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS
@Override
protected TinyFormulaPane[] formulaPanes() {
createMultiFormulaPane();
List<TinyFormulaPane> list = multiCategoryPane.componentList();
return list.toArray(new TinyFormulaPane[list.size()]);
}
@ -80,15 +55,7 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS
populateSeriesValuePane(multiCategoryColumnFieldCollection);
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = multiCategoryColumnFieldCollection.getSeriesValueCorrelationDefinition();
if (seriesValueCorrelationDefinition != null) {
seriesFilterPane.populateBean(seriesValueCorrelationDefinition.getFilterProperties());
}
if (categoryList != null && !categoryList.isEmpty()) {
categoryFilterPane.populateBean(categoryList.get(0).getFilterProperties());
}
filterPane.populateMultiCategoryFieldCollection(multiCategoryColumnFieldCollection);
}
@Override
@ -101,14 +68,7 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS
updateSeriesValuePane(fieldCollection);
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = fieldCollection.getSeriesValueCorrelationDefinition();
if (seriesValueCorrelationDefinition != null) {
seriesValueCorrelationDefinition.setFilterProperties(seriesFilterPane.updateBean());
}
if (categoryList != null && !categoryList.isEmpty()) {
categoryList.get(0).setFilterProperties(categoryFilterPane.updateBean());
}
filterPane.updateMultiCategoryFieldCollection(fieldCollection);
return fieldCollection;
}

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

@ -1,14 +1,15 @@
package com.fr.design.chartx.fields.diff;
import com.fr.chartx.data.field.ColumnField;
import com.fr.chartx.data.field.SeriesValueCorrelationDefinition;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.chartx.component.AbstractSingleFilterPane;
import com.fr.design.chartx.component.CategorySeriesFilterPane;
import com.fr.design.chartx.component.MultiComboBoxPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.van.chart.map.designer.VanChartGroupPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.util.List;
@ -19,52 +20,33 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer
private MultiComboBoxPane multiCategoryPane;
private AbstractSingleFilterPane seriesFilterPane;
private AbstractSingleFilterPane categoryFilterPane;
private CategorySeriesFilterPane filterPane;
@Override
protected String[] fieldLabels() {
return new String[0];
}
protected void initComponents() {
multiCategoryPane = new MultiComboBoxPane();
filterPane = new CategorySeriesFilterPane();
@Override
protected UIComboBox[] filedComboBoxes() {
List<UIComboBox> list = initMultiCategoryPane().componentList();
return list.toArray(new UIComboBox[list.size()]);
}
JPanel northPane = new JPanel(new BorderLayout(0, 6));
northPane.add(multiCategoryPane, BorderLayout.NORTH);
northPane.add(new JSeparator(), BorderLayout.CENTER);
northPane.add(createCenterPane(), BorderLayout.SOUTH);
northPane.setBorder(BorderFactory.createEmptyBorder(4, 24, 0, 15));
private MultiComboBoxPane initMultiCategoryPane() {
if (multiCategoryPane == null) {
multiCategoryPane = new MultiComboBoxPane();
}
return multiCategoryPane;
this.setLayout(new BorderLayout(0, 6));
this.add(northPane, BorderLayout.NORTH);
this.add(filterPane, BorderLayout.CENTER);
}
@Override
protected JPanel createNorthPane() {
return initMultiCategoryPane();
protected String[] fieldLabels() {
return new String[0];
}
@Override
protected JPanel createSouthPane() {
if (seriesFilterPane == null) {
seriesFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
//todo@shinerefactor
return "series";
}
};
categoryFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
return "category";
}
};
}
return new VanChartGroupPane(new String[]{seriesFilterPane.title4PopupWindow(), categoryFilterPane.title4PopupWindow()}
, new JPanel[]{seriesFilterPane, categoryFilterPane}) {
};
protected UIComboBox[] filedComboBoxes() {
List<UIComboBox> list = multiCategoryPane.componentList();
return list.toArray(new UIComboBox[list.size()]);
}
@Override
@ -81,15 +63,7 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer
populateSeriesValuePane(multiCategoryColumnFieldCollection);
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = multiCategoryColumnFieldCollection.getSeriesValueCorrelationDefinition();
if (seriesValueCorrelationDefinition != null) {
seriesFilterPane.populateBean(seriesValueCorrelationDefinition.getFilterProperties());
}
if (categoryList != null && !categoryList.isEmpty()) {
categoryFilterPane.populateBean(categoryList.get(0).getFilterProperties());
}
filterPane.populateMultiCategoryFieldCollection(multiCategoryColumnFieldCollection);
}
@Override
@ -102,14 +76,7 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer
updateSeriesValuePane(columnFieldCollection);
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = columnFieldCollection.getSeriesValueCorrelationDefinition();
if (seriesValueCorrelationDefinition != null) {
seriesValueCorrelationDefinition.setFilterProperties(seriesFilterPane.updateBean());
}
if (categoryList != null && !categoryList.isEmpty()) {
categoryList.get(0).setFilterProperties(categoryFilterPane.updateBean());
}
filterPane.updateMultiCategoryFieldCollection(columnFieldCollection);
return columnFieldCollection;
}

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

@ -59,7 +59,7 @@ public class StructureCellDataFieldsPane extends AbstractCellDataFieldsPane<Stru
nodeName,
nodeId,
parentId,
nodeValue,
seriesName,
nodeValue,
};
}

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

@ -63,7 +63,7 @@ public class StructureDataSetFieldsPane extends AbstractDataSetFieldsPane<Struct
nodeName,
nodeId,
parentId,
nodeValue,
seriesName,
nodeValue,
calculateCombox
};

1
designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java

@ -32,7 +32,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane {
new Component[]{createMarkerPane()},
new Component[]{createAreaFillColorPane()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()},
};

21
designer-chart/src/main/java/com/fr/van/chart/bar/BarIndependentVanChartInterface.java

@ -1,5 +1,6 @@
package com.fr.van.chart.bar;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
@ -10,7 +11,9 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.column.VanChartColumnConditionPane;
import com.fr.van.chart.column.VanChartColumnSeriesPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
@ -67,11 +70,27 @@ public class BarIndependentVanChartInterface extends AbstractMultiCategoryVanCha
/**
* 图表的属性界面数组
*
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartBarStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane();
VanChartOtherPane otherPane = new VanChartOtherPane() {
@Override
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePane() {
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};
}

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

@ -15,7 +15,9 @@ 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.van.chart.bubble.data.VanChartBubblePlotTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
@ -63,6 +65,7 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
public String getIconPath() {
return "com/fr/design/images/form/toolbar/bubble.png";
}
@Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartBubbleSeriesPane(parent, plot);
@ -86,13 +89,24 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
/**
* 图表的属性界面数组
*
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartBubbleStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane() {
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartBubbleInteractivePane();
return new VanChartInteractivePaneWithOutSort() {
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};

29
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleInteractivePane.java

@ -1,29 +0,0 @@
package com.fr.van.chart.bubble;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleInteractivePane extends VanChartInteractivePaneWithOutSort {
protected String[] getNameArray() {
Plot plot = chart.getPlot();
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")};
}
return super.getNameArray();
}
protected String[] getValueArray() {
Plot plot = chart.getPlot();
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
}
return super.getValueArray();
}
}

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

@ -6,9 +6,9 @@ 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.attr.ZoomAttribute;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom;
import com.fr.plugin.chart.bubble.BubbleIndependentVanChart;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
@ -116,8 +116,7 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
*/
@Override
protected void resetChartAttr4SamePlot(Chart chart){
VanChartZoom vanChartZoom = new VanChartZoom();
((VanChart)chart).setVanChartZoom(vanChartZoom);
((VanChart) chart).setZoomAttribute(new ZoomAttribute());
//重置监控刷新选项
resetRefreshMoreLabelAttr((VanChart)chart);
}

10
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java

@ -6,8 +6,6 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.van.chart.bubble.component.VanChartBubblePane;
import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane;
@ -44,10 +42,6 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
new Component[]{null}
};
if (!((VanChartBubblePlot)plot).isForceBubble()) {
components[3] = new Component[]{createLargeDataModelPane()};
}
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
return contentPane;
}
@ -84,7 +78,7 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
protected void populateCondition(ConditionAttr defaultAttr) {
super.populateCondition(defaultAttr);
if (bubblePane != null) {
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
bubblePane.populateBean(attrBubble);
}
}
@ -92,7 +86,7 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
protected void updateCondition(ConditionAttr defaultAttr) {
super.updateCondition(defaultAttr);
if (bubblePane != null) {
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
if (attrBubble != null) {
defaultAttr.remove(attrBubble);
}

26
designer-chart/src/main/java/com/fr/van/chart/column/ColumnIndependentVanChartInterface.java → designer-chart/src/main/java/com/fr/van/chart/column/VanColumnChartTypeUI.java

@ -2,8 +2,14 @@ package com.fr.van.chart.column;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.MultiCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
@ -11,7 +17,7 @@ import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
/**
* Created by Mitisky on 15/9/24.
*/
public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI {
public class VanColumnChartTypeUI extends AbstractMultiCategoryVanChartUI {
@Override
public String getName() {
@ -60,13 +66,13 @@ public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVan
return new VanChartColumnSeriesPane(parent, plot);
}
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
// }
// };
// }
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
}
};
}
}

25
designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java

@ -7,7 +7,6 @@ import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.style.FormatPane;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.area.VanChartAreaPlot;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.column.VanChartColumnPlot;
@ -89,11 +88,12 @@ public class PlotFactory {
public static boolean plotAutoAdjustLabelPosition(Plot plot) {
return autoAdjustLabelPlots.contains(plot.getClass());
}
/**
*
* 标签Map
*/
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLabelPane>> labelMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotLabelPane>>();
static {
labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class);
labelMap.put(VanChartScatterPlot.class, VanChartScatterPlotLabelPane.class);
@ -104,6 +104,7 @@ public class PlotFactory {
* 图例Map
*/
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>> legendMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>>();
static {
legendMap.put(VanChartGaugePlot.class, VanLegendPaneWidthOutHighlight.class);
legendMap.put(VanChartMultiPiePlot.class, VanLegendPaneWidthOutHighlight.class);
@ -119,6 +120,7 @@ public class PlotFactory {
* 数据点提示Map
*/
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>> toolTipMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>>();
static {
toolTipMap.put(VanChartGaugePlot.class, VanChartGaugePlotTooltipPane.class);
toolTipMap.put(VanChartScatterPlot.class, VanChartScatterPlotTooltipPane.class);
@ -156,18 +158,19 @@ public class PlotFactory {
}
/**
* 监控刷新 自动数据点提示Map
*/
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>> refreshToolTipMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>>();
static {
refreshToolTipMap.put(VanChartGaugePlot.class, VanChartGaugePlotRefreshTooltipPane.class);
refreshToolTipMap.put(VanChartBubblePlot.class, VanChartBubbleRefreshTooltipPane.class);
}
private static Map<Class<? extends Plot>, Class<? extends VanChartTooltipContentPane>> refreshTooltipContentMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartTooltipContentPane>>();
static {
@ -186,6 +189,7 @@ public class PlotFactory {
/**
* 根据图表类型创建标签界面
*
* @param plot 图表
* @param stylePane 样式界面
* @return 标签界面
@ -206,6 +210,7 @@ public class PlotFactory {
/**
* 根据图表类型创建图例界面
*
* @param plot 图表
* @param stylePane 样式界面
* @return 图例界面
@ -226,6 +231,7 @@ public class PlotFactory {
/**
* 根据图表类型创建数据点提示界面
*
* @param plot 图表
* @param stylePane 样式界面
* @return 数据点提示界面
@ -246,6 +252,7 @@ public class PlotFactory {
/**
* 根据图表类型创建标签的具体内容界面.分类名系列名等
*
* @param plot 图表
* @param parent 样式界面
* @param showOnPane formatpane用到
@ -267,6 +274,7 @@ public class PlotFactory {
/**
* 根据图表类型创建数据点提示的具体内容界面.分类名系列名等
*
* @param plot 图表
* @param parent 样式界面
* @param showOnPane formatpane用到
@ -287,9 +295,9 @@ public class PlotFactory {
}
/**
* 根据图表类型创建数据点提示界面
*
* @param plot 图表
* @return 数据点提示界面
*/
@ -306,8 +314,10 @@ public class PlotFactory {
}
return new VanChartPlotRefreshTooltipPane(plot);
}
/**
* 根据图表类型创建监控刷新中数据点提示的具体内容界面.分类名系列名等
*
* @param plot 图表
* @param parent 交互属性界面
* @param showOnPane formatpane用到
@ -336,6 +346,7 @@ public class PlotFactory {
new Component[]{centerPane, null},
};
}
protected UIComboBoxRenderer createComBoxRender() {
return new UIComboBoxRenderer() {
@Override
@ -362,11 +373,7 @@ public class PlotFactory {
* 判断是否为大数据模式
*/
public static boolean largeDataModel(Plot plot) {
return plot != null && plot.getDataProcessor().getMark() == LargeDataModel.MARK;
}
public static boolean lineMapLargeModel(Plot plot){
return plot instanceof VanChartMapPlot && ((VanChartMapPlot) plot).getLineMapDataProcessor().getMark() == LargeDataModel.MARK;
return plot != null && plot.convertDataProcessor().getMark() == LargeDataModel.MARK;
}
}

85
designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java

@ -0,0 +1,85 @@
package com.fr.van.chart.designer.component;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.i18n.Toolkit;
import com.fr.general.FRFont;
import com.fr.plugin.chart.type.LineType;
import com.fr.stable.Constants;
import javax.swing.JLabel;
import javax.swing.JList;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
/**
* Created by shine on 2019/08/30.
*/
public class LineTypeComboBox extends UIComboBox {
public LineTypeComboBox(LineType[] lineType) {
super(lineType);
this.setRenderer(new CellRenderer());
}
private static class CellRenderer extends UIComboBoxRenderer {
private LineType lineType;
public Component getListCellRendererComponent(
JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JLabel comp = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
this.lineType = (LineType) value;
comp.setText(null);
return comp;
}
public void paint(Graphics g) {
super.paint(g);
Graphics2D g2d = (Graphics2D) g;
Dimension d = getSize();
g2d.setColor(getForeground());
switch (this.lineType) {
case NONE:
FRFont font = FRContext.getDefaultValues().getFRFont();
int resolution = ScreenResolution.getScreenResolution();
Font rfont = font.applyResolutionNP(resolution);
g2d.setFont(rfont);
FontMetrics fm = GraphHelper.getFontMetrics(rfont);
GraphHelper.drawString(g2d, Toolkit.i18nText("Fine-Design_Report_None"), 4, (d.height - fm.getHeight()) / 2 + fm.getAscent());
break;
case NORMAL:
GraphHelper.drawLine(g2d, 4, d.height / 2, d.width - 8, d.height / 2);
break;
case DASH:
GraphHelper.drawLine(g2d, 4, d.height / 2, d.width - 8, d.height / 2, Constants.LINE_DASH);
break;
default:
break;
}
}
public Dimension getPreferredSize() {
return new Dimension(60, 16);
}
public Dimension getMinimumSize() {
return getPreferredSize();
}
}
}

123
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java

@ -2,21 +2,24 @@ package com.fr.van.chart.designer.component;
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.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.type.LineStyle;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.plugin.chart.type.LineType;
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;
import java.util.Arrays;
/**
* line相关设置
@ -24,64 +27,121 @@ import java.awt.Component;
public class VanChartLineTypePane extends BasicPane {
private static final long serialVersionUID = -6581862503009962973L;
protected LineComboBox lineWidth;//线型
private LineTypeComboBox lineTypeComboBox;//线型
private UISpinner lineWidthSpinner;//线宽
protected UIButtonGroup<LineStyle> lineStyle;//形态
protected UIButtonGroup nullValueBreak;//空值断开
private UIButtonGroup nullValueBreak;//空值断开
private JPanel lineWidthPane;
public VanChartLineTypePane() {
lineWidth = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
JPanel typeAndWidthPane = createTypeAndWidthPane();
createLineStyle();
nullValueBreak = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
nullValueBreak = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")});
lineTypeComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkLineWidth();
}
});
this.setLayout(new BorderLayout());
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
this.add(createContentPane(p, f), BorderLayout.CENTER);
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
Component[] lineStyleComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Present")), lineStyle},
nullValueBreakComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")), nullValueBreak};
Component[][] components = createContentComponent(lineStyleComponent, nullValueBreakComponent);
double[] row = new double[components.length];
Arrays.fill(row, p);
double[] col = {f, e};
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
this.setLayout(new BorderLayout(0, 6));
this.add(typeAndWidthPane, BorderLayout.NORTH);
this.add(contentPane, BorderLayout.CENTER);
}
private JPanel createTypeAndWidthPane() {
lineTypeComboBox = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2);
lineTypeComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkLineWidth();
}
});
Component[][] lineTypeComps = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineTypeComboBox}
};
Component[][] lineWidthComps = new Component[][]{
new Component[]{
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)}
};
double p = TableLayout.PREFERRED, f = TableLayout.FILL, e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] row = {p}, col = {f, e};
JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineTypeComps, row, col);
lineWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineWidthComps, row, col);
JPanel contentPane = new JPanel(new BorderLayout(0, 6));
contentPane.add(lineTypePane, BorderLayout.CENTER);
contentPane.add(lineWidthPane, BorderLayout.SOUTH);
return contentPane;
}
protected void createLineStyle() {
String[] textArray = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Normal_Line"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_StepLine"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_CurveLine")};
String[] textArray = new String[]{Toolkit.i18nText("Fine-Design_Chart_Normal_Line"),
Toolkit.i18nText("Fine-Design_Chart_StepLine"), Toolkit.i18nText("Fine-Design_Chart_CurveLine")};
lineStyle = new UIButtonGroup<LineStyle>(textArray, LineStyle.values());
}
protected JPanel createContentPane(double p, double f) {
double[] row = {p, p, p, p};
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] col = {f, e};
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidth)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present")),lineStyle},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")),nullValueBreak},
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
lineStyleComponent,
nullValueBreakComponent
};
}
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
private void checkLineWidth() {
if (lineWidthPane != null && lineTypeComboBox != null) {
lineWidthPane.setVisible(!ComparatorUtils.equals(lineTypeComboBox.getSelectedItem(), LineType.NONE));
}
}
public void checkLarge(boolean large) {
if (large) {
lineWidth.setSelectedLineStyle(Constants.LINE_NONE);
lineTypeComboBox.setSelectedItem(LineType.NONE);
}
lineWidth.setEnabled(!large);
lineTypeComboBox.setEnabled(!large);
lineStyle.setEnabled(!large);
}
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line");
return Toolkit.i18nText("Fine-Design_Chart_Line");
}
public void populate(VanChartAttrLine line) {
if (line == null) {
line = initVanChartAttrLine();
}
lineWidth.setSelectedLineStyle(line.getLineWidth());
lineTypeComboBox.setSelectedItem(line.getLineType());
lineWidthSpinner.setValue(line.getLineWidth());
lineStyle.setSelectedItem(line.getLineStyle());
nullValueBreak.setSelectedIndex(line.isNullValueBreak() ? 0 : 1);
}
@ -92,7 +152,8 @@ public class VanChartLineTypePane extends BasicPane {
public VanChartAttrLine update() {
VanChartAttrLine line = new VanChartAttrLine();
line.setLineWidth(lineWidth.getSelectedLineStyle());
line.setLineType((LineType) lineTypeComboBox.getSelectedItem());
line.setLineWidth(lineWidthSpinner.getValue());
line.setLineStyle(lineStyle.getSelectedItem());
line.setNullValueBreak(nullValueBreak.getSelectedIndex() == 0);
return line;

23
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java

@ -1,30 +1,17 @@
package com.fr.van.chart.designer.component;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.Component;
/**
* 线-线型
* 线型+线宽+空值断开
*/
public class VanChartLineWidthPane extends VanChartLineTypePane {
private static final long serialVersionUID = 4537158946119294689L;
protected JPanel createContentPane(double p, double f) {
double[] row = {p, p, p};
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] col = {f, e};
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")), nullValueBreak},
@Override
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
nullValueBreakComponent
};
return TableLayoutHelper.createTableLayoutPane(components, row, col);
}
}

286
designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java

@ -1,36 +1,39 @@
package com.fr.van.chart.designer.other;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.attr.LargeDataAttribute;
import com.fr.chartx.attr.LargeDataModeType;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
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.axis.type.AxisPlotType;
import com.fr.plugin.chart.base.AttrEffect;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.RefreshMoreLabel;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom;
import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.stable.StableUtils;
import com.fr.van.chart.custom.component.VanChartHyperLinkPane;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
@ -46,6 +49,10 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
protected UICheckBox fullScreenDisplay;
protected UIToggleButton collapse;
protected VanChart chart;
private UIComboBox largeDataMode;
private UISpinner largeModeThresholdNumber;
protected UIButtonGroup isChartAnimation;
//坐标轴翻转属性
@ -53,22 +60,15 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
private AutoRefreshPane autoRefreshPane;
private UIButtonGroup zoomWidget;
protected UIButtonGroup zoomGesture;//地图手势缩放
private UIButtonGroup zoomResize;
private TinyFormulaPane from;
private TinyFormulaPane to;
private UIButtonGroup<String> zoomType;
private JPanel changeEnablePane;
private JPanel zoomTypePane;
private ZoomPane zoomPane;
protected VanChartHyperLinkPane superLink;
protected Chart chart;
private JPanel largeModeThresholdNumberPane;
protected JPanel interactivePane;
/**
* 界面标题.
*
* @return 返回标题.
*/
@ -100,6 +100,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
Component[][] components = new Component[][]{
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null},
new Component[]{createLargeDataModePane(), null},
new Component[]{createAnimationPane(), null},
new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null},
new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null},
@ -110,55 +111,53 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
protected JPanel createZoomPane(double[] row, double[] col, VanChartPlot plot) {
if (!plot.isSupportZoomDirection()) {
private JPanel createLargeDataModePane() {
if (!isCurrentChartSupportLargeDataMode()) {
return null;
}
zoomWidget = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
zoomResize = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Change"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Non_Adjustment")});
from = new TinyFormulaPane();
to = new TinyFormulaPane();
zoomType = new UIButtonGroup(getNameArray(), getValueArray());
zoomGesture = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
JPanel zoomWidgetPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget"), zoomWidget);
JPanel zoomGesturePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ZoomGesture"), zoomGesture);
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Boundary")), zoomResize},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_From")), from},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_To")), to},
};
largeDataMode = new UIComboBox(new LargeDataModeType[]{LargeDataModeType.CLOSE, LargeDataModeType.OPEN_BEYOND_THRESHOLD});
largeModeThresholdNumber = new UISpinner(0, Integer.MAX_VALUE, 100, chart.getPlot().getLargeDataAttribute().getLargeModeThresholdNumber());
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
changeEnablePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize);
changeEnablePane.setBorder(BorderFactory.createEmptyBorder(10,12,0,0));
zoomTypePane = getzoomTypePane(zoomType);
JPanel panel = createZoomPaneContent(zoomWidgetPane, zoomGesturePane, changeEnablePane, zoomTypePane, plot);
zoomWidget.addActionListener(new ActionListener() {
largeDataMode.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkZoomPane();
checkLargeDataMode();
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), panel);
}
Component[][] comps1 = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Large_Model")), largeDataMode}
};
Component[][] comps2 = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Threshold_Number")), largeModeThresholdNumber}
};
double[] row = {TableLayout.PREFERRED}, col = {TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
protected JPanel getzoomTypePane(UIButtonGroup zoomType) {
return TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Direction"), zoomType);
JPanel contentPane = new JPanel(new BorderLayout(0, 6));
contentPane.add(TableLayout4VanChartHelper.createGapTableLayoutPane(comps1, row, col), BorderLayout.CENTER);
largeModeThresholdNumberPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps2, row, col);
contentPane.add(largeModeThresholdNumberPane, BorderLayout.SOUTH);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Large_Data"), contentPane);
}
protected boolean isCurrentChartSupportLargeDataMode() {
return false;
}
protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, JPanel changeEnablePane, JPanel zoomTypePane, VanChartPlot plot) {
JPanel panel = new JPanel(new BorderLayout(0, 4));
if (plot.isSupportZoomCategoryAxis()) {//支持缩放控件
panel.add(zoomWidgetPane, BorderLayout.NORTH);
panel.add(changeEnablePane, BorderLayout.CENTER);
protected JPanel createZoomPane(double[] row, double[] col, VanChartPlot plot) {
zoomPane = createZoomPane();
if (zoomPane == null) {
return null;
}
panel.add(zoomTypePane, BorderLayout.SOUTH);
return panel;
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), zoomPane);
}
protected ZoomPane createZoomPane() {
return null;
}
private JPanel createAxisRotationPane(double[] row, double[] col, VanChartPlot plot) {
@ -167,12 +166,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
axisRotation = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
axisRotation.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkZoomEnabled();
}
});
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Reversal")), axisRotation}
@ -181,28 +175,6 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel);
}
private void checkZoomEnabled() {
if (zoomWidget != null && axisRotation != null) {
if (axisRotation.getSelectedIndex() == 0) {
//只有开启坐标轴翻转,才需要将缩放控件强制关闭。
zoomWidget.setSelectedIndex(1);
}
checkZoomPane();
zoomWidget.setEnabled(axisRotation.getSelectedIndex() == 1);
}
}
protected String[] getNameArray() {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_X_Axis"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Y_Axis")
,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")};
}
protected String[] getValueArray() {
return new String[]{VanChartConstants.ZOOM_TYPE_X, VanChartConstants.ZOOM_TYPE_Y
,VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
}
protected JPanel createToolBarPane(double[] row, double[] col) {
isSort = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sort"));
@ -254,7 +226,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) {
boolean isLargeModel = largeModel(plot);
return new AutoRefreshPane((VanChart) chart, isLargeModel);
return new AutoRefreshPane(chart, isLargeModel);
}
protected JPanel createHyperlinkPane() {
@ -262,11 +234,42 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink);
}
private void checkLargeDataMode() {
largeModeThresholdNumberPane.setVisible(largeDataMode.getSelectedItem() == LargeDataModeType.OPEN_BEYOND_THRESHOLD);
resetAttr();
}
private void resetAttr() {
if (largeDataMode.getSelectedItem() == LargeDataModeType.OPEN_BEYOND_THRESHOLD) {
VanChartPlot plot = this.chart.getPlot();
AttrLabel attrLabel = plot.getAttrLabelFromConditionCollection();
if (attrLabel == null) {
attrLabel = plot.getDefaultAttrLabel();
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
defaultAttr.addDataSeriesCondition(attrLabel);
}
attrLabel.setEnable(false);
resetCustomCondition(plot.getConditionCollection());
}
}
private void resetCustomCondition(ConditionCollection conditionCollection) {
for (int i = 0, len = conditionCollection.getConditionAttrSize(); i < len; i++) {
ConditionAttr conditionAttr = conditionCollection.getConditionAttr(i);
conditionAttr.remove(AttrLabel.class);
conditionAttr.remove(ScatterAttrLabel.class);
conditionAttr.remove(AttrEffect.class);
conditionAttr.remove(AttrLineEffect.class);
private void checkZoomPane() {
boolean zoomWidgetEnabled = zoomWidget.getSelectedIndex() == 0;
changeEnablePane.setVisible(zoomWidgetEnabled);
zoomType.setEnabled(!zoomWidgetEnabled);
VanChartAttrMarker attrMarker = conditionAttr.getExisted(VanChartAttrMarker.class);
if (attrMarker != null && !attrMarker.isCommon()) {
conditionAttr.remove(VanChartAttrMarker.class);
}
}
}
@Override
@ -274,29 +277,28 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
if (chart == null || chart.getPlot() == null) {
return;
}
this.chart = chart;
VanChartPlot plot = (VanChartPlot)chart.getPlot();
this.chart = (VanChart) chart;
VanChartPlot plot = chart.getPlot();
if (interactivePane == null) {
this.remove(leftcontentPane);
reLayoutContentPane(plot);
}
if(plot.isSupportZoomDirection()){//支持缩放方向=方向+控件
populateChartZoom((VanChart)chart);
checkZoomPane();
if (zoomPane != null) {
zoomPane.populateBean(this.chart.getZoomAttribute());
}
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) {
populateChartAxisRotation(plot);
}
populateChartTools((VanChart) chart);
populateChartAnimate(chart, plot);
populateAutoRefresh((VanChart)chart);
populateChartTools(this.chart);
populateLargeMode(plot);
populateChartAnimate(this.chart, plot);
populateAutoRefresh(this.chart);
populateHyperlink(plot);
checkZoomEnabled();
}
@ -312,25 +314,13 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
collapse.setSelected(vanChartTools.isHidden());
}
private void populateChartZoom(VanChart chart) {
VanChartZoom zoom = chart.getVanChartZoom();
if(zoom == null){
zoom = new VanChartZoom();
}
zoomWidget.setSelectedIndex(zoom.isZoomVisible() ? 0 : 1);
zoomGesture.setSelectedIndex(zoom.isZoomGesture() ? 0 : 1);
zoomResize.setSelectedIndex(zoom.isZoomResize() ? 0 : 1);
if (zoom.getFrom() instanceof BaseFormula) {
from.populateBean(((BaseFormula) zoom.getFrom()).getContent());
} else {
from.populateBean(Utils.objectToString(zoom.getFrom()));
}
if (zoom.getTo() instanceof BaseFormula) {
to.populateBean(((BaseFormula) zoom.getTo()).getContent());
} else {
to.populateBean(Utils.objectToString(zoom.getTo()));
private void populateLargeMode(Plot plot) {
if (largeDataMode != null) {
LargeDataAttribute attribute = plot.getLargeDataAttribute();
largeDataMode.setSelectedItem(attribute.getLargeDataModeType());
largeModeThresholdNumber.setValue(attribute.getLargeModeThresholdNumber());
}
zoomType.setSelectedItem(zoom.getZoomType());
}
private void populateChartAxisRotation(VanChartPlot plot) {
@ -349,7 +339,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
protected void populateAutoRefresh(VanChart chart) {
VanChartPlot plot = (VanChartPlot)chart.getPlot();
VanChartPlot plot = chart.getPlot();
RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel();
if (refreshMoreLabel == null) {
@ -366,17 +356,20 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return;
}
VanChartPlot plot = (VanChartPlot)chart.getPlot();
VanChart vanChart = (VanChart) chart;
VanChartPlot plot = chart.getPlot();
if(plot.isSupportZoomDirection()){
updateChartZoom((VanChart)chart);
if (zoomPane != null) {
vanChart.setZoomAttribute(zoomPane.updateBean());
}
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) {
updateChartAxisRotation((VanChart)chart);
updateChartAxisRotation(vanChart);
}
updateChartTools((VanChart)chart);
updateChartAnimate(chart, plot);
updateAutoRefresh((VanChart)chart);
updateChartTools(vanChart);
updateChartAnimate(vanChart, plot);
updateLargeData(plot);
updateAutoRefresh(vanChart);
updateHyperlink(plot);
}
@ -393,37 +386,9 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
chart.setVanChartTools(vanChartTools);
}
private void updateChartZoom(VanChart chart) {
VanChartZoom zoom = chart.getVanChartZoom();
if(zoom == null){
zoom = new VanChartZoom();
chart.setVanChartZoom(zoom);
}
zoom.setZoomVisible(zoomWidget.getSelectedIndex() == 0);
zoom.setZoomGesture(zoomGesture.getSelectedIndex() == 0);
zoom.setZoomResize(zoomResize.getSelectedIndex() == 0);
String fromString = from.updateBean();
Object fromObject;
if (StableUtils.maybeFormula(fromString)) {
fromObject = BaseFormula.createFormulaBuilder().build(fromString);
} else {
fromObject = fromString;
}
zoom.setFrom(fromObject);
String toString = to.updateBean();
Object toObject;
if (StableUtils.maybeFormula(toString)) {
toObject = BaseFormula.createFormulaBuilder().build(toString);
} else {
toObject = toString;
}
zoom.setTo(toObject);
zoom.setZoomType(zoomType.getSelectedItem());
}
private void updateChartAxisRotation(VanChart chart) {
//坐标轴和plot都需要这个属性,因为坐标轴和plot是分开画的
VanChartPlot plot = (VanChartPlot) chart.getPlot();
VanChartPlot plot = chart.getPlot();
plot.setAxisRotation(axisRotation.getSelectedIndex() == 0);
//同时更新坐标轴旋转属性
for (VanChartAxis axis : ((VanChartRectanglePlot) plot).getXAxisList()) {
@ -440,6 +405,15 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
}
private void updateLargeData(Plot plot) {
if (largeDataMode != null) {
LargeDataAttribute attribute = new LargeDataAttribute();
attribute.setLargeDataModeType((LargeDataModeType) largeDataMode.getSelectedItem());
attribute.setLargeModeThresholdNumber(largeModeThresholdNumber.getValue());
plot.setLargeDataAttribute(attribute);
}
}
private void updateChartAnimate(Chart chart, Plot plot) {
if (plot.isSupportAnimate()) {
chart.setJSDraw(isChartAnimation.getSelectedIndex() == 0);
@ -458,7 +432,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
@Override
public Chart updateBean() {
public VanChart updateBean() {
return null;
}

14
designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePaneWithMapZoom.java

@ -1,19 +1,15 @@
package com.fr.van.chart.designer.other;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import com.fr.van.chart.designer.other.zoom.MapZoomPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
/**
* Created by mengao on 2017/4/7.
*/
public class VanChartInteractivePaneWithMapZoom extends VanChartInteractivePaneWithOutSort {
@Override
protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, JPanel changeEnablePane, JPanel zoomTypePane, VanChartPlot plot) {
JPanel panel = new JPanel(new BorderLayout(0, 4));
panel.add(zoomWidgetPane, BorderLayout.NORTH);
panel.add(zoomGesturePane, BorderLayout.CENTER);
return panel;
protected ZoomPane createZoomPane() {
return new MapZoomPane();
}
}

47
designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/MapZoomPane.java

@ -0,0 +1,47 @@
package com.fr.van.chart.designer.other.zoom;
import com.fr.chartx.attr.ZoomAttribute;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import java.awt.Component;
/**
* Created by shine on 2019/08/28.
*/
public class MapZoomPane extends ZoomPane {
private UIButtonGroup<Boolean> mapZoomWidget;//地图缩放控件
private UIButtonGroup<Boolean> gestureZoomGroup;//地图手势缩放
@Override
protected Component[][] getSouthComps() {
mapZoomWidget = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open")
, Toolkit.i18nText("Fine-Design_Chart_Close")}, new Boolean[]{true, false});
gestureZoomGroup = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open")
, Toolkit.i18nText("Fine-Design_Chart_Close")}, new Boolean[]{true, false});
return new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget")), mapZoomWidget},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_ZoomGesture")), gestureZoomGroup}
};
}
@Override
public void populateBean(ZoomAttribute ob) {
super.populateBean(ob);
mapZoomWidget.setSelectedItem(ob.isMapZoomWidget());
gestureZoomGroup.setSelectedItem(ob.isGestureZoom());
}
@Override
public ZoomAttribute updateBean() {
ZoomAttribute zoomAttribute = super.updateBean();
zoomAttribute.setMapZoomWidget(mapZoomWidget.getSelectedItem());
zoomAttribute.setGestureZoom(gestureZoomGroup.getSelectedItem());
return zoomAttribute;
}
}

224
designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/ZoomPane.java

@ -0,0 +1,224 @@
package com.fr.van.chart.designer.other.zoom;
import com.fr.chartx.attr.ZoomAttribute;
import com.fr.chartx.attr.ZoomInitialDisplayType;
import com.fr.chartx.attr.ZoomModeType;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.extended.chart.StringFormula;
import com.fr.general.ComparatorUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Arrays;
/**
* Created by shine on 2019/08/28.
*/
public class ZoomPane extends BasicBeanPane<ZoomAttribute> {
private UIButtonGroup<ZoomModeType> modeTypeButtonGroup;
private JPanel customModePane;
private UIComboBox initialDisplayTypeComboBox;
private JPanel initialDisplayCardPane;
private UISpinner topCategorySpinner;
private TinyFormulaPane leftFormulaPane;
private TinyFormulaPane rightFormulaPane;
private UIButtonGroup<Boolean> selectionZoomGroup;
public ZoomPane() {
initComponent();
}
private void initComponent() {
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double p = TableLayout.PREFERRED;
double[] columnSize = {f, e};
JPanel northPane = createNorthPane(f, p);
initCustomModePane(columnSize, p);
JPanel southPane = createSouthPane(f, p);
this.setLayout(new BorderLayout(0, 6));
if (northPane != null) {
this.add(northPane, BorderLayout.NORTH);
}
if (customModePane != null) {
this.add(customModePane, BorderLayout.CENTER);
}
if (southPane != null) {
this.add(southPane, BorderLayout.SOUTH);
}
}
protected JPanel createNorthPane(double f, double p) {
modeTypeButtonGroup = new UIButtonGroup<ZoomModeType>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"),
Toolkit.i18nText("Fine-Design_Chart_Mode_Custom"),
Toolkit.i18nText("Fine-Design_Chart_Close")
}, new ZoomModeType[]{ZoomModeType.AUTO, ZoomModeType.CUSTOM, ZoomModeType.CLOSE});
modeTypeButtonGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkCustomModePane();
}
});
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Mode_type")), modeTypeButtonGroup}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p}
, new double[]{f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH});
}
private JPanel createSouthPane(double f, double p) {
Component[][] components = getSouthComps();
double[] rows = new double[components.length];
Arrays.fill(rows, p);
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rows
, new double[]{f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH});
}
protected Component[][] getSouthComps() {
selectionZoomGroup = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open")
, Toolkit.i18nText("Fine-Design_Chart_Close")}, new Boolean[]{true, false});
return new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Selection_Zoom")), selectionZoomGroup}
};
}
protected void initCustomModePane(double[] columnSize, double p) {
initialDisplayTypeComboBox = new UIComboBox(new ZoomInitialDisplayType[]{
ZoomInitialDisplayType.TOP_CATEGORY,
ZoomInitialDisplayType.LEFT_RIGHT_BOUNDARY});
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_InitialDisplay")), initialDisplayTypeComboBox}
};
JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p}, columnSize);
initInitialDisplayCardPane(columnSize, p);
customModePane = new JPanel(new BorderLayout(0, 6));
customModePane.add(northPane, BorderLayout.NORTH);
customModePane.add(initialDisplayCardPane, BorderLayout.CENTER);
customModePane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
}
private void initInitialDisplayCardPane(double[] columnSize, double p) {
topCategorySpinner = new UISpinner(1, Integer.MAX_VALUE, 1);
Component[][] components1 = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Category_Number")), topCategorySpinner}
};
final JPanel topPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components1, new double[]{p}, columnSize);
leftFormulaPane = new TinyFormulaPane();
rightFormulaPane = new TinyFormulaPane();
Component[][] components2 = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Left_Boundary")), leftFormulaPane},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Right_Boundary")), rightFormulaPane}
};
final JPanel leftRightPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components2, new double[]{p, p}, columnSize);
initialDisplayCardPane = new JPanel(new CardLayout()) {
@Override
public Dimension getPreferredSize() {
return initialDisplayTypeComboBox.getSelectedIndex() == 0 ? topPane.getPreferredSize() : leftRightPane.getPreferredSize();
}
};
initialDisplayCardPane.add(topPane, ZoomInitialDisplayType.TOP_CATEGORY.toString());
initialDisplayCardPane.add(leftRightPane, ZoomInitialDisplayType.LEFT_RIGHT_BOUNDARY.toString());
initialDisplayTypeComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkInitialDisplayCardPane();
}
});
}
private void checkCustomModePane() {
customModePane.setVisible(modeTypeButtonGroup.getSelectedItem() == ZoomModeType.CUSTOM);
}
private void checkInitialDisplayCardPane() {
CardLayout cardLayout = (CardLayout) initialDisplayCardPane.getLayout();
if (ComparatorUtils.equals(initialDisplayTypeComboBox.getSelectedItem(), ZoomInitialDisplayType.TOP_CATEGORY)) {
cardLayout.show(initialDisplayCardPane, ZoomInitialDisplayType.TOP_CATEGORY.toString());
} else {
cardLayout.show(initialDisplayCardPane, ZoomInitialDisplayType.LEFT_RIGHT_BOUNDARY.toString());
}
}
@Override
public void populateBean(ZoomAttribute ob) {
modeTypeButtonGroup.setSelectedItem(ob.getModeType());
initialDisplayTypeComboBox.setSelectedItem(ob.getInitialDisplayType());
topCategorySpinner.setValue(ob.getTopCategory());
if (ob.getLeft() != null) {
leftFormulaPane.populateBean(ob.getLeft().getContent());
}
if (ob.getRight() != null) {
rightFormulaPane.populateBean(ob.getRight().getContent());
}
selectionZoomGroup.setSelectedItem(ob.isSelectionZoom());
checkInitialDisplayCardPane();
checkCustomModePane();
}
@Override
public ZoomAttribute updateBean() {
ZoomAttribute zoomAttribute = new ZoomAttribute();
zoomAttribute.setModeType(modeTypeButtonGroup.getSelectedItem());
zoomAttribute.setInitialDisplayType((ZoomInitialDisplayType) initialDisplayTypeComboBox.getSelectedItem());
zoomAttribute.setTopCategory((int) topCategorySpinner.getValue());
zoomAttribute.setLeft(new StringFormula(leftFormulaPane.updateBean()));
zoomAttribute.setRight(new StringFormula(rightFormulaPane.updateBean()));
zoomAttribute.setSelectionZoom(selectionZoomGroup.getSelectedItem());
return zoomAttribute;
}
@Override
protected String title4PopupWindow() {
return null;
}
}

17
designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/ZoomPaneWithOutMode.java

@ -0,0 +1,17 @@
package com.fr.van.chart.designer.other.zoom;
import javax.swing.JPanel;
/**
* Created by shine on 2019/08/28.
*/
public class ZoomPaneWithOutMode extends ZoomPane {
@Override
protected JPanel createNorthPane(double f, double p) {
return null;
}
@Override
protected void initCustomModePane(double[] columnSize, double p) {
}
}

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

@ -8,12 +8,11 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.stable.Constants;
@ -21,8 +20,8 @@ import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
@ -55,11 +54,8 @@ public class VanChartPlotLegendPane extends BasicPane {
protected UIButtonGroup<Integer> location;
protected UIToggleButton customFloatPositionButton;
protected VanChartFloatPositionPane customFloatPositionPane;
protected UIButtonGroup<Integer> limitSize;
protected UISpinner maxProportion;
private UILabel limitSizeTitle;
private JPanel maxProportionPane;
private LimitPane limitPane;
//高亮显示的按钮
protected UIButtonGroup<Boolean> highlightButton;
@ -232,25 +228,8 @@ public class VanChartPlotLegendPane extends BasicPane {
}
protected JPanel createDisplayStrategy(){
maxProportion = new UISpinner(0,100,1,30);
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
limitSizeTitle = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"));
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"),limitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"),maxProportion,TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
limitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return panel;
limitPane = new LimitPane(false);
return limitPane;
}
private JPanel createHighlightPane(){
@ -276,15 +255,8 @@ public class VanChartPlotLegendPane extends BasicPane {
//检查显示策略界面是否可用
protected void checkDisplayStrategyUse() {
limitSize.setEnabled(!customFloatPositionButton.isSelected());
checkMaxProPortionUse();
}
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
limitPane.checkMaxProPortionUse();
}
protected void checkBoxUse() {
@ -315,8 +287,7 @@ public class VanChartPlotLegendPane extends BasicPane {
legend.setPosition(-1);
}
legend.setFloating(customFloatPositionButton.isSelected());
legend.setLimitSize(limitSize.getSelectedIndex() == 0);
legend.setMaxHeight(maxProportion.getValue());
legend.setLimitAttribute(limitPane.updateBean());
legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());
legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y());
if(highlightButton != null && highlightButton.getSelectedItem() != null){
@ -336,8 +307,7 @@ public class VanChartPlotLegendPane extends BasicPane {
customFloatPositionButton.setSelected(legend.isFloating());
customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY());
limitSize.setSelectedIndex(legend.isLimitSize() ? 0 : 1);
maxProportion.setValue(legend.getMaxHeight());
limitPane.populateBean(legend.getLimitAttribute());
if(highlightButton != null){
highlightButton.setSelectedItem(legend.isHighlight());
}

19
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java

@ -192,26 +192,13 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane {
public void populateBean(VanChartLegend legend) {
VanChartRangeLegend scatterLegend = (VanChartRangeLegend)legend;
if (scatterLegend != null) {
isLegendVisible.setSelected(scatterLegend.isLegendVisible());
textAttrPane.populate(scatterLegend.getFRFont());
borderPane.populate(scatterLegend);
backgroundPane.populate(scatterLegend);
if(!scatterLegend.isFloating()){
location.setSelectedItem(scatterLegend.getPosition());
}
customFloatPositionButton.setSelected(scatterLegend.isFloating());
customFloatPositionPane.setFloatPosition_x(scatterLegend.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(scatterLegend.getFloatPercentY());
limitSize.setSelectedIndex(scatterLegend.isLimitSize() ? 0 : 1);
maxProportion.setValue(scatterLegend.getMaxHeight());
super.populateBean(scatterLegend);
//范围图例部分
legendTypeButton.setSelectedItem(scatterLegend.getLegendType());
gradualLegendPane.populate(scatterLegend.getGradualLegend());
sectionLegendPane.populate(scatterLegend.getSectionLegend());
if(highlightButton != null){
highlightButton.setSelectedItem(legend.isHighlight());
}
}
checkAllUse();
this.checkHighlightVisible();

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

@ -11,12 +11,11 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartTitle;
import com.fr.plugin.chart.vanchart.VanChart;
@ -27,8 +26,8 @@ import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
@ -60,9 +59,8 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private UIToggleButton useHtml;
private UIToggleButton customFloatPositionButton;
private VanChartFloatPositionPane customFloatPositionPane;
private UIButtonGroup<Integer> limitSize;
private UISpinner maxProportion;
private JPanel maxProportionPane;
private LimitPane limitPane;
protected VanChartStylePane parent;
@ -171,24 +169,8 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
}
private JPanel createDisplayStrategy(){
maxProportion = new UISpinner(0,100,1,30);
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"),limitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"),maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
limitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
limitPane = new LimitPane();
return limitPane;
}
private void initPositionListener(){
@ -250,15 +232,10 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
//检查显示策略界面是否可用
private void checkDisplayStrategyUse() {
limitSize.setEnabled(!customFloatPositionButton.isSelected());
checkMaxProPortionUse();
GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
limitPane.checkMaxProPortionUse();
}
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
}
/**
* 弹出框的界面标题
@ -301,8 +278,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
customFloatPositionButton.setSelected(title.isFloating());
customFloatPositionPane.setFloatPosition_x(title.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(title.getFloatPercentY());
limitSize.setSelectedIndex(title.isLimitSize() ? 0 : 1);
maxProportion.setValue(title.getMaxHeight());
limitPane.populateBean(title.getLimitAttribute());
checkAllUse();
}
@ -335,8 +311,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
}
title.setUseHtml(useHtml.isSelected());
title.setFloating(customFloatPositionButton.isSelected());
title.setLimitSize(limitSize.getSelectedIndex() == 0);
title.setMaxHeight(maxProportion.getValue());
title.setLimitAttribute(limitPane.updateBean());
title.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());
title.setFloatPercentY(customFloatPositionPane.getFloatPosition_y());
textAttrPane.update(textAttr);

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

@ -13,8 +13,8 @@ import com.fr.design.gui.ibutton.UIToggleButton;
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.itextfield.UITextField;
import com.fr.design.gui.style.FormatPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
@ -23,19 +23,24 @@ 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.attr.axis.VanChartAxis;
import com.fr.plugin.chart.base.OverlapHandleType;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.type.AxisTickLineType;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
@ -58,10 +63,14 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected UIButtonGroup showLabel;
protected ChartTextAttrPane labelTextAttrPane;
protected UINumberDragPane labelTextRotation;
private UIButtonGroup<OverlapHandleType> overlapHandleTypeGroup;
protected UIButtonGroup<Integer> labelGapStyle;
protected UITextField labelGapValue;
protected JPanel labelPanel;
protected UISpinner labelGapValue;
protected JPanel labelPanel;
private JPanel labelGapStylePane;
private JPanel labelGapValuePane;
protected LineComboBox axisLineStyle;
protected ColorSelectBox axisLineColor;
@ -71,15 +80,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected UIButtonGroup<Integer> position;
protected UIButtonGroup<Boolean> reversed;
protected UIButtonGroup<Integer> axisLimitSize;
protected UISpinner maxProportion;
protected JPanel maxProportionPane;
private LimitPane limitPane;
protected UIButtonGroup valueFormatStyle;
protected FormatPane valueFormat;
protected JPanel centerPane;
private VanChartHtmlLabelPane htmlLabelPane;
private JPanel labelGapValuePane;
public VanChartBaseAxisPane(){
this(true);
@ -166,32 +172,22 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
}
protected JPanel createLabelPane(double[] row, double[] col){
double p = TableLayout.PREFERRED;
showLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Show"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hidden")});
labelTextAttrPane = getChartTextAttrPane();
labelTextRotation = new UINumberDragPane(-ROTATION_MAX,ROTATION_MAX);
labelGapStyle = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fixed")});
labelGapValue = new UITextField();
Component[][] gapComponents = new Component[][]{
new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")),
UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle},
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col);
labelGapValuePane= TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText(""),labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
JPanel gapPanel = new JPanel(new BorderLayout());
gapPanel.add(panel, BorderLayout.CENTER);
gapPanel.add(labelGapValuePane, BorderLayout.SOUTH);
JPanel rotationPane = createLabelRotationPane(col);
JPanel overlapPane = createLabelOverlapPane();
Component[][] components = new Component[][]{
new Component[]{labelTextAttrPane, null},
new Component[]{gapPanel,null},
new Component[]{rotationPane, null},
new Component[]{overlapPane, null},
};
JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label"),showLabel);
labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, col);
labelPanel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0));
showLabel.addActionListener(new ActionListener() {
@Override
@ -199,16 +195,61 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
checkLabelPane();
}
});
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(showLabelPane, BorderLayout.NORTH);
jPanel.add(labelPanel, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, jPanel);
}
private JPanel createLabelRotationPane(double[] col) {
labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX);
Component[][] gapComponents = new Component[][]{
new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")),
UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation)
}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, new double[]{TableLayout.PREFERRED}, col);
}
private JPanel createLabelOverlapPane() {
labelGapStyle = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")});
labelGapStylePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Label_Interval"), labelGapStyle, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
labelGapValue = new UISpinner(0, Integer.MAX_VALUE, 1, 1);
labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(StringUtils.EMPTY, labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
JPanel panel = new JPanel(new BorderLayout(0, 0));
addOverlapGroupButton(panel);
panel.add(labelGapStylePane, BorderLayout.CENTER);
panel.add(labelGapValuePane, BorderLayout.SOUTH);
labelGapStyle.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkLabelGapValuePane();
}
});
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(showLabelPane, BorderLayout.NORTH);
jPanel.add(labelPanel, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, jPanel);
return panel;
}
protected void addOverlapGroupButton(JPanel panel) {
overlapHandleTypeGroup = new UIButtonGroup<OverlapHandleType>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Label_OverlapAbbreviate"), Toolkit.i18nText("Fine-Design_Chart_Label_OverlapInterval")},
new OverlapHandleType[]{OverlapHandleType.ABBREVIATE, OverlapHandleType.INTERVAL});
JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Label_WhenOverlap"), overlapHandleTypeGroup, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
panel.add(north, BorderLayout.NORTH);
overlapHandleTypeGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkLabelGapAndStylePane();
}
});
}
protected ChartTextAttrPane getChartTextAttrPane(){
@ -286,24 +327,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
}
protected JPanel createDisplayStrategy(double[] row, double[] col){
maxProportion = new UISpinner(0,100,1,30);
axisLimitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"),axisLimitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"),maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
axisLimitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
limitPane = new LimitPane();
return limitPane;
}
protected JPanel createValueStylePane(){
@ -360,7 +385,6 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected void checkAllUse() {
checkCardPane();
checkLabelPane();
checkMaxProPortionUse();
}
protected void checkCardPane() {
@ -381,24 +405,31 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
labelPanel.setVisible(enabled);
}
if(enabled){
checkLabelGapValuePane();
checkLabelGapAndStylePane();
}
}
}
protected void checkLabelGapValuePane() {
if(labelGapValuePane != null && labelGapStyle != null){
labelGapValuePane.setVisible(labelGapStyle.getSelectedIndex() == 1);
private void checkLabelGapAndStylePane() {
if (overlapHandleTypeGroup != null && labelGapStylePane != null) {
boolean visible = overlapHandleTypeGroup.getSelectedItem() == OverlapHandleType.INTERVAL;
labelGapStylePane.setVisible(visible);
}
checkLabelGapValuePane();
}
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
if(maxProportionPane != null && axisLimitSize != null){
maxProportionPane.setVisible(axisLimitSize.getSelectedIndex() == 0 && axisLimitSize.isEnabled());
protected void checkLabelGapValuePane() {
if (labelGapValuePane != null && labelGapStyle != null) {
boolean visible = labelGapStyle.getSelectedIndex() == 1;
if (overlapHandleTypeGroup != null) {
visible = visible && overlapHandleTypeGroup.getSelectedItem() == OverlapHandleType.INTERVAL;
}
labelGapValuePane.setVisible(visible);
}
}
/**
* 是否是指定类型
* @param ob 对象
@ -477,11 +508,14 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
if(labelTextRotation != null){
labelTextRotation.populateBean((double)labelTextAttr.getRotation());
}
if (overlapHandleTypeGroup != null) {
overlapHandleTypeGroup.setSelectedItem(axis.getOverlapHandleType());
}
if(labelGapStyle != null){
labelGapStyle.setSelectedIndex(axis.isAutoLabelGap() ? 0 : 1);
}
if(labelGapValue != null){
labelGapValue.setText(axis.getLabelNumber().getContent());
labelGapValue.setValue(axis.getIntervalNumber());
}
}
@ -516,13 +550,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//显示策略
private void populateDisplayStrategy(VanChartAxis axis) {
if(axisLimitSize != null){
axisLimitSize.setSelectedIndex(axis.isLimitSize() ? 0 : 1);
if (limitPane != null) {
limitPane.populateBean(axis.getLimitAttribute());
}
if(maxProportion != null){
maxProportion.setValue(axis.getMaxHeight());
}
}
//格式
@ -597,15 +627,14 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
if(labelTextRotation != null){
labelTextAttr.setRotation(labelTextRotation.updateBean().intValue());
}
if (overlapHandleTypeGroup != null) {
axis.setOverlapHandleType(overlapHandleTypeGroup.getSelectedItem());
}
if(labelGapStyle != null){
axis.setAutoLabelGap(labelGapStyle.getSelectedIndex() == 0);
}
if(labelGapValue != null){
if(axis.isAutoLabelGap()){
axis.setLabelIntervalNumber(BaseFormula.createFormulaBuilder().build("1"));
} else {
axis.setLabelIntervalNumber(BaseFormula.createFormulaBuilder().build(labelGapValue.getText()));
}
axis.setIntervalNumber((int) labelGapValue.getValue());
}
}
@ -637,11 +666,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//显示策略
private void updateDisplayStrategy(VanChartAxis axis){
if(axisLimitSize != null){
axis.setLimitSize(axisLimitSize.getSelectedIndex() == 0);
}
if(maxProportion != null){
axis.setMaxHeight(maxProportion.getValue());
if (limitPane != null) {
axis.setLimitAttribute(limitPane.updateBean());
}
}

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

@ -17,7 +17,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartTimeAxis;
import com.fr.plugin.chart.base.VanChartConstants;
@ -80,6 +79,10 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
@Override
protected void addOverlapGroupButton(JPanel panel) {
}
private JPanel createValueDefinition(){
timeMinMaxValuePane = new TimeMinMaxValuePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), timeMinMaxValuePane);

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

@ -7,7 +7,6 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
import com.fr.stable.StringUtils;
@ -61,6 +60,10 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
@Override
protected void addOverlapGroupButton(JPanel panel) {
}
protected JPanel createMinMaxValuePane(double[] row, double[] col){
JPanel panel = createCommenValuePane(row,col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), panel);

85
designer-chart/src/main/java/com/fr/van/chart/designer/style/component/LimitPane.java

@ -0,0 +1,85 @@
package com.fr.van.chart.designer.style.component;
import com.fr.chartx.attr.LimitAttribute;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by shine on 2019/08/28.
*/
public class LimitPane extends BasicBeanPane<LimitAttribute> {
private UIButtonGroup<Boolean> autoCustomTypeGroup;
private UISpinner maxProportion;
private JPanel maxProportionPane;
public LimitPane() {
this(true);
}
public LimitPane(boolean hasTitle) {
initComponent(hasTitle);
}
private void initComponent(boolean hasTitle) {
maxProportion = new UISpinner(0, 100, 1, 30);
autoCustomTypeGroup = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto")
, Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")}, new Boolean[]{true, false});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), autoCustomTypeGroup);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
autoCustomTypeGroup.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
this.setLayout(new BorderLayout());
if (hasTitle) {
JPanel contentPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
this.add(contentPane);
} else {
this.add(panel);
}
}
//检查最大显示占比是否可用
public void checkMaxProPortionUse() {
maxProportion.setVisible(!autoCustomTypeGroup.getSelectedItem() && autoCustomTypeGroup.isEnabled());
maxProportionPane.setVisible(!autoCustomTypeGroup.getSelectedItem() && autoCustomTypeGroup.isEnabled());
}
@Override
public void populateBean(LimitAttribute ob) {
autoCustomTypeGroup.setSelectedItem(ob.isAuto());
maxProportion.setValue(ob.getMaxSize());
}
@Override
public LimitAttribute updateBean() {
LimitAttribute attribute = new LimitAttribute();
attribute.setAuto(autoCustomTypeGroup.getSelectedItem());
attribute.setMaxSize(maxProportion.getValue());
return attribute;
}
@Override
protected String title4PopupWindow() {
return null;
}
}

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

@ -5,20 +5,23 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox;
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.chart.gui.style.ChartTextAttrPane;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.plugin.chart.attr.plot.VanChartLabelPositionPlot;
import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.OverlapHandleType;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
@ -38,7 +41,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
protected BasicBeanPane<AttrTooltipContent> dataLabelContentPane;
protected UIButtonGroup<Integer> position;
protected UIButtonGroup<Boolean> autoAdjust;
private UIButtonGroup<Boolean> allowOverlap;
private UIComboBox overlapHandleType;
protected UIToggleButton tractionLine;
protected UIButtonGroup<Integer> style;
@ -118,8 +124,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
position = new UIButtonGroup<Integer>(names, values);
autoAdjust = new UIButtonGroup<Boolean>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
allowOverlap = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"),
Toolkit.i18nText("Fine-Design_Chart_NO")}, new Boolean[]{true, false});
overlapHandleType = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Chart_Label_OverlapHide"),
Toolkit.i18nText("Fine-Design_Chart_Label_OverlapAdjust")});
Component[][] comps = new Component[2][2];
@ -134,13 +143,33 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
panel.add(tractionLinePane, BorderLayout.SOUTH);
initPositionListener();
} else if(PlotFactory.plotAutoAdjustLabelPosition(plot)){
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"),autoAdjust), BorderLayout.SOUTH);
panel.add(createOverlapLabelPane(), BorderLayout.SOUTH);
}
return panel;
}
return new JPanel();
}
private JPanel createOverlapLabelPane() {
allowOverlap.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkOverlap();
}
});
JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Label_AllowOverlap"), allowOverlap);
JPanel center = new JPanel(new BorderLayout());
center.add(overlapHandleType, BorderLayout.CENTER);
center.setBorder(BorderFactory.createEmptyBorder(0, 78, 0, 0));
JPanel result = new JPanel(new BorderLayout(0, 6));
result.add(north, BorderLayout.NORTH);
result.add(center, BorderLayout.CENTER);
return result;
}
protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){
JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col);
return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel);
@ -208,11 +237,17 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
private void checkAllUse() {
checkStyleUse();
if(tractionLine == null){
return;
}
checkOverlap();
if (tractionLine != null) {
checkPositionEnabled();
}
}
private void checkOverlap() {
if (overlapHandleType != null && allowOverlap != null) {
overlapHandleType.setVisible(!allowOverlap.getSelectedItem());
}
}
private void checkStyleUse() {
textFontPane.setVisible(style.getSelectedIndex() == 1);
@ -235,8 +270,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
if(tractionLine != null){
tractionLine.setSelected(detail.isShowGuidLine());
}
if(autoAdjust != null){
autoAdjust.setSelectedIndex(detail.isAutoAdjust() == true ? 0 : 1);
if (allowOverlap != null) {
allowOverlap.setSelectedItem(detail.isAllowOverlap());
}
if (overlapHandleType != null) {
overlapHandleType.setSelectedIndex(detail.getOverlapHandleType() == OverlapHandleType.HIDE ? 0 : 1);
}
style.setSelectedIndex(detail.isCustom() ? 1 : 0);
textFontPane.populate(detail.getTextAttr());
@ -259,7 +297,13 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
position.setSelectedItem(detail.getPosition());
}
detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem());
if (allowOverlap != null) {
detail.setAllowOverlap(allowOverlap.getSelectedItem());
}
if (overlapHandleType != null) {
detail.setOverlapHandleType(overlapHandleType.getSelectedIndex() == 0 ? OverlapHandleType.HIDE : OverlapHandleType.ADJUST);
}
if(tractionLine != null){
detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE);

111
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -1,8 +1,5 @@
package com.fr.van.chart.designer.style.series;
import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.base.chart.chartdata.model.LargeDataModel;
import com.fr.base.chart.chartdata.model.NormalDataModel;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.ChartConstants;
@ -10,11 +7,9 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane;
import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane;
import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
@ -28,6 +23,7 @@ import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.van.chart.custom.style.VanChartCustomStylePane;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane;
import com.fr.van.chart.designer.component.VanChartBeautyPane;
@ -41,8 +37,6 @@ import com.fr.van.chart.pie.RadiusCardLayoutPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
/**
@ -73,8 +67,6 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
private RadiusCardLayoutPane radiusPane;//半径设置界面
private JPanel radiusPaneWithTitle;
private UIButtonGroup<DataProcessor> largeDataModelGroup;//大数据模式
protected JPanel contentPane;
public VanChartAbstractPlotSeriesPane(ChartStylePane parent, Plot plot) {
@ -168,77 +160,23 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
return ((VanChartPlot) plot).isInCustom() ? null : radiusPaneWithTitle;
}
protected JPanel createLargeDataModelPane() {
largeDataModelGroup = createLargeDataModelGroup();
largeDataModelGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkLarge();
}
});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), largeDataModelGroup);
return createLargeDataModelPane(panel);
}
protected void checkLarge() {
if(largeModel()) {
AttrLabel attrLabel = ((VanChartPlot) plot).getAttrLabelFromConditionCollection();
if (attrLabel == null) {
attrLabel = ((VanChartPlot) this.plot).getDefaultAttrLabel();
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
defaultAttr.addDataSeriesCondition(attrLabel);
}
attrLabel.setEnable(false);
resetCustomCondition(plot.getConditionCollection());
}
checkCompsEnabledWithLarge();
}
protected void checkCompsEnabledWithLarge() {
if(markerPane != null && largeDataModelGroup != null){
markerPane.checkLargePlot(largeModel());
protected void checkCompsEnabledWithLarge(Plot plot) {
if (markerPane != null) {
markerPane.checkLargePlot(largeModel(plot));
}
}
protected void checkLinePane() {
if(lineTypePane != null && largeDataModelGroup != null){
lineTypePane.checkLarge(largeModel());
}
if (lineTypePane != null) {
lineTypePane.checkLarge(largeModel(plot));
}
protected boolean largeModel() {
return largeDataModelGroup != null && largeDataModelGroup.getSelectedIndex() == 0;
}
protected void resetCustomCondition(ConditionCollection conditionCollection) {
for(int i = 0, len = conditionCollection.getConditionAttrSize(); i < len; i++){
ConditionAttr conditionAttr = conditionCollection.getConditionAttr(i);
conditionAttr.remove(AttrLabel.class);
conditionAttr.remove(ScatterAttrLabel.class);
conditionAttr.remove(AttrEffect.class);
conditionAttr.remove(AttrLineEffect.class);
VanChartAttrMarker attrMarker = conditionAttr.getExisted(VanChartAttrMarker.class);
if(attrMarker != null && !attrMarker.isCommon()){
conditionAttr.remove(VanChartAttrMarker.class);
}
}
}
protected JPanel createLargeDataModelPane(JPanel jPanel) {
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel);
return panel;
protected boolean largeModel(Plot plot) {
return PlotFactory.largeDataModel(plot);
}
protected UIButtonGroup<DataProcessor> createLargeDataModelGroup() {
String[] strings = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")};
DataProcessor[] values = new DataProcessor[]{new LargeDataModel(), new NormalDataModel()};
return new UIButtonGroup<DataProcessor>(strings, values);
}
protected RadiusCardLayoutPane initRadiusPane() {
return new RadiusCardLayoutPane();
@ -284,10 +222,6 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
stylePane.populateBean(plot.getPlotStyle());
}
if(largeDataModelGroup != null){
largeDataModelGroup.setSelectedItem(plot.getDataProcessor());
}
if (stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot) {//堆积和坐标轴
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
if (rectanglePlot.isCustomChart()) {
@ -306,11 +240,12 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
checkAreaSeriesFillColorPane(plot.getPlotStyle());
checkCompsEnabledWithLarge();
checkCompsEnabledWithLarge(plot);
}
/**
* radius界面是否显示
*
* @param plot
*/
private void checkRadiusPane(Plot plot) {
@ -339,10 +274,6 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
plot.setPlotStyle(stylePane.updateBean());
}
if(largeDataModelGroup != null){
plot.setDataProcessor(largeDataModelGroup.getSelectedItem());
}
if (stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot) {//堆积和坐标轴
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
if (rectanglePlot.isCustomChart()) {
@ -373,23 +304,23 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
protected void populateCondition(ConditionAttr defaultAttr) {
if (trendLinePane != null) {//趋势线
VanChartAttrTrendLine attrTrendLine =(VanChartAttrTrendLine)defaultAttr.getExisted(VanChartAttrTrendLine.class);
VanChartAttrTrendLine attrTrendLine = defaultAttr.getExisted(VanChartAttrTrendLine.class);
trendLinePane.populate(attrTrendLine);
}
if (lineTypePane != null) {//线-线型、控制断开等
VanChartAttrLine attrLine = (VanChartAttrLine)defaultAttr.getExisted(VanChartAttrLine.class);
VanChartAttrLine attrLine = defaultAttr.getExisted(VanChartAttrLine.class);
lineTypePane.populate(attrLine);
}
if (markerPane != null) {//标记点
VanChartAttrMarker attrMarker = (VanChartAttrMarker)defaultAttr.getExisted(VanChartAttrMarker.class);
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
markerPane.populate(attrMarker);
}
if (areaSeriesFillColorPane != null) {//填充颜色
AttrAreaSeriesFillColorBackground seriesFillColorBackground = (AttrAreaSeriesFillColorBackground)defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class);
AttrAreaSeriesFillColorBackground seriesFillColorBackground = defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class);
areaSeriesFillColorPane.populate(seriesFillColorBackground);
}
if (borderPane != null) {//边框
AttrBorder attrBorder = (AttrBorder)defaultAttr.getExisted(AttrBorder.class);
AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class);
if (attrBorder != null) {
borderPane.populate(attrBorder);
}
@ -399,7 +330,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
protected void populateAlpha(ConditionAttr defaultAttr) {
if (transparent != null) {//不透明度
AttrAlpha attrAlpha = (AttrAlpha)defaultAttr.getExisted(AttrAlpha.class);
AttrAlpha attrAlpha = defaultAttr.getExisted(AttrAlpha.class);
if (attrAlpha != null) {
transparent.populateBean(attrAlpha.getAlpha() * VanChartAttrHelper.PERCENT);
} else {
@ -412,18 +343,18 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
protected void updateCondition(ConditionAttr defaultAttr) {
if (trendLinePane != null) {
VanChartAttrTrendLine newTrendLine = trendLinePane.update();
VanChartAttrTrendLine attrTrendLine =(VanChartAttrTrendLine)defaultAttr.getExisted(VanChartAttrTrendLine.class);
VanChartAttrTrendLine attrTrendLine = defaultAttr.getExisted(VanChartAttrTrendLine.class);
defaultAttr.remove(attrTrendLine);
defaultAttr.addDataSeriesCondition(newTrendLine);
}
if (lineTypePane != null) {
VanChartAttrLine attrLine = (VanChartAttrLine)defaultAttr.getExisted(VanChartAttrLine.class);
VanChartAttrLine attrLine = defaultAttr.getExisted(VanChartAttrLine.class);
defaultAttr.remove(attrLine);
defaultAttr.addDataSeriesCondition(lineTypePane.update());
}
if (markerPane != null) {
VanChartAttrMarker newMarker = markerPane.update();
VanChartAttrMarker attrMarker = (VanChartAttrMarker)defaultAttr.getExisted(VanChartAttrMarker.class);
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
defaultAttr.remove(attrMarker);
defaultAttr.addDataSeriesCondition(newMarker);
}
@ -436,7 +367,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
defaultAttr.addDataSeriesCondition(newFillColorBackground);
}
if (borderPane != null) {
AttrBorder attrBorder = (AttrBorder)defaultAttr.getExisted(AttrBorder.class);
AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class);
if (attrBorder == null) {
attrBorder = new AttrBorder();
defaultAttr.addDataSeriesCondition(attrBorder);
@ -448,7 +379,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
protected void updateAlpha(ConditionAttr defaultAttr) {
if (transparent != null) {
AttrAlpha attrAlpha = (AttrAlpha)defaultAttr.getExisted(AttrAlpha.class);
AttrAlpha attrAlpha = defaultAttr.getExisted(AttrAlpha.class);
if (attrAlpha == null) {
attrAlpha = new AttrAlpha();
defaultAttr.addDataSeriesCondition(attrAlpha);

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

@ -7,6 +7,7 @@ import com.fr.chart.chartattr.Plot;
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.design.ChartTypeInterfaceManager;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.MultilineLabel;
@ -17,7 +18,6 @@ import com.fr.js.NameJavaScriptGroup;
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.base.VanChartZoom;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.JPanel;
@ -116,7 +116,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Cha
protected void resetChartAttr(Chart chart, Plot newPlot){
chart.setPlot(newPlot);
if(newPlot.isSupportZoomDirection() && !newPlot.isSupportZoomCategoryAxis()){
((VanChart)chart).setVanChartZoom(new VanChartZoom());
((VanChart) chart).setZoomAttribute(new ZoomAttribute());
}
//重置工具栏选项
((VanChart)chart).setVanChartTools(createVanChartTools());

8
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java

@ -6,9 +6,9 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithOutImageAndShadow;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithMapZoom;
@ -123,8 +123,8 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
if (chart == null || chart.getPlot() == null) {
return;
}
this.chart = chart;
VanChartPlot plot = (VanChartPlot)chart.getPlot();
this.chart = (VanChart) chart;
VanChartPlot plot = chart.getPlot();
if (plot instanceof VanChartDrillMapPlot) {
DrillMapTools drillMapTools = ((VanChartDrillMapPlot) plot).getDrillMapTools();
openOrClose.setSelectedIndex(drillMapTools.isEnable() ? 0 : 1);
@ -145,7 +145,7 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
return;
}
VanChartPlot plot = (VanChartPlot) chart.getPlot();
VanChartPlot plot = chart.getPlot();
if (plot instanceof VanChartDrillMapPlot) {
DrillMapTools drillMapTools = ((VanChartDrillMapPlot) plot).getDrillMapTools();

8
designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java

@ -71,13 +71,19 @@ public class HeatMapIndependentVanChartInterface extends MapIndependentVanChartI
/**
* 图表的属性界面数组
*
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartMapStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane() {
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePaneWithMapZoom();
return new VanChartInteractivePaneWithMapZoom() {
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};

1
designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java

@ -29,7 +29,6 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane{
new Component[]{createLineTypePane()},
new Component[]{createMarkerPane()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()},
};

89
designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

@ -1,6 +1,5 @@
package com.fr.van.chart.map;
import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPane;
@ -12,7 +11,6 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.base.AttrBorderWithAlpha;
import com.fr.plugin.chart.base.AttrEffect;
@ -21,7 +19,6 @@ import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.attr.AttrMapLabel;
import com.fr.plugin.chart.map.line.condition.AttrCurve;
import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.type.MapMarkerType;
@ -79,7 +76,6 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
//line
private VanChartCurvePane curvePane;
private VanChartLineMapEffectPane lineMapEffectPane;
private UIButtonGroup<DataProcessor> lineMapLargeDataModelGroup;//大数据模式
private MapType mapType = MapType.AREA;
@ -87,53 +83,20 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
super(parent, plot);
}
@Override
protected void checkLarge() {
if(largeModel()) {
if(plot instanceof VanChartMapPlot) {
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
AttrMapLabel attrMapLabel = defaultAttr.getExisted(AttrMapLabel.class);
if(attrMapLabel == null){
attrMapLabel = new AttrMapLabel();
defaultAttr.addDataSeriesCondition(attrMapLabel);
}
attrMapLabel.getPointLabel().setEnable(false);
resetCustomCondition(((VanChartMapPlot) plot).getPointConditionCollection());
}
}
checkPointCompsEnabledWithLarge();
}
protected void checkCompsEnabledWithLarge() {
checkPointCompsEnabledWithLarge();
checkLineCompsEnabledWithLarge();
protected void checkCompsEnabledWithLarge(Plot plot) {
checkPointCompsEnabledWithLarge(plot);
checkLineCompsEnabledWithLarge(plot);
}
private void checkPointCompsEnabledWithLarge() {
private void checkPointCompsEnabledWithLarge(Plot plot) {
if (pointEffectPane != null) {
GUICoreUtils.setEnabled(pointEffectPane, !largeModel());
}
}
private boolean lineMapLargeModel() {
return lineMapLargeDataModelGroup != null && lineMapLargeDataModelGroup.getSelectedIndex() == 0;
GUICoreUtils.setEnabled(pointEffectPane, !largeModel(plot));
}
private void checkLineMapLarge() {
if(lineMapLargeModel()) {
if(plot instanceof VanChartMapPlot) {
resetCustomCondition(((VanChartMapPlot) plot).getLineConditionCollection());
}
}
checkLineCompsEnabledWithLarge();
}
private void checkLineCompsEnabledWithLarge() {
private void checkLineCompsEnabledWithLarge(Plot plot) {
if (lineMapEffectPane != null) {
GUICoreUtils.setEnabled(lineMapEffectPane, !lineMapLargeModel());
GUICoreUtils.setEnabled(lineMapEffectPane, !largeModel(plot));
}
}
@ -195,7 +158,6 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
Component[][] components = new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), createPointAlphaPane())},
new Component[]{createMarkerComPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createPointEffectPane()},
};
@ -212,25 +174,12 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
Component[][] components = new Component[][]{
new Component[]{createCurvePane()},
new Component[]{createLineMapLargeDataModelPane()},
new Component[]{createAnimationPane()}
};
return TableLayoutHelper.createTableLayoutPane(components, row, col);
}
private JPanel createLineMapLargeDataModelPane() {
lineMapLargeDataModelGroup = createLargeDataModelGroup();
lineMapLargeDataModelGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkLineMapLarge();
}
});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), lineMapLargeDataModelGroup);
return createLargeDataModelPane(panel);
}
private Component createCurvePane() {
curvePane = new VanChartCurvePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane);
@ -382,9 +331,6 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
if (nullValueColorBox != null) {
nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor());
}
if(lineMapLargeDataModelGroup != null){
lineMapLargeDataModelGroup.setSelectedItem(((VanChartMapPlot) plot).getLineMapDataProcessor());
}
}
super.populateBean(plot);
}
@ -397,9 +343,6 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
if (nullValueColorBox != null) {
((VanChartMapPlot) plot).setNullValueColor(nullValueColorBox.getSelectObject());
}
if(lineMapLargeDataModelGroup != null){
((VanChartMapPlot) plot).setLineMapDataProcessor(lineMapLargeDataModelGroup.getSelectedItem());
}
}
super.updateBean(plot);
}
@ -427,7 +370,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
protected void populateArea(ConditionAttr defaultAttr) {
populateAlpha(defaultAttr);
if (borderWithAlphaPane != null) {
AttrBorderWithAlpha attrBorderWithAlpha = (AttrBorderWithAlpha) defaultAttr.getExisted(AttrBorderWithAlpha.class);
AttrBorderWithAlpha attrBorderWithAlpha = defaultAttr.getExisted(AttrBorderWithAlpha.class);
borderWithAlphaPane.populate(attrBorderWithAlpha);
}
}
@ -435,7 +378,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
private void populatePoint(ConditionAttr defaultAttr) {
if (pointAlphaPane != null) {
AttrMarkerAlpha attrAlpha = (AttrMarkerAlpha)defaultAttr.getExisted(AttrMarkerAlpha.class);
AttrMarkerAlpha attrAlpha = defaultAttr.getExisted(AttrMarkerAlpha.class);
double alpha = VanChartAttrHelper.PERCENT * (attrAlpha == null ? 1 : attrAlpha.getAlpha());
pointAlphaPane.populateBean(alpha);
}
@ -449,7 +392,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
pointEffectPane.populateBean(attrEffect);
}
VanChartAttrMarker attrMarker = (VanChartAttrMarker) defaultAttr.getExisted(VanChartAttrMarker.class);
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
if (commonMarkerPane != null) {
commonMarkerPane.populateBean(attrMarker);
}
@ -457,7 +400,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
imageMarkerPane.populateBean(attrMarker);
}
if (bubblePane != null) {
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
bubblePane.populateBean(attrBubble);
}
}
@ -467,7 +410,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
if (defaultAttr.getExisted(AttrCurve.class) == null) {
defaultAttr.addDataSeriesCondition(new AttrCurve());
}
curvePane.populateBean((AttrCurve) defaultAttr.getExisted(AttrCurve.class));
curvePane.populateBean(defaultAttr.getExisted(AttrCurve.class));
}
if (lineMapEffectPane != null) {
if (defaultAttr.getExisted(AttrLineEffect.class) == null) {
@ -505,7 +448,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
protected void updateArea(ConditionAttr defaultAttr) {
updateAlpha(defaultAttr);
if (borderWithAlphaPane != null) {
AttrBorderWithAlpha attrBorderWithAlpha = (AttrBorderWithAlpha) defaultAttr.getExisted(AttrBorderWithAlpha.class);
AttrBorderWithAlpha attrBorderWithAlpha = defaultAttr.getExisted(AttrBorderWithAlpha.class);
defaultAttr.remove(attrBorderWithAlpha);
defaultAttr.addDataSeriesCondition(borderWithAlphaPane.update());
}
@ -513,7 +456,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
private void updatePoint(ConditionAttr defaultAttr) {
if (pointAlphaPane != null) {
AttrMarkerAlpha attrAlpha = (AttrMarkerAlpha)defaultAttr.getExisted(AttrMarkerAlpha.class);
AttrMarkerAlpha attrAlpha = defaultAttr.getExisted(AttrMarkerAlpha.class);
if (attrAlpha == null) {
attrAlpha = new AttrMarkerAlpha();
defaultAttr.addDataSeriesCondition(attrAlpha);
@ -527,9 +470,9 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
defaultAttr.addDataSeriesCondition(pointEffectPane.updateBean());
}
VanChartAttrMarker attrMarker = (VanChartAttrMarker) defaultAttr.getExisted(VanChartAttrMarker.class);
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
defaultAttr.remove(attrMarker);
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
defaultAttr.remove(attrBubble);
if (markerTypeCom != null) {
if (markerTypeCom.getSelectedIndex() == 1) {

25
designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java

@ -1,12 +1,9 @@
package com.fr.van.chart.map.designer.other;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.other.AutoRefreshPane;
import com.fr.van.chart.designer.other.AutoRefreshPaneWithoutTooltip;
@ -20,11 +17,13 @@ import javax.swing.JPanel;
public class VanChartMapInteractivePane extends VanChartInteractivePaneWithMapZoom {
private static final int HYPERLINK_LEFT_GAP = 36;
private VanChartMapHyperLinkPane hyperlinkPane;
@Override
protected JPanel createHyperlinkPane() {
hyperlinkPane = new VanChartMapHyperLinkPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), hyperlinkPane);
}
@Override
protected void populateHyperlink(Plot plot) {
hyperlinkPane.populateBean(plot);
@ -36,26 +35,22 @@ public class VanChartMapInteractivePane extends VanChartInteractivePaneWithMapZo
}
@Override
protected boolean largeModel(Plot plot) {
if(plot instanceof VanChartMapPlot){
VanChartMapPlot mapPlot = (VanChartMapPlot)plot;
switch (mapPlot.getMapType()){
case LINE:
return PlotFactory.lineMapLargeModel(mapPlot);
default:
return PlotFactory.largeDataModel(mapPlot);
}
}
protected boolean isCurrentChartSupportLargeDataMode() {
if (this.chart == null || this.chart.getPlot() == null) {
return false;
}
VanChartMapPlot mapPlot = this.chart.getPlot();
return mapPlot.getMapType() == MapType.POINT || mapPlot.getMapType() == MapType.LINE;
}
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) {
boolean isLargeModel = largeModel(plot);
VanChartMapPlot mapPlot = (VanChartMapPlot) plot;
if (mapPlot.getMapType().equals(MapType.LINE)) {
return new AutoRefreshPaneWithoutTooltip((VanChart) chart, isLargeModel);
return new AutoRefreshPaneWithoutTooltip(chart, isLargeModel);
}
return new AutoRefreshPane((VanChart) chart, isLargeModel);
return new AutoRefreshPane(chart, isLargeModel);
}
}

3
designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartLineMapConditionPane.java

@ -46,7 +46,7 @@ public class VanChartLineMapConditionPane extends DataSeriesConditionPane {
classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this));
classPaneMap.put(AttrCurve.class, new VanChartCurveConditionPane(this));
classPaneMap.put(AttrTooltip.class, new VanChartLineMapTooltipConditionPane(this, plot));
if(!PlotFactory.lineMapLargeModel(plot)){
if (!PlotFactory.largeDataModel(plot)) {
classPaneMap.put(AttrLineEffect.class, new VanChartLineEffectConditionPane(this, EffectHelper.getLineMapDefaultLineEffect()));
}
}
@ -56,6 +56,7 @@ public class VanChartLineMapConditionPane extends DataSeriesConditionPane {
/**
* 返回图表class对象
*
* @return class对象
*/
public Class<? extends Plot> class4Correspond() {

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

@ -16,6 +16,7 @@ import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.scatter.component.VanChartScatterStylePane;
import com.fr.van.chart.scatter.data.VanChartScatterPlotTableDataContentPane;
@ -56,6 +57,7 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
public String getIconPath() {
return "com/fr/design/images/form/toolbar/scatter.png";
}
@Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartScatterSeriesPane(parent, plot);
@ -81,7 +83,17 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
VanChartOtherPane otherPane = new VanChartOtherPane() {
@Override
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePaneWithOutSort();
return new VanChartInteractivePaneWithOutSort() {
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};

6
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java

@ -5,7 +5,6 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartLineTypePane;
@ -40,7 +39,6 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{
new Component[]{createLineTypePane()},
new Component[]{createMarkerPane()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()},
};
@ -77,8 +75,8 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{
}
@Override
protected void checkCompsEnabledWithLarge() {
super.checkCompsEnabledWithLarge();
protected void checkCompsEnabledWithLarge(Plot plot) {
super.checkCompsEnabledWithLarge(this.plot);
checkLinePane();
}

22
designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java

@ -1,16 +1,11 @@
package com.fr.van.chart.scatter.component;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.type.LineStyle;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.type.LineType;
import com.fr.van.chart.designer.component.VanChartLineTypePane;
import javax.swing.JPanel;
import java.awt.Component;
/**
@ -26,24 +21,17 @@ public class VanChartScatterLineTypePane extends VanChartLineTypePane {
}
@Override
protected JPanel createContentPane(double p, double f) {
double[] row = {p,p,p};
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] col = {f, e};
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present")), lineStyle},
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
lineStyleComponent
};
return TableLayoutHelper.createTableLayoutPane(components, row, col);
}
@Override
protected VanChartAttrLine initVanChartAttrLine() {
VanChartAttrLine attrLine = new VanChartAttrLine();
//默认为无线型,且默認空值不斷開
attrLine.setLineWidth(Constants.LINE_NONE);
attrLine.setLineType(LineType.NONE);
attrLine.setNullValueBreak(false);
return attrLine;
}

31
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java → designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java

@ -3,6 +3,10 @@ package com.fr.van.chart.structure.desinger;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.StructureCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.StructureDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
@ -12,9 +16,10 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.other.zoom.ZoomPaneWithOutMode;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.structure.desinger.data.StructurePlotReportDataContentPane;
import com.fr.van.chart.structure.desinger.data.StructurePlotTableDataContentPane;
@ -26,7 +31,7 @@ import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
/**
* Created by shine on 2017/2/15.
*/
public class StructureIndependentVanChartInterface extends AbstractIndependentVanChartUI {
public class VanStructureChartTypeUI extends AbstractIndependentVanChartUI {
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartStructureTypePane();
@ -84,16 +89,9 @@ public class StructureIndependentVanChartInterface extends AbstractIndependentVa
return new VanChartInteractivePaneWithOutSort(){
@Override
protected String[] getNameArray() {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")};
protected ZoomPane createZoomPane() {
return new ZoomPaneWithOutMode();
}
@Override
protected String[] getValueArray() {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
}
};
}
};
@ -105,8 +103,13 @@ public class StructureIndependentVanChartInterface extends AbstractIndependentVa
return new VanChartStructureConditionPane(plot);
}
/* @Override
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new StructureChartDataPane(listener);
}*/
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new StructureDataSetFieldsPane(), new StructureCellDataFieldsPane());
}
};
}
}

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

@ -1,6 +1,10 @@
package com.fr.van.chart.vanchart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane;
@ -9,6 +13,10 @@ import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContent
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.van.chart.designer.data.VanChartMoreCateReportDataContentPane;
import com.fr.van.chart.designer.data.VanChartMoreCateTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
/**
* Created by mengao on 2017/7/6.
@ -19,7 +27,8 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndepende
if (((VanChartPlot) plot).isInCustom() && ((VanChartPlot) plot).getCustomType().equals("CUSTOM")) {
return new CategoryPlotTableDataContentPane(parent);
}
return new VanChartMoreCateTableDataContentPane(parent); }
return new VanChartMoreCateTableDataContentPane(parent);
}
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
//自定义组合图特殊处理
@ -28,4 +37,27 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndepende
}
return new VanChartMoreCateReportDataContentPane(parent);
}
@Override
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane() {
@Override
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePane() {
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
}

13
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java

@ -10,9 +10,10 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.other.zoom.ZoomPaneWithOutMode;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
import com.fr.van.chart.wordcloud.designer.other.VanChartWordCloudConditionPane;
@ -83,14 +84,8 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa
return new VanChartInteractivePaneWithOutSort(){
@Override
protected String[] getNameArray() {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")};
}
@Override
protected String[] getValueArray() {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
protected ZoomPane createZoomPane() {
return new ZoomPaneWithOutMode();
}
};
}

2
designer-realize/src/main/java/com/fr/grid/GridUI.java

@ -1209,7 +1209,7 @@ public class GridUI extends ComponentUI {
* @return 有效返回true
*/
public static boolean validate(Rectangle2D rect) {
return rect != null && rect.getX() != INVALID_INTEGER;
return rect != null && ComparatorUtils.equals(rect.getX(), INVALID_INTEGER);
}

2
designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java

@ -141,7 +141,7 @@ class PrismImageLoader2 implements com.sun.javafx.tk.ImageLoader {
ImageFrame imageFrame = loader.load(i, w, h, preserveRatio, smooth);
images[i] = convert(imageFrame);
synchronized (this) {
this.notify();
notifyAll();
}
}
} catch (ImageStorageException e) {

Loading…
Cancel
Save