|
|
@ -19,6 +19,7 @@ import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.GraphHelper; |
|
|
|
import com.fr.base.GraphHelper; |
|
|
|
import com.fr.base.ScreenResolution; |
|
|
|
import com.fr.base.ScreenResolution; |
|
|
|
import com.fr.base.Utils; |
|
|
|
import com.fr.base.Utils; |
|
|
|
|
|
|
|
import com.fr.base.iofileattr.WatermarkAttr; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.designer.beans.AdapterBus; |
|
|
|
import com.fr.design.designer.beans.AdapterBus; |
|
|
|
import com.fr.design.designer.beans.ComponentAdapter; |
|
|
|
import com.fr.design.designer.beans.ComponentAdapter; |
|
|
@ -31,7 +32,10 @@ import com.fr.design.designer.creator.XWFitLayout; |
|
|
|
import com.fr.design.form.util.XCreatorConstants; |
|
|
|
import com.fr.design.form.util.XCreatorConstants; |
|
|
|
import com.fr.design.roleAuthority.ReportAndFSManagePane; |
|
|
|
import com.fr.design.roleAuthority.ReportAndFSManagePane; |
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
|
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
import com.fr.page.WatermarkPainter; |
|
|
|
|
|
|
|
import com.fr.report.core.ReportUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.stable.CoreGraphHelper; |
|
|
|
import com.fr.stable.CoreGraphHelper; |
|
|
@ -46,6 +50,7 @@ public class FormDesignerUI extends ComponentUI { |
|
|
|
private FormDesigner designer; |
|
|
|
private FormDesigner designer; |
|
|
|
private SelectionModel selectionModel; |
|
|
|
private SelectionModel selectionModel; |
|
|
|
private Rectangle2D.Double back_or_selection_rect = new Rectangle2D.Double(0, 0, 0, 0); |
|
|
|
private Rectangle2D.Double back_or_selection_rect = new Rectangle2D.Double(0, 0, 0, 0); |
|
|
|
|
|
|
|
private WatermarkPainter watermarkPainter; |
|
|
|
private float time; |
|
|
|
private float time; |
|
|
|
|
|
|
|
|
|
|
|
public FormDesignerUI() { |
|
|
|
public FormDesignerUI() { |
|
|
@ -111,6 +116,18 @@ public class FormDesignerUI extends ComponentUI { |
|
|
|
// 当前正在添加的组件
|
|
|
|
// 当前正在添加的组件
|
|
|
|
paintAddingBean(g, addingModel); |
|
|
|
paintAddingBean(g, addingModel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
paintWatermark((Graphics2D) g); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 绘制水印
|
|
|
|
|
|
|
|
private void paintWatermark(Graphics2D g) { |
|
|
|
|
|
|
|
WatermarkAttr watermark = ReportUtils.getWatermarkFromAttrMarkFile(designer.getTarget()); |
|
|
|
|
|
|
|
// 不要每次都 new 一个 WatermarkPainter
|
|
|
|
|
|
|
|
if (watermarkPainter == null || !ComparatorUtils.equals(watermarkPainter.getWatermark(), watermark)) { |
|
|
|
|
|
|
|
watermarkPainter = new WatermarkPainter(watermark); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
watermarkPainter.paint(g, 0, designer.getParaHeight(), designer.getArea().getBounds()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int[] getActualLine(int i) { |
|
|
|
private int[] getActualLine(int i) { |
|
|
|