public class AutoScaleAction extends JosmAction
Modifier and Type | Class and Description |
---|---|
private class |
AutoScaleAction.MapFrameAdapter
Adapter for MapFrame change events
|
private class |
AutoScaleAction.ZoomChangeAdapter
Adapter for zoom change events
|
Modifier and Type | Field and Description |
---|---|
protected AutoScaleAction.MapFrameAdapter |
mapFrameAdapter |
private String |
mode |
static Collection<String> |
MODES |
protected AutoScaleAction.ZoomChangeAdapter |
zoomChangeAdapter |
sc
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Modifier | Constructor and Description |
---|---|
|
AutoScaleAction(String mode)
Constructs a new
AutoScaleAction . |
private |
AutoScaleAction(String mode,
boolean marker)
Constructs a new
AutoScaleAction . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
void |
autoScale() |
static void |
autoScale(String mode) |
protected Layer |
getActiveLayer() |
private BoundingXYVisitor |
getBoundingBox() |
protected Layer |
getFirstSelectedLayer()
Replies the first selected layer in the layer list dialog. null, if no
such layer exists, either because the layer list dialog is not yet created
or because no layer is selected.
|
private static int |
getModeShortcut(String mode) |
protected void |
installAdapters() |
protected void |
updateEnabledState()
Override in subclasses to update the enabled state of the action when
something in the JOSM state changes, i.e. when a layer is removed or added.
|
protected void |
updateEnabledState(Collection<? extends OsmPrimitive> selection)
Override in subclasses to update the enabled state of the action if the
collection of selected primitives changes.
|
static void |
zoomTo(Collection<OsmPrimitive> sel) |
static void |
zoomToSelection()
Zooms the current map view to the currently selected primitives.
|
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, setTooltip
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public static final Collection<String> MODES
protected AutoScaleAction.ZoomChangeAdapter zoomChangeAdapter
protected AutoScaleAction.MapFrameAdapter mapFrameAdapter
private AutoScaleAction(String mode, boolean marker)
AutoScaleAction
.mode
- The autoscale mode (one of MODES
)marker
- Used only to differentiate from default constructorpublic AutoScaleAction(String mode)
AutoScaleAction
.mode
- The autoscale mode (one of MODES
)public static void zoomToSelection()
public static void zoomTo(Collection<OsmPrimitive> sel)
private static int getModeShortcut(String mode)
public void autoScale()
public void actionPerformed(ActionEvent e)
protected Layer getActiveLayer()
protected Layer getFirstSelectedLayer()
private BoundingXYVisitor getBoundingBox()
protected void updateEnabledState()
JosmAction
JosmAction.updateEnabledState(Collection)
to respond to changes in the collection
of selected primitives.
Default behavior is empty.updateEnabledState
in class JosmAction
JosmAction.updateEnabledState(Collection)
,
JosmAction.initEnabledState()
protected void updateEnabledState(Collection<? extends OsmPrimitive> selection)
JosmAction
updateEnabledState
in class JosmAction
selection
- the collection of selected primitives; may be empty, but not nullJosmAction.updateEnabledState()
,
JosmAction.initEnabledState()
protected void installAdapters()
installAdapters
in class JosmAction