Package org.eclipse.gmf.runtime.notation

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


  private Collection getIncomingLinksByType(Collection nodes, int visualID) {
    Collection result = new ArrayList();
    String type = OntoUML.diagram.part.OntoUMLVisualIDRegistry
        .getType(visualID);
    for (Iterator it = nodes.iterator(); it.hasNext();) {
      View nextNode = (View) it.next();
      result.addAll(selectViewsByType(nextNode.getTargetEdges(), type));
    }
    return result;
  }
View Full Code Here


        else {
          if (((View) compartmentEditPart.getModel()).isVisible() == false)
            ((View) compartmentEditPart.getModel())
                .setVisible(true);
          else {
            View view = (((View) (compartmentEditPart).getModel()));
            DrawerStyle drawerStyle = (DrawerStyle) view
                .getStyle(NotationPackage.eINSTANCE
                    .getDrawerStyle());
            if (drawerStyle != null) { // to refresh the compartment when a new attribute is added.
              drawerStyle.setCollapsed(true);
              drawerStyle.setCollapsed(false);
View Full Code Here

  private Collection getChildrenByType(Collection nodes, int visualID) {
    Collection result = new ArrayList();
    String type = OntoUML.diagram.part.OntoUMLVisualIDRegistry
        .getType(visualID);
    for (Iterator it = nodes.iterator(); it.hasNext();) {
      View nextNode = (View) it.next();
      result.addAll(selectViewsByType(nextNode.getChildren(), type));
    }
    return result;
  }
View Full Code Here

   * @generated
   */
  private Collection selectViewsByType(Collection views, String type) {
    Collection result = new ArrayList();
    for (Iterator it = views.iterator(); it.hasNext();) {
      View nextView = (View) it.next();
      if (type.equals(nextView.getType()) && isOwnView(nextView)) {
        result.add(nextView);
      }
    }
    return result;
  }
View Full Code Here

  /**
   * @generated
   */
  public static String getModelID(View view) {
    View diagram = view.getDiagram();
    while (view != diagram) {
      EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
      if (annotation != null) {
        return (String) annotation.getDetails().get("modelID"); //$NON-NLS-1$
      }
      view = (View) view.eContainer();
    }
    return diagram != null ? diagram.getType() : null;
  }
View Full Code Here

    if (targetElement.eResource() instanceof XMLResource) {
      hasStructuralURI = ((XMLResource) targetElement.eResource())
          .getID(targetElement) == null;
    }

    View view = null;
    if (hasStructuralURI
        && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
      view = (View) lazyElement2ViewMap.getElement2ViewMap().get(
          targetElement);
    } else if (findElementsInDiagramByID(diagramEditPart, targetElement,
View Full Code Here

        element2ViewMap = new HashMap();
        // map possible notation elements to itself as these can't be found by view.getElement()
        for (Iterator it = elementSet.iterator(); it.hasNext();) {
          EObject element = (EObject) it.next();
          if (element instanceof View) {
            View view = (View) element;
            if (view.getDiagram() == scope.getDiagram()) {
              element2ViewMap.put(element, element); // take only those that part of our diagram
            }
          }
        }
View Full Code Here

        else {
          if (((View) compartmentEditPart.getModel()).isVisible() == false)
            ((View) compartmentEditPart.getModel())
                .setVisible(true);
          else {
            View view = (((View) (compartmentEditPart).getModel()));
            DrawerStyle drawerStyle = (DrawerStyle) view
                .getStyle(NotationPackage.eINSTANCE
                    .getDrawerStyle());
            if (drawerStyle != null) { // to refresh the compartment when a new attribute is added.
              drawerStyle.setCollapsed(true);
              drawerStyle.setCollapsed(false);
View Full Code Here

        else {
          if (((View) compartmentEditPart.getModel()).isVisible() == false)
            ((View) compartmentEditPart.getModel())
                .setVisible(true);
          else {
            View view = (((View) (compartmentEditPart).getModel()));
            DrawerStyle drawerStyle = (DrawerStyle) view
                .getStyle(NotationPackage.eINSTANCE
                    .getDrawerStyle());
            if (drawerStyle != null) { // to refresh the compartment when a new attribute is added.
              drawerStyle.setCollapsed(true);
              drawerStyle.setCollapsed(false);
View Full Code Here

   */
  protected Command getDestroyElementCommand(DestroyElementRequest req) {
    CompoundCommand cc = getDestroyEdgesCommand();
    addDestroyChildNodesCommand(cc);
    addDestroyShortcutsCommand(cc);
    View view = (View) getHost().getModel();
    if (view.getEAnnotation("Shortcut") != null) { //$NON-NLS-1$
      req.setElementToDestroy(view);
    }
    cc.add(getGEFWrapper(new DestroyElementCommand(req)));
    return cc.unwrap();
  }
View Full Code Here

TOP

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

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.