예제 #1
0
ArrowPointCanvas * CodLinkCanvas::brk(const QPoint & p) {
  ArrowPointCanvas * ap =
    new ArrowPointCanvas(the_canvas(), p.x(), p.y());
  
  ap->setZ(z() + 1);
  
  CodLinkCanvas * other =
    new CodLinkCanvas(the_canvas(), ap, end, 0, decenter_begin, decenter_end);

  ap->add_line(this);
  end->remove_line(this, TRUE);
  end = ap;
  
  //update_pos();
  
  ap->show();
  other->show();
  
  if (dirs && 
      ((p - beginp).manhattanLength() < (p - endp).manhattanLength())) {
    other->dirs = dirs;
    dirs = 0;
    other->dirs->set_link(other);
    other->dirs->update_pos(other->beginp, other->endp);
  }
  
  modified();
  other->modified();
  
  return ap;
}
예제 #2
0
ArrowPointCanvas * SimpleRelationCanvas::brk(const QPoint & p)
{
    ArrowPointCanvas * ap =
        new ArrowPointCanvas(the_canvas(), p.x(), p.y());

    ap->setZ(z() + 1);

    SimpleRelationCanvas * other =
        // do not give data to not call update()
        new SimpleRelationCanvas(the_canvas(), ap, end, br_begin,
                                 itstype, 0, decenter_begin, decenter_end);

    other->data = data;
    connect(data, SIGNAL(changed()), other, SLOT(modified()));
    connect(data, SIGNAL(deleted()), other, SLOT(deleted()));

    ap->add_line(this);
    end->remove_line(this, TRUE);
    end = ap;

    if ((p - beginp).manhattanLength() < (p - endp).manhattanLength()) {
        if (stereotype != 0) {
            other->stereotype = stereotype;
            stereotype = 0;
        }
    }

    ap->show();
    other->show();

    modified();		// to set/unset name, role_b and multiplicity_b
    other->modified();	// to set/unset role_a and multiplicity_a

    return ap;
}
예제 #3
0
ArrowPointCanvas * ArrowPointCanvas::read(char *& st, UmlCanvas * canvas,
                                          char * k)
{
    if (strcmp(k, "point"))
        return 0;

    int x = (int) read_double(st);

    ArrowPointCanvas * result =
            new ArrowPointCanvas(canvas, x, (int) read_double(st));

    result->show();

    return result;
}
예제 #4
0
ArrowPointCanvas * AssocContainCanvas::brk(const QPoint & p) {
  ArrowPointCanvas * ap =
    new ArrowPointCanvas(the_canvas(), p.x(), p.y());
  
  ap->setZ(z() + 1);
  
  AssocContainCanvas * other =
    new AssocContainCanvas(the_canvas(), ap, end, 0,
			   decenter_begin, decenter_end);

  ap->add_line(this);
  end->remove_line(this, TRUE);
  end = ap;
  
  //update_pos();
  
  ap->show();
  other->show();
  
  modified();
  other->modified();
  
  return ap;
}