Package org.eclipse.gmf.runtime.notation

Examples of org.eclipse.gmf.runtime.notation.Shape


   * @generated
   */
  public Node createOutputConnection_3061(EObject domainElement,
      View containerView, int index, boolean persisted,
      PreferencesHint preferencesHint) {
    Shape node = NotationFactory.eINSTANCE.createShape();
    node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
    node.setType(DispelVisualIDRegistry
        .getType(OutputConnection4EditPart.VISUAL_ID));
    ViewUtil.insertChildView(containerView, node, index, persisted);
    node.setElement(domainElement);
    // initializeFromPreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
        .getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
        prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(node,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle nodeFontStyle = (FontStyle) node
        .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (nodeFontStyle != null) {
      FontData fontData = PreferenceConverter.getFontData(prefStore,
          IPreferenceConstants.PREF_DEFAULT_FONT);
      nodeFontStyle.setFontName(fontData.getName());
View Full Code Here


   * @generated
   */
  public Node createLocalVariableStatement_2001(EObject domainElement,
      View containerView, int index, boolean persisted,
      PreferencesHint preferencesHint) {
    Shape node = NotationFactory.eINSTANCE.createShape();
    node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
    node.setType(DispelVisualIDRegistry
        .getType(LocalVariableStatementEditPart.VISUAL_ID));
    ViewUtil.insertChildView(containerView, node, index, persisted);
    node.setElement(domainElement);
    stampShortcut(containerView, node);
    // initializeFromPreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
        .getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
        prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(node,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle nodeFontStyle = (FontStyle) node
        .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (nodeFontStyle != null) {
      FontData fontData = PreferenceConverter.getFontData(prefStore,
          IPreferenceConstants.PREF_DEFAULT_FONT);
      nodeFontStyle.setFontName(fontData.getName());
View Full Code Here

   * @generated
   */
  public Node createConnectionInitialization_2002(EObject domainElement,
      View containerView, int index, boolean persisted,
      PreferencesHint preferencesHint) {
    Shape node = NotationFactory.eINSTANCE.createShape();
    node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
    node.setType(DispelVisualIDRegistry
        .getType(ConnectionInitializationEditPart.VISUAL_ID));
    ViewUtil.insertChildView(containerView, node, index, persisted);
    node.setElement(domainElement);
    stampShortcut(containerView, node);
    // initializeFromPreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
        .getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
        prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(node,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle nodeFontStyle = (FontStyle) node
        .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (nodeFontStyle != null) {
      FontData fontData = PreferenceConverter.getFontData(prefStore,
          IPreferenceConstants.PREF_DEFAULT_FONT);
      nodeFontStyle.setFontName(fontData.getName());
View Full Code Here

   * @generated
   */
  public Node createDispelFunction_2003(EObject domainElement,
      View containerView, int index, boolean persisted,
      PreferencesHint preferencesHint) {
    Shape node = NotationFactory.eINSTANCE.createShape();
    {
      HintedDiagramLinkStyle diagramFacet = NotationFactory.eINSTANCE
          .createHintedDiagramLinkStyle();
      diagramFacet
          .setHint("FIXME put GenEditorGenerator.modelID value here"); //$NON-NLS-1$
      node.getStyles().add(diagramFacet);
    }
    node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
    node.setType(DispelVisualIDRegistry
        .getType(DispelFunctionEditPart.VISUAL_ID));
    ViewUtil.insertChildView(containerView, node, index, persisted);
    node.setElement(domainElement);
    stampShortcut(containerView, node);
    // initializeFromPreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
        .getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
        prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(node,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle nodeFontStyle = (FontStyle) node
        .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (nodeFontStyle != null) {
      FontData fontData = PreferenceConverter.getFontData(prefStore,
          IPreferenceConstants.PREF_DEFAULT_FONT);
      nodeFontStyle.setFontName(fontData.getName());
View Full Code Here

  /**
   * @generated
   */
  public Node createPackage_2005(EObject domainElement, View containerView,
      int index, boolean persisted, PreferencesHint preferencesHint) {
    Shape node = NotationFactory.eINSTANCE.createShape();
    node.getStyles().add(
        NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
    node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
    node.setType(DispelVisualIDRegistry.getType(Package2EditPart.VISUAL_ID));
    ViewUtil.insertChildView(containerView, node, index, persisted);
    node.setElement(domainElement);
    stampShortcut(containerView, node);
    // initializeFromPreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
        .getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
        prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(node,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle nodeFontStyle = (FontStyle) node
        .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (nodeFontStyle != null) {
      FontData fontData = PreferenceConverter.getFontData(prefStore,
          IPreferenceConstants.PREF_DEFAULT_FONT);
      nodeFontStyle.setFontName(fontData.getName());
View Full Code Here

          ILayoutNode lnode = (ILayoutNode)liter.next();
                   
          if ((lnode.getNode().getElement() instanceof ConnectionInitialization) ||
              (lnode.getNode().getElement() instanceof LocalVariableStatement)) {
           
            Shape shape = (Shape)((Node)lnode.getNode());
            DecorationNode decorationNode = (DecorationNode)shape.getChildren().get(0);
           
            if ((lnode.getNode().getElement() instanceof ConnectionInitialization) && (decorationNode.isVisible() == true)) {
             
              Node nodeCI = (Node)lnode.getNode();
             
              Edge e = (Edge)nodeCI.getSourceEdges().get(0);
              e.setVisible(false);
             
              decorationNode.setVisible(false);
             
              /*
              //RGB to Integer
              System.out.println("original shape line color:  " + shape.getLineColor());             
              FigureUtilities fu =  new FigureUtilities();
              RGB rgb = new RGB(255,255,255); // White Color (255,255,255)
              int rgbInt = fu.RGBToInteger(rgb);
              System.out.println("RGB to Integer: " + rgbInt);
              */
             
              //White Line -> RGB(255,255,255) to Integer = 16777215
              shape.setLineColor(16777215);
             
              //System.out.println("REDUCE - CI is NOT Visible");
            }

            if ((lnode.getNode().getElement() instanceof LocalVariableStatement) && (decorationNode.isVisible() == true)) {
              // 1.LocalVariableStatement
              Node nodeLVS = (Node)lnode.getNode();
              if (!nodeLVS.getChildren().isEmpty()) {
                // 2.LocalVariableStatement
                Node nodeSecondLVS = (Node)nodeLVS.getChildren().get(0);
                    //System.out.println("nodeSecondLVS: " + nodeSecondLVS.getElement());
                if ((nodeSecondLVS.getElement() instanceof LocalVariableStatement) && (!nodeSecondLVS.getChildren().isEmpty())) {
                  // 1. LocalVariable
                  Node nodeLV = (Node)nodeSecondLVS.getChildren().get(0);
                      //System.out.println("nodeLV: " + nodeLV.getElement());
                  if ((nodeLV.getElement() instanceof LocalVariable) && (nodeLV.getChildren().size() == 2)) {
                    //2. & 3. LocalVariable
                    Node nodeFirstChildLV = (Node)nodeLV.getChildren().get(0);
                    Node nodeSecondChildLV = (Node)nodeLV.getChildren().get(1);
                        //System.out.println("nodeFirstChildLV: " + nodeFirstChildLV.getElement());
                        //System.out.println("nodeSecondChildLV: " + nodeSecondChildLV.getElement());
                    if ((nodeFirstChildLV.getElement() instanceof LocalVariable) && (nodeFirstChildLV.getChildren().isEmpty()) &&
                        (nodeSecondChildLV.getElement() instanceof LocalVariable) && (nodeSecondChildLV.getChildren().isEmpty())) {
                     
                      if (!nodeLV.getSourceEdges().isEmpty()) {
                        Edge e = (Edge)nodeLV.getSourceEdges().get(0);
                        e.setVisible(false);
                      }
                     
                      if (!nodeLV.getTargetEdges().isEmpty()) {
                        Edge e = (Edge)nodeLV.getTargetEdges().get(0);
                        e.setVisible(false);
                      }
                     
                      decorationNode.setVisible(false);
                     
                      //White Line -> RGB(255,255,255) to Integer = 16777215
                      shape.setLineColor(16777215);
                     
                      //System.out.println("REDUCE - LVS is NOT Visible");
                    }
                  }
                }
              } 
            }
          }
        }
       
       
        //SET POSITION
        ListIterator li = lnodes.listIterator();
        int freeLeftPosition = DISTANCE_X;
        int freeSecondLeftPosition = DISTANCE_X;
        int freeTopPosition = DISTANCE_Y;
        boolean isFirst = true;
        while (li.hasNext()) {
          ILayoutNode lnode = (ILayoutNode)li.next();
         
          if (lnode.getNode().getElement() instanceof ExpressionStatement ) {
            Bounds bounds = (Bounds)lnode.getNode().getLayoutConstraint();
            bounds.setX(0);
            bounds.setY(0);
            lnode.getNode().setLayoutConstraint(bounds);
          }
         
          if ((lnode.getNode().getElement() instanceof ConnectionInitialization) ||
              (lnode.getNode().getElement() instanceof LocalVariableStatement)) {
            //Check of freeTopPosition
            if (freeTopPosition < lnode.getHeight()) {
              freeTopPosition = lnode.getHeight();
            }
            Shape shape = (Shape)((Node)lnode.getNode());
            DecorationNode decorationNode = (DecorationNode)shape.getChildren().get(0);
           
            if ((lnode.getNode().getElement() instanceof LocalVariableStatement) && (decorationNode.isVisible() == true)) {
              Node nodeLVS = (Node)lnode.getNode();
              Bounds bounds = (Bounds)lnode.getNode().getLayoutConstraint();
              // set X position
View Full Code Here

   * @generated
   */
  public Node createDispelFunction_2006(EObject domainElement,
      View containerView, int index, boolean persisted,
      PreferencesHint preferencesHint) {
    Shape node = NotationFactory.eINSTANCE.createShape();
    {
      HintedDiagramLinkStyle diagramFacet = NotationFactory.eINSTANCE
          .createHintedDiagramLinkStyle();
      diagramFacet
          .setHint("FIXME put GenEditorGenerator.modelID value here"); //$NON-NLS-1$
      node.getStyles().add(diagramFacet);
    }
    node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
    node.setType(DispelVisualIDRegistry
        .getType(DispelFunction2EditPart.VISUAL_ID));
    ViewUtil.insertChildView(containerView, node, index, persisted);
    node.setElement(domainElement);
    stampShortcut(containerView, node);
    // initializeFromPreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
        .getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
        prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(node,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle nodeFontStyle = (FontStyle) node
        .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (nodeFontStyle != null) {
      FontData fontData = PreferenceConverter.getFontData(prefStore,
          IPreferenceConstants.PREF_DEFAULT_FONT);
      nodeFontStyle.setFontName(fontData.getName());
View Full Code Here

   * @generated
   */
  public Node createLocalVariable_3001(EObject domainElement,
      View containerView, int index, boolean persisted,
      PreferencesHint preferencesHint) {
    Shape node = NotationFactory.eINSTANCE.createShape();
    node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
    node.setType(DispelVisualIDRegistry
        .getType(LocalVariableEditPart.VISUAL_ID));
    ViewUtil.insertChildView(containerView, node, index, persisted);
    node.setElement(domainElement);
    // initializeFromPreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
        .getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
        prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(node,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle nodeFontStyle = (FontStyle) node
        .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (nodeFontStyle != null) {
      FontData fontData = PreferenceConverter.getFontData(prefStore,
          IPreferenceConstants.PREF_DEFAULT_FONT);
      nodeFontStyle.setFontName(fontData.getName());
View Full Code Here

   * @generated
   */
  public Node createStringReference_3002(EObject domainElement,
      View containerView, int index, boolean persisted,
      PreferencesHint preferencesHint) {
    Shape node = NotationFactory.eINSTANCE.createShape();
    node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
    node.setType(DispelVisualIDRegistry
        .getType(StringReferenceEditPart.VISUAL_ID));
    ViewUtil.insertChildView(containerView, node, index, persisted);
    node.setElement(domainElement);
    // initializeFromPreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
        .getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
        prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(node,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle nodeFontStyle = (FontStyle) node
        .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (nodeFontStyle != null) {
      FontData fontData = PreferenceConverter.getFontData(prefStore,
          IPreferenceConstants.PREF_DEFAULT_FONT);
      nodeFontStyle.setFontName(fontData.getName());
View Full Code Here

   * @generated
   */
  public Node createBooleanLiteral_3003(EObject domainElement,
      View containerView, int index, boolean persisted,
      PreferencesHint preferencesHint) {
    Shape node = NotationFactory.eINSTANCE.createShape();
    node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
    node.setType(DispelVisualIDRegistry
        .getType(BooleanLiteralEditPart.VISUAL_ID));
    ViewUtil.insertChildView(containerView, node, index, persisted);
    node.setElement(domainElement);
    // initializeFromPreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
        .getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
        prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(node,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle nodeFontStyle = (FontStyle) node
        .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (nodeFontStyle != null) {
      FontData fontData = PreferenceConverter.getFontData(prefStore,
          IPreferenceConstants.PREF_DEFAULT_FONT);
      nodeFontStyle.setFontName(fontData.getName());
View Full Code Here

TOP

Related Classes of org.eclipse.gmf.runtime.notation.Shape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.