Browse Source

Merge branch 'release/10.0' of http://code.fineres.com/scm/~harrison/design into release/10.0

feature/big-screen
Harrison 4 years ago
parent
commit
e43ddfa3bf
  1. 7
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  2. 8
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java
  3. 89
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java
  4. 18
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java
  5. 16
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  6. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java
  7. 12
      designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartTooltipPane.java
  8. 28
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  9. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  10. 4
      designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java

7
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -15,8 +15,9 @@ import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.awt.Dimension;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.LinkedHashMap;
@Open
public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
@ -27,7 +28,7 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
protected LiteConditionPane liteConditionPane;
protected java.util.Map<Class, ConditionAttrSingleConditionPane> classPaneMap = new HashMap<Class, ConditionAttrSingleConditionPane>();
protected Map<Class, ConditionAttrSingleConditionPane> classPaneMap = new LinkedHashMap<>();
//可用的Actions.
protected java.util.List<UpdateAction> useAbleActionList = new java.util.ArrayList<UpdateAction>();
@ -70,7 +71,7 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT));
propertyChangePane.add(selectedItemScrollPane);
}
public void updateBean(T ob) {
updateMenuDef();
}

8
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.box;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.plugin.chart.box.VanChartBoxPlot;
import com.fr.plugin.chart.box.attr.AttrBoxTooltip;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane;
@ -13,7 +14,8 @@ public class VanChartBoxPlotTooltipPane extends VanChartPlotTooltipPane {
}
protected void initTooltipContentPane(Plot plot) {
tooltipContentPane = new VanChartBoxTooltipContentPane(parent, VanChartBoxPlotTooltipPane.this);
boolean isDetailed = ((VanChartBoxPlot) plot).isDetailed();
tooltipContentPane = new VanChartBoxTooltipContentPane(parent, VanChartBoxPlotTooltipPane.this, isDetailed);
}
protected AttrTooltip getAttrTooltip() {
@ -23,4 +25,8 @@ public class VanChartBoxPlotTooltipPane extends VanChartPlotTooltipPane {
protected boolean hasTooltipSeriesType() {
return false;
}
public void checkContentVisible(boolean isDetailed) {
((VanChartBoxTooltipContentPane) tooltipContentPane).checkFormatVisible(isDetailed);
}
}

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

@ -1,6 +1,8 @@
package com.fr.van.chart.box;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
@ -10,10 +12,13 @@ import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
private boolean detailed;
private VanChartFormatPaneWithCheckBox number;
private VanChartFormatPaneWithCheckBox max;
private VanChartFormatPaneWithCheckBox q3;
@ -22,8 +27,12 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
private VanChartFormatPaneWithCheckBox min;
private VanChartFormatPaneWithCheckBox outlier;
public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) {
private JPanel dataNumberPane;
private JPanel dataOutlierPane;
public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) {
super(parent, showOnPane);
this.detailed = isDetailed;
}
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) {
@ -67,22 +76,81 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
};
}
protected JPanel createCommonPanel() {
JPanel commonPanel = new JPanel(new BorderLayout());
commonPanel.add(createCateAndSeriesPane(), BorderLayout.NORTH);
commonPanel.add(createDataNumberPane(), BorderLayout.CENTER);
commonPanel.add(createDataDetailPane(), BorderLayout.SOUTH);
checkFormatVisible(detailed);
return commonPanel;
}
protected double[] getRowSize(double p) {
return new double[]{p, p, p, p, p, p, p, p, p};
return new double[]{p, p, p, p, p, p, p, p, p, p, p, p};
}
protected Component[][] getPaneComponents() {
return new Component[][]{
private JPanel createCateAndSeriesPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, p};
double[] rowSize = {p, p};
Component[][] cateAndSeries = new Component[][]{
new Component[]{categoryNameFormatPane, null},
new Component[]{seriesNameFormatPane, null},
new Component[]{seriesNameFormatPane, null}
};
return TableLayoutHelper.createTableLayoutPane(cateAndSeries, rowSize, columnSize);
}
private JPanel createDataNumberPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, p};
double[] rowSize = {p, p};
Component[][] dataNumber = new Component[][]{
new Component[]{null, null},
new Component[]{number, null},
};
dataNumberPane = TableLayoutHelper.createTableLayoutPane(dataNumber, rowSize, columnSize);
return dataNumberPane;
}
private JPanel createDataDetailPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, p};
JPanel detailPane = new JPanel(new BorderLayout());
Component[][] dataDetail = new Component[][]{
new Component[]{null, null},
new Component[]{max, null},
new Component[]{q3, null},
new Component[]{median, null},
new Component[]{q1, null},
new Component[]{min, null},
new Component[]{outlier, null}
new Component[]{min, null}
};
Component[][] dataOutlier = new Component[][]{
new Component[]{null, null},
new Component[]{outlier, null},
};
dataOutlierPane = TableLayoutHelper.createTableLayoutPane(dataOutlier, new double[]{p, p}, columnSize);
detailPane.add(TableLayoutHelper.createTableLayoutPane(dataDetail, new double[]{p, p, p, p, p, p}, columnSize), BorderLayout.NORTH);
detailPane.add(dataOutlierPane, BorderLayout.CENTER);
return detailPane;
}
public boolean isDirty() {
@ -146,4 +214,11 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
outlier.update(boxTooltipContent.getOutlier());
}
}
public void checkFormatVisible(boolean detailed) {
this.detailed = detailed;
dataNumberPane.setVisible(detailed);
dataOutlierPane.setVisible(detailed);
}
}

