Revision 36669
branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/SplitGeometryCADToolExtension.java | ||
---|---|---|
113 | 113 |
getEditionManager(). |
114 | 114 |
getActiveLayerEdited(). |
115 | 115 |
getLayer(); |
116 |
int geometryDimensions = getDimensions(lv.getShapeType()); |
|
117 |
if(geometryDimensions <= 0) |
|
116 |
if (isPoint(lv.getShapeType())){ |
|
118 | 117 |
return false; |
118 |
} |
|
119 | 119 |
|
120 | 120 |
return !lv.getFeatureStore().getFeatureSelection().isEmpty(); |
121 | 121 |
} |
... | ... | |
125 | 125 |
} |
126 | 126 |
return true; |
127 | 127 |
} |
128 |
private static int getDimensions(int shapeType) { |
|
129 |
switch (shapeType) { |
|
130 |
case Geometry.TYPES.ARC: |
|
131 |
case Geometry.TYPES.CURVE: |
|
132 |
return 1; |
|
133 |
|
|
134 |
case Geometry.TYPES.CIRCLE: |
|
135 |
case Geometry.TYPES.ELLIPSE: |
|
136 |
case Geometry.TYPES.SURFACE: |
|
137 |
case Geometry.TYPES.GEOMETRY: |
|
138 |
return 2; |
|
139 |
|
|
128 |
|
|
129 |
private boolean isPoint(int shapeType) { |
|
130 |
switch (shapeType) { |
|
140 | 131 |
case Geometry.TYPES.MULTIPOINT: |
141 |
case Geometry.TYPES.POINT:
|
|
142 |
return 0;
|
|
132 |
case Geometry.TYPES.POINT:
|
|
133 |
return true;
|
|
143 | 134 |
default: |
144 |
return -1;
|
|
135 |
return false;
|
|
145 | 136 |
} |
146 | 137 |
} |
147 | 138 |
|
Also available in: Unified diff