001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.sql.framework.ui.graph;
043:
044: import java.util.List;
045:
046: /**
047: * @author radval
048: */
049: public interface IGraphNode extends IDataNode {
050: /**
051: * get field name given a port
052: *
053: * @param graphPort graph port
054: * @return field name
055: */
056: String getFieldName(IGraphPort graphPort);
057:
058: /**
059: * get output graph port , given a field name
060: *
061: * @param fieldName field name
062: * @return graph port
063: */
064: IGraphPort getOutputGraphPort(String fieldName);
065:
066: /**
067: * get input graph port , given a field name
068: *
069: * @param fieldName field name
070: * @return graph port
071: */
072: IGraphPort getInputGraphPort(String fieldName);
073:
074: /**
075: * get a list of all input and output links
076: *
077: * @return list of input links
078: */
079: List getAllLinks();
080:
081: /**
082: * Expand this graph node
083: *
084: * @param expand whether to expand or collapse this node
085: */
086: public void expand(boolean expand);
087:
088: /**
089: * get the child graphNode
090: *
091: * @param obj child data object
092: * @return graph node
093: */
094: public IGraphNode getChildNode(Object obj);
095:
096: /**
097: * Remove a child object
098: *
099: * @param child child object
100: */
101: public void removeChildNode(IGraphNode childNode) throws Exception;
102:
103: /**
104: * Get the parent node
105: *
106: * @return parent
107: */
108: public IGraphNode getParentGraphNode();
109:
110: /**
111: * set the expansion state of the graph node
112: *
113: * @param expand expansion state
114: */
115: public void setExpandedState(boolean expand);
116:
117: /**
118: * get the expanded state
119: *
120: * @return expanded state
121: */
122: public boolean isExpandedState();
123:
124: /**
125: * set the graph view whixh hold this node
126: *
127: * @param view graph view
128: */
129: public void setGraphView(IGraphView view);
130:
131: /**
132: * get the graphview which holds this view
133: *
134: * @return graph view
135: */
136: public IGraphView getGraphView();
137:
138: /**
139: * update this node with changes in data object
140: */
141: public void updateUI();
142:
143: /**
144: * remove the child data object
145: *
146: * @param obj child data object
147: */
148: public void removeChildObject(Object obj);
149:
150: /**
151: * add child data object
152: *
153: * @param obj child data object
154: */
155: public void addChildObject(Object obj);
156:
157: /**
158: * set the actions on a node
159: *
160: * @param actions
161: */
162: public void initializeActions(List actions);
163:
164: /**
165: * is this node can be deleted
166: *
167: * @return true if node can be deleted
168: */
169: public boolean isDeleteAllowed();
170:
171: }
|