Revision: 5257
http://sourceforge.net/p/jump-pilot/code/5257
Author: ma15569
Date: 2016-12-14 16:53:28 +0000 (Wed, 14 Dec 2016)
Log Message:
-----------
RotateSelectedItemTool shows rotation center as point shape if this has been
set (shift option)
Modified Paths:
--------------
core/trunk/ChangeLog
core/trunk/src/org/openjump/core/ui/plugin/edittoolbox/cursortools/RotateSelectedItemTool.java
Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog 2016-12-14 14:05:08 UTC (rev 5256)
+++ core/trunk/ChangeLog 2016-12-14 16:53:28 UTC (rev 5257)
@@ -3,6 +3,11 @@
# 2. make sure that lines break at 80 chars for constricted display situations
#<-------------------------------- 80 chars
---------------------------------->#
+2016-14-10 Giuseppe Aruta <[email protected]>
+ * Updated Italian Language file
+ * RotateSelectedItemTool shows rotation center as point shape
+ if this has been set (shift option)
+
2016-12-10 mmichaud <[email protected]>
* Sort the list of SRS in WMS layer SRS chooser + fix some I18N
Modified:
core/trunk/src/org/openjump/core/ui/plugin/edittoolbox/cursortools/RotateSelectedItemTool.java
===================================================================
---
core/trunk/src/org/openjump/core/ui/plugin/edittoolbox/cursortools/RotateSelectedItemTool.java
2016-12-14 14:05:08 UTC (rev 5256)
+++
core/trunk/src/org/openjump/core/ui/plugin/edittoolbox/cursortools/RotateSelectedItemTool.java
2016-12-14 16:53:28 UTC (rev 5257)
@@ -59,6 +59,7 @@
import com.vividsolutions.jts.geom.CoordinateFilter;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;
+import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jump.I18N;
import com.vividsolutions.jump.workbench.JUMPWorkbench;
import com.vividsolutions.jump.workbench.model.Layer;
@@ -219,25 +220,30 @@
}
}
+ protected static GeometryFactory geomFac = new GeometryFactory();
+
+ @SuppressWarnings("unchecked")
private Shape createSelectedItemsShape()
- throws NoninvertibleTransformException {
- Collection selectedGeos = (getPanel().getSelectionManager()
- .getSelectedItems());
- Geometry geo = ((Geometry) selectedGeos.iterator().next());
- Geometry[] allGeoms = new Geometry[selectedGeos.size()];
- int i = 0;
- for (Iterator j = selectedGeos.iterator(); j.hasNext();)
- allGeoms[i++] = (Geometry) j.next();
+ throws NoninvertibleTransformException {
+ Collection selectedGeos = (getPanel().getSelectionManager()
+ .getSelectedItems());
+ Point p = geomFac.createPoint(centerCoord);
+ selectedGeos.add(p);
+ Geometry geo = ((Geometry) selectedGeos.iterator().next());
+ Geometry[] allGeoms = new Geometry[selectedGeos.size()];
+ int i = 0;
+ for (Iterator j = selectedGeos.iterator(); j.hasNext();)
+ allGeoms[i++] = (Geometry) j.next();
+ GeometryFactory geoFac = new GeometryFactory();
+ geo = geoFac.createGeometryCollection(allGeoms);
+ if (centerCoord == null) {
+ centerCoord = geo.getCentroid().getCoordinate();
+ }
+ Shape shap = getPanel().getJava2DConverter().toShape(geo);
+ return shap;
+ }
- GeometryFactory geoFac = new GeometryFactory();
- geo = geoFac.createGeometryCollection(allGeoms);
- if (centerCoord == null) {
- centerCoord = geo.getCentroid().getCoordinate();
- }
- return getPanel().getJava2DConverter().toShape(geo);
- }
-
protected Shape getShape() throws Exception {
AffineTransform transform = new AffineTransform();
Point2D centerPt = getPanel().getViewport().toViewPoint(
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel