1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g2d.element.handler.impl;
\r
14 import org.simantics.g2d.element.handler.StaticSymbol;
\r
15 import org.simantics.g2d.image.Image;
\r
18 * A {@link StaticSymbol} implementation that provides a single static image
\r
19 * provided to it during construction.
\r
21 public class StaticSymbolImpl implements StaticSymbol {
\r
23 private static final long serialVersionUID = 9062542343545213793L;
\r
25 private final Image i;
\r
27 public StaticSymbolImpl(Image i) {
\r
29 throw new IllegalArgumentException("null arg");
\r
34 public Image getImage() {
\r
39 public int hashCode() {
\r
40 return i.hashCode();
\r
44 public boolean equals(Object obj) {
\r
49 if (getClass() != obj.getClass())
\r
51 StaticSymbolImpl other = (StaticSymbolImpl) obj;
\r
52 return i.equals(other.i);
\r