Modify

Opened 2 years ago

Closed 2 years ago

#22536 closed defect (duplicate)

Delayed rename and improper repaint of layer name in image viewer

Reported by: skyper Owned by: team
Priority: normal Milestone:
Component: Core image mapping Version: latest
Keywords: template_report image viewer layer name Cc:

Description

What steps will reproduce the problem?

  1. Have two geotagged image layers both named Geotagged Images
  2. Open image viewer and select an image of both layers
  3. In the layer toggle dialog rename one layer to a
  4. Click on the layer name in the image viewer

What is the expected result?

  • direct adjustment of the layer name in the image viewer
  • proper repaint of layer buttons

What happens instead?

  • layer name is only adjusted after an action within the image viewer
  • if the layer name is shorten, some part of the past name is still visible below the repainted area

Please provide any additional information below. Attach a screenshot if possible.

See #21605

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2022-11-23 19:12:12 +0100 (Wed, 23 Nov 2022)
Revision:18604
Build-Date:2022-11-25 02:30:57
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18604 en) Linux Debian GNU/Linux 11 (bullseye)
Memory Usage: 322 MB / 512 MB (111 MB allocated, but free)
Java version: 17.0.4+8-Debian-1deb11u1, Debian, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Java package: openjdk-17-jre:amd64-17.0.4+8-1~deb11u1
libcommons-compress-java: libcommons-compress-java:all-1.20-1
libcommons-logging-java: libcommons-logging-java:all-1.2-2
fonts-noto: fonts-noto:all-20201225-1
VM arguments: [-Djosm.home=<josm.pref>]

Attachments (0)

Change History (2)

comment:1 by taylor.smock, 2 years ago

I've got a fix for this locally, since I'm having to rework the tabs for #21605.
It pretty much boils down to adding

        layer.addPropertyChangeListener(l -> {
            if (Layer.NAME_PROP.equals(l.getPropertyName()) && this.tabbedEntries.containsKey(layer)) {
                this.updateLayers(true);
                if (this.tabbedEntries.get(layer).contains(this.currentEntry)) {
                    this.setTitle(layer.getLabel());
                }
            } else if (Layer.VISIBLE_PROP.equals(l.getPropertyName()) && this.tabbedEntries.containsKey(layer)) {
                this.getImageTabs().filter(m -> Objects.equals(m.layer, layer)).mapToInt(this.layers::indexOfComponent)
                        .filter(i -> i >= 0).forEach(i -> this.layers.setEnabledAt(i, layer.isVisible()));
            }
        });

to the registerOnLayer method.

I'm uncertain on the layer visibility code though -- does it make sense to disable a tab if the user hid the layer?

comment:2 by skyper, 2 years ago

Resolution: duplicate
Status: newclosed

Closed as duplicate of #21605.
This was fixed with r18613.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.