public class GenericRelationEditor extends RelationEditor
| Modifier and Type | Class and Description |
|---|---|
static class |
GenericRelationEditor.AddAbortException
Exception thrown when user aborts add operation.
|
(package private) static class |
GenericRelationEditor.LeftButtonToolbar
The toolbar with the buttons on the left
|
(package private) class |
GenericRelationEditor.MemberTableDblClickAdapter |
private class |
GenericRelationEditor.RelationEditorActionAccess |
javax.swing.JDialog.AccessibleJDialogjava.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityTypejava.awt.Window.AccessibleAWTWindow, java.awt.Window.Type| Modifier and Type | Field and Description |
|---|---|
private ApplyAction |
applyAction
Action for performing the
ApplyAction |
private CancelAction |
cancelAction
Action for performing the
CancelAction |
private java.util.ArrayList<java.awt.datatransfer.FlavorListener> |
clipboardListeners
A list of listeners that need to be notified on clipboard content changes.
|
private DeleteCurrentRelationAction |
deleteAction
Action for performing the
DeleteCurrentRelationAction |
private DuplicateRelationAction |
duplicateAction
Action for performing the
DuplicateRelationAction |
private MemberTable |
memberTable
the member table and its model
|
private MemberTableModel |
memberTableModel |
private OKAction |
okAction
Action for performing the
OKAction |
private ReferringRelationsBrowser |
referrerBrowser |
private ReferringRelationsBrowserModel |
referrerModel |
private RefreshAction |
refreshAction
Action for performing the
RefreshAction |
private SelectAction |
selectAction
Action for performing the
SelectAction |
private SelectionTable |
selectionTable
the selection table and its model
|
private SelectionTableModel |
selectionTableModel |
private TagEditorPanel |
tagEditorPanel
the tag table and its model
|
private AutoCompletingTextField |
tfRole |
private javax.swing.JMenuItem |
windowMenuItem
the menu item in the windows menu.
|
RELATION_PROP, RELATION_SNAPSHOT_PROPbuttons, contentInsets, defaultButton, DialogClosedOtherwiseaccessibleContext, rootPane, rootPaneCheckingEnabledBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
GenericRelationEditor(OsmDataLayer layer,
Relation relation,
java.util.Collection<RelationMember> selectedMembers)
Creates a new relation editor for the given relation.
|
| Modifier and Type | Method and Description |
|---|---|
static Command |
addPrimitivesToRelation(Relation orig,
java.util.Collection<? extends OsmPrimitive> primitivesToAdd)
Adds primitives to a given relation.
|
protected static javax.swing.JMenuItem |
addToWindowMenu(IRelationEditor re,
java.lang.String layerName)
Adds current relation editor to the windows menu (in the "volatile" group)
|
void |
apply()
Apply changes.
|
protected static javax.swing.JPanel |
buildMemberEditorPanel(GenericRelationEditor.LeftButtonToolbar leftButtonToolbar,
IRelationEditorActionAccess editorAccess)
builds the panel for the relation member editor
|
private static IRelationEditorActionGroup |
buildNativeGroup(int order,
AbstractRelationEditorAction... actions) |
protected static javax.swing.JPanel |
buildOkCancelButtonPanel(OKAction okAction,
CancelAction cancelAction)
builds the panel with the OK and the Cancel button
|
protected static AutoCompletingTextField |
buildRoleTextField(IRelationEditor re)
builds the role text field
|
protected static javax.swing.JToolBar |
buildSelectionControlButtonToolbar(IRelationEditorActionAccess editorAccess)
build the toolbar with the buttons for adding or removing the current selection
|
protected static javax.swing.JPanel |
buildSelectionTablePanel(SelectionTable selectionTable)
builds the panel with the table displaying the currently selected primitives
|
protected static javax.swing.JSplitPane |
buildSplitPane(javax.swing.JPanel top,
javax.swing.JPanel bottom,
IRelationEditor re)
builds the
JSplitPane which divides the editor in an upper and a lower half |
protected static javax.swing.JPanel |
buildTagEditorPanel(TagEditorPanel tagEditorPanel)
builds the panel with the tag editor
|
protected static javax.swing.JToolBar |
buildToolBar(AbstractRelationEditorAction... actions)
Creates the toolbar
|
void |
cancel()
Cancel changes.
|
protected static void |
cleanSelfReferences(MemberTableModel memberTableModel,
Relation relation)
checks whether the current relation has members referring to itself.
|
static boolean |
confirmAddingPrimitive(OsmPrimitive primitive)
Asks confirmationbefore adding a primitive.
|
void |
dispose() |
protected java.awt.Dimension |
findMaxDialogSize()
Tries to find a good value of how large the dialog should be
|
protected static java.util.Set<java.lang.String> |
findSuggestedRoles(java.util.Collection<TaggingPreset> presets,
OsmPrimitive p) |
private void |
populateModels(Relation relation) |
private void |
registerCopyPasteAction(javax.swing.AbstractAction action,
java.lang.Object actionName,
javax.swing.KeyStroke shortcut,
javax.swing.JRootPane rootPane,
javax.swing.JTable... tables) |
void |
reloadDataFromRelation()
Reloads data from relation.
|
void |
select()
Select relation.
|
void |
setVisible(boolean visible)
Override setVisible to be able to save the window geometry if required
|
static void |
warnOfCircularReferences(OsmPrimitive primitive)
Warn about circular references.
|
addPropertyChangeListener, getEditor, getLayer, getRelation, getRelationSnapshot, isDirtyRelation, removePropertyChangeListener, setRelation, setRelationSnapshot, updateTitlebuttonAction, configureContextsensitiveHelp, createButtonAction, getValue, initWindowGeometry, rememberWindowGeometry, setButtonIcons, setButtonIcons, setCancelButton, setContent, setContent, setContent, setDefaultButton, setFocusOnDefaultButton, setIcon, setIcon, setRememberWindowGeometry, setToolTipTexts, setupDialog, showDialog, toggleCheckState, toggleEnable, toggleSaveStateaddImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackaddPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontadd, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprivate final TagEditorPanel tagEditorPanel
private final ReferringRelationsBrowser referrerBrowser
private final ReferringRelationsBrowserModel referrerModel
private final MemberTable memberTable
private final MemberTableModel memberTableModel
private final SelectionTable selectionTable
private final SelectionTableModel selectionTableModel
private final AutoCompletingTextField tfRole
private javax.swing.JMenuItem windowMenuItem
private final RefreshAction refreshAction
RefreshActionprivate final ApplyAction applyAction
ApplyActionprivate final SelectAction selectAction
SelectActionprivate final DuplicateRelationAction duplicateAction
DuplicateRelationActionprivate final DeleteCurrentRelationAction deleteAction
DeleteCurrentRelationActionprivate final CancelAction cancelAction
CancelActionprivate final java.util.ArrayList<java.awt.datatransfer.FlavorListener> clipboardListeners
public GenericRelationEditor(OsmDataLayer layer, Relation relation, java.util.Collection<RelationMember> selectedMembers)
layer - the OsmDataLayer the new or edited relation belongs torelation - relation to edit, or null to create a new one.selectedMembers - a collection of members which shall be selected initiallypublic void reloadDataFromRelation()
IRelationEditorprivate void populateModels(Relation relation)
public void apply()
ApplyActionpublic void select()
SelectActionpublic void cancel()
CancelActionprotected static javax.swing.JToolBar buildToolBar(AbstractRelationEditorAction... actions)
actions - relation toolbar actionsprotected static javax.swing.JPanel buildOkCancelButtonPanel(OKAction okAction, CancelAction cancelAction)
okAction - OK actioncancelAction - Cancel actionprotected static javax.swing.JPanel buildTagEditorPanel(TagEditorPanel tagEditorPanel)
tagEditorPanel - tag editor panelprotected static AutoCompletingTextField buildRoleTextField(IRelationEditor re)
re - relation editorprotected static javax.swing.JPanel buildMemberEditorPanel(GenericRelationEditor.LeftButtonToolbar leftButtonToolbar, IRelationEditorActionAccess editorAccess)
leftButtonToolbar - left button toolbareditorAccess - The relation editorprotected static javax.swing.JPanel buildSelectionTablePanel(SelectionTable selectionTable)
selectionTable - selection tableprotected static javax.swing.JSplitPane buildSplitPane(javax.swing.JPanel top, javax.swing.JPanel bottom, IRelationEditor re)
JSplitPane which divides the editor in an upper and a lower halftop - top panelbottom - bottom panelre - relation editorprotected static javax.swing.JToolBar buildSelectionControlButtonToolbar(IRelationEditorActionAccess editorAccess)
editorAccess - relation editorprivate static IRelationEditorActionGroup buildNativeGroup(int order, AbstractRelationEditorAction... actions)
protected java.awt.Dimension findMaxDialogSize()
ExtendedDialogfindMaxDialogSize in class ExtendedDialogpublic void setVisible(boolean visible)
ExtendedDialogsetVisible in class ExtendedDialogprotected static javax.swing.JMenuItem addToWindowMenu(IRelationEditor re, java.lang.String layerName)
re - relation editorlayerName - layer nameprotected static void cleanSelfReferences(MemberTableModel memberTableModel, Relation relation)
memberTableModel - member table modelrelation - relationprivate void registerCopyPasteAction(javax.swing.AbstractAction action, java.lang.Object actionName, javax.swing.KeyStroke shortcut, javax.swing.JRootPane rootPane, javax.swing.JTable... tables)
public void dispose()
dispose in class RelationEditorpublic static boolean confirmAddingPrimitive(OsmPrimitive primitive) throws GenericRelationEditor.AddAbortException
primitive - primitive to addtrue is user confirms the operation, false otherwiseGenericRelationEditor.AddAbortException - if user aborts operationpublic static void warnOfCircularReferences(OsmPrimitive primitive)
primitive - the concerned primitivepublic static Command addPrimitivesToRelation(Relation orig, java.util.Collection<? extends OsmPrimitive> primitivesToAdd)
orig - The relation to modifyprimitivesToAdd - The primitives to add as relation membersjava.lang.IllegalArgumentException - if orig is nullprotected static java.util.Set<java.lang.String> findSuggestedRoles(java.util.Collection<TaggingPreset> presets, OsmPrimitive p)