KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > editor2d > edit > ImageEditPart


1 /**
2  * <p> Project: com.nightlabs.editor2d </p>
3  * <p> Copyright: Copyright (c) 2004 </p>
4  * <p> Company: NightLabs GmbH (Germany) </p>
5  * <p> Creation Date: 21.03.2005 </p>
6  * <p> Author: Daniel Mazurek </p>
7 **/

8 package com.nightlabs.editor2d.edit;
9
10 import java.beans.PropertyChangeEvent JavaDoc;
11
12 import org.apache.log4j.Logger;
13
14 import com.nightlabs.editor2d.ImageDrawComponent;
15
16 public class ImageEditPart
17 //extends AbstractDrawComponentEditPart
18
extends DrawComponentEditPart
19 {
20   public static final Logger LOGGER = Logger.getLogger(ImageEditPart.class);
21   
22   public ImageEditPart(ImageDrawComponent drawComponent) {
23     super(drawComponent);
24   }
25
26   protected ImageDrawComponent getImageDrawComponent() {
27     return (ImageDrawComponent) getModel();
28   }
29   
30 // protected ImageFigure getImageFigure() {
31
// return (ImageFigure) getFigure();
32
// }
33
//
34
// protected IFigure createFigure()
35
// {
36
// BufferedImage image = getImageDrawComponent().getImage();
37
// ImageFigure imageFigure = new ImageFigure(image);
38
// return imageFigure;
39
// }
40
//
41
// protected void refreshVisuals()
42
// {
43
// getImageFigure().setBufferedImage(getImageDrawComponent().getImage());
44
// super.refreshVisuals();
45
// }
46

47     protected void propertyChanged(PropertyChangeEvent JavaDoc evt)
48     {
49         super.propertyChanged(evt);
50         String JavaDoc propertyName = evt.getPropertyName();
51         if (propertyName.equals(ImageDrawComponent.PROP_IMAGE)) {
52             LOGGER.debug(propertyName +" changed!");
53             refreshVisuals();
54         }
55     }
56   
57 // public void notifyChanged(Notification notification)
58
// {
59
// int type = notification.getEventType();
60
// int featureId = notification.getFeatureID(Editor2DPackage.class);
61
//
62
// if (type == Notification.SET)
63
// {
64
// switch (featureId)
65
// {
66
// case Editor2DPackage.IMAGE_DRAW_COMPONENT__IMAGE :
67
// LOGGER.debug("IMAGE_DRAW_COMPONENT__IMAGE Notified!");
68
// refreshVisuals();
69
// break;
70
// }
71
// }
72
// super.notifyChanged(notification);
73
// }
74
}
75
Popular Tags