18
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java

@ -1,6 +1,10 @@
package com.fr.van.chart.box;
import com.fr.chart.base.DataSeriesCondition;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.plugin.chart.box.VanChartBoxPlot;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane;
import com.fr.van.chart.designer.style.tooltip.VanChartTooltipPane;
@ -14,4 +18,18 @@ public class VanChartBoxTooltipPane extends VanChartTooltipPane {
protected VanChartPlotTooltipPane getTooltipPane(Plot plot) {
return new VanChartBoxPlotTooltipPane(plot, parent);
}
public void populateTooltipPane(Plot plot) {
DataSeriesCondition attr = ((VanChartPlot) plot).getAttrTooltipFromConditionCollection();
VanChartPlotTooltipPane tooltipPane = getPlotTooltipPane();
if (tooltipPane instanceof VanChartBoxPlotTooltipPane) {
tooltipPane.populate((AttrTooltip) attr);
VanChartBoxPlotTooltipPane boxPlotTooltipPane = (VanChartBoxPlotTooltipPane) tooltipPane;
VanChartBoxPlot boxPlot = (VanChartBoxPlot) plot;
boxPlotTooltipPane.checkContentVisible(boxPlot.isDetailed());
}
}
}

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

@ -42,6 +42,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
protected ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane;
private JPanel centerPane;
private JPanel commonPanel;
private VanChartHtmlLabelPane htmlLabelPane;
private VanChartStylePane parent;
@ -64,11 +65,8 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, p};
double[] rowSize = getRowSize(p);
final JPanel commonPanel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize);
commonPanel = createCommonPanel();
htmlLabelPane = createHtmlLabelPane();
htmlLabelPane.setParent(parent);
@ -109,6 +107,16 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
return new VanChartHtmlLabelPaneWithOutWidthAndHeight();
}
protected JPanel createCommonPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, p};
double[] rowSize = getRowSize(p);
return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize);
}
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane){
categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane);
seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane);

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

@ -162,8 +162,10 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
JPanel mainTickPane = new JPanel();
mainTickPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
mainUnitField.setPreferredSize(new Dimension(100,20));
secondUnitField.setPreferredSize(new Dimension(100,20));
int width = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH - (int) Math.ceil(mainType.getPreferredSize().getWidth());
mainUnitField.setPreferredSize(new Dimension(width,20));
secondUnitField.setPreferredSize(new Dimension(width,20));
mainTickPane.add(mainUnitField);
mainTickPane.add(mainType);

12
designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartTooltipPane.java

