Opened 2 years ago

Last modified 10 months ago

#15296 assigned enhancement

[patch][ccla]Add shape to group at a given child position

Reported by: Richard Fairhurst Owned by: edurocher
Priority: undecided Milestone: future
Component: DojoX GFX Version: 1.7.2
Keywords: Cc: cjolif, elazutkin
Blocked by: Blocking:

Description

At present the support for reordering objects is fairly basic - moveToFront and moveToBack. It would be good to be able to insert into Groups at a given position, a la Node.insertBefore.

This could perhaps be implemented as an optional second parameter to .add - i.e. group.add(shape [,position]).

I'm a novice with Dojo but happy to have a go at working up a patch if this would be considered useful.

Attachments (2)

15296.patch (31.3 KB) - added by pruzand 19 months ago.
Possible patch (by pruzand, IBM, CCLA)
15296.2.patch (31.0 KB) - added by pruzand 14 months ago.
some code refactoring

Download all attachments as: .zip

Change History (12)

comment:1 Changed 2 years ago by pruzand

  • Owner changed from elazutkin to pruzand
  • Status changed from new to assigned

comment:2 Changed 20 months ago by cjolif

  • Cc cjolif added

Changed 19 months ago by pruzand

Possible patch (by pruzand, IBM, CCLA)

comment:3 Changed 19 months ago by pruzand

  • Summary changed from Add shape to group at a given child position to [patch][ccla]Add shape to group at a given child position

comment:4 Changed 19 months ago by pruzand

This patch proposes the following API:

Group.insertAfter(/*Shape*/ newShape, /*Shape*/ after)
Inserts the specified shape after the given shape in the list of children.

Group.insertBefore(/*Shape*/ newShape, /*Shape*/ before)
Inserts the specified shape before the given shape in the list of children.

Shape.moveAfter(/*Shape*/ after)
moves this shape after the specified shape in its parent's list of shapes.

Shape.moveBefore(/*Shape*/ before)
moves this shape before the specified shape in its parent's list of shapes

comment:5 Changed 19 months ago by pruzand

  • Milestone changed from tbd to 1.9

comment:6 Changed 19 months ago by pruzand

  • Cc elazutkin added

Changed 14 months ago by pruzand

some code refactoring

comment:7 Changed 14 months ago by pruzand

Add a new patch, with better code factorization. The proposed API is still the same.

comment:8 Changed 13 months ago by elazutkin

Hmm, insertBefore(shape, after)?

Nevertheless all my objections to the proposed API for the previous version of this patch still stand. Obviously I cannot force you to rewrite the patch, and we can always remove it in 2.0.

comment:9 Changed 13 months ago by pruzand

  • Milestone changed from 1.9 to future

no agreement => postponed to future

comment:10 Changed 10 months ago by edurocher

  • Owner changed from pruzand to edurocher
Note: See TracTickets for help on using tickets.