Opened 6 years ago

Closed 2 years ago

#15296 closed enhancement (patchwelcome)

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

Reported by: Richard Fairhurst Owned by: Eric Durocher
Priority: undecided Milestone: 1.13
Component: DojoX GFX Version: 1.7.2
Keywords: Cc: cjolif, Eugene Lazutkin
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 Patrick Ruzand 5 years ago.
Possible patch (by pruzand, IBM, CCLA)
15296.2.patch (31.0 KB) - added by Patrick Ruzand 5 years ago.
some code refactoring

Download all attachments as: .zip

Change History (13)

comment:1 Changed 6 years ago by Patrick Ruzand

Owner: changed from Eugene Lazutkin to Patrick Ruzand
Status: newassigned

comment:2 Changed 5 years ago by cjolif

Cc: cjolif added

Changed 5 years ago by Patrick Ruzand

Attachment: 15296.patch added

Possible patch (by pruzand, IBM, CCLA)

comment:3 Changed 5 years ago by Patrick Ruzand

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

comment:4 Changed 5 years ago by Patrick Ruzand

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 5 years ago by Patrick Ruzand

Milestone: tbd1.9

comment:6 Changed 5 years ago by Patrick Ruzand

Cc: Eugene Lazutkin added

Changed 5 years ago by Patrick Ruzand

Attachment: 15296.2.patch added

some code refactoring

comment:7 Changed 5 years ago by Patrick Ruzand

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

comment:8 Changed 5 years ago by Eugene Lazutkin

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 5 years ago by Patrick Ruzand

Milestone: 1.9future

no agreement => postponed to future

comment:10 Changed 4 years ago by Eric Durocher

Owner: changed from Patrick Ruzand to Eric Durocher

comment:11 Changed 2 years ago by dylan

Milestone: future1.12
Resolution: patchwelcome
Status: assignedclosed

Given that no one has shown interest in creating a patch in the past 3+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.