|
|
@ -3,20 +3,6 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package com.fr.poly; |
|
|
|
package com.fr.poly; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
|
|
|
|
import java.awt.event.*; |
|
|
|
|
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.AbstractAction; |
|
|
|
|
|
|
|
import javax.swing.ActionMap; |
|
|
|
|
|
|
|
import javax.swing.InputMap; |
|
|
|
|
|
|
|
import javax.swing.JComponent; |
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
import javax.swing.JScrollBar; |
|
|
|
|
|
|
|
import javax.swing.KeyStroke; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.base.GraphHelper; |
|
|
|
import com.fr.base.GraphHelper; |
|
|
@ -47,11 +33,7 @@ import com.fr.design.utils.gui.LayoutUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.grid.selection.Selection; |
|
|
|
import com.fr.grid.selection.Selection; |
|
|
|
import com.fr.poly.actions.DeleteBlockAction; |
|
|
|
import com.fr.poly.actions.DeleteBlockAction; |
|
|
|
import com.fr.poly.creator.BlockCreator; |
|
|
|
import com.fr.poly.creator.*; |
|
|
|
import com.fr.poly.creator.BlockEditor; |
|
|
|
|
|
|
|
import com.fr.poly.creator.ECBlockCreator; |
|
|
|
|
|
|
|
import com.fr.poly.creator.ECBlockEditor; |
|
|
|
|
|
|
|
import com.fr.poly.creator.PolyElementCasePane; |
|
|
|
|
|
|
|
import com.fr.poly.hanlder.DataEditingListener; |
|
|
|
import com.fr.poly.hanlder.DataEditingListener; |
|
|
|
import com.fr.poly.hanlder.PolyDesignerDropTarget; |
|
|
|
import com.fr.poly.hanlder.PolyDesignerDropTarget; |
|
|
|
import com.fr.poly.model.AddedData; |
|
|
|
import com.fr.poly.model.AddedData; |
|
|
@ -61,13 +43,21 @@ import com.fr.report.block.Block; |
|
|
|
import com.fr.report.poly.PolyWorkSheet; |
|
|
|
import com.fr.report.poly.PolyWorkSheet; |
|
|
|
import com.fr.report.poly.TemplateBlock; |
|
|
|
import com.fr.report.poly.TemplateBlock; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.CoreGraphHelper; |
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.unit.FU; |
|
|
|
import com.fr.stable.unit.FU; |
|
|
|
import com.fr.stable.unit.OLDPIX; |
|
|
|
import com.fr.stable.unit.OLDPIX; |
|
|
|
import com.fr.stable.unit.UNIT; |
|
|
|
import com.fr.stable.unit.UNIT; |
|
|
|
import com.fr.stable.unit.UnitRectangle; |
|
|
|
import com.fr.stable.unit.UnitRectangle; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
import java.awt.event.KeyEvent; |
|
|
|
|
|
|
|
import java.awt.event.KeyListener; |
|
|
|
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author richer |
|
|
|
* @author richer |
|
|
|
* @since 6.5.3 聚合报表的设计块,不包括底部和右边的滚动条以及左边和上边的像素标识条 |
|
|
|
* @since 6.5.3 聚合报表的设计块,不包括底部和右边的滚动条以及左边和上边的像素标识条 |
|
|
@ -85,6 +75,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
public static enum SelectionType { |
|
|
|
public static enum SelectionType { |
|
|
|
NONE, INNER, BLOCK |
|
|
|
NONE, INNER, BLOCK |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public JComponent polyArea; |
|
|
|
public JComponent polyArea; |
|
|
|
private SelectionType selectedtype = SelectionType.NONE; |
|
|
|
private SelectionType selectedtype = SelectionType.NONE; |
|
|
|
private AddingData addingData; |
|
|
|
private AddingData addingData; |
|
|
@ -171,12 +162,14 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
public void keyTyped(KeyEvent e) { |
|
|
|
public void keyTyped(KeyEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void keyPressed(KeyEvent e) { |
|
|
|
public void keyPressed(KeyEvent e) { |
|
|
|
if (e.isControlDown()) { |
|
|
|
if (e.isControlDown()) { |
|
|
|
isCtrl = true; |
|
|
|
isCtrl = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void keyReleased(KeyEvent e) { |
|
|
|
public void keyReleased(KeyEvent e) { |
|
|
|
isCtrl = false; |
|
|
|
isCtrl = false; |
|
|
@ -209,6 +202,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否含有聚和报表块 |
|
|
|
* 是否含有聚和报表块 |
|
|
|
|
|
|
|
* |
|
|
|
* @param targetComponent 目标组件 |
|
|
|
* @param targetComponent 目标组件 |
|
|
|
* @return 是则返回true |
|
|
|
* @return 是则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -249,6 +243,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 增加组件 |
|
|
|
* 增加组件 |
|
|
|
|
|
|
|
* |
|
|
|
* @param currentEditor 组件 |
|
|
|
* @param currentEditor 组件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addEditor(BlockEditor currentEditor) { |
|
|
|
public void addEditor(BlockEditor currentEditor) { |
|
|
@ -257,6 +252,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 移除组件 |
|
|
|
* 移除组件 |
|
|
|
|
|
|
|
* |
|
|
|
* @param currentEditor 组件 |
|
|
|
* @param currentEditor 组件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void removeEditor(BlockEditor currentEditor) { |
|
|
|
public void removeEditor(BlockEditor currentEditor) { |
|
|
@ -265,6 +261,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 权限编辑状态 |
|
|
|
* 权限编辑状态 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 权限编辑面板 |
|
|
|
* @return 权限编辑面板 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public AuthorityEditPane createAuthorityEditPane() { |
|
|
|
public AuthorityEditPane createAuthorityEditPane() { |
|
|
@ -300,6 +297,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 增加组件 |
|
|
|
* 增加组件 |
|
|
|
|
|
|
|
* |
|
|
|
* @param creator 组件 |
|
|
|
* @param creator 组件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addBlockCreator(BlockCreator creator) { |
|
|
|
public void addBlockCreator(BlockCreator creator) { |
|
|
@ -386,6 +384,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 选中的是否是报表块 |
|
|
|
* 选中的是否是报表块 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 是则返回true |
|
|
|
* @return 是则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isSelectedECBolck() { |
|
|
|
public boolean isSelectedECBolck() { |
|
|
@ -410,7 +409,6 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -461,6 +459,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 黏贴 |
|
|
|
* 黏贴 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 黏贴成功返回true |
|
|
|
* @return 黏贴成功返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean paste() { |
|
|
|
public boolean paste() { |
|
|
@ -520,6 +519,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 删除 |
|
|
|
* 删除 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 删除成功返回true |
|
|
|
* @return 删除成功返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean delete() { |
|
|
|
public boolean delete() { |
|
|
@ -559,6 +559,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 剪切 |
|
|
|
* 剪切 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 剪切成功返回true |
|
|
|
* @return 剪切成功返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean cut() { |
|
|
|
public boolean cut() { |
|
|
@ -569,6 +570,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 移动 |
|
|
|
* 移动 |
|
|
|
|
|
|
|
* |
|
|
|
* @param x 横坐标 |
|
|
|
* @param x 横坐标 |
|
|
|
* @param y 纵坐标 |
|
|
|
* @param y 纵坐标 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -687,6 +689,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 开始编辑 |
|
|
|
* 开始编辑 |
|
|
|
|
|
|
|
* |
|
|
|
* @param blockName 聚合块名称 |
|
|
|
* @param blockName 聚合块名称 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void startEditing(String blockName) { |
|
|
|
public void startEditing(String blockName) { |
|
|
@ -919,6 +922,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否选中聚合块本身 |
|
|
|
* 是否选中聚合块本身 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 是则返回true |
|
|
|
* @return 是则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isChooseBlock() { |
|
|
|
public boolean isChooseBlock() { |
|
|
@ -967,6 +971,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 计算滚动条的值和max |
|
|
|
* 计算滚动条的值和max |
|
|
|
|
|
|
|
* |
|
|
|
* @param oldmax 之前最大值 |
|
|
|
* @param oldmax 之前最大值 |
|
|
|
* @param max 当前最大值 |
|
|
|
* @param max 当前最大值 |
|
|
|
* @param newValue 当前value |
|
|
|
* @param newValue 当前value |
|
|
@ -983,7 +988,6 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
* 获取当前聚合报表区域左上角x坐标 |
|
|
|
* 获取当前聚合报表区域左上角x坐标 |
|
|
|
* |
|
|
|
* |
|
|
|
* @return 当前聚合报表区域左上角x坐标 |
|
|
|
* @return 当前聚合报表区域左上角x坐标 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public double getAreaLocationX() { |
|
|
|
public double getAreaLocationX() { |
|
|
|
return polyArea.getLocationOnScreen().getX(); |
|
|
|
return polyArea.getLocationOnScreen().getX(); |
|
|
@ -993,7 +997,6 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
* 获取当前聚合报表区域左上角y坐标 |
|
|
|
* 获取当前聚合报表区域左上角y坐标 |
|
|
|
* |
|
|
|
* |
|
|
|
* @return 当前聚合报表区域左上角y坐标 |
|
|
|
* @return 当前聚合报表区域左上角y坐标 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public double getAreaLocationY() { |
|
|
|
public double getAreaLocationY() { |
|
|
|
return polyArea.getLocationOnScreen().getY(); |
|
|
|
return polyArea.getLocationOnScreen().getY(); |
|
|
@ -1003,9 +1006,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
* 检测指定块是否与其他的块有重叠区域 |
|
|
|
* 检测指定块是否与其他的块有重叠区域 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param creator 指定的块编辑器 |
|
|
|
* @param creator 指定的块编辑器 |
|
|
|
* |
|
|
|
|
|
|
|
* @return 是否与其他的块有重叠区域 |
|
|
|
* @return 是否与其他的块有重叠区域 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean intersectsAllBlock(BlockCreator creator) { |
|
|
|
public boolean intersectsAllBlock(BlockCreator creator) { |
|
|
|
return intersectsAllBlock(creator.getValue()); |
|
|
|
return intersectsAllBlock(creator.getValue()); |
|
|
@ -1015,9 +1016,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
* 检测指定块是否与其他的块有重叠区域 |
|
|
|
* 检测指定块是否与其他的块有重叠区域 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param block 指定的块 |
|
|
|
* @param block 指定的块 |
|
|
|
* |
|
|
|
|
|
|
|
* @return 是否与其他的块有重叠区域 |
|
|
|
* @return 是否与其他的块有重叠区域 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean intersectsAllBlock(TemplateBlock block) { |
|
|
|
public boolean intersectsAllBlock(TemplateBlock block) { |
|
|
|
UnitRectangle rec = block.getBounds(); |
|
|
|
UnitRectangle rec = block.getBounds(); |
|
|
@ -1030,9 +1029,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase |
|
|
|
* |
|
|
|
* |
|
|
|
* @param rec 指定的块区域 |
|
|
|
* @param rec 指定的块区域 |
|
|
|
* @param blockName 指定的块名称 |
|
|
|
* @param blockName 指定的块名称 |
|
|
|
* |
|
|
|
|
|
|
|
* @return 是否与其他的块有重叠区域 |
|
|
|
* @return 是否与其他的块有重叠区域 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean intersectsAllBlock(UnitRectangle rec, String blockName) { |
|
|
|
public boolean intersectsAllBlock(UnitRectangle rec, String blockName) { |
|
|
|
PolyWorkSheet worksheet = this.getTarget(); |
|
|
|
PolyWorkSheet worksheet = this.getTarget(); |
|
|
|