Package org.eclipse.gmf.runtime.diagram.ui.editparts

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart


  public void testRoot() throws Exception {
    // initialise and load
    DiagramDocumentEditor editor = initialize();
   
    {
      ShapeNodeEditPart part = assertHasFrame(editor, "Home");
      Frame e = (Frame) part.resolveSemanticElement();
      assertFalse(e.isIsGenerated());
      assertFalse(e.isOverridden());
     
      GraphicalEditPart name = (GraphicalEditPart) part.getChildren().get(0);
     
      // check the label name
      assertEquals("Home", ((IAccessibleTextAwareEditPart) name).getLabelText());
     
      // and check that it is NOT bold
      assertIsBold(name.getFigure().getFont().getFontData(), false);
    }
   
    {
      ShapeNodeEditPart part = assertHasFrame(editor, "Overridden Frame");
      Frame e = (Frame) part.resolveSemanticElement();
      assertFalse(e.isIsGenerated());
      assertTrue(e.isOverridden());
     
      GraphicalEditPart name = (GraphicalEditPart) part.getChildren().get(0);
     
      // check the label name
      assertEquals("Overridden Frame", ((IAccessibleTextAwareEditPart) name).getLabelText());
     
      // and check that it is bold
View Full Code Here


   */
  public void testFrame() throws Exception {
    // initialise and load
    DiagramDocumentEditor editor = initialize();
   
    ShapeNodeEditPart home = assertHasFrame(editor, "Home");
    DiagramDocumentEditor frame = openDiagram(home);
   
    assertEditorFrame(frame);
   
    {
      ShapeNodeEditPart part = assertHasOperation(frame, "Normal Operation");
      ActivityOperation e = (ActivityOperation) part.resolveSemanticElement();
      assertFalse(e.isIsGenerated());
      assertFalse(e.isOverridden());
     
      GraphicalEditPart name = (GraphicalEditPart) part.getChildren().get(0);
     
      // check the label name
      assertEquals("Normal Operation", ((IAccessibleTextAwareEditPart) name).getLabelText());
     
      // and check that it is NOT bold
      assertIsBold(name.getFigure().getFont().getFontData(), false);
    }
   
    {
      ShapeNodeEditPart part = assertHasOperation(frame, "Overridden Operation");
      ActivityOperation e = (ActivityOperation) part.resolveSemanticElement();
      assertFalse(e.isIsGenerated());
      assertTrue(e.isOverridden());
     
      GraphicalEditPart name = (GraphicalEditPart) part.getChildren().get(0);
     
      // check the label name
      assertEquals("Overridden Operation", ((IAccessibleTextAwareEditPart) name).getLabelText());
     
      // and check that it is bold
View Full Code Here

   * @throws Exception
   */
  public void testDerivedProperties() throws Exception {
    initializeModelFile();

    ShapeNodeEditPart page1 = assertHasFrame(editor, "Home");
    ShapeNodeEditPart page2 = assertHasFrame(editor, "generated page");
   
    assertNotHasDerivedMarker(page1);
    assertHasDerivedMarker(page2);
   
    // open page
    editor_page = openDiagram(page1);
    assertEditorFrame(editor_page);
   
    ShapeNodeEditPart op1 = assertHasOperation(editor_page, "non-generated");
    ShapeNodeEditPart op2 = assertHasOperation(editor_page, "generated");
   
    assertNotHasDerivedMarker(op1);
    assertHasDerivedMarker(op2);
   
    // open operation
    editor_operation = openDiagram(op2);
    assertEditorOperation(editor_operation);
   
    ShapeNodeEditPart dop1 = assertHasDecisionNode(editor_operation, "non-generated");
    ShapeNodeEditPart dop2 = assertHasDecisionNode(editor_operation, "generated");
   
    assertNotHasDerivedMarker(dop1);
    assertHasDerivedMarker(dop2);

  }
View Full Code Here

    // set name
    gmf.setName(cop, "my operation");
    assertEquals(cop.getName(), "my operation");

    // find the edit part for this element
    ShapeNodeEditPart part = assertHasOperation(editor, "my operation");
    assertNotNull(part);

    // what is the content pane?
    IFigure fig = part.getContentPane();
    assertTrue("CompositeOperation should be extended: " + fig.getClass(),
        fig instanceof ExtendedActivityOperationFigure);

    ExtendedActivityOperationFigure ext = (ExtendedActivityOperationFigure) fig;
    // check to see it has the correct initial parent value
View Full Code Here

    // set name
    gmf.setName(cop, "my operation");
    assertEquals(cop.getName(), "my operation");

    // find the edit part for this element
    ShapeNodeEditPart partOp = assertHasOperation(editor, "my operation");
    assertNotNull(partOp);
    // what is the content pane?
    IFigure fig_o = partOp.getContentPane();
    assertTrue("CompositeOperation should be extended: " + fig_o.getClass(),
        fig_o instanceof ExtendedActivityOperationFigure);

    ExtendedActivityOperationFigure ext_o = (ExtendedActivityOperationFigure) fig_o;
    // check to see it has the correct initial parent value
View Full Code Here

    // set name
    gmf.setName(page, "my email");
    assertEquals(page.getName(), "my email");

    // find the edit part for this element
    ShapeNodeEditPart part = assertHasEmail(editor, "my email");
    assertNotNull(part);

    // what is the content pane?
    IFigure fig = part.getContentPane();
    assertEquals("Email should be extended.",
        "ExtendedEmailFigure",
        fig.getClass().getSimpleName());
  }
View Full Code Here

    // there should be four children
    assertEditorHasChildren(4, editor);
   
    // check the contents
    ShapeNodeEditPart page1 = assertHasFrame(editor, "page1");
    ShapeNodeEditPart page2 = assertHasFrame(editor, "page2");
    ShapeNodeEditPart store = assertHasDomainType(editor, "domainStore");
    ShapeNodeEditPart page4 = assertHasFrame(editor, "last signup user");
   
    // stop warnings
    assertNotNull(page1);
    assertNotNull(page2);
    assertNotNull(store);
View Full Code Here

   
    // there should be two children
    assertEditorHasChildren(1, editor);
   
    // check the contents
    ShapeNodeEditPart page = assertHasFrame(editor, "SignupForm");
   
    // here we could open the page/stores and see what they contain
    assertNotNull(page);
   
  }
View Full Code Here

    // there should be two children
    assertEditorHasChildren(1, editor);
   
    // check the contents
    ShapeNodeEditPart page = assertHasFrame(editor, "SignupForm");
   
    // here we could open the page/stores and see what they contain
    assertNotNull(page);

    editor_page = openDiagram(page);
View Full Code Here

   */
  public void testOpenSubdiagramsPage1() throws Exception {
    migrateModel();
   
    // open the diagram
    ShapeNodeEditPart page = assertHasFrame(editor, "page1");
    assertNotNull(page);

    editor_page = openDiagram(page);
    assertEditorFrame(editor_page);
   
View Full Code Here

TOP

Related Classes of org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart

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.