X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fsymbolcontribution%2FSymbolGroup.java;h=652ae5ace5f87178c749c0118f723b07ceae061d;hb=a96e5125d72579c43abd70eb5c23de835324eaad;hp=74b3904872874666c57cd66e3f8f9dca4ec5f4ca;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/symbolcontribution/SymbolGroup.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/symbolcontribution/SymbolGroup.java index 74b390487..652ae5ace 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/symbolcontribution/SymbolGroup.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/symbolcontribution/SymbolGroup.java @@ -1,96 +1,96 @@ -/******************************************************************************* - * 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 java.util.Arrays; - -import org.simantics.diagram.symbollibrary.ISymbolGroup; -import org.simantics.diagram.symbollibrary.ISymbolItem; - -/** - * @author Tuukka Lehtonen - */ -public class SymbolGroup extends NamedObject implements ISymbolGroup { - - public static final ISymbolItem[] NO_ITEMS = {}; - - ISymbolItem[] items = NO_ITEMS; - - private final String description; - - public SymbolGroup(Object identification, String name) { - this(identification, name, name); - } - - public SymbolGroup(Object identification, String name, ISymbolItem[] items) { - this(identification, name, name, items); - } - - public SymbolGroup(Object identification, String name, String description) { - super(identification, name); - this.description = description; - } - - public SymbolGroup(Object identification, String name, String description, ISymbolItem[] items) { - super(identification, name); - this.description = description; - this.items = items; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public ISymbolItem[] getItems() { - return items; - } - - public void setItems(ISymbolItem[] items) { - this.items = items; - } - - @Override - public String toString() { - return super.toString() + "[item count=" + items.length + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((description == null) ? 0 : description.hashCode()); - result = prime * result + Arrays.hashCode(items); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (!super.equals(obj)) - return false; - if (getClass() != obj.getClass()) - return false; - SymbolGroup other = (SymbolGroup) obj; - if (description == null) { - if (other.description != null) - return false; - } else if (!description.equals(other.description)) - return false; - if (!Arrays.equals(items, other.items)) - return false; - return true; - } - +/******************************************************************************* + * 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 java.util.Arrays; + +import org.simantics.diagram.symbollibrary.ISymbolGroup; +import org.simantics.diagram.symbollibrary.ISymbolItem; + +/** + * @author Tuukka Lehtonen + */ +public class SymbolGroup extends NamedObject implements ISymbolGroup { + + public static final ISymbolItem[] NO_ITEMS = {}; + + ISymbolItem[] items = NO_ITEMS; + + private final String description; + + public SymbolGroup(Object identification, String name) { + this(identification, name, name); + } + + public SymbolGroup(Object identification, String name, ISymbolItem[] items) { + this(identification, name, name, items); + } + + public SymbolGroup(Object identification, String name, String description) { + super(identification, name); + this.description = description; + } + + public SymbolGroup(Object identification, String name, String description, ISymbolItem[] items) { + super(identification, name); + this.description = description; + this.items = items; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public ISymbolItem[] getItems() { + return items; + } + + public void setItems(ISymbolItem[] items) { + this.items = items; + } + + @Override + public String toString() { + return super.toString() + "[item count=" + items.length + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((description == null) ? 0 : description.hashCode()); + result = prime * result + Arrays.hashCode(items); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + SymbolGroup other = (SymbolGroup) obj; + if (description == null) { + if (other.description != null) + return false; + } else if (!description.equals(other.description)) + return false; + if (!Arrays.equals(items, other.items)) + return false; + return true; + } + } \ No newline at end of file