KickJava   Java API By Example, From Geeks To Geeks.

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


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
31 public interface IZoomSupport
32 {
33     /**
34      *
35      * @param zoomListener the IZoomListener to add
36      */

37     void addZoomListener(IZoomListener zoomListener);
38     
39     /**
40      *
41      * @param zoomListener the zoomListener to remove
42      */

43     void removeZoomListener(IZoomListener zoomListener);
44     
45     /**
46      *
47      * @param zoomFactor the zoomFactor (100% = 1.0)
48      */

49     void setZoom(double zoomFactor);
50     
51     /**
52      *
53      * @return the zoomFactor (100% = 1.0)
54      */

55     double getZoom();
56     
57     /**
58      *
59      * @return the minimum zoomFactor
60      */

61     double getMinZoom();
62     
63     /**
64      *
65      * @param minZoom the minimum zoomFactor to set
66      */

67     void setMinZoom(double minZoom);
68     
69     /**
70      *
71      * @return the maximum zoomFactor
72      */

73     double getMaxZoom();
74     
75     /**
76      *
77      * @param maxZoom the maximum zoomFactor to set
78      */

79     void setMaxZoom(double maxZoom);
80     
81     /**
82      *
83      * @return the value of each zoomIncrement (e.g. zoomIn/zoomOut)
84      */

85     double getZoomStep();
86     
87     /**
88      *
89      * @param zoomStep the value of each zoomIncrement to set
90      */

91     void setZoomStep(double zoomStep);
92     
93     /**
94      * if the maxZoomFactor is not yet reached, the zoomFactor is incremented
95      * by one zoomStep
96      *
97      */

98     void zoomIn();
99     
100     /**
101      * if the minZoomFactor is not yet reached, the zoomFactor is decremented
102      * by one zoomStep
103      *
104      */

105     void zoomOut();
106     
107     /**
108      *
109      * @return if the maxZoomFactor is not yet reached returns true,
110      * otherwise false
111      */

112     boolean canZoomIn();
113     
114     /**
115      *
116      * @return if the minZoomFactor is not yet reached returns true,
117      * otherwise false
118      */

119     boolean canZoomOut();
120     
121     /**
122      *
123      * @return the zoomFactor as procentual String
124      */

125     String JavaDoc getZoomAsString();
126     
127     /**
128      * zooms the Viewport to the given Rectangle
129      * @param r the Rectangle to zoom to
130      */

131     void zoomTo(Rectangle JavaDoc r);
132     
133     /**
134      *
135      * @return the viewport for the ZoomSupport
136      */

137     IViewport getViewport();
138     
139     /**
140      *
141      * @param viewport the viewport for the ZoomSupport
142      */

143     void setViewport(IViewport viewport);
144 }
145
Popular Tags