Class FilterDialog
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.openstreetmap.josm.gui.dialogs.ToggleDialog
-
- org.openstreetmap.josm.gui.dialogs.FilterDialog
-
- All Implemented Interfaces:
java.awt.event.AWTEventListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,DataSetListener
,Helpful
,MapFrame.MapModeChangeListener
,ShowHideButtonListener
,PreferenceChangedListener
,Destroyable
public class FilterDialog extends ToggleDialog implements DataSetListener, MapFrame.MapModeChangeListener
The filter dialog displays a list of filters that are active on the current edit layer.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
FilterDialog.AbstractFilterAction
private class
FilterDialog.AddAction
(package private) static class
FilterDialog.BooleanRenderer
private class
FilterDialog.DeleteAction
private class
FilterDialog.EditAction
private class
FilterDialog.EnableFilterAction
private class
FilterDialog.FilterAction
private class
FilterDialog.HidingFilterAction
private class
FilterDialog.MoveDownAction
private class
FilterDialog.MoveUpAction
private class
FilterDialog.ReverseAction
private class
FilterDialog.SortAction
(package private) static class
FilterDialog.StringRenderer
(package private) static class
FilterDialog.UserTable
-
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
-
-
Field Summary
Fields Modifier and Type Field Description private FilterDialog.AddAction
addAction
private static java.lang.String[]
COLUMN_TOOLTIPS
private FilterDialog.DeleteAction
deleteAction
private FilterDialog.EditAction
editAction
private static Shortcut
ENABLE_FILTER_SHORTCUT
private FilterDialog.EnableFilterAction
enableFilterAction
private FilterTableModel
filterModel
private static Shortcut
HIDING_FILTER_SHORTCUT
private FilterDialog.HidingFilterAction
hidingFilterAction
private FilterDialog.MoveDownAction
moveDownAction
private FilterDialog.MoveUpAction
moveUpAction
private FilterDialog.ReverseAction
reverseAction
private FilterDialog.SortAction
sortAction
private javax.swing.JTable
userTable
-
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 Constructor Description FilterDialog()
Constructs a newFilterDialog
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
build()
Builds the GUI.void
dataChanged(DataChangedEvent event)
Called after big changes in dataset.void
destroy()
Called when the object has been destroyed.void
drawOSDText(java.awt.Graphics2D g)
Draws a text on the map display that indicates that filters are active.FilterTableModel
getFilterModel()
This method is intended for Plugins getting the filtermodel and using .addFilter() to add a new filter.void
hideNotify()
Called when toggle dialog is hidden (collapsed, removed, MapFrame is removed, ...).void
mapModeChange(MapMode oldMapMode, MapMode newMapMode)
Trigerred when map mode changes.void
nodeMoved(NodeMovedEvent event)
A node's coordinates were modified.void
otherDatasetChange(AbstractDatasetChangedEvent event)
Minor dataset change, currently only changeset id changed is supported, but can be extended in future.void
primitivesAdded(PrimitivesAddedEvent event)
A bunch of primitives were added into the DataSet, or existing deleted/invisible primitives were resurrected.void
primitivesRemoved(PrimitivesRemovedEvent event)
A bunch of primitives were removed from the DataSet, or preexisting primitives were marked as deleted.void
relationMembersChanged(RelationMembersChangedEvent event)
A relation's members have changed.void
showNotify()
Called when toggle dialog is shown (after it was created or expanded).void
tagsChanged(TagsChangedEvent event)
There was some change in the tag set of a primitive.void
updateDialogHeader()
Updates the headline of this dialog to display the number of active filters.void
wayNodesChanged(WayNodesChangedEvent event)
A way's node list was changed.-
Methods inherited from class org.openstreetmap.josm.gui.dialogs.ToggleDialog
buttonHidden, buttonShown, clearButtonActions, closeDetachedDialog, collapse, createLayout, createLayout, detach, dock, dockWhenClosingDetachedDlg, eventDispatched, expand, getButton, getDefaultDetachedSize, getLastHeight, getName, getPreferencePrefix, getPreferredHeight, getToggleAction, helpTopic, hideDialog, isDialogInCollapsedView, isDialogInDefaultView, isDialogShowing, preferenceChanged, registerInWindowMenu, rememberHeight, setButton, setContentVisible, setDialogsPanel, setIsButtonHiding, setIsCollapsed, setIsDocked, setIsShowing, setTitle, showDialog, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.osm.event.DataSetListener
dataChangedIndividualEvents
-
-
-
-
Field Detail
-
userTable
private javax.swing.JTable userTable
-
filterModel
private final FilterTableModel filterModel
-
addAction
private final FilterDialog.AddAction addAction
-
editAction
private final FilterDialog.EditAction editAction
-
deleteAction
private final FilterDialog.DeleteAction deleteAction
-
moveUpAction
private final FilterDialog.MoveUpAction moveUpAction
-
moveDownAction
private final FilterDialog.MoveDownAction moveDownAction
-
sortAction
private final FilterDialog.SortAction sortAction
-
reverseAction
private final FilterDialog.ReverseAction reverseAction
-
enableFilterAction
private final FilterDialog.EnableFilterAction enableFilterAction
-
hidingFilterAction
private final FilterDialog.HidingFilterAction hidingFilterAction
-
ENABLE_FILTER_SHORTCUT
private static final Shortcut ENABLE_FILTER_SHORTCUT
-
HIDING_FILTER_SHORTCUT
private static final Shortcut HIDING_FILTER_SHORTCUT
-
COLUMN_TOOLTIPS
private static final java.lang.String[] COLUMN_TOOLTIPS
-
-
Constructor Detail
-
FilterDialog
public FilterDialog()
Constructs a newFilterDialog
-
-
Method Detail
-
showNotify
public void showNotify()
Description copied from class:ToggleDialog
Called when toggle dialog is shown (after it was created or expanded). Descendants may overwrite this method, it's a good place to register listeners needed to keep dialog updated- Overrides:
showNotify
in classToggleDialog
-
hideNotify
public void hideNotify()
Description copied from class:ToggleDialog
Called when toggle dialog is hidden (collapsed, removed, MapFrame is removed, ...). Good place to unregister listeners- Overrides:
hideNotify
in classToggleDialog
-
build
protected void build()
Builds the GUI.
-
destroy
public void destroy()
Description copied from interface:Destroyable
Called when the object has been destroyed.- Specified by:
destroy
in interfaceDestroyable
- Overrides:
destroy
in classToggleDialog
-
updateDialogHeader
public void updateDialogHeader()
Updates the headline of this dialog to display the number of active filters.
-
drawOSDText
public void drawOSDText(java.awt.Graphics2D g)
Draws a text on the map display that indicates that filters are active.- Parameters:
g
- The graphics to draw that text on.
-
dataChanged
public void dataChanged(DataChangedEvent event)
Description copied from interface:DataSetListener
Called after big changes in dataset. Usually other events are stopped using Dataset.beginUpdate() and after operation is completed (Dataset.endUpdate()),DataSetListener.dataChanged(DataChangedEvent event)
is called.- Specified by:
dataChanged
in interfaceDataSetListener
- Parameters:
event
- data change event
-
nodeMoved
public void nodeMoved(NodeMovedEvent event)
Description copied from interface:DataSetListener
A node's coordinates were modified.- Specified by:
nodeMoved
in interfaceDataSetListener
- Parameters:
event
- The event for the node that was moved.
-
otherDatasetChange
public void otherDatasetChange(AbstractDatasetChangedEvent event)
Description copied from interface:DataSetListener
Minor dataset change, currently only changeset id changed is supported, but can be extended in future.- Specified by:
otherDatasetChange
in interfaceDataSetListener
- Parameters:
event
- the event for data modification
-
primitivesAdded
public void primitivesAdded(PrimitivesAddedEvent event)
Description copied from interface:DataSetListener
A bunch of primitives were added into the DataSet, or existing deleted/invisible primitives were resurrected.- Specified by:
primitivesAdded
in interfaceDataSetListener
- Parameters:
event
- An event for an collection of newly-visible primitives
-
primitivesRemoved
public void primitivesRemoved(PrimitivesRemovedEvent event)
Description copied from interface:DataSetListener
A bunch of primitives were removed from the DataSet, or preexisting primitives were marked as deleted.- Specified by:
primitivesRemoved
in interfaceDataSetListener
- Parameters:
event
- An event for an collection of newly-invisible primitives
-
relationMembersChanged
public void relationMembersChanged(RelationMembersChangedEvent event)
Description copied from interface:DataSetListener
A relation's members have changed.- Specified by:
relationMembersChanged
in interfaceDataSetListener
- Parameters:
event
- The event for the relation that was modified.
-
tagsChanged
public void tagsChanged(TagsChangedEvent event)
Description copied from interface:DataSetListener
There was some change in the tag set of a primitive. It can have been a tag addition, tag removal or change in tag value.- Specified by:
tagsChanged
in interfaceDataSetListener
- Parameters:
event
- the event for the primitive, whose tags were affected.
-
wayNodesChanged
public void wayNodesChanged(WayNodesChangedEvent event)
Description copied from interface:DataSetListener
A way's node list was changed.- Specified by:
wayNodesChanged
in interfaceDataSetListener
- Parameters:
event
- The event for the way that was modified.
-
mapModeChange
public void mapModeChange(MapMode oldMapMode, MapMode newMapMode)
Description copied from interface:MapFrame.MapModeChangeListener
Trigerred when map mode changes.- Specified by:
mapModeChange
in interfaceMapFrame.MapModeChangeListener
- Parameters:
oldMapMode
- old map modenewMapMode
- new map mode
-
getFilterModel
public FilterTableModel getFilterModel()
This method is intended for Plugins getting the filtermodel and using .addFilter() to add a new filter.- Returns:
- the filtermodel
-
-