@ -5,6 +5,7 @@ import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chartx.config.info.constant.ConfigType;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.AttrTooltip;
@ -27,6 +28,10 @@ public class VanChartTooltipPane extends AbstractVanChartScrollPane<Chart> {
this.parent = parent;
}
public VanChartPlotTooltipPane getPlotTooltipPane() {
return tooltipPane;
}
@Override
protected JPanel createContentPane() {
JPanel contentPane = new JPanel(new BorderLayout());
@ -48,7 +53,10 @@ public class VanChartTooltipPane extends AbstractVanChartScrollPane<Chart> {
parent.initAllListeners();
}
Plot plot = this.chart.getPlot();
populateTooltipPane(this.chart.getPlot());
}
public void populateTooltipPane(Plot plot) {
DataSeriesCondition attr = ((VanChartPlot)plot).getAttrTooltipFromConditionCollection();
if(tooltipPane != null) {
tooltipPane.populate((AttrTooltip)attr);
@ -74,7 +82,7 @@ public class VanChartTooltipPane extends AbstractVanChartScrollPane<Chart> {
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Tooltip");
return Toolkit.i18nText("Fine-Design_Chart_Tooltip");
}
protected VanChartPlotTooltipPane getTooltipPane(Plot plot) {

28
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -79,6 +79,9 @@ public class EditingMouseListener extends MouseInputAdapter {
//备份开始拖动的位置和大小
private Rectangle dragBackupBounds;
private int pressX;
private int pressY;
/**
* 获取最小移动距离
*
@ -141,6 +144,8 @@ public class EditingMouseListener extends MouseInputAdapter {
public void mousePressed(MouseEvent e) {
int oldX = e.getX();
int oldY = e.getY();
pressX = oldX;
pressY = oldY;
offsetEventPoint(e);
if (!stopEditing()) {
return;
@ -189,6 +194,7 @@ public class EditingMouseListener extends MouseInputAdapter {
* @param e 鼠标事件
*/
public void mouseReleased(MouseEvent e) {
MouseEvent transEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton());
int oldX = e.getX();
int oldY = e.getY();
offsetEventPoint(e);
@ -213,6 +219,12 @@ public class EditingMouseListener extends MouseInputAdapter {
lastPressEvent = null;
lastXCreator = null;
e.translatePoint(oldX - e.getX(), oldY - e.getY());
if (pressX != oldX || pressY != oldY) {
// click只有在mouseReleased和mousePressed前后x/y坐标相等时才会被触发在mouseReleased之后
// 但是当使用者来回点击切换时 存在mouseReleased和mousePressed前后x/y坐标不相等的情况 即鼠标按下去的位置和鼠标释放的位置不相等 存在偏移
// 当这种偏移很小时 看起来就好像是点击了 实际上是手抖了或者鼠标轻微滑动了 所以这里对这种情况要有容错处理
mouseClicked(transEvent);
}
}
private void mouseDraggingRelease(MouseEvent e) {
@ -327,8 +339,8 @@ public class EditingMouseListener extends MouseInputAdapter {
if (designer.getCursor().getType() == Cursor.HAND_CURSOR) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
} // component.getParent() 是报表块所在的XWTitleLayout
int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue();
int minY = button.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue();
int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue();
int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue();
if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) {
if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
@ -342,8 +354,8 @@ public class EditingMouseListener extends MouseInputAdapter {
if (component.getCoverPane() != null) {
if (component.getCoverPane().getComponentCount() > 1) {
JComponent button1 = (JComponent) component.getCoverPane().getComponent(1);
int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue();
int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue();
int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue();
int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue();
if (e.getX() + GAP - component.getInsets().left > minX1 && e.getX() - GAP - component.getInsets().left < minX1 + button1.getWidth()) {
if (e.getY() + GAP - component.getInsets().top > minY1 && e.getY() - GAP - component.getInsets().top < minY1 + button1.getHeight()) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
@ -358,8 +370,8 @@ public class EditingMouseListener extends MouseInputAdapter {
if (StringUtils.isEmpty(component.toData().getDescription())) {
return;
}
int minX1 = getParentPositionX(component, component.getX()) + component.getWidth() - ShareConstants.SHARE_EL_CONTROL_BUTTON_HW - designer.getArea().getHorizontalValue();
int minY1 = getParentPositionY(component, component.getY()) - designer.getArea().getVerticalValue();
int minX1 = getParentPositionX(component, component.getX()) + component.getWidth() - ShareConstants.SHARE_EL_CONTROL_BUTTON_HW - designer.getHorizontalScaleValue();
int minY1 = getParentPositionY(component, component.getY()) - designer.getVerticalScaleValue();
if (e.getX() + GAP - component.getInsets().left > minX1 && e.getX() - GAP - component.getInsets().left < minX1 + ShareConstants.SHARE_EL_CONTROL_BUTTON_HW) {
if (e.getY() + GAP - component.getInsets().top > minY1 && e.getY() - GAP - component.getInsets().top < minY1 + ShareConstants.SHARE_EL_CONTROL_BUTTON_HW) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
@ -426,8 +438,8 @@ public class EditingMouseListener extends MouseInputAdapter {
if (designer.getCursor().getType() == Cursor.HAND_CURSOR) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue();
int minY = button.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue();
int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue();
int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue();
if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) {
if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

2
designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

@ -773,7 +773,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
heightPane.setValue(height);
reCalculateHeight((int) height);
}
if (designer.getRootComponent().acceptType(XWFitLayout.class) && AssistUtils.equals(slide, DEFAULT_SLIDER) ) {
if (designer.getRootComponent().acceptType(XWFitLayout.class) && AssistUtils.equals(screenValue, DEFAULT_SLIDER) ) {
XWFitLayout layout = (XWFitLayout) designer.getRootComponent();
// 撤销时先refreshRoot了,此处去掉内边距再增加间隔
layout.moveContainerMargin();

4
designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java

@ -1,5 +1,6 @@
package com.fr.design.parameter;
import com.fr.base.Parameter;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWParameterLayout;
@ -124,7 +125,8 @@ public class ParameterPropertyPane extends JPanel{
hideInJForm = jt instanceof JForm &&
!(creator instanceof XWParameterLayout || creator.getParent() instanceof XWParameterLayout);
} catch (NullPointerException ex) {
hideInJForm = toolbarPane.updateBean().length <= 0;
Parameter[] parameters = toolbarPane.updateBean();
hideInJForm = parameters == null || parameters.length <= 0;
}
if (isVisible && toolbarPane.hasSelectedLabelItem() && !hideInJForm) {
addParaPane.setVisible(true);

Loading…
Cancel
Save