KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nightlabs > editor2d > viewer > IViewport


1 /* *****************************************************************************
2  * NightLabs Editor2D - Graphical editor framework *
3  * Copyright (C) 2004-2005 NightLabs - http://NightLabs.org *
4  * *
5  * This library is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or (at your option) any later version. *
9  * *
10  * This library is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13  * Lesser General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU Lesser General Public *
16  * License along with this library; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin St, Fifth Floor, *
19  * Boston, MA 02110-1301 USA *
20  * *
21  * Or get it online : *
22  * http://www.gnu.org/copyleft/lesser.html *
23  * *
24  * *
25  ******************************************************************************/

26
27 package org.nightlabs.editor2d.viewer;
28
29 import java.awt.Rectangle JavaDoc;
30 import java.awt.geom.Point2D JavaDoc;
31 import java.beans.PropertyChangeListener JavaDoc;
32
33 public interface IViewport
34 {
35     public static final String JavaDoc VIEW_CHANGE = "viewChange";
36     public static final String JavaDoc REAL_CHANGE = "realChange";
37 // public static final String BUFFER_CHANGE = "bufferChange";
38

39     /**
40      * @param realBounds the bounds of the whole area of the viewport
41      */

42     void setRealBounds(Rectangle JavaDoc realBounds);
43     
44     /**
45      *
46      * @return the bounds of the whole area of the viewport
47      */

48     Rectangle JavaDoc getRealBounds();
49     
50     /**
51      *
52      * @param viewBounds sets the bounds of the visible area of the viewport
53      */

54     void setViewBounds(Rectangle JavaDoc viewBounds);
55     
56     /**
57      *
58      * @return the bounds of the visible area of the viewport
59      */

60     Rectangle JavaDoc getViewBounds();
61     
62     /**
63      * sets the upper left corner of visible area of the viewport
64      * @param p the upper left view location
65      */

66     void setViewLocation(Point2D JavaDoc p);
67     
68     /**
69      * sets the upper left corner of visible area of the viewport
70      * @param x the X-Coordinate
71      * @param y the Y-Coordinate
72      */

73     void setViewLocation(int x, int y);
74     
75     /**
76      *
77      * @return the viewLocation
78      */

79     Point2D JavaDoc getViewLocation();
80             
81     /**
82      * @return the offset in X-direction between the viewBounds and the realBounds
83      */

84     int getOffsetX();
85         
86     /**
87      * @return the offset in Y-direction between the viewBounds and the realBounds
88      */

89     int getOffsetY();
90     
91     /**
92      *
93      * @param pcl the PropertyChangeListener which will be notified of
94      * changes of the realBounds or the viewBounds, the corresponding
95      * propertyName is either <code>VIEW_CHANGE</code> or <code>REAL_CHANGE</code>
96      */

97     void addPropertyChangeListener(PropertyChangeListener JavaDoc pcl);
98     
99     /**
100      *
101      * @param pcl the propertyChangeListener to remove
102      */

103     void removePropertyChangeListener(PropertyChangeListener JavaDoc pcl);
104 }
105
Popular Tags