public class CreateMultipolygonAction extends JosmAction
Modifier and Type | Field and Description |
---|---|
static List<String> |
DEFAULT_LINEAR_TAGS |
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
Constructor and Description |
---|
CreateMultipolygonAction()
Constructs a new
CreateMultipolygonAction . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
The action button has been clicked
|
private MultipolygonCreate |
analyzeWays(Collection<Way> selectedWays)
This method analyzes ways and creates multipolygon.
|
private Relation |
createRelation(MultipolygonCreate pol)
Builds a relation from polygon ways.
|
private List<Command> |
removeTagsFromWaysIfNeeded(Relation relation)
This method removes tags/value pairs from inner and outer ways and put them on relation if necessary
Function was extended in reltoolbox plugin by Zverikk and copied back to the core
|
protected void |
updateEnabledState()
Enable this action only if something is selected
|
protected void |
updateEnabledState(Collection<? extends OsmPrimitive> selection)
Enable this action only if something is selected
|
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public static final List<String> DEFAULT_LINEAR_TAGS
public CreateMultipolygonAction()
CreateMultipolygonAction
.public void actionPerformed(ActionEvent e)
e
- Action Eventprotected void updateEnabledState()
updateEnabledState
in class JosmAction
JosmAction.updateEnabledState(Collection)
,
JosmAction.initEnabledState()
protected void updateEnabledState(Collection<? extends OsmPrimitive> selection)
updateEnabledState
in class JosmAction
selection
- the current selection, gets tested for emptynessJosmAction.updateEnabledState()
,
JosmAction.initEnabledState()
private MultipolygonCreate analyzeWays(Collection<Way> selectedWays)
selectedWays
- list of selected waysnull
, if there was a problem with the ways.private Relation createRelation(MultipolygonCreate pol)
pol
- data storage class containing polygon informationprivate List<Command> removeTagsFromWaysIfNeeded(Relation relation)
relation
- the multipolygon style relation to process