2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
5 package org.ufcspa.simdecs.diagram.elements;
7 import java.io.Serializable;
9 import java.util.Locale;
10 import org.ufcspa.simdecs.diagram.util.MessageResourceUtils;
16 public abstract class Element implements Serializable {
19 protected String messageBundle;
20 protected Locale locale;
23 public boolean equals(Object obj) {
27 if (getClass() != obj.getClass()) {
30 final Element other = (Element) obj;
31 if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
38 public int hashCode() {
40 hash = 29 * hash + (this.id != null ? this.id.hashCode() : 0);
44 public Element(String messageBundle, Locale locale) {
45 this.id = this.getClass().getSimpleName() + "-" + String.valueOf((new Date()).getTime());
47 this.messageBundle = messageBundle;
50 public String getMessageBundle() {
54 public void setMessageBundle(String messageBundle) {
55 this.messageBundle = messageBundle;
58 public Locale getLocale() {
62 public void setLocale(Locale locale) {
66 protected String getResourceMessage(String key, Object params[]) {
67 return MessageResourceUtils.getMessageResourceString(messageBundle, key, params, locale);
70 protected String getResourceMessage(String key) {
71 return getResourceMessage(key, null);
74 public String getId() {
78 public void setId(String id) {