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.exception.InvalidModelException;
29  import org.wsmo.service.Capability;
30  
31  public class CapabilityModel extends TopEntityModel {
32  
33      public CapabilityModel(Capability cap) {
34          super(cap);
35      }
36      
37      public Capability getCapability() {
38          return (Capability)getAdapter(Capability.class);
39      }
40      
41      public void addAssumption(Axiom ax) 
42              throws InvalidModelException {
43          getCapability().addAssumption(ax);
44          setChanged();
45      }
46      public void addEffect(Axiom ax) 
47              throws InvalidModelException {
48          getCapability().addEffect(ax);
49          setChanged();
50      }
51      public void addPostCondition(Axiom ax) 
52              throws InvalidModelException {
53          getCapability().addPostCondition(ax);
54          setChanged();
55      }
56      public void addPreCondition(Axiom ax) 
57              throws InvalidModelException {
58          getCapability().addPreCondition(ax);
59          setChanged();
60      }
61      public void addSharedVariable(Variable var) 
62              throws InvalidModelException {
63          getCapability().addSharedVariable(var);
64          setChanged();
65      }
66      
67      public void removeAssumption(Axiom ax) 
68              throws InvalidModelException {
69          getCapability().removeAssumption(ax);
70          setChanged();
71      }
72      public void removeEffect(Axiom ax) 
73              throws InvalidModelException {
74          getCapability().removeEffect(ax);
75          setChanged();
76      }
77      public void removePostCondition(Axiom ax) 
78              throws InvalidModelException {
79          getCapability().removePostCondition(ax);
80          setChanged();
81      }
82      public void removePreCondition(Axiom ax) 
83              throws InvalidModelException {
84          getCapability().removePreCondition(ax);
85          setChanged();
86      }
87      public void removeSharedVariable(Variable var) 
88              throws InvalidModelException {
89          getCapability().removeSharedVariable(var);
90          setChanged();
91      }
92      
93  }
94  
95  /*
96   * $Log: CapabilityModel.java,v $
97   * Revision 1.3  2006/01/09 12:51:14  alex_simov
98   * Copyright message in header updated
99   *
100  * Revision 1.2  2005/11/09 16:16:08  alex_simov
101  * UIModels notification improved
102  *
103  * Revision 1.1  2005/11/04 15:54:00  alex_simov
104  * wsmo4j entity UI models created
105  *
106  *
107  */