Package org.tinyuml.draw

Examples of org.tinyuml.draw.PackageElement


   * Tests the basic setter methods.
   */
  public void testBasicSetters() {
    UmlPackage pkg = UmlPackage.getInstance();
    pkg.setName("mypackage");
    PackageElement shape = new PackageElement(pkg);
    assertEquals("mypackage", shape.getLabelText());
    assertEquals(pkg, shape.getModelElement());
   
    // sets the name
    shape.setLabelText("yourpackage");
    assertEquals("yourpackage", pkg.getName());
    assertEquals("yourpackage", shape.getLabelText());
  }
View Full Code Here


   * Tests the basic setter methods.
   */
  public void testBasicSetters() {
    UmlPackage pkg = UmlPackage.getInstance();
    pkg.setName("mypackage");
    PackageElement shape = new PackageElement(pkg);
    assertEquals("mypackage", shape.getLabelText());
    assertEquals(pkg, shape.getModelElement());
   
    // sets the name
    shape.setLabelText("yourpackage");
    assertEquals("yourpackage", pkg.getName());
    assertEquals("yourpackage", shape.getLabelText());
  }
View Full Code Here

   * Tests the basic setter methods.
   */
  public void testBasicSetters() {
    UmlPackage pkg = UmlPackage.getInstance();
    pkg.setName("mypackage");
    PackageElement shape = new PackageElement(pkg);
    assertEquals("mypackage", shape.getName());
    assertEquals(pkg, shape.getModelElement());
   
    // sets the name
    shape.setName("yourpackage");
    assertEquals("yourpackage", shape.getName());
    assertEquals("yourpackage", pkg.getName());
    assertEquals("yourpackage", shape.getLabelText());
  }
View Full Code Here

   * Tests the creation of a Dependency given two Nodes.
   */
  public void testCreateDependency() {
    mockElementFactory.expects(atLeastOnce()).method("create").
      with(eq(ElementType.PACKAGE)).will(returnValue(pkg));
    PackageElement source = factory.createPackage();
    PackageElement target = factory.createPackage();
   
    mockElementFactory.expects(atLeastOnce()).method("create").
      with(eq(ElementType.DEPENDENCY)).will(returnValue(assoc));
   
    Connection conn = factory.createDependency(source, target);
View Full Code Here

   * Tests the creation of a Dependency given two Nodes.
   */
  public void testCreateDependency() {
    mockElementFactory.expects(atLeastOnce()).method("create").
      with(eq(ElementType.PACKAGE)).will(returnValue(pkg));
    PackageElement source = factory.createPackage();
    PackageElement target = factory.createPackage();
   
    mockElementFactory.expects(atLeastOnce()).method("create").
      with(eq(ElementType.DEPENDENCY)).will(returnValue(assoc));
   
    Dependency conn = (Dependency) factory.createDependency(source, target);
View Full Code Here

    NamedElement elem = elementMap.get(elementId);
    if (elem instanceof UmlClass) {
      shape = new ClassElement((UmlClass) elem);
    } else if (elem instanceof UmlPackage) {
      shape = new PackageElement((UmlPackage) elem);
    } else if (elem instanceof UmlComponent) {
      shape = new ComponentElement((UmlComponent) elem);
    }
    if (shape != null) {
      shapeMap.put(shapeId, shape);
View Full Code Here

   * {@inheritDoc}
   */
  public void mousePressed(EditorMouseEvent event) {
    UmlPackage pkg = (UmlPackage)
      modelElementFactory.create(ElementType.PACKAGE);
    PackageElement pkgElem = new PackageElement(pkg);
    pkg.setName("Package 1");
    CompositeElement parent = editor.getDiagram();
    pkgElem.setOrigin(parent.getMappedX(event.getX()), parent.getMappedY(
      event.getY()));
    CreateElementCommand createCommand = new CreateElementCommand(editor,
      editor.getDiagram(), pkgElem);
    editor.execute(createCommand);
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.draw.PackageElement

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.