EMMA Coverage Report (generated Sat Oct 08 11:41:37 CEST 2011)
[all classes][net.sf.jomic.ui]

COVERAGE SUMMARY FOR SOURCE FILE [JomicApplication.java]

nameclass, %method, %block, %line, %
JomicApplication.java75%  (3/4)50%  (21/42)39%  (415/1075)41%  (111.3/274)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class JomicApplication100% (1/1)47%  (18/38)38%  (394/1045)39%  (103.3/263)
getLastActiveWindow (): JomicFrame 0%   (0/1)0%   (0/35)0%   (0/6)
open (JomicFrame, File): void 0%   (0/1)0%   (0/54)0%   (0/20)
openInNewWindow (): void 0%   (0/1)0%   (0/5)0%   (0/2)
performAbout (): void 0%   (0/1)0%   (0/16)0%   (0/5)
performApplicationEvent (ApplicationEvent): void 0%   (0/1)0%   (0/27)0%   (0/7)
performConvert (): void 0%   (0/1)0%   (0/34)0%   (0/8)
performCreate (): void 0%   (0/1)0%   (0/48)0%   (0/12)
performHelp (): void 0%   (0/1)0%   (0/9)0%   (0/4)
performOpenRecent (ActionEvent): void 0%   (0/1)0%   (0/8)0%   (0/3)
performSystemInfo (): void 0%   (0/1)0%   (0/21)0%   (0/6)
performToggleAdjustArchiveSuffix (): void 0%   (0/1)0%   (0/13)0%   (0/3)
performToggleFullScreen (): void 0%   (0/1)0%   (0/21)0%   (0/7)
performToggleOpenInFullScreen (): void 0%   (0/1)0%   (0/13)0%   (0/3)
prepareChangeBlurSettings (): void 0%   (0/1)0%   (0/16)0%   (0/4)
prepareConvertDialog (): void 0%   (0/1)0%   (0/18)0%   (0/5)
prepareCreateComicDialog (): void 0%   (0/1)0%   (0/18)0%   (0/5)
showError (String, Object, Throwable): void 0%   (0/1)0%   (0/8)0%   (0/2)
showInternalCommandErrorMessage (String, Throwable): void 0%   (0/1)0%   (0/6)0%   (0/2)
windowDeiconified (WindowEvent): void 0%   (0/1)0%   (0/1)0%   (0/1)
windowIconified (WindowEvent): void 0%   (0/1)0%   (0/1)0%   (0/1)
actionPerformed (ActionEvent): void 100% (1/1)21%  (41/193)24%  (12/49)
setUpFramelessMenuBar (): void 100% (1/1)50%  (12/24)62%  (5/8)
removeOpenWindow (Component): void 100% (1/1)51%  (28/55)67%  (5.4/8)
quit (): void 100% (1/1)59%  (27/46)75%  (9/12)
addOpenWindow (JomicFrame): void 100% (1/1)66%  (25/38)82%  (4.9/6)
openInNewWindow (File): void 100% (1/1)69%  (9/13)83%  (2.5/3)
windowActivated (WindowEvent): void 100% (1/1)72%  (23/32)90%  (6.3/7)
prepareOpenDialog (): void 100% (1/1)77%  (44/57)79%  (11/14)
createJomicFrame (): JomicFrame 100% (1/1)77%  (41/53)88%  (11.4/13)
<static initializer> 100% (1/1)80%  (12/15)80%  (0.8/1)
windowClosing (WindowEvent): void 100% (1/1)85%  (50/59)94%  (11.3/12)
JomicApplication (): void 100% (1/1)90%  (46/51)99%  (12.9/13)
ifAllWindowsClosedThenQuit (): void 100% (1/1)95%  (19/20)98%  (3.9/4)
getChangeBlurSettingsAction (): Action 100% (1/1)100% (6/6)100% (1/1)
instance (): JomicApplication 100% (1/1)100% (8/8)100% (3/3)
windowClosed (WindowEvent): void 100% (1/1)100% (1/1)100% (1/1)
windowDeactivated (WindowEvent): void 100% (1/1)100% (1/1)100% (1/1)
windowOpened (WindowEvent): void 100% (1/1)100% (1/1)100% (1/1)
     
class JomicApplication$10%   (0/1)100% (0/0)100% (0/0)100% (0/0)
     
