Fixes issue #884 (see issue for more info).
AliasItemEditor.save() modifies objects that are observed by the
TableView's underlying SortedList. Thus, the TableView's selection can
change by calling save(), which means the ListChangeListener can be
fired.
This is a problem for two reasons.
1. The alert dialogue that prompts the user to save a modified alias
will show when the user presses the "save" button, because saving
modifies the selected alias and causes the list to update.
2. setAliases() calls Alert.showAndWait(). From the JavaDoc:
"It must not be called during animation or layout processing."
This statement is likely there because it can cause issues like the one
here: TableView's layout processing (and the list updating) is paused
and the list is further modified (by calling save()). Thus, when the
processing is resumed the list is in a different and unexpected state.
Calling setAliases() from Platform.runLater() will allow the SortedList,
TableView, and any other involved objects to finish processing changes
before more modifications are made. Additionally, it allows save(),
when called by pressing the save button, to complete and set the
modifiedProperty to false, so setAliases() does not display an
additional save prompt.
Updating the service library prompted some minor changes with the way that county info objects are handled for each site.
Co-authored-by: Denny <denny@denny-desktop>
* #775 Adds frequency column to channel editor
* #775 Resolves issue with changing channel processing flag on FX event thread
* #775 Removes auto-detect channel settings for P25 Phase 2 configurations.
* #775 Playlist editor cleanup actions. Changes style of segmented buttons. Fix issue with channel set processing not on FX thread. Removes P25P2 auto-detect settings feature. Adds frequency column to channel editor.
Co-authored-by: Denny <denny@denny-desktop>
* WIP - Adds support for aliasing P25 Phase 2 tones.Playlist editor - adds editor support for alias actions
* Playlist editor implementation and integration into application is complete. Adds JavaFX window monitoring to persist window size/location across application runs.
Co-authored-by: Denny <denny@denny-desktop>
* Misc minor performance improvements
* Use more concise loop syntax
* Use more concise Collection sort syntax
* Use StringUtils pad methods
* Optimize some loops and double-map-lookups
* Optimize array instantiation
There are two styles to convert a collection to an array: either
using a pre-sized array (like c.toArray(new String[c.size()])) or
using an empty array (like c.toArray(new String[0]).
In older Java versions using pre-sized array was recommended,
as the reflection call which is necessary to create an array
of proper size was quite slow. However since late updates of
OpenJDK 6 this call was intrinsified, making the performance
of the empty array version the same and sometimes even better,
compared to the pre-sized version. Also passing pre-sized array
is dangerous for a concurrent or synchronized collection as
a data race is possible between the size and toArray call
which may result in extra nulls at the end of the array,
if the collection was concurrently shrunk during the operation.
* Cleanup string concatenation
* Use EnumMap where possible
* Use FastMath instead of Math
* Initialize complex things only once
* Reduce method size to aloow more JIT inlining
* remove map of short->float
* Move field to local variable
* Cleanup Map lookup
Co-authored-by: Rob Ekl <xwq876@zebra.com>
* Include other member variables in copy constructor
* Add break to switch cases
* Implement equals() in classes extending Comparable
If equals() is not overridden, the equals() implementation is not consistent
with the compareTo() implementation. If an object of such a class is added
to a collection such as java.util.SortedSet, this collection will violate
the contract of java.util.Set, which is defined in terms of equals().
Co-authored-by: Rob Ekl <xwq876@zebra.com>