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 *******************************************************************************/
12 package org.simantics.g2d.element.handler.impl.proxy;
14 import java.awt.Stroke;
16 import org.simantics.g2d.element.IElement;
17 import org.simantics.g2d.element.handler.EdgeVisuals;
20 * @author Toni Kalajainen
22 public class ProxyEdgeVisuals implements EdgeVisuals {
24 private static final long serialVersionUID = -2890966887731302696L;
26 IProxyProvider provider;
28 public ProxyEdgeVisuals(IProxyProvider provider, EdgeVisuals orig) {
29 this.provider = provider;
34 public double getArrowSize(IElement e, EdgeEnd end) {
35 return orig.getArrowSize(provider.provide(e), end);
39 public ArrowType getArrowType(IElement e, EdgeEnd end) {
40 return orig.getArrowType(provider.provide(e), end);
44 public StrokeType getStrokeType(IElement e) {
45 return orig.getStrokeType(provider.provide(e));
49 public Stroke getStroke(IElement e) {
50 return orig.getStroke(provider.provide(e));
54 public void setArrowSize(IElement e, EdgeEnd end, double size) {
55 orig.setArrowSize(provider.provide(e), end, size);
59 public void setStrokeType(IElement e, StrokeType strokeType) {
60 orig.setStrokeType(provider.provide(e), strokeType);
64 public void setArrowType(IElement e, EdgeEnd end, ArrowType arrowType) {
65 orig.setArrowType(provider.provide(e), end, arrowType);
69 public void setStroke(IElement e, Stroke s) {
70 orig.setStroke(provider.provide(e), s);