1 8 package com.nightlabs.editor2d.edit; 9 10 import java.beans.PropertyChangeEvent ; 11 12 import org.eclipse.ui.views.properties.IPropertySource; 13 14 import com.nightlabs.editor2d.EllipseDrawComponent; 15 import com.nightlabs.editor2d.model.EllipsePropertySource; 16 17 18 public class EllipseEditPart 19 extends ShapeDrawComponentEditPart 20 { 21 24 public EllipseEditPart(EllipseDrawComponent drawComponent) { 25 super(drawComponent); 26 } 27 28 protected EllipseDrawComponent getEllipseDrawComponent() { 29 return (EllipseDrawComponent) getModel(); 30 } 31 32 protected IPropertySource getPropertySource() 33 { 34 if (propertySource == null) 35 { 36 propertySource = 37 new EllipsePropertySource(getEllipseDrawComponent()); 38 } 39 return propertySource; 40 } 41 42 protected void propertyChanged(PropertyChangeEvent evt) 43 { 44 super.propertyChanged(evt); 45 String propertyName = evt.getPropertyName(); 46 if (propertyName.equals(EllipseDrawComponent.PROP_END_ANGLE)) { 47 LOGGER.debug(propertyName +" changed!"); 48 refreshVisuals(); 49 } 50 else if (propertyName.equals(EllipseDrawComponent.PROP_START_ANGLE)) { 51 LOGGER.debug(propertyName +" changed!"); 52 refreshVisuals(); 53 } 54 } 55 56 59 68 94 103 } 104 | Popular Tags |