Skip to content

Commit

Permalink
Make plugin handle float level values
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccasc committed Oct 5, 2022
1 parent 64beec3 commit 50f4fb9
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,14 @@ public void actionPerformed(ActionEvent e) {
* @param key specific key to unset hidden objects which contains it
*/
public void unsetSpecificKeyFilter(String key) {
try{
// check if key is integer, no support for float values right now
Integer.parseInt(workingLevel);
}catch(Exception e){
System.out.println("No support of -unsetSpecificKeyFilter- for float values right now.");
return;
}

DataSet editDataSet = OsmDataManager.getInstance().getEditDataSet();
if (editDataSet != null) {
ArrayList<OsmPrimitive> primitiveCollection = new ArrayList<>(editDataSet.allPrimitives());
Expand All @@ -385,6 +393,8 @@ public void unsetSpecificKeyFilter(String key) {
primitivesToDisable.add(primitive);
}
}

// TODO check if we really need to perform this on a new thread
new Thread(() -> primitivesToDisable.forEach(primitive -> {
if (IndoorLevel.isPartOfWorkingLevel(primitive.get(key), level)) {
primitive.unsetDisabledState();
Expand Down

0 comments on commit 50f4fb9

Please sign in to comment.