Merge pull request #6248 from rcordovano/6807-MediaViewImagePanel-thread-safety

6807 Tidy up MediaViewImagePanel
This commit is contained in:
Richard Cordovano 2020-09-09 12:04:54 -04:00 committed by GitHub
commit 0c726c20b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,28 +118,11 @@ class MediaViewImagePanel extends JPanel implements MediaFileViewer.MediaViewPan
.map("."::concat) //NOI18N .map("."::concat) //NOI18N
.collect(Collectors.toList()); .collect(Collectors.toList());
private final boolean fxInited;
/* /*
* JFX * JFX components
*/ */
private final ProgressBar progressBar = new ProgressBar(); private final ProgressBar progressBar = new ProgressBar();
private final MaskerPane maskerPane = new MaskerPane(); private final MaskerPane maskerPane = new MaskerPane();
/*
* Swing
*/
private final JPopupMenu imageTaggingOptions = new JPopupMenu();
private final JMenuItem createTagMenuItem;
private final JMenuItem deleteTagMenuItem;
private final JMenuItem hideTagsMenuItem;
private final JMenuItem exportTagsMenuItem;
private final JFileChooser exportChooser;
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
/*
* JFX
*/
private Group masterGroup; private Group masterGroup;
private ImageTagsGroup tagsGroup; private ImageTagsGroup tagsGroup;
private ImageTagCreator imageTagCreator; private ImageTagCreator imageTagCreator;
@ -148,10 +131,21 @@ class MediaViewImagePanel extends JPanel implements MediaFileViewer.MediaViewPan
private Task<Image> readImageTask; private Task<Image> readImageTask;
/* /*
* Swing * Swing components
*/ */
private final JPopupMenu imageTaggingOptions = new JPopupMenu();
private final JMenuItem createTagMenuItem;
private final JMenuItem deleteTagMenuItem;
private final JMenuItem hideTagsMenuItem;
private final JMenuItem exportTagsMenuItem;
private final JFileChooser exportChooser;
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
private JFXPanel fxPanel; private JFXPanel fxPanel;
/*
* State
*/
private final boolean fxInited;
private double zoomRatio; private double zoomRatio;
private double rotation; // Can be 0, 90, 180, and 270. private double rotation; // Can be 0, 90, 180, and 270.
private boolean autoResize = true; // Auto resize when the user changes the size of the content viewer unless the user has used the zoom buttons. private boolean autoResize = true; // Auto resize when the user changes the size of the content viewer unless the user has used the zoom buttons.