Source Code Cross Referenced for ScriptEditPart.java in  » ESB » cbesb-1.2 » com » bostechcorp » cbesb » ui » componentflow » componentFlowEditor » diagram » edit » parts » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ESB » cbesb 1.2 » com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.edit.parts 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * ChainBuilder ESB
0003:         *          Visual Enterprise Integration
0004:         * 
0005:         * Copyright (C) 2006 Bostech Corporation
0006:         * 
0007:         * This program is free software; you can redistribute it and/or modify it 
0008:         * under the terms of the GNU General Public License as published by the 
0009:         * Free Software Foundation; either version 2 of the License, or (at your option) 
0010:         * any later version.
0011:         *
0012:         * This program is distributed in the hope that it will be useful, 
0013:         * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
0014:         * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
0015:         * for more details.
0016:         * 
0017:         * You should have received a copy of the GNU General Public License along with 
0018:         * this program; if not, write to the Free Software Foundation, Inc., 
0019:         * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0020:         *
0021:         *
0022:         * $Id$
0023:         */
0024:        package com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.edit.parts;
0025:
0026:        import java.util.HashMap;
0027:        import java.util.Iterator;
0028:        import java.util.List;
0029:
0030:        import org.eclipse.draw2d.BorderLayout;
0031:        import org.eclipse.draw2d.ChopboxAnchor;
0032:        import org.eclipse.draw2d.ConnectionAnchor;
0033:        import org.eclipse.draw2d.Figure;
0034:        import org.eclipse.draw2d.IFigure;
0035:        import org.eclipse.draw2d.ImageFigure;
0036:        import org.eclipse.draw2d.PositionConstants;
0037:        import org.eclipse.draw2d.StackLayout;
0038:        import org.eclipse.draw2d.ToolbarLayout;
0039:        import org.eclipse.draw2d.geometry.Point;
0040:        import org.eclipse.draw2d.geometry.Rectangle;
0041:        import org.eclipse.emf.common.command.AbstractCommand;
0042:        import org.eclipse.emf.common.command.CompoundCommand;
0043:        import org.eclipse.emf.common.notify.Notification;
0044:        import org.eclipse.emf.common.notify.impl.AdapterImpl;
0045:        import org.eclipse.emf.ecore.EAnnotation;
0046:        import org.eclipse.emf.ecore.EClass;
0047:        import org.eclipse.emf.ecore.EObject;
0048:        import org.eclipse.emf.ecore.EStructuralFeature;
0049:        import org.eclipse.emf.edit.command.AddCommand;
0050:        import org.eclipse.emf.edit.command.RemoveCommand;
0051:        import org.eclipse.emf.edit.command.SetCommand;
0052:        import org.eclipse.emf.transaction.RecordingCommand;
0053:        import org.eclipse.emf.transaction.TransactionalEditingDomain;
0054:        import org.eclipse.emf.transaction.util.TransactionUtil;
0055:        import org.eclipse.gef.ConnectionEditPart;
0056:        import org.eclipse.gef.EditPart;
0057:        import org.eclipse.gef.EditPolicy;
0058:        import org.eclipse.gef.GraphicalEditPart;
0059:        import org.eclipse.gef.NodeEditPart;
0060:        import org.eclipse.gef.Request;
0061:        import org.eclipse.gef.RequestConstants;
0062:        import org.eclipse.gef.commands.Command;
0063:        import org.eclipse.gef.commands.UnexecutableCommand;
0064:        import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
0065:        import org.eclipse.gef.editpolicies.ComponentEditPolicy;
0066:        import org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy;
0067:        import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy;
0068:        import org.eclipse.gef.editpolicies.ResizableEditPolicy;
0069:        import org.eclipse.gef.requests.CreateConnectionRequest;
0070:        import org.eclipse.gef.requests.CreateRequest;
0071:        import org.eclipse.gef.requests.DirectEditRequest;
0072:        import org.eclipse.gef.requests.GroupRequest;
0073:        import org.eclipse.gef.requests.ReconnectRequest;
0074:        import org.eclipse.gmf.runtime.notation.Bounds;
0075:        import org.eclipse.gmf.runtime.notation.Edge;
0076:        import org.eclipse.gmf.runtime.notation.FillStyle;
0077:        import org.eclipse.gmf.runtime.notation.FontStyle;
0078:        import org.eclipse.gmf.runtime.notation.LineStyle;
0079:        import org.eclipse.gmf.runtime.notation.Node;
0080:        import org.eclipse.gmf.runtime.notation.NotationFactory;
0081:        import org.eclipse.gmf.runtime.notation.NotationPackage;
0082:        import org.eclipse.gmf.runtime.notation.View;
0083:        import org.eclipse.jface.wizard.WizardDialog;
0084:        import org.eclipse.swt.SWT;
0085:        import org.eclipse.swt.graphics.Color;
0086:        import org.eclipse.swt.graphics.Font;
0087:        import org.eclipse.swt.graphics.FontData;
0088:        import org.eclipse.ui.PlatformUI;
0089:
0090:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.ComponentFlowEditorDocument;
0091:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.ComponentFlowEditorElement;
0092:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.MessageExchange;
0093:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.Script;
0094:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.componentflowFactory;
0095:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.componentflowPackage;
0096:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.part.ComponentFlowEditorDiagramEditor;
0097:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.part.ComponentFlowEditorDiagramEditorPlugin;
0098:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.part.ComponentFlowEditorPaletteFactory;
0099:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.part.ComponentFlowEditorVisualIDRegistry;
0100:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.view.factories.DomainElementInitializer;
0101:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.view.factories.MessageExchangeViewFactory;
0102:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.wizards.JMSPropertyWizard;
0103:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.wizards.ParserPropertyWizard;
0104:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.wizards.ScriptPropertyWizard;
0105:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.wizards.WizardUtil;
0106:
0107:        /**
0108:         * @generated
0109:         */
0110:        public class ScriptEditPart extends AbstractGraphicalEditPart implements 
0111:                NodeEditPart, IUpdatableEditPart {
0112:
0113:            /**
0114:             * @generated
0115:             */
0116:            public static final int VISUAL_ID = 2012;
0117:
0118:            /**
0119:             * @generated
0120:             */
0121:            protected IFigure contentPane;
0122:
0123:            /**
0124:             * @generated
0125:             */
0126:            protected IFigure primaryShape;
0127:
0128:            /**
0129:             * @generated
0130:             */
0131:            public ScriptEditPart(View model) {
0132:                assert model instanceof  Node;
0133:                setModel(model);
0134:            }
0135:
0136:            /**
0137:             * @generated
0138:             */
0139:            protected void createEditPolicies() {
0140:                installEditPolicy(EditPolicy.COMPONENT_ROLE,
0141:                        new ComponentEditPolicy() {
0142:                            protected Command createDeleteCommand(
0143:                                    GroupRequest deleteRequest) {
0144:                                TransactionalEditingDomain editingDomain = TransactionUtil
0145:                                        .getEditingDomain(getDiagramNode()
0146:                                                .getDiagram().getElement());
0147:                                CompoundCommand cc = new CompoundCommand();
0148:                                cc
0149:                                        .append(getDomainModelRemoveCommand(editingDomain));
0150:                                cc.append(RemoveCommand.create(editingDomain,
0151:                                        getDiagramNode()));
0152:                                return new WrappingCommand(editingDomain, cc);
0153:                            }
0154:
0155:                            private org.eclipse.emf.common.command.Command getDomainModelRemoveCommand(
0156:                                    TransactionalEditingDomain editingDomain) {
0157:                                return RemoveCommand
0158:                                        .create(
0159:                                                editingDomain,
0160:                                                getDiagramNode().getElement()
0161:                                                        .eContainer(),
0162:                                                componentflowPackage.eINSTANCE
0163:                                                        .getComponentFlowEditorDocument_ComponentFlowEditorElements(),
0164:                                                getDiagramNode().getElement());
0165:                            }
0166:                        });
0167:                installEditPolicy(EditPolicy.LAYOUT_ROLE,
0168:                        new ConstrainedLayoutEditPolicy() {
0169:                            protected Command getCreateCommand(
0170:                                    CreateRequest request) {
0171:                                return UnexecutableCommand.INSTANCE;
0172:                            }
0173:
0174:                            protected Object getConstraintFor(Rectangle rect) {
0175:                                return null;
0176:                            }
0177:
0178:                            protected Object getConstraintFor(Point point) {
0179:                                return null;
0180:                            }
0181:
0182:                            protected Command createChangeConstraintCommand(
0183:                                    EditPart child, Object constraint) {
0184:                                return UnexecutableCommand.INSTANCE;
0185:                            }
0186:
0187:                            protected EditPolicy createChildEditPolicy(
0188:                                    EditPart child) {
0189:                                return new ResizableEditPolicy() {
0190:                                    public EditPart getTargetEditPart(
0191:                                            Request request) {
0192:                                        if (RequestConstants.REQ_SELECTION
0193:                                                .equals(request.getType())) {
0194:                                            return ScriptEditPart.this ;
0195:                                        }
0196:                                        return super .getTargetEditPart(request);
0197:                                    }
0198:                                };
0199:                            }
0200:                        });
0201:                installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
0202:                        new GraphicalNodeEditPolicy() {
0203:                            protected Command getReconnectTargetCommand(
0204:                                    ReconnectRequest request) {
0205:                                //XXX: reconnect command
0206:                                return UnexecutableCommand.INSTANCE;
0207:                            }
0208:
0209:                            protected Command getReconnectSourceCommand(
0210:                                    ReconnectRequest request) {
0211:                                //XXX: reconnect command
0212:                                return UnexecutableCommand.INSTANCE;
0213:                            }
0214:
0215:                            protected Command getConnectionCreateCommand(
0216:                                    CreateConnectionRequest request) {
0217:                                if (request instanceof  ComponentFlowEditorPaletteFactory.CreateConnectionRequestEx) {
0218:                                    ComponentFlowEditorPaletteFactory.CreateConnectionRequestEx requestEx = (ComponentFlowEditorPaletteFactory.CreateConnectionRequestEx) request;
0219:                                    int[] visualIds = requestEx.getVisualIds();
0220:                                    CompoundCommand result = new CompoundCommand();
0221:                                    for (int i = 0; i < visualIds.length; i++) {
0222:                                        int nextVisualId = visualIds[i];
0223:                                        switch (nextVisualId) {
0224:                                        case MessageExchangeEditPart.VISUAL_ID:
0225:                                            result
0226:                                                    .append(new CreateMessageExchange4001StartCommand(
0227:                                                            requestEx));
0228:                                            break;
0229:                                        }
0230:                                    }
0231:                                    if (result.getCommandList().size() != 1
0232:                                            || !result.canExecute()) {
0233:                                        //Cannot create several connections at once.
0234:                                        //returning an unexecutable command does not change cursor to "No".
0235:                                        return null;
0236:                                    }
0237:                                    Command wrappedResult = new WrappingCommand(
0238:                                            TransactionUtil
0239:                                                    .getEditingDomain(getDiagramNode()
0240:                                                            .getDiagram()
0241:                                                            .getElement()),
0242:                                            result);
0243:                                    request.setStartCommand(wrappedResult);
0244:                                    return wrappedResult;
0245:                                }
0246:                                return null;
0247:                            }
0248:
0249:                            protected Command getConnectionCompleteCommand(
0250:                                    CreateConnectionRequest request) {
0251:                                if (request.getStartCommand() == null
0252:                                        || !request.getStartCommand()
0253:                                                .canExecute()) {
0254:                                    return UnexecutableCommand.INSTANCE;
0255:                                }
0256:                                if (request instanceof  ComponentFlowEditorPaletteFactory.CreateConnectionRequestEx) {
0257:                                    ComponentFlowEditorPaletteFactory.CreateConnectionRequestEx requestEx = (ComponentFlowEditorPaletteFactory.CreateConnectionRequestEx) request;
0258:                                    int[] visualIds = requestEx.getVisualIds();
0259:                                    CompoundCommand result = new CompoundCommand();
0260:                                    for (int i = 0; i < visualIds.length; i++) {
0261:                                        int nextVisualId = visualIds[i];
0262:                                        switch (nextVisualId) {
0263:                                        case MessageExchangeEditPart.VISUAL_ID:
0264:                                            result
0265:                                                    .append(new CreateMessageExchange4001Command(
0266:                                                            requestEx));
0267:                                            break;
0268:                                        }
0269:                                    }
0270:                                    if (result.getCommandList().size() != 1) {
0271:                                        //Cannot create several connections at once.
0272:                                        return UnexecutableCommand.INSTANCE;
0273:                                    }
0274:                                    return new WrappingCommand(
0275:                                            TransactionUtil
0276:                                                    .getEditingDomain(getDiagramNode()
0277:                                                            .getDiagram()
0278:                                                            .getElement()),
0279:                                            result);
0280:                                }
0281:                                return UnexecutableCommand.INSTANCE;
0282:                            }
0283:                        });
0284:            }
0285:
0286:            /**
0287:             * @generated NOT
0288:             */
0289:            protected IFigure createFigure() {
0290:                IFigure invisibleRectangle = new Figure();
0291:                invisibleRectangle.setLayoutManager(new BorderLayout());
0292:                IFigure rec = new Figure();
0293:                invisibleRectangle.add(rec, BorderLayout.CENTER);
0294:                rec.setLayoutManager(new StackLayout());
0295:                IFigure shape = createNodeShape();
0296:                rec.add(shape);
0297:                contentPane = setupContentPane(shape);
0298:
0299:                IFigure decorationShape = createDecorationPane();
0300:                if (decorationShape != null) {
0301:                    rec.add(decorationShape);
0302:                }
0303:                // add----------------------------
0304:                org.eclipse.draw2d.Label fig = new org.eclipse.draw2d.Label();
0305:                fig.setText("");
0306:
0307:                ((SEFigure) shape).setFigureSENameFigure(fig);
0308:
0309:                invisibleRectangle.add(fig, BorderLayout.BOTTOM);
0310:                //---------------------------------------------------
0311:
0312:                View view = (View) getModel();
0313:
0314:                wizardOut(view, true);
0315:
0316:                return invisibleRectangle;
0317:            }
0318:
0319:            /**
0320:             * @generated
0321:             */
0322:            protected IFigure createNodeShape() {
0323:                SEFigure figure = new SEFigure();
0324:                primaryShape = figure;
0325:                return primaryShape;
0326:            }
0327:
0328:            /**
0329:             * @generated
0330:             */
0331:            public SEFigure getPrimaryShape() {
0332:                return (SEFigure) primaryShape;
0333:            }
0334:
0335:            /**
0336:             * @generated NOT
0337:             */
0338:            private IFigure createDecorationPane() {
0339:                View view = (View) getModel();
0340:                EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
0341:                /*if (annotation == null) {
0342:                 return null;
0343:                 }*/
0344:
0345:                Figure decorationPane = new Figure();
0346:                decorationPane.setLayoutManager(new BorderLayout());
0347:
0348:                ImageFigure imageFigure = new ImageFigure(
0349:                        ComponentFlowEditorDiagramEditorPlugin.getInstance()
0350:                                .getBundledImage("icons/Script32.ico"),
0351:                        PositionConstants.CENTER);
0352:                decorationPane.add(imageFigure, BorderLayout.TOP);
0353:                return decorationPane;
0354:            }
0355:
0356:            /**
0357:             * Default implementation treats passed figure as content pane.
0358:             * Respects layout one may have set for generated figure.
0359:             * @param nodeShape instance of generated figure class
0360:             * @generated
0361:             */
0362:            protected IFigure setupContentPane(IFigure nodeShape) {
0363:                if (nodeShape.getLayoutManager() == null) {
0364:                    ToolbarLayout layout = new ToolbarLayout();
0365:                    layout.setSpacing(5);
0366:                    nodeShape.setLayoutManager(layout);
0367:                }
0368:                return nodeShape; // use nodeShape itself as contentPane
0369:            }
0370:
0371:            /**
0372:             * @generated
0373:             */
0374:            public IFigure getContentPane() {
0375:                if (contentPane == null) {
0376:                    return super .getContentPane();
0377:                }
0378:                return contentPane;
0379:            }
0380:
0381:            /**
0382:             * @generated
0383:             */
0384:            public Node getDiagramNode() {
0385:                return (Node) getModel();
0386:            }
0387:
0388:            /**
0389:             * @generated
0390:             */
0391:            protected boolean addFixedChild(EditPart childEditPart) {
0392:                if (childEditPart instanceof  ScriptNameEditPart) {
0393:                    ((ScriptNameEditPart) childEditPart)
0394:                            .setLabel(getPrimaryShape().getFigureSENameFigure());
0395:                    return true;
0396:                }
0397:                return false;
0398:            }
0399:
0400:            /**
0401:             * @generated
0402:             */
0403:            protected boolean removeFixedChild(EditPart childEditPart) {
0404:                return false;
0405:            }
0406:
0407:            /**
0408:             * Returns the label which should be direct-edited by default.
0409:             * @generated
0410:             */
0411:            private EditPart getPrimaryLabelEditPart() {
0412:                for (Iterator it = getDiagramNode().getChildren().iterator(); it
0413:                        .hasNext();) {
0414:                    View nextChild = (View) it.next();
0415:                    if (ComponentFlowEditorVisualIDRegistry
0416:                            .getVisualID(nextChild) == ScriptNameEditPart.VISUAL_ID) {
0417:                        return (EditPart) getViewer().getEditPartRegistry()
0418:                                .get(nextChild);
0419:                    }
0420:                }
0421:                return null;
0422:            }
0423:
0424:            /**
0425:             * @generated NOT
0426:             */
0427:            public void performRequest(Request req) {
0428:                if (RequestConstants.REQ_DIRECT_EDIT == req.getType()) {
0429:                    EditPart labelToEdit;
0430:                    if (req instanceof  DirectEditRequest) {
0431:                        labelToEdit = getLabelEditPart((DirectEditRequest) req);
0432:                    } else {
0433:                        labelToEdit = getPrimaryLabelEditPart();
0434:                    }
0435:                    if (labelToEdit != null) {
0436:                        labelToEdit.performRequest(req);
0437:                    }
0438:                }
0439:
0440:                //			Figure double clicked
0441:                if (REQ_OPEN.equals(req.getType())) {
0442:                    /*View view = (View) getModel();
0443:                     wizardOut(view, false);
0444:                     super.performRequest(req);*/
0445:                }
0446:            }
0447:
0448:            /**
0449:             * @generated
0450:             */
0451:            private EditPart getLabelEditPart(DirectEditRequest req) {
0452:                EditPart result = getViewer().findObjectAt(req.getLocation());
0453:                if (result != null) {
0454:                    View view = (View) result.getModel();
0455:                    if (getDiagramNode().getChildren().contains(view)) {
0456:                        int visualId = ComponentFlowEditorVisualIDRegistry
0457:                                .getVisualID(view);
0458:                        switch (visualId) {
0459:                        case ScriptNameEditPart.VISUAL_ID:
0460:                            return result;
0461:                        }
0462:                    }
0463:                }
0464:                return getPrimaryLabelEditPart();
0465:            }
0466:
0467:            /**
0468:             * @generated
0469:             */
0470:            protected void addChildVisual(EditPart childEditPart, int index) {
0471:                if (addFixedChild(childEditPart)) {
0472:                    return;
0473:                }
0474:                super .addChildVisual(childEditPart, -1);
0475:            }
0476:
0477:            /**
0478:             * @generated
0479:             */
0480:            protected void removeChildVisual(EditPart childEditPart) {
0481:                if (removeFixedChild(childEditPart)) {
0482:                    return;
0483:                }
0484:                super .removeChildVisual(childEditPart);
0485:            }
0486:
0487:            /**
0488:             * @generated
0489:             */
0490:            protected void refreshVisuals() {
0491:                super .refreshVisuals();
0492:                refreshBounds();
0493:                refreshBackgroundColor();
0494:                refreshForegroundColor();
0495:                refreshFont();
0496:                refreshVisibility();
0497:            }
0498:
0499:            /**
0500:             * @generated
0501:             */
0502:            protected void refreshVisibility() {
0503:                boolean isVisible = getDiagramNode().isVisible();
0504:                boolean wasVisible = getFigure().isVisible();
0505:                if (isVisible == wasVisible) {
0506:                    return;
0507:                }
0508:                if (!isVisible && (getSelected() != SELECTED_NONE)) {
0509:                    getViewer().deselect(this );
0510:                }
0511:
0512:                getFigure().setVisible(isVisible);
0513:                getFigure().revalidate();
0514:            }
0515:
0516:            /**
0517:             * @generated
0518:             */
0519:            protected void refreshBounds() {
0520:                Node node = getDiagramNode();
0521:                assert node.getLayoutConstraint() instanceof  Bounds;
0522:                Bounds bounds = (Bounds) node.getLayoutConstraint();
0523:                ((GraphicalEditPart) getParent()).setLayoutConstraint(this ,
0524:                        getFigure(), new Rectangle(bounds.getX(),
0525:                                bounds.getY(), bounds.getWidth(), bounds
0526:                                        .getHeight()));
0527:            }
0528:
0529:            /**
0530:             * @generated
0531:             */
0532:            protected List getModelChildren() {
0533:                return getDiagramNode().getVisibleChildren();
0534:            }
0535:
0536:            /**
0537:             * @generated
0538:             */
0539:            protected List getModelSourceConnections() {
0540:                return getDiagramNode().getSourceEdges();
0541:            }
0542:
0543:            /**
0544:             * @generated NOT
0545:             */
0546:            protected List getModelTargetConnections() {
0547:
0548:                return getDiagramNode().getTargetEdges();
0549:            }
0550:
0551:            /**
0552:             * @generated NOT
0553:             */
0554:            protected void adjustName() {
0555:                ComponentFlowEditorEditPartFactory.setModelName(this , "Script");
0556:            }
0557:
0558:            /**
0559:             * @generated NOT
0560:             */
0561:            public void wizardOut(View view, boolean newCom) {
0562:
0563:                if (newCom && !WizardUtil.canWizardOut(view))
0564:                    return;
0565:
0566:                final ScriptPropertyWizard scriptWizard = new ScriptPropertyWizard();
0567:                if (newCom) {
0568:                    scriptWizard
0569:                            .setAddedOperation((ComponentFlowEditorElement) view
0570:                                    .getElement());
0571:                    WizardDialog wizard = new WizardDialog(PlatformUI
0572:                            .getWorkbench().getActiveWorkbenchWindow()
0573:                            .getShell(), scriptWizard);
0574:                    wizard.open();
0575:                } else {
0576:                    scriptWizard
0577:                            .setUpdateOperation((ComponentFlowEditorElement) view
0578:                                    .getElement());
0579:
0580:                    TransactionalEditingDomain domain = TransactionUtil
0581:                            .getEditingDomain(view.getElement());
0582:                    domain.getCommandStack().execute(
0583:                            new RecordingCommand(domain) {
0584:
0585:                                public void doExecute() {
0586:                                    WizardDialog wizard = new WizardDialog(
0587:                                            PlatformUI.getWorkbench()
0588:                                                    .getActiveWorkbenchWindow()
0589:                                                    .getShell(), scriptWizard);
0590:                                    wizard.open();
0591:                                }
0592:                            });
0593:                }
0594:            }
0595:
0596:            /**
0597:             * @generated
0598:             */
0599:            public ConnectionAnchor getSourceConnectionAnchor(
0600:                    ConnectionEditPart connection) {
0601:                return new ChopboxAnchor(getFigure());
0602:            }
0603:
0604:            /**
0605:             * @generated
0606:             */
0607:            public ConnectionAnchor getSourceConnectionAnchor(Request request) {
0608:                return new ChopboxAnchor(getFigure());
0609:            }
0610:
0611:            /**
0612:             * @generated
0613:             */
0614:            public ConnectionAnchor getTargetConnectionAnchor(
0615:                    ConnectionEditPart connection) {
0616:                return new ChopboxAnchor(getFigure());
0617:            }
0618:
0619:            /**
0620:             * @generated
0621:             */
0622:            public ConnectionAnchor getTargetConnectionAnchor(Request request) {
0623:                return new ChopboxAnchor(getFigure());
0624:            }
0625:
0626:            /**
0627:             * @generated
0628:             */
0629:            public Object getAdapter(Class key) {
0630:                return super .getAdapter(key);
0631:            }
0632:
0633:            /**
0634:             * @generated
0635:             */
0636:            public void activate() {
0637:                super .activate();
0638:                getDiagramNode().getElement().eAdapters().add(
0639:                        domainModelRefresher);
0640:            }
0641:
0642:            /**
0643:             * @generated
0644:             */
0645:            public void deactivate() {
0646:                getDiagramNode().getElement().eAdapters().remove(
0647:                        domainModelRefresher);
0648:                super .deactivate();
0649:            }
0650:
0651:            /**
0652:             * @generated
0653:             */
0654:            private DomainModelRefresher domainModelRefresher = new DomainModelRefresher();
0655:
0656:            /**
0657:             * @generated
0658:             */
0659:            private class DomainModelRefresher extends AdapterImpl {
0660:                /**
0661:                 * @generated NOT
0662:                 */
0663:                public void notifyChanged(Notification msg) {
0664:                    super .notifyChanged(msg);
0665:                    if (msg.isTouch()) {
0666:                        return;
0667:                    }
0668:                    Refresher refresher = getRefresher((EStructuralFeature) msg
0669:                            .getFeature(), msg);
0670:                    if (refresher != null) {
0671:                        refresher.refresh();
0672:                    }
0673:                    adjustName();
0674:                }
0675:            }
0676:
0677:            /**
0678:             * @generated
0679:             */
0680:            public void addRefresher(EStructuralFeature feature,
0681:                    Refresher refresher) {
0682:                CompositeRefresher compositeRefresher = getCompositeRefresher(feature);
0683:                compositeRefresher.addRefresher(refresher);
0684:            }
0685:
0686:            /**
0687:             * @generated
0688:             */
0689:            public void removeRefresher(EStructuralFeature feature,
0690:                    Refresher refresher) {
0691:                CompositeRefresher compositeRefresher = getCompositeRefresher(feature);
0692:                compositeRefresher.removeRefresher(refresher);
0693:            }
0694:
0695:            /**
0696:             * @generated
0697:             */
0698:            private CompositeRefresher getCompositeRefresher(
0699:                    EStructuralFeature feature) {
0700:                if (structuralFeatures2Refresher == null) {
0701:                    createRefreshers();
0702:                }
0703:                Refresher refresher = (Refresher) structuralFeatures2Refresher
0704:                        .get(feature);
0705:                if (refresher instanceof  CompositeRefresher) {
0706:                    return (CompositeRefresher) refresher;
0707:                }
0708:                CompositeRefresher result = new CompositeRefresher();
0709:                if (refresher != null) {
0710:                    result.addRefresher(refresher);
0711:                }
0712:                structuralFeatures2Refresher.put(feature, result);
0713:                return result;
0714:            }
0715:
0716:            /**
0717:             * @generated
0718:             */
0719:            protected void refreshFont() {
0720:                FontStyle style = (FontStyle) getDiagramNode().getStyle(
0721:                        NotationPackage.eINSTANCE.getFontStyle());
0722:                Font toDispose = createdFont;
0723:                if (style != null) {
0724:                    String fontName = style.getFontName();
0725:                    int fontHeight = style.getFontHeight();
0726:                    int fontStyle = SWT.NORMAL;
0727:                    if (style.isBold()) {
0728:                        fontStyle |= SWT.BOLD;
0729:                    }
0730:                    if (style.isItalic()) {
0731:                        fontStyle |= SWT.ITALIC;
0732:                    }
0733:                    Font currentFont = getFigure().getFont();
0734:                    if (currentFont != null) {
0735:                        FontData currentFontData = currentFont.getFontData()[0];
0736:                        if (currentFontData.getName().equals(fontName)
0737:                                && currentFontData.getHeight() == fontHeight
0738:                                && currentFontData.getStyle() == fontStyle) {
0739:                            return;
0740:                        }
0741:                    }
0742:                    createdFont = new Font(null, fontName, fontHeight,
0743:                            fontStyle);
0744:                    getFigure().setFont(createdFont);
0745:                } else {
0746:                    //revert to the default font
0747:                    getFigure().setFont(getViewer().getControl().getFont());
0748:                    createdFont = null;
0749:                }
0750:                if (toDispose != null) {
0751:                    toDispose.dispose();
0752:                }
0753:            }
0754:
0755:            /**
0756:             * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned).
0757:             * Whenever another non-default font is assigned to it, it is safe to dispose the previous one.
0758:             * @generated
0759:             */
0760:            private Font createdFont;
0761:
0762:            /**
0763:             * @generated
0764:             */
0765:            protected void refreshForegroundColor() {
0766:                LineStyle style = (LineStyle) getDiagramNode().getStyle(
0767:                        NotationPackage.eINSTANCE.getLineStyle());
0768:                Color toDispose = createdForegroundColor;
0769:                if (style != null) {
0770:                    int foregroundColor = style.getLineColor();
0771:                    int red = foregroundColor & 0x000000FF;
0772:                    int green = (foregroundColor & 0x0000FF00) >> 8;
0773:                    int blue = (foregroundColor & 0x00FF0000) >> 16;
0774:                    Color currentColor = getFigure().getForegroundColor();
0775:                    if (currentColor != null && currentColor.getRed() == red
0776:                            && currentColor.getGreen() == green
0777:                            && currentColor.getBlue() == blue) {
0778:                        return;
0779:                    }
0780:                    createdForegroundColor = new Color(null, red, green, blue);
0781:                    getFigure().setForegroundColor(createdForegroundColor);
0782:                } else {
0783:                    getFigure().setForegroundColor(
0784:                            getViewer().getControl().getForeground());
0785:                    createdForegroundColor = null;
0786:                }
0787:                if (toDispose != null) {
0788:                    toDispose.dispose();
0789:                }
0790:            }
0791:
0792:            /**
0793:             * The color (created by {@link #refreshForegroundColor()}) currently assigned to the figure.
0794:             * Whenever another color is assigned to it, it is safe to dispose the previous one.
0795:             * @generated
0796:             */
0797:            private Color createdForegroundColor;
0798:
0799:            /**
0800:             * @generated
0801:             */
0802:            protected void refreshBackgroundColor() {
0803:                FillStyle style = (FillStyle) getDiagramNode().getStyle(
0804:                        NotationPackage.eINSTANCE.getFillStyle());
0805:                Color toDispose = createdBackgroundColor;
0806:                if (style != null) {
0807:                    int backgroundColor = style.getFillColor();
0808:                    int red = backgroundColor & 0x000000FF;
0809:                    int green = (backgroundColor & 0x0000FF00) >> 8;
0810:                    int blue = (backgroundColor & 0x00FF0000) >> 16;
0811:                    Color currentColor = getFigure().getBackgroundColor();
0812:                    if (currentColor != null && currentColor.getRed() == red
0813:                            && currentColor.getGreen() == green
0814:                            && currentColor.getBlue() == blue) {
0815:                        return;
0816:                    }
0817:                    createdBackgroundColor = new Color(null, red, green, blue);
0818:                    getFigure().setBackgroundColor(createdBackgroundColor);
0819:                } else {
0820:                    getFigure().setBackgroundColor(
0821:                            getViewer().getControl().getBackground());
0822:                }
0823:                if (toDispose != null) {
0824:                    toDispose.dispose();
0825:                }
0826:            }
0827:
0828:            /**
0829:             * The color (created by {@link #refreshBackgroundColor()}) currently assigned to the figure.
0830:             * Whenever another color is assigned to it, it is safe to dispose the previous one.
0831:             * @generated
0832:             */
0833:            private Color createdBackgroundColor;
0834:
0835:            /**
0836:             * @generated
0837:             */
0838:            private HashMap structuralFeatures2Refresher;
0839:
0840:            /**
0841:             * @generated
0842:             */
0843:            public Refresher getRefresher(EStructuralFeature feature,
0844:                    Notification msg) {
0845:                if (structuralFeatures2Refresher == null) {
0846:                    createRefreshers();
0847:                }
0848:                return (Refresher) structuralFeatures2Refresher.get(feature);
0849:            }
0850:
0851:            /**
0852:             * @generated NOT
0853:             */
0854:            private void createRefreshers() {
0855:                structuralFeatures2Refresher = new HashMap();
0856:                Refresher childrenRefresher = new Refresher() {
0857:                    public void refresh() {
0858:                        refreshChildren();
0859:                    }
0860:                };
0861:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0862:                        .getView_PersistedChildren(), childrenRefresher);
0863:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0864:                        .getView_TransientChildren(), childrenRefresher);
0865:                Refresher boundsRefresher = new Refresher() {
0866:                    public void refresh() {
0867:                        refreshBounds();
0868:                    }
0869:                };
0870:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0871:                        .getNode_LayoutConstraint(), boundsRefresher);
0872:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0873:                        .getSize_Width(), boundsRefresher);
0874:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0875:                        .getSize_Height(), boundsRefresher);
0876:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0877:                        .getLocation_X(), boundsRefresher);
0878:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0879:                        .getLocation_Y(), boundsRefresher);
0880:                Refresher visibilityRefresher = new Refresher() {
0881:                    public void refresh() {
0882:                        refreshVisibility();
0883:                    }
0884:                };
0885:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0886:                        .getView_Visible(), visibilityRefresher);
0887:                Refresher sourceEdgesRefresher = new Refresher() {
0888:                    public void refresh() {
0889:                        refreshSourceConnections();
0890:                    }
0891:                };
0892:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0893:                        .getView_SourceEdges(), sourceEdgesRefresher);
0894:                Refresher targetEdgesRefresher = new Refresher() {
0895:                    public void refresh() {
0896:                        refreshTargetConnections();
0897:                    }
0898:                };
0899:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0900:                        .getView_TargetEdges(), targetEdgesRefresher);
0901:                Refresher fontRefresher = new Refresher() {
0902:                    public void refresh() {
0903:                        refreshFont();
0904:                    }
0905:                };
0906:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0907:                        .getFontStyle_FontHeight(), fontRefresher);
0908:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0909:                        .getFontStyle_FontName(), fontRefresher);
0910:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0911:                        .getFontStyle_Bold(), fontRefresher);
0912:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0913:                        .getFontStyle_Italic(), fontRefresher);
0914:
0915:                Refresher backgroundColorRefresher = new Refresher() {
0916:                    public void refresh() {
0917:                        refreshBackgroundColor();
0918:                    }
0919:                };
0920:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0921:                        .getFillStyle_FillColor(), backgroundColorRefresher);
0922:                Refresher foregroundColorRefresher = new Refresher() {
0923:                    public void refresh() {
0924:                        refreshForegroundColor();
0925:                    }
0926:                };
0927:                structuralFeatures2Refresher.put(NotationPackage.eINSTANCE
0928:                        .getLineStyle_LineColor(), foregroundColorRefresher);
0929:            }
0930:
0931:            /**
0932:             * @generated
0933:             */
0934:            private static class CreateMessageExchange4001StartCommand extends
0935:                    AbstractCommand {
0936:                /**
0937:                 * @generated
0938:                 */
0939:                private View source;
0940:
0941:                /**
0942:                 * @generated
0943:                 */
0944:                public CreateMessageExchange4001StartCommand(
0945:                        ComponentFlowEditorPaletteFactory.CreateConnectionRequestEx requestEx) {
0946:                    //Until the mouse button is pressed, the source of the connection is in request.getTargetEditPart(), not in request.getSourceEditPart().
0947:                    source = (View) requestEx.getTargetEditPart().getModel();
0948:                }
0949:
0950:                /**
0951:                 * @generated
0952:                 */
0953:                public void execute() {
0954:                    //This command never gets executed
0955:                }
0956:
0957:                /**
0958:                 * @generated
0959:                 */
0960:                public void undo() {
0961:                    //This command never gets executed
0962:                }
0963:
0964:                /**
0965:                 * @generated
0966:                 */
0967:                public void redo() {
0968:                    //This command never gets executed
0969:                }
0970:
0971:                /**
0972:                 * @generated
0973:                 */
0974:                public boolean canUndo() {
0975:                    return true;
0976:                }
0977:
0978:                /**
0979:                 * @generated
0980:                 */
0981:                protected boolean prepare() {
0982:                    if (source == null) {
0983:                        return false;
0984:                    }
0985:                    ComponentFlowEditorDocument container = (ComponentFlowEditorDocument) getRelationshipContainer(
0986:                            source.getElement(), componentflowPackage.eINSTANCE
0987:                                    .getComponentFlowEditorDocument());
0988:                    if (container == null) {
0989:                        return false;
0990:                    }
0991:
0992:                    return true;
0993:                }
0994:
0995:                /**
0996:                 * Finds container element for the new relationship of the specified type.
0997:                 * Default implementation goes up by containment hierarchy starting from
0998:                 * the specified element and returns the first element that is instance of
0999:                 * the specified container class.
1000:                 * 
1001:                 * @generated
1002:                 */
1003:                protected EObject getRelationshipContainer(EObject element,
1004:                        EClass containerClass) {
1005:                    for (; element != null; element = element.eContainer()) {
1006:                        if (containerClass.isSuperTypeOf(element.eClass())) {
1007:                            return element;
1008:                        }
1009:                    }
1010:                    return null;
1011:                }
1012:
1013:            }
1014:
1015:            /**
1016:             * @generated
1017:             */
1018:            private static class CreateMessageExchange4001Command extends
1019:                    AbstractCommand {
1020:                /**
1021:                 * @generated
1022:                 */
1023:                private final View source;
1024:
1025:                /**
1026:                 * @generated
1027:                 */
1028:                private final View target;
1029:
1030:                /**
1031:                 * @generated
1032:                 */
1033:                private final Edge createdEdge;
1034:
1035:                /**
1036:                 * @generated
1037:                 */
1038:                private final org.eclipse.emf.common.command.Command domainModelAddCommand;
1039:
1040:                /**
1041:                 * @generated
1042:                 */
1043:                public CreateMessageExchange4001Command(
1044:                        ComponentFlowEditorPaletteFactory.CreateConnectionRequestEx requestEx) {
1045:                    if (requestEx.getSourceEditPart().getModel() instanceof  View) {
1046:                        source = (View) requestEx.getSourceEditPart()
1047:                                .getModel();
1048:                    } else {
1049:                        source = null;
1050:                    }
1051:                    if (requestEx.getTargetEditPart().getModel() instanceof  View) {
1052:                        target = (View) requestEx.getTargetEditPart()
1053:                                .getModel();
1054:                    } else {
1055:                        target = null;
1056:                    }
1057:                    if (source == null || target == null) {
1058:                        createdEdge = null;
1059:                        domainModelAddCommand = org.eclipse.emf.common.command.UnexecutableCommand.INSTANCE;
1060:                        return;
1061:                    }
1062:                    createdEdge = NotationFactory.eINSTANCE.createEdge();
1063:                    MessageExchange createdDomainElement = componentflowFactory.eINSTANCE
1064:                            .createMessageExchange();
1065:                    createdEdge.setElement(createdDomainElement);
1066:
1067:                    DomainElementInitializer.MessageExchange_4001
1068:                            .initializeElement(createdDomainElement);
1069:                    MessageExchangeViewFactory.decorateView(createdEdge);
1070:                    TransactionalEditingDomain domainModelEditDomain = TransactionUtil
1071:                            .getEditingDomain(source.getDiagram().getElement());
1072:                    org.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();
1073:                    EObject container = getRelationshipContainer(source
1074:                            .getElement(), componentflowPackage.eINSTANCE
1075:                            .getComponentFlowEditorDocument());
1076:                    if (container == null) {
1077:                        domainModelAddCommand = null;
1078:                        return;
1079:                    }
1080:                    addLinkEndsCommand
1081:                            .append(AddCommand
1082:                                    .create(
1083:                                            domainModelEditDomain,
1084:                                            container,
1085:                                            componentflowPackage.eINSTANCE
1086:                                                    .getComponentFlowEditorDocument_MessageExchanges(),
1087:                                            createdDomainElement));
1088:
1089:                    if (createdDomainElement.getSourceElement() != null) {
1090:                        domainModelAddCommand = null;
1091:                        return;
1092:                    }
1093:                    addLinkEndsCommand.append(SetCommand.create(
1094:                            domainModelEditDomain, createdDomainElement,
1095:                            componentflowPackage.eINSTANCE
1096:                                    .getMessageExchange_SourceElement(), source
1097:                                    .getElement()));
1098:
1099:                    if (createdDomainElement.getTargetElement() != null) {
1100:                        domainModelAddCommand = null;
1101:                        return;
1102:                    }
1103:                    addLinkEndsCommand.append(SetCommand.create(
1104:                            domainModelEditDomain, createdDomainElement,
1105:                            componentflowPackage.eINSTANCE
1106:                                    .getMessageExchange_TargetElement(), target
1107:                                    .getElement()));
1108:                    domainModelAddCommand = addLinkEndsCommand;
1109:                }
1110:
1111:                /**
1112:                 * Finds container element for the new relationship of the specified type.
1113:                 * Default implementation goes up by containment hierarchy starting from
1114:                 * the specified element and returns the first element that is instance of
1115:                 * the specified container class.
1116:                 * 
1117:                 * @generated
1118:                 */
1119:                protected EObject getRelationshipContainer(EObject element,
1120:                        EClass containerClass) {
1121:                    for (; element != null; element = element.eContainer()) {
1122:                        if (containerClass.isSuperTypeOf(element.eClass())) {
1123:                            return element;
1124:                        }
1125:                    }
1126:                    return null;
1127:                }
1128:
1129:                /**
1130:                 * @generated
1131:                 */
1132:                public boolean canExecute() {
1133:                    if (source == null || target == null || createdEdge == null
1134:                            || domainModelAddCommand == null
1135:                            || !domainModelAddCommand.canExecute()) {
1136:                        return false;
1137:                    }
1138:
1139:                    return true;
1140:                }
1141:
1142:                /**
1143:                 * @generated
1144:                 */
1145:                public boolean canUndo() {
1146:                    return source != null && target != null
1147:                            && createdEdge != null
1148:                            && domainModelAddCommand != null
1149:                            && domainModelAddCommand.canUndo();
1150:                }
1151:
1152:                /**
1153:                 * @generated
1154:                 */
1155:                public void execute() {
1156:                    domainModelAddCommand.execute();
1157:                    source.getDiagram().insertEdge(createdEdge);
1158:                    createdEdge.setSource(source);
1159:                    createdEdge.setTarget(target);
1160:                }
1161:
1162:                /**
1163:                 * @generated
1164:                 */
1165:                public void undo() {
1166:                    domainModelAddCommand.undo();
1167:                    source.getDiagram().removeEdge(createdEdge);
1168:                    createdEdge.setSource(null);
1169:                    createdEdge.setTarget(null);
1170:                }
1171:
1172:                /**
1173:                 * @generated
1174:                 */
1175:                public void redo() {
1176:                    execute();
1177:                }
1178:            }
1179:
1180:            /**
1181:             * @generated
1182:             */
1183:            public class SEFigure extends org.eclipse.draw2d.RectangleFigure {
1184:
1185:                /**
1186:                 * @generated
1187:                 */
1188:                public SEFigure() {
1189:
1190:                    this 
1191:                            .setBackgroundColor(org.eclipse.draw2d.ColorConstants.orange
1192:
1193:                            );
1194:                    this .setPreferredSize(getMapMode().DPtoLP(80), getMapMode()
1195:                            .DPtoLP(50));
1196:                    createContents();
1197:                }
1198:
1199:                /**
1200:                 * @generated NOT
1201:                 */
1202:                private void createContents() {
1203:                    /*org.eclipse.draw2d.Label fig_0 = new org.eclipse.draw2d.Label();
1204:                     fig_0.setText("<...>");
1205:
1206:                     setFigureSENameFigure(fig_0);
1207:
1208:                     Object layData0 = null;
1209:
1210:                     this.add(fig_0, layData0);*/
1211:                }
1212:
1213:                /**
1214:                 * @generated
1215:                 */
1216:                private org.eclipse.draw2d.Label fSENameFigure;
1217:
1218:                /**
1219:                 * @generated
1220:                 */
1221:                public org.eclipse.draw2d.Label getFigureSENameFigure() {
1222:                    return fSENameFigure;
1223:                }
1224:
1225:                /**
1226:                 * @generated
1227:                 */
1228:                private void setFigureSENameFigure(org.eclipse.draw2d.Label fig) {
1229:                    fSENameFigure = fig;
1230:                }
1231:
1232:                /**
1233:                 * @generated
1234:                 */
1235:                private boolean myUseLocalCoordinates = false;
1236:
1237:                /**
1238:                 * @generated
1239:                 */
1240:                protected boolean useLocalCoordinates() {
1241:                    return myUseLocalCoordinates;
1242:                }
1243:
1244:                /**
1245:                 * @generated
1246:                 */
1247:                protected void setUseLocalCoordinates(
1248:                        boolean useLocalCoordinates) {
1249:                    myUseLocalCoordinates = useLocalCoordinates;
1250:                }
1251:
1252:            }
1253:
1254:            /**
1255:             * @generated
1256:             */
1257:            private static class MapModeWorkaround {
1258:                /**
1259:                 * @generated
1260:                 */
1261:                public int DPtoLP(int dp) {
1262:                    return dp;
1263:                }
1264:
1265:                /**
1266:                 * @generated
1267:                 */
1268:                public static MapModeWorkaround INSTANCE = new MapModeWorkaround();
1269:            }
1270:
1271:            /**
1272:             * @generated
1273:             */
1274:            private MapModeWorkaround getMapMode() {
1275:                return MapModeWorkaround.INSTANCE;
1276:            }
1277:        }
ww___w__.__j___av_a__2__s___.c_om | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.