public class RelationDialogManager extends java.awt.event.WindowAdapter implements LayerManager.LayerChangeListener
| Modifier and Type | Class and Description |
|---|---|
private static class |
RelationDialogManager.DialogContext
Helper class for keeping the context of a relation editor.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<RelationDialogManager.DialogContext,RelationEditor> |
openDialogs
the map of open dialogs
|
private static RelationDialogManager |
relationDialogManager
keeps track of open relation editors
|
| Constructor and Description |
|---|
RelationDialogManager()
constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close(OsmDataLayer layer,
Relation relation)
Closes the editor open for a specific layer and a specific relation.
|
RelationEditor |
getEditorForRelation(OsmDataLayer layer,
Relation relation)
Replies the editor for the relation managed by layer.
|
static RelationDialogManager |
getRelationDialogManager()
Replies the singleton
RelationDialogManager |
protected boolean |
hasEditorWithCloseUpperLeftCorner(java.awt.Point p,
RelationEditor thisEditor)
Replies true, if there is another open
RelationEditor whose
upper left corner is close to p. |
boolean |
isOpenInEditor(OsmDataLayer layer,
Relation relation)
Replies true if there is an open relation editor for the relation managed
by the given layer.
|
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.
|
void |
positionOnScreen(RelationEditor editor)
Positions a
RelationEditor on the screen. |
void |
register(OsmDataLayer layer,
Relation relation,
RelationEditor editor)
Register the relation editor for a relation managed by a
OsmDataLayer. |
void |
updateContext(OsmDataLayer layer,
Relation relation,
RelationEditor editor) |
void |
windowClosed(java.awt.event.WindowEvent e) |
private static RelationDialogManager relationDialogManager
private final java.util.Map<RelationDialogManager.DialogContext,RelationEditor> openDialogs
public RelationDialogManager()
public static RelationDialogManager getRelationDialogManager()
RelationDialogManagerRelationDialogManagerpublic void register(OsmDataLayer layer, Relation relation, RelationEditor editor)
OsmDataLayer.layer - the layerrelation - the relationeditor - the editorpublic void updateContext(OsmDataLayer layer, Relation relation, RelationEditor editor)
public void close(OsmDataLayer layer, Relation relation)
layer - the layerrelation - the relationpublic boolean isOpenInEditor(OsmDataLayer layer, Relation relation)
layer - the layerrelation - the relation. May be null.public RelationEditor getEditorForRelation(OsmDataLayer layer, Relation relation)
layer - the layerrelation - the relationisOpenInEditor(OsmDataLayer, Relation)public 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 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 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 windowClosed(java.awt.event.WindowEvent e)
windowClosed in interface java.awt.event.WindowListenerwindowClosed in class java.awt.event.WindowAdapterprotected boolean hasEditorWithCloseUpperLeftCorner(java.awt.Point p, RelationEditor thisEditor)
RelationEditor whose
upper left corner is close to p.p - the reference point to checkthisEditor - the current editorRelationEditor whose
upper left corner is close to p.public void positionOnScreen(RelationEditor editor)
RelationEditor on the screen. Tries to center it on the
screen. If it hide another instance of an editor at the same position this
method tries to reposition editor by moving it slightly down and
slightly to the right.editor - the editor