Revision 2304 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameGroup.java

View differences:

FFrameGroup.java
144 144
	public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
145 145
		BufferedImage imgBase) throws DriverException {
146 146
		Rectangle2D.Double r = getBoundingBox(at);
147
		g.rotate(Math.toRadians(getRotation()), r.x + (r.width / 2),
148
				r.y + (r.height / 2));
147 149
		m_at = at;
148 150

  
149 151
		for (int i = 0; i < m_fframes.size(); i++) {
150 152
			((IFFrame) m_fframes.get(i)).draw(g, at, rv, imgBase);
151 153
		}
154
		g.rotate(Math.toRadians(-getRotation()),
155
				r.x + (r.width / 2), r.y + (r.height / 2));
152 156
	}
153 157

  
154 158
	/**
......
217 221
		xml.putProperty("m_Selected", m_Selected);
218 222
		xml.putProperty("type", Layout.RECTANGLEGROUP);
219 223
		xml.putProperty("tag", getTag());
220

  
224
		xml.putProperty("m_rotation",getRotation());
221 225
		for (int i = 0; i < getFFrames().size(); i++) {
222 226
			xml.addChild(((IFFrame) getFFrames().get(i)).getXMLEntity());
223 227
		}
......
260 264
		} else {
261 265
			this.setSelected(false);
262 266
		}
263

  
267
		setRotation(xml.getDoubleProperty("m_rotation"));
264 268
		IFFrame fframechild = null;
265 269

  
266 270
		for (int i = 0; i < xml.getNumChild(); i++) {
......
290 294
	 */
291 295
	public void print(Graphics2D g, AffineTransform at)
292 296
		throws DriverException {
297
		Rectangle2D.Double r = getBoundingBox(at);
298
		g.rotate(Math.toRadians(getRotation()), r.x + (r.width / 2),
299
				r.y + (r.height / 2));
293 300
		for (int i = 0; i < m_fframes.size(); i++) {
294 301
			((IFFrame) m_fframes.get(i)).print(g, at);
295 302
		}
303
		g.rotate(Math.toRadians(-getRotation()),
304
				r.x + (r.width / 2), r.y + (r.height / 2));
296 305
	}
297 306
}

Also available in: Unified diff