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 *******************************************************************************/
14 * @author Toni Kalajainen
16 package org.simantics.g2d.chassis;
18 import org.simantics.g2d.canvas.ICanvasContext;
19 import org.simantics.utils.datastructures.hints.IHintContext;
20 import org.simantics.utils.threads.IThreadWorkQueue;
24 * Canvas chassis is a user operable base for canvas contexts
26 * @See {@link AWTChassis}
27 * @See {@link SWTChassis}
28 * @See {@link FullscreenChassis} Full screen chassis
29 * @See {@link ImageChassis} Renders to a bitmap
31 public interface ICanvasChassis {
34 * Get the hint context of the chassis
37 IHintContext getHintContext();
40 * Set canvas context into the chassis
42 void setCanvasContext(ICanvasContext canvasContext);
46 * @return <code>null</code> if the chassis has no canvas context at the moment
48 ICanvasContext getCanvasContext();
51 * Add chassis listener
55 void addChassisListener(IThreadWorkQueue threadAccess, IChassisListener listener);
62 void removeChassisListener(IThreadWorkQueue threadAccess, IChassisListener listener);
68 void addChassisListener(IChassisListener listener);
74 void removeChassisListener(IChassisListener listener);