KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.eclipse.swt.graphics.Color;
30 import org.nightlabs.editor2d.DrawComponent;
31 import org.nightlabs.editor2d.render.RenderModeManager;
32
33 public interface IViewer
34 {
35     /**
36      *
37      * @return the drawComponent to draw
38      */

39     DrawComponent getDrawComponent();
40     
41     /**
42      *
43      * @param dc the DrawComponent to draw
44      */

45     void setDrawComponent(DrawComponent dc);
46     
47     /**
48      * refreshes/repaints the Canvas
49      *
50      */

51     void updateCanvas();
52
53 // /**
54
// *
55
// * @return the ViewerCanvas which draws the drawComponent
56
// */
57
// ViewerCanvas getCanvas();
58

59 // /**
60
// *
61
// * @return the BufferedCanvas which draws the drawComponent
62
// */
63
// BufferedCanvas getCanvas();
64

65 // /**
66
// *
67
// * @return a J2DViewport which is draws the drawComponent
68
// */
69
// J2DViewport getCanvas();
70

71 // /**
72
// *
73
// * @return a J2DCanvas which is draws the drawComponent
74
// */
75
// J2DCanvas getCanvas();
76

77     /**
78      *
79      * @return the Background Color of the Viewer
80      */

81     Color getBgColor();
82     
83     /**
84      *
85      * @param bgColor the Background Color of the Viewer to set
86      */

87     void setBgColor(Color bgColor);
88             
89     /**
90      *
91      * @param zoomFactor the zoomFactor of the viewer (100% = 1.0)
92      */

93     void setZoom(double zoomFactor);
94     
95     /**
96      *
97      * @return the zoomFactor of the viewer (100% = 1.0)
98      */

99     double getZoom();
100     
101     /**
102      *
103      * @return the IZoomSupport of the viewer
104      * @see org.nightlabs.editor2d.viewer.IZoomSupport
105      */

106     IZoomSupport getZoomSupport();
107     
108     /**
109      *
110      * @return the RenderModeManager which manages the visual representation
111      * (renderers) for the given DrawComponent
112      * @see RenderModeManager
113      */

114     RenderModeManager getRenderModeManager();
115     
116     /**
117      *
118      * @return the viewport which displays the DrawComponent
119      */

120     IViewport getViewport();
121     
122     /**
123      *
124      * @return the BufferedCanvas of the Viewer
125      * (in most cases this is the viewport itself)
126      */

127     IBufferedCanvas getBufferedCanvas();
128     
129 // IBufferedViewport getViewport();
130

131 // /**
132
// *
133
// * @param x the X-Coordinate
134
// * @param y the Y-Coordinate
135
// * @return the topmost DrawComponent in the Z-Order which contains x and y
136
// */
137
// DrawComponent findObjectAt(int x, int y);
138

139     /**
140      *
141      * @return the implementation of IMouseManager, which is responsible for
142      * calculating the right Mouse-Coordinates
143      */

144     IMouseManager getMouseManager();
145     
146     ///**
147
//*
148
//* @return the ISelectionSupport which manages the selection of the viewer
149
//* @see org.nightlabs.rcp.selection.ISelectionSupport
150
//*/
151
//ISelectionSupport getSelectionSupport();
152

153     /**
154     *
155     * @return the SelectionManager which manages the selection of the viewer
156     * @see SelectionManager
157     */

158     SelectionManager getSelectionManager();
159     
160     /**
161      *
162      * @return the HitTestManager which manages hitTesting
163      */

164     HitTestManager getHitTestManager();
165 }
166
Popular Tags