class JomicApplication$ChangeBlurSettingsAction100% (1/1)50%  (1/2)55%  (11/20)50%  (3/6)
actionPerformed (ActionEvent): void 0%   (0/1)0%   (0/9)0%   (0/3)
JomicApplication$ChangeBlurSettingsAction (JomicApplication): void 100% (1/1)100% (11/11)100% (3/3)
     
class JomicApplication$QuitRunner100% (1/1)100% (2/2)100% (10/10)100% (5/5)
JomicApplication$QuitRunner (JomicApplication): void 100% (1/1)100% (6/6)100% (3/3)
run (): void 100% (1/1)100% (4/4)100% (2/2)

1// Jomic - a viewer for comic book archives.
2// Copyright (C) 2004-2011 Thomas Aglassinger
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program.  If not, see <http://www.gnu.org/licenses/>.
16package net.sf.jomic.ui;
17 
18import java.awt.Component;
19import java.awt.event.ActionEvent;
20import java.awt.event.ActionListener;
21import java.awt.event.WindowEvent;
22import java.awt.event.WindowListener;
23import java.io.File;
24import java.io.IOException;
25import java.util.LinkedList;
26import java.util.List;
27 
28import javax.help.HelpBroker;
29import javax.swing.AbstractAction;
30import javax.swing.Action;
31import javax.swing.JFileChooser;
32import javax.swing.SwingUtilities;
33import javax.swing.WindowConstants;
34 
35import net.roydesign.event.ApplicationEvent;
36import net.roydesign.mac.MRJAdapter;
37import net.sf.jomic.comic.ComicCache;
38import net.sf.jomic.comic.ComicChooserFileFilter;
39import net.sf.jomic.comic.ComicFileFilter;
40import net.sf.jomic.common.JomicHelpTools;
41import net.sf.jomic.common.JomicStartup;
42import net.sf.jomic.common.JomicTools;
43import net.sf.jomic.common.PropertyConstants;
44import net.sf.jomic.common.Settings;
45import net.sf.jomic.tools.LocaleTools;
46import net.sf.jomic.tools.StringTools;
47import net.sf.jomic.tools.UiTools;
48 
49import org.apache.commons.logging.Log;
50import org.apache.commons.logging.LogFactory;
51 
52/**
53 *  Jomic application that manages all open comics and processes comic independent commands like
54 *  "about", "help", or "quit".
55 *
56 * @author    Thomas Aglassinger
57 */
58public final class JomicApplication implements ActionListener, WindowListener
59{
60    private static JomicApplication instance;
61 
62    private AboutFrame aboutFrame;
63    private ChangeBlurSettingsDialog changeBlurSettingsDialog;
64    private ComicFileFilter comicFileFilter;
65    private ComicChooserFileFilter comicFilter;
66    private ConvertDialog convertDialog;
67    private CreateComicDialog createComicDialog;
68    private FramelessJomicMenuBar framelessMenuBar;
69    private Runnable fullScreenViewerRunner;
70    private boolean hasFramelessMenuBar;
71    private JomicStartup jomicStartup;
72    private JomicTools jomicTools;
73    private LocaleTools localeTools;
74    private Log logger;
75    private JFileChooser openComicChooser;
76    private List openComicWindows;
77    private Settings settings;
78    private StringTools stringTools;
79    private SystemInfoFrame systemInfoFrame;
80    private UiTools uiTools;
81 
82    private JomicApplication() {
83        logger = LogFactory.getLog(JomicApplication.class);
84        jomicTools = JomicTools.instance();
85        localeTools = LocaleTools.instance();
86        stringTools = StringTools.instance();
87        uiTools = UiTools.instance();
88        jomicStartup = JomicStartup.instance();
89        settings = Settings.instance();
90        openComicWindows = new LinkedList();
91        comicFileFilter = new ComicFileFilter();
92        comicFilter = new ComicChooserFileFilter();
93 
94        jomicTools.setFullScreenCancelabel(FullScreenViewer.instance());
95    }
96 
97    public void setUpFramelessMenuBar() {
98        // Under Mac OS X, the following lines create a hidden frame with a
99        // menu bar where most items are disabled. This keeps Jomic running
100        // even when no comic is open. (Don't ask. This is a Mac OS UI
101        // convention.)
102        if (MRJAdapter.isSwingUsingScreenMenuBar()) {
103            String showMenuBarName =
104                    PropertyConstants.SYSTEM_PROPERTY_PREFIX + PropertyConstants.SHOW_FRAMELESS_MENU_BAR;
105 
106            hasFramelessMenuBar = Boolean.getBoolean(showMenuBarName);
107            if (hasFramelessMenuBar) {
108                framelessMenuBar = new FramelessJomicMenuBar();
109                framelessMenuBar.addActionListener(this);
110                MRJAdapter.setFramelessJMenuBar(framelessMenuBar);
111            }
112        }
113    }
114 
115    public Action getChangeBlurSettingsAction() {
116        return new ChangeBlurSettingsAction();
117    }
118 
119    private JomicFrame getLastActiveWindow() {
120        JomicFrame result;
121 
122        synchronized (openComicWindows) {
123            int lastActiveWindowIndex = openComicWindows.size() - 1;
124 
125            assert lastActiveWindowIndex >= 0;
126            result = (JomicFrame) openComicWindows.get(lastActiveWindowIndex);
127        }
128        return result;
129    }
130 
131    public static synchronized JomicApplication instance() {
132        if (instance == null) {
133            instance = new JomicApplication();
134        }
135        return instance;
136    }
137 
138    public void actionPerformed(ActionEvent event) {
139        ApplicationEvent appEvent = null;
140        String command = null;
141 
142        // Find out if we received an Mac OS ApplicationEvent or just a
143        // "normal" command.
144        if (event instanceof ApplicationEvent) {
145            appEvent = (ApplicationEvent) event;
146            if (logger.isInfoEnabled()) {
147                logger.info("handle application event: " + appEvent);
148            }
149        } else {
150            command = event.getActionCommand();
151            if (logger.isInfoEnabled()) {
152                logger.info("handle command: " + command);
153            }
154        }
155 
156        try {
157            if (appEvent != null) {
158                performApplicationEvent(appEvent);
159            } else if (command.equals(Commands.ABOUT)) {
160                performAbout();
161            } else if (command.equals(Commands.CLEAR_RECENT)) {
162                settings.clearRecentFiles();
163            } else if (command.equals(Commands.CONVERT)) {
164                performConvert();
165            } else if (command.equals(Commands.NEW_COMIC)) {
166                performCreate();
167            } else if (command.equals(Commands.FULL_SCREEN)) {
168                performToggleFullScreen();
169            } else if (command.equals(Commands.HELP)) {
170                performHelp();
171            } else if (command.equals(Commands.OPEN)) {
172                synchronized (openComicWindows) {
173                    int lastWindowIndex = openComicWindows.size();
174                    JomicFrame mostRecentlyActivatedWindow;
175 
176                    if (lastWindowIndex == 0) {
177                        mostRecentlyActivatedWindow = null;
178                    } else {
179                        mostRecentlyActivatedWindow = (JomicFrame) openComicWindows.get(lastWindowIndex - 1);
180                    }
181                    open(mostRecentlyActivatedWindow, null);
182                }
183            } else if (command.equals(Commands.OPEN_IN_NEW_WINDOW)) {
184                openInNewWindow();
185            } else if (command.equals(Commands.OPEN_RECENT)) {
186                performOpenRecent(event);
187            } else if (command.equals(Commands.QUIT)) {
188                quit();
189            } else if (command.equals(Commands.SYSTEM_INFO)) {
190                performSystemInfo();
191            } else if (command.equals(Commands.TOGGLE_ADJUST_ARCHIVE_SUFFIX)) {
192                performToggleAdjustArchiveSuffix();
193            } else if (command.equals(Commands.TOGGLE_OPEN_IN_FULL_SCREEN)) {
194                performToggleOpenInFullScreen();
195            } else {
196                String message = localeTools.getMessage("errors.cannotProcessUnknownCommand", command);
197 
198                throw new IllegalArgumentException(message);
199            }
200        } catch (Throwable error) {
201            showInternalCommandErrorMessage(command, error);
202        }
203    }
204 
205    /**
206     *  <p>
207     *
208     *  Open in window <code>jomicFrameToOpenIn</code> the comic <code>comicToOpen</code>.</p> If
209     *  <code>jomicFrameToOpenIn</code> is <code>null</code>, open a new window first. If <code>comicToOpen</code>
210     *  is <code>null</code>, let the user choose one.
211     */
212    public void open(JomicFrame jomicFrameToOpenIn, File comicToOpen) {
213        JomicFrame jomicFrame;
214        boolean useNewFrame = jomicFrameToOpenIn == null;
215 
216        if (useNewFrame) {
217            jomicFrame = createJomicFrame();
218        } else {
219            jomicFrame = jomicFrameToOpenIn;
220        }
221 
222        File comicFile = comicToOpen;
223 
224        if (comicFile == null) {
225            prepareOpenDialog();
226 
227            // Let the user select the file, and open it.
228            int selection = openComicChooser.showOpenDialog(jomicFrame);
229 
230            if (selection == JFileChooser.APPROVE_OPTION) {
231                comicFile = openComicChooser.getSelectedFile();
232            }
233        }
234 
235        if (comicFile != null) {
236            jomicFrame.open(comicFile);
237        } else if (useNewFrame) {
238            boolean frameWasVisible = jomicFrame.isVisible();
239 
240            // We just created a new window for this comic, but now do not need
241            // it because the user canceled the "Open comic" dialog.
242            if (!frameWasVisible) {
243                removeOpenWindow(jomicFrame);
244            }
245            jomicFrame.performClose();
246            if (!frameWasVisible) {
247                ifAllWindowsClosedThenQuit();
248            }
249        }
250    }
251 
252    /**
253     *  Open dialog to select comic, then open it in new window.
254     */
255    public void openInNewWindow() {
256        open(null, null);
257    }
258 
259    /**
260     *  Open comic in new window.
261     */
262    public void openInNewWindow(File comicFile) {
263        assert comicFile != null;
264        createJomicFrame().open(comicFile);
265    }
266 
267    /**
268     *  Change view of current comic to full screen.
269     */
270    public void performToggleFullScreen() {
271        FullScreenViewer fullScreen = FullScreenViewer.instance();
272        JomicFrame controller = getLastActiveWindow();
273 
274        if (fullScreen.isVisible()) {
275            fullScreen.performCancel();
276        } else {
277            fullScreenViewerRunner = new FullScreenViewerRunner(controller);
278 
279            SwingUtilities.invokeLater(fullScreenViewerRunner);
280        }
281    }
282 
283    /**
284     *  Cleanup, write settings and exit application.
285     *
286     * @see    JomicStartup#exit(int)
287     */
288    public void quit() {
289        ComicCache.instance().dispose();
290 
291        if (logger.isInfoEnabled()) {
292            logger.info("write settings");
293        }
294 
295        File settingsFile = settings.getSettingsFile();
296 
297        try {
298            settings.write(settingsFile);
299        } catch (IOException error) {
300            logger.warn("cannot write settings to \"" + settingsFile + "\"", error);
301        }
302        if (framelessMenuBar != null) {
303            framelessMenuBar.removeActionListener(this);
304        }
305        jomicStartup.exit(0);
306    }
307 
308    public void windowActivated(WindowEvent event) {
309        assert event != null;
310 
311        synchronized (openComicWindows) {
312            // Move window to end of list
313            JomicFrame jomicFrame = (JomicFrame) event.getWindow();
314 
315            removeOpenWindow(jomicFrame);
316            addOpenWindow(jomicFrame);
317        }
318    }
319 
320    public void windowClosed(WindowEvent event) {
321        // Do nothing.
322    }
323 
324    public void windowClosing(WindowEvent event) {
325        assert event != null;
326 
327        synchronized (openComicWindows) {
328            JomicFrame jomicFrame = (JomicFrame) event.getWindow();
329 
330            if (logger.isInfoEnabled()) {
331                logger.info("closing comic frame: " + stringTools.sourced(jomicFrame.getTitle()));
332            }
333            removeOpenWindow(jomicFrame);
334            jomicFrame.removeWindowListener(this);
335            jomicFrame.dispose();
336            settings.setComicWindow(jomicFrame);
337 
338            ifAllWindowsClosedThenQuit();
339        }
340    }
341 
342    public void windowDeactivated(WindowEvent event) {
343        // Do nothing.
344    }
345 
346    public void windowDeiconified(WindowEvent event) {
347        // Do nothing.
348    }
349 
350    public void windowIconified(WindowEvent event) {
351        // Do nothing.
352    }
353 
354    public void windowOpened(WindowEvent event) {
355        // Do nothing.
356    }
357 
358    synchronized void prepareChangeBlurSettings() {
359        if (changeBlurSettingsDialog == null) {
360            changeBlurSettingsDialog = new ChangeBlurSettingsDialog(null);
361            settings.applyComponentAreaProperty(PropertyConstants.SET_BLUR_DIALOG_WINDOW, changeBlurSettingsDialog);
362        }
363    }
364 
365    synchronized void prepareConvertDialog() {
366        if (convertDialog == null) {
367            convertDialog = new ConvertDialog();
368            convertDialog.pack();
369            settings.applyComponentAreaProperty(PropertyConstants.CONVERT_DIALOG_WINDOW, convertDialog);
370        }
371    }
372 
373    synchronized void prepareCreateComicDialog() {
374        if (createComicDialog == null) {
375            createComicDialog = new CreateComicDialog();
376            createComicDialog.pack();
377            settings.applyComponentAreaProperty(PropertyConstants.NEW_COMIC_DIALOG_WINDOW, createComicDialog);
378        }
379    }
380 
381    /**
382     *  Prepare <code>openComicChooser</code> by possibly creating it first, and setting the
383     *  selected file name to the most recently opened file.
384     */
385    void prepareOpenDialog() {
386        // Create the dialog if necessary.
387        if (openComicChooser == null) {
388            String title = localeTools.getMessage("dialogs.open.title");
389            OpenComicFileChooserAccessory accessory = new OpenComicFileChooserAccessory();
390 
391            openComicChooser = new SnapableJFileChooser(settings, PropertyConstants.OPEN_DIALOG_WINDOW);
392            openComicChooser.setDialogTitle(title);
393            openComicChooser.setFileFilter(comicFilter);
394            openComicChooser.setAccessory(accessory);
395            openComicChooser.addPropertyChangeListener(accessory);
396        }
397 
398        // Set the selected file to the most recent one.
399        File mostRecentFile = settings.getMostRecentFile();
400 
401        if (mostRecentFile != null) {
402            String mostRecentName = mostRecentFile.getName();
403 
404            if (comicFileFilter.accept(null, mostRecentName)) {
405                openComicChooser.setSelectedFile(mostRecentFile);
406            }
407        }
408    }
409 
410    private void addOpenWindow(JomicFrame openWindow) {
411        synchronized (openComicWindows) {
412            assert openWindow != null;
413            assert !openComicWindows.contains(openWindow);
414            openComicWindows.add(openWindow);
415        }
416    }
417 
418    private JomicFrame createJomicFrame() {
419        JomicFrame result;
420 
421        synchronized (openComicWindows) {
422            if (openComicWindows.size() > 0) {
423                result = (JomicFrame) openComicWindows.get(0);
424            } else {
425                result = new JomicFrame();
426                result.addWindowListener(this);
427                result.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
428                result.pack();
429                settings.applyComicWindow(result);
430                if (logger.isInfoEnabled()) {
431                    logger.info("create new comic window");
432                }
433                addOpenWindow(result);
434            }
435        }
436        return result;
437    }
438 
439    private void ifAllWindowsClosedThenQuit() {
440        // If this was the last window, then quit (unless we are running
441        // under Mac OS and using a frameless menu).
442        boolean allWindowsClosed = (openComicWindows.size() == 0);
443 
444        if (allWindowsClosed && !hasFramelessMenuBar) {
445            SwingUtilities.invokeLater(new QuitRunner());
446        }
447    }
448 
449    private synchronized void performAbout() {
450        if (aboutFrame == null) {
451            aboutFrame = new AboutFrame();
452            aboutFrame.pack();
453        }
454        aboutFrame.setVisible(true);
455    }
456 
457    /**
458     *  Process Mac OS application event.
459     */
460    private void performApplicationEvent(ApplicationEvent appEvent) {
461        int type = appEvent.getType();
462 
463        if (type == ApplicationEvent.ABOUT) {
464            performAbout();
465        } else if (type == ApplicationEvent.QUIT_APPLICATION) {
466            quit();
467        } else {
468            logger.warn("ignoring unknown application event: " + appEvent);
469        }
470    }
471 
472    private void performConvert() {
473        prepareConvertDialog();
474        convertDialog.setVisible(true);
475        settings.setComponentAreaProperty(PropertyConstants.CONVERT_DIALOG_WINDOW, convertDialog);
476 
477        int selection = convertDialog.getSelection();
478 
479        if (selection == JFileChooser.APPROVE_OPTION) {
480            ConvertWorker convertWorker = new ConvertWorker(
481                    convertDialog.getTargetDir(),
482                    convertDialog.getSelectedFiles(),
483                    convertDialog.getConversion());
484 
485            convertWorker.start();
486        }
487    }
488 
489    private void performCreate() {
490        prepareCreateComicDialog();
491        createComicDialog.setVisible(true);
492        settings.setComponentAreaProperty(PropertyConstants.NEW_COMIC_DIALOG_WINDOW, createComicDialog);
493 
494        int selection = createComicDialog.getSelection();
495 
496        if (selection == JFileChooser.APPROVE_OPTION) {
497            File targetDir = createComicDialog.getTargetDir();
498            File sourceDir = createComicDialog.getSourceDir();
499            boolean isCreateComicForEachFolder = createComicDialog.isCreateComicForEachFolder();
500            boolean isOpenAfterwards = createComicDialog.isOpenAfterwards();
501            CreateComicWorker createComicWorker = new CreateComicWorker(sourceDir, targetDir,
502                    createComicDialog.getConversion(), isCreateComicForEachFolder, isOpenAfterwards);
503 
504            createComicWorker.start();
505        }
506    }
507 
508    private void performHelp() {
509        JomicHelpTools helpTools = JomicHelpTools.instance();
510        HelpBroker helpBroker = helpTools.getHelpBroker();
511 
512        helpBroker.setDisplayed(true);
513    }
514 
515    private void performOpenRecent(ActionEvent event) {
516        OpenRecentFileEvent orfEvent = (OpenRecentFileEvent) event;
517 
518        openInNewWindow(orfEvent.getFile());
519    }
520 
521    private synchronized void performSystemInfo() {
522        if (systemInfoFrame == null) {
523            systemInfoFrame = new SystemInfoFrame();
524            systemInfoFrame.pack();
525            uiTools.centerUp(systemInfoFrame);
526        }
527        systemInfoFrame.setVisible(true);
528    }
529 
530 
531    private void performToggleAdjustArchiveSuffix() {
532        boolean newValue = !settings.getAdjustArchiveSuffix();
533 
534        settings.setAdjustArchiveSuffix(newValue);
535    }
536 
537    private void performToggleOpenInFullScreen() {
538        boolean newValue = !settings.getOpenInFullScreen();
539 
540        settings.setOpenInFullScreen(newValue);
541    }
542 
543    private void removeOpenWindow(Component frame) {
544        synchronized (openComicWindows) {
545            assert frame != null : "frame to remove must not be null";
546            assert openComicWindows.contains(frame) || MRJAdapter.isSwingUsingScreenMenuBar() :
547                    "frame must be open: " + frame;
548            openComicWindows.remove(frame);
549            if (hasFramelessMenuBar) {
550                framelessMenuBar.updateFileOpenRecent();
551            }
552        }
553    }
554 
555    private void showError(String key, Object option, Throwable error) {
556        jomicTools.showError(null, key, option, error);
557    }
558 
559    private void showInternalCommandErrorMessage(String command, Throwable error) {
560        showError("errors.cannotProcessInternalCommand", command, error);
561    }
562 
563    /**
564     *  Action to open ChangeBlurSettingsDialog.
565     *
566     * @see       ChangeBlurSettingsDialog
567     * @author    Thomas Aglassinger
568     */
569    private final class ChangeBlurSettingsAction extends AbstractAction
570    {
571        private ChangeBlurSettingsAction() {
572            super(localeTools.getMenuItemLabel(LocaleTools.MENU_VIEW, "changeBlurSettings"));
573        }
574 
575        public void actionPerformed(ActionEvent event) {
576            prepareChangeBlurSettings();
577            changeBlurSettingsDialog.setVisible(true);
578        }
579    }
580 
581    /**
582     *  Runnable to quit application.
583     */
584    private final class QuitRunner implements Runnable
585    {
586        private QuitRunner() {
587            super();
588        }
589 
590        public void run() {
591            quit();
592        }
593    }
594}

[all classes][net.sf.jomic.ui]
EMMA 2.0.4217 (C) Vladimir Roubtsov