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.viewfactorysupport;
043:
044: import org.netbeans.modules.uml.core.metamodel.core.foundation.IPresentationElement;
045: import org.netbeans.modules.uml.core.support.umlsupport.IETRect;
046: import org.netbeans.modules.uml.ui.products.ad.application.IMenuManager;
047: import org.netbeans.modules.uml.ui.support.contextmenusupport.IProductContextMenu;
048: import org.netbeans.modules.uml.ui.support.contextmenusupport.IProductContextMenuItem;
049:
050: public interface ILabelManager extends IGraphObjectManager {
051: /**
052: * Creates the initial labels on a newly created node or edge
053: */
054: public void createInitialLabels();
055:
056: /**
057: * Reset the label text.
058: */
059: public void resetLabelsText();
060:
061: /**
062: * Called when the model element associated with the label/engine has changed.
063: */
064: public void modelElementHasChanged(INotificationTargets pTargets);
065:
066: /**
067: * Reset the labels. Creates the defaults and positions them accordingly.
068: */
069: public void resetLabels();
070:
071: /**
072: * Relayout the labels on this link/node.
073: */
074: public void relayoutLabels();
075:
076: /**
077: * Removes all labels.
078: */
079: public void discardAllLabels();
080:
081: /**
082: * Notifies the node that a context menu is about to be displayed
083: */
084: public void onContextMenu(IProductContextMenu pContextMenu,
085: int logicalX, int logicalY);
086:
087: public void onContextMenu(IMenuManager manager);
088:
089: /**
090: * Notifies the node that a context menu has been selected
091: */
092: public void onContextMenuHandleSelection(
093: IProductContextMenu pContextMenu,
094: IProductContextMenuItem pMenuItem);
095:
096: /**
097: * Set the menu button sensitivity
098: */
099: public void setSensitivityAndCheck(
100: IProductContextMenu pContextMenu,
101: IProductContextMenuItem pMenuItem, int buttonKind);
102:
103: /**
104: * Handles the changing of the model element when a label is edited.
105: */
106: public void handleEditChange(IETLabel pLabel, String sNewString);
107:
108: /**
109: * Notification to the label manager that edit took place, but nothing changed. Used in multiplicity editing.
110: */
111: public void handleEditNoChange(IETLabel pLabel, String sNewString);
112:
113: /**
114: * Deletes the label by type.
115: */
116: public void discardLabel(int nLabelKind);
117:
118: /**
119: * Deletes the ET label.
120: */
121: public void discardETLabel(IETLabel pETLabel);
122:
123: /**
124: * Does this label manager know how to display this label?
125: */
126: public boolean isValidLabelKind(int nLabelKind);
127:
128: /**
129: * Are we currently displaying this label?
130: */
131: public boolean isDisplayed(int nLabelKind);
132:
133: /**
134: * Show or hide this label
135: */
136: public void showLabel(int nLabelKind, boolean bShow);
137:
138: /**
139: * Retrieve a label by its index
140: */
141: public IETLabel getLabelByIndex(int lIndex);
142:
143: /**
144: * Get the IPresentationElement for this label
145: */
146: public IPresentationElement getLabel(int nLabelKind);
147:
148: /**
149: * Edits this label
150: */
151: public void editLabel(int nLabelKind);
152:
153: /**
154: * The rectangle encompassing all the labels, in logical coordinates
155: */
156: public IETRect getLogicalBoundingRectForAllLabels();
157:
158: /**
159: * Sets the forced stereotype string used to show a stereotype label when no actual stereotype is involved
160: */
161: public void setForcedStereotypeString(String sForcedString);
162:
163: /**
164: * Gets the stereotype text.
165: */
166: public String getStereotypeText();
167:
168: }
|