]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.g2d/src/org/simantics/g2d/canvas/ICanvasContext.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / canvas / ICanvasContext.java
index 8b1d33a51f5359cca9412b3be79c09175cb8c063..9e22f6a60f64125ebb6c81ad0d0a9348e9fcec2d 100644 (file)
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-/*\r
- *\r
- * @author Toni Kalajainen\r
- */\r
-package org.simantics.g2d.canvas;\r
-\r
-import org.simantics.g2d.chassis.ICanvasChassis;\r
-import org.simantics.g2d.chassis.ITooltipProvider;\r
-import org.simantics.scenegraph.g2d.G2DParentNode;\r
-import org.simantics.scenegraph.g2d.G2DSceneGraph;\r
-import org.simantics.scenegraph.g2d.events.IEventHandlerStack;\r
-import org.simantics.scenegraph.g2d.events.IEventQueue;\r
-import org.simantics.utils.datastructures.context.IContext;\r
-import org.simantics.utils.datastructures.disposable.IDisposable;\r
-import org.simantics.utils.datastructures.hints.IHintContext;\r
-import org.simantics.utils.datastructures.hints.IHintStack;\r
-import org.simantics.utils.threads.IThreadWorkQueue;\r
-\r
-\r
-/**\r
- * Canvas context.\r
- *\r
- * TODO Add Mouse(Id) Discovery and enumeration\r
- */\r
-public interface ICanvasContext extends\r
-IContext<ICanvasParticipant>,\r
-IDisposable\r
-{\r
-\r
-    /**\r
-     * Get content monitor context.\r
-     * @return\r
-     */\r
-    IContentContext getContentContext();\r
-    void setContentContext(IContentContext ctx);\r
-\r
-    /**\r
-     * Get Event queue\r
-     * @return event queue\r
-     */\r
-    IEventQueue getEventQueue();\r
-\r
-\r
-    /**\r
-     * Get event handler stack. Higher priority event handlers get events first.\r
-     *\r
-     * @return the stack\r
-     */\r
-    IEventHandlerStack getEventHandlerStack();\r
-\r
-    /**\r
-     * Get the hint stack of this interactor context.\r
-     * Any interactor that adds a layer into the stack should also remove it\r
-     * if the context is changed.\r
-     *\r
-     * @return the hint stack\r
-     */\r
-    IHintStack getHintStack();\r
-\r
-    /**\r
-     * Get the hint context of lowest priority in the stack.\r
-     *\r
-     * @return hint context.\r
-     */\r
-    IHintContext getDefaultHintContext();\r
-\r
-    /**\r
-     * Get the thread that is used for handling events and painting.\r
-     * External modifications to the three stacks (painter, event handler,\r
-     * and hint stack) and to the participant context must be made\r
-     * in this thread.\r
-     *\r
-     * All participant events / painting is executed from this thread.\r
-     *\r
-     * @return access to thread\r
-     */\r
-    IThreadWorkQueue getThreadAccess();\r
-\r
-    /**\r
-     * Set mouse cursor context. Initially there is a default context.\r
-     * @param mctx\r
-     */\r
-    void setMouseCursorContext(IMouseCursorContext mctx);\r
-    IMouseCursorContext getMouseCursorContext();\r
-\r
-\r
-    /**\r
-     * Set mouse capture context. Initially there is a default context.\r
-     * @param mctx\r
-     */\r
-    void setMouseCaptureContext(IMouseCaptureContext mctx);\r
-    IMouseCaptureContext getMouseCaptureContext();\r
-\r
-    /**\r
-     * @return the scene graph root node associated with this canvas context\r
-     */\r
-    G2DSceneGraph getSceneGraph();\r
-\r
-    G2DParentNode getCanvasNode();\r
-    void setCanvasNode(G2DParentNode node);\r
-\r
-    /**\r
-     * Set the locked state of the canvas context. A locked canvas context may\r
-     * not be rendered. Unlocking a canvas context automatically marks the\r
-     * canvas context dirty. It will be repainted if attached to an\r
-     * {@link ICanvasChassis}. Invocations that don't change locked state do\r
-     * nothing.\r
-     * \r
-     * @param locked <code>true</code> to lock, <code>false</code> to unlock\r
-     */\r
-    void setLocked(boolean locked);\r
-\r
-    /**\r
-     * Tells whether the canvas context is locked. A locked canvas context is\r
-     * not allowed to be rendered by an {@link ICanvasChassis}. This is\r
-     * necessary for performing safe and glitch-free batch initialization on the\r
-     * canvas context.\r
-     * \r
-     * @return <code>true</code> if locked\r
-     */\r
-    boolean isLocked();\r
-    \r
-    /**\r
-     * Get Tooltip provider\r
-     * @return tooltip provider\r
-     */\r
-    ITooltipProvider getTooltipProvider();\r
-    \r
-    void setTooltipProvider( ITooltipProvider tooltipProvider );\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+/*
+ *
+ * @author Toni Kalajainen
+ */
+package org.simantics.g2d.canvas;
+
+import org.simantics.g2d.chassis.ICanvasChassis;
+import org.simantics.g2d.chassis.ITooltipProvider;
+import org.simantics.scenegraph.g2d.G2DParentNode;
+import org.simantics.scenegraph.g2d.G2DSceneGraph;
+import org.simantics.scenegraph.g2d.events.IEventHandlerStack;
+import org.simantics.scenegraph.g2d.events.IEventQueue;
+import org.simantics.utils.datastructures.context.IContext;
+import org.simantics.utils.datastructures.disposable.IDisposable;
+import org.simantics.utils.datastructures.hints.IHintContext;
+import org.simantics.utils.datastructures.hints.IHintStack;
+import org.simantics.utils.threads.IThreadWorkQueue;
+
+
+/**
+ * Canvas context.
+ *
+ * TODO Add Mouse(Id) Discovery and enumeration
+ */
+public interface ICanvasContext extends
+IContext<ICanvasParticipant>,
+IDisposable
+{
+
+    /**
+     * Get content monitor context.
+     * @return
+     */
+    IContentContext getContentContext();
+    void setContentContext(IContentContext ctx);
+
+    /**
+     * Get Event queue
+     * @return event queue
+     */
+    IEventQueue getEventQueue();
+
+
+    /**
+     * Get event handler stack. Higher priority event handlers get events first.
+     *
+     * @return the stack
+     */
+    IEventHandlerStack getEventHandlerStack();
+
+    /**
+     * Get the hint stack of this interactor context.
+     * Any interactor that adds a layer into the stack should also remove it
+     * if the context is changed.
+     *
+     * @return the hint stack
+     */
+    IHintStack getHintStack();
+
+    /**
+     * Get the hint context of lowest priority in the stack.
+     *
+     * @return hint context.
+     */
+    IHintContext getDefaultHintContext();
+
+    /**
+     * Get the thread that is used for handling events and painting.
+     * External modifications to the three stacks (painter, event handler,
+     * and hint stack) and to the participant context must be made
+     * in this thread.
+     *
+     * All participant events / painting is executed from this thread.
+     *
+     * @return access to thread
+     */
+    IThreadWorkQueue getThreadAccess();
+
+    /**
+     * Set mouse cursor context. Initially there is a default context.
+     * @param mctx
+     */
+    void setMouseCursorContext(IMouseCursorContext mctx);
+    IMouseCursorContext getMouseCursorContext();
+
+
+    /**
+     * Set mouse capture context. Initially there is a default context.
+     * @param mctx
+     */
+    void setMouseCaptureContext(IMouseCaptureContext mctx);
+    IMouseCaptureContext getMouseCaptureContext();
+
+    /**
+     * @return the scene graph root node associated with this canvas context
+     */
+    G2DSceneGraph getSceneGraph();
+
+    G2DParentNode getCanvasNode();
+    void setCanvasNode(G2DParentNode node);
+
+    /**
+     * Set the locked state of the canvas context. A locked canvas context may
+     * not be rendered. Unlocking a canvas context automatically marks the
+     * canvas context dirty. It will be repainted if attached to an
+     * {@link ICanvasChassis}. Invocations that don't change locked state do
+     * nothing.
+     * 
+     * @param locked <code>true</code> to lock, <code>false</code> to unlock
+     */
+    void setLocked(boolean locked);
+
+    /**
+     * Tells whether the canvas context is locked. A locked canvas context is
+     * not allowed to be rendered by an {@link ICanvasChassis}. This is
+     * necessary for performing safe and glitch-free batch initialization on the
+     * canvas context.
+     * 
+     * @return <code>true</code> if locked
+     */
+    boolean isLocked();
+    
+    /**
+     * Get Tooltip provider
+     * @return tooltip provider
+     */
+    ITooltipProvider getTooltipProvider();
+    
+    void setTooltipProvider( ITooltipProvider tooltipProvider );
+
+}