1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.g2d.canvas.impl;
14 import java.util.Collection;
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;
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.
38 * @author Tuukka Lehtonen
40 public class DisposedCanvasContext implements ICanvasContext {
42 public static final DisposedCanvasContext INSTANCE = new DisposedCanvasContext();
45 public G2DParentNode getCanvasNode() {
46 throw new UnsupportedOperationException();
50 public IContentContext getContentContext() {
51 throw new UnsupportedOperationException();
55 public IHintContext getDefaultHintContext() {
56 throw new UnsupportedOperationException();
60 public IEventHandlerStack getEventHandlerStack() {
61 throw new UnsupportedOperationException();
65 public IEventQueue getEventQueue() {
66 throw new UnsupportedOperationException();
70 public IHintStack getHintStack() {
71 throw new UnsupportedOperationException();
75 public IMouseCaptureContext getMouseCaptureContext() {
76 throw new UnsupportedOperationException();
80 public IMouseCursorContext getMouseCursorContext() {
81 throw new UnsupportedOperationException();
85 public G2DSceneGraph getSceneGraph() {
86 throw new UnsupportedOperationException();
90 public IThreadWorkQueue getThreadAccess() {
91 throw new UnsupportedOperationException();
95 public void setCanvasNode(G2DParentNode node) {
96 throw new UnsupportedOperationException();
100 public void setContentContext(IContentContext ctx) {
101 throw new UnsupportedOperationException();
105 public void setMouseCaptureContext(IMouseCaptureContext mctx) {
106 throw new UnsupportedOperationException();
110 public void setMouseCursorContext(IMouseCursorContext mctx) {
111 throw new UnsupportedOperationException();
115 public boolean isLocked() {
120 public void setLocked(boolean locked) {
124 public void add(ICanvasParticipant item) {
125 throw new UnsupportedOperationException();
129 public void addContextListener(IContextListener<ICanvasParticipant> listener) {
130 throw new UnsupportedOperationException();
134 public void addContextListener(IThreadWorkQueue thread, IContextListener<ICanvasParticipant> listener) {
135 throw new UnsupportedOperationException();
139 public void clear() {
140 throw new UnsupportedOperationException();
144 public boolean contains(ICanvasParticipant item) {
145 throw new UnsupportedOperationException();
149 public <R> boolean containsItemByClass(Class<R> clazz) {
150 throw new UnsupportedOperationException();
154 public <R extends ICanvasParticipant> R getAtMostOneItemOfClass(Class<R> clazz) {
155 throw new UnsupportedOperationException();
159 public <R extends ICanvasParticipant> Collection<R> getItemsByClass(Class<R> clazz) {
160 throw new UnsupportedOperationException();
164 public <R extends ICanvasParticipant> R getSingleItem(Class<R> clazz) {
165 throw new UnsupportedOperationException();
169 public boolean remove(ICanvasParticipant item) {
170 throw new UnsupportedOperationException();
174 public void removeContextListener(IContextListener<ICanvasParticipant> listener) {
175 throw new UnsupportedOperationException();
179 public void removeContextListener(IThreadWorkQueue thread, IContextListener<ICanvasParticipant> listener) {
180 throw new UnsupportedOperationException();
184 public ICanvasParticipant[] toArray() {
185 throw new UnsupportedOperationException();
189 public void addDisposeListener(IDisposeListener listener) {
190 throw new UnsupportedOperationException();
194 public void addDisposeListener(IDisposeListener listener, IThreadWorkQueue thread) {
195 throw new UnsupportedOperationException();
199 public void dispose() {
200 throw new UnsupportedOperationException();
204 public DisposeState getDisposeState() {
205 return DisposeState.Disposed;
209 public boolean isDisposed() {
214 public void removeDisposeListener(IDisposeListener listener) {
215 throw new UnsupportedOperationException();
219 public void removeDisposeListener(IDisposeListener listener, IThreadWorkQueue thread) {
220 throw new UnsupportedOperationException();
224 public void safeDispose() {
225 throw new UnsupportedOperationException();
229 public ITooltipProvider getTooltipProvider() {
230 throw new UnsupportedOperationException();
234 public void setTooltipProvider(ITooltipProvider tooltipProvider) {
235 throw new UnsupportedOperationException();