View Javadoc
1   /*
2    WSMO Studio - a Semantic Web Service Editor
3    Copyright (c) 2004-2006, OntoText Lab. / SIRMA Group
4    
5    This library is free software; you can redistribute it and/or modify it under
6    the terms of the GNU Lesser General Public License as published by the Free
7    Software Foundation; either version 2.1 of the License, or (at your option)
8    any later version.
9    This library is distributed in the hope that it will be useful, but WITHOUT
10   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   details.
13   You should have received a copy of the GNU Lesser General Public License along
14   with this library; if not, write to the Free Software Foundation, Inc.,
15   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16   */
17  
18  /***
19   * <p>Title: WSMO Studio</p>
20   * <p>Description: Semantic Web Service Editor</p>
21   * <p>Copyright:  Copyright (c) 2004-2006</p>
22   * <p>Company: OntoText Lab. / SIRMA </p>
23   */
24  
25  package org.wsmostudio.ui.editors.model;
26  
27  import org.omwg.ontology.*;
28  import org.wsmo.common.*;
29  import org.wsmo.common.exception.InvalidModelException;
30  
31  public class ConceptModel extends EntityModel {
32  
33      public ConceptModel(Concept delegate) {
34          super(delegate);
35      }
36      
37      public Concept getConcept() {
38          return (Concept)getAdapter(Concept.class);
39      }
40      
41      public void addInstance(Instance inst) 
42              throws InvalidModelException {
43          getConcept().addInstance(inst);
44          setChanged();
45      }
46  
47      public void addSuperConcept(Concept superConcept) 
48              throws InvalidModelException {
49          getConcept().addSuperConcept(superConcept);
50          setChanged();
51      }
52      
53      public Attribute createAttribute(IRI attrIRI) throws InvalidModelException {
54          Attribute newAttr = getConcept().createAttribute(attrIRI);
55          setChanged();
56          return newAttr;
57      }
58      
59      public void removeAttribute(Attribute attr)
60              throws InvalidModelException {
61          getConcept().removeAttribute(attr);
62          setChanged();
63      }
64  
65      public void removeInstance(Instance inst)
66              throws InvalidModelException {
67          getConcept().removeInstance(inst);
68          setChanged();
69      }
70      public void removeSuperConcept(Concept superConcept)
71              throws InvalidModelException {
72          getConcept().removeSuperConcept(superConcept);
73          setChanged();
74      }
75      
76  }
77  
78  /*
79   * $Log: ConceptModel.java,v $
80   * Revision 1.4  2006/02/20 12:47:51  alex_simov
81   * wsmo4j api change: attributes handled by IRI instead of object refs
82   *
83   * Revision 1.3  2006/01/09 12:51:14  alex_simov
84   * Copyright message in header updated
85   *
86   * Revision 1.2  2005/11/09 16:16:08  alex_simov
87   * UIModels notification improved
88   *
89   * Revision 1.1  2005/11/04 15:54:00  alex_simov
90   * wsmo4j entity UI models created
91   *
92   *
93   */