Modify

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#1575 closed enhancement (fixed)

Need access to "current" relation

Reported by: email@… Owned by: framm
Priority: major Milestone:
Component: Core Version: latest
Keywords: Cc:

Description

Hi,

I'm developing a plugin that highlights the relation currently selected in the RelationListDialog and adds commands to more easily edit this relation. This plugin needs two operations that are currently not supported by JOSM:

  1. Determine the currently selected relation.
  2. Be notified whenever the selection changes.

Currently, there is no direct access to the JList of relations contained in the RelationListDialog. I am hacking around this by navigating the Swing component tree to retrieve the Jlist, but it would be good if JOSM provided "official" access to the above information.

If you feel like this would be a good addition, but don't have the time to implement it, I'd be happy to contribute a patch. Please let me know your preferred way how the API could look like.

Happy hacking,
Mike

Attachments (1)

relationListDialog.patch (2.2 KB ) - added by Michael Forster <email@…> 16 years ago.
Patch that implements the requested functionality

Download all attachments as: .zip

Change History (10)

comment:1 by anonymous, 16 years ago

What does you plugin actually wants to do with the data you request?

in reply to:  1 comment:2 by anonymous, 16 years ago

Replying to anonymous:

What does you plugin actually wants to do with the data you request?

It adds a layer that highlights the currently selected relation. For this to be possible, it needs to know which relation is currently selected.

As an alternative it could add its own list of relations to select from, but this seems like unnecessary duplication in the UI.

comment:3 by anonymous, 16 years ago

Provide a patch for JOSM please to make the stuff accessable you want to have.

comment:4 by jpstotz, 16 years ago

Don't forget that JOSM is not limited to one RelationListDialog. The user can open as many RelationListDialogs as he wants, therefore it is not as easy as it seems to determine the "relation currently selected".

in reply to:  4 ; comment:5 by Michael Forster <email@…>, 16 years ago

Replying to anonymous:

Provide a patch for JOSM please to make the stuff accessable you want to have.

Ok, I will do that.

Replying to Jan Peter Stotz <jpstotz@gmx.de>:

Don't forget that JOSM is not limited to one RelationListDialog. The
user can open as many RelationListDialogs as he wants, therefore it
is not as easy as it seems to determine the "relation currently selected".

Interesting. I have not seen this. How would I open a second RelationListDialog?

In the code I can find only one call to the RelationListDialog constructor - in the MapFrame constructor. So I cannot see how to create a second RelationListDialog. What have I missed?

Note that I am not talking about the RelationEditor class.

by Michael Forster <email@…>, 16 years ago

Attachment: relationListDialog.patch added

Patch that implements the requested functionality

comment:6 by Michael Forster <email@…>, 16 years ago

Hi,

I've added a patch that does what I need in a minimalistic way.

Would be great if you could apply it.

Thanks,
Mike

in reply to:  5 comment:7 by jpstotz, 16 years ago

Note that I am not talking about the RelationEditor class.

Right, I mixed up both dialogs in mind.

Your patch looks quite useful. I noticed that you added a public reference for the RelationEditor in MapFrame - IMHO a good step. Personally I would say that MapFrame should hold a reference for every ToggleDialog instead of creating and "forgetting" nearly all of them...

Jan

comment:8 by anonymous, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in r997.

in reply to:  8 comment:9 by Michael Forster <email@…>, 16 years ago

Replying to anonymous:

Fixed in r997.

Thanks!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain framm.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.