]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/canvas/impl/DisposedCanvasContext.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / canvas / impl / DisposedCanvasContext.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.g2d.canvas.impl;
13
14 import java.util.Collection;
15
16 import org.simantics.g2d.canvas.ICanvasContext;
17 import org.simantics.g2d.canvas.ICanvasParticipant;
18 import org.simantics.g2d.canvas.IContentContext;
19 import org.simantics.g2d.canvas.IMouseCaptureContext;
20 import org.simantics.g2d.canvas.IMouseCursorContext;
21 import org.simantics.g2d.chassis.ITooltipProvider;
22 import org.simantics.scenegraph.g2d.G2DParentNode;
23 import org.simantics.scenegraph.g2d.G2DSceneGraph;
24 import org.simantics.scenegraph.g2d.events.IEventHandlerStack;
25 import org.simantics.scenegraph.g2d.events.IEventQueue;
26 import org.simantics.utils.datastructures.context.IContextListener;
27 import org.simantics.utils.datastructures.disposable.DisposeState;
28 import org.simantics.utils.datastructures.disposable.IDisposeListener;
29 import org.simantics.utils.datastructures.hints.IHintContext;
30 import org.simantics.utils.datastructures.hints.IHintStack;
31 import org.simantics.utils.threads.IThreadWorkQueue;
32
33 /**
34  * A dummy implementation of ICanvasContext that is immediately marked disposed.
35  * Can be used in situations where the disposedness of an ICanvasContext is used
36  * for (transient) life-cycle management.
37  * 
38  * @author Tuukka Lehtonen
39  */
40 public class DisposedCanvasContext implements ICanvasContext {
41
42     public static final DisposedCanvasContext INSTANCE = new DisposedCanvasContext();
43
44     @Override
45     public G2DParentNode getCanvasNode() {
46         throw new UnsupportedOperationException();
47     }
48
49     @Override
50     public IContentContext getContentContext() {
51         throw new UnsupportedOperationException();
52     }
53
54     @Override
55     public IHintContext getDefaultHintContext() {
56         throw new UnsupportedOperationException();
57     }
58
59     @Override
60     public IEventHandlerStack getEventHandlerStack() {
61         throw new UnsupportedOperationException();
62     }
63
64     @Override
65     public IEventQueue getEventQueue() {
66         throw new UnsupportedOperationException();
67     }
68
69     @Override
70     public IHintStack getHintStack() {
71         throw new UnsupportedOperationException();
72     }
73
74     @Override
75     public IMouseCaptureContext getMouseCaptureContext() {
76         throw new UnsupportedOperationException();
77     }
78
79     @Override
80     public IMouseCursorContext getMouseCursorContext() {
81         throw new UnsupportedOperationException();
82     }
83
84     @Override
85     public G2DSceneGraph getSceneGraph() {
86         throw new UnsupportedOperationException();
87     }
88
89     @Override
90     public IThreadWorkQueue getThreadAccess() {
91         throw new UnsupportedOperationException();
92     }
93
94     @Override
95     public void setCanvasNode(G2DParentNode node) {
96         throw new UnsupportedOperationException();
97     }
98
99     @Override
100     public void setContentContext(IContentContext ctx) {
101         throw new UnsupportedOperationException();
102     }
103
104     @Override
105     public void setMouseCaptureContext(IMouseCaptureContext mctx) {
106         throw new UnsupportedOperationException();
107     }
108
109     @Override
110     public void setMouseCursorContext(IMouseCursorContext mctx) {
111         throw new UnsupportedOperationException();
112     }
113
114     @Override
115     public boolean isLocked() {
116         return false;
117     }
118
119     @Override
120     public void setLocked(boolean locked) {
121     }
122
123     @Override
124     public void add(ICanvasParticipant item) {
125         throw new UnsupportedOperationException();
126     }
127
128     @Override
129     public void addContextListener(IContextListener<ICanvasParticipant> listener) {
130         throw new UnsupportedOperationException();
131     }
132
133     @Override
134     public void addContextListener(IThreadWorkQueue thread, IContextListener<ICanvasParticipant> listener) {
135         throw new UnsupportedOperationException();
136     }
137
138     @Override
139     public void clear() {
140         throw new UnsupportedOperationException();
141     }
142
143     @Override
144     public boolean contains(ICanvasParticipant item) {
145         throw new UnsupportedOperationException();
146     }
147
148     @Override
149     public <R> boolean containsItemByClass(Class<R> clazz) {
150         throw new UnsupportedOperationException();
151     }
152
153     @Override
154     public <R extends ICanvasParticipant> R getAtMostOneItemOfClass(Class<R> clazz) {
155         throw new UnsupportedOperationException();
156     }
157
158     @Override
159     public <R extends ICanvasParticipant> Collection<R> getItemsByClass(Class<R> clazz) {
160         throw new UnsupportedOperationException();
161     }
162
163     @Override
164     public <R extends ICanvasParticipant> R getSingleItem(Class<R> clazz) {
165         throw new UnsupportedOperationException();
166     }
167
168     @Override
169     public boolean remove(ICanvasParticipant item) {
170         throw new UnsupportedOperationException();
171     }
172
173     @Override
174     public void removeContextListener(IContextListener<ICanvasParticipant> listener) {
175         throw new UnsupportedOperationException();
176     }
177
178     @Override
179     public void removeContextListener(IThreadWorkQueue thread, IContextListener<ICanvasParticipant> listener) {
180         throw new UnsupportedOperationException();
181     }
182
183     @Override
184     public ICanvasParticipant[] toArray() {
185         throw new UnsupportedOperationException();
186     }
187
188     @Override
189     public void addDisposeListener(IDisposeListener listener) {
190         throw new UnsupportedOperationException();
191     }
192
193     @Override
194     public void addDisposeListener(IDisposeListener listener, IThreadWorkQueue thread) {
195         throw new UnsupportedOperationException();
196     }
197
198     @Override
199     public void dispose() {
200         throw new UnsupportedOperationException();
201     }
202
203     @Override
204     public DisposeState getDisposeState() {
205         return DisposeState.Disposed;
206     }
207
208     @Override
209     public boolean isDisposed() {
210         return true;
211     }
212
213     @Override
214     public void removeDisposeListener(IDisposeListener listener) {
215         throw new UnsupportedOperationException();
216     }
217
218     @Override
219     public void removeDisposeListener(IDisposeListener listener, IThreadWorkQueue thread) {
220         throw new UnsupportedOperationException();
221     }
222
223     @Override
224     public void safeDispose() {
225         throw new UnsupportedOperationException();
226     }
227
228         @Override
229         public ITooltipProvider getTooltipProvider() {
230         throw new UnsupportedOperationException();
231         }
232
233         @Override
234         public void setTooltipProvider(ITooltipProvider tooltipProvider) {
235         throw new UnsupportedOperationException();
236         }
237
238 }