public final class HistoryBrowserDialogManager extends java.lang.Object implements LayerManager.LayerChangeListener
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.Long,HistoryBrowserDialog> |
dialogs |
private static HistoryBrowserDialogManager |
instance |
private java.util.function.Predicate<PrimitiveId> |
notNewPredicate |
private java.util.function.Predicate<PrimitiveId> |
unloadedHistoryPredicate |
private static java.lang.String |
WINDOW_GEOMETRY_PREF |
Modifier | Constructor and Description |
---|---|
protected |
HistoryBrowserDialogManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
existsDialog(long id)
Determines if an history dialog exists for the given object id.
|
static HistoryBrowserDialogManager |
getInstance()
Replies the unique instance.
|
private boolean |
hasDialogWithCloseUpperLeftCorner(java.awt.Point p) |
void |
hide(HistoryBrowserDialog dialog)
Hides the specified history dialog and cleans associated resources.
|
void |
hideAll()
Hides and destroys all currently visible history browser dialogs
|
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 |
placeOnScreen(HistoryBrowserDialog dialog) |
void |
show(History h)
Show history dialog for the given history.
|
private void |
show(long id) |
private void |
show(long id,
HistoryBrowserDialog dialog) |
void |
showHistory(java.util.Collection<? extends PrimitiveId> primitives)
Show history dialog(s) for the given primitive(s).
|
private static final java.lang.String WINDOW_GEOMETRY_PREF
private static HistoryBrowserDialogManager instance
private final java.util.Map<java.lang.Long,HistoryBrowserDialog> dialogs
private final java.util.function.Predicate<PrimitiveId> unloadedHistoryPredicate
private final java.util.function.Predicate<PrimitiveId> notNewPredicate
protected HistoryBrowserDialogManager()
public static HistoryBrowserDialogManager getInstance()
public boolean existsDialog(long id)
id
- the object idtrue
if an history dialog exists for the given object id, false
otherwiseprivate void show(long id, HistoryBrowserDialog dialog)
private void show(long id)
private boolean hasDialogWithCloseUpperLeftCorner(java.awt.Point p)
private void placeOnScreen(HistoryBrowserDialog dialog)
public void hide(HistoryBrowserDialog dialog)
dialog
- History dialog to hidepublic void hideAll()
public void show(History h)
h
- History to showpublic void layerAdded(LayerManager.LayerAddEvent e)
LayerManager.LayerChangeListener
Listeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
layerAdded
in interface LayerManager.LayerChangeListener
e
- 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.LayerChangeListener
e
- The layer to be removed (as event)public void layerOrderChanged(LayerManager.LayerOrderChangeEvent e)
LayerManager.LayerChangeListener
Listeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
layerOrderChanged
in interface LayerManager.LayerChangeListener
e
- The order change event.public void showHistory(java.util.Collection<? extends PrimitiveId> primitives)
primitives
- The primitive(s) for which history will be displayed