Revision 142 branches/usability_v2/org.gvsig.app.document.layout.app/org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/tools/behavior/LayoutViewMoveBehavior.java
LayoutViewMoveBehavior.java | ||
---|---|---|
57 | 57 |
* @see org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior#paintComponent(java.awt.Graphics) |
58 | 58 |
*/ |
59 | 59 |
public void paintComponent(Graphics g) { |
60 |
IFFrame[] fframes = getLayoutControl().getLayoutContext().getFFrames();
|
|
60 |
IFFrameUseFMap[] fframes = getLayoutControl().getLayoutContext().getSelectedFFrames(IFFrameUseFMap.class);
|
|
61 | 61 |
for (int i = 0; i < fframes.length; i++) { |
62 |
if (fframes[i] instanceof IFFrameUseFMap) { |
|
63 |
IFFrameUseFMap fframe = (IFFrameUseFMap) fframes[i]; |
|
62 |
IFFrameUseFMap fframe = (IFFrameUseFMap) fframes[i]; |
|
63 |
Rectangle2D.Double rec = |
|
64 |
((IFFrame) fframe).getBoundingBox(getLayoutControl() |
|
65 |
.getAT()); |
|
64 | 66 |
|
65 |
if (((IFFrame) fframe).getSelected() != IFFrame.NOSELECT) { |
|
66 |
Rectangle2D.Double rec = |
|
67 |
((IFFrame) fframe).getBoundingBox(getLayoutControl() |
|
68 |
.getAT()); |
|
67 |
if (getLayoutControl().getImage() != null) { |
|
68 |
rec = |
|
69 |
(Rectangle2D.Double) rec |
|
70 |
.createIntersection(getLayoutControl() |
|
71 |
.getComponent().getVisibleRect()); |
|
72 |
} |
|
69 | 73 |
|
70 |
if (getLayoutControl().getImage() != null) { |
|
71 |
rec = |
|
72 |
(Rectangle2D.Double) rec |
|
73 |
.createIntersection(getLayoutControl() |
|
74 |
.getComponent().getVisibleRect()); |
|
75 |
} |
|
74 |
if (fframe.getBufferedImage() != null) { |
|
75 |
getLayoutControl().getLayoutDraw().drawHandlers( |
|
76 |
(Graphics2D) g, Color.black); |
|
77 |
g.clipRect((int) rec.x, (int) rec.y, (int) rec.width, |
|
78 |
(int) rec.height); |
|
76 | 79 |
|
77 |
if (fframe.getBufferedImage() != null) { |
|
78 |
getLayoutControl().getLayoutDraw().drawHandlers( |
|
79 |
(Graphics2D) g, Color.black); |
|
80 |
g.clipRect((int) rec.x, (int) rec.y, (int) rec.width, |
|
81 |
(int) rec.height); |
|
80 |
Rectangle2D.Double r1 = |
|
81 |
((IFFrame) fframe) |
|
82 |
.getBoundingBox(getLayoutControl().getAT()); |
|
83 |
g.drawImage(fframe.getBufferedImage(), (int) r1.getX() |
|
84 |
+ getLayoutControl().getLastPoint().x |
|
85 |
- getLayoutControl().getPointAnt().x, |
|
86 |
(int) r1.getY() |
|
87 |
+ getLayoutControl().getLastPoint().y |
|
88 |
- getLayoutControl().getPointAnt().y, |
|
89 |
getLayoutControl().getComponent()); |
|
82 | 90 |
|
83 |
Rectangle2D.Double r1 = |
|
84 |
((IFFrame) fframe) |
|
85 |
.getBoundingBox(getLayoutControl().getAT()); |
|
86 |
g.drawImage(fframe.getBufferedImage(), (int) r1.getX() |
|
87 |
+ getLayoutControl().getLastPoint().x |
|
88 |
- getLayoutControl().getPointAnt().x, |
|
89 |
(int) r1.getY() |
|
90 |
+ getLayoutControl().getLastPoint().y |
|
91 |
- getLayoutControl().getPointAnt().y, |
|
92 |
getLayoutControl().getComponent()); |
|
93 |
|
|
94 |
fframe.refresh(); |
|
95 |
} |
|
96 |
} |
|
97 |
} |
|
91 |
fframe.refresh(); |
|
92 |
} |
|
98 | 93 |
} |
99 | 94 |
|
100 | 95 |
// g.setClip(rClip); |
Also available in: Unified diff