KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > bridge > UpdateManagerEvent


1 /*
2
3    Copyright 2001-2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.bridge;
19
20 import java.awt.image.BufferedImage JavaDoc;
21 import java.util.EventObject JavaDoc;
22 import java.util.List JavaDoc;
23
24 /**
25  * This class represents an event which indicate an event originated
26  * from a UpdateManager instance.
27  *
28  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
29  * @version $Id: UpdateManagerEvent.java,v 1.7 2005/03/27 08:58:30 cam Exp $
30  */

31 public class UpdateManagerEvent extends EventObject JavaDoc {
32
33     /**
34      * The buffered image.
35      */

36     protected BufferedImage JavaDoc image;
37     
38     /**
39      * The dirty areas, as a List of Rectangles.
40      */

41     protected List JavaDoc dirtyAreas;
42
43     /**
44      * True if before painting this update the canvas's painting
45      * transform needs to be cleared.
46      */

47     protected boolean clearPaintingTransform;
48
49     /**
50      * Creates a new UpdateManagerEvent.
51      * @param source the object that originated the event, ie. the
52      * UpdateManager.
53      * @param bi the image to paint.
54      * @param das List of dirty areas.
55      */

56     public UpdateManagerEvent(Object JavaDoc source, BufferedImage JavaDoc bi,
57                               List JavaDoc das) {
58         super(source);
59         this.image = bi;
60         this.dirtyAreas = das;
61         this.clearPaintingTransform = false;
62     }
63
64     /**
65      * Creates a new UpdateManagerEvent.
66      * @param source the object that originated the event, ie. the
67      * UpdateManager.
68      * @param bi the image to paint.
69      * @param das List of dirty areas.
70      * @param cpt Indicates if the painting transform should be
71      * cleared as a result of this event.
72      */

73     public UpdateManagerEvent(Object JavaDoc source, BufferedImage JavaDoc bi,
74                               List JavaDoc das, boolean cpt) {
75         super(source);
76         this.image = bi;
77         this.dirtyAreas = das;
78         this.clearPaintingTransform = cpt;
79     }
80
81     /**
82      * Returns the image to display, or null if the rendering failed.
83      */

84     public BufferedImage JavaDoc getImage() {
85         return image;
86     }
87
88     /**
89      * Returns the dirty areas (list of rectangles)
90      */

91     public List JavaDoc getDirtyAreas() {
92         return dirtyAreas;
93     }
94
95     /**
96      * returns true if the component should clear it's painting transform
97      * before painting the associated BufferedImage.
98      */

99     public boolean getClearPaintingTransform() {
100         return clearPaintingTransform;
101     }
102 }
103
Popular Tags