public class ZoomToAction extends javax.swing.AbstractAction implements LayerManager.LayerChangeListener, MainLayerManager.ActiveLayerChangeListener, javax.swing.event.ListSelectionListener
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
descriptionInactiveLayer |
private java.lang.String |
descriptionNominal |
private java.lang.String |
descriptionNoSelection |
private OsmPrimitivesTable |
table |
Constructor and Description |
---|
ZoomToAction(MemberTable table)
Creates a new zoom to action for a
MemberTable using the matching description strings |
ZoomToAction(NodeListTable table)
Creates a new zoom to action for a
NodeListTable using the matching description strings |
ZoomToAction(OsmPrimitivesTable table,
java.lang.String descriptionNominal,
java.lang.String descriptionInactiveLayer,
java.lang.String descriptionNoSelection)
Creates a new, generic zoom to action
|
ZoomToAction(RelationMemberTable table)
Creates a new zoom to action for a
RelationMemberTable using the matching description strings |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
Called whenever the active or edit layer changed.
|
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.
|
protected void |
updateEnabledState() |
void |
valueChanged(javax.swing.event.ListSelectionEvent e) |
private final OsmPrimitivesTable table
private final java.lang.String descriptionNominal
private final java.lang.String descriptionInactiveLayer
private final java.lang.String descriptionNoSelection
public ZoomToAction(OsmPrimitivesTable table, java.lang.String descriptionNominal, java.lang.String descriptionInactiveLayer, java.lang.String descriptionNoSelection)
table
- The table to get the selected element fromdescriptionNominal
- The description to display if zooming is possibledescriptionInactiveLayer
- The description to display if zooming is impossible because the layer is not activedescriptionNoSelection
- The description to display if zooming is impossible because the table selection is emptypublic ZoomToAction(MemberTable table)
MemberTable
using the matching description stringstable
- The table to get the selected element frompublic ZoomToAction(RelationMemberTable table)
RelationMemberTable
using the matching description stringstable
- The table to get the selected element frompublic ZoomToAction(NodeListTable table)
NodeListTable
using the matching description stringstable
- The table to get the selected element frompublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
protected final void updateEnabledState()
public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
public void activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
MainLayerManager.ActiveLayerChangeListener
You can be sure that this layer is still contained in this set.
Listeners are called in the EDT thread and you can manipulate the layer manager in the current thread.
activeOrEditLayerChanged
in interface MainLayerManager.ActiveLayerChangeListener
e
- The change event.public 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.