]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/elementclass/canvas/CanvasClass.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / elementclass / canvas / CanvasClass.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.elementclass.canvas;
13
14 import org.simantics.g2d.canvas.ICanvasContext;
15 import org.simantics.g2d.diagram.DiagramHints;
16 import org.simantics.g2d.element.ElementClass;
17 import org.simantics.g2d.element.handler.impl.BorderColorImpl;
18 import org.simantics.g2d.element.handler.impl.DefaultTransform;
19 import org.simantics.g2d.element.handler.impl.FillColorImpl;
20 import org.simantics.g2d.element.handler.impl.Resizeable;
21 import org.simantics.utils.datastructures.hints.IHintContext.Key;
22 import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;
23
24 /**
25  * @author Toni Kalajainen
26  */
27 public class CanvasClass {
28
29     public static final Key KEY_CANVAS = new KeyOf(ICanvasContext.class);
30
31     /**
32      * Class that paints canvas as an element
33      * Keys:
34      *  {@link CanvasPainter}.KEY_CANVAS
35      */
36     public static final ElementClass CANVAS_CLASS =
37         ElementClass.compile(
38                 Resizeable.UNCONSTRICTED,
39                 DefaultTransform.INSTANCE,
40                 CanvasPainter.INSTANCE
41         );
42
43     /**
44      * Class that previews another diagram
45      * Keys:
46      *  {@link DiagramHints}.KEY_DIAGRAM
47      *  {@link DiagramPainter}.KEY_VIEWPORT
48      */
49     public static final ElementClass DIAGRAM_CLASS =
50         ElementClass.compile(
51                 Resizeable.UNCONSTRICTED,
52                 DefaultTransform.INSTANCE,
53                 DiagramPainter.INSTANCE
54         );
55
56     /**
57      * Class that previews an element of another diagram.
58      * Keys:
59      *  {@link ElementViewport}.KEY_ELEMENT
60      */
61     public static final ElementClass ELEMENT_VIEWPORT_CLASS =
62         ElementClass.compile(
63                 FillColorImpl.UNSET,
64                 BorderColorImpl.UNSET,
65                 Resizeable.UNCONSTRICTED,
66                 DefaultTransform.INSTANCE,
67                 ElementViewport.INSTANCE,
68                 DiagramPainter.INSTANCE
69         );
70
71 }