3,7 → 3,11 |
import org.tela_botanica.client.interfaces.Rafraichissable; |
import org.tela_botanica.client.observation.ObservationMediateur; |
|
import com.google.gwt.user.client.DOM; |
import com.google.gwt.user.client.Event; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.Image; |
import com.gwtext.client.core.Ext; |
import com.gwtext.client.widgets.Panel; |
|
/** |
26,7 → 30,10 |
*/ |
private Image image = new Image(); |
|
private String urlImage = "" ; |
|
com.gwtext.client.widgets.Window imgZoom = new com.gwtext.client.widgets.Window("Agrandissement") ; |
|
/** |
* Constructeur sans argument (privé car ne doit pas être utilisé) |
*/ |
47,6 → 54,24 |
|
this.observationMediateur = obs; |
|
imgZoom.setCloseAction(com.gwtext.client.widgets.Window.HIDE) ; |
image = new Image() { |
|
public void onBrowserEvent(Event event) { |
|
// lors du double clic |
if (Event.ONDBLCLICK == DOM.eventGetType(event)) { |
|
// on notifie le médiateur |
agrandirImage() ; |
} |
} |
|
}; |
|
image.sinkEvents(Event.ONDBLCLICK); |
|
this.setCls("x-image-info-rep") ; |
image.setPixelSize(150, 150); |
add(image); |
|
66,7 → 91,7 |
// si on recoit une String contenant une URL |
if (nouvelleDonnees instanceof String) { |
|
String urlImage=(String) nouvelleDonnees; |
urlImage=(String) nouvelleDonnees; |
|
if (urlImage.length()==0) { |
raz() ; |
77,6 → 102,21 |
} |
|
} |
|
public void agrandirImage() { |
|
if(!imgZoom.isVisible()) |
{ |
String urlAgrandie = urlImage.replace("min", "max") ; |
|
imgZoom.setHtml("<img src=\""+urlAgrandie+"\" />") ; |
imgZoom.setPagePosition( Window.getClientWidth()/2, Window.getClientHeight()/5) ; |
imgZoom.setAutoHeight(true) ; |
imgZoom.setAutoWidth(true) ; |
imgZoom.show(this.getElement()) ; |
} |
|
} |
|
|
/** |