X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fsymbolcontribution%2FGroupProxySymbolItem.java;h=1d04653b5720fd0ab8bcead8c522ec3b14961680;hb=7e2af4ac725e0f663f0598f8c85a0896618bd237;hp=5b30fb665a24b548e35cd3c64fde5ba9c9f53df0;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/symbolcontribution/GroupProxySymbolItem.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/symbolcontribution/GroupProxySymbolItem.java index 5b30fb665..1d04653b5 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/symbolcontribution/GroupProxySymbolItem.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/symbolcontribution/GroupProxySymbolItem.java @@ -1,75 +1,79 @@ -/******************************************************************************* - * 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.diagram.symbolcontribution; - -import org.simantics.diagram.symbollibrary.ISymbolGroup; -import org.simantics.diagram.symbollibrary.ISymbolItem; -import org.simantics.g2d.element.ElementClass; -import org.simantics.utils.datastructures.cache.ProvisionException; -import org.simantics.utils.datastructures.hints.IHintObservable; - -/** - * An ISymbolItem proxy version that allows changing the ISymbolGroup returned - * by {@link #getGroup()}. - * - * @author Tuukka Lehtonen - */ -public class GroupProxySymbolItem implements ISymbolItem { - - private final ISymbolItem proxy; - private final ISymbolGroup group; - - public GroupProxySymbolItem(ISymbolItem item, ISymbolGroup group) { - if (item == null) - throw new NullPointerException("null item"); - if (group == null) - throw new NullPointerException("null group"); - this.proxy = item; - this.group = group; - } - - @Override - public String getName() { - return proxy.getName(); - } - - @Override - public String getDescription() { - return proxy.getDescription(); - } - - @Override - public Object getAdapter(Class adapter) { - return proxy.getAdapter(adapter); - } - - @Override - public ElementClass getElementClass(IHintObservable hints) throws ProvisionException { - return proxy.getElementClass(hints); - } - - @Override - public ISymbolGroup getGroup() { - return group; - } - - @Override - public int hashCode() { - return proxy.hashCode(); - } - - @Override - public boolean equals(Object obj) { - return proxy.equals(obj); - } - +/******************************************************************************* + * 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.diagram.symbolcontribution; + +import org.simantics.diagram.symbollibrary.ISymbolGroup; +import org.simantics.diagram.symbollibrary.ISymbolItem; +import org.simantics.g2d.element.ElementClass; +import org.simantics.utils.datastructures.cache.ProvisionException; +import org.simantics.utils.datastructures.hints.IHintObservable; + +/** + * An ISymbolItem proxy version that allows changing the ISymbolGroup returned + * by {@link #getGroup()}. + * + * @author Tuukka Lehtonen + */ +public class GroupProxySymbolItem implements ISymbolItem { + + private final ISymbolItem proxy; + private final ISymbolGroup group; + + public GroupProxySymbolItem(ISymbolItem item, ISymbolGroup group) { + if (item == null) + throw new NullPointerException("null item"); + if (group == null) + throw new NullPointerException("null group"); + this.proxy = item; + this.group = group; + } + + public ISymbolItem getSubject() { + return proxy; + } + + @Override + public String getName() { + return proxy.getName(); + } + + @Override + public String getDescription() { + return proxy.getDescription(); + } + + @Override + public Object getAdapter(Class adapter) { + return proxy.getAdapter(adapter); + } + + @Override + public ElementClass getElementClass(IHintObservable hints) throws ProvisionException { + return proxy.getElementClass(hints); + } + + @Override + public ISymbolGroup getGroup() { + return group; + } + + @Override + public int hashCode() { + return proxy.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return proxy.equals(obj); + } + } \ No newline at end of file