1 27 28 package org.nightlabs.editor2d.edit; 29 30 import java.beans.PropertyChangeEvent ; 31 32 import org.apache.log4j.Logger; 33 import org.eclipse.ui.views.properties.IPropertySource; 34 35 import org.nightlabs.editor2d.ImageDrawComponent; 36 import org.nightlabs.editor2d.model.ImagePropertySource; 37 38 public class ImageEditPart 39 extends DrawComponentEditPart 41 { 42 public static final Logger LOGGER = Logger.getLogger(ImageEditPart.class); 43 44 public ImageEditPart(ImageDrawComponent drawComponent) { 45 super(drawComponent); 46 } 47 48 protected ImageDrawComponent getImageDrawComponent() { 49 return (ImageDrawComponent) getModel(); 50 } 51 52 protected IPropertySource getPropertySource() 53 { 54 if (propertySource == null) 55 { 56 propertySource = 57 new ImagePropertySource(getImageDrawComponent()); 58 } 59 return propertySource; 60 } 61 62 protected void propertyChanged(PropertyChangeEvent evt) 63 { 64 super.propertyChanged(evt); 65 String propertyName = evt.getPropertyName(); 66 if (propertyName.equals(ImageDrawComponent.PROP_IMAGE)) { 67 LOGGER.debug(propertyName +" changed!"); 68 refreshVisuals(); 69 } 70 } 71 72 89 } 90 | Popular Tags |