001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: package org.netbeans.modules.soa.mapper.common;
021:
022: import java.beans.PropertyChangeListener;
023: import java.util.List;
024:
025: /**
026: * <p>
027: *
028: * Title: IMapperViewModel </p> <p>
029: *
030: * Description: A view model manages nodes. MapperModel is able to switch to
031: * display difference view model on run time. All the nodes are contained by
032: * this model should be all the nodes of a mapper in a layer. The current design
033: * will provide one view model for mutiple views. </p> <p>
034: *
035: * Copyright: Copyright (c) 2002 </p> <p>
036: *
037: * Company: </p>
038: *
039: * @author Un Seng Leong
040: * @created December 4, 2002
041: * @version 1.0
042: */
043: public interface IMapperViewModel {
044: /**
045: * The property name of a new link added to this model.
046: */
047: public static final String NODE_ADDED = "MapperVM.AddNode";
048:
049: /**
050: * The property name of a link remove from this model.
051: */
052: public static final String NODE_REMOVED = "MapperVM.RemoveNode";
053:
054: /**
055: * Add a Node to this view.
056: *
057: * @param node The feature to be added to the Node attribute
058: */
059: public void addNode(IMapperNode node);
060:
061: /**
062: * Remove a node from this view.
063: *
064: * @param node the node to be removed
065: */
066: public void removeNode(IMapperNode node);
067:
068: /**
069: * Return all the nodes of this view. The element in the List should be
070: * IMapperNode.
071: *
072: * @return all the nodes of this view.
073: */
074: public List getNodes();
075:
076: /**
077: * Return the number of nodes of this view.
078: *
079: * @return the number of nodes in this view.
080: */
081: public int getNodeCount();
082:
083: /**
084: * Return true if the specified node is in this model, false otherwise.
085: *
086: * @param node the specified node to check
087: * @return true if the node is in this model, false otherwise.
088: */
089: public boolean containsNode(IMapperNode node);
090:
091: /**
092: * Adds a PropertyChangeListener to the listener list. The specified
093: * property may be user-defined, and the following:
094: * <ul>
095: * <li> a new link added to this model (<code>LINK_ADDED</code>) </li>
096: *
097: * <li> a link removed from this model (<code>LINK_REMOVED</code>) </li>
098: *
099: * </ul>
100: *
101: *
102: * @param listener the PropertyChangeListener to be added
103: */
104: public void addPropertyChangeListener(
105: PropertyChangeListener listener);
106:
107: /**
108: * Removes a PropertyChangeListener from the listener list.
109: *
110: * @param listener the PropertyChangeListener to be added
111: */
112: public void removePropertyChangeListener(
113: PropertyChangeListener listener);
114: }
|