Esempio n. 1
0
static ObjectChange*
arc_move_handle(Arc *arc, Handle *handle,
		Point *to, ConnectionPoint *cp,
		HandleMoveReason reason, ModifierKeys modifiers)
{
  ObjectChange *change;
  change = orthconn_move_handle(&arc->orth, handle, to, cp, reason, modifiers);
  arc_update_data(arc);

  return change;
}
static void
generalization_move_handle(Generalization *genlz, Handle *handle,
		       Point *to, HandleMoveReason reason, ModifierKeys modifiers)
{
  assert(genlz!=NULL);
  assert(handle!=NULL);
  assert(to!=NULL);
  
  orthconn_move_handle(&genlz->orth, handle, to, reason);
  generalization_update_data(genlz);
}
Esempio n. 3
0
static void
participation_move_handle(Participation *participation, Handle *handle,
		       Point *to, HandleMoveReason reason, ModifierKeys modifiers)
{
  assert(participation!=NULL);
  assert(handle!=NULL);
  assert(to!=NULL);
  
  orthconn_move_handle(&participation->orth, handle, to, reason);
  participation_update_data(participation);
}
Esempio n. 4
0
static ObjectChange* 
transition_move_handle(Transition*      transition,
                       Handle*          handle,
                       Point*           newpos,
                       ConnectionPoint* cp,
                       HandleMoveReason reason,
                       ModifierKeys     modifiers)
{
  ObjectChange *change = NULL;
  
  assert(transition != NULL);
  assert(handle != NULL);
  assert(newpos != NULL);
  
  switch (handle->id)
  {
    case HANDLE_MOVE_TRIGGER_TEXT:
      /* The trigger text is being moved */
      transition->trigger_text_pos = *newpos;
      break;
    
    case HANDLE_MOVE_GUARD_TEXT:
      /* The guard text is being moved */
      transition->guard_text_pos = *newpos;
      break;
    
    default:
      {
        int n = transition->orth.numpoints/2;
        Point p1, p2;
	p1.x = 0.5 * (transition->orth.points[n-1].x + transition->orth.points[n].x);
	p1.y = 0.5 * (transition->orth.points[n-1].y + transition->orth.points[n].y);
	
        /* Tell the connection that one of its handles is being moved */
        orthconn_move_handle(&transition->orth, handle, newpos, cp, reason, modifiers);
	/* with auto-routing the number of points may have changed */
	n = transition->orth.numpoints/2;
	p2.x = 0.5 * (transition->orth.points[n-1].x + transition->orth.points[n].x);
	p2.y = 0.5 * (transition->orth.points[n-1].y + transition->orth.points[n].y);
        point_sub(&p2, &p1);
	
        point_add(&transition->trigger_text_pos, &p2);
        point_add(&transition->guard_text_pos, &p2);
      }
      break;
  }
  
  /* Update ourselves to reflect the new handle position */
  uml_transition_update_data(transition);

  return change;
}
Esempio n. 5
0
static ObjectChange*
dependency_move_handle(Dependency *dep, Handle *handle,
		       Point *to, ConnectionPoint *cp,
		       HandleMoveReason reason, ModifierKeys modifiers)
{
  ObjectChange *change;
  assert(dep!=NULL);
  assert(handle!=NULL);
  assert(to!=NULL);
  
  change = orthconn_move_handle(&dep->orth, handle, to, cp, reason, modifiers);
  dependency_update_data(dep);

  return change;
}
Esempio n. 6
0
static ObjectChange*
realizes_move_handle(Realizes *realize, Handle *handle,
		     Point *to, ConnectionPoint *cp,
		     HandleMoveReason reason, ModifierKeys modifiers)
{
  ObjectChange *change;
  assert(realize!=NULL);
  assert(handle!=NULL);
  assert(to!=NULL);
  
  change = orthconn_move_handle(&realize->orth, handle, to, cp, reason, modifiers);
  realizes_update_data(realize);

  return change;
}
Esempio n. 7
0
static ObjectChange*
association_move_handle(Association *assoc, Handle *handle,
			Point *to, ConnectionPoint *cp,
			HandleMoveReason reason, ModifierKeys modifiers)
{
  ObjectChange *change;
  assert(assoc!=NULL);
  assert(handle!=NULL);
  assert(to!=NULL);
  
  change = orthconn_move_handle(&assoc->orth, handle, to, cp, reason, modifiers);
  association_update_data(assoc);

  return change;
}
Esempio n. 8
0
static ObjectChange*
participation_move_handle(Participation *participation, Handle *handle,
			  Point *to, ConnectionPoint *cp,
			  HandleMoveReason reason, ModifierKeys modifiers)
{
  ObjectChange *change;
  assert(participation!=NULL);
  assert(handle!=NULL);
  assert(to!=NULL);
  
  change = orthconn_move_handle(&participation->orth, handle, to, cp, 
				reason, modifiers);
  participation_update_data(participation);

  return change;
}
Esempio n. 9
0
static ObjectChange*
zigzagline_move_handle(Zigzagline *zigzagline, Handle *handle,
		       Point *to, ConnectionPoint *cp,
		       HandleMoveReason reason, ModifierKeys modifiers)
{
  ObjectChange *change;
  assert(zigzagline!=NULL);
  assert(handle!=NULL);
  assert(to!=NULL);

  change = orthconn_move_handle((OrthConn*)zigzagline, handle, to, cp, 
				reason, modifiers);

  zigzagline_update_data(zigzagline);

  return change;
}
Esempio n. 10
0
static ObjectChange *
compfeat_move_handle(Compfeat *compfeat, Handle *handle,
		     Point *to, ConnectionPoint *cp,
		     HandleMoveReason reason,
		     ModifierKeys modifiers)
{
  ObjectChange *change;

  assert(compfeat!=NULL);
  assert(handle!=NULL);
  assert(to!=NULL);

  if (handle->id == HANDLE_MOVE_TEXT) {
    text_set_position(compfeat->text, to);
    change = NULL;
  } else  {
    change = orthconn_move_handle(&compfeat->orth, handle, to, cp, 
				  reason, modifiers);
  }
  compfeat_update_data(compfeat);

  return change;
}