]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/canvas/ICanvasContext.java
List the unsatisfied dependencies in CanvasContext
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / canvas / ICanvasContext.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 /*\r
13  *\r
14  * @author Toni Kalajainen\r
15  */\r
16 package org.simantics.g2d.canvas;\r
17 \r
18 import org.simantics.g2d.chassis.ICanvasChassis;\r
19 import org.simantics.g2d.chassis.ITooltipProvider;\r
20 import org.simantics.scenegraph.g2d.G2DParentNode;\r
21 import org.simantics.scenegraph.g2d.G2DSceneGraph;\r
22 import org.simantics.scenegraph.g2d.events.IEventHandlerStack;\r
23 import org.simantics.scenegraph.g2d.events.IEventQueue;\r
24 import org.simantics.utils.datastructures.context.IContext;\r
25 import org.simantics.utils.datastructures.disposable.IDisposable;\r
26 import org.simantics.utils.datastructures.hints.IHintContext;\r
27 import org.simantics.utils.datastructures.hints.IHintStack;\r
28 import org.simantics.utils.threads.IThreadWorkQueue;\r
29 \r
30 \r
31 /**\r
32  * Canvas context.\r
33  *\r
34  * TODO Add Mouse(Id) Discovery and enumeration\r
35  */\r
36 public interface ICanvasContext extends\r
37 IContext<ICanvasParticipant>,\r
38 IDisposable\r
39 {\r
40 \r
41     /**\r
42      * Get content monitor context.\r
43      * @return\r
44      */\r
45     IContentContext getContentContext();\r
46     void setContentContext(IContentContext ctx);\r
47 \r
48     /**\r
49      * Get Event queue\r
50      * @return event queue\r
51      */\r
52     IEventQueue getEventQueue();\r
53 \r
54 \r
55     /**\r
56      * Get event handler stack. Higher priority event handlers get events first.\r
57      *\r
58      * @return the stack\r
59      */\r
60     IEventHandlerStack getEventHandlerStack();\r
61 \r
62     /**\r
63      * Get the hint stack of this interactor context.\r
64      * Any interactor that adds a layer into the stack should also remove it\r
65      * if the context is changed.\r
66      *\r
67      * @return the hint stack\r
68      */\r
69     IHintStack getHintStack();\r
70 \r
71     /**\r
72      * Get the hint context of lowest priority in the stack.\r
73      *\r
74      * @return hint context.\r
75      */\r
76     IHintContext getDefaultHintContext();\r
77 \r
78     /**\r
79      * Get the thread that is used for handling events and painting.\r
80      * External modifications to the three stacks (painter, event handler,\r
81      * and hint stack) and to the participant context must be made\r
82      * in this thread.\r
83      *\r
84      * All participant events / painting is executed from this thread.\r
85      *\r
86      * @return access to thread\r
87      */\r
88     IThreadWorkQueue getThreadAccess();\r
89 \r
90     /**\r
91      * Set mouse cursor context. Initially there is a default context.\r
92      * @param mctx\r
93      */\r
94     void setMouseCursorContext(IMouseCursorContext mctx);\r
95     IMouseCursorContext getMouseCursorContext();\r
96 \r
97 \r
98     /**\r
99      * Set mouse capture context. Initially there is a default context.\r
100      * @param mctx\r
101      */\r
102     void setMouseCaptureContext(IMouseCaptureContext mctx);\r
103     IMouseCaptureContext getMouseCaptureContext();\r
104 \r
105     /**\r
106      * @return the scene graph root node associated with this canvas context\r
107      */\r
108     G2DSceneGraph getSceneGraph();\r
109 \r
110     G2DParentNode getCanvasNode();\r
111     void setCanvasNode(G2DParentNode node);\r
112 \r
113     /**\r
114      * Set the locked state of the canvas context. A locked canvas context may\r
115      * not be rendered. Unlocking a canvas context automatically marks the\r
116      * canvas context dirty. It will be repainted if attached to an\r
117      * {@link ICanvasChassis}. Invocations that don't change locked state do\r
118      * nothing.\r
119      * \r
120      * @param locked <code>true</code> to lock, <code>false</code> to unlock\r
121      */\r
122     void setLocked(boolean locked);\r
123 \r
124     /**\r
125      * Tells whether the canvas context is locked. A locked canvas context is\r
126      * not allowed to be rendered by an {@link ICanvasChassis}. This is\r
127      * necessary for performing safe and glitch-free batch initialization on the\r
128      * canvas context.\r
129      * \r
130      * @return <code>true</code> if locked\r
131      */\r
132     boolean isLocked();\r
133     \r
134     /**\r
135      * Get Tooltip provider\r
136      * @return tooltip provider\r
137      */\r
138     ITooltipProvider getTooltipProvider();\r
139     \r
140     void setTooltipProvider( ITooltipProvider tooltipProvider );\r
141 \r
142 }\r