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.uml.ui.support.applicationmanager;
043:
044: import org.netbeans.modules.uml.core.metamodel.core.foundation.IElement;
045: import org.netbeans.modules.uml.core.metamodel.core.foundation.IPresentationElement;
046: import org.netbeans.modules.uml.core.support.umlsupport.IETPoint;
047: import org.netbeans.modules.uml.core.support.umlsupport.IETRect;
048: import org.netbeans.modules.uml.core.support.umlutils.ETList;
049: import com.tomsawyer.editor.ui.TSENodeUI;
050: import com.tomsawyer.editor.TSENode;
051: import org.netbeans.modules.uml.ui.support.viewfactorysupport.IETGraphObject;
052:
053: public interface INodePresentation extends IProductGraphPresentation {
054: /*
055: * Get the TS node view this presentation element represents.
056: */
057: public TSENodeUI getNodeView();
058:
059: /*
060: * Get the TS node this presentation element represents.
061: */
062: public TSENode getTSNode();
063:
064: /*
065: * Get/Set the TS node this presentation element represents.
066: */
067: public void setTSNode(TSENode newVal);
068:
069: /**
070: * Moves this node to the logical x and y points. If neither the X or Y
071: * coordiate is specified for the move (via the flags parameter) then both
072: * are moved.
073: *
074: * @param flags An OR value from the MoveToFlags interface.
075: * <code>example (ie MTF_MOVEX | MTF_MOVEY | MTF_LOGICALCOORD) <code>
076: * <br>
077: * If niether <code>MTF_LOGICALCOORD</code> or
078: * <code>MTF_DEVICECOORD</code> is spcified the call defaults
079: * to <code>MTF_LOGICALCOORD</code>.
080: * @see MoveToFlags
081: */
082: public void moveTo(int x, int y, int flags);
083:
084: /**
085: * Moves this node using the TS command
086: *
087: * @param x [in] The new x center
088: * @param x [in] The new y center
089: */
090: public void moveTo(int x, int y);
091:
092: /*
093: * Resizes this node
094: */
095: public void resize(double cx, double cy, boolean bKeepUpperLeftPoint);
096:
097: /*
098: * Resizes the node using one of the TS handles
099: */
100: public void resizeByHandle(int dx, int dy, int handleLocation,
101: boolean sendGraphEvents);
102:
103: /*
104: * Resizes the node to fit the contents
105: */
106: public void sizeToContents();
107:
108: /**
109: * Called to notify the node that a link has been added.
110: *
111: * @param edgeToBeDeleted The link about to be deleted
112: * @param isFromNode <code>true</code> if this is the from node.
113: */
114: public void onPreDeleteLink(IEdgePresentation edgeToBeDeleted,
115: boolean isFromNode);
116:
117: /*
118: * Returns the incoming and/or the outgoing edges
119: */
120: public ETList<IETGraphObject> getEdges(boolean bIncoming,
121: boolean bOutgoing);
122:
123: /*
124: * Returns the nodes connected to this node via an edge
125: */
126: public ETList<IConnectedNode> getEdgeConnectedNodes();
127:
128: /*
129: * Returns the incoming and/or the outgoing edges with pEndNodePresentation at the other end
130: */
131: public ETList<IPresentationElement> getEdgesWithEndPoint(
132: boolean bIncoming, boolean bOutgoing,
133: INodePresentation pEndNodePresentation);
134:
135: /*
136: * Returns the incoming and/or the outgoing edges that go out of the container this node is in.
137: */
138: public ETList<IPresentationElement> getEdgesExitingContainer(
139: boolean bIncoming, boolean bOutgoing);
140:
141: /*
142: * Returns the incoming and/or the outgoing edges by type, EdgeKind nEdgeKind
143: */
144: public ETList<IETGraphObject> getEdgesByType(int nEdgeKind,
145: boolean bIncoming, boolean bOutgoing);
146:
147: /*
148: * Returns the incoming and/or the outgoing edges that have this specific draw engine
149: */
150: public ETList<IPresentationElement> getEdgesWithDrawEngine(
151: String sDrawEngineID, boolean bIncoming, boolean bOutgoing);
152:
153: /*
154: * Returns location information for this node
155: */
156: public IETRect getLocation();
157:
158: public long getHeight();
159:
160: public long getWidth();
161:
162: public IETPoint getCenter();
163:
164: /*
165: * Returns the presentation elements that are touching (or fully contained in) this nodes bounding rectangle
166: */
167: public ETList<IPresentationElement> getPEsViaBoundingRect(
168: boolean bTouchingRect);
169:
170: /*
171: * Returns the presentation elements that are touching (or fully contained in) the input rectangle
172: */
173: public ETList<IPresentationElement> getPEsViaRect(
174: boolean bTouchingRect, IETRect pRect);
175:
176: /*
177: * Returns the first presentation element that is nearby thats of this type
178: */
179: public IPresentationElement findNearbyElement(
180: boolean bSearchOutsideOfBoundingRect,
181: IElement pElementToFind, String sDrawEngineTypeToFind);
182:
183: /*
184: * Returns the node presentation that is this node presentation's graphical container
185: */
186: public INodePresentation getGraphicalContainer();
187:
188: /*
189: * Resize this node so that the input node is contained within this node
190: */
191: public void resizeToContain(INodePresentation pContained);
192:
193: /*
194: * Locks editing so double clicks dont activate the edit control.
195: */
196: public boolean getLockEdit();
197:
198: /*
199: * Locks editing so double clicks dont activate the edit control.
200: */
201: public void setLockEdit(boolean newVal);
202:
203: }
|