@@ -135,6 +135,10 @@ public void actionPerformed(ActionEvent e) {
135135 private final JosmAction setMaxViewportAction ;
136136
137137 private final JMenu markSeenMainMenu ;
138+ /* following three are stored to be used in the tests */
139+ private final JMenuItem mainMenuRecordItem ;
140+ @ SuppressWarnings ("UnusedVariable" ) private final JMenuItem mainMenuClearItem ;
141+ @ SuppressWarnings ("UnusedVariable" ) private final JMenuItem mainMenuSetMaxViewportItem ;
138142
139143 private static final int recordMinZoomMin = 4 ;
140144 private static final int recordMinZoomMax = 24 ;
@@ -161,12 +165,12 @@ public MarkSeenRoot() {
161165
162166 this .markSeenMainMenu = new JMenu (tr ("MarkSeen" ));
163167 this .markSeenMainMenu .setIcon (new ImageProvider ("icons/16x16/markseen" ).get ());
164- final JMenuItem mainMenuRecordItem = new JCheckBoxMenuItem (this .recordAction );
168+ this . mainMenuRecordItem = new JCheckBoxMenuItem (this .recordAction );
165169 mainMenuRecordItem .setAccelerator (this .recordAction .getShortcut ().getKeyStroke ());
166- this .recordAction .addButtonModel (mainMenuRecordItem .getModel ());
167- this .markSeenMainMenu .add (mainMenuRecordItem );
168- MainMenu .add (this .markSeenMainMenu , this .clearAction , false );
169- MainMenu .add (this .markSeenMainMenu , this .setMaxViewportAction , false );
170+ this .recordAction .addButtonModel (this . mainMenuRecordItem .getModel ());
171+ this .markSeenMainMenu .add (this . mainMenuRecordItem );
172+ this . mainMenuClearItem = MainMenu .add (this .markSeenMainMenu , this .clearAction , false );
173+ this . mainMenuSetMaxViewportItem = MainMenu .add (this .markSeenMainMenu , this .setMaxViewportAction , false );
170174 }
171175
172176 public void mapFrameInitialized (MapFrame oldFrame , MapFrame newFrame ) {
0 commit comments