Class StreetsideMainDialog
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.openstreetmap.josm.gui.dialogs.ToggleDialog
-
- org.openstreetmap.josm.plugins.streetside.gui.StreetsideMainDialog
-
- All Implemented Interfaces:
java.awt.event.AWTEventListener,java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,ICachedLoaderListener,Helpful,ShowHideButtonListener,StreetsideDataListener,PreferenceChangedListener,Destroyable
public final class StreetsideMainDialog extends ToggleDialog implements ICachedLoaderListener, StreetsideDataListener
Toggle dialog that shows an image and some buttons.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classStreetsideMainDialog.BlueActionAction class to jump to the image following the blue line.static classStreetsideMainDialog.MODEButtons mode.private static classStreetsideMainDialog.NextPictureActionAction class form the next image button.private static classStreetsideMainDialog.PauseActionprivate static classStreetsideMainDialog.PlayActionprivate static classStreetsideMainDialog.PreviousPictureActionAction class for the previous image button.private static classStreetsideMainDialog.RedActionAction class to jump to the image following the red line.private static classStreetsideMainDialog.StopAction-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.dialogs.ToggleDialog
ToggleDialog.ButtonHidingType, ToggleDialog.TitleBar, ToggleDialog.ToggleDialogAction
-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.data.cache.ICachedLoaderListener
ICachedLoaderListener.LoadResult
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBASE_TITLESideButtonblueButtonButton used to jump to the image following the blue lineprivate StreetsideAbstractImageimageprivate StreetsideCacheimageCacheprivate ImageInfoHelpPopupimageInfoHelpprivate static StreetsideMainDialoginstance(package private) static org.apache.log4j.Loggerloggerprivate static java.lang.StringMESSAGE_SEPARATORprivate SideButtonnextButtonprivate SideButtonpauseButtonprivate SideButtonplayButtonprivate SideButtonpreviousButtonSideButtonredButtonButton used to jump to the image following the red lineprivate static longserialVersionUIDprivate SideButtonstopButtonStreetsideImageDisplaystreetsideImageDisplayObject containing the shown image and that handles zoom and dragStreetsideCachethumbnailCache-
Fields inherited from class org.openstreetmap.josm.gui.dialogs.ToggleDialog
button, buttonHiding, detachedDialog, dialogsPanel, isCollapsed, isDocked, isShowing, name, preferenceClass, preferencePrefix, PROP_DYNAMIC_BUTTONS, titleBar, toggleAction, windowMenuItem
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Modifier Constructor Description privateStreetsideMainDialog()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddShortcuts()Adds the shortcuts to the buttons.voidcreateLayout(java.awt.Component data, java.util.List<SideButton> buttons)Creates the layout of the dialog.static voiddestroyInstance()Destroys the unique instance of the class.private voiddisableAllButtons()Disables all the buttons in the dialogStreetsideAbstractImagegetImage()Returns theStreetsideAbstractImageobject which is being shown.static StreetsideMainDialoggetInstance()Returns the unique instance of the class.StreetsideImageDisplaygetStreetsideImageDisplay()static booleanhasInstance()voidimagesAdded()Fired when any image is added to the database.voidloadingFinished(CacheEntry data, CacheEntryAttributes attributes, ICachedLoaderListener.LoadResult result)When the pictures are returned from the cache, they are set in theStreetsideImageDisplayobject.voidselectedImageChanged(StreetsideAbstractImage oldImage, StreetsideAbstractImage newImage)Fired when the selected image is changed by something different from manually clicking on the icon.voidsetImage(StreetsideAbstractImage image)Sets a new StreetsideImage to be shown.voidsetImageInfoHelp(ImageInfoHelpPopup popup)voidsetMode(StreetsideMainDialog.MODE mode)Sets a new mode for the dialog.voidsetStreetsideImageDisplay(StreetsideImageDisplay streetsideImageDisplay)voidupdateImage()Downloads the full quality picture of the selected StreetsideImage and sets in the StreetsideImageDisplay object.voidupdateImage(boolean fullQuality)Downloads the picture of the selected StreetsideImage and sets in the StreetsideImageDisplay object.voidupdateTitle()Updates the title of the dialog.-
Methods inherited from class org.openstreetmap.josm.gui.dialogs.ToggleDialog
buttonHidden, buttonShown, clearButtonActions, closeDetachedDialog, collapse, createLayout, createLayout, destroy, detach, dock, dockWhenClosingDetachedDlg, 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, stateChanged, toggleButtonHook, toString, unfurlDialog
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, update
-
Methods inherited from class java.awt.Container
add, 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, validateTree
-
Methods inherited from class java.awt.Component
action, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
logger
static final org.apache.log4j.Logger logger
-
BASE_TITLE
public static final java.lang.String BASE_TITLE
-
MESSAGE_SEPARATOR
private static final java.lang.String MESSAGE_SEPARATOR
- See Also:
- Constant Field Values
-
instance
private static StreetsideMainDialog instance
-
image
private volatile StreetsideAbstractImage image
-
nextButton
private final SideButton nextButton
-
previousButton
private final SideButton previousButton
-
redButton
public final SideButton redButton
Button used to jump to the image following the red line
-
blueButton
public final SideButton blueButton
Button used to jump to the image following the blue line
-
playButton
private final SideButton playButton
-
pauseButton
private final SideButton pauseButton
-
stopButton
private final SideButton stopButton
-
imageInfoHelp
private ImageInfoHelpPopup imageInfoHelp
-
streetsideImageDisplay
public StreetsideImageDisplay streetsideImageDisplay
Object containing the shown image and that handles zoom and drag
-
imageCache
private StreetsideCache imageCache
-
thumbnailCache
public StreetsideCache thumbnailCache
-
-
Constructor Detail
-
StreetsideMainDialog
private StreetsideMainDialog()
-
-
Method Detail
-
addShortcuts
private void addShortcuts()
Adds the shortcuts to the buttons.
-
getInstance
public static StreetsideMainDialog getInstance()
Returns the unique instance of the class.- Returns:
- The unique instance of the class.
-
hasInstance
public static boolean hasInstance()
- Returns:
- true, iff the singleton instance is present
-
setImageInfoHelp
public void setImageInfoHelp(ImageInfoHelpPopup popup)
-
setMode
public void setMode(StreetsideMainDialog.MODE mode)
Sets a new mode for the dialog.- Parameters:
mode- The mode to be set. Must not benull.
-
destroyInstance
public static void destroyInstance()
Destroys the unique instance of the class.
-
updateImage
public void updateImage()
Downloads the full quality picture of the selected StreetsideImage and sets in the StreetsideImageDisplay object.
-
updateImage
public void updateImage(boolean fullQuality)
Downloads the picture of the selected StreetsideImage and sets in the StreetsideImageDisplay object.- Parameters:
fullQuality- If the full quality picture must be downloaded or just the thumbnail.
-
disableAllButtons
private void disableAllButtons()
Disables all the buttons in the dialog
-
setImage
public void setImage(StreetsideAbstractImage image)
Sets a new StreetsideImage to be shown.- Parameters:
image- The image to be shown.
-
updateTitle
public void updateTitle()
Updates the title of the dialog.
-
getImage
public StreetsideAbstractImage getImage()
Returns theStreetsideAbstractImageobject which is being shown.- Returns:
- The
StreetsideAbstractImageobject which is being shown.
-
loadingFinished
public void loadingFinished(CacheEntry data, CacheEntryAttributes attributes, ICachedLoaderListener.LoadResult result)
When the pictures are returned from the cache, they are set in theStreetsideImageDisplayobject.- Specified by:
loadingFinishedin interfaceICachedLoaderListener
-
createLayout
public void createLayout(java.awt.Component data, java.util.List<SideButton> buttons)
Creates the layout of the dialog.- Parameters:
data- The content of the dialogbuttons- The buttons where you can click
-
selectedImageChanged
public void selectedImageChanged(StreetsideAbstractImage oldImage, StreetsideAbstractImage newImage)
Description copied from interface:StreetsideDataListenerFired when the selected image is changed by something different from manually clicking on the icon.- Specified by:
selectedImageChangedin interfaceStreetsideDataListener- Parameters:
oldImage- Old selectedStreetsideAbstractImagenewImage- New selectedStreetsideAbstractImage
-
imagesAdded
public void imagesAdded()
Description copied from interface:StreetsideDataListenerFired when any image is added to the database.- Specified by:
imagesAddedin interfaceStreetsideDataListener
-
getStreetsideImageDisplay
public StreetsideImageDisplay getStreetsideImageDisplay()
- Returns:
- the streetsideImageDisplay
-
setStreetsideImageDisplay
public void setStreetsideImageDisplay(StreetsideImageDisplay streetsideImageDisplay)
- Parameters:
streetsideImageDisplay- the streetsideImageDisplay to set
-
-