public final class ImageViewerDialog extends ToggleDialog implements LayerManager.LayerChangeListener, MainLayerManager.ActiveLayerChangeListener, ImageData.ImageDataUpdateListener
GeoImageLayer.| Modifier and Type | Class and Description |
|---|---|
private class |
ImageViewerDialog.ImageCenterViewAction |
private class |
ImageViewerDialog.ImageCollapseAction |
private class |
ImageViewerDialog.ImageCopyPathAction |
private class |
ImageViewerDialog.ImageFirstAction |
private class |
ImageViewerDialog.ImageLastAction |
private class |
ImageViewerDialog.ImageNextAction |
private class |
ImageViewerDialog.ImagePreviousAction |
private class |
ImageViewerDialog.ImageRemoveAction |
private class |
ImageViewerDialog.ImageRemoveFromDiskAction |
private class |
ImageViewerDialog.ImageZoomAction |
ToggleDialog.ButtonHidingType, ToggleDialog.TitleBar, ToggleDialog.ToggleDialogActionjavax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponentbutton, buttonHiding, detachedDialog, dialogsPanel, isCollapsed, isDocked, isShowing, name, preferenceClass, preferencePrefix, PROP_DYNAMIC_BUTTONS, titleBar, toggleAction, windowMenuItemlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Modifier | Constructor and Description |
|---|---|
private |
ImageViewerDialog() |
| Modifier and Type | Method and Description |
|---|---|
void |
activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
Called whenever the active or edit layer changed.
|
private void |
build() |
(package private) static void |
createInstance() |
private static javax.swing.JButton |
createNavigationButton(JosmAction action,
java.awt.Dimension buttonDim) |
void |
destroy()
Called when the object has been destroyed.
|
void |
displayImage(ImageData data,
ImageEntry entry)
Displays image for the given layer.
|
protected boolean |
dockWhenClosingDetachedDlg()
When an image is closed, really close it and do not pop
up the side dialog.
|
static ImageEntry |
getCurrentImage()
Returns the currently displayed image.
|
static ImageViewerDialog |
getInstance()
Replies the unique instance of this dialog
|
boolean |
hasImage()
Returns whether an image is currently displayed
|
void |
imageDataUpdated(ImageData data)
Called when the data change
|
static boolean |
isCenterView()
Returns whether the center view is currently active.
|
void |
layerAdded(LayerManager.LayerAddEvent e)
Notifies this listener that a layer has been added.
|
void |
layerOrderChanged(LayerManager.LayerOrderChangeEvent e)
Notifies this listener that the order of layers was changed.
|
void |
layerRemoving(LayerManager.LayerRemoveEvent e)
Notifies this listener that a alayer was just removed.
|
private void |
registerOnLayer(Layer layer) |
void |
selectedImageChanged(ImageData data)
Called when the selection change
|
static boolean |
setCentreEnabled(boolean value)
Enables (or disables) the "Center view" button.
|
void |
setNextEnabled(boolean value)
Enables (or disables) the "Next" button.
|
void |
setPreviousEnabled(boolean value)
Enables (or disables) the "Previous" button.
|
static void |
showImage(ImageData data,
ImageEntry entry)
Displays image for the given data.
|
private void |
showLayer(Layer newLayer) |
protected void |
stateChanged()
primitive stateChangedListener for subclasses
|
buttonHidden, buttonShown, closeDetachedDialog, collapse, createLayout, createLayout, detach, dock, eventDispatched, expand, getButton, getDefaultDetachedSize, getLastHeight, getName, getPreferencePrefix, getPreferredHeight, getToggleAction, helpTopic, hideDialog, hideNotify, isDialogInCollapsedView, isDialogInDefaultView, isDialogShowing, preferenceChanged, registerInWindowMenu, rememberHeight, setButton, setContentVisible, setDialogsPanel, setIsButtonHiding, setIsCollapsed, setIsDocked, setIsShowing, setTitle, showDialog, showNotify, toggleButtonHook, toString, unfurlDialoggetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycleprivate final ImageViewerDialog.ImageZoomAction imageZoomAction
private final ImageViewerDialog.ImageCenterViewAction imageCenterViewAction
private final ImageViewerDialog.ImageNextAction imageNextAction
private final ImageViewerDialog.ImageRemoveAction imageRemoveAction
private final ImageViewerDialog.ImageRemoveFromDiskAction imageRemoveFromDiskAction
private final ImageViewerDialog.ImagePreviousAction imagePreviousAction
private final ImageViewerDialog.ImageCollapseAction imageCollapseAction
private final ImageViewerDialog.ImageFirstAction imageFirstAction
private final ImageViewerDialog.ImageLastAction imageLastAction
private final ImageViewerDialog.ImageCopyPathAction imageCopyPathAction
private final ImageDisplay imgDisplay
private boolean centerView
private static volatile ImageViewerDialog dialog
private boolean collapseButtonClicked
private javax.swing.JButton btnLast
private javax.swing.JButton btnNext
private javax.swing.JButton btnPrevious
private javax.swing.JButton btnFirst
private javax.swing.JButton btnCollapse
private javax.swing.JButton btnDelete
private javax.swing.JButton btnCopyPath
private javax.swing.JButton btnDeleteFromDisk
private javax.swing.JToggleButton tbCentre
private transient ImageData currentData
private transient ImageEntry currentEntry
private ImageViewerDialog()
static void createInstance()
public static ImageViewerDialog getInstance()
private static javax.swing.JButton createNavigationButton(JosmAction action, java.awt.Dimension buttonDim)
private void build()
public void destroy()
Destroyabledestroy in interface Destroyabledestroy in class ToggleDialogpublic static void showImage(ImageData data, ImageEntry entry)
data - geo image dataentry - image entrypublic void setPreviousEnabled(boolean value)
value - true to enable the button, false otherwisepublic void setNextEnabled(boolean value)
value - true to enable the button, false otherwisepublic static boolean setCentreEnabled(boolean value)
value - true to enable the button, false otherwisepublic void displayImage(ImageData data, ImageEntry entry)
data - the image dataentry - image entryprotected boolean dockWhenClosingDetachedDlg()
dockWhenClosingDetachedDlg in class ToggleDialogprotected void stateChanged()
ToggleDialogstateChanged in class ToggleDialogpublic boolean hasImage()
public static ImageEntry getCurrentImage()
nullpublic static boolean isCenterView()
true if the center view is active, false otherwisepublic void layerAdded(LayerManager.LayerAddEvent e)
LayerManager.LayerChangeListenerListeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
layerAdded in interface LayerManager.LayerChangeListenere - The new added layer eventpublic void layerRemoving(LayerManager.LayerRemoveEvent e)
LayerManager.LayerChangeListener
Listeners are called in the EDT thread after the layer was removed.
Use LayerManager.LayerRemoveEvent.scheduleRemoval(Collection) to remove more layers.
You should not do blocking or long-running tasks in this method.
layerRemoving in interface LayerManager.LayerChangeListenere - The layer to be removed (as event)public void layerOrderChanged(LayerManager.LayerOrderChangeEvent e)
LayerManager.LayerChangeListenerListeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
layerOrderChanged in interface LayerManager.LayerChangeListenere - The order change event.public void activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
MainLayerManager.ActiveLayerChangeListenerYou can be sure that this layer is still contained in this set.
Listeners are called in the EDT thread and you can manipulate the layer manager in the current thread.
activeOrEditLayerChanged in interface MainLayerManager.ActiveLayerChangeListenere - The change event.private void registerOnLayer(Layer layer)
public void selectedImageChanged(ImageData data)
ImageData.ImageDataUpdateListenerselectedImageChanged in interface ImageData.ImageDataUpdateListenerdata - the image datapublic void imageDataUpdated(ImageData data)
ImageData.ImageDataUpdateListenerimageDataUpdated in interface ImageData.ImageDataUpdateListenerdata - the image data