|
From: <de...@us...> - 2012-07-11 13:36:34
|
Revision: 7479
http://fudaa.svn.sourceforge.net/fudaa/?rev=7479&view=rev
Author: deniger
Date: 2012-07-11 13:36:23 +0000 (Wed, 11 Jul 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueSelectionInteractionSimple.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueSelectionInteractionSimple.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueSelectionInteractionSimple.java 2012-07-11 09:16:43 UTC (rev 7478)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueSelectionInteractionSimple.java 2012-07-11 13:36:23 UTC (rev 7479)
@@ -27,20 +27,40 @@
*/
public class ZCalqueSelectionInteractionSimple extends ZCalqueSelectionInteractionAbstract {
+ private interface EditorDelegate {
+
+ String edit();
+ }
+ EditorDelegate editorDelegate;
+
// private ZCalqueAffichageDonneesInterface zcalquesActif_;
-
/**
* Cr\xE9ation d'un calque de s\xE9lection sans objets s\xE9lectionnables.
*/
- public ZCalqueSelectionInteractionSimple( final BGroupeCalque _donnees) {
+ public ZCalqueSelectionInteractionSimple(final BGroupeCalque _donnees) {
super(_donnees);
}
+ public EditorDelegate getEditorDelegate() {
+ return editorDelegate;
+ }
+
+ public void setEditorDelegate(EditorDelegate editorDelegate) {
+ this.editorDelegate = editorDelegate;
+ }
+
+ @Override
public boolean editionAsked() {
- String message = editor_.edit();
- if(message!=null)
- FuLog.trace("EBL : ZCalqueSelectionInteractionSimple : "+message);
- return message!=null;
+ String message = null;
+ if (editorDelegate != null) {
+ message = editorDelegate.edit();
+ } else {
+ message = editor_.edit();
+ }
+ if (message != null) {
+ FuLog.trace("EBL : ZCalqueSelectionInteractionSimple : " + message);
+ }
+ return message != null;
}
/**
@@ -50,23 +70,21 @@
if (internalGetScene().isRestrictedToCalqueActif() && internalGetScene().getCalqueActif() == null) {
return;
}
- if (mode_ == PONCTUEL ||
- (mode_ == RECTANGLE && listePoints_.renvoie(0).distanceXY(listePoints_.renvoie(2))<4)) {
- if (idxGeomAccroch_!=null) {
- ZSceneSelection ssel=new ZSceneSelection(internalGetScene());
- CtuluListSelection sel=new CtuluListSelection(new int[]{idxVertexAccroch_});
+ if (mode_ == PONCTUEL
+ || (mode_ == RECTANGLE && listePoints_.renvoie(0).distanceXY(listePoints_.renvoie(2)) < 4)) {
+ if (idxGeomAccroch_ != null) {
+ ZSceneSelection ssel = new ZSceneSelection(internalGetScene());
+ CtuluListSelection sel = new CtuluListSelection(new int[]{idxVertexAccroch_});
ssel.set(idxGeomAccroch_, sel);
internalGetScene().changeSelection(ssel, modificateur_.getModificateur());
- }
- else {
+ } else {
final GrPoint pt = listePoints_.renvoie(0);
pt.autoApplique(getVersReel());
internalGetScene().changeSelection(pt, tolerancePixel_, modificateur_.getModificateur());
}
- }
- else {
+ } else {
final GrPolygone poly = plHelper_.toGrPolygone();
- if (poly.nombre()>=3) {
+ if (poly.nombre() >= 3) {
poly.autoApplique(getVersReel());
final LinearRing l = GISGeometryFactory.INSTANCE.createLinearRing(poly.sommets_.createCoordinateSequence(true));
internalGetScene().changeSelection(l, modificateur_.getModificateur(), EbliSelectionMode.MODE_ALL);
@@ -74,7 +92,6 @@
}
}
-
/**
* Efface les selections de tous les calques.
*/
@@ -89,26 +106,14 @@
_g.setColor(old);
}
}
-
// boolean special_;
-/* public void setCalqueActif(final ZCalqueAffichageDonneesInterface _calque) {
- if (FuLog.isTrace()) {
- FuLog.trace("EBL: selection calque=" + (_calque == null ? "null" : _calque.getTitle()));
- }
-// addCalqueActif(_calque);
- if (_calque != zcalquesActif_) {
- if (zcalquesActif_ != null) {
- zcalquesActif_.clearSelection();
- }
- zcalquesActif_ = _calque;
- if (zcalquesActif_ == null) {
- modificateur_.setSpecial(false);
- } else {
- modificateur_.setSpecial(zcalquesActif_.isSpecialSelectionAllowed());
- }
- repaint();
- }
-
- }*/
+ /*
+ * public void setCalqueActif(final ZCalqueAffichageDonneesInterface _calque) { if (FuLog.isTrace()) { FuLog.trace("EBL: selection calque=" +
+ * (_calque == null ? "null" : _calque.getTitle())); } // addCalqueActif(_calque); if (_calque != zcalquesActif_) { if (zcalquesActif_ != null) {
+ * zcalquesActif_.clearSelection(); } zcalquesActif_ = _calque; if (zcalquesActif_ == null) { modificateur_.setSpecial(false); } else {
+ * modificateur_.setSpecial(zcalquesActif_.isSpecialSelectionAllowed()); } repaint(); }
+ *
+ * }
+ */
}
\ No newline at end of file
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2012-07-11 09:16:43 UTC (rev 7478)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2012-07-11 13:36:23 UTC (rev 7479)
@@ -50,6 +50,7 @@
editor_ = _editor;
}
+ @Override
public String editSelected() {
return editor_ == null ? EbliLib.getS("Edition impossible") : editor_.edit();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|