X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Felementclass%2Fcanvas%2FCanvasClass.java;fp=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Felementclass%2Fcanvas%2FCanvasClass.java;h=f0d713d76f2bdea49c7157678918d7d1ce649808;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/elementclass/canvas/CanvasClass.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/elementclass/canvas/CanvasClass.java new file mode 100644 index 000000000..f0d713d76 --- /dev/null +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/elementclass/canvas/CanvasClass.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * 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 + *******************************************************************************/ +package org.simantics.g2d.elementclass.canvas; + +import org.simantics.g2d.canvas.ICanvasContext; +import org.simantics.g2d.diagram.DiagramHints; +import org.simantics.g2d.element.ElementClass; +import org.simantics.g2d.element.handler.impl.BorderColorImpl; +import org.simantics.g2d.element.handler.impl.DefaultTransform; +import org.simantics.g2d.element.handler.impl.FillColorImpl; +import org.simantics.g2d.element.handler.impl.Resizeable; +import org.simantics.utils.datastructures.hints.IHintContext.Key; +import org.simantics.utils.datastructures.hints.IHintContext.KeyOf; + +/** + * @author Toni Kalajainen + */ +public class CanvasClass { + + public static final Key KEY_CANVAS = new KeyOf(ICanvasContext.class); + + /** + * Class that paints canvas as an element + * Keys: + * {@link CanvasPainter}.KEY_CANVAS + */ + public static final ElementClass CANVAS_CLASS = + ElementClass.compile( + Resizeable.UNCONSTRICTED, + DefaultTransform.INSTANCE, + CanvasPainter.INSTANCE + ); + + /** + * Class that previews another diagram + * Keys: + * {@link DiagramHints}.KEY_DIAGRAM + * {@link DiagramPainter}.KEY_VIEWPORT + */ + public static final ElementClass DIAGRAM_CLASS = + ElementClass.compile( + Resizeable.UNCONSTRICTED, + DefaultTransform.INSTANCE, + DiagramPainter.INSTANCE + ); + + /** + * Class that previews an element of another diagram. + * Keys: + * {@link ElementViewport}.KEY_ELEMENT + */ + public static final ElementClass ELEMENT_VIEWPORT_CLASS = + ElementClass.compile( + FillColorImpl.UNSET, + BorderColorImpl.UNSET, + Resizeable.UNCONSTRICTED, + DefaultTransform.INSTANCE, + ElementViewport.INSTANCE, + DiagramPainter.INSTANCE + ); + +}