1 27 28 package org.nightlabs.editor2d.edit; 29 30 import java.beans.PropertyChangeEvent ; 31 32 import org.eclipse.ui.views.properties.IPropertySource; 33 34 import org.nightlabs.editor2d.EllipseDrawComponent; 35 import org.nightlabs.editor2d.model.EllipsePropertySource; 36 37 38 public class EllipseEditPart 39 extends ShapeDrawComponentEditPart 40 { 41 44 public EllipseEditPart(EllipseDrawComponent drawComponent) { 45 super(drawComponent); 46 } 47 48 protected EllipseDrawComponent getEllipseDrawComponent() { 49 return (EllipseDrawComponent) getModel(); 50 } 51 52 protected IPropertySource getPropertySource() 53 { 54 if (propertySource == null) 55 { 56 propertySource = 57 new EllipsePropertySource(getEllipseDrawComponent()); 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(EllipseDrawComponent.PROP_END_ANGLE)) { 67 LOGGER.debug(propertyName +" changed!"); 68 refreshVisuals(); 69 } 70 else if (propertyName.equals(EllipseDrawComponent.PROP_START_ANGLE)) { 71 LOGGER.debug(propertyName +" changed!"); 72 refreshVisuals(); 73 } 74 } 75 76 } 77 | Popular Tags |