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.products.ad.ADDrawEngines;
043:
044: import org.netbeans.modules.uml.core.metamodel.core.foundation.IElement;
045: import org.netbeans.modules.uml.ui.support.contextmenusupport.IProductButtonHandler;
046: import org.netbeans.modules.uml.ui.support.contextmenusupport.IProductContextMenu;
047: import org.netbeans.modules.uml.ui.support.contextmenusupport.IProductContextMenuItem;
048: import org.netbeans.modules.uml.ui.support.viewfactorysupport.IDrawEngine;
049:
050: /**
051: * @author KevinM
052: *
053: */
054: public interface IADDrawEngineButtonHandler extends
055: IProductButtonHandler {
056:
057: public final static int MBK_SEPARATOR = 0;
058: public final static int MBK_PROPERTIES = 1;
059: public final static int MBK_LIFELINE_REALIZE_PART_PORT = 2;
060: public final static int MBK_LIFELINE_REALIZE_PART_ATTRIBUTE = 3;
061: public final static int MBK_LIFELINE_REALIZE_PART_PARAMETER = 4;
062: public final static int MBK_LINK_END_ORDINARY_AGGREGATE = 5;
063: public final static int MBK_LINK_END_COMPOSITE_AGGREGATE = 6;
064: public final static int MBK_LINK_END_REMOVE_AGGREGATE = 7;
065: public final static int MBK_LINK_END_NAVIGABLE = 8;
066: public final static int MBK_LINK_END_REVERSE_ENDS = 9;
067: // Does a layout of the link to move the labels back to their original positions
068: public final static int MBK_RELAYOUT_LABELS = 10;
069: // Shows the associationname, if not there it creates one
070: public final static int MBK_SHOW_ASSOCIATION_NAME = 11;
071: // Shows both rolenames
072: public final static int MBK_SHOW_BOTH_ROLENAMES = 12;
073: // Shows both multiplicities
074: public final static int MBK_SHOW_BOTH_MULTIPLICITIES = 13;
075: // Shows the rolename for the end we're nearest to
076: public final static int MBK_SHOW_ROLENAME = 14;
077: // Shows the interface name
078: public final static int MBK_SHOW_INTERFACENAME = 15;
079: // Shows the multiplicity for the end we're nearest to
080: public final static int MBK_SHOW_MULTIPLICITY = 16;
081: // Sets the multiplicity to 0..1
082: public final static int MBK_SET_MULTIPLICITY_0_1 = 17;
083: // Sets the multiplicity to 0..*
084: public final static int MBK_SET_MULTIPLICITY_0_STAR = 18;
085: // Sets the multiplicity to *
086: public final static int MBK_SET_MULTIPLICITY_STAR = 19;
087: // Sets the multiplicity to 1
088: public final static int MBK_SET_MULTIPLICITY_1 = 20;
089: // Sets the multiplicity to 1..*
090: public final static int MBK_SET_MULTIPLICITY_1_STAR = 21;
091: // Shows all labels
092: public final static int MBK_SHOW_ALL_LABELS = 22;
093: // Customizes the compartments
094: public final static int MBK_CUSTOMIZE = 23;
095: // Shows the stereotype
096: public final static int MBK_SHOW_STEREOTYPE = 24;
097: // Shows the name
098: public final static int MBK_SHOW_NAME_LABEL = 25;
099: // Shows the binding on a derivation
100: public final static int MBK_SHOW_BINDING = 26;
101: // Shows the guard condition on the activity edge
102: public final static int MBK_SHOW_GUARD_CONDITION = 27;
103: // Shows the pre condition on the transition
104: public final static int MBK_SHOW_PRE_CONDITION = 28;
105: // Shows the post condition on the transition
106: public final static int MBK_SHOW_POST_CONDITION = 29;
107: // Shows the name on the activity edge
108: public final static int MBK_SHOW_ACTIVITYEDGE_NAME = 30;
109: // Inserts an extension point into a use case
110: public final static int MBK_INSERT_USECASE_EXTENSIONPOINT = 31;
111: // Used to change graphic states
112: public final static int MBK_SHAPE_RECTANGLE = 32;
113: public final static int MBK_SHAPE_ROUNDED_RECTANGLE = 33;
114: public final static int MBK_SHAPE_ELLIPSE = 34;
115: public final static int MBK_SHAPE_PENTAGON = 35;
116: public final static int MBK_SHAPE_HEXAGON1 = 36;
117: public final static int MBK_SHAPE_HEXAGON2 = 37;
118: public final static int MBK_SHAPE_OCTAGON = 38;
119: public final static int MBK_SHAPE_TRIANGLE = 39;
120: public final static int MBK_SHAPE_TRIANGLE_DOWN = 40;
121: public final static int MBK_SHAPE_TRIANGLE_LEFT = 41;
122: public final static int MBK_SHAPE_TRIANGLE_RIGHT = 42;
123: public final static int MBK_SHAPE_DIAMOND = 43;
124: public final static int MBK_SHAPE_PARALLELOGRAM = 44;
125: public final static int MBK_SHAPE_STAR = 45;
126: public final static int MBK_SHAPE_CROSS = 46;
127: // Enable and disable containment
128: public final static int MBK_CONTAINMENT_ENABLE = 47;
129: public final static int MBK_CONTAINMENT_DISABLE = 48;
130: // Enables and disables the events and transitions compartment
131: public final static int MBK_STATE_EVENT_TRANSITIONS_COMPARTMENT_SHOW = 49;
132: public final static int MBK_STATE_EVENT_TRANSITIONS_COMPARTMENT_HIDE = 50;
133: // Pseudostate stuff
134: public final static int MBK_SHOW_PSEUDOSTATE_NAME = 51;
135: // FinalState stuff
136: public final static int MBK_SHOW_FINALSTATE_NAME = 52;
137: // Adding and Removing Ports from components
138: public final static int MBK_COMPONENT_PORT_NAME = 53;
139: public final static int MBK_COMPONENT_PORT_NAME_END = MBK_COMPONENT_PORT_NAME + 100;
140: // Shows qualifiers
141: public final static int MBK_QUALIFIERS = MBK_COMPONENT_PORT_NAME_END + 1;
142: public final static int MBK_INVALID = -1;
143:
144: /// Adds Port on Component specific stuff
145: public void addPortMenuItems(IDrawEngine pDrawEngine,
146: IProductContextMenu pContextMenu);
147:
148: /// Adds Node specific stuff
149: public void addCustomizeMenuItems(IProductContextMenu pContextMenu);
150:
151: /// Adds PseudoState specific stuff
152: public void addPseudoStateMenuItems(IProductContextMenu pContextMenu);
153:
154: /// Adds FinalState specific stuff
155: public void addFinalStateMenuItems(IProductContextMenu pContextMenu);
156:
157: /// Adds the state events and transitions list compartment enable/disable stuff
158: public void addEventTransitionMenuItems(
159: IProductContextMenu pContextMenu, boolean bShow);
160:
161: /// Adds Interface Edge specific stuff
162: public void addInterfaceEdgeMenuItems(
163: IProductContextMenu pContextMenu);
164:
165: /// Adds Association and Aggregation Edge specific stuff
166: public void addAssociationAndAggregationEdgeMenuItems(
167: IProductContextMenu pContextMenu, IElement pLinkElement);
168:
169: /// Adds Activity Edge specific stuff
170: public void addActivityEdgeMenuItems(
171: IProductContextMenu pContextMenu, IElement pLinkElement);
172:
173: /// Adds Transition Edge specific stuff
174: public void addTransitionEdgeMenuItems(
175: IProductContextMenu pContextMenu, IElement pLinkElement);
176:
177: /// Adds Association Edge set multiplicity stuff
178: public void addAssociationEndSetMultiplicityMenuItems(
179: IProductContextMenu pContextMenu);
180:
181: /// Adds the Association menu items for controlling name, both ends and both multiplicities
182: public void addAssociationMultiLabelSelectionsPullright(
183: IProductContextMenu pContextMenu, boolean bInMiddle);
184:
185: /// Adds the Association menu items when the location is CMPK_END or CMPK_START
186: public void addAssociationEndLabelsPullright(
187: IProductContextMenu pContextMenu);
188:
189: /// Adds the Qualifiers button when the location is CMPK_END or CMPK_START
190: public void addQualifiersButton(IProductContextMenu pContextMenu);
191:
192: /// Adds the name label
193: public void addNameLabelPullright(IDrawEngine pEngine,
194: IProductContextMenu pContextMenu);
195:
196: /// Adds the stereotype label
197: public void addStereotypeLabelPullright(IDrawEngine pEngine,
198: IProductContextMenu pContextMenu);
199:
200: /// Adds the binding label
201: public void addBindLabelPullright(IProductContextMenu pContextMenu);
202:
203: /// Adds the ability to represent new parts (Port, Attribute and Parameter)
204: public void addRepresentPartButtons(IProductContextMenu pContextMenu);
205:
206: /// Used to change the shape of the graphics
207: public void addGraphicShapePullright(
208: IProductContextMenu pContextMenu);
209:
210: /// Used to turn containment on and off on graphic shapes
211: public void addContainmentOnOffPullright(
212: IProductContextMenu pContextMenu);
213:
214: /// Called when a specific button is called. The menuSelected is of kind MenuButtonKind.
215: public boolean handleButton(IProductContextMenu pContextMenu,
216: IProductContextMenuItem pMenuItem, int menuSelected);
217:
218: /// Set the menu button sensitivity
219: public void setSensitivityAndCheck(
220: IProductContextMenu pContextMenu,
221: IProductContextMenuItem pMenuItem, int buttonKind);
222:
223: /// Loads a string based on an ID
224: public String loadString(String id);
225:
226: /// Is the parent diagram readonly
227: public boolean parentDiagramIsReadOnly();
228:
229: public void setDrawEngine(IDrawEngine drawengine);
230:
231: public IDrawEngine getDrawEngine();
232: }
|