mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-20 04:27:48 -05:00
Compare commits
800 Commits
v0.4.0-alp
...
2717-tuner
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
463a805890 | ||
|
|
156dd40bfe | ||
|
|
e01dd02b74 | ||
|
|
8324233acb | ||
|
|
838e7708c0 | ||
|
|
d3a9adc06f | ||
|
|
cd098955aa | ||
|
|
61efb3d299 | ||
|
|
6d89a604c3 | ||
|
|
3473150ee9 | ||
|
|
ff6e2bd710 | ||
|
|
f302d46be1 | ||
|
|
f47479b8d4 | ||
|
|
bc7dd201ab | ||
|
|
c46b80b06b | ||
|
|
7f1e7d9cd2 | ||
|
|
7a7364839b | ||
|
|
2213544eec | ||
|
|
feeedb7c29 | ||
|
|
6dd06288ac | ||
|
|
5fd469c402 | ||
|
|
0bc5d6db64 | ||
|
|
80754558d6 | ||
|
|
2f9d52a56a | ||
|
|
5474a5a448 | ||
|
|
c93d099742 | ||
|
|
be0966653b | ||
|
|
26a24fc6ad | ||
|
|
9deabd0dcc | ||
|
|
2db41393dc | ||
|
|
29a10edf03 | ||
|
|
5bce541631 | ||
|
|
9641d2ef59 | ||
|
|
73fc85aa76 | ||
|
|
aad971db9c | ||
|
|
73d3238644 | ||
|
|
4626d56730 | ||
|
|
1a90eaf6c6 | ||
|
|
fbc54a38dd | ||
|
|
07b61be257 | ||
|
|
74dc32538f | ||
|
|
7fcf035337 | ||
|
|
a53f6e9d99 | ||
|
|
e7f4f655e5 | ||
|
|
000ac51ff0 | ||
|
|
23cee388de | ||
|
|
5c73fb318f | ||
|
|
066554393f | ||
|
|
303c0a98cc | ||
|
|
02c62d012f | ||
|
|
a4ec04a499 | ||
|
|
006e382b34 | ||
|
|
beb2593dd9 | ||
|
|
657cbf5c55 | ||
|
|
aff34fa5eb | ||
|
|
22cd8968cb | ||
|
|
ec7efa4d17 | ||
|
|
07fd8c2923 | ||
|
|
a7301e93d9 | ||
|
|
5912a958b3 | ||
|
|
9ca4ae4d8f | ||
|
|
6cd2cea30b | ||
|
|
ba16c8b377 | ||
|
|
d72c5d87be | ||
|
|
dea3a3a41e | ||
|
|
48296990e9 | ||
|
|
289150d415 | ||
|
|
69d49d9dd0 | ||
|
|
e8e813142b | ||
|
|
968705a589 | ||
|
|
1c097491d9 | ||
|
|
0b3ce66cad | ||
|
|
14c77c4926 | ||
|
|
8aadbe4706 | ||
|
|
19d18b96b3 | ||
|
|
59e64a73ff | ||
|
|
8b338dec2d | ||
|
|
bab02222a4 | ||
|
|
9359f523c1 | ||
|
|
e385d2fdec | ||
|
|
49c3d3ff55 | ||
|
|
7b249af944 | ||
|
|
197cec04f3 | ||
|
|
c75baa48f4 | ||
|
|
866aadc8c3 | ||
|
|
276f4a316a | ||
|
|
e65ff5a8dc | ||
|
|
85bfd21257 | ||
|
|
9ebbf957a2 | ||
|
|
00c0418017 | ||
|
|
33a2471338 | ||
|
|
d86fba6945 | ||
|
|
248fe3e4f7 | ||
|
|
9a6dc2b0a0 | ||
|
|
6b9cd2d317 | ||
|
|
f2c98cdb40 | ||
|
|
5635341d12 | ||
|
|
df739f525f | ||
|
|
c8b1c8ed3a | ||
|
|
b0428a1d8b | ||
|
|
c0a96f94fb | ||
|
|
1945b83562 | ||
|
|
dc550f3121 | ||
|
|
0460f2b77b | ||
|
|
b37ed51d07 | ||
|
|
f1183e531d | ||
|
|
16a66112fc | ||
|
|
8aa6ae089a | ||
|
|
728a83a82d | ||
|
|
c05328cd1e | ||
|
|
a9120ed65e | ||
|
|
9305abc784 | ||
|
|
0c637ed80d | ||
|
|
7ee3c5d251 | ||
|
|
a33c99347b | ||
|
|
97cae50bdd | ||
|
|
80360029ef | ||
|
|
af5dbcfcdc | ||
|
|
9dcebb4943 | ||
|
|
e2d9c4cda3 | ||
|
|
3e21887d27 | ||
|
|
d60720aab7 | ||
|
|
2292af6c07 | ||
|
|
ff128f56d2 | ||
|
|
3c01c644c9 | ||
|
|
ade4dc47cd | ||
|
|
cbbbe3a131 | ||
|
|
b385a42b63 | ||
|
|
ccae1d05e7 | ||
|
|
788d994ad7 | ||
|
|
7cf6974b6b | ||
|
|
cf0737ed90 | ||
|
|
75fa495c99 | ||
|
|
7945f0ce63 | ||
|
|
a053315675 | ||
|
|
de0e722f0c | ||
|
|
a42592daa9 | ||
|
|
7f9dc86b23 | ||
|
|
2f5c165aec | ||
|
|
29164ac75d | ||
|
|
185df1735a | ||
|
|
c81e6cccfa | ||
|
|
a2509554db | ||
|
|
b83f77c7c6 | ||
|
|
d8e2e0ac57 | ||
|
|
b0a0ad4b43 | ||
|
|
17cdd0df27 | ||
|
|
6d23aaa06f | ||
|
|
933629e30d | ||
|
|
8a6bc03ffc | ||
|
|
0c616d4531 | ||
|
|
b472c68b80 | ||
|
|
f6f4b07623 | ||
|
|
de100b4662 | ||
|
|
bbde3033b7 | ||
|
|
f6866f5408 | ||
|
|
d09fad56db | ||
|
|
7c06075880 | ||
|
|
5b597e29eb | ||
|
|
feb66831d4 | ||
|
|
37d47f4219 | ||
|
|
0d886c272e | ||
|
|
48202da9e4 | ||
|
|
c4d9d58a5d | ||
|
|
fe5679fed7 | ||
|
|
b2be38b239 | ||
|
|
912925ee7d | ||
|
|
d86f8bf3d9 | ||
|
|
88d8633958 | ||
|
|
3bf3de82fc | ||
|
|
03a015f504 | ||
|
|
15b7923a4f | ||
|
|
189173e289 | ||
|
|
2dcd994eb2 | ||
|
|
afadb227db | ||
|
|
5dbcd5a8ad | ||
|
|
728a85c180 | ||
|
|
dd6ddd59e9 | ||
|
|
758794fdb4 | ||
|
|
49b95a9445 | ||
|
|
a4bcdfa769 | ||
|
|
872498badc | ||
|
|
4afb74a847 | ||
|
|
96f0b7dd55 | ||
|
|
b360950b80 | ||
|
|
5b0a1401a1 | ||
|
|
3fa114501b | ||
|
|
8935835921 | ||
|
|
dec255d444 | ||
|
|
1cb0490985 | ||
|
|
c8235ea4fc | ||
|
|
7d69d829b5 | ||
|
|
a46abf7da8 | ||
|
|
437264e272 | ||
|
|
8718d04ef5 | ||
|
|
4e367bb5fe | ||
|
|
71d2cb6fca | ||
|
|
e856de273d | ||
|
|
ea0a9da24c | ||
|
|
b3cd7d787a | ||
|
|
9a13a82ed1 | ||
|
|
9b71508d49 | ||
|
|
694ea83a80 | ||
|
|
70fb74b787 | ||
|
|
9ffa02e2e5 | ||
|
|
11abb87177 | ||
|
|
49cf92c7ab | ||
|
|
4cf51405ea | ||
|
|
db83d5121c | ||
|
|
d61d9c07b0 | ||
|
|
5c9c3fa503 | ||
|
|
552d3a6ce9 | ||
|
|
3bf425f94a | ||
|
|
660a5acd2f | ||
|
|
551277f399 | ||
|
|
a12040be5c | ||
|
|
e4be7dc5f4 | ||
|
|
b615c1e16a | ||
|
|
912af4e3e6 | ||
|
|
df0d0468c8 | ||
|
|
7509245751 | ||
|
|
02e236202c | ||
|
|
4b1d294211 | ||
|
|
40840dbd5c | ||
|
|
786ae9369b | ||
|
|
b7bbf10415 | ||
|
|
486ac01416 | ||
|
|
9e01cc48a5 | ||
|
|
37996d0477 | ||
|
|
a15ff9040b | ||
|
|
b3cd3f431f | ||
|
|
649d1f650a | ||
|
|
215e4064fa | ||
|
|
66a0b2543b | ||
|
|
378841b408 | ||
|
|
e28d726182 | ||
|
|
71bc27e3d9 | ||
|
|
bcfb2700cb | ||
|
|
2d9491ac93 | ||
|
|
4977c3e4fa | ||
|
|
54a0ca5247 | ||
|
|
024a624083 | ||
|
|
9a02416403 | ||
|
|
91e5bc8ba1 | ||
|
|
97afdfa8a9 | ||
|
|
67f91b80f2 | ||
|
|
1b3ce431e6 | ||
|
|
d24895575c | ||
|
|
c97e355349 | ||
|
|
3c8cd0386d | ||
|
|
600db3fb8a | ||
|
|
161595e7c8 | ||
|
|
0ecdf4dd2b | ||
|
|
32ce79b8af | ||
|
|
8070ae3c4b | ||
|
|
55b20c75c0 | ||
|
|
5d4dff7948 | ||
|
|
b1229b6971 | ||
|
|
9474d53a93 | ||
|
|
6f05db723f | ||
|
|
056bccb89a | ||
|
|
e00cd90aef | ||
|
|
8bb59d581f | ||
|
|
b9068da99c | ||
|
|
9f3f7e65a4 | ||
|
|
e6a804836b | ||
|
|
5d8d3e4a41 | ||
|
|
298d9d7016 | ||
|
|
d7fbbcefc5 | ||
|
|
36e198eb1b | ||
|
|
130e59f4c1 | ||
|
|
9223e7c056 | ||
|
|
c3487411fb | ||
|
|
142dd9d579 | ||
|
|
53d537bda8 | ||
|
|
24e11b8ed6 | ||
|
|
14a7b040f9 | ||
|
|
2af3e992a1 | ||
|
|
737c3faacc | ||
|
|
03792b0245 | ||
|
|
dddda052fa | ||
|
|
c50a914632 | ||
|
|
5f082973eb | ||
|
|
2f0419f796 | ||
|
|
cbe451a793 | ||
|
|
aa8d449140 | ||
|
|
7e709d9d6f | ||
|
|
f5938fa8e2 | ||
|
|
ca2509e9f9 | ||
|
|
1d2ba8c06c | ||
|
|
73275aa8ae | ||
|
|
2c32096ec9 | ||
|
|
6532e33296 | ||
|
|
7ea8cb63d2 | ||
|
|
1df29b62eb | ||
|
|
8a5b31f143 | ||
|
|
4d7a8e5980 | ||
|
|
aeeed71231 | ||
|
|
f6c4cc8a5f | ||
|
|
d019388034 | ||
|
|
e125d6a452 | ||
|
|
6b5a1fb827 | ||
|
|
0491b08818 | ||
|
|
7b9adc1da2 | ||
|
|
3acaea0019 | ||
|
|
be02393f65 | ||
|
|
614bf72f01 | ||
|
|
bed28b82ab | ||
|
|
c047d48d91 | ||
|
|
5222bffce4 | ||
|
|
42e7a49d37 | ||
|
|
686bddf7d5 | ||
|
|
1c420b8eee | ||
|
|
e2a0325d07 | ||
|
|
9d03c151af | ||
|
|
3c18bfdc81 | ||
|
|
d89ba65238 | ||
|
|
d2cf2ee7b5 | ||
|
|
7a03331955 | ||
|
|
7c5ef3803a | ||
|
|
6f3e7c86e5 | ||
|
|
fc51de2b4f | ||
|
|
e1e75710cb | ||
|
|
87ce08e9b9 | ||
|
|
1a5c7521a5 | ||
|
|
b54e94dfbe | ||
|
|
19977d5f4d | ||
|
|
0492f19a95 | ||
|
|
098b039154 | ||
|
|
5c6e6059f8 | ||
|
|
72d45543df | ||
|
|
e96fc46315 | ||
|
|
f0cfbb80dd | ||
|
|
a199f03a60 | ||
|
|
526c9609ef | ||
|
|
ec9ceeefb3 | ||
|
|
b6c6505824 | ||
|
|
93c61c48f9 | ||
|
|
9b89e80bb5 | ||
|
|
e0ecaa6e08 | ||
|
|
a7c89b5d1a | ||
|
|
834846d339 | ||
|
|
45c8bb73fa | ||
|
|
d2580f8a99 | ||
|
|
804c2e6359 | ||
|
|
3f2ec612d5 | ||
|
|
8bead998f5 | ||
|
|
2ecdaba183 | ||
|
|
82cb10a03d | ||
|
|
8717ce38eb | ||
|
|
5858a85a50 | ||
|
|
65d16da997 | ||
|
|
b1b5ae5fd2 | ||
|
|
b5ec6d8877 | ||
|
|
8599aebed9 | ||
|
|
2b9e753033 | ||
|
|
dba50744a9 | ||
|
|
490569e023 | ||
|
|
e79f2af759 | ||
|
|
ec7ee1ce91 | ||
|
|
672207c27c | ||
|
|
a1a6b3e988 | ||
|
|
2347135614 | ||
|
|
93438ddd97 | ||
|
|
ae31c41643 | ||
|
|
16aed8741d | ||
|
|
e878ca0c7f | ||
|
|
ca61dd2543 | ||
|
|
6187253589 | ||
|
|
b51c80742f | ||
|
|
15352b9216 | ||
|
|
a848b21ae8 | ||
|
|
279aca7287 | ||
|
|
88879c956a | ||
|
|
729b7e27a8 | ||
|
|
feaed168ae | ||
|
|
50edb18db3 | ||
|
|
7302e2806d | ||
|
|
8845306b4a | ||
|
|
09e19e1486 | ||
|
|
0f5478925c | ||
|
|
09dce0b0d1 | ||
|
|
ad98b1cb5e | ||
|
|
8effd97749 | ||
|
|
9dbed72c32 | ||
|
|
b4dd3692b8 | ||
|
|
030cbb856c | ||
|
|
511101e9b7 | ||
|
|
60dd2b2df7 | ||
|
|
218dc94e02 | ||
|
|
2440f578b1 | ||
|
|
09c87237cb | ||
|
|
3d974ddd91 | ||
|
|
1489c970ba | ||
|
|
9e0afca3d1 | ||
|
|
99eda4013e | ||
|
|
a62f81f890 | ||
|
|
66f0731731 | ||
|
|
dc239801c6 | ||
|
|
d4ba0988bc | ||
|
|
ad0f953b2a | ||
|
|
e1bc9eabd6 | ||
|
|
d3dc1a8667 | ||
|
|
bf278120de | ||
|
|
2f52f6e009 | ||
|
|
02363c3113 | ||
|
|
cfaac0fcbc | ||
|
|
bee0405e00 | ||
|
|
50bdf0ee81 | ||
|
|
a27ddbe0d0 | ||
|
|
0d652b9153 | ||
|
|
9468fd189b | ||
|
|
215737ad9b | ||
|
|
123c25b142 | ||
|
|
af56198f0e | ||
|
|
3c73fdfd6e | ||
|
|
b391ebbb5f | ||
|
|
bad5a1f9f0 | ||
|
|
a7470b463f | ||
|
|
d6c706cb35 | ||
|
|
a0d6950c75 | ||
|
|
2495200b36 | ||
|
|
bfe7ae0b1b | ||
|
|
4912abbf07 | ||
|
|
2f2998d02e | ||
|
|
c96349fa1c | ||
|
|
f640576cc3 | ||
|
|
77d725a488 | ||
|
|
2c0305f928 | ||
|
|
21fd61d507 | ||
|
|
8fb56a5342 | ||
|
|
5d7b73f876 | ||
|
|
85b2a38058 | ||
|
|
c78517ee75 | ||
|
|
ae116d3dfe | ||
|
|
93252f9a40 | ||
|
|
3c03a4db2e | ||
|
|
d0fcd617aa | ||
|
|
6ca0decbd6 | ||
|
|
ddd9ca933e | ||
|
|
b2cc29569e | ||
|
|
411735772b | ||
|
|
2ffb2963af | ||
|
|
227c88c8a2 | ||
|
|
cbe9c79498 | ||
|
|
1b8c100b43 | ||
|
|
30c5fd64f2 | ||
|
|
3a6b486340 | ||
|
|
ded7335dbf | ||
|
|
005a4f8119 | ||
|
|
1ac49bfa7f | ||
|
|
c302c4d121 | ||
|
|
b0a524cf62 | ||
|
|
d246ffff30 | ||
|
|
adfc8b2d6f | ||
|
|
ad2ab08466 | ||
|
|
f3369410b2 | ||
|
|
bac38a5bd8 | ||
|
|
e5f5df74ad | ||
|
|
b3837f581a | ||
|
|
b2ab6f58e9 | ||
|
|
e04b59ba15 | ||
|
|
366eacd234 | ||
|
|
f792876c0a | ||
|
|
19f7a5171b | ||
|
|
5b6377cc11 | ||
|
|
9502ca3069 | ||
|
|
77629000b2 | ||
|
|
ca7916f992 | ||
|
|
9de83843a3 | ||
|
|
cbab7bb0c9 | ||
|
|
3df8d60eed | ||
|
|
b39dd1a19f | ||
|
|
0af5963d08 | ||
|
|
4f8b8e978b | ||
|
|
5654254cbb | ||
|
|
11f37e896a | ||
|
|
e8f563deeb | ||
|
|
f877354a11 | ||
|
|
df3d3b5ddc | ||
|
|
59e74d70b4 | ||
|
|
8d6b7c3ac8 | ||
|
|
372d2ff870 | ||
|
|
32a8363b45 | ||
|
|
87f1f8986f | ||
|
|
b3c08053fb | ||
|
|
a5208dcf1e | ||
|
|
2782953518 | ||
|
|
366055145e | ||
|
|
39ebdb47b1 | ||
|
|
c788292db8 | ||
|
|
f0dc80437c | ||
|
|
2d6c5c2331 | ||
|
|
bc4e6cb5b0 | ||
|
|
d69ad46c10 | ||
|
|
ba7b616f88 | ||
|
|
8355b7e3b9 | ||
|
|
22ffb656be | ||
|
|
de80d2a6c1 | ||
|
|
a320b4a24f | ||
|
|
fc13777211 | ||
|
|
75347f9d0a | ||
|
|
9abf64c6ab | ||
|
|
1702103f5d | ||
|
|
8f68a989b9 | ||
|
|
b51a0102ef | ||
|
|
e177c2c6b0 | ||
|
|
3567fdf51d | ||
|
|
323097ba65 | ||
|
|
33f2bab7ac | ||
|
|
c063cfb201 | ||
|
|
e99aa3d3b4 | ||
|
|
ec162ff84c | ||
|
|
f0db2865f2 | ||
|
|
f97b2150b9 | ||
|
|
8ce8aaddf9 | ||
|
|
e4a85a4ed7 | ||
|
|
f61a415b43 | ||
|
|
29ed3b4553 | ||
|
|
a87309e792 | ||
|
|
ddb5b5ef87 | ||
|
|
7a58bf85b6 | ||
|
|
8707eb2c88 | ||
|
|
08499ac73f | ||
|
|
70170ff70f | ||
|
|
bad5589c0d | ||
|
|
7de28519a1 | ||
|
|
bbd907514e | ||
|
|
4a68cd9407 | ||
|
|
dc327a2855 | ||
|
|
9af593a785 | ||
|
|
24f4c22cdd | ||
|
|
bc462b9652 | ||
|
|
047dec6da1 | ||
|
|
bf935555bb | ||
|
|
efe36b0682 | ||
|
|
a18d4498aa | ||
|
|
803dc2531c | ||
|
|
1b062bcd06 | ||
|
|
a24c3736f4 | ||
|
|
ac61b681e6 | ||
|
|
0866bfd555 | ||
|
|
79fed701d9 | ||
|
|
48a93990e8 | ||
|
|
414ba25d61 | ||
|
|
f67f90e8b0 | ||
|
|
5751c70212 | ||
|
|
4e15c426a8 | ||
|
|
ceda189260 | ||
|
|
fce0ae33e7 | ||
|
|
fc5c6ef841 | ||
|
|
d0033578d5 | ||
|
|
670ec3a097 | ||
|
|
8bfb1d5470 | ||
|
|
46a916a945 | ||
|
|
459e77390a | ||
|
|
f4ab46b79d | ||
|
|
3c58e98788 | ||
|
|
36de81248c | ||
|
|
925353d515 | ||
|
|
7c32897321 | ||
|
|
cbeda19d27 | ||
|
|
8148ca48af | ||
|
|
adcb55ffbc | ||
|
|
1152b13220 | ||
|
|
166383e1ed | ||
|
|
0d5d1b20e3 | ||
|
|
77ea43f61a | ||
|
|
f988344222 | ||
|
|
60489e1fef | ||
|
|
ac8aa17a80 | ||
|
|
25a42126df | ||
|
|
1b90e0b50c | ||
|
|
7f5ad7eb20 | ||
|
|
0e6713b6e2 | ||
|
|
96d3996bec | ||
|
|
0fb148d31e | ||
|
|
cebca28b19 | ||
|
|
af8cc0255e | ||
|
|
775ae00861 | ||
|
|
1b80f5f1b3 | ||
|
|
f9a7bbeddf | ||
|
|
58a0264565 | ||
|
|
6d2af95e9a | ||
|
|
bf46b19dc9 | ||
|
|
7749fd10f1 | ||
|
|
90bc321aca | ||
|
|
bad4fae1b8 | ||
|
|
c3fc435fdc | ||
|
|
2ab0c78728 | ||
|
|
187989f6b8 | ||
|
|
3b83412bcb | ||
|
|
968ea458da | ||
|
|
a9f4fbbdd4 | ||
|
|
6b3b45e9af | ||
|
|
2355dfce07 | ||
|
|
0e8c9591e4 | ||
|
|
54e4771f36 | ||
|
|
b2eb245feb | ||
|
|
e826314d06 | ||
|
|
0eec2e7ab8 | ||
|
|
5e9c239ea3 | ||
|
|
1fd9b0fbcb | ||
|
|
8413343e76 | ||
|
|
2a0427c559 | ||
|
|
5d9d232585 | ||
|
|
f0f0329f9b | ||
|
|
2a45849e6d | ||
|
|
aa89079e28 | ||
|
|
31b9ee5910 | ||
|
|
6a54fe101c | ||
|
|
87b3d34024 | ||
|
|
b8bbe9264a | ||
|
|
0c7dd192b0 | ||
|
|
8b487d79e4 | ||
|
|
cb83a8e870 | ||
|
|
0bc11a07cf | ||
|
|
560cbad5d7 | ||
|
|
87e9bf8749 | ||
|
|
770f58c668 | ||
|
|
4b806ecfde | ||
|
|
7303e06943 | ||
|
|
846b249fb3 | ||
|
|
67f23494e2 | ||
|
|
d7efb627d7 | ||
|
|
08bc0b9963 | ||
|
|
d1ed46860c | ||
|
|
38f694d262 | ||
|
|
75ef3217ac | ||
|
|
2847dff64a | ||
|
|
f0d9ef99ea | ||
|
|
67702096d7 | ||
|
|
88f124af9d | ||
|
|
d34460c4e3 | ||
|
|
f4f3db7436 | ||
|
|
3ebfa90ca1 | ||
|
|
733fdd0d7a | ||
|
|
09893605eb | ||
|
|
57468ef932 | ||
|
|
c6afb1c133 | ||
|
|
05c0b51fde | ||
|
|
de8cfa24f9 | ||
|
|
fe714c69a7 | ||
|
|
ac219cf2ba | ||
|
|
77b1102100 | ||
|
|
5117e6cbe8 | ||
|
|
61c4e13c3e | ||
|
|
f1190b7be3 | ||
|
|
49e7087b9b | ||
|
|
c397b5a601 | ||
|
|
c809dcc609 | ||
|
|
7eec82deee | ||
|
|
b061db1189 | ||
|
|
8715dd2d6b | ||
|
|
63b0aaaa7f | ||
|
|
d20dd1af8c | ||
|
|
e1f32d3d0b | ||
|
|
eaa3433034 | ||
|
|
838016c89f | ||
|
|
030a88f5a3 | ||
|
|
de3ba5529a | ||
|
|
7962758e05 | ||
|
|
0f9d1c0792 | ||
|
|
48be38a2d8 | ||
|
|
207893e5a8 | ||
|
|
e07d6fa854 | ||
|
|
e26698d0d8 | ||
|
|
a8837c8e2a | ||
|
|
7395f02fb8 | ||
|
|
706ada2940 | ||
|
|
d957846ab0 | ||
|
|
bbe90ca74b | ||
|
|
96611fa2c2 | ||
|
|
c94edf05ef | ||
|
|
74adb6f30c | ||
|
|
421abe5768 | ||
|
|
1d003c561e | ||
|
|
b22177ee17 | ||
|
|
a1e8c761ef | ||
|
|
ad194d1bab | ||
|
|
2bb5082943 | ||
|
|
2c3648f8c2 | ||
|
|
3d816c3570 | ||
|
|
e1194d26bd | ||
|
|
8167e9e9f2 | ||
|
|
3b357c4d40 | ||
|
|
89cb54676d | ||
|
|
73c251ff4d | ||
|
|
0d51b39604 | ||
|
|
af0dbf1566 | ||
|
|
01146a5624 | ||
|
|
316cdb4068 | ||
|
|
91cae70fa1 | ||
|
|
2723926f83 | ||
|
|
2aff9ee817 | ||
|
|
c87e6553dc | ||
|
|
5d580544e7 | ||
|
|
08ea0e0f18 | ||
|
|
c8b441dbd4 | ||
|
|
1aa22789e5 | ||
|
|
cff5494db4 | ||
|
|
9bd6507342 | ||
|
|
379461e649 | ||
|
|
cc52ae5bd7 | ||
|
|
39f6d6c831 | ||
|
|
649258bd2b | ||
|
|
de9431f649 | ||
|
|
18f9e38090 | ||
|
|
2e37f1e687 | ||
|
|
5e8f2d0523 | ||
|
|
9fb6c33319 | ||
|
|
fdecac4230 | ||
|
|
85c27a6cca | ||
|
|
57f56d31a2 | ||
|
|
df25675d3f | ||
|
|
277a84702a | ||
|
|
c651296378 | ||
|
|
866d25e86a | ||
|
|
5e62f1b889 | ||
|
|
e9d524ad14 | ||
|
|
158c8b4b8a | ||
|
|
41df207bb9 | ||
|
|
692ffabe82 | ||
|
|
944ad5a571 | ||
|
|
5ca70d3940 | ||
|
|
904752e3dd | ||
|
|
cf61798466 | ||
|
|
fd72f459f9 | ||
|
|
1bc462b300 | ||
|
|
1c6f91f101 | ||
|
|
a7c28f066a | ||
|
|
604c8ab6e5 | ||
|
|
23a3ee39cc | ||
|
|
fa16db129b | ||
|
|
de249c448b | ||
|
|
e1bc56c500 | ||
|
|
d1d115d11f | ||
|
|
aca41b4f6e | ||
|
|
1e3ae996ac | ||
|
|
b3b2e74688 | ||
|
|
44237bec5c | ||
|
|
53b44f44e3 | ||
|
|
9af7a184ad | ||
|
|
9c8d87ec64 | ||
|
|
4c34968d28 | ||
|
|
2d71f5173a | ||
|
|
2e942113c6 | ||
|
|
e20540ccc6 | ||
|
|
8d7e0e9f46 | ||
|
|
cc5d94f58d | ||
|
|
26197e433c | ||
|
|
f54b4dfd0e | ||
|
|
085ba52294 | ||
|
|
b8c24680a5 | ||
|
|
c658582157 | ||
|
|
83e518d503 | ||
|
|
2163d0f822 | ||
|
|
34c920eede | ||
|
|
35b0b5ef9b | ||
|
|
08672c33bd | ||
|
|
e2651d6c7c | ||
|
|
851a4e12d2 | ||
|
|
b7c66ec844 | ||
|
|
7522a3a820 | ||
|
|
6a0402d1cf | ||
|
|
5309af84f7 | ||
|
|
8d8d77fa11 | ||
|
|
284cf07e97 | ||
|
|
16414c7585 | ||
|
|
70c9eed0bf | ||
|
|
f49b1fef17 | ||
|
|
3fe070987a | ||
|
|
00d5610213 | ||
|
|
d3c1a605df | ||
|
|
85df151a96 | ||
|
|
8915797aac | ||
|
|
03a5d71a95 | ||
|
|
4158d4ac10 | ||
|
|
f934676bd0 | ||
|
|
d5b802e794 | ||
|
|
139227e46d | ||
|
|
2394d51a51 | ||
|
|
d9fa2bea5b | ||
|
|
0cb360eeed | ||
|
|
ea472f873f | ||
|
|
8cbdbd527e | ||
|
|
ff0d893bd9 | ||
|
|
7b924d0486 | ||
|
|
712eb07f4b | ||
|
|
d5c3ecc7df | ||
|
|
c4bf089667 | ||
|
|
378b03e06e | ||
|
|
34235382fb | ||
|
|
c05aff0768 | ||
|
|
f0c3e0fd1a | ||
|
|
d601cbda0e | ||
|
|
2653dc6b38 | ||
|
|
48cbbfc656 | ||
|
|
d6892b9203 | ||
|
|
59f0844fcc |
38
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: Bug Report
|
||||||
|
about: Create a report to help us improve sdrtrunk
|
||||||
|
title: ''
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**sdrtrunk Version**
|
||||||
|
Indicate which sdrtrunk version you are using. Use 'master-branch' if you are running the latest code.
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Application Log**
|
||||||
|
If applicable, include either the full application log,or a snippet of the error logging.
|
||||||
|
|
||||||
|
**Desktop (optional - complete the following information):**
|
||||||
|
- OS: [e.g. iOS]
|
||||||
|
- CPU Cores: [e.g. 4 cores]
|
||||||
|
- RAM:[e.g. 16GB]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: Support and Questions - How do I XXX? Does it support XXX?
|
||||||
|
url: https://github.com/DSheirer/sdrtrunk/wiki/Support
|
||||||
|
about: Please ask your user questions here -- DO NOT create an issue if you have a user question please!!
|
||||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: feature
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
34
.github/workflows/gradle.yml
vendored
Normal file
34
.github/workflows/gradle.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# This workflow uses actions that are not certified by GitHub.
|
||||||
|
# They are provided by a third-party and are governed by
|
||||||
|
# separate terms of service, privacy policy, and support
|
||||||
|
# documentation.
|
||||||
|
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||||
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||||
|
|
||||||
|
name: Java CI with Gradle
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: Set up JDK 27
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
java-version: '27'
|
||||||
|
distribution: 'liberica'
|
||||||
|
java-package: 'jdk+fx'
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v6
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew clean build
|
||||||
51
.github/workflows/nightly.yml
vendored
Normal file
51
.github/workflows/nightly.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# Create nightly release for Linux, Mac and Windows using the Linux runner.
|
||||||
|
name: Nightly Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
# Don't run nightly build for pull requests - uncomment to test changes to this action within scope of the PR review
|
||||||
|
# pull_request:
|
||||||
|
# branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
nightly:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
# Full history and tags, so the build can describe the commit relative to the latest version tag
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up JDK 27
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
# Must match the JDK version downloaded in build.gradle (jdk_download_base) - jlink requires an exact version match
|
||||||
|
java-version: '27.0.0'
|
||||||
|
distribution: 'liberica'
|
||||||
|
java-package: 'jdk+fx'
|
||||||
|
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v6
|
||||||
|
|
||||||
|
- name: Build Linux and Mac releases with Gradle
|
||||||
|
run: ./gradlew runtimeZipOthers -PprojectVersion=nightly
|
||||||
|
|
||||||
|
- name: Build Windows release with Gradle
|
||||||
|
run: ./gradlew runtimeZipWindows -PprojectVersion=nightly
|
||||||
|
|
||||||
|
- name: Create Build Info file
|
||||||
|
run: |
|
||||||
|
echo -e "ref: $GITHUB_REF \ncommit: $GITHUB_SHA\ndescribe: $(git describe --tags --match 'v[0-9]*' --dirty)\nbuild: $(date +"%Y-%m-%dT%H:%M:%SZ")" > build/image/build_info.txt
|
||||||
|
|
||||||
|
- name: Add build artifacts to nightly release
|
||||||
|
uses: softprops/action-gh-release@v3
|
||||||
|
with:
|
||||||
|
tag_name: nightly
|
||||||
|
prerelease: true
|
||||||
|
files: |
|
||||||
|
build/image/*.zip
|
||||||
|
build/image/build_info.txt
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
132
.github/workflows/release.yml
vendored
Normal file
132
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
# Publishes a release when a version tag is pushed: v0.6.2 for a final release,
|
||||||
|
# or v0.6.2-beta-1 / v0.6.2-alpha-1 for a pre-release. The build derives the
|
||||||
|
# version from the tag (see build.gradle).
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ['v[0-9]+.[0-9]+.[0-9]+*']
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
previous_tag: ${{ steps.previous.outputs.tag }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
# Full history and tags, to find the previous release tag for the release notes
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# Release notes list the PRs since the previous version tag (never 'nightly'). A final release
|
||||||
|
# starts from the previous final release, so it covers every alpha and beta in between.
|
||||||
|
- id: previous
|
||||||
|
run: |
|
||||||
|
exclude=(--exclude "$GITHUB_REF_NAME")
|
||||||
|
if [[ "$GITHUB_REF_NAME" != *-* ]]; then
|
||||||
|
exclude+=(--exclude '*-*')
|
||||||
|
fi
|
||||||
|
tag="$(git describe --tags --abbrev=0 --match 'v[0-9]*' "${exclude[@]}" HEAD 2>/dev/null || true)"
|
||||||
|
echo "Release notes start from: ${tag:-(GitHub default)}"
|
||||||
|
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Set up JDK 27
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
# Must match the JDK version downloaded in build.gradle (jdk_download_base) - jlink requires an exact version match
|
||||||
|
java-version: '27.0.0'
|
||||||
|
distribution: 'liberica'
|
||||||
|
java-package: 'jdk+fx'
|
||||||
|
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v6
|
||||||
|
|
||||||
|
# The version comes from 'git describe', which can pick a different tag when more than one
|
||||||
|
# version tag points at the same commit. Fail rather than publish zips with the wrong version.
|
||||||
|
- id: version
|
||||||
|
run: |
|
||||||
|
version="$(./gradlew -q printVersion --console=plain | tail -n 1)"
|
||||||
|
if [ "v$version" != "$GITHUB_REF_NAME" ]; then
|
||||||
|
echo "::error::Build version $version does not match tag $GITHUB_REF_NAME"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Build and test
|
||||||
|
run: ./gradlew clean build --console=plain
|
||||||
|
|
||||||
|
# The runtime plugin can't build Windows and the other platforms in the same invocation.
|
||||||
|
- name: Build Linux and Mac releases
|
||||||
|
run: ./gradlew runtimeZipOthers --console=plain
|
||||||
|
|
||||||
|
- name: Build Windows release
|
||||||
|
run: ./gradlew runtimeZipWindows --console=plain
|
||||||
|
|
||||||
|
- name: Check release zips
|
||||||
|
env:
|
||||||
|
VERSION: ${{ steps.version.outputs.version }}
|
||||||
|
run: |
|
||||||
|
missing=0
|
||||||
|
for platform in linux-aarch64 linux-x86_64 osx-aarch64 osx-x86_64 windows-aarch64 windows-x86_64; do
|
||||||
|
zip="build/image/sdr-trunk-${platform}-v${VERSION}.zip"
|
||||||
|
if [ ! -f "$zip" ]; then
|
||||||
|
echo "::error::Missing $zip"
|
||||||
|
missing=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
ls -l build/image/*.zip
|
||||||
|
exit $missing
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: release-zips
|
||||||
|
path: build/image/*.zip
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
|
publish:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: release-zips
|
||||||
|
path: zips
|
||||||
|
|
||||||
|
# Publishing is split into steps that can all be repeated, so a failed
|
||||||
|
# upload or a re-run finishes the draft left behind rather than failing on
|
||||||
|
# it: gh retries uploads, and a retry of an upload that had in fact
|
||||||
|
# succeeded fails with "ReleaseAsset.name already exists" unless clobbering.
|
||||||
|
- name: Create release
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
GH_REPO: ${{ github.repository }}
|
||||||
|
VERSION: ${{ needs.build.outputs.version }}
|
||||||
|
PREVIOUS_TAG: ${{ needs.build.outputs.previous_tag }}
|
||||||
|
run: |
|
||||||
|
(cd zips && sha256sum *.zip > SHA256SUMS)
|
||||||
|
prerelease=()
|
||||||
|
if [[ "$GITHUB_REF_NAME" == *-* ]]; then
|
||||||
|
prerelease=(--prerelease)
|
||||||
|
fi
|
||||||
|
notes_start=()
|
||||||
|
if [ -n "$PREVIOUS_TAG" ]; then
|
||||||
|
notes_start=(--notes-start-tag "$PREVIOUS_TAG")
|
||||||
|
fi
|
||||||
|
if gh release view "$GITHUB_REF_NAME" --json isDraft --jq .isDraft 2>/dev/null | grep -qx false; then
|
||||||
|
echo "::error::Release $GITHUB_REF_NAME is already published"
|
||||||
|
exit 1
|
||||||
|
elif gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
|
||||||
|
echo "Reusing the draft release $GITHUB_REF_NAME"
|
||||||
|
else
|
||||||
|
gh release create "$GITHUB_REF_NAME" --draft "${prerelease[@]}" \
|
||||||
|
--verify-tag --generate-notes "${notes_start[@]}" --title "Version $VERSION"
|
||||||
|
fi
|
||||||
|
gh release upload "$GITHUB_REF_NAME" zips/* --clobber
|
||||||
|
gh release edit "$GITHUB_REF_NAME" --draft=false
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -17,7 +17,7 @@ out/
|
|||||||
*.class
|
*.class
|
||||||
*.log
|
*.log
|
||||||
# Package Files #
|
# Package Files #
|
||||||
*.jar
|
#*.jar
|
||||||
|
|
||||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
hs_err_pid*
|
hs_err_pid*
|
||||||
|
|||||||
9
.idea/compiler.xml
generated
9
.idea/compiler.xml
generated
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerConfiguration">
|
|
||||||
<bytecodeTargetLevel>
|
|
||||||
<module name="sdr-trunk_main" target="11" />
|
|
||||||
<module name="sdr-trunk_test" target="11" />
|
|
||||||
</bytecodeTargetLevel>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
11
.idea/dictionaries/denny.xml
generated
11
.idea/dictionaries/denny.xml
generated
@@ -2,15 +2,24 @@
|
|||||||
<dictionary name="denny">
|
<dictionary name="denny">
|
||||||
<words>
|
<words>
|
||||||
<w>bahroo</w>
|
<w>bahroo</w>
|
||||||
|
<w>baseband</w>
|
||||||
|
<w>basebanded</w>
|
||||||
<w>broadcastify</w>
|
<w>broadcastify</w>
|
||||||
|
<w>cach</w>
|
||||||
<w>correlator</w>
|
<w>correlator</w>
|
||||||
|
<w>deinterleave</w>
|
||||||
|
<w>descrambled</w>
|
||||||
|
<w>dibit</w>
|
||||||
<w>dinf</w>
|
<w>dinf</w>
|
||||||
|
<w>dqpsk</w>
|
||||||
<w>esnid</w>
|
<w>esnid</w>
|
||||||
<w>fleetsync</w>
|
<w>fleetsync</w>
|
||||||
<w>heterdyned</w>
|
<w>heterdyned</w>
|
||||||
<w>heterodynes</w>
|
<w>heterodynes</w>
|
||||||
|
<w>hytera</w>
|
||||||
<w>icecast</w>
|
<w>icecast</w>
|
||||||
<w>ident</w>
|
<w>ident</w>
|
||||||
|
<w>lcns</w>
|
||||||
<w>nutall</w>
|
<w>nutall</w>
|
||||||
<w>overflowable</w>
|
<w>overflowable</w>
|
||||||
<w>polyphase</w>
|
<w>polyphase</w>
|
||||||
@@ -23,8 +32,10 @@
|
|||||||
<w>shoutcast</w>
|
<w>shoutcast</w>
|
||||||
<w>streamable</w>
|
<w>streamable</w>
|
||||||
<w>talkgroup</w>
|
<w>talkgroup</w>
|
||||||
|
<w>talkgroups</w>
|
||||||
<w>tgid</w>
|
<w>tgid</w>
|
||||||
<w>ultravox</w>
|
<w>ultravox</w>
|
||||||
|
<w>unsynchronized</w>
|
||||||
<w>wacn</w>
|
<w>wacn</w>
|
||||||
<w>xtea</w>
|
<w>xtea</w>
|
||||||
</words>
|
</words>
|
||||||
|
|||||||
14
.idea/libraries/imports.xml
generated
14
.idea/libraries/imports.xml
generated
@@ -1,14 +0,0 @@
|
|||||||
<component name="libraryTable">
|
|
||||||
<library name="imports">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$PROJECT_DIR$/imports/jmbe-interface-0.3.3.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/imports/java-lame-3.98.4.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/imports/radioreference-14.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/imports/wsdl4j-1.5.1.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/imports/commons-math3-3.6.1.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/imports/libresample4j-0.1.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</component>
|
|
||||||
49
.idea/misc.xml
generated
49
.idea/misc.xml
generated
@@ -1,6 +1,53 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="11" project-jdk-type="JavaSDK">
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="NullableNotNullManager">
|
||||||
|
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
|
||||||
|
<option name="myDefaultNotNull" value="org.jetbrains.annotations.NotNull" />
|
||||||
|
<option name="myOrdered" value="true" />
|
||||||
|
<option name="myNullables">
|
||||||
|
<value>
|
||||||
|
<list size="13">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="org.jspecify.annotations.Nullable" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||||
|
<item index="2" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
|
||||||
|
<item index="3" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
|
||||||
|
<item index="4" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
|
||||||
|
<item index="5" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
|
||||||
|
<item index="6" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||||
|
<item index="7" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||||
|
<item index="8" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
||||||
|
<item index="9" class="java.lang.String" itemvalue="io.reactivex.annotations.Nullable" />
|
||||||
|
<item index="10" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.Nullable" />
|
||||||
|
<item index="11" class="java.lang.String" itemvalue="org.springframework.lang.Nullable" />
|
||||||
|
<item index="12" class="java.lang.String" itemvalue="jakarta.annotation.Nullable" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="myNotNulls">
|
||||||
|
<value>
|
||||||
|
<list size="13">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="org.jspecify.annotations.NonNull" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||||
|
<item index="2" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
|
||||||
|
<item index="3" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
|
||||||
|
<item index="4" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
|
||||||
|
<item index="5" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
|
||||||
|
<item index="6" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||||
|
<item index="7" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||||
|
<item index="8" class="java.lang.String" itemvalue="lombok.NonNull" />
|
||||||
|
<item index="9" class="java.lang.String" itemvalue="io.reactivex.annotations.NonNull" />
|
||||||
|
<item index="10" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.NonNull" />
|
||||||
|
<item index="11" class="java.lang.String" itemvalue="org.springframework.lang.NonNull" />
|
||||||
|
<item index="12" class="java.lang.String" itemvalue="jakarta.annotation.Nonnull" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_27_PREVIEW" project-jdk-name="liberica-27" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
10
.idea/modules.xml
generated
10
.idea/modules.xml
generated
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/sdr-trunk.iml" filepath="$PROJECT_DIR$/.idea/modules/sdr-trunk.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/sdr-trunk_main.iml" filepath="$PROJECT_DIR$/.idea/modules/sdr-trunk_main.iml" group="sdr-trunk" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/sdr-trunk_test.iml" filepath="$PROJECT_DIR$/.idea/modules/sdr-trunk_test.iml" group="sdr-trunk" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
12
.idea/vcs.xml
generated
12
.idea/vcs.xml
generated
@@ -1,16 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="IssueNavigationConfiguration">
|
|
||||||
<option name="links">
|
|
||||||
<list>
|
|
||||||
<IssueNavigationLink>
|
|
||||||
<option name="issueRegexp" value="#(\d+)" />
|
|
||||||
<option name="linkRegexp" value="https://github.com/DSheirer/sdrtrunk/issues/$1" />
|
|
||||||
</IssueNavigationLink>
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
15
CHANGELOG
15
CHANGELOG
@@ -1,3 +1,18 @@
|
|||||||
|
0.4.0 20200404
|
||||||
|
- Release includes embedded Java 14 & JavaFX 13 runtime
|
||||||
|
- Adds Polyphase Channelizer with 2x channel oversampling and redesigned source management
|
||||||
|
- Adds P25 Phase 2 decoder
|
||||||
|
- Adds P25 radio identifier aliasing
|
||||||
|
- JMBE library 1.0.4 with support for AMBE tone metadata
|
||||||
|
- New JavaFX User Preferences dialog
|
||||||
|
- HackRF tuner enhanced (sample rates and saturation issues)
|
||||||
|
- Adds support for Airspy mini tuner
|
||||||
|
- Redesigned audio sub-system that uses AudioSegments
|
||||||
|
- USB tuner bus saturation management/monitoring
|
||||||
|
- Bitstream (.bits) recording
|
||||||
|
- MP3 Audio Recording
|
||||||
|
- Numerous bug fixes
|
||||||
|
|
||||||
0.3.4 20180418
|
0.3.4 20180418
|
||||||
- New P25 C4FM decoder that uses Differential QPSK decoder instead of FM demodulation with 4FSK.
|
- New P25 C4FM decoder that uses Differential QPSK decoder instead of FM demodulation with 4FSK.
|
||||||
- Adds channel auto-start and ordering capability with startup dialog allowing user to invoke or bypass channel
|
- Adds channel auto-start and ordering capability with startup dialog allowing user to invoke or bypass channel
|
||||||
|
|||||||
118
README.md
118
README.md
@@ -1,80 +1,72 @@
|
|||||||
|

|
||||||
|

|
||||||
|
[](https://github.com/DSheirer/sdrtrunk/releases/latest)
|
||||||
|
[](https://github.com/DSheirer/sdrtrunk/releases)
|
||||||
|
[](LICENSE)
|
||||||
|
[](https://discord.gg/HJQaKYE)
|
||||||
|
[](https://groups.google.com/g/sdrtrunk)
|
||||||
|
|
||||||
# sdrtrunk
|
# sdrtrunk
|
||||||
A cross-platform java application for decoding, monitoring, recording and streaming trunked mobile and related radio protocols using Software Defined Radios (SDR).
|
A cross-platform java application for decoding, monitoring, recording and streaming trunked mobile and related radio protocols using Software Defined Radios (SDR).
|
||||||
|
|
||||||
* [Getting Started](https://github.com/DSheirer/sdrtrunk/wiki/GettingStarted_V0.3.0)
|
> ## 📖 [Read the sdrtrunk User Manual](https://github.com/DSheirer/sdrtrunk/wiki/User-Manual)
|
||||||
* [User's Manual Version 0.3.0](https://github.com/DSheirer/sdrtrunk/wiki/UserManual_V0.3.0)
|
> New to sdrtrunk? Start with the **[Getting Started](https://github.com/DSheirer/sdrtrunk/wiki/Getting-Started)** guide,
|
||||||
|
> then use the **[User Manual](https://github.com/DSheirer/sdrtrunk/wiki/User-Manual)** and
|
||||||
|
> **[How-To Guides](https://github.com/DSheirer/sdrtrunk/wiki/How-To-Guides)** to set up tuners, playlists, aliases and streaming.
|
||||||
|
|
||||||
|
* [Help/Wiki Home Page](https://github.com/DSheirer/sdrtrunk/wiki)
|
||||||
|
* [Getting Started](https://github.com/DSheirer/sdrtrunk/wiki/Getting-Started)
|
||||||
|
* [User Manual](https://github.com/DSheirer/sdrtrunk/wiki/User-Manual)
|
||||||
|
* [How-To Guides](https://github.com/DSheirer/sdrtrunk/wiki/How-To-Guides)
|
||||||
|
* [FAQ](https://github.com/DSheirer/sdrtrunk/wiki/FAQ)
|
||||||
* [Download](https://github.com/DSheirer/sdrtrunk/releases)
|
* [Download](https://github.com/DSheirer/sdrtrunk/releases)
|
||||||
* [Support](https://groups.google.com/forum/#!forum/sdrtrunk)
|
* [Support](https://github.com/DSheirer/sdrtrunk/wiki/Support)
|
||||||
|
|
||||||

|

|
||||||
**Figure 1:** sdrtrunk **Version 0.3.0** Application Screenshot
|
**Figure 1:** sdrtrunk decoding a P25 Phase 1 simulcast trunked radio system
|
||||||
|
|
||||||
# End User Instructions:
|
|
||||||
|
|
||||||
If you simply want to download and run the program, please follow these instructions.
|
|
||||||
|
|
||||||
## Install Java 8 (or newer)
|
|
||||||
|
|
||||||
## Download the latest sdrtrunk release
|
|
||||||
|
|
||||||
|
## Download the Latest Release
|
||||||
All release versions of sdrtrunk are available from the [releases](https://github.com/DSheirer/sdrtrunk/releases) tab.
|
All release versions of sdrtrunk are available from the [releases](https://github.com/DSheirer/sdrtrunk/releases) tab.
|
||||||
|
|
||||||
**(final)** These versions have been tested and are the current release version.
|
* **(alpha)** These versions are under development feature previews and likely to contain bugs and unexpected behavior.
|
||||||
|
* **(beta)** These versions are currently being tested for bugs and functionality prior to final release.
|
||||||
|
* **(final)** These versions have been tested and are the current release version.
|
||||||
|
|
||||||
**(alpha)** These versions are under development feature previews and likely to contain bugs and unexpected behavior.
|
## Download Nightly Software Build
|
||||||
|
The [nightly](https://github.com/DSheirer/sdrtrunk/releases/tag/nightly) release contains current builds of the software
|
||||||
|
for all supported operating systems. This version of the software may contain bugs and may not run correctly. However,
|
||||||
|
it let's you preview the most recent changes and fixes before the next software release. **Always backup your
|
||||||
|
playlist(s) before you use the nightly builds.** Note: the nightly release is updated each time code changes are
|
||||||
|
committed to the code base, so it's not really 'nightly' as much as it is 'current'.
|
||||||
|
|
||||||
**(beta)** These versions are currently being tested for bugs and functionality.
|
## Minimum System Requirements
|
||||||
|
* **Operating System:** Windows (~~32 or~~ 64-bit), Linux (~~32 or~~ 64-bit) or Mac (64-bit, 12.x or higher)
|
||||||
|
* **CPU:** 4-core
|
||||||
|
* **RAM:** 8GB or more (preferred). Depending on usage, 4GB may be sufficient.
|
||||||
|
|
||||||
## Run the application
|
## Creating a Release (Maintainers)
|
||||||
|
Releases are built and published automatically by the [Release](.github/workflows/release.yml) GitHub workflow
|
||||||
Either double-click on the downloaded file (if supported on your operating system) or open a terminal/command window
|
whenever a version tag is pushed to the repository.
|
||||||
and change to the directory where you downloaded the release file and type:
|
|
||||||
|
|
||||||
|
The version is taken from the tag, so there is no version number to update in the code. Create and push a tag
|
||||||
|
with a leading `v`, following the naming convention described in `gradle.properties` (e.g. `v0.6.2-alpha-1`,
|
||||||
|
`v0.6.2-beta-1` or `v0.6.2`):
|
||||||
```
|
```
|
||||||
java -jar downloaded-jar-filename
|
git tag v0.6.2-beta-1
|
||||||
|
git push origin v0.6.2-beta-1
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: replace _downloaded-jar-filename_ with the actual name of the sdrtrunk release version that you downloaded
|
Builds made from an untagged commit get a version like `0.6.2-beta-1-14-g4626d567` (14 commits after the
|
||||||
|
`v0.6.2-beta-1` tag, at commit `4626d567`), with `-dirty` appended when there are uncommitted changes.
|
||||||
|
|
||||||
## Optional - P25 Audio
|
The workflow then:
|
||||||
If you're using sdrtrunk with a P25 trunked radio system, the [JMBE](https://github.com/DSheirer/sdrtrunk/wiki/JMBE) wiki page contains instructions
|
* Verifies that the version the build derives from git matches the tag and fails if it does not.
|
||||||
for downloading the JMBE audio library source code and compiling the JMBE library. Copy the resulting JMBE audio library
|
* Builds and tests the code, then creates the release zips for Linux, Mac and Windows (x86-64 and aarch64).
|
||||||
jar file to the same folder containing the sdrtrunk application to use the library with sdrtrunk.
|
* Creates a GitHub release titled `Version <version>` with auto-generated release notes (a "What's Changed" list of
|
||||||
|
the PRs merged since the previous version tag), and attaches the six zip
|
||||||
|
files plus a `SHA256SUMS` checksum file.
|
||||||
|
* Marks tags containing a dash (alpha and beta versions) as pre-releases. Tags without a dash become full releases.
|
||||||
|
|
||||||
# Developer Instructions:
|
If the workflow fails part way through, fix the problem and re-run it from the Actions tab. It resumes from the
|
||||||
|
draft release left behind. It won't modify a release that has already been published. To rebuild a published
|
||||||
If you're interested in modifying and/or compiling the source code, please follow these instructions to use gradle to compile the code.
|
release, delete the release and the tag on GitHub, then push the tag again.
|
||||||
|
|
||||||
## Build the project
|
|
||||||
sdrtrunk uses gradle as the build system. You can build it with locally installed gradle or if you do not have/want
|
|
||||||
to install gradle you can use preconfigured linux/windows wrapper.
|
|
||||||
|
|
||||||
### Build with locally installed gradle 4.3.1
|
|
||||||
```
|
|
||||||
gradle clean buildSdr
|
|
||||||
```
|
|
||||||
### Build with preconfigured wrapper for linux/windows
|
|
||||||
Linux
|
|
||||||
```
|
|
||||||
./gradlew clean buildSdr
|
|
||||||
```
|
|
||||||
Windows
|
|
||||||
```
|
|
||||||
gradlew.bat clean buildSdr
|
|
||||||
```
|
|
||||||
This would add gradle, download all project dependencies and build JAR
|
|
||||||
|
|
||||||
## Development
|
|
||||||
All dependencies/versions are controlled from build.gradle.
|
|
||||||
To change the new release version tag of artifact - change property:
|
|
||||||
```
|
|
||||||
version = '0.3.2'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Run SDRTrunk
|
|
||||||
SDRTrunk is packed into single uber-jar file. There is need to have folders with dependencies and
|
|
||||||
adding them with classpath. Just run with java.
|
|
||||||
### Use Java8
|
|
||||||
```
|
|
||||||
java -jar build/libs/sdr-trunk-all-0.3.2.jar
|
|
||||||
```
|
|
||||||
|
|||||||
582
build.gradle
582
build.gradle
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2019 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,81 +14,249 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
import org.beryx.runtime.RuntimeZipTask
|
||||||
|
import org.gradle.internal.jvm.Jvm
|
||||||
|
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instructions for building/compiling the sdrtrunk application.
|
||||||
|
*
|
||||||
|
* Prerequisites:
|
||||||
|
* Install and configure an OpenJDK version 27+ that includes the JavaFX modules (e.g. Bellsoft Liberica JDK)
|
||||||
|
* - Optional: install and configure Gradle 9.8+
|
||||||
|
*
|
||||||
|
* Scenario 1: run the application via gradle command line from the source code root directory:
|
||||||
|
* command: ./gradlew run
|
||||||
|
*
|
||||||
|
* Scenario 2: create an application release for the current operating system
|
||||||
|
* command: ./gradlew runtimeZipCurrent
|
||||||
|
* Note: release image is located in the /build/image/ directory
|
||||||
|
*
|
||||||
|
* Scenario 3: create releases for Linux and OSX operating systems using downloaded JDKs
|
||||||
|
* command: ./gradlew runtimeZipOthers
|
||||||
|
* Note: release images are located in the /build/image/ directory
|
||||||
|
*
|
||||||
|
* Scenario 4: create release for Windows operating system using downloaded JDK
|
||||||
|
* command: ./gradlew runtimeZipWindows
|
||||||
|
* Note: release image is located in the /build/image/ directory
|
||||||
|
*/
|
||||||
plugins {
|
plugins {
|
||||||
id 'application'
|
id 'application'
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'idea'
|
id 'idea'
|
||||||
id 'org.openjfx.javafxplugin' version '0.0.6'
|
id 'org.beryx.runtime' version '2.0.1'
|
||||||
id 'org.beryx.runtime' version '1.1.1'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
/**
|
||||||
jcenter()
|
* Version is derived from the most recent 'v<version>' git tag (e.g. v1.0.0-beta-1 -> 1.0.0-beta-1). Commits after
|
||||||
mavenCentral()
|
* the tag produce a version like 1.0.0-beta-1-14-g4626d567 and uncommitted changes append '-dirty'. The moving
|
||||||
|
* 'nightly' tag is ignored. Override with -PprojectVersion=<version> (the nightly build uses 'nightly' so that the
|
||||||
|
* nightly release asset names stay the same). Falls back to 'unknown' when built outside a git checkout.
|
||||||
|
*/
|
||||||
|
String gitDescribe = describeGitVersion()
|
||||||
|
version = project.findProperty('projectVersion') ?: (gitDescribe ? gitDescribe.substring(1) : 'unknown')
|
||||||
|
|
||||||
|
String describeGitVersion()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
def describe = providers.exec {
|
||||||
|
commandLine 'git', 'describe', '--tags', '--match', 'v[0-9]*', '--dirty'
|
||||||
|
ignoreExitValue = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if(describe.result.get().exitValue == 0)
|
||||||
|
{
|
||||||
|
return describe.standardOutput.asText.get().trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
logger.warn("Unable to determine version from git tags: " + e.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
version = '0.4.0-alpha.6'
|
tasks.register('printVersion') {
|
||||||
sourceCompatibility = '11'
|
description = 'Prints the project version'
|
||||||
|
def projectVersion = version
|
||||||
|
doLast {
|
||||||
|
println projectVersion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sourceSets {
|
//Java 27 is required for this version of the Project Panama preview/incubator feature
|
||||||
main.java.srcDirs 'src/main'
|
java {
|
||||||
test.java.srcDirs 'src/test'
|
toolchain {
|
||||||
|
languageVersion = JavaLanguageVersion.of(27)
|
||||||
|
vendor = JvmVendorSpec.BELLSOFT
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies that the selected toolchain JDK includes the JavaFX modules (e.g. Bellsoft Liberica 'Full JDK').
|
||||||
|
*
|
||||||
|
* Gradle's toolchain spec can only select by language version, vendor and implementation, so it can't distinguish
|
||||||
|
* between the Liberica JDK packages that do and don't bundle JavaFX. This task fails the build with a clear message
|
||||||
|
* instead of allowing compilation to fail with missing javafx packages.
|
||||||
|
*/
|
||||||
|
tasks.register('verifyToolchainJavaFx') {
|
||||||
|
def jdkHome = javaToolchains.launcherFor(java.toolchain).map { it.metadata.installationPath.asFile }
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
def release = new File(jdkHome.get(), 'release')
|
||||||
|
|
||||||
|
if(!release.exists() || !release.text.contains('javafx.base')) {
|
||||||
|
throw new GradleException("The JDK at [${jdkHome.get()}] does not include the JavaFX modules. Install " +
|
||||||
|
"the Bellsoft Liberica JDK 27 'Full' package (includes LibericaFX), or use " +
|
||||||
|
"-Porg.gradle.java.installations.paths=<jdk path> to specify the JDK that Gradle should use.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('compileJava') {
|
||||||
|
dependsOn 'verifyToolchainJavaFx'
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile 'junit:junit:4.12'
|
|
||||||
testCompile 'org.assertj:assertj-core:3.8.0'
|
// JUnit Tests
|
||||||
compile fileTree(dir: 'imports', include: '*.jar')
|
testImplementation(platform("org.junit:junit-bom:6.1.3"))
|
||||||
compile 'ch.qos.logback:logback-core:1.2.3'
|
testImplementation 'org.junit.jupiter:junit-jupiter-api'
|
||||||
compile 'ch.qos.logback:logback-classic:1.2.3'
|
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
|
||||||
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.8'
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||||
compile 'com.github.jiconfont:jiconfont-font_awesome:4.7.0.1'
|
|
||||||
compile 'com.github.jiconfont:jiconfont-javafx:1.0.0'
|
//Jitpack imports
|
||||||
compile 'com.github.jiconfont:jiconfont-swing:1.0.1'
|
implementation 'com.github.dnault:libresample4j:master'
|
||||||
compile 'com.github.wendykierp:JTransforms:3.1'
|
implementation 'com.github.DSheirer.jmbe:api:v2.1.1'
|
||||||
compile 'com.google.guava:guava:27.0.1-jre'
|
implementation 'com.github.nwaldispuehl:java-lame:v3.98.4'
|
||||||
compile 'com.jidesoft:jide-oss:3.6.18'
|
|
||||||
compile 'com.miglayout:miglayout-swing:5.2'
|
//mavenCentral/jcenter imports
|
||||||
compile 'javax.usb:usb-api:1.0.2'
|
implementation 'ch.qos.logback:logback-classic:1.6.6'
|
||||||
compile 'net.coderazzi:tablefilter-swing:5.4.0'
|
implementation 'ch.qos.logback:logback-core:1.6.6'
|
||||||
compile 'org.apache.axis:axis:1.4'
|
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.23.0'
|
||||||
compile 'org.apache.axis:axis-jaxrpc:1.4'
|
implementation 'com.formdev:flatlaf:3.8'
|
||||||
compile 'org.apache.commons:commons-lang3:3.8.1'
|
implementation 'com.formdev:flatlaf-intellij-themes:3.8' //Not imported - Theme.java loads these themes by class name
|
||||||
compile 'org.apache.commons:commons-io:1.3.2'
|
implementation 'com.github.jiconfont:jiconfont-font_awesome:4.7.0.1'
|
||||||
compile 'org.apache.mina:mina-core:2.0.19'
|
implementation 'com.github.jiconfont:jiconfont-javafx:1.0.0'
|
||||||
compile 'org.apache.mina:mina-http:2.0.19'
|
implementation 'com.github.jiconfont:jiconfont-swing:1.0.1'
|
||||||
compile "org.openjfx:javafx-base:11:win"
|
implementation('com.github.wendykierp:JTransforms:3.2') {
|
||||||
compile "org.openjfx:javafx-base:11:linux"
|
exclude group: 'junit' //JLargeArrays 1.7 declares junit as a compile dependency
|
||||||
compile "org.openjfx:javafx-base:11:mac"
|
}
|
||||||
compile "org.openjfx:javafx-controls:11:win"
|
implementation 'com.google.code.gson:gson:2.15.0'
|
||||||
compile "org.openjfx:javafx-controls:11:linux"
|
implementation 'com.google.guava:guava:33.8.0-jre'
|
||||||
compile "org.openjfx:javafx-controls:11:mac"
|
implementation 'com.jidesoft:jide-oss:3.6.18'
|
||||||
compile "org.openjfx:javafx-graphics:11:win"
|
implementation 'com.miglayout:miglayout-swing:11.5.2'
|
||||||
compile "org.openjfx:javafx-graphics:11:linux"
|
implementation 'com.mpatric:mp3agic:0.9.1'
|
||||||
compile "org.openjfx:javafx-graphics:11:mac"
|
implementation 'commons-io:commons-io:2.22.0'
|
||||||
compile "org.openjfx:javafx-swing:11:win"
|
implementation 'io.github.dsheirer:jairspy:1.0.12.1' //Airspy tuners - GitHub release, see settings.gradle
|
||||||
compile "org.openjfx:javafx-swing:11:linux"
|
implementation 'io.github.dsheirer:jairspyhf:1.8.1.1' //Airspy HF+ tuners - GitHub release, see settings.gradle
|
||||||
compile "org.openjfx:javafx-swing:11:mac"
|
implementation 'io.github.dsheirer:jbladerf:2.6.0.1' //bladeRF tuners - GitHub release, see settings.gradle
|
||||||
compile 'org.slf4j:slf4j-api:1.7.25'
|
implementation 'io.github.dsheirer:jhackrf:2026.01.3.1' //HackRF tuners - GitHub release, see settings.gradle
|
||||||
compile 'org.usb4java:libusb4java:1.3.0'
|
implementation 'io.github.dsheirer:jlibusb:1.0.30.1' //libusb and USB hotplug for the tuner libraries - GitHub release; not pulled in transitively
|
||||||
compile 'org.usb4java:usb4java:1.3.0'
|
implementation 'io.github.dsheirer:jhydrasdr:1.1.4.1' //HydraSDR tuners - GitHub release, see settings.gradle
|
||||||
compile 'org.usb4java:usb4java-javax:1.3.0'
|
implementation 'io.github.dsheirer:jlimesdr:25.1.0.2' //LimeSDR tuners - GitHub release, see settings.gradle
|
||||||
compile 'pl.edu.icm:JLargeArrays:1.6'
|
implementation 'io.github.dsheirer:jrtl:1.4.0.3' //RTL-SDR tuners - GitHub release, see settings.gradle
|
||||||
|
implementation 'io.github.dsheirer:jsdrplay:3.15.3' //SDRplay RSP tuners - GitHub release, see settings.gradle
|
||||||
|
implementation 'io.github.dsheirer:radio-reference-api:18.1.0' //RadioReference SOAP API - GitHub release, see settings.gradle
|
||||||
|
implementation 'org.apache.commons:commons-compress:1.28.0' //Not used directly - overrides the vulnerable 1.21 version from jarchivelib
|
||||||
|
implementation 'org.apache.commons:commons-lang3:3.21.0'
|
||||||
|
implementation 'org.apache.commons:commons-math3:3.6.1'
|
||||||
|
implementation 'org.apache.commons:commons-csv:1.14.1'
|
||||||
|
implementation 'org.apache.mina:mina-core:2.2.10'
|
||||||
|
implementation 'org.apache.mina:mina-http:2.2.10'
|
||||||
|
implementation 'org.controlsfx:controlsfx:11.2.6'
|
||||||
|
implementation 'org.rauschig:jarchivelib:1.2.0'
|
||||||
|
implementation 'org.slf4j:slf4j-api:2.0.20'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def os = DefaultNativePlatform.currentOperatingSystem
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is needed for the JDK23+ vector API ... until it moves out of incubation or preview
|
||||||
|
*/
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
options.compilerArgs.add("--enable-preview") //Project Panama Vector API is still in incubator
|
||||||
|
options.compilerArgs.add("--add-modules=jdk.incubator.vector") //Project Panama Vector API is still in incubator
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JVM Arguments for running the application on Windows.
|
||||||
|
*/
|
||||||
|
def jvmArgsWindows =
|
||||||
|
['--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED', //Needed for controls-fx.jar
|
||||||
|
'--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED', //windows users for JIDE
|
||||||
|
'--add-modules=jdk.incubator.vector', //Project Panama vector API is still in incubator
|
||||||
|
'--enable-preview', //Project Panama Vector API is still in incubator
|
||||||
|
'--enable-native-access=ALL-UNNAMED', //Suppress unsafe warnings for FFM API Foreign Memory calls
|
||||||
|
'--enable-native-access=javafx.graphics', //JDK24 - suppress restricted java.lang.System calls
|
||||||
|
'--sun-misc-unsafe-memory-access=allow'] //JDK24 - suppress sun.misc.Unsafe::allocateMemory warning
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JVM Arguments for running the application on Linux.
|
||||||
|
*/
|
||||||
|
def jvmArgsLinux =
|
||||||
|
['--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED', //Needed for controls-fx.jar
|
||||||
|
'--add-modules=jdk.incubator.vector', //Project Panama vector API is still in incubator
|
||||||
|
'--enable-preview', //Project Panama Vector & Foreign Function APIs remain in incubator
|
||||||
|
'--sun-misc-unsafe-memory-access=allow', //JDK24 - suppress sun.misc.Unsafe::allocateMemory warning
|
||||||
|
'--enable-native-access=javafx.graphics', //JDK24 - suppress restricted java.lang.System calls
|
||||||
|
'--enable-native-access=ALL-UNNAMED'] //Suppress warnings for FFM API native calls (tuner libraries)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Startup splash screen image. The JVM shows it before any application code runs and closes it when the main window
|
||||||
|
* opens. The release launch scripts load it from the runtime image lib folder (see the runtime task below) and the
|
||||||
|
* gradle run task loads it from the resources folder. The JVM picks up the @2x image on HiDPI displays.
|
||||||
|
*/
|
||||||
|
def splashImages = ['sdrtrunk-splash.png', 'sdrtrunk-splash@2x.png']
|
||||||
|
def splashResourceDir = 'src/main/resources/images/sdrtrunk'
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClassName = "io.github.dsheirer.gui.SDRTrunk"
|
mainClass = "io.github.dsheirer.gui.SDRTrunk"
|
||||||
|
|
||||||
|
if(os.isWindows()) {
|
||||||
|
applicationDefaultJvmArgs = jvmArgsWindows
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
applicationDefaultJvmArgs = jvmArgsLinux
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('run') {
|
||||||
|
jvmArgs "-splash:${file(splashResourceDir + '/' + splashImages[0]).absolutePath}"
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
if(os.isWindows()) {
|
||||||
|
jvmArgs = jvmArgsWindows
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
jvmArgs = jvmArgsLinux
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
manifest {
|
||||||
|
attributes (
|
||||||
|
'Implementation-Title' : 'sdrtrunk project',
|
||||||
|
'Implementation-Version' : archiveVersion,
|
||||||
|
'Git-Describe' : gitDescribe ?: 'unknown',
|
||||||
|
'Created-By' : "Gradle ${gradle.gradleVersion}",
|
||||||
|
'Build-Timestamp' : new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
|
||||||
|
'Build-JDK' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']}",
|
||||||
|
'Build-OS' : "${System.properties['os.name']} (${System.properties['os.arch']} ${System.properties['os.version']}"
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
idea {
|
idea {
|
||||||
@@ -99,15 +266,290 @@ idea {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
javafx {
|
javadoc {
|
||||||
modules = ['javafx.base', 'javafx.controls', 'javafx.graphics', 'javafx.swing']
|
options.addStringOption('-add-modules', 'jdk.incubator.vector')
|
||||||
|
options.addStringOption('Xdoclint:none', '-quiet')
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime {
|
/**
|
||||||
targetPlatform('linux-x64', '/media/denny/WD250GB/java/linux/jdk-11.0.1')
|
* Runtime target OS and CPU image names. We append version here so that version details are at end of zip filename.
|
||||||
targetPlatform('osx-x64', '/media/denny/WD250GB/java/osx/jdk-11.0.1.jdk/Contents/Home')
|
*/
|
||||||
targetPlatform('windows-x64', '/media/denny/WD250GB/java/windows/jdk-11.0.1')
|
String targetLinuxAarch64 = 'linux-aarch64-v' + version
|
||||||
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
|
String targetLinuxX86_64 = 'linux-x86_64-v' + version
|
||||||
modules = ['java.desktop', 'java.naming', 'jdk.unsupported', 'jdk.unsupported.desktop']
|
String targetOsxAarch64 = 'osx-aarch64-v' + version
|
||||||
imageZip = file("$buildDir/image/sdr-trunk-" + version + ".zip")
|
String targetOsxX86_64 = 'osx-x86_64-v' + version
|
||||||
|
String targetWindowsX86_64 = 'windows-x86_64-v' + version
|
||||||
|
String targetWindowsAarch64 = 'windows-aarch64-v' + version
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Download URLs to download the JDK as part of the gradle build packaging process
|
||||||
|
*/
|
||||||
|
def jdk_download_base = "https://download.bell-sw.com/java/27+36/bellsoft-jdk27+36-"
|
||||||
|
def jdk_download_suffix = "-full.tar.gz"
|
||||||
|
def jdk_download_linux_aarch64 = jdk_download_base + "linux-aarch64" + jdk_download_suffix
|
||||||
|
def jdk_download_linux_x86_64 = jdk_download_base + "linux-amd64" + jdk_download_suffix
|
||||||
|
def jdk_download_osx_x86_64 = jdk_download_base + "macos-amd64" + jdk_download_suffix
|
||||||
|
def jdk_download_osx_aarch64 = jdk_download_base + "macos-aarch64" + jdk_download_suffix
|
||||||
|
def jdk_download_windows_x86_64 = jdk_download_base + "windows-amd64-full.zip"
|
||||||
|
def jdk_download_windows_aarch64 = jdk_download_base + "windows-aarch64-full.zip"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures the runtime zip task with additional options/settings.
|
||||||
|
* @param rt task to configure
|
||||||
|
* @param jvmArgs to use (windows or linux)
|
||||||
|
* @return configured task.
|
||||||
|
*/
|
||||||
|
def configure(RuntimeZipTask rt, List<String> jvmArgs) {
|
||||||
|
//Use the correct set of JVM arguments, plus the startup splash screen that the runtime task copies to lib
|
||||||
|
rt.extension.launcherData.get().jvmArgs = jvmArgs + ['-splash:{{BIN_DIR}}/../lib/sdrtrunk-splash.png']
|
||||||
|
|
||||||
|
//Additional modules to include with auto-detected modules.
|
||||||
|
//jdk.charsets - NXDN BIG5 encoding support
|
||||||
|
//jdk.crypto.ec - needed for HTTPS connections (broadcastify calls & map tile server)
|
||||||
|
//jdk.incubator.vector - needed for Project Panama foreign function and vector apis
|
||||||
|
//jdk.accessibility is used with assistive technologies like screen readers
|
||||||
|
//java.management for JVM resource monitoring
|
||||||
|
//java.base, java.logging, java.net.http, java.prefs, javafx.controls, javafx.swing - required by sdrtrunk (jdeps)
|
||||||
|
rt.extension.addModules('jdk.charsets', 'jdk.crypto.ec', 'jdk.incubator.vector', 'jdk.accessibility', 'java.management',
|
||||||
|
'java.base', 'java.logging', 'java.net.http', 'java.prefs', 'javafx.controls', 'javafx.swing')
|
||||||
|
|
||||||
|
//Use only the modules listed above. The runtime plugin's module auto-detection uses a bundled ASM library that
|
||||||
|
//can't read Java 27 class files and logs a 'Failed to scan' error for each sdrtrunk class. The jdeps module check
|
||||||
|
//on the runtime task verifies that this list is complete.
|
||||||
|
rt.extension.additive.set(false)
|
||||||
|
|
||||||
|
//Recommended options for reducing/shrinking runtime target image size
|
||||||
|
rt.extension.addOptions('--strip-debug', '--compress', 'zip-6', '--no-header-files', '--no-man-pages')
|
||||||
|
|
||||||
|
//Runtime images have auto appended version in image zip name. Override to include version in single target image.
|
||||||
|
// rt.extension.imageDir=layout.buildDirectory.dir('image')
|
||||||
|
rt.extension.imageZip.set(file(layout.buildDirectory.dir('image').get().file('sdr-trunk.zip')))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rewrites the jar file without the native library folders for other operating systems and architectures. Fails the
|
||||||
|
* build if a jar that contains native libraries doesn't contain the folder for the target.
|
||||||
|
* @param jar file to rewrite
|
||||||
|
* @param keep native folder for the target
|
||||||
|
* @return number of bytes removed from the jar
|
||||||
|
*/
|
||||||
|
long stripJar(File jar, String keep) {
|
||||||
|
def tunerPattern = ~/^[^\/]+\/native\/([^\/]+)\/.*/
|
||||||
|
def removed = [] as Set
|
||||||
|
def hadTuner = false, keptTuner = false
|
||||||
|
File temp = new File(jar.parentFile, jar.name + '.tmp')
|
||||||
|
|
||||||
|
new java.util.zip.ZipFile(jar).withCloseable { zip ->
|
||||||
|
def entries = zip.entries().toList()
|
||||||
|
|
||||||
|
entries.each { e ->
|
||||||
|
def tuner = tunerPattern.matcher(e.name)
|
||||||
|
|
||||||
|
if(tuner.matches()) {
|
||||||
|
hadTuner = true
|
||||||
|
if(tuner.group(1) == keep) { keptTuner = true } else { removed << e.name }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hadTuner && !keptTuner) {
|
||||||
|
throw new GradleException("Native strip: ${jar.name} has no native/${keep} folder")
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!removed.isEmpty()) {
|
||||||
|
new java.util.zip.ZipOutputStream(new FileOutputStream(temp)).withCloseable { out ->
|
||||||
|
entries.findAll { !removed.contains(it.name) }.each { e ->
|
||||||
|
def copy = new java.util.zip.ZipEntry(e)
|
||||||
|
if(copy.method == java.util.zip.ZipEntry.DEFLATED) {
|
||||||
|
copy.compressedSize = -1
|
||||||
|
}
|
||||||
|
out.putNextEntry(copy)
|
||||||
|
zip.getInputStream(e).withCloseable { out << it }
|
||||||
|
out.closeEntry()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(removed.isEmpty()) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
long before = jar.length()
|
||||||
|
java.nio.file.Files.move(temp.toPath(), jar.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING)
|
||||||
|
return before - jar.length()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the native libraries for other operating systems and architectures from the jars in each runtime target
|
||||||
|
* image, before the runtimeZip tasks package the images. The tuner libraries (jRTL, jAirspy, etc.) package their
|
||||||
|
* native libraries under '<library>/native/<os>-<arch>/', where the folder name matches the runtime target name
|
||||||
|
* '<os>-<arch>-v<version>' without the version suffix, except that the libraries use 'macos' where the target uses 'osx'.
|
||||||
|
*/
|
||||||
|
tasks.named('runtime') {rt ->
|
||||||
|
rt.doLast {
|
||||||
|
rt.targetPlatforms.get().keySet().each { target ->
|
||||||
|
def nativeFolder = (target - "-v${version}").replaceFirst(/^osx-/, 'macos-')
|
||||||
|
def lib = new File(rt.imageDir.asFile, "${project.name}-${target}/lib")
|
||||||
|
long total = 0
|
||||||
|
lib.listFiles({ File f -> f.name.endsWith('.jar') } as FileFilter).each { jar ->
|
||||||
|
total += stripJar(jar, nativeFolder)
|
||||||
|
}
|
||||||
|
logger.lifecycle("Native strip: removed ${String.format('%.1f', total / 1048576)} MB of other " +
|
||||||
|
"platform native libraries from [${target}]")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the startup splash screen images into the lib folder of each runtime target image, where the launch scripts
|
||||||
|
* load them from (-splash:{{BIN_DIR}}/../lib/...).
|
||||||
|
*/
|
||||||
|
tasks.named('runtime') {rt ->
|
||||||
|
rt.doLast {
|
||||||
|
rt.targetPlatforms.get().keySet().each { target ->
|
||||||
|
def lib = new File(rt.imageDir.asFile, "${project.name}-${target}/lib")
|
||||||
|
splashImages.each { name ->
|
||||||
|
java.nio.file.Files.copy(file(splashResourceDir + '/' + name).toPath(), new File(lib, name).toPath(),
|
||||||
|
java.nio.file.StandardCopyOption.REPLACE_EXISTING)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies that each runtime target image contains every module that the sdrtrunk jar requires, as reported by jdeps.
|
||||||
|
* This guards against the runtime plugin's module auto-detection silently missing modules (e.g. when it can't parse
|
||||||
|
* class files compiled for a newer Java version).
|
||||||
|
*/
|
||||||
|
def jdepsHome = javaToolchains.launcherFor(java.toolchain).map { it.metadata.installationPath.asFile }
|
||||||
|
def mainJar = tasks.named('jar').flatMap { it.archiveFile }
|
||||||
|
|
||||||
|
tasks.named('runtime') {rt ->
|
||||||
|
rt.doLast {
|
||||||
|
def jdeps = new File(jdepsHome.get(), 'bin/' + (os.isWindows() ? 'jdeps.exe' : 'jdeps')).absolutePath
|
||||||
|
def process = new ProcessBuilder(jdeps, '--multi-release', java.toolchain.languageVersion.get().toString(),
|
||||||
|
'--ignore-missing-deps', '--print-module-deps', '-q', mainJar.get().asFile.absolutePath)
|
||||||
|
.redirectErrorStream(true).start()
|
||||||
|
def output = process.inputStream.text.trim()
|
||||||
|
|
||||||
|
if(process.waitFor() != 0) {
|
||||||
|
throw new GradleException("Module check: jdeps failed: ${output}")
|
||||||
|
}
|
||||||
|
|
||||||
|
def required = output.split(',')*.trim().findAll { it } as Set
|
||||||
|
|
||||||
|
rt.targetPlatforms.get().keySet().each { target ->
|
||||||
|
def release = new File(rt.imageDir.asFile, "${project.name}-${target}/release")
|
||||||
|
def match = release.text =~ /(?m)^MODULES="([^"]*)"/
|
||||||
|
|
||||||
|
if(!match.find()) {
|
||||||
|
throw new GradleException("Module check: no MODULES entry in ${release}")
|
||||||
|
}
|
||||||
|
|
||||||
|
def missing = required - (match.group(1).split(' ') as Set)
|
||||||
|
|
||||||
|
if(missing) {
|
||||||
|
throw new GradleException("Module check: runtime image [${target}] is missing required modules " +
|
||||||
|
"${missing.sort()} - add them to addModules() in build.gradle")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.lifecycle("Module check: runtime images contain all modules required by sdrtrunk: ${required.sort()}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a release package for the current operating system.
|
||||||
|
*
|
||||||
|
* Note: you cannot create both Windows and Linux releases at the same time due to limitations of the Runtime plugin
|
||||||
|
*
|
||||||
|
* Usage: gradle runtimeZipCurrent
|
||||||
|
* Usage: gradlew runtimeZipCurrent (windows - using gradlew)
|
||||||
|
* Usage: ./gradlew runtimeZipCurrent (linux - using gradlew)
|
||||||
|
*/
|
||||||
|
tasks.register('runtimeZipCurrent', RuntimeZipTask) {rt ->
|
||||||
|
def arch = System.properties.getProperty("os.arch")
|
||||||
|
def javaHome = Jvm.current().getJavaHome().toString()
|
||||||
|
|
||||||
|
if(os.isWindows()) {
|
||||||
|
if(arch == "amd64") {
|
||||||
|
rt.extension.targetPlatform(targetWindowsX86_64, javaHome)
|
||||||
|
}
|
||||||
|
else if(arch == "aarch64") {
|
||||||
|
rt.extension.targetPlatform(targetWindowsAarch64, javaHome)
|
||||||
|
}
|
||||||
|
configure(rt, jvmArgsWindows)
|
||||||
|
}
|
||||||
|
else if(os.isLinux())
|
||||||
|
{
|
||||||
|
if(arch == "amd64") {
|
||||||
|
rt.extension.targetPlatform(targetLinuxX86_64, javaHome)
|
||||||
|
}
|
||||||
|
else if(arch == "aarch64") {
|
||||||
|
rt.extension.targetPlatform(targetLinuxAarch64, javaHome)
|
||||||
|
}
|
||||||
|
configure(rt, jvmArgsLinux)
|
||||||
|
}
|
||||||
|
else if(os.isMacOsX())
|
||||||
|
{
|
||||||
|
if(arch == "amd64") {
|
||||||
|
rt.extension.targetPlatform(targetOsxX86_64, javaHome)
|
||||||
|
}
|
||||||
|
else if(arch == "aarch64") {
|
||||||
|
rt.extension.targetPlatform(targetOsxAarch64, javaHome)
|
||||||
|
}
|
||||||
|
configure(rt, jvmArgsLinux)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a Windows release package.
|
||||||
|
*
|
||||||
|
* Note: you cannot create both Windows and Linux releases at the same time due to limitations of the Runtime plugin
|
||||||
|
*
|
||||||
|
* Usage: gradle runtimeZipWindows
|
||||||
|
* Usage: gradlew runtimeZipWindows (windows - using gradlew)
|
||||||
|
* Usage: ./gradlew runtimeZipWindows (linux - using gradlew)
|
||||||
|
*/
|
||||||
|
tasks.register('runtimeZipWindows', RuntimeZipTask) {rt ->
|
||||||
|
//Windows aarch64
|
||||||
|
rt.extension.targetPlatform(targetWindowsAarch64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_windows_aarch64)
|
||||||
|
}
|
||||||
|
//Windows x86-64
|
||||||
|
rt.extension.targetPlatform(targetWindowsX86_64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_windows_x86_64)
|
||||||
|
}
|
||||||
|
|
||||||
|
configure(rt, jvmArgsWindows)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates Linux & OSX release packages.
|
||||||
|
*
|
||||||
|
* Note: you cannot create both Windows and Linux releases at the same time due to limitations of the Runtime plugin
|
||||||
|
*
|
||||||
|
* Usage: gradle runtimeZipOthers
|
||||||
|
* Usage: gradlew runtimeZipOthers (windows - using gradlew)
|
||||||
|
* Usage: ./gradlew runtimeZipOthers (linux - using gradlew)
|
||||||
|
*/
|
||||||
|
tasks.register('runtimeZipOthers', RuntimeZipTask) {rt ->
|
||||||
|
//Linux aarch64
|
||||||
|
rt.extension.targetPlatform(targetLinuxAarch64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_linux_aarch64)
|
||||||
|
}
|
||||||
|
//Linux x86-64
|
||||||
|
rt.extension.targetPlatform(targetLinuxX86_64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_linux_x86_64)
|
||||||
|
}
|
||||||
|
//OSX aarch64
|
||||||
|
rt.extension.targetPlatform(targetOsxAarch64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_osx_aarch64)
|
||||||
|
}
|
||||||
|
//OSX x86-64
|
||||||
|
rt.extension.targetPlatform(targetOsxX86_64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_osx_x86_64)
|
||||||
|
}
|
||||||
|
|
||||||
|
configure(rt, jvmArgsLinux)
|
||||||
}
|
}
|
||||||
|
|||||||
16
copyright.template
Normal file
16
copyright.template
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
******************************************************************************
|
||||||
|
Copyright (C) 2014-${today.year} Dennis Sheirer
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*****************************************************************************
|
||||||
32
gradle.properties
Normal file
32
gradle.properties
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#
|
||||||
|
# ******************************************************************************
|
||||||
|
# Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
# *****************************************************************************
|
||||||
|
#
|
||||||
|
|
||||||
|
# The project version is no longer defined here. It is derived from the most recent 'v<version>' git tag (see
|
||||||
|
# build.gradle) and can be overridden with -PprojectVersion=<version>.
|
||||||
|
#
|
||||||
|
# Version tag naming conventions:
|
||||||
|
# Alpha: vmaj.min.patch-alpha-build
|
||||||
|
# Beta: vmaj.min.patch-beta-build
|
||||||
|
# Release: vmaj.min.patch
|
||||||
|
#
|
||||||
|
# Example: v0.6.0-beta-5
|
||||||
|
#
|
||||||
|
# Note: this is so that the file names for the resultant release build products match the GitHub release asset
|
||||||
|
# tag name, specifically the dashes inserted before and after the alpha/beta labels.
|
||||||
|
# See: https://github.com/DSheirer/sdrtrunk/issues/1651
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
26
gradle/wrapper/gradle-wrapper.properties
vendored
26
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,25 +1,9 @@
|
|||||||
#
|
|
||||||
# *******************************************************************************
|
|
||||||
# sdrtrunk
|
|
||||||
# Copyright (C) 2014-2019 Dennis Sheirer
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
# ******************************************************************************
|
|
||||||
#
|
|
||||||
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.9.0-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
retries=0
|
||||||
|
retryBackOffMs=500
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
310
gradlew
vendored
310
gradlew
vendored
@@ -1,78 +1,128 @@
|
|||||||
#!/usr/bin/env sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright © 2015 the original authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
#
|
||||||
## Gradle start up script for UN*X
|
# gradlew start up script for POSIX generated by Gradle.
|
||||||
##
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh gradlew
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
# Resolve links: $0 may be a link
|
# Resolve links: $0 may be a link
|
||||||
PRG="$0"
|
app_path=$0
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
# Need this for daisy-chained symlinks.
|
||||||
ls=`ls -ld "$PRG"`
|
while
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
[ -h "$app_path" ]
|
||||||
PRG="$link"
|
do
|
||||||
else
|
ls=$( ls -ld "$app_path" )
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
link=${ls#*' -> '}
|
||||||
fi
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >/dev/null
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
# This is normally unused
|
||||||
APP_BASE_NAME=`basename "$0"`
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m"'
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD=maximum
|
||||||
|
|
||||||
warn () {
|
warn () {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
die () {
|
die () {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
# OS specific support (must be 'true' or 'false').
|
||||||
cygwin=false
|
cygwin=false
|
||||||
msys=false
|
msys=false
|
||||||
darwin=false
|
darwin=false
|
||||||
nonstop=false
|
nonstop=false
|
||||||
case "`uname`" in
|
case "$( uname )" in #(
|
||||||
CYGWIN* )
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
cygwin=true
|
Darwin* ) darwin=true ;; #(
|
||||||
;;
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
Darwin* )
|
NONSTOP* ) nonstop=true ;;
|
||||||
darwin=true
|
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
NONSTOP* )
|
|
||||||
nonstop=true
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
else
|
else
|
||||||
JAVACMD="$JAVA_HOME/bin/java"
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
fi
|
fi
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
@@ -81,92 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the
|
|||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD="java"
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
case $MAX_FD in #(
|
||||||
if [ $? -eq 0 ] ; then
|
max*)
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
# shellcheck disable=SC2039,SC3045
|
||||||
fi
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
ulimit -n $MAX_FD
|
warn "Could not query maximum file descriptor limit"
|
||||||
if [ $? -ne 0 ] ; then
|
esac
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
case $MAX_FD in #(
|
||||||
fi
|
'' | soft) :;; #(
|
||||||
else
|
*)
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
fi
|
# shellcheck disable=SC2039,SC3045
|
||||||
fi
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
|
||||||
if $cygwin ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
done
|
|
||||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
||||||
# Add a user-defined pattern to the cygpath arguments
|
|
||||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
||||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
||||||
fi
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
i=0
|
|
||||||
for arg in "$@" ; do
|
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
||||||
else
|
|
||||||
eval `echo args$i`="\"$arg\""
|
|
||||||
fi
|
|
||||||
i=$((i+1))
|
|
||||||
done
|
|
||||||
case $i in
|
|
||||||
(0) set -- ;;
|
|
||||||
(1) set -- "$args0" ;;
|
|
||||||
(2) set -- "$args0" "$args1" ;;
|
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Escape application args
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
save () {
|
# * args from the command line
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
# * the main class name
|
||||||
echo " "
|
# * -classpath
|
||||||
}
|
# * -D...appname settings
|
||||||
APP_ARGS=$(save "$@")
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
|
|||||||
130
gradlew.bat
vendored
130
gradlew.bat
vendored
@@ -1,84 +1,112 @@
|
|||||||
@if "%DEBUG%" == "" @echo off
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem gradlew startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
setlocal EnableExtensions
|
||||||
|
|
||||||
|
@rem Catch executions from older scripts and ensure they exit cleanly.
|
||||||
|
@rem This can be removed once we can be reasonably confident that few people
|
||||||
|
@rem will be migrating directly to this new wrapper.
|
||||||
|
goto afterSafetyNet
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
goto exitWithErrorLevel
|
||||||
|
:afterSafetyNet
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m"
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
1>&2 echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
echo.
|
1>&2 echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
1>&2 echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation.
|
1>&2 echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
"%COMSPEC%" /c exit 1
|
||||||
|
goto exitWithErrorLevel
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
:findJavaFromJavaHome
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
1>&2 echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
echo.
|
1>&2 echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
1>&2 echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation.
|
1>&2 echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
"%COMSPEC%" /c exit 1
|
||||||
|
goto exitWithErrorLevel
|
||||||
:init
|
|
||||||
@rem Get command-line arguments, handling Windows variants
|
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
||||||
|
|
||||||
:win9xME_args
|
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
|
||||||
set _SKIP=2
|
|
||||||
|
|
||||||
:win9xME_args_slurp
|
|
||||||
if "x%~1" == "x" goto execute
|
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
|
||||||
|
|
||||||
:end
|
@rem Execute gradlew
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
@rem which allows us to clear the local environment before executing the java command
|
||||||
|
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel & goto exitWithErrorLevel
|
||||||
|
|
||||||
:fail
|
@rem This label must not be changed. We rely on old scripts being able to jump to this point.
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
:exitWithErrorLevel
|
||||||
rem the _cmd.exe /c_ return code!
|
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
746
sdr-trunk.ipr
746
sdr-trunk.ipr
@@ -1,746 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerConfiguration">
|
|
||||||
<resourceExtensions>
|
|
||||||
<entry name=".+\.(properties|xml|html|dtd|tld)" />
|
|
||||||
<entry name=".+\.(gif|png|jpeg|jpg)" />
|
|
||||||
</resourceExtensions>
|
|
||||||
<wildcardResourcePatterns>
|
|
||||||
<entry name="!?*.class" />
|
|
||||||
<entry name="!?*.scala" />
|
|
||||||
<entry name="!?*.java" />
|
|
||||||
<entry name="!?*.groovy" />
|
|
||||||
</wildcardResourcePatterns>
|
|
||||||
<bytecodeTargetLevel target="1.8">
|
|
||||||
<module name="sdr-trunk_main" target="1.8" />
|
|
||||||
<module name="sdr-trunk_test" target="1.8" />
|
|
||||||
</bytecodeTargetLevel>
|
|
||||||
</component>
|
|
||||||
<component name="CopyrightManager" default="sdrtrunk">
|
|
||||||
<copyright>
|
|
||||||
<option name="notice" value="sdr-trunk Copyright (C) 2014-&#36;today.year Dennis Sheirer This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/> " />
|
|
||||||
<option name="myName" value="sdrtrunk" />
|
|
||||||
</copyright>
|
|
||||||
<LanguageOptions name="JAVA">
|
|
||||||
<option name="fileTypeOverride" value="3" />
|
|
||||||
<option name="separateBefore" value="true" />
|
|
||||||
<option name="separateAfter" value="true" />
|
|
||||||
</LanguageOptions>
|
|
||||||
</component>
|
|
||||||
<component name="DependencyValidationManager">
|
|
||||||
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
|
||||||
</component>
|
|
||||||
<component name="GradleSettings">
|
|
||||||
<option name="linkedExternalProjectsSettings">
|
|
||||||
<GradleProjectSettings>
|
|
||||||
<option name="distributionType" value="WRAPPED" />
|
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
||||||
<option name="gradleHome" value="$USER_HOME$/gradle/gradle-2.12" />
|
|
||||||
<option name="modules">
|
|
||||||
<set>
|
|
||||||
<option value="$PROJECT_DIR$" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
<option name="useAutoImport" value="true" />
|
|
||||||
</GradleProjectSettings>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="GradleUISettings">
|
|
||||||
<setting name="root" />
|
|
||||||
</component>
|
|
||||||
<component name="GradleUISettings2">
|
|
||||||
<setting name="root" />
|
|
||||||
</component>
|
|
||||||
<component name="IdProvider" IDEtalkID="11DA1DB66DD62DDA1ED602B7079FE97C" />
|
|
||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<profile version="1.0">
|
|
||||||
<option name="myName" value="Project Default" />
|
|
||||||
</profile>
|
|
||||||
<version value="1.0" />
|
|
||||||
</component>
|
|
||||||
<component name="JavadocGenerationManager">
|
|
||||||
<option name="OUTPUT_DIRECTORY" />
|
|
||||||
<option name="OPTION_SCOPE" value="protected" />
|
|
||||||
<option name="OPTION_HIERARCHY" value="true" />
|
|
||||||
<option name="OPTION_NAVIGATOR" value="true" />
|
|
||||||
<option name="OPTION_INDEX" value="true" />
|
|
||||||
<option name="OPTION_SEPARATE_INDEX" value="true" />
|
|
||||||
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
|
|
||||||
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
|
|
||||||
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
|
|
||||||
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
|
|
||||||
<option name="OPTION_DEPRECATED_LIST" value="true" />
|
|
||||||
<option name="OTHER_OPTIONS" value="" />
|
|
||||||
<option name="HEAP_SIZE" />
|
|
||||||
<option name="LOCALE" />
|
|
||||||
<option name="OPEN_IN_BROWSER" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="Palette2">
|
|
||||||
<group name="Swing">
|
|
||||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="Button" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="RadioButton" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="CheckBox" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="Label" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
||||||
<preferred-size width="150" height="-1" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
||||||
<preferred-size width="150" height="-1" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
||||||
<preferred-size width="150" height="-1" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
|
||||||
<preferred-size width="200" height="200" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
|
||||||
<preferred-size width="200" height="200" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
|
||||||
<preferred-size width="-1" height="20" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
|
||||||
</item>
|
|
||||||
</group>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectDictionaryState">
|
|
||||||
<dictionary name="Denny">
|
|
||||||
<words>
|
|
||||||
<w>baseband</w>
|
|
||||||
<w>costas</w>
|
|
||||||
</words>
|
|
||||||
</dictionary>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/sdr-trunk.iml" filepath="$PROJECT_DIR$/sdr-trunk.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/sdr-trunk_main.iml" filepath="$PROJECT_DIR$/sdr-trunk_main.iml" group="sdr-trunk" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/sdr-trunk_test.iml" filepath="$PROJECT_DIR$/sdr-trunk_test.iml" group="sdr-trunk" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
<component name="SvnBranchConfigurationManager">
|
|
||||||
<option name="mySupportsUserInfoFilter" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Gradle: ch.qos.logback:logback-classic:1.2.3">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/7c4f3c474fb2c041d8028740440937705ebb473a/logback-classic-1.2.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/99b0433b7d86044643b7d677f22d2c793d31d416/logback-classic-1.2.3-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/cfd5385e0c5ed1c8a5dce57d86e79cf357153a64/logback-classic-1.2.3-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: ch.qos.logback:logback-core:1.2.3">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.3/864344400c3d4d92dfeb0a305dc87d953677c03c/logback-core-1.2.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.3/c978d4afd24d32991c8aa31a9c8a1119f19a1cb4/logback-core-1.2.3-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.3/3ebabe69eba0196af9ad3a814f723fb720b9101e/logback-core-1.2.3-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.fasterxml.jackson.core:jackson-annotations:2.9.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.9.0/7c10d545325e3a6e72e06381afe469fd40eb701/jackson-annotations-2.9.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.9.0/9978adad2c78154ca4aca7cd2a71941e1278f724/jackson-annotations-2.9.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.9.0/a0ad4e203304ccab7e01266fa814115850edb8a9/jackson-annotations-2.9.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.fasterxml.jackson.core:jackson-core:2.9.3">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.9.3/ea9b6fc7bc3ccba9777b0827091f9aa1f8580371/jackson-core-2.9.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.9.3/a1c84964d4a1ef15eeb91d0c2b62460e7d7c4829/jackson-core-2.9.3-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.9.3/99006a307afedb30000fc93b462e98f0d822fa11/jackson-core-2.9.3-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.fasterxml.jackson.core:jackson-databind:2.9.3">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.9.3/193b96ef555b2f2573b576887ba9a93e4bf48e8c/jackson-databind-2.9.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.9.3/486b5cb643a0c98342b6f533d9fc5aa75ab736df/jackson-databind-2.9.3-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.9.3/eab1ff15884e40c0adafe219a98c46513eb1d0e6/jackson-databind-2.9.3-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.3">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.9.3/c7d7d9f5316e0098e4d652f2d013aa9f9d69e3b1/jackson-dataformat-xml-2.9.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.9.3/9f09f5e7b1ff00b02953b0dc64e6edcc03d8dbc2/jackson-dataformat-xml-2.9.3-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.9.3/585e357aeb2ce0428740e88efd1443889e5834f4/jackson-dataformat-xml-2.9.3-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.9.3">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.9.3/ffe9afb0a9ee84fc79a9fd451b00643da1fa2466/jackson-module-jaxb-annotations-2.9.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.9.3/21ec5b47ad8833bbe1ce1f99192bcb6a4d0d3846/jackson-module-jaxb-annotations-2.9.3-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.9.3/660f2e6f5bc3dcd507e21ec656218d92095e4e01/jackson-module-jaxb-annotations-2.9.3-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.fasterxml.woodstox:woodstox-core:5.0.3">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.woodstox/woodstox-core/5.0.3/10aa199207fda142eff01cd61c69244877d71770/woodstox-core-5.0.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.woodstox/woodstox-core/5.0.3/7f5316fa0b4e68daa353bb2df3c546bfd854d54f/woodstox-core-5.0.3-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.fasterxml.woodstox/woodstox-core/5.0.3/f38482e8b060d9e5354c10103f4c4db53c58db7d/woodstox-core-5.0.3-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.github.wendykierp:JTransforms:3.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.wendykierp/JTransforms/3.1/f1f6d3c9c9bc04f848e38bdb77dea01e8764a01f/JTransforms-3.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.wendykierp/JTransforms/3.1/30208ebb430bee1b2e48e28478853bc9628c0e54/JTransforms-3.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.wendykierp/JTransforms/3.1/fc9cbab6459c03db12a643bc5dc1b1475a3f0b52/JTransforms-3.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.google.code.findbugs:jsr305:3.0.2">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/25ea2e8b0c338a877313bd4672d3fe056ea78f0d/jsr305-3.0.2.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/7cb5b4e91eb0741882c8fefb2fd0338eff9857c/jsr305-3.0.2-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/b19b5927c2c25b6c70f093767041e641ae0b1b35/jsr305-3.0.2-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.google.errorprone:error_prone_annotations:2.2.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.2.0/88e3c593e9b3586e1c6177f89267da6fc6986f0c/error_prone_annotations-2.2.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.2.0/959f406f238a0e047ed2a227479ff9db28173be9/error_prone_annotations-2.2.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.2.0/a8cd7823aa1dcd2fd6677c0c5988fdde9d1fb0a3/error_prone_annotations-2.2.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.google.guava:failureaccess:1.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/failureaccess/1.0/50bacb0bdbbeeda25142aff57e2214c402e1193c/failureaccess-1.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/failureaccess/1.0/d4f5c095ed310f738d56b26bad666f342c1fd73d/failureaccess-1.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/failureaccess/1.0/1e90402881010c96ea5e4b7e6f56acb283e78db3/failureaccess-1.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.google.guava:guava:27.0-jre">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/27.0-jre/c6ad87d2575af8ac8ec38e28e75aefa882cc3a1f/guava-27.0-jre.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/27.0-jre/607bfb3210bdc9c60315b033710e35428bc400bb/guava-27.0-jre-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/27.0-jre/d6484e2ee11ad928ccf61cf3e4ce9cedc2eead7e/guava-27.0-jre-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/b421526c5f297295adef1c886e5246c39d4ac629/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.google.j2objc:j2objc-annotations:1.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.j2objc/j2objc-annotations/1.1/976d8d30bebc251db406f2bdb3eb01962b5685b3/j2objc-annotations-1.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.j2objc/j2objc-annotations/1.1/2e1e0c8db5be95ec85d19d456186f8989ea263fa/j2objc-annotations-1.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.j2objc/j2objc-annotations/1.1/dcd31de68a90e41e336f6b7afce0d39285c433d7/j2objc-annotations-1.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.jidesoft:jide-oss:3.6.18">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jidesoft/jide-oss/3.6.18/2a0b8ef9ed1f18607b70f1e627d862fb8e595373/jide-oss-3.6.18.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jidesoft/jide-oss/3.6.18/814e47763c22729f665a4232da421824831ea734/jide-oss-3.6.18-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jidesoft/jide-oss/3.6.18/b9cadcf869c0bdd032756228315252516856ad56/jide-oss-3.6.18-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.miglayout:miglayout-core:5.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.miglayout/miglayout-core/5.0/956daa1576bccb24e727ab75540b078171c7c432/miglayout-core-5.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.miglayout/miglayout-core/5.0/c346dd69f6de7ae6ab2e93d42fa5def41c99aa1c/miglayout-core-5.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.miglayout/miglayout-core/5.0/c457b92ed51255fdb5dfab4e89c7aec06674cd7c/miglayout-core-5.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: com.miglayout:miglayout-swing:5.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.miglayout/miglayout-swing/5.0/7b4c4d92002459e68e8f115b9ae8a774b2660490/miglayout-swing-5.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.miglayout/miglayout-swing/5.0/7f87b7818189138a1e9691b861d06f20f121820d/miglayout-swing-5.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.miglayout/miglayout-swing/5.0/d3e06bcc8aabd8cdd1f40989e12ced6413fae68c/miglayout-swing-5.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: commons-io:commons-io:1.3.2">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/1.3.2/b6dde38349ba9bb5e6ea6320531eae969985dae5/commons-io-1.3.2.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/1.3.2/6927a72f39651d8d57070a35c3ba669c2314a47c/commons-io-1.3.2-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/1.3.2/b41a5f39fa90007a6c247175933555ba5f166d70/commons-io-1.3.2-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: javax.usb:usb-api:1.0.2">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.usb/usb-api/1.0.2/f0ae0d322a99811cf79d508d37f3dc2d82753070/usb-api-1.0.2.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.usb/usb-api/1.0.2/c0bc03446978d12d8b5b3e8a136a181936f61015/usb-api-1.0.2-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.usb/usb-api/1.0.2/4b6337e574535ac803bbc05f3f22808d8bdba0d0/usb-api-1.0.2-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: junit:junit:4.12">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/941a8be4506c65f0a9001c08812fb7da1e505e21/junit-4.12-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/a6c32b40bf3d76eca54e3c601e5d1470c86fcdfa/junit-4.12-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: net.coderazzi:tablefilter-swing:5.3.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.coderazzi/tablefilter-swing/5.3.1/998bed231fba3ca6ab2f182aa576e5cb1df3339c/tablefilter-swing-5.3.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.coderazzi/tablefilter-swing/5.3.1/90c361ce16cd898f1629906fa1df6d74a678704c/tablefilter-swing-5.3.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.coderazzi/tablefilter-swing/5.3.1/9e46adc554cfdf19029afa46ee81044ea5602b44/tablefilter-swing-5.3.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.apache.axis:axis-jaxrpc:1.4">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.axis/axis-jaxrpc/1.4/b393f1f0c0d95b68c86d0b1ab2e687bb71f3c075/axis-jaxrpc-1.4.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.apache.axis:axis:1.4">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.axis/axis/1.4/94a9ce681a42d0352b3ad22659f67835e560d107/axis-1.4.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.axis/axis/1.4/442ab1fe3e66b6d5c916ae3f203fbfa618515f1c/axis-1.4-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.apache.commons:commons-lang3:3.8.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.8.1/6505a72a097d9270f7a9e7bf42c4238283247755/commons-lang3-3.8.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.8.1/e7e19f37a0e712862967e39558b888fb59ee5b6a/commons-lang3-3.8.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.8.1/e9748d7783594da3735ad9724390a10e7cebc01d/commons-lang3-3.8.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.apache.commons:commons-math3:3.5">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-math3/3.5/13af68e9a11576953f5c4b09436f8207be9d3a27/commons-math3-3.5.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-math3/3.5/e6106a9927c5ee66d0e647ad116af26c9b6b5f06/commons-math3-3.5-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-math3/3.5/1d3f412d28c8bff0e8f048240b08bcd21cfa432e/commons-math3-3.5-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.apache.mina:mina-core:2.0.16">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.mina/mina-core/2.0.16/f720f17643eaa7b0fec07c1d7f6272972c02bba4/mina-core-2.0.16.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.mina/mina-core/2.0.16/9b8b385cba38847719659ce6fde466828c4ab623/mina-core-2.0.16-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.mina/mina-core/2.0.16/660fb813ca1c8d8a936f894324091400a5ac128a/mina-core-2.0.16-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.apache.mina:mina-http:2.0.16">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.mina/mina-http/2.0.16/b2081b5255a3998a044c34b12797b915e1640122/mina-http-2.0.16.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.mina/mina-http/2.0.16/38119b808477795cc161a2aaf3e5bb16920a9aae/mina-http-2.0.16-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.mina/mina-http/2.0.16/fadd15439d830c99ccd6e020a2e125f0a4224059/mina-http-2.0.16-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.assertj:assertj-core:3.8.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.8.0/b209d90ff2e279bee3e02547ee7b11349c52d0e3/assertj-core-3.8.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.8.0/a2958ce39a3fd0ccdb52502e3a839edec50b6a98/assertj-core-3.8.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.8.0/85dab3e124fb391b10196df9bfdb43640deabb09/assertj-core-3.8.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.checkerframework:checker-qual:2.5.2">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-qual/2.5.2/cea74543d5904a30861a61b4643a5f2bb372efc4/checker-qual-2.5.2.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-qual/2.5.2/bfab5d13a888ce75ba0104fdb310808e445ff67d/checker-qual-2.5.2-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-qual/2.5.2/ebb8ebccd42218434674f3e1d9022c13df1c19f8/checker-qual-2.5.2-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.codehaus.mojo:animal-sniffer-annotations:1.17">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.mojo/animal-sniffer-annotations/1.17/f97ce6decaea32b36101e37979f8b647f00681fb/animal-sniffer-annotations-1.17.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.mojo/animal-sniffer-annotations/1.17/c67d33bf1588c89f633cf6b5a629d0e1dc1b02c4/animal-sniffer-annotations-1.17-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.mojo/animal-sniffer-annotations/1.17/8fb5b5ad9c9723951b9fccaba5bb657fa6064868/animal-sniffer-annotations-1.17-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.codehaus.woodstox:stax2-api:3.1.4">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.woodstox/stax2-api/3.1.4/ac19014b1e6a7c08aad07fe114af792676b685b7/stax2-api-3.1.4.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.woodstox/stax2-api/3.1.4/819aa74f907d379c6afc2e0376808ca9feadcbb1/stax2-api-3.1.4-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.woodstox/stax2-api/3.1.4/b40604d61c01cc081a4a7bdfc562aa9847ee8857/stax2-api-3.1.4-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.hamcrest:hamcrest-core:1.3">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/ad09811315f1d4f5756986575b0ea16b99cd686f/hamcrest-core-1.3-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b/hamcrest-core-1.3-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.kordamp.ikonli:ikonli-core:2.1.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.kordamp.ikonli/ikonli-core/2.1.1/99b0142ea24785d14d51e329dd8050a9a55b8904/ikonli-core-2.1.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.kordamp.ikonli/ikonli-core/2.1.1/2931b2864da41ce42f1a5973b4239d25e02d0f37/ikonli-core-2.1.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.kordamp.ikonli/ikonli-core/2.1.1/ce342290407ae3c6ce7b1249978c9ddf45b92974/ikonli-core-2.1.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.kordamp.ikonli:ikonli-fontawesome-pack:2.1.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.kordamp.ikonli/ikonli-fontawesome-pack/2.1.1/5c48f3fbb11a21b6fe460650569085aa0b7e4ae1/ikonli-fontawesome-pack-2.1.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.kordamp.ikonli/ikonli-fontawesome-pack/2.1.1/e8c0c8694953bdbcca312b8cc0e6dbc5c2e7ec8b/ikonli-fontawesome-pack-2.1.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.kordamp.ikonli/ikonli-fontawesome-pack/2.1.1/19de8abf192dcc83c0d0b7b507fa1fc72ce6bbb2/ikonli-fontawesome-pack-2.1.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.kordamp.ikonli:ikonli-javafx:2.1.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.kordamp.ikonli/ikonli-javafx/2.1.1/bf3e8f21146016f3fcee9ab48ab2228b7db4bc49/ikonli-javafx-2.1.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.kordamp.ikonli/ikonli-javafx/2.1.1/7c45822547d7a8a53d80ebb8e4a5602db10f9e45/ikonli-javafx-2.1.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.kordamp.ikonli/ikonli-javafx/2.1.1/a9c7c4aaad34e274df03701b84e064d9169ddd1d/ikonli-javafx-2.1.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.slf4j:slf4j-api:1.7.25">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.25/da76ca59f6a57ee3102f8f9bd9cee742973efa8a/slf4j-api-1.7.25.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.25/f003e89ddebdbaca5cf3fc7cc0c67c88c2ca1a3c/slf4j-api-1.7.25-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.25/962153db4a9ea71b79d047dfd1b2a0d80d8f4739/slf4j-api-1.7.25-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.usb4java:libusb4java:darwin-x86-64:1.3.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/1fdaa8ec7cfad158be58fbc8e2867d05f2b5fe63/libusb4java-1.3.0-darwin-x86-64.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.usb4java:libusb4java:linux-aarch64:1.3.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/bb5924dfb86c27ca5d91ccc975c11da2caa3c82d/libusb4java-1.3.0-linux-aarch64.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.usb4java:libusb4java:linux-arm:1.3.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/504de50cc979b1f19b76ba1154d298632ff1be4e/libusb4java-1.3.0-linux-arm.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.usb4java:libusb4java:linux-x86-64:1.3.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/9514c818fc97f831277873f082dcefd5394045e4/libusb4java-1.3.0-linux-x86-64.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.usb4java:libusb4java:linux-x86:1.3.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/7abf7240bcd7c26cb1ea5265eec5e6d703b71b4e/libusb4java-1.3.0-linux-x86.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.usb4java:libusb4java:win32-x86-64:1.3.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/8cd521a203404d65f4bc59c2a8a38eb4dcd302da/libusb4java-1.3.0-win32-x86-64.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.usb4java:libusb4java:win32-x86:1.3.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/9cb97c4b8317d8dae0401f80438fde5bfd910b2c/libusb4java-1.3.0-win32-x86.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.usb4java:usb4java-javax:1.3.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java-javax/1.3.0/b68f4617513a61e889fbf81926daba9c9accc96d/usb4java-javax-1.3.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java-javax/1.3.0/76268e0268e00cace559a5d3284b065d64044a76/usb4java-javax-1.3.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java-javax/1.3.0/684ff71e8ca72e5536116390909dd37fcb590690/usb4java-javax-1.3.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: org.usb4java:usb4java:1.3.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java/1.3.0/2d5487fdf303642d480b199a9da0c5a0d2bb0e82/usb4java-1.3.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java/1.3.0/e688082c68718dfbd6f566beb2eebf31cc225036/usb4java-1.3.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java/1.3.0/e6f73cf21dbbc0ecf85417f311e13d8eb278d14a/usb4java-1.3.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
<library name="Gradle: pl.edu.icm:JLargeArrays:1.6">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/pl.edu.icm/JLargeArrays/1.6/be888269f87ebf21f49d979925a07551f6e795ff/JLargeArrays-1.6.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/pl.edu.icm/JLargeArrays/1.6/80bc6536d3d1183ed46bf8a3fccfe8da9a65d34e/JLargeArrays-1.6-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/pl.edu.icm/JLargeArrays/1.6/20a1c4e9de9d8d4943ecdf723bed6a7f843ac20e/JLargeArrays-1.6-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
||||||
<component name="masterDetails">
|
|
||||||
<states>
|
|
||||||
<state key="ArtifactsStructureConfigurable.UI">
|
|
||||||
<UIState>
|
|
||||||
<splitter-proportions>
|
|
||||||
<SplitterProportionsDataImpl />
|
|
||||||
</splitter-proportions>
|
|
||||||
<settings />
|
|
||||||
</UIState>
|
|
||||||
</state>
|
|
||||||
<state key="Copyright.UI">
|
|
||||||
<UIState>
|
|
||||||
<splitter-proportions>
|
|
||||||
<SplitterProportionsDataImpl />
|
|
||||||
</splitter-proportions>
|
|
||||||
</UIState>
|
|
||||||
</state>
|
|
||||||
<state key="ProjectJDKs.UI">
|
|
||||||
<UIState>
|
|
||||||
<splitter-proportions>
|
|
||||||
<SplitterProportionsDataImpl>
|
|
||||||
<option name="proportions">
|
|
||||||
<list>
|
|
||||||
<option value="0.2" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</SplitterProportionsDataImpl>
|
|
||||||
</splitter-proportions>
|
|
||||||
<last-edited>1.6</last-edited>
|
|
||||||
</UIState>
|
|
||||||
</state>
|
|
||||||
<state key="ScopeChooserConfigurable.UI">
|
|
||||||
<UIState>
|
|
||||||
<splitter-proportions>
|
|
||||||
<SplitterProportionsDataImpl />
|
|
||||||
</splitter-proportions>
|
|
||||||
<settings />
|
|
||||||
</UIState>
|
|
||||||
</state>
|
|
||||||
</states>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -1 +1,95 @@
|
|||||||
|
plugins {
|
||||||
|
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
|
||||||
|
}
|
||||||
rootProject.name = 'sdr-trunk'
|
rootProject.name = 'sdr-trunk'
|
||||||
|
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven { url = 'https://jitpack.io' }
|
||||||
|
|
||||||
|
//jAirspy is published as a GitHub release, with the native libraries for all platforms in the jar
|
||||||
|
ivy {
|
||||||
|
url = 'https://github.com/DSheirer/jAirspy/releases/download'
|
||||||
|
patternLayout { artifact 'v[revision]/[artifact]-[revision].[ext]' }
|
||||||
|
metadataSources { artifact() }
|
||||||
|
content { includeModule 'io.github.dsheirer', 'jairspy' }
|
||||||
|
}
|
||||||
|
|
||||||
|
//jAirspyHF is published as a GitHub release, with the native libraries for all platforms in the jar
|
||||||
|
ivy {
|
||||||
|
url = 'https://github.com/DSheirer/jAirspyHF/releases/download'
|
||||||
|
patternLayout { artifact 'v[revision]/[artifact]-[revision].[ext]' }
|
||||||
|
metadataSources { artifact() }
|
||||||
|
content { includeModule 'io.github.dsheirer', 'jairspyhf' }
|
||||||
|
}
|
||||||
|
|
||||||
|
//jRTL is published as a GitHub release, with the native libraries for all platforms in the jar
|
||||||
|
ivy {
|
||||||
|
url = 'https://github.com/DSheirer/jRTL/releases/download'
|
||||||
|
patternLayout { artifact 'v[revision]/[artifact]-[revision].[ext]' }
|
||||||
|
metadataSources { artifact() }
|
||||||
|
content { includeModule 'io.github.dsheirer', 'jrtl' }
|
||||||
|
}
|
||||||
|
|
||||||
|
//jlibusb is published as a GitHub release, with libusb for all platforms in the jar. Tuner libraries built on
|
||||||
|
//jlibusb (jAirspy, jAirspyHF, jBladeRF, jHackRF, jHydraSDR, jLimeSDR, jRTL) load their native library next to its libusb, so the process shares one copy.
|
||||||
|
ivy {
|
||||||
|
url = 'https://github.com/DSheirer/jlibusb/releases/download'
|
||||||
|
patternLayout { artifact 'v[revision]/[artifact]-[revision].[ext]' }
|
||||||
|
metadataSources { artifact() }
|
||||||
|
content { includeModule 'io.github.dsheirer', 'jlibusb' }
|
||||||
|
}
|
||||||
|
|
||||||
|
//jHackRF is published as a GitHub release, with the native libraries for all platforms in the jar
|
||||||
|
ivy {
|
||||||
|
url = 'https://github.com/DSheirer/jHackRF/releases/download'
|
||||||
|
patternLayout { artifact 'v[revision]/[artifact]-[revision].[ext]' }
|
||||||
|
metadataSources { artifact() }
|
||||||
|
content { includeModule 'io.github.dsheirer', 'jhackrf' }
|
||||||
|
}
|
||||||
|
|
||||||
|
//jHydraSDR is published as a GitHub release, with the native libraries for all platforms in the jar
|
||||||
|
ivy {
|
||||||
|
url = 'https://github.com/DSheirer/jHydraSDR/releases/download'
|
||||||
|
patternLayout { artifact 'v[revision]/[artifact]-[revision].[ext]' }
|
||||||
|
metadataSources { artifact() }
|
||||||
|
content { includeModule 'io.github.dsheirer', 'jhydrasdr' }
|
||||||
|
}
|
||||||
|
|
||||||
|
//jLimeSDR is published as a GitHub release, with the native libraries for all platforms in the jar
|
||||||
|
ivy {
|
||||||
|
url = 'https://github.com/DSheirer/jLimeSDR/releases/download'
|
||||||
|
patternLayout { artifact 'v[revision]/[artifact]-[revision].[ext]' }
|
||||||
|
metadataSources { artifact() }
|
||||||
|
content { includeModule 'io.github.dsheirer', 'jlimesdr' }
|
||||||
|
}
|
||||||
|
|
||||||
|
//jsdrplay is published as a GitHub release. The jar does not contain the SDRplay API native library, which
|
||||||
|
//users install separately from sdrplay.com
|
||||||
|
ivy {
|
||||||
|
url = 'https://github.com/DSheirer/jsdrplay/releases/download'
|
||||||
|
patternLayout { artifact 'v[revision]/[artifact]-[revision].[ext]' }
|
||||||
|
metadataSources { artifact() }
|
||||||
|
content { includeModule 'io.github.dsheirer', 'jsdrplay' }
|
||||||
|
}
|
||||||
|
|
||||||
|
//jBladeRF is published as a GitHub release, with the native libraries for all platforms in the jar
|
||||||
|
ivy {
|
||||||
|
url = 'https://github.com/DSheirer/jBladeRF/releases/download'
|
||||||
|
patternLayout { artifact 'v[revision]/[artifact]-[revision].[ext]' }
|
||||||
|
metadataSources { artifact() }
|
||||||
|
content { includeModule 'io.github.dsheirer', 'jbladerf' }
|
||||||
|
}
|
||||||
|
|
||||||
|
//radio-reference-api is published as a GitHub release. Its dependencies (jackson-dataformat-xml, slf4j-api)
|
||||||
|
//are not pulled in transitively and are declared directly in build.gradle
|
||||||
|
ivy {
|
||||||
|
url = 'https://github.com/DSheirer/radio-reference-api/releases/download'
|
||||||
|
patternLayout { artifact 'v[revision]/[artifact]-[revision].[ext]' }
|
||||||
|
metadataSources { artifact() }
|
||||||
|
content { includeModule 'io.github.dsheirer', 'radio-reference-api' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.java.swing.plaf.windows;
|
||||||
|
|
||||||
|
import javax.swing.LookAndFeel;
|
||||||
|
import javax.swing.UIDefaults;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* No-op stub for the JDK's Windows look-and-feel.
|
||||||
|
*
|
||||||
|
* <p>JIDE 3.6.18's {@code LookAndFeelFactory} contains compile-time
|
||||||
|
* {@code instanceof com.sun.java.swing.plaf.windows.WindowsLookAndFeel} checks throughout its
|
||||||
|
* dispatch logic. On Linux and macOS JDK builds that class is genuinely absent from
|
||||||
|
* {@code java.desktop}, so the JVM throws {@link NoClassDefFoundError} the first time JIDE's
|
||||||
|
* dispatch code executes the {@code instanceof} bytecode. That happens during
|
||||||
|
* {@link com.jidesoft.swing.JideSplitPane#updateUI()} on every LAF change.
|
||||||
|
*
|
||||||
|
* <p>This stub lives in the classpath so the class reference resolves on non-Windows JDKs.
|
||||||
|
* On Windows JDK builds the real {@code WindowsLookAndFeel} is loaded from the
|
||||||
|
* {@code java.desktop} module via the boot class loader and shadows this class.
|
||||||
|
*
|
||||||
|
* <p>The stub reports itself as not native and not supported - JIDE never instantiates this
|
||||||
|
* class, it only uses it for {@code instanceof} comparisons against the active LAF. Since
|
||||||
|
* sdrtrunk never installs this LAF, the {@code instanceof} check always returns false and
|
||||||
|
* JIDE proceeds to its next branch.
|
||||||
|
*/
|
||||||
|
public class WindowsLookAndFeel extends LookAndFeel
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return "Windows (stub)";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getID()
|
||||||
|
{
|
||||||
|
return "WindowsStub";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return "Compatibility stub for JIDE's instanceof checks on non-Windows JDKs.";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNativeLookAndFeel()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSupportedLookAndFeel()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UIDefaults getDefaults()
|
||||||
|
{
|
||||||
|
return new UIDefaults();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2025 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.alias;
|
package io.github.dsheirer.alias;
|
||||||
|
|
||||||
@@ -28,161 +27,492 @@ import io.github.dsheirer.alias.id.AliasIDType;
|
|||||||
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
||||||
import io.github.dsheirer.alias.id.priority.Priority;
|
import io.github.dsheirer.alias.id.priority.Priority;
|
||||||
import io.github.dsheirer.alias.id.record.Record;
|
import io.github.dsheirer.alias.id.record.Record;
|
||||||
|
import io.github.dsheirer.alias.id.talkgroup.StreamAsTalkgroup;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
import javafx.beans.Observable;
|
||||||
|
import javafx.beans.binding.Bindings;
|
||||||
|
import javafx.beans.binding.BooleanBinding;
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
import javafx.beans.property.IntegerProperty;
|
||||||
|
import javafx.beans.property.ObjectProperty;
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
|
import javafx.beans.property.StringProperty;
|
||||||
|
import javafx.collections.FXCollections;
|
||||||
|
import javafx.collections.ObservableList;
|
||||||
|
import javafx.collections.transformation.FilteredList;
|
||||||
|
import javafx.util.Callback;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias provides an aliasing (e.g. name, color, etc) container that is linked to multiple alias identifiers and
|
||||||
|
* provides a corresponding set of actions related to the alias.
|
||||||
|
*/
|
||||||
@JacksonXmlRootElement(localName = "alias")
|
@JacksonXmlRootElement(localName = "alias")
|
||||||
public class Alias
|
public class Alias
|
||||||
{
|
{
|
||||||
private String mList;
|
private final static Logger mLog = LoggerFactory.getLogger(Alias.class);
|
||||||
private String mGroup;
|
|
||||||
private String mName;
|
|
||||||
private int mColor;
|
|
||||||
private String mIconName;
|
|
||||||
private List<AliasID> mAliasIDs = new ArrayList<AliasID>();
|
|
||||||
private List<AliasAction> mAliasActions = new ArrayList<AliasAction>();
|
|
||||||
|
|
||||||
public Alias()
|
private BooleanProperty mRecordable = new SimpleBooleanProperty();
|
||||||
{
|
private BooleanProperty mStreamable = new SimpleBooleanProperty();
|
||||||
}
|
private BooleanProperty mOverlap = new SimpleBooleanProperty();
|
||||||
|
private IntegerProperty mColor = new SimpleIntegerProperty();
|
||||||
|
private IntegerProperty mPriority = new SimpleIntegerProperty(Priority.DEFAULT_PRIORITY);
|
||||||
|
private IntegerProperty mNonAudioIdentifierCount = new SimpleIntegerProperty();
|
||||||
|
private StringProperty mAliasListName = new SimpleStringProperty();
|
||||||
|
private StringProperty mGroup = new SimpleStringProperty();
|
||||||
|
private StringProperty mIconName = new SimpleStringProperty();
|
||||||
|
private StringProperty mName = new SimpleStringProperty();
|
||||||
|
private ObservableList<AliasID> mAliasIDs = FXCollections.observableArrayList();
|
||||||
|
private ObservableList<AliasAction> mAliasActions = FXCollections.observableArrayList();
|
||||||
|
private ObjectProperty<StreamAsTalkgroup> mStreamTalkgroupAlias = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance and sets the specified name.
|
||||||
|
* @param name for the alias
|
||||||
|
*/
|
||||||
public Alias(String name)
|
public Alias(String name)
|
||||||
{
|
{
|
||||||
mName = name;
|
mName.set(name);
|
||||||
|
|
||||||
|
//Bind the non-audio identifier count property to the size of a filtered list of alias identifiers
|
||||||
|
mNonAudioIdentifierCount.bind(Bindings.size(new FilteredList<>(mAliasIDs, aliasID -> {
|
||||||
|
return aliasID != null && !aliasID.isAudioIdentifier();
|
||||||
|
})));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
*/
|
||||||
|
public Alias()
|
||||||
|
{
|
||||||
|
this(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Count of non-audio identifiers for this alias
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public IntegerProperty nonAudioIdentifierCountProperty()
|
||||||
|
{
|
||||||
|
return mNonAudioIdentifierCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Audio playback priority
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public IntegerProperty priorityProperty()
|
||||||
|
{
|
||||||
|
return mPriority;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if one or more of the identifiers for this alias overlap with identifiers from another alias
|
||||||
|
* within the same alias list.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public BooleanProperty overlapProperty()
|
||||||
|
{
|
||||||
|
return mOverlap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recordable property
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public BooleanProperty recordableProperty()
|
||||||
|
{
|
||||||
|
return mRecordable;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Streamable property
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public BooleanProperty streamableProperty()
|
||||||
|
{
|
||||||
|
return mStreamable;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias list name property
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public StringProperty aliasListNameProperty()
|
||||||
|
{
|
||||||
|
return mAliasListName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Group property
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public StringProperty groupProperty()
|
||||||
|
{
|
||||||
|
return mGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias name property
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public StringProperty nameProperty()
|
||||||
|
{
|
||||||
|
return mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias color value property
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public IntegerProperty colorProperty()
|
||||||
|
{
|
||||||
|
return mColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public ObjectProperty streamTalkgroupAliasProperty()
|
||||||
|
{
|
||||||
|
return mStreamTalkgroupAlias;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Icon name property
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public StringProperty iconNameProperty()
|
||||||
|
{
|
||||||
|
return mIconName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias identifiers list property
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public ObservableList<AliasID> aliasIds()
|
||||||
|
{
|
||||||
|
return mAliasIDs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias actions list property
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public ObservableList<AliasAction> aliasActions()
|
||||||
|
{
|
||||||
|
return mAliasActions;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Uses name value for string representation
|
||||||
|
*/
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return getName();
|
return getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias name
|
||||||
|
*/
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "name")
|
@JacksonXmlProperty(isAttribute = true, localName = "name")
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return mName;
|
return mName.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name)
|
public void setName(String name)
|
||||||
{
|
{
|
||||||
mName = name;
|
mName.set(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias name
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "stream_talkgroup_alias")
|
||||||
|
public StreamAsTalkgroup getStreamTalkgroupAlias()
|
||||||
|
{
|
||||||
|
return mStreamTalkgroupAlias.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the stream as talkgroup value that will be used in the TO field for streamed audio calls.
|
||||||
|
* @param streamTalkgroupAlias with a talkgroup value.
|
||||||
|
*/
|
||||||
|
public void setStreamTalkgroupAlias(StreamAsTalkgroup streamTalkgroupAlias)
|
||||||
|
{
|
||||||
|
mStreamTalkgroupAlias.set(streamTalkgroupAlias);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias list name for the alias list that this alias belongs to
|
||||||
|
*/
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "list")
|
@JacksonXmlProperty(isAttribute = true, localName = "list")
|
||||||
public String getList()
|
public String getAliasListName()
|
||||||
{
|
{
|
||||||
return mList;
|
return mAliasListName.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setList(String list)
|
public void setAliasListName(String aliasListName)
|
||||||
{
|
{
|
||||||
mList = list;
|
mAliasListName.set(aliasListName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean matchesAliasList(String aliasList)
|
||||||
|
{
|
||||||
|
boolean isEmptyArgument = aliasList == null || aliasList.isEmpty() || aliasList.contentEquals(AliasModel.NO_ALIAS_LIST);
|
||||||
|
boolean isEmptyThis = getAliasListName() == null || getAliasListName().isEmpty();
|
||||||
|
|
||||||
|
if(isEmptyArgument && isEmptyThis)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if(!isEmptyArgument && !isEmptyThis && aliasList.contentEquals(getAliasListName()))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this alias has a specified alias list name
|
||||||
|
*/
|
||||||
public boolean hasList()
|
public boolean hasList()
|
||||||
{
|
{
|
||||||
return mList != null;
|
return mAliasListName.get() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Grouping tag for this alias.
|
||||||
|
*/
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "group")
|
@JacksonXmlProperty(isAttribute = true, localName = "group")
|
||||||
public String getGroup()
|
public String getGroup()
|
||||||
{
|
{
|
||||||
return mGroup;
|
return mGroup.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGroup(String group)
|
public void setGroup(String group)
|
||||||
{
|
{
|
||||||
mGroup = group;
|
mGroup.set(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this alias has a grouping tag
|
||||||
|
*/
|
||||||
public boolean hasGroup()
|
public boolean hasGroup()
|
||||||
{
|
{
|
||||||
return mGroup != null;
|
return mGroup.get() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Color (RGBA) value to use for this alias
|
||||||
|
*/
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "color")
|
@JacksonXmlProperty(isAttribute = true, localName = "color")
|
||||||
public int getColor()
|
public int getColor()
|
||||||
{
|
{
|
||||||
return mColor;
|
return mColor.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public String getColorHex()
|
||||||
|
{
|
||||||
|
return String.format("#%06X", (0xFFFFFF & mColor.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setColor(int color)
|
public void setColor(int color)
|
||||||
{
|
{
|
||||||
mColor = color;
|
mColor.set(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display color for this alias.
|
||||||
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Color getDisplayColor()
|
public Color getDisplayColor()
|
||||||
{
|
{
|
||||||
return new Color(getColor());
|
return new Color(getColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Icon name of the icon to use for this alias.
|
||||||
|
*/
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "iconName")
|
@JacksonXmlProperty(isAttribute = true, localName = "iconName")
|
||||||
public String getIconName()
|
public String getIconName()
|
||||||
{
|
{
|
||||||
return mIconName;
|
return mIconName.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIconName(String iconName)
|
public void setIconName(String iconName)
|
||||||
{
|
{
|
||||||
mIconName = iconName;
|
mIconName.set(iconName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of alias identifiers for this alias.
|
||||||
|
*/
|
||||||
@JacksonXmlProperty(isAttribute = false, localName = "id")
|
@JacksonXmlProperty(isAttribute = false, localName = "id")
|
||||||
public List<AliasID> getId()
|
public List<AliasID> getAliasIdentifiers()
|
||||||
{
|
{
|
||||||
return mAliasIDs;
|
return mAliasIDs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(ArrayList<AliasID> id)
|
public void setAliasIdentifiers(List<AliasID> id)
|
||||||
{
|
{
|
||||||
mAliasIDs = id;
|
mAliasIDs.clear();
|
||||||
|
|
||||||
|
for(AliasID aliasID : id)
|
||||||
|
{
|
||||||
|
addAliasID(aliasID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds an alias identifier to this alias and updates the recordable and streamable attributes.
|
||||||
|
*/
|
||||||
public void addAliasID(AliasID id)
|
public void addAliasID(AliasID id)
|
||||||
{
|
{
|
||||||
mAliasIDs.add(id);
|
mAliasIDs.add(id);
|
||||||
|
validate();
|
||||||
|
updateOverlapBinding();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes an alias identifier from this alias and updates the recordable and streamable attributes.
|
||||||
|
*/
|
||||||
public void removeAliasID(AliasID id)
|
public void removeAliasID(AliasID id)
|
||||||
{
|
{
|
||||||
mAliasIDs.remove(id);
|
if(id != null)
|
||||||
|
{
|
||||||
|
mAliasIDs.remove(id);
|
||||||
|
validate();
|
||||||
|
updateOverlapBinding();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of alias actions associated with this alias.
|
||||||
|
*/
|
||||||
@JacksonXmlProperty(isAttribute = false, localName = "action")
|
@JacksonXmlProperty(isAttribute = false, localName = "action")
|
||||||
public List<AliasAction> getAction()
|
public List<AliasAction> getAliasActions()
|
||||||
{
|
{
|
||||||
return mAliasActions;
|
return mAliasActions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAction(List<AliasAction> actions)
|
public void setAliasActions(List<AliasAction> actions)
|
||||||
{
|
{
|
||||||
mAliasActions = actions;
|
mAliasActions.setAll(actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the specified alias action to this alias
|
||||||
|
*/
|
||||||
public void addAliasAction(AliasAction action)
|
public void addAliasAction(AliasAction action)
|
||||||
{
|
{
|
||||||
mAliasActions.add(action);
|
mAliasActions.add(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the specified alias action from this alias
|
||||||
|
*/
|
||||||
public void removeAliasAction(AliasAction action)
|
public void removeAliasAction(AliasAction action)
|
||||||
{
|
{
|
||||||
mAliasActions.remove(action);
|
mAliasActions.remove(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this alias has any associated
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public boolean hasActions()
|
public boolean hasActions()
|
||||||
{
|
{
|
||||||
return !mAliasActions.isEmpty();
|
return !mAliasActions.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the playback priority this alias
|
||||||
|
*/
|
||||||
|
private void updatePriority()
|
||||||
|
{
|
||||||
|
for(AliasID aliasID: mAliasIDs)
|
||||||
|
{
|
||||||
|
if(aliasID instanceof Priority)
|
||||||
|
{
|
||||||
|
mPriority.set(((Priority)aliasID).getPriority());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mPriority.set(Priority.DEFAULT_PRIORITY);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateOverlapBinding()
|
||||||
|
{
|
||||||
|
mOverlap.unbind();
|
||||||
|
|
||||||
|
BooleanBinding binding = new SimpleBooleanProperty(true).not();
|
||||||
|
|
||||||
|
for(AliasID aliasID: mAliasIDs)
|
||||||
|
{
|
||||||
|
binding = binding.or(aliasID.overlapProperty());
|
||||||
|
}
|
||||||
|
|
||||||
|
mOverlap.bind(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the recordable status for this alias
|
||||||
|
*/
|
||||||
|
private void updateRecordable()
|
||||||
|
{
|
||||||
|
for(AliasID aliasID: mAliasIDs)
|
||||||
|
{
|
||||||
|
if(aliasID instanceof Record)
|
||||||
|
{
|
||||||
|
mRecordable.set(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mRecordable.set(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the streamable status for this alias
|
||||||
|
*/
|
||||||
|
private void updateStreamable()
|
||||||
|
{
|
||||||
|
for(AliasID aliasID: mAliasIDs)
|
||||||
|
{
|
||||||
|
if(aliasID instanceof BroadcastChannel)
|
||||||
|
{
|
||||||
|
mStreamable.set(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mStreamable.set(false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform any validation/cleanup actions on this alias.
|
* Perform any validation/cleanup actions on this alias.
|
||||||
*/
|
*/
|
||||||
public void validate()
|
public void validate()
|
||||||
{
|
{
|
||||||
|
updatePriority();
|
||||||
|
updateRecordable();
|
||||||
|
updateStreamable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -220,22 +550,23 @@ public class Alias
|
|||||||
*/
|
*/
|
||||||
public void setCallPriority(int priority)
|
public void setCallPriority(int priority)
|
||||||
{
|
{
|
||||||
if(priority == Priority.DO_NOT_MONITOR ||
|
AliasID priorityID = null;
|
||||||
(Priority.MIN_PRIORITY <= priority && priority <= Priority.MAX_PRIORITY))
|
|
||||||
{
|
|
||||||
for(AliasID id : mAliasIDs)
|
|
||||||
{
|
|
||||||
if(id.getType() == AliasIDType.PRIORITY)
|
|
||||||
{
|
|
||||||
((Priority)id).setPriority(priority);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//If we don't find a priority id, create one
|
for(AliasID aliasID: mAliasIDs)
|
||||||
Priority p = new Priority();
|
{
|
||||||
p.setPriority(priority);
|
if(aliasID instanceof Priority)
|
||||||
addAliasID(p);
|
{
|
||||||
|
priorityID = aliasID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
removeAliasID(priorityID);
|
||||||
|
|
||||||
|
//Don't add a priority alias id if the priority is MAX_PRIORITY or DEFAULT_PRIORITY since the getCallPriority()
|
||||||
|
//will return that as the default value
|
||||||
|
if(priority == Priority.DO_NOT_MONITOR || (Priority.MIN_PRIORITY <= priority && priority < Priority.MAX_PRIORITY))
|
||||||
|
{
|
||||||
|
addAliasID(new Priority(priority));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,15 +576,7 @@ public class Alias
|
|||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public boolean isRecordable()
|
public boolean isRecordable()
|
||||||
{
|
{
|
||||||
for(AliasID id : getId())
|
return mRecordable.get();
|
||||||
{
|
|
||||||
if(id.getType() == AliasIDType.RECORD)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -261,36 +584,22 @@ public class Alias
|
|||||||
*/
|
*/
|
||||||
public void setRecordable(boolean recordable)
|
public void setRecordable(boolean recordable)
|
||||||
{
|
{
|
||||||
|
AliasID recordID = null;
|
||||||
|
|
||||||
|
for(AliasID aliasID: mAliasIDs)
|
||||||
|
{
|
||||||
|
if(aliasID instanceof Record)
|
||||||
|
{
|
||||||
|
recordID = aliasID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
removeAliasID(recordID);
|
||||||
|
|
||||||
if(recordable)
|
if(recordable)
|
||||||
{
|
{
|
||||||
for(AliasID id : getId())
|
|
||||||
{
|
|
||||||
if(id.getType() == AliasIDType.RECORD)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
addAliasID(new Record());
|
addAliasID(new Record());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
AliasID toRemove = null;
|
|
||||||
|
|
||||||
for(AliasID id : getId())
|
|
||||||
{
|
|
||||||
if(id.getType() == AliasIDType.RECORD)
|
|
||||||
{
|
|
||||||
toRemove = id;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(toRemove != null)
|
|
||||||
{
|
|
||||||
removeAliasID(toRemove);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -299,15 +608,7 @@ public class Alias
|
|||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public boolean isStreamable()
|
public boolean isStreamable()
|
||||||
{
|
{
|
||||||
for(AliasID id : getId())
|
return mStreamable.get();
|
||||||
{
|
|
||||||
if(id.getType() == AliasIDType.BROADCAST_CHANNEL)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -318,7 +619,7 @@ public class Alias
|
|||||||
{
|
{
|
||||||
Set<BroadcastChannel> broadcastChannels = new TreeSet<>();
|
Set<BroadcastChannel> broadcastChannels = new TreeSet<>();
|
||||||
|
|
||||||
for(AliasID id : getId())
|
for(AliasID id : getAliasIdentifiers())
|
||||||
{
|
{
|
||||||
if(id.getType() == AliasIDType.BROADCAST_CHANNEL)
|
if(id.getType() == AliasIDType.BROADCAST_CHANNEL)
|
||||||
{
|
{
|
||||||
@@ -339,15 +640,101 @@ public class Alias
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(AliasID id : getId())
|
for(AliasID id : getAliasIdentifiers())
|
||||||
{
|
{
|
||||||
if(id.getType() == AliasIDType.BROADCAST_CHANNEL &&
|
if(id instanceof BroadcastChannel)
|
||||||
((BroadcastChannel)id).getChannelName().contentEquals(channel))
|
|
||||||
{
|
{
|
||||||
return true;
|
BroadcastChannel broadcastChannel = (BroadcastChannel)id;
|
||||||
|
|
||||||
|
if(broadcastChannel.getChannelName() != null && broadcastChannel.getChannelName().contentEquals(channel))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes any broadcast channel(s) that match the argument
|
||||||
|
*/
|
||||||
|
public void removeBroadcastChannel(String channel)
|
||||||
|
{
|
||||||
|
if(channel == null || channel.isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<AliasID> toRemove = new ArrayList<>();
|
||||||
|
|
||||||
|
for(AliasID aliasID: getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(aliasID instanceof BroadcastChannel &&
|
||||||
|
((BroadcastChannel)aliasID).getChannelName().contentEquals(channel))
|
||||||
|
{
|
||||||
|
toRemove.add(aliasID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(AliasID aliasID: toRemove)
|
||||||
|
{
|
||||||
|
removeAliasID(aliasID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes (clears) all broadcast channels from this alias
|
||||||
|
*/
|
||||||
|
public void removeAllBroadcastChannels()
|
||||||
|
{
|
||||||
|
List<AliasID> toRemove = new ArrayList<>();
|
||||||
|
for(AliasID aliasID: mAliasIDs)
|
||||||
|
{
|
||||||
|
if(aliasID instanceof BroadcastChannel)
|
||||||
|
{
|
||||||
|
toRemove.add(aliasID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(AliasID aliasID: toRemove)
|
||||||
|
{
|
||||||
|
removeAliasID(aliasID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all non audio identifiers to prepare for replacing them from an editor.
|
||||||
|
*/
|
||||||
|
public void removeNonAudioIdentifiers()
|
||||||
|
{
|
||||||
|
Iterator<AliasID> it = mAliasIDs.iterator();
|
||||||
|
|
||||||
|
while(it.hasNext())
|
||||||
|
{
|
||||||
|
if(!it.next().isAudioIdentifier())
|
||||||
|
{
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all alias actions from this alias
|
||||||
|
*/
|
||||||
|
public void removeAllActions()
|
||||||
|
{
|
||||||
|
mAliasActions.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an observable property extractor for use with observable lists to detect changes internal to this object.
|
||||||
|
*/
|
||||||
|
public static Callback<Alias,Observable[]> extractor()
|
||||||
|
{
|
||||||
|
return (Alias a) -> new Observable[] {a.recordableProperty(), a.streamableProperty(), a.colorProperty(),
|
||||||
|
a.aliasListNameProperty(), a.groupProperty(), a.iconNameProperty(), a.nameProperty(), a.aliasIds(),
|
||||||
|
a.aliasActions(), a.nonAudioIdentifierCountProperty(), a.overlapProperty(), a.priorityProperty(),
|
||||||
|
a.streamTalkgroupAliasProperty()};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,356 +0,0 @@
|
|||||||
package io.github.dsheirer.alias;
|
|
||||||
|
|
||||||
import com.jidesoft.swing.JideSplitPane;
|
|
||||||
import io.github.dsheirer.audio.broadcast.BroadcastModel;
|
|
||||||
import io.github.dsheirer.gui.editor.Editor;
|
|
||||||
import io.github.dsheirer.icon.IconManager;
|
|
||||||
import net.coderazzi.filters.gui.AutoChoices;
|
|
||||||
import net.coderazzi.filters.gui.TableFilterHeader;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.event.ListSelectionEvent;
|
|
||||||
import javax.swing.event.ListSelectionListener;
|
|
||||||
import javax.swing.table.DefaultTableCellRenderer;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class AliasController extends JPanel
|
|
||||||
implements ActionListener, ListSelectionListener
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private AliasModel mAliasModel;
|
|
||||||
private JTable mAliasTable;
|
|
||||||
private TableFilterHeader mTableFilterHeader;
|
|
||||||
private AliasEditor mAliasEditor;
|
|
||||||
private MultipleAliasEditor mMultipleAliasEditor;
|
|
||||||
private JideSplitPane mSplitPane;
|
|
||||||
|
|
||||||
private static final String NEW_ALIAS = "New";
|
|
||||||
private static final String COPY_ALIAS = "Copy";
|
|
||||||
private static final String DELETE_ALIAS = "Delete";
|
|
||||||
|
|
||||||
private JButton mNewButton = new JButton(NEW_ALIAS);
|
|
||||||
private JButton mCopyButton = new JButton(COPY_ALIAS);
|
|
||||||
private JButton mDeleteButton = new JButton(DELETE_ALIAS);
|
|
||||||
|
|
||||||
private IconCellRenderer mIconCellRenderer;
|
|
||||||
|
|
||||||
public AliasController(AliasModel aliasModel, BroadcastModel broadcastModel, IconManager iconManager)
|
|
||||||
{
|
|
||||||
mAliasModel = aliasModel;
|
|
||||||
|
|
||||||
mAliasEditor = new AliasEditor(mAliasModel, broadcastModel, iconManager);
|
|
||||||
mMultipleAliasEditor = new MultipleAliasEditor(mAliasModel, broadcastModel, iconManager);
|
|
||||||
|
|
||||||
mIconCellRenderer = new IconCellRenderer(iconManager);
|
|
||||||
|
|
||||||
init();
|
|
||||||
|
|
||||||
mAliasModel.addListener(mAliasEditor);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
setLayout(new MigLayout("insets 0 0 0 0",
|
|
||||||
"[grow,fill]",
|
|
||||||
"[grow,fill]"));
|
|
||||||
|
|
||||||
//System Configuration View and Editor
|
|
||||||
mAliasTable = new JTable(mAliasModel);
|
|
||||||
mAliasTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
|
||||||
mAliasTable.getSelectionModel().addListSelectionListener(this);
|
|
||||||
mAliasTable.setAutoCreateRowSorter(true);
|
|
||||||
|
|
||||||
mAliasTable.getColumnModel().getColumn(AliasModel.COLUMN_COLOR)
|
|
||||||
.setCellRenderer(new ColorCellRenderer());
|
|
||||||
|
|
||||||
mAliasTable.getColumnModel().getColumn(AliasModel.COLUMN_ICON)
|
|
||||||
.setCellRenderer(mIconCellRenderer);
|
|
||||||
|
|
||||||
mTableFilterHeader = new TableFilterHeader(mAliasTable, AutoChoices.ENABLED);
|
|
||||||
mTableFilterHeader.setFilterOnUpdates(true);
|
|
||||||
|
|
||||||
JScrollPane tableScroller = new JScrollPane(mAliasTable);
|
|
||||||
|
|
||||||
JPanel buttonsPanel = new JPanel();
|
|
||||||
|
|
||||||
buttonsPanel.setLayout(
|
|
||||||
new MigLayout("insets 0 0 0 0", "[grow,fill][grow,fill][grow,fill]", "[]"));
|
|
||||||
|
|
||||||
mNewButton.addActionListener(this);
|
|
||||||
mNewButton.setToolTipText("Adds a new alias");
|
|
||||||
buttonsPanel.add(mNewButton);
|
|
||||||
|
|
||||||
mCopyButton.addActionListener(this);
|
|
||||||
mCopyButton.setEnabled(false);
|
|
||||||
mCopyButton.setToolTipText("Creates a copy of the currently selected alias and adds it");
|
|
||||||
buttonsPanel.add(mCopyButton);
|
|
||||||
|
|
||||||
mDeleteButton.addActionListener(this);
|
|
||||||
mDeleteButton.setEnabled(false);
|
|
||||||
mDeleteButton.setToolTipText("Deletes the currently selected alias");
|
|
||||||
buttonsPanel.add(mDeleteButton);
|
|
||||||
|
|
||||||
JPanel listAndButtonsPanel = new JPanel();
|
|
||||||
|
|
||||||
listAndButtonsPanel.setLayout(
|
|
||||||
new MigLayout("insets 0 0 0 0", "[grow,fill]", "[grow,fill][]"));
|
|
||||||
|
|
||||||
listAndButtonsPanel.add(tableScroller, "wrap");
|
|
||||||
listAndButtonsPanel.add(buttonsPanel);
|
|
||||||
|
|
||||||
mSplitPane = new JideSplitPane(JideSplitPane.HORIZONTAL_SPLIT);
|
|
||||||
mSplitPane.setDividerSize(5);
|
|
||||||
mSplitPane.setShowGripper(true);
|
|
||||||
mSplitPane.add(listAndButtonsPanel);
|
|
||||||
mSplitPane.add(mAliasEditor);
|
|
||||||
|
|
||||||
add(mSplitPane);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the editor argument as the currently visible alias editor
|
|
||||||
*/
|
|
||||||
private void setEditor(Editor<?> editor)
|
|
||||||
{
|
|
||||||
if(mSplitPane.getComponentCount() == 3)
|
|
||||||
{
|
|
||||||
Component component = mSplitPane.getComponent(2);
|
|
||||||
|
|
||||||
if(component instanceof Editor<?> && component != editor)
|
|
||||||
{
|
|
||||||
//Get current divider location so that we can reapply it after
|
|
||||||
//changing out the editors, so that the interface doesn't move
|
|
||||||
int location = mSplitPane.getDividerLocation(0);
|
|
||||||
|
|
||||||
((Editor<?>) component).setItem(null);
|
|
||||||
|
|
||||||
mSplitPane.remove(component);
|
|
||||||
editor.setPreferredSize(new Dimension(100, 100));
|
|
||||||
mSplitPane.add(editor);
|
|
||||||
|
|
||||||
mSplitPane.validate();
|
|
||||||
mSplitPane.setDividerLocation(0, location);
|
|
||||||
mSplitPane.repaint();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Alias getAlias(int selectedRow)
|
|
||||||
{
|
|
||||||
if(selectedRow >= 0)
|
|
||||||
{
|
|
||||||
int index = mAliasTable.convertRowIndexToModel(selectedRow);
|
|
||||||
|
|
||||||
return mAliasModel.getAliasAtIndex(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void valueChanged(ListSelectionEvent event)
|
|
||||||
{
|
|
||||||
//Limits event firing to only when selection is complete
|
|
||||||
if(!event.getValueIsAdjusting())
|
|
||||||
{
|
|
||||||
int[] selectedRows = mAliasTable.getSelectedRows();
|
|
||||||
|
|
||||||
if(selectedRows.length == 0)
|
|
||||||
{
|
|
||||||
mAliasEditor.setItem(null);
|
|
||||||
mCopyButton.setEnabled(false);
|
|
||||||
mDeleteButton.setEnabled(false);
|
|
||||||
}
|
|
||||||
else if(selectedRows.length == 1)
|
|
||||||
{
|
|
||||||
setEditor(mAliasEditor);
|
|
||||||
|
|
||||||
Alias selectedAlias = getAlias(selectedRows[0]);
|
|
||||||
|
|
||||||
mAliasEditor.setItem(selectedAlias);
|
|
||||||
|
|
||||||
if(selectedAlias != null)
|
|
||||||
{
|
|
||||||
mCopyButton.setEnabled(true);
|
|
||||||
mDeleteButton.setEnabled(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mCopyButton.setEnabled(false);
|
|
||||||
mDeleteButton.setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setEditor(mMultipleAliasEditor);
|
|
||||||
|
|
||||||
mCopyButton.setEnabled(true);
|
|
||||||
mDeleteButton.setEnabled(true);
|
|
||||||
|
|
||||||
List<Alias> selectedAliases = new ArrayList<Alias>();
|
|
||||||
|
|
||||||
for(int selectedRow : selectedRows)
|
|
||||||
{
|
|
||||||
Alias alias = getAlias(selectedRow);
|
|
||||||
|
|
||||||
selectedAliases.add(alias);
|
|
||||||
}
|
|
||||||
|
|
||||||
mMultipleAliasEditor.setItem(selectedAliases);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds the alias to the alias table/model and scrolls the view it
|
|
||||||
*/
|
|
||||||
private void addAlias(Alias alias)
|
|
||||||
{
|
|
||||||
//HACK: when inserting a row to the model, the JTable gets
|
|
||||||
//notified and attempts to tell the coderazzi table filter
|
|
||||||
//adaptive choices filter to refresh before the table filter is
|
|
||||||
//notified of the row additions, causing an index out of bounds
|
|
||||||
//exception. We turn off adaptive choices temporarily, add the
|
|
||||||
//channel, and turn on adaptive choices again.
|
|
||||||
mTableFilterHeader.setAdaptiveChoices(false);
|
|
||||||
|
|
||||||
int index = mAliasModel.addAlias(alias);
|
|
||||||
|
|
||||||
mTableFilterHeader.setAdaptiveChoices(true);
|
|
||||||
|
|
||||||
if(index >= 0)
|
|
||||||
{
|
|
||||||
int translatedIndex = mAliasTable.convertRowIndexToView(index);
|
|
||||||
mAliasTable.setRowSelectionInterval(translatedIndex, translatedIndex);
|
|
||||||
mAliasTable.scrollRectToVisible(
|
|
||||||
new Rectangle(mAliasTable.getCellRect(translatedIndex, 0, true)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<Alias> getSelectedAliases()
|
|
||||||
{
|
|
||||||
List<Alias> selected = new ArrayList<>();
|
|
||||||
|
|
||||||
int[] rows = mAliasTable.getSelectedRows();
|
|
||||||
|
|
||||||
for(int row : rows)
|
|
||||||
{
|
|
||||||
if(row >= 0)
|
|
||||||
{
|
|
||||||
Alias alias = mAliasModel.getAliasAtIndex(mAliasTable.convertRowIndexToModel(row));
|
|
||||||
|
|
||||||
if(alias != null)
|
|
||||||
{
|
|
||||||
selected.add(alias);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return selected;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Responds to New, Copy and Delete Channel button invocations
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent event)
|
|
||||||
{
|
|
||||||
switch(event.getActionCommand())
|
|
||||||
{
|
|
||||||
case NEW_ALIAS:
|
|
||||||
addAlias(new Alias("New Alias"));
|
|
||||||
break;
|
|
||||||
case COPY_ALIAS:
|
|
||||||
for(Alias alias : getSelectedAliases())
|
|
||||||
{
|
|
||||||
addAlias(AliasFactory.copyOf(alias));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case DELETE_ALIAS:
|
|
||||||
List<Alias> toDelete = getSelectedAliases();
|
|
||||||
|
|
||||||
if(toDelete != null && !toDelete.isEmpty())
|
|
||||||
{
|
|
||||||
String title = toDelete.size() == 1 ? "Delete Alias?" : "Delete Aliases?";
|
|
||||||
String prompt = toDelete.size() == 1 ? "Do you want to delete this alias?" :
|
|
||||||
"Do you want to delete these " + toDelete.size() + " aliases?";
|
|
||||||
|
|
||||||
int choice = JOptionPane.showConfirmDialog(AliasController.this,
|
|
||||||
prompt, title, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
|
|
||||||
|
|
||||||
if(choice == JOptionPane.YES_OPTION)
|
|
||||||
{
|
|
||||||
for(Alias alias : toDelete)
|
|
||||||
{
|
|
||||||
mAliasModel.removeAlias(alias);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Colorizes the cell based on the cell's integer value
|
|
||||||
*/
|
|
||||||
public class ColorCellRenderer extends DefaultTableCellRenderer
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Component getTableCellRendererComponent(JTable table,
|
|
||||||
Object value, boolean isSelected, boolean hasFocus, int row,
|
|
||||||
int column)
|
|
||||||
{
|
|
||||||
JLabel label = (JLabel) super.getTableCellRendererComponent(table,
|
|
||||||
value, isSelected, hasFocus, row, column);
|
|
||||||
|
|
||||||
label.setBackground(new Color((int) value));
|
|
||||||
|
|
||||||
label.setText("");
|
|
||||||
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Displays cell's icon and name
|
|
||||||
*/
|
|
||||||
public class IconCellRenderer extends DefaultTableCellRenderer
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private IconManager mIconManager;
|
|
||||||
|
|
||||||
public IconCellRenderer(IconManager iconManager)
|
|
||||||
{
|
|
||||||
mIconManager = iconManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Component getTableCellRendererComponent(JTable table,
|
|
||||||
Object value, boolean isSelected, boolean hasFocus, int row,
|
|
||||||
int column)
|
|
||||||
{
|
|
||||||
JLabel label = (JLabel) super.getTableCellRendererComponent(table,
|
|
||||||
value, isSelected, hasFocus, row, column);
|
|
||||||
|
|
||||||
ImageIcon icon = mIconManager.getIcon(label.getText(), 12);
|
|
||||||
|
|
||||||
if(icon != null)
|
|
||||||
{
|
|
||||||
label.setIcon(icon);
|
|
||||||
}
|
|
||||||
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias;
|
|
||||||
|
|
||||||
import com.jidesoft.swing.JideTabbedPane;
|
|
||||||
import io.github.dsheirer.alias.action.AliasActionEditor;
|
|
||||||
import io.github.dsheirer.alias.id.AliasIdentifierEditor;
|
|
||||||
import io.github.dsheirer.audio.broadcast.BroadcastModel;
|
|
||||||
import io.github.dsheirer.gui.editor.Editor;
|
|
||||||
import io.github.dsheirer.icon.IconManager;
|
|
||||||
import io.github.dsheirer.sample.Listener;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
|
|
||||||
public class AliasEditor extends Editor<Alias> implements ActionListener, Listener<AliasEvent>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String DEFAULT_NAME = "select an alias";
|
|
||||||
|
|
||||||
private AliasModel mAliasModel;
|
|
||||||
|
|
||||||
private JLabel mAliasLabel;
|
|
||||||
private AliasNameEditor mAliasNameEditor;
|
|
||||||
private AliasIdentifierEditor mAliasIdentifierEditor;
|
|
||||||
private AliasActionEditor mAliasActionEditor;
|
|
||||||
|
|
||||||
public AliasEditor(AliasModel aliasModel, BroadcastModel broadcastModel, IconManager iconManager )
|
|
||||||
{
|
|
||||||
mAliasModel = aliasModel;
|
|
||||||
mAliasNameEditor = new AliasNameEditor( mAliasModel, iconManager );
|
|
||||||
mAliasIdentifierEditor = new AliasIdentifierEditor( aliasModel, broadcastModel );
|
|
||||||
mAliasActionEditor = new AliasActionEditor( aliasModel );
|
|
||||||
|
|
||||||
mAliasModel.addListener( this );
|
|
||||||
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( Alias alias )
|
|
||||||
{
|
|
||||||
super.setItem( alias );
|
|
||||||
|
|
||||||
if( hasItem() )
|
|
||||||
{
|
|
||||||
mAliasLabel.setText( getItem().getName() );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mAliasLabel.setText( DEFAULT_NAME );
|
|
||||||
}
|
|
||||||
|
|
||||||
mAliasNameEditor.setItem( alias );
|
|
||||||
mAliasIdentifierEditor.setItem( alias );
|
|
||||||
mAliasActionEditor.setItem( alias );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[grow,fill][grow,fill]",
|
|
||||||
"[][][][][][grow,fill]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Alias:" ), "align right" );
|
|
||||||
mAliasLabel = new JLabel( DEFAULT_NAME );
|
|
||||||
add( mAliasLabel, "align left" );
|
|
||||||
|
|
||||||
add( new JSeparator( JSeparator.HORIZONTAL ), "span,growx,push" );
|
|
||||||
|
|
||||||
JideTabbedPane tabs = new JideTabbedPane();
|
|
||||||
tabs.setFont( this.getFont() );
|
|
||||||
tabs.setForeground( Color.BLACK );
|
|
||||||
|
|
||||||
tabs.addTab( "Alias", mAliasNameEditor );
|
|
||||||
tabs.addTab( "Audio / Identifier", mAliasIdentifierEditor );
|
|
||||||
tabs.addTab( "Action", mAliasActionEditor );
|
|
||||||
add( tabs, "span,grow" );
|
|
||||||
|
|
||||||
//Playlist management buttons
|
|
||||||
JButton btnSave = new JButton( "Save" );
|
|
||||||
btnSave.setToolTipText( "Save alias changes to the playlist" );
|
|
||||||
btnSave.addActionListener( AliasEditor.this );
|
|
||||||
add( btnSave );
|
|
||||||
|
|
||||||
JButton btnReset = new JButton( "Reset" );
|
|
||||||
btnReset.setToolTipText( "Reset alias changes since last save" );
|
|
||||||
btnReset.addActionListener( AliasEditor.this );
|
|
||||||
add( btnReset, "wrap" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void receive( AliasEvent event )
|
|
||||||
{
|
|
||||||
//If this is the currently displayed alias, reload it
|
|
||||||
if( hasItem() && getItem() == event.getAlias() )
|
|
||||||
{
|
|
||||||
switch( event.getEvent() )
|
|
||||||
{
|
|
||||||
case CHANGE:
|
|
||||||
//Alias changed - reset the editor with changed alias
|
|
||||||
setItem( event.getAlias() );
|
|
||||||
break;
|
|
||||||
case DELETE:
|
|
||||||
setItem( null );
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
if( hasItem() )
|
|
||||||
{
|
|
||||||
String command = e.getActionCommand();
|
|
||||||
|
|
||||||
if( command.contentEquals( "Save" ) )
|
|
||||||
{
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
else if( command.contentEquals( "Reset" ) )
|
|
||||||
{
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
mAliasNameEditor.save();
|
|
||||||
mAliasIdentifierEditor.save();
|
|
||||||
mAliasActionEditor.save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias;
|
|
||||||
|
|
||||||
public class AliasEvent
|
|
||||||
{
|
|
||||||
private Alias mAlias;
|
|
||||||
private Event mEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AliasEvent - event describing any changes to an alias
|
|
||||||
* @param alias - alias that changed
|
|
||||||
* @param event - change event
|
|
||||||
*/
|
|
||||||
public AliasEvent( Alias alias, Event event )
|
|
||||||
{
|
|
||||||
mAlias = alias;
|
|
||||||
mEvent = event;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Alias getAlias()
|
|
||||||
{
|
|
||||||
return mAlias;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Event getEvent()
|
|
||||||
{
|
|
||||||
return mEvent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Channel events to describe the specific event
|
|
||||||
*/
|
|
||||||
public enum Event
|
|
||||||
{
|
|
||||||
ADD,
|
|
||||||
CHANGE,
|
|
||||||
DELETE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,58 +14,45 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.alias;
|
package io.github.dsheirer.alias;
|
||||||
|
|
||||||
import io.github.dsheirer.alias.action.AliasAction;
|
import io.github.dsheirer.alias.action.AliasAction;
|
||||||
import io.github.dsheirer.alias.action.AliasActionType;
|
|
||||||
import io.github.dsheirer.alias.action.beep.BeepAction;
|
import io.github.dsheirer.alias.action.beep.BeepAction;
|
||||||
import io.github.dsheirer.alias.action.beep.BeepActionEditor;
|
|
||||||
import io.github.dsheirer.alias.action.clip.ClipAction;
|
import io.github.dsheirer.alias.action.clip.ClipAction;
|
||||||
import io.github.dsheirer.alias.action.clip.ClipActionEditor;
|
|
||||||
import io.github.dsheirer.alias.action.script.ScriptAction;
|
import io.github.dsheirer.alias.action.script.ScriptAction;
|
||||||
import io.github.dsheirer.alias.action.script.ScriptActionEditor;
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
import io.github.dsheirer.alias.id.AliasID;
|
||||||
import io.github.dsheirer.alias.id.AliasIDType;
|
|
||||||
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
||||||
import io.github.dsheirer.alias.id.broadcast.BroadcastChannelEditor;
|
import io.github.dsheirer.alias.id.dcs.Dcs;
|
||||||
import io.github.dsheirer.alias.id.esn.ESNEditor;
|
|
||||||
import io.github.dsheirer.alias.id.esn.Esn;
|
import io.github.dsheirer.alias.id.esn.Esn;
|
||||||
import io.github.dsheirer.alias.id.legacy.fleetsync.FleetsyncID;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.fleetsync.FleetsyncIDEditor;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.mdc.MDC1200ID;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.mdc.MDC1200IDEditor;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.mpt1327.MPT1327ID;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.mpt1327.MPT1327IDEditor;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.nonrecordable.NonRecordable;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.nonrecordable.NonRecordableEditor;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.talkgroup.LegacyTalkgroupID;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.talkgroup.LegacyTalkgroupIDEditor;
|
|
||||||
import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID;
|
|
||||||
import io.github.dsheirer.alias.id.lojack.LoJackIDEditor;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.mobileID.MINEditor;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.mobileID.Min;
|
import io.github.dsheirer.alias.id.legacy.mobileID.Min;
|
||||||
import io.github.dsheirer.alias.id.priority.Priority;
|
|
||||||
import io.github.dsheirer.alias.id.priority.PriorityEditor;
|
|
||||||
import io.github.dsheirer.alias.id.record.Record;
|
|
||||||
import io.github.dsheirer.alias.id.record.RecordEditor;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.siteID.SiteID;
|
import io.github.dsheirer.alias.id.legacy.siteID.SiteID;
|
||||||
import io.github.dsheirer.alias.id.legacy.siteID.SiteIDEditor;
|
import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID;
|
||||||
import io.github.dsheirer.alias.id.status.StatusID;
|
import io.github.dsheirer.alias.id.priority.Priority;
|
||||||
import io.github.dsheirer.alias.id.status.StatusIDEditor;
|
import io.github.dsheirer.alias.id.radio.NXDNTypeDRadio;
|
||||||
|
import io.github.dsheirer.alias.id.radio.NXDNTypeDRadioRange;
|
||||||
|
import io.github.dsheirer.alias.id.radio.P25FullyQualifiedRadio;
|
||||||
|
import io.github.dsheirer.alias.id.radio.Radio;
|
||||||
|
import io.github.dsheirer.alias.id.radio.RadioRange;
|
||||||
|
import io.github.dsheirer.alias.id.record.Record;
|
||||||
|
import io.github.dsheirer.alias.id.status.UnitStatusID;
|
||||||
|
import io.github.dsheirer.alias.id.status.UserStatusID;
|
||||||
|
import io.github.dsheirer.alias.id.talkgroup.NXDNTypeDTalkgroup;
|
||||||
|
import io.github.dsheirer.alias.id.talkgroup.NXDNTypeDTalkgroupRange;
|
||||||
|
import io.github.dsheirer.alias.id.talkgroup.P25FullyQualifiedTalkgroup;
|
||||||
import io.github.dsheirer.alias.id.talkgroup.Talkgroup;
|
import io.github.dsheirer.alias.id.talkgroup.Talkgroup;
|
||||||
import io.github.dsheirer.alias.id.talkgroup.TalkgroupEditor;
|
|
||||||
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRange;
|
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRange;
|
||||||
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRangeEditor;
|
import io.github.dsheirer.alias.id.tone.TonesID;
|
||||||
import io.github.dsheirer.alias.id.legacy.uniqueID.UniqueID;
|
import java.util.ArrayList;
|
||||||
import io.github.dsheirer.alias.id.legacy.uniqueID.UniqueIDEditor;
|
import java.util.List;
|
||||||
import io.github.dsheirer.audio.broadcast.BroadcastModel;
|
import org.slf4j.Logger;
|
||||||
import io.github.dsheirer.gui.editor.Editor;
|
import org.slf4j.LoggerFactory;
|
||||||
import io.github.dsheirer.gui.editor.EmptyEditor;
|
|
||||||
|
|
||||||
public class AliasFactory
|
public class AliasFactory
|
||||||
{
|
{
|
||||||
|
private static final Logger mLog = LoggerFactory.getLogger(AliasFactory.class);
|
||||||
|
|
||||||
public static AliasID copyOf(AliasID id)
|
public static AliasID copyOf(AliasID id)
|
||||||
{
|
{
|
||||||
switch(id.getType())
|
switch(id.getType())
|
||||||
@@ -76,16 +62,16 @@ public class AliasFactory
|
|||||||
BroadcastChannel copyBroadcast = new BroadcastChannel();
|
BroadcastChannel copyBroadcast = new BroadcastChannel();
|
||||||
copyBroadcast.setChannelName(originalBroadcast.getChannelName());
|
copyBroadcast.setChannelName(originalBroadcast.getChannelName());
|
||||||
return copyBroadcast;
|
return copyBroadcast;
|
||||||
|
case DCS:
|
||||||
|
Dcs originalDcs = (Dcs)id;
|
||||||
|
Dcs copyDcs = new Dcs();
|
||||||
|
copyDcs.setDCSCode(originalDcs.getDCSCode());
|
||||||
|
return copyDcs;
|
||||||
case ESN:
|
case ESN:
|
||||||
Esn originalESN = (Esn)id;
|
Esn originalESN = (Esn)id;
|
||||||
Esn copyESN = new Esn();
|
Esn copyESN = new Esn();
|
||||||
copyESN.setEsn(originalESN.getEsn());
|
copyESN.setEsn(originalESN.getEsn());
|
||||||
return copyESN;
|
return copyESN;
|
||||||
case LTR_NET_UID:
|
|
||||||
UniqueID originalUniqueID = (UniqueID)id;
|
|
||||||
UniqueID copyUniqueID = new UniqueID();
|
|
||||||
copyUniqueID.setUid(originalUniqueID.getUid());
|
|
||||||
return copyUniqueID;
|
|
||||||
case LOJACK:
|
case LOJACK:
|
||||||
LoJackFunctionAndID originalLoJackFunctionAndID = (LoJackFunctionAndID)id;
|
LoJackFunctionAndID originalLoJackFunctionAndID = (LoJackFunctionAndID)id;
|
||||||
LoJackFunctionAndID copyLoJackFunctionAndID = new LoJackFunctionAndID();
|
LoJackFunctionAndID copyLoJackFunctionAndID = new LoJackFunctionAndID();
|
||||||
@@ -97,11 +83,59 @@ public class AliasFactory
|
|||||||
Min copyMin = new Min();
|
Min copyMin = new Min();
|
||||||
copyMin.setMin(originalMin.getMin());
|
copyMin.setMin(originalMin.getMin());
|
||||||
return copyMin;
|
return copyMin;
|
||||||
|
case NXDN_TYPE_D_RADIO_ID:
|
||||||
|
NXDNTypeDRadio originalTypeDRadio = (NXDNTypeDRadio)id;
|
||||||
|
NXDNTypeDRadio copyTypeDRadio = new NXDNTypeDRadio(originalTypeDRadio.getHomeRepeater(),
|
||||||
|
originalTypeDRadio.getIdentifier());
|
||||||
|
copyTypeDRadio.setOverlap(originalTypeDRadio.overlapProperty().get());
|
||||||
|
return copyTypeDRadio;
|
||||||
|
case NXDN_TYPE_D_RADIO_ID_RANGE:
|
||||||
|
NXDNTypeDRadioRange originalTypeDRadioRange = (NXDNTypeDRadioRange)id;
|
||||||
|
NXDNTypeDRadioRange copyTypeDRadioRange = new NXDNTypeDRadioRange(originalTypeDRadioRange.getHomeRepeater(),
|
||||||
|
originalTypeDRadioRange.getMinIdentifier(), originalTypeDRadioRange.getMaxIdentifier());
|
||||||
|
copyTypeDRadioRange.setOverlap(originalTypeDRadioRange.overlapProperty().get());
|
||||||
|
return copyTypeDRadioRange;
|
||||||
|
case NXDN_TYPE_D_TALKGROUP:
|
||||||
|
NXDNTypeDTalkgroup originalTypeDTalkgroup = (NXDNTypeDTalkgroup)id;
|
||||||
|
NXDNTypeDTalkgroup copyTypeDTalkgroup = new NXDNTypeDTalkgroup(originalTypeDTalkgroup.getHomeRepeater(),
|
||||||
|
originalTypeDTalkgroup.getIdentifier());
|
||||||
|
copyTypeDTalkgroup.setOverlap(originalTypeDTalkgroup.overlapProperty().get());
|
||||||
|
return copyTypeDTalkgroup;
|
||||||
|
case NXDN_TYPE_D_TALKGROUP_RANGE:
|
||||||
|
NXDNTypeDTalkgroupRange originalTypeDTalkgroupRange = (NXDNTypeDTalkgroupRange)id;
|
||||||
|
NXDNTypeDTalkgroupRange copyTypeDTalkgroupRange = new NXDNTypeDTalkgroupRange(
|
||||||
|
originalTypeDTalkgroupRange.getHomeRepeater(), originalTypeDTalkgroupRange.getMinIdentifier(),
|
||||||
|
originalTypeDTalkgroupRange.getMaxIdentifier());
|
||||||
|
copyTypeDTalkgroupRange.setOverlap(originalTypeDTalkgroupRange.overlapProperty().get());
|
||||||
|
return copyTypeDTalkgroupRange;
|
||||||
|
case P25_FULLY_QUALIFIED_RADIO_ID:
|
||||||
|
P25FullyQualifiedRadio originalP25 = (P25FullyQualifiedRadio) id;
|
||||||
|
P25FullyQualifiedRadio copyP25 = new P25FullyQualifiedRadio(originalP25.getWacn(),
|
||||||
|
originalP25.getSystem(), originalP25.getValue());
|
||||||
|
copyP25.setOverlap(originalP25.overlapProperty().get());
|
||||||
|
return copyP25;
|
||||||
|
case P25_FULLY_QUALIFIED_TALKGROUP:
|
||||||
|
P25FullyQualifiedTalkgroup originalFqt = (P25FullyQualifiedTalkgroup) id;
|
||||||
|
P25FullyQualifiedTalkgroup copyFqt = new P25FullyQualifiedTalkgroup(originalFqt.getWacn(),
|
||||||
|
originalFqt.getSystem(), originalFqt.getValue());
|
||||||
|
copyFqt.setOverlap(originalFqt.overlapProperty().get());
|
||||||
|
return copyFqt;
|
||||||
case PRIORITY:
|
case PRIORITY:
|
||||||
Priority originalPriority = (Priority)id;
|
Priority originalPriority = (Priority)id;
|
||||||
Priority copyPriority = new Priority();
|
Priority copyPriority = new Priority();
|
||||||
copyPriority.setPriority(originalPriority.getPriority());
|
copyPriority.setPriority(originalPriority.getPriority());
|
||||||
return copyPriority;
|
return copyPriority;
|
||||||
|
case RADIO_ID:
|
||||||
|
Radio originalRadio = (Radio)id;
|
||||||
|
Radio copyRadio = new Radio(originalRadio.getProtocol(), originalRadio.getValue());
|
||||||
|
copyRadio.setOverlap(originalRadio.overlapProperty().get());
|
||||||
|
return copyRadio;
|
||||||
|
case RADIO_ID_RANGE:
|
||||||
|
RadioRange originalRadioRange = (RadioRange)id;
|
||||||
|
RadioRange copyRadioRange = new RadioRange(originalRadioRange.getProtocol(), originalRadioRange.getMinRadio(),
|
||||||
|
originalRadioRange.getMaxRadio());
|
||||||
|
copyRadioRange.setOverlap(originalRadioRange.overlapProperty().get());
|
||||||
|
return copyRadioRange;
|
||||||
case RECORD:
|
case RECORD:
|
||||||
return new Record();
|
return new Record();
|
||||||
case SITE:
|
case SITE:
|
||||||
@@ -110,27 +144,45 @@ public class AliasFactory
|
|||||||
copySiteID.setSite(originalSiteID.getSite());
|
copySiteID.setSite(originalSiteID.getSite());
|
||||||
return copySiteID;
|
return copySiteID;
|
||||||
case STATUS:
|
case STATUS:
|
||||||
StatusID originalStatusID = (StatusID)id;
|
UserStatusID originalUserStatusID = (UserStatusID)id;
|
||||||
StatusID copyStatusID = new StatusID();
|
UserStatusID copyUserStatusID = new UserStatusID();
|
||||||
copyStatusID.setStatus(originalStatusID.getStatus());
|
copyUserStatusID.setStatus(originalUserStatusID.getStatus());
|
||||||
return copyStatusID;
|
copyUserStatusID.setOverlap(originalUserStatusID.overlapProperty().get());
|
||||||
|
return copyUserStatusID;
|
||||||
case TALKGROUP:
|
case TALKGROUP:
|
||||||
Talkgroup originalTalkgroup = (Talkgroup)id;
|
Talkgroup originalTalkgroup = (Talkgroup)id;
|
||||||
Talkgroup copyTalkgroup = new Talkgroup(originalTalkgroup.getProtocol(), originalTalkgroup.getValue());
|
Talkgroup copyTalkgroup = new Talkgroup(originalTalkgroup.getProtocol(), originalTalkgroup.getValue());
|
||||||
|
copyTalkgroup.setOverlap(originalTalkgroup.overlapProperty().get());
|
||||||
return copyTalkgroup;
|
return copyTalkgroup;
|
||||||
case TALKGROUP_RANGE:
|
case TALKGROUP_RANGE:
|
||||||
TalkgroupRange originalRange = (TalkgroupRange)id;
|
TalkgroupRange originalRange = (TalkgroupRange)id;
|
||||||
TalkgroupRange copyRange = new TalkgroupRange(originalRange.getProtocol(), originalRange.getMinTalkgroup(),
|
TalkgroupRange copyRange = new TalkgroupRange(originalRange.getProtocol(), originalRange.getMinTalkgroup(),
|
||||||
originalRange.getMaxTalkgroup());
|
originalRange.getMaxTalkgroup());
|
||||||
|
copyRange.setOverlap(originalRange.overlapProperty().get());
|
||||||
return copyRange;
|
return copyRange;
|
||||||
|
case TONES:
|
||||||
|
TonesID originalTones = (TonesID)id;
|
||||||
|
TonesID copyTones = new TonesID();
|
||||||
|
copyTones.setToneSequence(originalTones.getToneSequence().copyOf());
|
||||||
|
return copyTones;
|
||||||
|
case UNIT_STATUS:
|
||||||
|
UnitStatusID originalUnitStatus = (UnitStatusID)id;
|
||||||
|
UnitStatusID copyUnitStatusID = new UnitStatusID();
|
||||||
|
copyUnitStatusID.setStatus(originalUnitStatus.getStatus());
|
||||||
|
copyUnitStatusID.setOverlap(originalUnitStatus.overlapProperty().get());
|
||||||
|
return copyUnitStatusID;
|
||||||
|
|
||||||
//Legacy identifiers ... not supported
|
//Legacy identifiers ... not supported
|
||||||
case FLEETSYNC:
|
case FLEETSYNC:
|
||||||
case LEGACY_TALKGROUP:
|
case LEGACY_TALKGROUP:
|
||||||
|
case LTR_NET_UID:
|
||||||
case MDC1200:
|
case MDC1200:
|
||||||
case MPT1327:
|
case MPT1327:
|
||||||
case NON_RECORDABLE:
|
case NON_RECORDABLE:
|
||||||
|
return null;
|
||||||
default:
|
default:
|
||||||
|
mLog.warn("Unrecognized Alias ID Type [" + id.getType() + "] cannot make copy of instance");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -140,7 +192,11 @@ public class AliasFactory
|
|||||||
{
|
{
|
||||||
if(action instanceof BeepAction)
|
if(action instanceof BeepAction)
|
||||||
{
|
{
|
||||||
return new BeepAction();
|
BeepAction original = (BeepAction)action;
|
||||||
|
BeepAction copyBeep = new BeepAction();
|
||||||
|
copyBeep.setInterval(original.getInterval());
|
||||||
|
copyBeep.setPeriod(original.getPeriod());
|
||||||
|
return copyBeep;
|
||||||
}
|
}
|
||||||
else if(action instanceof ClipAction)
|
else if(action instanceof ClipAction)
|
||||||
{
|
{
|
||||||
@@ -164,158 +220,59 @@ public class AliasFactory
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Alias copyOf(Alias original)
|
public static Alias shallowCopyOf(Alias original)
|
||||||
{
|
{
|
||||||
Alias copy = new Alias(original.getName());
|
Alias copy = new Alias(original.getName());
|
||||||
copy.setList(original.getList());
|
copy.setAliasListName(original.getAliasListName());
|
||||||
copy.setGroup(original.getGroup());
|
copy.setGroup(original.getGroup());
|
||||||
copy.setColor(original.getColor());
|
copy.setColor(original.getColor());
|
||||||
copy.setIconName(original.getIconName());
|
copy.setIconName(original.getIconName());
|
||||||
|
copy.setRecordable(original.isRecordable());
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
|
||||||
for(AliasID id : original.getId())
|
public static List<AliasID> copyAliasIDs(Alias original)
|
||||||
|
{
|
||||||
|
List<AliasID> aliasIDS = new ArrayList<>();
|
||||||
|
|
||||||
|
for(AliasID id : original.getAliasIdentifiers())
|
||||||
{
|
{
|
||||||
AliasID copyID = copyOf(id);
|
aliasIDS.add(copyOf(id));
|
||||||
|
|
||||||
if(copyID != null)
|
|
||||||
{
|
|
||||||
copy.addAliasID(copyID);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(AliasAction action : original.getAction())
|
return aliasIDS;
|
||||||
{
|
}
|
||||||
AliasAction copyAction = copyOf(action);
|
|
||||||
|
|
||||||
if(copyAction != null)
|
public static List<AliasAction> copyAliasActions(Alias original)
|
||||||
{
|
{
|
||||||
copy.addAliasAction(copyAction);
|
List<AliasAction> actions = new ArrayList<>();
|
||||||
}
|
|
||||||
|
for(AliasAction aliasAction: original.getAliasActions())
|
||||||
|
{
|
||||||
|
actions.add(copyOf(aliasAction));
|
||||||
|
}
|
||||||
|
|
||||||
|
return actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Alias copyOf(Alias original)
|
||||||
|
{
|
||||||
|
Alias copy = shallowCopyOf(original);
|
||||||
|
|
||||||
|
List<AliasID> aliasIDS = copyAliasIDs(original);
|
||||||
|
|
||||||
|
for(AliasID aliasID: aliasIDS)
|
||||||
|
{
|
||||||
|
copy.addAliasID(aliasID);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<AliasAction> actions = copyAliasActions(original);
|
||||||
|
|
||||||
|
for(AliasAction action: actions)
|
||||||
|
{
|
||||||
|
copy.addAliasAction(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Editor<AliasID> getEditor(AliasID aliasID, BroadcastModel broadcastModel)
|
|
||||||
{
|
|
||||||
if(aliasID != null)
|
|
||||||
{
|
|
||||||
switch(aliasID.getType())
|
|
||||||
{
|
|
||||||
case BROADCAST_CHANNEL:
|
|
||||||
return new BroadcastChannelEditor(aliasID, broadcastModel);
|
|
||||||
case ESN:
|
|
||||||
return new ESNEditor(aliasID);
|
|
||||||
case LTR_NET_UID:
|
|
||||||
return new UniqueIDEditor(aliasID);
|
|
||||||
case LOJACK:
|
|
||||||
return new LoJackIDEditor(aliasID);
|
|
||||||
case MIN:
|
|
||||||
return new MINEditor(aliasID);
|
|
||||||
case PRIORITY:
|
|
||||||
return new PriorityEditor(aliasID);
|
|
||||||
case RECORD:
|
|
||||||
return new RecordEditor(aliasID);
|
|
||||||
case SITE:
|
|
||||||
return new SiteIDEditor(aliasID);
|
|
||||||
case STATUS:
|
|
||||||
return new StatusIDEditor(aliasID);
|
|
||||||
case TALKGROUP:
|
|
||||||
return new TalkgroupEditor(aliasID);
|
|
||||||
case TALKGROUP_RANGE:
|
|
||||||
return new TalkgroupRangeEditor(aliasID);
|
|
||||||
|
|
||||||
case FLEETSYNC:
|
|
||||||
return new FleetsyncIDEditor(aliasID);
|
|
||||||
case LEGACY_TALKGROUP:
|
|
||||||
return new LegacyTalkgroupIDEditor(aliasID);
|
|
||||||
case MDC1200:
|
|
||||||
return new MDC1200IDEditor(aliasID);
|
|
||||||
case MPT1327:
|
|
||||||
return new MPT1327IDEditor(aliasID);
|
|
||||||
case NON_RECORDABLE:
|
|
||||||
return new NonRecordableEditor(aliasID);
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new EmptyEditor<AliasID>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Editor<AliasAction> getEditor(AliasAction aliasAction)
|
|
||||||
{
|
|
||||||
if(aliasAction != null)
|
|
||||||
{
|
|
||||||
switch(aliasAction.getType())
|
|
||||||
{
|
|
||||||
case BEEP:
|
|
||||||
return new BeepActionEditor(aliasAction);
|
|
||||||
case CLIP:
|
|
||||||
return new ClipActionEditor(aliasAction);
|
|
||||||
case SCRIPT:
|
|
||||||
return new ScriptActionEditor(aliasAction);
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new EmptyEditor<AliasAction>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AliasID getAliasID(AliasIDType type)
|
|
||||||
{
|
|
||||||
switch(type)
|
|
||||||
{
|
|
||||||
case BROADCAST_CHANNEL:
|
|
||||||
return new BroadcastChannel();
|
|
||||||
case ESN:
|
|
||||||
return new Esn();
|
|
||||||
case FLEETSYNC:
|
|
||||||
return new FleetsyncID();
|
|
||||||
case LTR_NET_UID:
|
|
||||||
return new UniqueID();
|
|
||||||
case LOJACK:
|
|
||||||
return new LoJackFunctionAndID();
|
|
||||||
case MDC1200:
|
|
||||||
return new MDC1200ID();
|
|
||||||
case MIN:
|
|
||||||
return new Min();
|
|
||||||
case MPT1327:
|
|
||||||
return new MPT1327ID();
|
|
||||||
case NON_RECORDABLE:
|
|
||||||
return new NonRecordable();
|
|
||||||
case PRIORITY:
|
|
||||||
return new Priority();
|
|
||||||
case RECORD:
|
|
||||||
return new Record();
|
|
||||||
case TALKGROUP:
|
|
||||||
return new Talkgroup();
|
|
||||||
case TALKGROUP_RANGE:
|
|
||||||
return new TalkgroupRange();
|
|
||||||
case SITE:
|
|
||||||
return new SiteID();
|
|
||||||
case STATUS:
|
|
||||||
return new StatusID();
|
|
||||||
case LEGACY_TALKGROUP:
|
|
||||||
return new LegacyTalkgroupID();
|
|
||||||
default:
|
|
||||||
throw new IllegalArgumentException("Unrecognized Alias ID type: " + type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AliasAction getAliasAction(AliasActionType type)
|
|
||||||
{
|
|
||||||
switch(type)
|
|
||||||
{
|
|
||||||
case BEEP:
|
|
||||||
return new BeepAction();
|
|
||||||
case CLIP:
|
|
||||||
return new ClipAction();
|
|
||||||
case SCRIPT:
|
|
||||||
return new ScriptAction();
|
|
||||||
default:
|
|
||||||
throw new IllegalArgumentException("Unrecognized Alias Action type: " + type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2019 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,47 +14,73 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.alias;
|
package io.github.dsheirer.alias;
|
||||||
|
|
||||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
import io.github.dsheirer.alias.id.AliasID;
|
||||||
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
||||||
|
import io.github.dsheirer.alias.id.dcs.Dcs;
|
||||||
import io.github.dsheirer.alias.id.esn.Esn;
|
import io.github.dsheirer.alias.id.esn.Esn;
|
||||||
import io.github.dsheirer.alias.id.priority.Priority;
|
import io.github.dsheirer.alias.id.priority.Priority;
|
||||||
import io.github.dsheirer.alias.id.status.StatusID;
|
import io.github.dsheirer.alias.id.radio.P25FullyQualifiedRadio;
|
||||||
|
import io.github.dsheirer.alias.id.radio.Radio;
|
||||||
|
import io.github.dsheirer.alias.id.radio.RadioRange;
|
||||||
|
import io.github.dsheirer.alias.id.status.UnitStatusID;
|
||||||
|
import io.github.dsheirer.alias.id.status.UserStatusID;
|
||||||
|
import io.github.dsheirer.alias.id.talkgroup.P25FullyQualifiedTalkgroup;
|
||||||
import io.github.dsheirer.alias.id.talkgroup.Talkgroup;
|
import io.github.dsheirer.alias.id.talkgroup.Talkgroup;
|
||||||
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRange;
|
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRange;
|
||||||
|
import io.github.dsheirer.alias.id.tone.TonesID;
|
||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||||
|
import io.github.dsheirer.identifier.dcs.DCSIdentifier;
|
||||||
import io.github.dsheirer.identifier.esn.ESNIdentifier;
|
import io.github.dsheirer.identifier.esn.ESNIdentifier;
|
||||||
import io.github.dsheirer.identifier.patch.PatchGroup;
|
import io.github.dsheirer.identifier.patch.PatchGroup;
|
||||||
import io.github.dsheirer.identifier.patch.PatchGroupIdentifier;
|
import io.github.dsheirer.identifier.patch.PatchGroupIdentifier;
|
||||||
|
import io.github.dsheirer.identifier.radio.FullyQualifiedRadioIdentifier;
|
||||||
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.identifier.status.UnitStatusIdentifier;
|
import io.github.dsheirer.identifier.status.UnitStatusIdentifier;
|
||||||
import io.github.dsheirer.identifier.status.UserStatusIdentifier;
|
import io.github.dsheirer.identifier.status.UserStatusIdentifier;
|
||||||
|
import io.github.dsheirer.identifier.talkgroup.FullyQualifiedTalkgroupIdentifier;
|
||||||
import io.github.dsheirer.identifier.talkgroup.TalkgroupIdentifier;
|
import io.github.dsheirer.identifier.talkgroup.TalkgroupIdentifier;
|
||||||
|
import io.github.dsheirer.identifier.tone.ToneIdentifier;
|
||||||
|
import io.github.dsheirer.identifier.tone.ToneSequence;
|
||||||
|
import io.github.dsheirer.module.decode.squelch.dcs.DCSCode;
|
||||||
import io.github.dsheirer.protocol.Protocol;
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
import io.github.dsheirer.sample.Listener;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
import javafx.collections.FXCollections;
|
||||||
|
import javafx.collections.ObservableList;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
/**
|
||||||
import java.util.Collections;
|
* List of aliases that share the same alias list name and provides convenient methods for looking up alias
|
||||||
import java.util.HashMap;
|
* objects that match an identifier.
|
||||||
import java.util.Iterator;
|
*/
|
||||||
import java.util.List;
|
public class AliasList
|
||||||
import java.util.Map;
|
|
||||||
import java.util.TreeMap;
|
|
||||||
|
|
||||||
public class AliasList implements Listener<AliasEvent>
|
|
||||||
{
|
{
|
||||||
private final static Logger mLog = LoggerFactory.getLogger(AliasList.class);
|
private final static Logger mLog = LoggerFactory.getLogger(AliasList.class);
|
||||||
private Map<Protocol,TalkgroupAliasList> mTalkgroupProtocolMap = new HashMap<>();
|
private Map<Protocol,TalkgroupAliasList> mTalkgroupProtocolMap = new EnumMap<>(Protocol.class);
|
||||||
|
private Map<Protocol,RadioAliasList> mRadioProtocolMap = new EnumMap<>(Protocol.class);
|
||||||
|
private Map<DCSCode,Alias> mDCSCodeAliasMap = new EnumMap<>(DCSCode.class);
|
||||||
private Map<String,Alias> mESNMap = new HashMap<>();
|
private Map<String,Alias> mESNMap = new HashMap<>();
|
||||||
private Map<Integer,Alias> mStatusMap = new HashMap<>();
|
private Map<Integer,Alias> mUnitStatusMap = new HashMap<>();
|
||||||
|
private Map<Integer,Alias> mUserStatusMap = new HashMap<>();
|
||||||
|
private Map<ToneSequence,Alias> mToneSequenceMap = new HashMap<>();
|
||||||
private boolean mHasAliasActions = false;
|
private boolean mHasAliasActions = false;
|
||||||
private String mName;
|
private String mName;
|
||||||
|
private ObservableList<Alias> mAliases = FXCollections.observableArrayList(Alias.extractor());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of aliases where all aliases share the same list name. Contains
|
* List of aliases where all aliases share the same list name. Contains
|
||||||
@@ -68,6 +93,14 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
mName = name;
|
mName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Observable list of aliases contained in this alias list
|
||||||
|
*/
|
||||||
|
public ObservableList<Alias> aliases()
|
||||||
|
{
|
||||||
|
return mAliases;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the alias to this list
|
* Adds the alias to this list
|
||||||
*/
|
*/
|
||||||
@@ -75,16 +108,18 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
{
|
{
|
||||||
if(alias != null)
|
if(alias != null)
|
||||||
{
|
{
|
||||||
for(AliasID aliasID : alias.getId())
|
alias.getAliasIdentifiers().stream().forEach(aliasID -> addAliasID(aliasID, alias));
|
||||||
{
|
|
||||||
addAliasID(aliasID, alias);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(alias.hasActions())
|
if(alias.hasActions())
|
||||||
{
|
{
|
||||||
mHasAliasActions = true;
|
mHasAliasActions = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!mAliases.contains(alias))
|
||||||
|
{
|
||||||
|
mAliases.add(alias);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -99,6 +134,7 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
switch(id.getType())
|
switch(id.getType())
|
||||||
{
|
{
|
||||||
case TALKGROUP:
|
case TALKGROUP:
|
||||||
|
case NXDN_TYPE_D_TALKGROUP:
|
||||||
Talkgroup talkgroup = (Talkgroup)id;
|
Talkgroup talkgroup = (Talkgroup)id;
|
||||||
|
|
||||||
TalkgroupAliasList talkgroupAliasList = mTalkgroupProtocolMap.get(talkgroup.getProtocol());
|
TalkgroupAliasList talkgroupAliasList = mTalkgroupProtocolMap.get(talkgroup.getProtocol());
|
||||||
@@ -112,6 +148,7 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
talkgroupAliasList.add(talkgroup, alias);
|
talkgroupAliasList.add(talkgroup, alias);
|
||||||
break;
|
break;
|
||||||
case TALKGROUP_RANGE:
|
case TALKGROUP_RANGE:
|
||||||
|
case NXDN_TYPE_D_TALKGROUP_RANGE:
|
||||||
TalkgroupRange talkgroupRange = (TalkgroupRange)id;
|
TalkgroupRange talkgroupRange = (TalkgroupRange)id;
|
||||||
|
|
||||||
TalkgroupAliasList talkgroupRangeAliasList = mTalkgroupProtocolMap.get(talkgroupRange.getProtocol());
|
TalkgroupAliasList talkgroupRangeAliasList = mTalkgroupProtocolMap.get(talkgroupRange.getProtocol());
|
||||||
@@ -124,8 +161,68 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
|
|
||||||
talkgroupRangeAliasList.add(talkgroupRange, alias);
|
talkgroupRangeAliasList.add(talkgroupRange, alias);
|
||||||
break;
|
break;
|
||||||
|
case P25_FULLY_QUALIFIED_RADIO_ID:
|
||||||
|
P25FullyQualifiedRadio qualifiedRadio = (P25FullyQualifiedRadio) id;
|
||||||
|
|
||||||
|
RadioAliasList p25RadioAliasList = mRadioProtocolMap.get(qualifiedRadio.getProtocol());
|
||||||
|
|
||||||
|
if(p25RadioAliasList == null)
|
||||||
|
{
|
||||||
|
p25RadioAliasList = new RadioAliasList();
|
||||||
|
mRadioProtocolMap.put(qualifiedRadio.getProtocol(), p25RadioAliasList);
|
||||||
|
}
|
||||||
|
|
||||||
|
p25RadioAliasList.add(qualifiedRadio, alias);
|
||||||
|
break;
|
||||||
|
case P25_FULLY_QUALIFIED_TALKGROUP:
|
||||||
|
P25FullyQualifiedTalkgroup qualifiedTalkgroup = (P25FullyQualifiedTalkgroup) id;
|
||||||
|
|
||||||
|
TalkgroupAliasList p25TalkgroupAliasList = mTalkgroupProtocolMap.get(qualifiedTalkgroup.getProtocol());
|
||||||
|
|
||||||
|
if(p25TalkgroupAliasList == null)
|
||||||
|
{
|
||||||
|
p25TalkgroupAliasList = new TalkgroupAliasList();
|
||||||
|
mTalkgroupProtocolMap.put(qualifiedTalkgroup.getProtocol(), p25TalkgroupAliasList);
|
||||||
|
}
|
||||||
|
|
||||||
|
p25TalkgroupAliasList.add(qualifiedTalkgroup, alias);
|
||||||
|
break;
|
||||||
|
case RADIO_ID:
|
||||||
|
case NXDN_TYPE_D_RADIO_ID:
|
||||||
|
Radio radio = (Radio)id;
|
||||||
|
|
||||||
|
RadioAliasList radioAliasList = mRadioProtocolMap.get(radio.getProtocol());
|
||||||
|
|
||||||
|
if(radioAliasList == null)
|
||||||
|
{
|
||||||
|
radioAliasList = new RadioAliasList();
|
||||||
|
mRadioProtocolMap.put(radio.getProtocol(), radioAliasList);
|
||||||
|
}
|
||||||
|
|
||||||
|
radioAliasList.add(radio, alias);
|
||||||
|
break;
|
||||||
|
case RADIO_ID_RANGE:
|
||||||
|
case NXDN_TYPE_D_RADIO_ID_RANGE:
|
||||||
|
RadioRange radioRange = (RadioRange)id;
|
||||||
|
|
||||||
|
RadioAliasList radioRangeAliasList = mRadioProtocolMap.get(radioRange.getProtocol());
|
||||||
|
|
||||||
|
if(radioRangeAliasList == null)
|
||||||
|
{
|
||||||
|
radioRangeAliasList = new RadioAliasList();
|
||||||
|
mRadioProtocolMap.put(radioRange.getProtocol(), radioRangeAliasList);
|
||||||
|
}
|
||||||
|
|
||||||
|
radioRangeAliasList.add(radioRange, alias);
|
||||||
|
break;
|
||||||
|
case DCS:
|
||||||
|
if(id instanceof Dcs dcs)
|
||||||
|
{
|
||||||
|
mDCSCodeAliasMap.put(dcs.getDCSCode(), alias);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case ESN:
|
case ESN:
|
||||||
String esn = ((Esn) id).getEsn();
|
String esn = ((Esn)id).getEsn();
|
||||||
|
|
||||||
if(esn != null && !esn.isEmpty())
|
if(esn != null && !esn.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -133,7 +230,67 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STATUS:
|
case STATUS:
|
||||||
mStatusMap.put(((StatusID) id).getStatus(), alias);
|
int userStatus = ((UserStatusID)id).getStatus();
|
||||||
|
|
||||||
|
if(mUserStatusMap.containsKey(userStatus) && !mUserStatusMap.get(userStatus).equals(alias))
|
||||||
|
{
|
||||||
|
id.setOverlap(true);
|
||||||
|
|
||||||
|
Alias existing = mUserStatusMap.get(userStatus);
|
||||||
|
|
||||||
|
for(AliasID aliasID: existing.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(aliasID instanceof UserStatusID && ((UserStatusID)aliasID).getStatus() == userStatus)
|
||||||
|
{
|
||||||
|
aliasID.setOverlap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mUserStatusMap.put(userStatus, alias);
|
||||||
|
break;
|
||||||
|
case UNIT_STATUS:
|
||||||
|
int unitStatus = ((UnitStatusID)id).getStatus();
|
||||||
|
|
||||||
|
if(mUnitStatusMap.containsKey(unitStatus) && !mUnitStatusMap.get(unitStatus).equals(alias))
|
||||||
|
{
|
||||||
|
id.setOverlap(true);
|
||||||
|
|
||||||
|
Alias existing = mUnitStatusMap.get(unitStatus);
|
||||||
|
|
||||||
|
for(AliasID aliasID: existing.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(aliasID instanceof UnitStatusID && ((UnitStatusID)aliasID).getStatus() == unitStatus)
|
||||||
|
{
|
||||||
|
aliasID.setOverlap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mUnitStatusMap.put(unitStatus, alias);
|
||||||
|
break;
|
||||||
|
case TONES:
|
||||||
|
ToneSequence toneSequence = ((TonesID)id).getToneSequence();
|
||||||
|
|
||||||
|
if(toneSequence != null)
|
||||||
|
{
|
||||||
|
if(mToneSequenceMap.containsKey(toneSequence) && !mToneSequenceMap.get(toneSequence).equals(alias))
|
||||||
|
{
|
||||||
|
id.setOverlap(true);
|
||||||
|
|
||||||
|
Alias existing = mToneSequenceMap.get(toneSequence);
|
||||||
|
|
||||||
|
for(AliasID aliasID: existing.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(aliasID instanceof TonesID && aliasID.equals(id))
|
||||||
|
{
|
||||||
|
aliasID.setOverlap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mToneSequenceMap.put(toneSequence, alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -149,13 +306,45 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
*/
|
*/
|
||||||
public void removeAlias(Alias alias)
|
public void removeAlias(Alias alias)
|
||||||
{
|
{
|
||||||
for(TalkgroupAliasList talkgroupAliasList: mTalkgroupProtocolMap.values())
|
//Note: because the alias' identifiers could have changed from when we initially added the alias, we have to
|
||||||
|
//inspect every collection and map to remove the alias completely.
|
||||||
|
mAliases.remove(alias);
|
||||||
|
|
||||||
|
mTalkgroupProtocolMap.values().stream().forEach(talkgroupAliasList -> talkgroupAliasList.remove(alias));
|
||||||
|
mRadioProtocolMap.values().stream().forEach(radioAliasList -> radioAliasList.remove(alias));
|
||||||
|
|
||||||
|
Collection<Alias> collection = Collections.singleton(alias);
|
||||||
|
mESNMap.values().removeAll(collection);
|
||||||
|
mUnitStatusMap.values().removeAll(collection);
|
||||||
|
mUserStatusMap.values().removeAll(collection);
|
||||||
|
mToneSequenceMap.values().removeAll(collection);
|
||||||
|
|
||||||
|
validate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Identifies all aliases with an alias identifier that has the overlap flag set, resets the flag, and then readds
|
||||||
|
* each alias back to this alias list so that overlap can be detected again.
|
||||||
|
*/
|
||||||
|
public void validate()
|
||||||
|
{
|
||||||
|
Set<Alias> overlapAliases = new HashSet<>();
|
||||||
|
|
||||||
|
List<Alias> aliases = new ArrayList<>(mAliases);
|
||||||
|
|
||||||
|
for(Alias alias: aliases)
|
||||||
{
|
{
|
||||||
talkgroupAliasList.remove(alias);
|
for(AliasID aliasID: alias.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(aliasID.overlapProperty().get())
|
||||||
|
{
|
||||||
|
aliasID.setOverlap(false);
|
||||||
|
overlapAliases.add(alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
remove(alias, mStatusMap);
|
overlapAliases.stream().forEach(alias -> addAlias(alias));
|
||||||
remove(alias, mESNMap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -199,39 +388,15 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receive alias change event notifications and modify this list accordingly
|
* Updates the alias by removing it from this list and then adding it back to this list when the list name matches.
|
||||||
*/
|
*/
|
||||||
@Override
|
public void updateAlias(Alias alias)
|
||||||
public void receive(AliasEvent event)
|
|
||||||
{
|
{
|
||||||
if(hasName())
|
removeAlias(alias);
|
||||||
{
|
|
||||||
Alias alias = event.getAlias();
|
|
||||||
|
|
||||||
switch(event.getEvent())
|
if(hasName() && getName().equals(alias.getAliasListName()))
|
||||||
{
|
{
|
||||||
case ADD:
|
addAlias(alias);
|
||||||
if(alias.getList() != null && getName().equalsIgnoreCase(alias.getList()))
|
|
||||||
{
|
|
||||||
addAlias(alias);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CHANGE:
|
|
||||||
if(alias.getList() != null && getName().equalsIgnoreCase(alias.getList()))
|
|
||||||
{
|
|
||||||
removeAlias(alias);
|
|
||||||
addAlias(alias);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case DELETE:
|
|
||||||
if(alias.getList() != null && getName().equalsIgnoreCase(alias.getList()))
|
|
||||||
{
|
|
||||||
removeAlias(alias);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,17 +418,12 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
|
|
||||||
if(talkgroupAliasList != null)
|
if(talkgroupAliasList != null)
|
||||||
{
|
{
|
||||||
Alias alias = talkgroupAliasList.getAlias(talkgroup);
|
return toList(talkgroupAliasList.getAlias(talkgroup));
|
||||||
|
|
||||||
if(alias != null)
|
|
||||||
{
|
|
||||||
List<Alias> aliases = new ArrayList<>();
|
|
||||||
aliases.add(alias);
|
|
||||||
return aliases;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PATCH_GROUP:
|
case PATCH_GROUP:
|
||||||
|
List<Alias> aliases = new ArrayList<>();
|
||||||
|
|
||||||
PatchGroupIdentifier patchGroupIdentifier = (PatchGroupIdentifier)identifier;
|
PatchGroupIdentifier patchGroupIdentifier = (PatchGroupIdentifier)identifier;
|
||||||
PatchGroup patchGroup = patchGroupIdentifier.getValue();
|
PatchGroup patchGroup = patchGroupIdentifier.getValue();
|
||||||
|
|
||||||
@@ -271,8 +431,6 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
|
|
||||||
if(patchGroupAliasList != null)
|
if(patchGroupAliasList != null)
|
||||||
{
|
{
|
||||||
List<Alias> aliases = new ArrayList<>();
|
|
||||||
|
|
||||||
Alias alias = patchGroupAliasList.getAlias(patchGroup.getPatchGroup());
|
Alias alias = patchGroupAliasList.getAlias(patchGroup.getPatchGroup());
|
||||||
|
|
||||||
if(alias != null)
|
if(alias != null)
|
||||||
@@ -280,66 +438,106 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
aliases.add(alias);
|
aliases.add(alias);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(TalkgroupIdentifier patchedGroup: patchGroup.getPatchedGroupIdentifiers())
|
for(TalkgroupIdentifier patchedTalkgroup: patchGroup.getPatchedTalkgroupIdentifiers())
|
||||||
{
|
{
|
||||||
Alias patchedAlias = patchGroupAliasList.getAlias(patchedGroup);
|
Alias patchedTalkgroupAlias = patchGroupAliasList.getAlias(patchedTalkgroup);
|
||||||
|
|
||||||
if(patchedAlias != null && !aliases.contains(patchedAlias))
|
if(patchedTalkgroupAlias != null && !aliases.contains(patchedTalkgroupAlias))
|
||||||
{
|
{
|
||||||
aliases.add(patchedAlias);
|
aliases.add(patchedTalkgroupAlias);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return aliases;
|
if(patchGroup.hasPatchedRadios())
|
||||||
|
{
|
||||||
|
RadioAliasList radioAliasList = mRadioProtocolMap.get(patchGroupIdentifier.getProtocol());
|
||||||
|
|
||||||
|
if(radioAliasList != null)
|
||||||
|
{
|
||||||
|
for(RadioIdentifier patchedRadio: patchGroup.getPatchedRadioIdentifiers())
|
||||||
|
{
|
||||||
|
Alias patchedRadioAlias = radioAliasList.getAlias(patchedRadio);
|
||||||
|
|
||||||
|
if(patchedRadioAlias != null && !aliases.contains(patchedRadioAlias))
|
||||||
|
{
|
||||||
|
aliases.add(patchedRadioAlias);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return aliases;
|
||||||
|
case RADIO:
|
||||||
|
RadioIdentifier radio = (RadioIdentifier)identifier;
|
||||||
|
|
||||||
|
RadioAliasList radioAliasList = mRadioProtocolMap.get(identifier.getProtocol());
|
||||||
|
|
||||||
|
if(radioAliasList != null)
|
||||||
|
{
|
||||||
|
return toList(radioAliasList.getAlias(radio));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESN:
|
case ESN:
|
||||||
if(identifier instanceof ESNIdentifier)
|
if(identifier instanceof ESNIdentifier)
|
||||||
{
|
{
|
||||||
Alias alias = getESNAlias(((ESNIdentifier)identifier).getValue());
|
return toList(getESNAlias(((ESNIdentifier)identifier).getValue()));
|
||||||
|
|
||||||
if(alias != null)
|
|
||||||
{
|
|
||||||
List<Alias> aliases = new ArrayList<>();
|
|
||||||
aliases.add(alias);
|
|
||||||
return aliases;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UNIT_STATUS:
|
case UNIT_STATUS:
|
||||||
if(identifier instanceof UnitStatusIdentifier)
|
if(identifier instanceof UnitStatusIdentifier)
|
||||||
{
|
{
|
||||||
int status = ((UnitStatusIdentifier)identifier).getValue();
|
int status = ((UnitStatusIdentifier)identifier).getValue();
|
||||||
|
return toList(mUserStatusMap.get(status));
|
||||||
Alias alias = mStatusMap.get(status);
|
|
||||||
|
|
||||||
if(alias != null)
|
|
||||||
{
|
|
||||||
List<Alias> aliases = new ArrayList<>();
|
|
||||||
aliases.add(alias);
|
|
||||||
return aliases;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case USER_STATUS:
|
case USER_STATUS:
|
||||||
if(identifier instanceof UserStatusIdentifier)
|
if(identifier instanceof UserStatusIdentifier)
|
||||||
{
|
{
|
||||||
int status = ((UserStatusIdentifier)identifier).getValue();
|
int status = ((UserStatusIdentifier)identifier).getValue();
|
||||||
|
return toList(mUserStatusMap.get(status));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case TONE:
|
||||||
|
if(identifier instanceof ToneIdentifier toneIdentifier)
|
||||||
|
{
|
||||||
|
ToneSequence toneSequence = toneIdentifier.getValue();
|
||||||
|
|
||||||
Alias alias = mStatusMap.get(status);
|
if(toneSequence != null && toneSequence.hasTones())
|
||||||
|
|
||||||
if(alias != null)
|
|
||||||
{
|
{
|
||||||
List<Alias> aliases = new ArrayList<>();
|
for(Map.Entry<ToneSequence,Alias> entry: mToneSequenceMap.entrySet())
|
||||||
aliases.add(alias);
|
{
|
||||||
return aliases;
|
if(entry.getKey().isContainedIn(toneSequence))
|
||||||
|
{
|
||||||
|
return toList(entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(identifier instanceof DCSIdentifier dcsIdentifier)
|
||||||
|
{
|
||||||
|
DCSCode dcsCode = dcsIdentifier.getValue();
|
||||||
|
|
||||||
|
if(dcsCode != null)
|
||||||
|
{
|
||||||
|
return toList(mDCSCodeAliasMap.get(dcsCode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Collections.EMPTY_LIST;
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<Alias> toList(Alias alias)
|
||||||
|
{
|
||||||
|
if(alias != null)
|
||||||
|
{
|
||||||
|
return Collections.singletonList(alias);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -454,28 +652,12 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
return channels;
|
return channels;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the alias (as a value) from the specified map
|
|
||||||
*/
|
|
||||||
public static void remove(Alias alias, Map map)
|
|
||||||
{
|
|
||||||
Iterator<Map.Entry> it = map.entrySet().iterator();
|
|
||||||
|
|
||||||
while(it.hasNext())
|
|
||||||
{
|
|
||||||
if(it.next().getValue().equals(alias))
|
|
||||||
{
|
|
||||||
it.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listing of talkgroups and ranges for a specific protocol
|
* Listing of talkgroups and ranges for a specific protocol
|
||||||
*/
|
*/
|
||||||
public class TalkgroupAliasList
|
public class TalkgroupAliasList
|
||||||
{
|
{
|
||||||
|
private Map<String,Alias> mFullyQualifiedTalkgroupAliasMap = new HashMap<>();
|
||||||
private Map<Integer,Alias> mTalkgroupAliasMap = new TreeMap<>();
|
private Map<Integer,Alias> mTalkgroupAliasMap = new TreeMap<>();
|
||||||
private Map<TalkgroupRange, Alias> mTalkgroupRangeAliasMap = new HashMap<>();
|
private Map<TalkgroupRange, Alias> mTalkgroupRangeAliasMap = new HashMap<>();
|
||||||
|
|
||||||
@@ -485,18 +667,27 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
|
|
||||||
public Alias getAlias(TalkgroupIdentifier identifier)
|
public Alias getAlias(TalkgroupIdentifier identifier)
|
||||||
{
|
{
|
||||||
int value = identifier.getValue();
|
//Attempt to do a fully qualified identifier match only
|
||||||
|
if(identifier instanceof FullyQualifiedTalkgroupIdentifier fqti)
|
||||||
if(mTalkgroupAliasMap.containsKey(value))
|
|
||||||
{
|
{
|
||||||
return mTalkgroupAliasMap.get(value);
|
return mFullyQualifiedTalkgroupAliasMap.get(fqti.getFullyQualifiedTalkgroupAddress());
|
||||||
}
|
}
|
||||||
|
|
||||||
for(TalkgroupRange talkgroupRange: mTalkgroupRangeAliasMap.keySet())
|
//Attempt to match the talkgroup value
|
||||||
|
int value = identifier.getValue();
|
||||||
|
|
||||||
|
Alias mapValue = mTalkgroupAliasMap.get(value);
|
||||||
|
if (mapValue != null)
|
||||||
{
|
{
|
||||||
if(talkgroupRange.contains(value))
|
return mapValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Alternatively, match the talkgroup to any talkgroup ranges
|
||||||
|
for(Map.Entry<TalkgroupRange, Alias> entry : mTalkgroupRangeAliasMap.entrySet())
|
||||||
|
{
|
||||||
|
if(entry.getKey().contains(value))
|
||||||
{
|
{
|
||||||
return mTalkgroupRangeAliasMap.get(talkgroupRange);
|
return entry.getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,31 +696,199 @@ public class AliasList implements Listener<AliasEvent>
|
|||||||
|
|
||||||
public void add(Talkgroup talkgroup, Alias alias)
|
public void add(Talkgroup talkgroup, Alias alias)
|
||||||
{
|
{
|
||||||
mTalkgroupAliasMap.put(talkgroup.getValue(), alias);
|
if(talkgroup instanceof P25FullyQualifiedTalkgroup fqt)
|
||||||
|
{
|
||||||
|
//Detect collisions
|
||||||
|
if(mFullyQualifiedTalkgroupAliasMap.containsKey(fqt.getHashKey()))
|
||||||
|
{
|
||||||
|
Alias existing = mFullyQualifiedTalkgroupAliasMap.get(fqt.getHashKey());
|
||||||
|
|
||||||
|
if(!existing.equals(alias))
|
||||||
|
{
|
||||||
|
fqt.setOverlap(true);
|
||||||
|
|
||||||
|
for(AliasID aliasID: existing.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(aliasID instanceof P25FullyQualifiedTalkgroup existingFqt &&
|
||||||
|
existingFqt.getHashKey().contentEquals(fqt.getHashKey()))
|
||||||
|
{
|
||||||
|
aliasID.setOverlap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mFullyQualifiedTalkgroupAliasMap.put(fqt.getHashKey(), alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Detect talkgroup collisions and set overlap flag for both
|
||||||
|
if(mTalkgroupAliasMap.containsKey(talkgroup.getValue()))
|
||||||
|
{
|
||||||
|
Alias existing = mTalkgroupAliasMap.get(talkgroup.getValue());
|
||||||
|
|
||||||
|
if(!existing.equals(alias))
|
||||||
|
{
|
||||||
|
talkgroup.setOverlap(true);
|
||||||
|
|
||||||
|
for(AliasID aliasID: existing.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(aliasID instanceof Talkgroup && ((Talkgroup)aliasID).getValue() == talkgroup.getValue())
|
||||||
|
{
|
||||||
|
aliasID.setOverlap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mTalkgroupAliasMap.put(talkgroup.getValue(), alias);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(TalkgroupRange talkgroupRange, Alias alias)
|
public void add(TalkgroupRange talkgroupRange, Alias alias)
|
||||||
{
|
{
|
||||||
|
//Log warning if the new talkgroup range overlaps with any existing ranges
|
||||||
|
for(Map.Entry<TalkgroupRange,Alias> entry: mTalkgroupRangeAliasMap.entrySet())
|
||||||
|
{
|
||||||
|
if(talkgroupRange.overlaps(entry.getKey()) && !entry.getValue().equals(alias))
|
||||||
|
{
|
||||||
|
talkgroupRange.setOverlap(true);
|
||||||
|
entry.getKey().setOverlap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mTalkgroupRangeAliasMap.put(talkgroupRange, alias);
|
mTalkgroupRangeAliasMap.put(talkgroupRange, alias);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(Talkgroup talkgroup)
|
|
||||||
{
|
|
||||||
mTalkgroupAliasMap.remove(talkgroup.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void remove(TalkgroupRange talkgroupRange)
|
|
||||||
{
|
|
||||||
mTalkgroupRangeAliasMap.remove(talkgroupRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the alias from all internal maps
|
* Removes the alias from both the talkgroup and the talkgroup range maps.
|
||||||
*/
|
*/
|
||||||
public void remove(Alias alias)
|
public void remove(Alias alias)
|
||||||
{
|
{
|
||||||
AliasList.remove(alias, mTalkgroupAliasMap);
|
mTalkgroupAliasMap.values().removeAll(Collections.singleton(alias));
|
||||||
AliasList.remove(alias, mTalkgroupRangeAliasMap);
|
mTalkgroupRangeAliasMap.values().removeAll(Collections.singleton(alias));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Listing of radio IDs and ranges for a specific protocol
|
||||||
|
*/
|
||||||
|
public class RadioAliasList
|
||||||
|
{
|
||||||
|
private Map<String,Alias> mFullyQualifiedRadioAliasMap = new HashMap<>();
|
||||||
|
private Map<Integer,Alias> mRadioAliasMap = new TreeMap<>();
|
||||||
|
private Map<RadioRange, Alias> mRadioRangeAliasMap = new HashMap<>();
|
||||||
|
|
||||||
|
public RadioAliasList()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Alias getAlias(RadioIdentifier identifier)
|
||||||
|
{
|
||||||
|
//Match fully qualified identifier only.
|
||||||
|
if(identifier instanceof FullyQualifiedRadioIdentifier fqri)
|
||||||
|
{
|
||||||
|
return mFullyQualifiedRadioAliasMap.get(fqri.getFullyQualifiedRadioAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
//Attempt to match against the radio identifier
|
||||||
|
int value = identifier.getValue();
|
||||||
|
|
||||||
|
Alias mapValue = mRadioAliasMap.get(value);
|
||||||
|
if(mapValue != null)
|
||||||
|
{
|
||||||
|
return mapValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Alternatively, attempt to match the radio address against any radio ranges.
|
||||||
|
for(Map.Entry<RadioRange, Alias> entry : mRadioRangeAliasMap.entrySet())
|
||||||
|
{
|
||||||
|
if(entry.getKey().contains(value))
|
||||||
|
{
|
||||||
|
return entry.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(Radio radio, Alias alias)
|
||||||
|
{
|
||||||
|
if(radio instanceof P25FullyQualifiedRadio fqr)
|
||||||
|
{
|
||||||
|
//Detect collisions
|
||||||
|
if(mFullyQualifiedRadioAliasMap.containsKey(fqr.getHashKey()))
|
||||||
|
{
|
||||||
|
Alias existing = mFullyQualifiedRadioAliasMap.get(fqr.getHashKey());
|
||||||
|
|
||||||
|
if(!existing.equals(alias))
|
||||||
|
{
|
||||||
|
fqr.setOverlap(true);
|
||||||
|
|
||||||
|
for(AliasID aliasID: existing.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(aliasID instanceof P25FullyQualifiedRadio existingFqr &&
|
||||||
|
existingFqr.getHashKey().contentEquals(fqr.getHashKey()))
|
||||||
|
{
|
||||||
|
aliasID.setOverlap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mFullyQualifiedRadioAliasMap.put(fqr.getHashKey(), alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Detect collisions
|
||||||
|
if(mRadioAliasMap.containsKey(radio.getValue()))
|
||||||
|
{
|
||||||
|
Alias existing = mRadioAliasMap.get(radio.getValue());
|
||||||
|
|
||||||
|
if(!existing.equals(alias))
|
||||||
|
{
|
||||||
|
radio.setOverlap(true);
|
||||||
|
|
||||||
|
for(AliasID aliasID: existing.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(aliasID instanceof Radio existingRadio && (existingRadio.getValue() == radio.getValue()))
|
||||||
|
{
|
||||||
|
aliasID.setOverlap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mRadioAliasMap.put(radio.getValue(), alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(RadioRange radioRange, Alias alias)
|
||||||
|
{
|
||||||
|
//Log warning if the new range overlaps with any existing ranges
|
||||||
|
for(Map.Entry<RadioRange,Alias> entry: mRadioRangeAliasMap.entrySet())
|
||||||
|
{
|
||||||
|
if(radioRange.overlaps(entry.getKey()) && !entry.getValue().equals(alias))
|
||||||
|
{
|
||||||
|
radioRange.setOverlap(true);
|
||||||
|
entry.getKey().setOverlap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mRadioRangeAliasMap.put(radioRange, alias);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the alias from both the radio and the radio range maps.
|
||||||
|
*/
|
||||||
|
public void remove(Alias alias)
|
||||||
|
{
|
||||||
|
mRadioAliasMap.values().removeAll(Collections.singleton(alias));
|
||||||
|
mRadioRangeAliasMap.values().removeAll(Collections.singleton(alias));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,269 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.alias;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
|
import javafx.beans.Observable;
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
import javafx.beans.property.IntegerProperty;
|
||||||
|
import javafx.beans.property.LongProperty;
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
|
import javafx.beans.property.SimpleLongProperty;
|
||||||
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
|
import javafx.beans.property.StringProperty;
|
||||||
|
import javafx.util.Callback;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Persisted settings for an alias list. Alias lists are otherwise identified only by the list name that each alias
|
||||||
|
* carries, so settings that belong to the list itself, like tracking a Radio Reference system, are stored here and
|
||||||
|
* saved in the playlist.
|
||||||
|
*
|
||||||
|
* Radio Reference tracking uses two timestamps from the Radio Reference system's last updated value: the last updated
|
||||||
|
* value seen by the most recent check, and the last updated value that the aliases were synchronized to. When the
|
||||||
|
* seen value is newer than the synchronized value, the system changed on Radio Reference and the aliases haven't
|
||||||
|
* been updated yet.
|
||||||
|
*/
|
||||||
|
public class AliasListConfiguration
|
||||||
|
{
|
||||||
|
public static final int NO_SYSTEM = 0;
|
||||||
|
|
||||||
|
private StringProperty mName = new SimpleStringProperty();
|
||||||
|
private IntegerProperty mRadioReferenceSystemId = new SimpleIntegerProperty(NO_SYSTEM);
|
||||||
|
private StringProperty mRadioReferenceSystemName = new SimpleStringProperty();
|
||||||
|
private BooleanProperty mAutoUpdate = new SimpleBooleanProperty();
|
||||||
|
private LongProperty mRadioReferenceLastUpdated = new SimpleLongProperty();
|
||||||
|
private LongProperty mSynchronizedLastUpdated = new SimpleLongProperty();
|
||||||
|
private LongProperty mLastChecked = new SimpleLongProperty();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jackson constructor
|
||||||
|
*/
|
||||||
|
public AliasListConfiguration()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
* @param name of the alias list
|
||||||
|
*/
|
||||||
|
public AliasListConfiguration(String name)
|
||||||
|
{
|
||||||
|
setName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extractor so that observable lists of configurations report changes to the persisted properties.
|
||||||
|
*/
|
||||||
|
public static Callback<AliasListConfiguration,Observable[]> extractor()
|
||||||
|
{
|
||||||
|
return (AliasListConfiguration c) -> new Observable[] {c.mName, c.mRadioReferenceSystemId,
|
||||||
|
c.mRadioReferenceSystemName, c.mAutoUpdate, c.mRadioReferenceLastUpdated, c.mSynchronizedLastUpdated,
|
||||||
|
c.mLastChecked};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias list name
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "name")
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return mName.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
mName.set(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public StringProperty nameProperty()
|
||||||
|
{
|
||||||
|
return mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this alias list tracks a Radio Reference system.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean isTrackingRadioReferenceSystem()
|
||||||
|
{
|
||||||
|
return getRadioReferenceSystemId() > NO_SYSTEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this alias list tracks the specified Radio Reference system.
|
||||||
|
*/
|
||||||
|
public boolean isTracking(int systemId)
|
||||||
|
{
|
||||||
|
return systemId > NO_SYSTEM && getRadioReferenceSystemId() == systemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Radio Reference system ID tracked by this alias list, or NO_SYSTEM (0).
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "rr_system_id")
|
||||||
|
public int getRadioReferenceSystemId()
|
||||||
|
{
|
||||||
|
return mRadioReferenceSystemId.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRadioReferenceSystemId(int systemId)
|
||||||
|
{
|
||||||
|
mRadioReferenceSystemId.set(systemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public IntegerProperty radioReferenceSystemIdProperty()
|
||||||
|
{
|
||||||
|
return mRadioReferenceSystemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Radio Reference system name, for display.
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "rr_system_name")
|
||||||
|
public String getRadioReferenceSystemName()
|
||||||
|
{
|
||||||
|
return mRadioReferenceSystemName.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRadioReferenceSystemName(String name)
|
||||||
|
{
|
||||||
|
mRadioReferenceSystemName.set(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public StringProperty radioReferenceSystemNameProperty()
|
||||||
|
{
|
||||||
|
return mRadioReferenceSystemName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if talkgroups are automatically added or updated as aliases when the system changes on Radio Reference.
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "rr_auto_update")
|
||||||
|
public boolean isAutoUpdate()
|
||||||
|
{
|
||||||
|
return mAutoUpdate.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutoUpdate(boolean autoUpdate)
|
||||||
|
{
|
||||||
|
mAutoUpdate.set(autoUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public BooleanProperty autoUpdateProperty()
|
||||||
|
{
|
||||||
|
return mAutoUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Radio Reference last updated timestamp (ms since epoch) for the system, as seen by the most recent check.
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "rr_last_updated")
|
||||||
|
public long getRadioReferenceLastUpdated()
|
||||||
|
{
|
||||||
|
return mRadioReferenceLastUpdated.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRadioReferenceLastUpdated(long timestamp)
|
||||||
|
{
|
||||||
|
mRadioReferenceLastUpdated.set(timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public LongProperty radioReferenceLastUpdatedProperty()
|
||||||
|
{
|
||||||
|
return mRadioReferenceLastUpdated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Radio Reference last updated timestamp (ms since epoch) that the aliases were last synchronized to.
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "rr_synchronized")
|
||||||
|
public long getSynchronizedLastUpdated()
|
||||||
|
{
|
||||||
|
return mSynchronizedLastUpdated.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSynchronizedLastUpdated(long timestamp)
|
||||||
|
{
|
||||||
|
mSynchronizedLastUpdated.set(timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public LongProperty synchronizedLastUpdatedProperty()
|
||||||
|
{
|
||||||
|
return mSynchronizedLastUpdated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Time (ms since epoch) of the most recent successful check of the system on Radio Reference.
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "rr_last_checked")
|
||||||
|
public long getLastChecked()
|
||||||
|
{
|
||||||
|
return mLastChecked.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastChecked(long timestamp)
|
||||||
|
{
|
||||||
|
mLastChecked.set(timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public LongProperty lastCheckedProperty()
|
||||||
|
{
|
||||||
|
return mLastChecked;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the most recent check saw a system change on Radio Reference that the aliases don't include yet.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean isUpdateAvailable()
|
||||||
|
{
|
||||||
|
return isTrackingRadioReferenceSystem() && getRadioReferenceLastUpdated() > getSynchronizedLastUpdated();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts tracking the Radio Reference system. Clears timestamps so that the next refresh synchronizes.
|
||||||
|
*/
|
||||||
|
public void track(int systemId, String systemName)
|
||||||
|
{
|
||||||
|
setRadioReferenceSystemId(systemId);
|
||||||
|
setRadioReferenceSystemName(systemName);
|
||||||
|
setRadioReferenceLastUpdated(0);
|
||||||
|
setSynchronizedLastUpdated(0);
|
||||||
|
setLastChecked(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops tracking any Radio Reference system.
|
||||||
|
*/
|
||||||
|
public void stopTracking()
|
||||||
|
{
|
||||||
|
track(NO_SYSTEM, null);
|
||||||
|
setAutoUpdate(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,45 +14,236 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.alias;
|
package io.github.dsheirer.alias;
|
||||||
|
|
||||||
|
import io.github.dsheirer.alias.id.AliasID;
|
||||||
|
import io.github.dsheirer.alias.id.AliasIDType;
|
||||||
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
||||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||||
import io.github.dsheirer.identifier.configuration.AliasListConfigurationIdentifier;
|
import io.github.dsheirer.identifier.configuration.AliasListConfigurationIdentifier;
|
||||||
import io.github.dsheirer.sample.Broadcaster;
|
|
||||||
import io.github.dsheirer.sample.Listener;
|
|
||||||
|
|
||||||
import javax.swing.table.AbstractTableModel;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import javafx.collections.FXCollections;
|
||||||
|
import javafx.collections.ListChangeListener;
|
||||||
|
import javafx.collections.ObservableList;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alias Model contains all aliases and is responsible for creation and management of alias lists. Alias lists are a
|
* Alias Model contains all aliases and is responsible for creation and management of alias lists. Alias lists are a
|
||||||
* set of aliases that all share a common alias list name and can be attached to a decoding channel for aliasing
|
* set of aliases that all share a common alias list name and can be attached to a decoding channel for aliasing
|
||||||
* identifiers produced by channel decoder(s).
|
* identifiers produced by channel decoder(s).
|
||||||
*/
|
*/
|
||||||
public class AliasModel extends AbstractTableModel
|
public class AliasModel
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private final static Logger mLog = LoggerFactory.getLogger(AliasModel.class);
|
||||||
|
public static final String NO_ALIAS_LIST = "(No Alias List)";
|
||||||
public static final int COLUMN_LIST = 0;
|
private ObservableList<Alias> mAliases = FXCollections.observableArrayList(Alias.extractor());
|
||||||
public static final int COLUMN_GROUP = 1;
|
private ObservableList<String> mAliasListNames = FXCollections.observableArrayList();
|
||||||
public static final int COLUMN_NAME = 2;
|
|
||||||
public static final int COLUMN_ICON = 3;
|
|
||||||
public static final int COLUMN_COLOR = 4;
|
|
||||||
|
|
||||||
private List<Alias> mAliases = new CopyOnWriteArrayList<>();
|
|
||||||
private Broadcaster<AliasEvent> mAliasEventBroadcaster = new Broadcaster<>();
|
|
||||||
private Map<String,AliasList> mAliasListMap = new HashMap<>();
|
private Map<String,AliasList> mAliasListMap = new HashMap<>();
|
||||||
|
private ObservableList<AliasListConfiguration> mAliasListConfigurations =
|
||||||
|
FXCollections.observableArrayList(AliasListConfiguration.extractor());
|
||||||
|
|
||||||
public AliasModel()
|
public AliasModel()
|
||||||
{
|
{
|
||||||
|
//Register a listener to detect alias changes and broadcast change events to cause playlist save requests
|
||||||
|
mAliases.addListener(new AliasListChangeListener());
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableList<Alias> aliasList()
|
||||||
|
{
|
||||||
|
return mAliases;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableList<String> aliasListNames()
|
||||||
|
{
|
||||||
|
return mAliasListNames;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Observable list of persisted alias list configurations. Only alias lists with settings, like Radio Reference
|
||||||
|
* system tracking, have a configuration.
|
||||||
|
*/
|
||||||
|
public ObservableList<AliasListConfiguration> aliasListConfigurations()
|
||||||
|
{
|
||||||
|
return mAliasListConfigurations;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bulk loading of alias list configurations from a playlist. Ignores configurations without a name and
|
||||||
|
* duplicates of an earlier configuration's name.
|
||||||
|
*/
|
||||||
|
public void addAliasListConfigurations(List<AliasListConfiguration> configurations)
|
||||||
|
{
|
||||||
|
if(configurations != null)
|
||||||
|
{
|
||||||
|
for(AliasListConfiguration configuration: configurations)
|
||||||
|
{
|
||||||
|
String name = configuration.getName();
|
||||||
|
|
||||||
|
if(name != null && !name.isEmpty() && getAliasListConfiguration(name) == null)
|
||||||
|
{
|
||||||
|
mAliasListConfigurations.add(configuration);
|
||||||
|
addAliasList(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration for the named alias list.
|
||||||
|
* @param aliasListName to find
|
||||||
|
* @return configuration or null if the alias list doesn't have one
|
||||||
|
*/
|
||||||
|
public AliasListConfiguration getAliasListConfiguration(String aliasListName)
|
||||||
|
{
|
||||||
|
if(aliasListName != null)
|
||||||
|
{
|
||||||
|
for(AliasListConfiguration configuration: mAliasListConfigurations)
|
||||||
|
{
|
||||||
|
if(aliasListName.equals(configuration.getName()))
|
||||||
|
{
|
||||||
|
return configuration;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration for the named alias list, created when the alias list doesn't have one.
|
||||||
|
* @param aliasListName for the configuration, not null or the (No Alias List) name
|
||||||
|
* @return configuration
|
||||||
|
*/
|
||||||
|
public AliasListConfiguration getOrCreateAliasListConfiguration(String aliasListName)
|
||||||
|
{
|
||||||
|
if(aliasListName == null || aliasListName.isEmpty() || aliasListName.equals(NO_ALIAS_LIST))
|
||||||
|
{
|
||||||
|
throw new IllegalArgumentException("Invalid alias list name [" + aliasListName + "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
AliasListConfiguration configuration = getAliasListConfiguration(aliasListName);
|
||||||
|
|
||||||
|
if(configuration == null)
|
||||||
|
{
|
||||||
|
configuration = new AliasListConfiguration(aliasListName);
|
||||||
|
mAliasListConfigurations.add(configuration);
|
||||||
|
addAliasList(aliasListName);
|
||||||
|
}
|
||||||
|
|
||||||
|
return configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the first alias list that tracks the Radio Reference system.
|
||||||
|
* @param systemId of the Radio Reference system
|
||||||
|
* @return alias list name or null
|
||||||
|
*/
|
||||||
|
public String getAliasListNameTracking(int systemId)
|
||||||
|
{
|
||||||
|
for(AliasListConfiguration configuration: mAliasListConfigurations)
|
||||||
|
{
|
||||||
|
if(configuration.isTracking(systemId))
|
||||||
|
{
|
||||||
|
return configuration.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears and reloads the list of alias list names from the current set of aliases.
|
||||||
|
*/
|
||||||
|
public void refreshAliasListNames()
|
||||||
|
{
|
||||||
|
mAliasListNames.clear();
|
||||||
|
|
||||||
|
for(Alias alias : mAliases)
|
||||||
|
{
|
||||||
|
String aliasListName = alias.getAliasListName();
|
||||||
|
|
||||||
|
if(aliasListName != null && !aliasListName.isEmpty() && !mAliasListNames.contains(aliasListName))
|
||||||
|
{
|
||||||
|
mAliasListNames.add(aliasListName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Alias lists with a configuration exist even before they have any aliases
|
||||||
|
for(AliasListConfiguration configuration: mAliasListConfigurations)
|
||||||
|
{
|
||||||
|
if(!mAliasListNames.contains(configuration.getName()))
|
||||||
|
{
|
||||||
|
mAliasListNames.add(configuration.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renames the alias list across the set of aliases.
|
||||||
|
* @param oldName currently used by the alias
|
||||||
|
* @param newName to apply to the alias
|
||||||
|
*/
|
||||||
|
public void renameAliasList(String oldName, String newName)
|
||||||
|
{
|
||||||
|
if(oldName == null || oldName.isEmpty() || newName == null || newName.isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mAliases.stream().filter(alias -> oldName.equals(alias.getAliasListName())).forEach(alias -> alias.setAliasListName(newName));
|
||||||
|
|
||||||
|
AliasListConfiguration configuration = getAliasListConfiguration(oldName);
|
||||||
|
|
||||||
|
if(configuration != null)
|
||||||
|
{
|
||||||
|
//Merging into an existing list keeps that list's configuration
|
||||||
|
if(getAliasListConfiguration(newName) == null)
|
||||||
|
{
|
||||||
|
configuration.setName(newName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mAliasListConfigurations.remove(configuration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes any aliases that have the alias list name
|
||||||
|
* @param aliasListName to delete
|
||||||
|
*/
|
||||||
|
public void deleteAliasList(String aliasListName)
|
||||||
|
{
|
||||||
|
if(aliasListName == null || aliasListName.isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mAliases.removeIf(alias -> alias.getAliasListName().equals(aliasListName));
|
||||||
|
mAliasListMap.remove(aliasListName);
|
||||||
|
mAliasListConfigurations.removeIf(configuration -> aliasListName.equals(configuration.getName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the list of alias list names to the currently managed set of alias list names.
|
||||||
|
* @param aliasListNames to add
|
||||||
|
*/
|
||||||
|
public void addAliasListNames(List<String> aliasListNames)
|
||||||
|
{
|
||||||
|
for(String aliasListName : aliasListNames)
|
||||||
|
{
|
||||||
|
if(!mAliasListNames.contains(aliasListName))
|
||||||
|
{
|
||||||
|
mAliasListNames.add(aliasListName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,14 +254,20 @@ public class AliasModel extends AbstractTableModel
|
|||||||
return Collections.unmodifiableList(mAliases);
|
return Collections.unmodifiableList(mAliases);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getAliasAtIndex(int row)
|
/**
|
||||||
|
* Removes all aliases from the list and broadcasts the alias delete event for each
|
||||||
|
*/
|
||||||
|
public void clear()
|
||||||
{
|
{
|
||||||
if(mAliases.size() >= row)
|
List<Alias> aliasToRemove = new ArrayList<>(mAliases);
|
||||||
|
|
||||||
|
for(Alias alias: aliasToRemove)
|
||||||
{
|
{
|
||||||
return mAliases.get(row);
|
removeAlias(alias);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
mAliasListConfigurations.clear();
|
||||||
|
mAliasListNames.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -117,16 +313,17 @@ public class AliasModel extends AbstractTableModel
|
|||||||
return new AliasList(name);
|
return new AliasList(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mAliasListMap.containsKey(name))
|
AliasList mapValue = mAliasListMap.get(name);
|
||||||
|
if (mapValue != null)
|
||||||
{
|
{
|
||||||
return mAliasListMap.get(name);
|
return mapValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
AliasList aliasList = new AliasList(name);
|
AliasList aliasList = new AliasList(name);
|
||||||
|
|
||||||
for(Alias alias : mAliases)
|
for(Alias alias : mAliases)
|
||||||
{
|
{
|
||||||
if(alias.hasList() && alias.getList().equalsIgnoreCase(name))
|
if(alias.hasList() && alias.getAliasListName().equalsIgnoreCase(name))
|
||||||
{
|
{
|
||||||
aliasList.addAlias(alias);
|
aliasList.addAlias(alias);
|
||||||
}
|
}
|
||||||
@@ -134,9 +331,6 @@ public class AliasModel extends AbstractTableModel
|
|||||||
|
|
||||||
mAliasListMap.put(name, aliasList);
|
mAliasListMap.put(name, aliasList);
|
||||||
|
|
||||||
//Register the new alias list to receive updates from this model
|
|
||||||
addListener(aliasList);
|
|
||||||
|
|
||||||
return aliasList;
|
return aliasList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,19 +339,7 @@ public class AliasModel extends AbstractTableModel
|
|||||||
*/
|
*/
|
||||||
public List<String> getListNames()
|
public List<String> getListNames()
|
||||||
{
|
{
|
||||||
List<String> listNames = new ArrayList<>();
|
return mAliasListNames;
|
||||||
|
|
||||||
for(Alias alias : mAliases)
|
|
||||||
{
|
|
||||||
if(alias.hasList() && !listNames.contains(alias.getList()))
|
|
||||||
{
|
|
||||||
listNames.add(alias.getList());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Collections.sort(listNames);
|
|
||||||
|
|
||||||
return listNames;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -180,214 +362,209 @@ public class AliasModel extends AbstractTableModel
|
|||||||
return groupNames;
|
return groupNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a list of alias group names for all aliases that have a matching
|
|
||||||
* list name value
|
|
||||||
*/
|
|
||||||
public List<String> getGroupNames(String listName)
|
|
||||||
{
|
|
||||||
List<String> groupNames = new ArrayList<>();
|
|
||||||
|
|
||||||
if(listName != null)
|
|
||||||
{
|
|
||||||
for(Alias alias : mAliases)
|
|
||||||
{
|
|
||||||
if(alias.hasList() &&
|
|
||||||
alias.hasGroup() &&
|
|
||||||
listName.equals(alias.getList()) &&
|
|
||||||
!groupNames.contains(alias.getGroup()))
|
|
||||||
{
|
|
||||||
groupNames.add(alias.getGroup());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Collections.sort(groupNames);
|
|
||||||
|
|
||||||
return groupNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bulk loading of aliases
|
* Bulk loading of aliases
|
||||||
*/
|
*/
|
||||||
public void addAliases(List<Alias> aliases)
|
public void addAliases(List<Alias> aliases)
|
||||||
{
|
{
|
||||||
for(Alias alias : aliases)
|
removeAliases(aliases);
|
||||||
{
|
mAliases.addAll(aliases);
|
||||||
addAlias(alias);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the alias to the model
|
* Adds the alias to the model
|
||||||
*/
|
*/
|
||||||
public int addAlias(Alias alias)
|
public void addAlias(Alias alias)
|
||||||
{
|
{
|
||||||
if(alias != null)
|
if(mAliases.contains(alias))
|
||||||
{
|
{
|
||||||
mAliases.add(alias);
|
removeAlias(alias);
|
||||||
|
|
||||||
int index = mAliases.size() - 1;
|
|
||||||
|
|
||||||
fireTableRowsInserted(index, index);
|
|
||||||
|
|
||||||
broadcast(new AliasEvent(alias, AliasEvent.Event.ADD));
|
|
||||||
|
|
||||||
return index;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
mAliases.add(alias);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean hasAliasList(String aliasListName)
|
||||||
|
{
|
||||||
|
return aliasListName != null && mAliasListMap.containsKey(aliasListName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addAliasList(String aliasListName)
|
||||||
|
{
|
||||||
|
if(aliasListName != null && !aliasListName.isEmpty())
|
||||||
|
{
|
||||||
|
if(!mAliasListNames.contains(aliasListName))
|
||||||
|
{
|
||||||
|
mAliasListNames.add(aliasListName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(!mAliasListNames.contains(NO_ALIAS_LIST))
|
||||||
|
{
|
||||||
|
//This list allows users to view unassigned aliases so that they can move them to a valid alias list, but
|
||||||
|
// it is not assignable to a channel
|
||||||
|
mAliasListNames.add(NO_ALIAS_LIST);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the channel from the model and broadcasts a channel remove event
|
* Removes the alias from this model and an alias list (if one exists)
|
||||||
*/
|
*/
|
||||||
public void removeAlias(Alias alias)
|
public void removeAlias(Alias alias)
|
||||||
{
|
{
|
||||||
if(alias != null)
|
if(alias != null)
|
||||||
{
|
{
|
||||||
int index = mAliases.indexOf(alias);
|
|
||||||
|
|
||||||
mAliases.remove(alias);
|
mAliases.remove(alias);
|
||||||
|
|
||||||
fireTableRowsDeleted(index, index);
|
if(hasAliasList(alias.getAliasListName()))
|
||||||
|
{
|
||||||
broadcast(new AliasEvent(alias, AliasEvent.Event.DELETE));
|
getAliasList(alias.getAliasListName()).removeAlias(alias);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renames any broadcast channels that have the previous name.
|
* Removes the list of aliases from this model and any alias lists that might contain each alias.
|
||||||
*
|
* @param aliases
|
||||||
* @param previousName to rename
|
|
||||||
* @param newName to assign to the broadcast channel
|
|
||||||
*/
|
*/
|
||||||
public void renameBroadcastChannel(String previousName, String newName)
|
public void removeAliases(List<Alias> aliases)
|
||||||
{
|
{
|
||||||
if(previousName == null || previousName.isEmpty() || newName == null || newName.isEmpty())
|
if(aliases != null && !aliases.isEmpty())
|
||||||
|
{
|
||||||
|
mAliases.removeAll(aliases);
|
||||||
|
|
||||||
|
for(Alias alias: aliases)
|
||||||
|
{
|
||||||
|
if(hasAliasList(alias.getAliasListName()))
|
||||||
|
{
|
||||||
|
getAliasList(alias.getAliasListName()).removeAlias(alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all aliases that match the alias list and have at least one alias ID of the specified type
|
||||||
|
* @param aliasListName to search
|
||||||
|
* @param type to find
|
||||||
|
* @return list of aliases
|
||||||
|
*/
|
||||||
|
public List<Alias> getAliases(String aliasListName, AliasIDType type)
|
||||||
|
{
|
||||||
|
List<Alias> aliases = new ArrayList<>();
|
||||||
|
|
||||||
|
for(Alias alias : mAliases)
|
||||||
|
{
|
||||||
|
if(alias.hasList() && alias.getAliasListName().equalsIgnoreCase(aliasListName))
|
||||||
|
{
|
||||||
|
for(AliasID aliasID: alias.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(aliasID.getType() == type)
|
||||||
|
{
|
||||||
|
aliases.add(alias);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return aliases;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates that one or more of the aliases managed by this model are configured to stream to the specified
|
||||||
|
* broadcast channel argument.
|
||||||
|
* @param broadcastChannel to check
|
||||||
|
* @return true if the broadcast channel is non-null, non-empty and at least one alias is configured to stream to
|
||||||
|
* the specified stream name.
|
||||||
|
*/
|
||||||
|
public boolean hasAliasesWithBroadcastChannel(String broadcastChannel)
|
||||||
|
{
|
||||||
|
if(broadcastChannel == null || broadcastChannel.isEmpty())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(Alias alias: mAliases)
|
||||||
|
{
|
||||||
|
if(alias.hasBroadcastChannel(broadcastChannel))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates all aliases configured to stream to the previousStreamName with the updatedStreamName
|
||||||
|
* @param previousStreamName to be removed
|
||||||
|
* @param updatedStreamName to be added
|
||||||
|
*/
|
||||||
|
public void updateBroadcastChannel(String previousStreamName, String updatedStreamName)
|
||||||
|
{
|
||||||
|
if(previousStreamName == null || previousStreamName.isEmpty() || updatedStreamName == null || updatedStreamName.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Alias alias : mAliases)
|
for(Alias alias: mAliases)
|
||||||
{
|
{
|
||||||
if(alias.hasBroadcastChannel(previousName))
|
if(alias.hasBroadcastChannel(previousStreamName))
|
||||||
{
|
{
|
||||||
for(BroadcastChannel broadcastChannel : alias.getBroadcastChannels())
|
for(BroadcastChannel broadcastChannel: alias.getBroadcastChannels())
|
||||||
{
|
{
|
||||||
if(broadcastChannel.getChannelName().contentEquals(previousName))
|
if(broadcastChannel.getChannelName().contentEquals(previousStreamName))
|
||||||
{
|
{
|
||||||
broadcastChannel.setChannelName(newName);
|
alias.removeAliasID(broadcastChannel);
|
||||||
|
|
||||||
|
if(!alias.hasBroadcastChannel(updatedStreamName))
|
||||||
|
{
|
||||||
|
alias.addAliasID(new BroadcastChannel(updatedStreamName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public int getRowCount()
|
* Monitors alias additions and removals and updates alias lists
|
||||||
|
*/
|
||||||
|
public class AliasListChangeListener implements ListChangeListener<Alias>
|
||||||
{
|
{
|
||||||
return mAliases.size();
|
@Override
|
||||||
}
|
public void onChanged(ListChangeListener.Change<? extends Alias> change)
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getColumnCount()
|
|
||||||
{
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getColumnName(int columnIndex)
|
|
||||||
{
|
|
||||||
switch(columnIndex)
|
|
||||||
{
|
{
|
||||||
case COLUMN_LIST:
|
while(change.next())
|
||||||
return "List";
|
{
|
||||||
case COLUMN_GROUP:
|
if(change.wasAdded())
|
||||||
return "Group";
|
{
|
||||||
case COLUMN_NAME:
|
for(Alias alias: change.getAddedSubList())
|
||||||
return "Name";
|
{
|
||||||
case COLUMN_ICON:
|
addAliasList(alias.getAliasListName());
|
||||||
return "Icon";
|
|
||||||
case COLUMN_COLOR:
|
if(hasAliasList(alias.getAliasListName()))
|
||||||
return "Color";
|
{
|
||||||
|
getAliasList(alias.getAliasListName()).addAlias(alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(change.wasRemoved())
|
||||||
|
{
|
||||||
|
for(Alias alias: change.getRemoved())
|
||||||
|
{
|
||||||
|
if(hasAliasList(alias.getAliasListName()))
|
||||||
|
{
|
||||||
|
AliasList aliasList = getAliasList(alias.getName());
|
||||||
|
|
||||||
|
if(alias != null)
|
||||||
|
{
|
||||||
|
aliasList.removeAlias(alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getColumnClass(int columnIndex)
|
|
||||||
{
|
|
||||||
if(columnIndex == COLUMN_COLOR)
|
|
||||||
{
|
|
||||||
return Integer.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
return String.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isCellEditable(int rowIndex, int columnIndex)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object getValueAt(int rowIndex, int columnIndex)
|
|
||||||
{
|
|
||||||
Alias alias = mAliases.get(rowIndex);
|
|
||||||
|
|
||||||
switch(columnIndex)
|
|
||||||
{
|
|
||||||
case COLUMN_LIST:
|
|
||||||
return alias.getList();
|
|
||||||
case COLUMN_GROUP:
|
|
||||||
return alias.getGroup();
|
|
||||||
case COLUMN_NAME:
|
|
||||||
return alias.getName();
|
|
||||||
case COLUMN_ICON:
|
|
||||||
return alias.getIconName();
|
|
||||||
case COLUMN_COLOR:
|
|
||||||
return alias.getColor();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
|
|
||||||
{
|
|
||||||
throw new IllegalArgumentException("Not yet implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void broadcast(AliasEvent event)
|
|
||||||
{
|
|
||||||
Alias alias = event.getAlias();
|
|
||||||
|
|
||||||
//Validate the alias following a user action that changed the alias or any alias IDs
|
|
||||||
if(alias != null)
|
|
||||||
{
|
|
||||||
alias.validate();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(event.getEvent() == AliasEvent.Event.CHANGE)
|
|
||||||
{
|
|
||||||
int index = mAliases.indexOf(event.getAlias());
|
|
||||||
|
|
||||||
fireTableRowsUpdated(index, index);
|
|
||||||
}
|
|
||||||
|
|
||||||
mAliasEventBroadcaster.broadcast(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addListener(Listener<AliasEvent> listener)
|
|
||||||
{
|
|
||||||
mAliasEventBroadcaster.addListener(listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeListener(Listener<AliasEvent> listener)
|
|
||||||
{
|
|
||||||
mAliasEventBroadcaster.removeListener(listener);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,333 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2017 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias;
|
|
||||||
|
|
||||||
import io.github.dsheirer.gui.editor.Editor;
|
|
||||||
import io.github.dsheirer.icon.Icon;
|
|
||||||
import io.github.dsheirer.icon.IconListCellRenderer;
|
|
||||||
import io.github.dsheirer.icon.IconManager;
|
|
||||||
import io.github.dsheirer.icon.IconTableModel;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.event.DocumentEvent;
|
|
||||||
import javax.swing.event.DocumentListener;
|
|
||||||
import javax.swing.event.TableModelEvent;
|
|
||||||
import javax.swing.event.TableModelListener;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class AliasNameEditor extends Editor<Alias>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static ComboBoxModel<String> EMPTY_LIST_MODEL = new DefaultComboBoxModel<>();
|
|
||||||
private static ComboBoxModel<String> EMPTY_GROUP_MODEL = new DefaultComboBoxModel<>();
|
|
||||||
|
|
||||||
private JComboBox<String> mListCombo = new JComboBox<>(EMPTY_LIST_MODEL);
|
|
||||||
private JComboBox<String> mGroupCombo = new JComboBox<>(EMPTY_GROUP_MODEL);
|
|
||||||
private JComboBox<Icon> mIconCombo;
|
|
||||||
private JTextField mName;
|
|
||||||
private JButton mButtonColor;
|
|
||||||
private JButton mBtnIconManager;
|
|
||||||
|
|
||||||
private AliasModel mAliasModel;
|
|
||||||
private IconManager mIconManager;
|
|
||||||
|
|
||||||
public AliasNameEditor(AliasModel aliasModel, IconManager iconManager)
|
|
||||||
{
|
|
||||||
mAliasModel = aliasModel;
|
|
||||||
mIconManager = iconManager;
|
|
||||||
|
|
||||||
mIconManager.getModel().addTableModelListener(new TableModelListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void tableChanged(TableModelEvent e)
|
|
||||||
{
|
|
||||||
refreshIcons();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
setLayout(new MigLayout("fill,wrap 2", "[right][grow,fill]", "[][][][][][][grow]"));
|
|
||||||
|
|
||||||
add(new JLabel("Name:"));
|
|
||||||
mName = new JTextField();
|
|
||||||
mName.getDocument().addDocumentListener(new DocumentListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void removeUpdate(DocumentEvent e)
|
|
||||||
{
|
|
||||||
setModified(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void insertUpdate(DocumentEvent e)
|
|
||||||
{
|
|
||||||
setModified(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void changedUpdate(DocumentEvent e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(mName, "wrap");
|
|
||||||
|
|
||||||
add(new JLabel("List:"));
|
|
||||||
mListCombo.setEditable(true);
|
|
||||||
mListCombo.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
if(mListCombo.getSelectedItem() != null)
|
|
||||||
{
|
|
||||||
List<String> groups = mAliasModel
|
|
||||||
.getGroupNames((String) mListCombo.getSelectedItem());
|
|
||||||
|
|
||||||
if(groups.isEmpty())
|
|
||||||
{
|
|
||||||
mGroupCombo.setModel(EMPTY_GROUP_MODEL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mGroupCombo.setModel(new DefaultComboBoxModel<String>(
|
|
||||||
groups.toArray(new String[groups.size()])));
|
|
||||||
;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(mListCombo, "wrap");
|
|
||||||
|
|
||||||
add(new JLabel("Group:"));
|
|
||||||
mGroupCombo.setEditable(true);
|
|
||||||
mGroupCombo.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
setModified(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(mGroupCombo, "wrap");
|
|
||||||
|
|
||||||
add(new JLabel("Color:"));
|
|
||||||
|
|
||||||
mButtonColor = new JButton("Select ...");
|
|
||||||
mButtonColor.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
Color newColor = JColorChooser.showDialog(
|
|
||||||
AliasNameEditor.this,
|
|
||||||
"Choose color for this alias",
|
|
||||||
(hasItem() ? getItem().getDisplayColor() : null));
|
|
||||||
|
|
||||||
if(newColor != null)
|
|
||||||
{
|
|
||||||
mButtonColor.setForeground(newColor);
|
|
||||||
mButtonColor.setBackground(newColor);
|
|
||||||
|
|
||||||
setModified(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(mButtonColor, "wrap");
|
|
||||||
|
|
||||||
add(new JLabel("Icon:"));
|
|
||||||
|
|
||||||
mIconCombo = new JComboBox<Icon>(mIconManager.getIcons());
|
|
||||||
|
|
||||||
IconListCellRenderer renderer = new IconListCellRenderer(mIconManager);
|
|
||||||
renderer.setPreferredSize(new Dimension(200, 30));
|
|
||||||
mIconCombo.setRenderer(renderer);
|
|
||||||
mIconCombo.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
setModified(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
add(mIconCombo, "wrap");
|
|
||||||
|
|
||||||
//Dummy place holder
|
|
||||||
add(new JLabel());
|
|
||||||
|
|
||||||
mBtnIconManager = new JButton("Icon Manager");
|
|
||||||
mBtnIconManager.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent arg0)
|
|
||||||
{
|
|
||||||
mIconManager.showEditor(AliasNameEditor.this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
add(mBtnIconManager, "span 2,wrap");
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void refreshIcons()
|
|
||||||
{
|
|
||||||
if(mIconCombo != null)
|
|
||||||
{
|
|
||||||
EventQueue.invokeLater(new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
mIconCombo.setModel(new DefaultComboBoxModel<>(mIconManager.getIcons()));
|
|
||||||
|
|
||||||
if(hasItem())
|
|
||||||
{
|
|
||||||
String iconName = getItem().getIconName();
|
|
||||||
Icon aliasIcon = mIconManager.getModel().getIcon(iconName);
|
|
||||||
|
|
||||||
if(aliasIcon != null)
|
|
||||||
{
|
|
||||||
mIconCombo.setSelectedItem(aliasIcon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem(Alias alias)
|
|
||||||
{
|
|
||||||
super.setItem(alias);
|
|
||||||
|
|
||||||
if(hasItem())
|
|
||||||
{
|
|
||||||
mName.setText(alias.getName());
|
|
||||||
|
|
||||||
mIconCombo.setModel(new DefaultComboBoxModel<>(mIconManager.getIcons()));
|
|
||||||
|
|
||||||
List<String> listNames = mAliasModel.getListNames();
|
|
||||||
|
|
||||||
if(listNames.isEmpty())
|
|
||||||
{
|
|
||||||
mListCombo.setModel(EMPTY_LIST_MODEL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mListCombo.setModel(new DefaultComboBoxModel<String>(
|
|
||||||
listNames.toArray(new String[listNames.size()])));
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
mListCombo.setSelectedItem(alias.getList());
|
|
||||||
|
|
||||||
List<String> groupNames = mAliasModel.getGroupNames(alias.getList());
|
|
||||||
|
|
||||||
if(groupNames.isEmpty())
|
|
||||||
{
|
|
||||||
mGroupCombo.setModel(EMPTY_GROUP_MODEL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mGroupCombo.setModel(new DefaultComboBoxModel<String>(
|
|
||||||
groupNames.toArray(new String[groupNames.size()])));
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
mGroupCombo.setSelectedItem(alias.getGroup());
|
|
||||||
|
|
||||||
Color color = alias.getDisplayColor();
|
|
||||||
|
|
||||||
mButtonColor.setBackground(color);
|
|
||||||
mButtonColor.setForeground(color);
|
|
||||||
|
|
||||||
String iconName = alias.getIconName();
|
|
||||||
|
|
||||||
if(iconName == null)
|
|
||||||
{
|
|
||||||
iconName = IconTableModel.DEFAULT_ICON;
|
|
||||||
}
|
|
||||||
|
|
||||||
Icon savedIcon = mIconManager.getModel().getIcon(iconName);
|
|
||||||
|
|
||||||
if(savedIcon != null)
|
|
||||||
{
|
|
||||||
mIconCombo.setSelectedItem(savedIcon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mListCombo.setModel(EMPTY_LIST_MODEL);
|
|
||||||
mGroupCombo.setModel(EMPTY_GROUP_MODEL);
|
|
||||||
mName.setText(null);
|
|
||||||
|
|
||||||
mButtonColor.setBackground(getBackground());
|
|
||||||
mButtonColor.setForeground(getForeground());
|
|
||||||
}
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
if(hasItem() && isModified())
|
|
||||||
{
|
|
||||||
Alias alias = getItem();
|
|
||||||
|
|
||||||
if(mListCombo.getSelectedItem() != null)
|
|
||||||
{
|
|
||||||
alias.setList((String) mListCombo.getSelectedItem());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mGroupCombo.getSelectedItem() != null)
|
|
||||||
{
|
|
||||||
alias.setGroup((String) mGroupCombo.getSelectedItem());
|
|
||||||
}
|
|
||||||
|
|
||||||
alias.setName(mName.getText());
|
|
||||||
|
|
||||||
alias.setColor(mButtonColor.getBackground().getRGB());
|
|
||||||
|
|
||||||
if(mIconCombo.getSelectedItem() != null)
|
|
||||||
{
|
|
||||||
alias.setIconName(((Icon) mIconCombo.getSelectedItem()).getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
|
|
||||||
//Broadcast an alias change event to save the updates
|
|
||||||
mAliasModel.broadcast(new AliasEvent(getItem(), AliasEvent.Event.CHANGE));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.event.DocumentListener;
|
|
||||||
|
|
||||||
public abstract class ComponentEditor<T> extends JPanel implements DocumentListener
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
private boolean mModified;
|
|
||||||
private ComponentModificationListener mListener;
|
|
||||||
protected T mComponent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Abstract class for editor with notifications when contents are modified
|
|
||||||
* and methods for saving or resetting the component values with the
|
|
||||||
* contents of the editor.
|
|
||||||
*/
|
|
||||||
public ComponentEditor( T component )
|
|
||||||
{
|
|
||||||
mComponent = component;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ComponentEditor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void dispose()
|
|
||||||
{
|
|
||||||
mComponent = null;
|
|
||||||
mListener = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public T getComponent()
|
|
||||||
{
|
|
||||||
return mComponent;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setModified( boolean modified )
|
|
||||||
{
|
|
||||||
mModified = modified;
|
|
||||||
|
|
||||||
if( modified && mListener != null )
|
|
||||||
{
|
|
||||||
mListener.componentModified();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates if the contents of the editor have been modified
|
|
||||||
*/
|
|
||||||
public boolean isModified()
|
|
||||||
{
|
|
||||||
return mModified;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setComponentModificationListener( ComponentModificationListener listener )
|
|
||||||
{
|
|
||||||
mListener = listener;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets or resets the editable component
|
|
||||||
*/
|
|
||||||
public abstract void setComponent( T t );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Saves changed editor values to the component
|
|
||||||
*/
|
|
||||||
public abstract void save();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reloads the editor contents from the source component and resets the
|
|
||||||
* modified flag
|
|
||||||
*/
|
|
||||||
public void reset()
|
|
||||||
{
|
|
||||||
setComponent( getComponent() );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate contents of other editors against this component editor before
|
|
||||||
* saving. Override this method to allow controller to pass other editors
|
|
||||||
* to this editor for content inspection/validation before indicating that
|
|
||||||
* this editor passes validation. This allows for validating editor contents
|
|
||||||
* that are contingent on settings in other editors.
|
|
||||||
*
|
|
||||||
* @throws ComponentValidationException if the contents of the editor
|
|
||||||
* argument cannot be validated, with the exception containing a detailed
|
|
||||||
* description of the issue.
|
|
||||||
*/
|
|
||||||
public void validate( ComponentEditor<?> editor ) throws ComponentValidationException
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Listener interface to receive notification that the contents of the
|
|
||||||
* editor have been modified from the original component value and either
|
|
||||||
* need to be saved or reset
|
|
||||||
*/
|
|
||||||
public interface ComponentModificationListener
|
|
||||||
{
|
|
||||||
public void componentModified();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package io.github.dsheirer.alias;
|
|
||||||
|
|
||||||
public class ComponentValidationException extends Exception
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Component editor contents validation error
|
|
||||||
*/
|
|
||||||
public ComponentValidationException( String message )
|
|
||||||
{
|
|
||||||
super( message );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,466 +0,0 @@
|
|||||||
package io.github.dsheirer.alias;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasIDType;
|
|
||||||
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
|
||||||
import io.github.dsheirer.alias.id.priority.Priority;
|
|
||||||
import io.github.dsheirer.audio.broadcast.BroadcastModel;
|
|
||||||
import io.github.dsheirer.gui.editor.Editor;
|
|
||||||
import io.github.dsheirer.icon.Icon;
|
|
||||||
import io.github.dsheirer.icon.IconListCellRenderer;
|
|
||||||
import io.github.dsheirer.icon.IconManager;
|
|
||||||
import io.github.dsheirer.sample.Listener;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.event.ChangeEvent;
|
|
||||||
import javax.swing.event.ChangeListener;
|
|
||||||
import javax.swing.event.TableModelEvent;
|
|
||||||
import javax.swing.event.TableModelListener;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class MultipleAliasEditor extends Editor<List<Alias>>
|
|
||||||
implements Listener<AliasEvent>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
private final static Logger mLog = LoggerFactory.getLogger(MultipleAliasEditor.class);
|
|
||||||
|
|
||||||
private static String HELP_TEXT =
|
|
||||||
"<html>Select attributes below to change for all selected aliases</html>";
|
|
||||||
|
|
||||||
private JLabel mAliasCountLabel;
|
|
||||||
private JLabel mAliasCount;
|
|
||||||
|
|
||||||
private JCheckBox mListCheckBox = new JCheckBox("List");
|
|
||||||
private JComboBox<String> mListCombo = new JComboBox<>();
|
|
||||||
private JCheckBox mGroupCheckBox = new JCheckBox("Group");
|
|
||||||
private JComboBox<String> mGroupCombo = new JComboBox<>();
|
|
||||||
private JCheckBox mIconCheckBox = new JCheckBox("Icon");
|
|
||||||
private JComboBox<Icon> mIconCombo;
|
|
||||||
private JCheckBox mColorCheckBox = new JCheckBox("Color");
|
|
||||||
private JButton mButtonColor;
|
|
||||||
private JButton mBtnIconManager;
|
|
||||||
private JCheckBox mRecordCheckBox = new JCheckBox("Record");
|
|
||||||
private JComboBox<Record> mRecordActionCombo = new JComboBox<>(Record.values());
|
|
||||||
private JCheckBox mPriorityCheckBox = new JCheckBox("Priority");
|
|
||||||
private JSlider mPrioritySlider;
|
|
||||||
private JLabel mPrioritySliderLabel;
|
|
||||||
private JCheckBox mStreamCheckBox = new JCheckBox("Stream");
|
|
||||||
private JComboBox<String> mStreamCombo;
|
|
||||||
|
|
||||||
private AliasModel mAliasModel;
|
|
||||||
private BroadcastModel mBroadcastModel;
|
|
||||||
private IconManager mIconManager;
|
|
||||||
|
|
||||||
public MultipleAliasEditor(AliasModel aliasModel, BroadcastModel broadcastModel, IconManager iconManager)
|
|
||||||
{
|
|
||||||
mAliasModel = aliasModel;
|
|
||||||
mBroadcastModel = broadcastModel;
|
|
||||||
mIconManager = iconManager;
|
|
||||||
|
|
||||||
mAliasModel.addListener(this);
|
|
||||||
mIconManager.getModel().addTableModelListener(new TableModelListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void tableChanged(TableModelEvent e)
|
|
||||||
{
|
|
||||||
refreshIcons();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Alias> getAliases()
|
|
||||||
{
|
|
||||||
if (hasItem())
|
|
||||||
{
|
|
||||||
return (List<Alias>) getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init()
|
|
||||||
{
|
|
||||||
setLayout(new MigLayout("fill,wrap 2", "[grow,fill][grow,fill]",
|
|
||||||
"[][][][][][][][][][][][][][grow,fill]"));
|
|
||||||
|
|
||||||
mAliasCountLabel = new JLabel("Alias:");
|
|
||||||
add(mAliasCountLabel);
|
|
||||||
|
|
||||||
mAliasCount = new JLabel("Multiple");
|
|
||||||
add(mAliasCount, "span");
|
|
||||||
|
|
||||||
add(new JSeparator(), "span");
|
|
||||||
|
|
||||||
add(new JLabel(HELP_TEXT), "span");
|
|
||||||
|
|
||||||
add(mListCheckBox);
|
|
||||||
|
|
||||||
mListCombo.setEditable(true);
|
|
||||||
add(mListCombo, "wrap");
|
|
||||||
|
|
||||||
add(mGroupCheckBox);
|
|
||||||
|
|
||||||
mGroupCombo.setEditable(true);
|
|
||||||
add(mGroupCombo, "wrap");
|
|
||||||
|
|
||||||
add(mColorCheckBox);
|
|
||||||
|
|
||||||
mButtonColor = new JButton("Select ...");
|
|
||||||
mButtonColor.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
Color newColor = JColorChooser.showDialog(
|
|
||||||
MultipleAliasEditor.this,
|
|
||||||
"Choose color for this alias", null);
|
|
||||||
|
|
||||||
if (newColor != null)
|
|
||||||
{
|
|
||||||
mButtonColor.setForeground(newColor);
|
|
||||||
mButtonColor.setBackground(newColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(mButtonColor, "wrap");
|
|
||||||
|
|
||||||
add(mIconCheckBox);
|
|
||||||
|
|
||||||
mIconCombo = new JComboBox<Icon>(mIconManager.getIcons());
|
|
||||||
|
|
||||||
IconListCellRenderer renderer = new IconListCellRenderer(mIconManager);
|
|
||||||
renderer.setPreferredSize(new Dimension(200, 30));
|
|
||||||
mIconCombo.setRenderer(renderer);
|
|
||||||
add(mIconCombo, "wrap");
|
|
||||||
|
|
||||||
//Dummy place holder
|
|
||||||
add(new JLabel());
|
|
||||||
|
|
||||||
mBtnIconManager = new JButton("Icon Manager");
|
|
||||||
mBtnIconManager.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent arg0)
|
|
||||||
{
|
|
||||||
mIconManager.showEditor(MultipleAliasEditor.this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
add(mBtnIconManager, "span,wrap");
|
|
||||||
|
|
||||||
add(mRecordCheckBox);
|
|
||||||
add(mRecordActionCombo);
|
|
||||||
|
|
||||||
//Placeholder
|
|
||||||
add(new JLabel(" "));
|
|
||||||
mPrioritySliderLabel = new JLabel("Audio Priority: " + Priority.MIN_PRIORITY);
|
|
||||||
add(mPrioritySliderLabel);
|
|
||||||
|
|
||||||
add(mPriorityCheckBox);
|
|
||||||
|
|
||||||
mPrioritySlider = new JSlider(JSlider.HORIZONTAL,
|
|
||||||
Priority.MIN_PRIORITY,
|
|
||||||
Priority.MAX_PRIORITY + 1,
|
|
||||||
Priority.MIN_PRIORITY);
|
|
||||||
|
|
||||||
mPrioritySlider.setMajorTickSpacing(20);
|
|
||||||
mPrioritySlider.setMinorTickSpacing(5);
|
|
||||||
mPrioritySlider.setPaintTicks(true);
|
|
||||||
mPrioritySlider.setLabelTable(mPrioritySlider.createStandardLabels(25, 25));
|
|
||||||
mPrioritySlider.setPaintLabels(true);
|
|
||||||
mPrioritySlider.addChangeListener(new ChangeListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void stateChanged(ChangeEvent e)
|
|
||||||
{
|
|
||||||
int priority = mPrioritySlider.getValue();
|
|
||||||
|
|
||||||
if (priority > Priority.MAX_PRIORITY)
|
|
||||||
{
|
|
||||||
mPrioritySliderLabel.setText("Audio Priority: Do Not Monitor");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mPrioritySliderLabel.setText("Audio Priority: " + mPrioritySlider.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mPrioritySlider.setToolTipText(HELP_TEXT);
|
|
||||||
|
|
||||||
add(mPrioritySlider);
|
|
||||||
|
|
||||||
add(mStreamCheckBox);
|
|
||||||
|
|
||||||
mStreamCombo = new JComboBox<String>();
|
|
||||||
mStreamCombo.setEditable(true);
|
|
||||||
add(mStreamCombo, "wrap");
|
|
||||||
|
|
||||||
JButton saveButton = new JButton("Save");
|
|
||||||
saveButton.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(saveButton);
|
|
||||||
|
|
||||||
JButton resetButton = new JButton("Reset");
|
|
||||||
resetButton.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(resetButton);
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void refreshIcons()
|
|
||||||
{
|
|
||||||
if(mIconCombo != null)
|
|
||||||
{
|
|
||||||
EventQueue.invokeLater(new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
mIconCombo.setModel(new DefaultComboBoxModel<>(mIconManager.getIcons()));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem(List<Alias> item)
|
|
||||||
{
|
|
||||||
super.setItem(item);
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("Multiple Selected [ ");
|
|
||||||
|
|
||||||
if (hasItem())
|
|
||||||
{
|
|
||||||
sb.append(String.valueOf(getAliases().size()));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sb.append("0");
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.append(" ]");
|
|
||||||
|
|
||||||
mAliasCount.setText(sb.toString());
|
|
||||||
|
|
||||||
List<String> listNames = mAliasModel.getListNames();
|
|
||||||
listNames.add(0, "");
|
|
||||||
mListCombo.setModel(new DefaultComboBoxModel<String>(
|
|
||||||
listNames.toArray(new String[listNames.size()])));
|
|
||||||
|
|
||||||
List<String> groupNames = mAliasModel.getGroupNames();
|
|
||||||
groupNames.add(0, "");
|
|
||||||
mGroupCombo.setModel(new DefaultComboBoxModel<String>(
|
|
||||||
groupNames.toArray(new String[groupNames.size()])));
|
|
||||||
|
|
||||||
List<String> streamNames = mBroadcastModel.getBroadcastConfigurationNames();
|
|
||||||
mStreamCombo.setModel(new DefaultComboBoxModel<String>(streamNames.toArray(new String[streamNames.size()])));
|
|
||||||
|
|
||||||
mIconCombo.setModel(new DefaultComboBoxModel<>(mIconManager.getIcons()));
|
|
||||||
|
|
||||||
setCheckBoxesUnselected();
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setCheckBoxesUnselected()
|
|
||||||
{
|
|
||||||
mListCheckBox.setSelected(false);
|
|
||||||
mGroupCheckBox.setSelected(false);
|
|
||||||
mColorCheckBox.setSelected(false);
|
|
||||||
mIconCheckBox.setSelected(false);
|
|
||||||
mRecordCheckBox.setSelected(false);
|
|
||||||
mPriorityCheckBox.setSelected(false);
|
|
||||||
mStreamCheckBox.setSelected(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void reset()
|
|
||||||
{
|
|
||||||
List<String> listNames = mAliasModel.getListNames();
|
|
||||||
listNames.add(0, "");
|
|
||||||
mListCombo.setModel(new DefaultComboBoxModel<String>(
|
|
||||||
listNames.toArray(new String[listNames.size()])));
|
|
||||||
|
|
||||||
List<String> groupNames = mAliasModel.getGroupNames();
|
|
||||||
groupNames.add(0, "");
|
|
||||||
mGroupCombo.setModel(new DefaultComboBoxModel<String>(
|
|
||||||
groupNames.toArray(new String[groupNames.size()])));
|
|
||||||
|
|
||||||
mButtonColor.setForeground(getForeground());
|
|
||||||
mButtonColor.setBackground(getBackground());
|
|
||||||
|
|
||||||
super.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean hasRequestedChanges()
|
|
||||||
{
|
|
||||||
return mListCheckBox.isSelected() ||
|
|
||||||
mGroupCheckBox.isSelected() ||
|
|
||||||
mColorCheckBox.isSelected() ||
|
|
||||||
mIconCheckBox.isSelected() ||
|
|
||||||
mRecordCheckBox.isSelected() ||
|
|
||||||
mPriorityCheckBox.isSelected() ||
|
|
||||||
mStreamCheckBox.isSelected();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
if (hasRequestedChanges() && hasItem())
|
|
||||||
{
|
|
||||||
List<Alias> aliases = getAliases();
|
|
||||||
|
|
||||||
for (Alias alias : aliases)
|
|
||||||
{
|
|
||||||
if (mListCheckBox.isSelected())
|
|
||||||
{
|
|
||||||
String list = null;
|
|
||||||
|
|
||||||
if (mListCombo.getSelectedItem() != null)
|
|
||||||
{
|
|
||||||
list = (String) mListCombo.getSelectedItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
alias.setList(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mGroupCheckBox.isSelected())
|
|
||||||
{
|
|
||||||
String group = null;
|
|
||||||
|
|
||||||
if (mGroupCombo.getSelectedItem() != null)
|
|
||||||
{
|
|
||||||
group = (String) mGroupCombo.getSelectedItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
alias.setGroup(group);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mColorCheckBox.isSelected())
|
|
||||||
{
|
|
||||||
alias.setColor(mButtonColor.getForeground().getRGB());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mIconCheckBox.isSelected())
|
|
||||||
{
|
|
||||||
if (mIconCombo.getSelectedItem() != null)
|
|
||||||
{
|
|
||||||
alias.setIconName(((Icon)mIconCombo.getSelectedItem()).getName());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
alias.setIconName(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mRecordCheckBox.isSelected())
|
|
||||||
{
|
|
||||||
Record action =
|
|
||||||
(Record) mRecordActionCombo.getSelectedItem();
|
|
||||||
|
|
||||||
alias.setRecordable(action == Record.RECORDABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mPriorityCheckBox.isSelected())
|
|
||||||
{
|
|
||||||
int priority = mPrioritySlider.getValue();
|
|
||||||
|
|
||||||
//This is a work-around -- we use max priority + 1 in the
|
|
||||||
//gui to indicate do not monitor, and change the value here
|
|
||||||
if (priority == Priority.MAX_PRIORITY + 1)
|
|
||||||
{
|
|
||||||
priority = Priority.DO_NOT_MONITOR;
|
|
||||||
}
|
|
||||||
|
|
||||||
alias.setCallPriority(priority);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mStreamCheckBox.isSelected())
|
|
||||||
{
|
|
||||||
if(mStreamCombo.getSelectedItem() != null)
|
|
||||||
{
|
|
||||||
String streamName = (String)mStreamCombo.getSelectedItem();
|
|
||||||
|
|
||||||
boolean hasChannel = false;
|
|
||||||
|
|
||||||
//Ensure the alias doesn't already have the channel
|
|
||||||
for(BroadcastChannel channel: alias.getBroadcastChannels())
|
|
||||||
{
|
|
||||||
if(channel.getChannelName().equals(streamName))
|
|
||||||
{
|
|
||||||
hasChannel = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!hasChannel)
|
|
||||||
{
|
|
||||||
BroadcastChannel channel = (BroadcastChannel)AliasFactory
|
|
||||||
.getAliasID(AliasIDType.BROADCAST_CHANNEL);
|
|
||||||
|
|
||||||
channel.setChannelName(streamName);
|
|
||||||
alias.addAliasID(channel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Alias alias : aliases)
|
|
||||||
{
|
|
||||||
//Broadcast an alias change event to save the updates
|
|
||||||
mAliasModel.broadcast(new AliasEvent(alias, AliasEvent.Event.CHANGE));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void receive(AliasEvent event)
|
|
||||||
{
|
|
||||||
if (event.getEvent() == AliasEvent.Event.DELETE &&
|
|
||||||
hasItem() &&
|
|
||||||
getAliases().contains(event.getAlias()))
|
|
||||||
{
|
|
||||||
getAliases().remove(event.getAlias());
|
|
||||||
setItem(getAliases());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum Record
|
|
||||||
{
|
|
||||||
NON_RECORDABLE("Non-Recordable"),
|
|
||||||
RECORDABLE("Recordable");
|
|
||||||
|
|
||||||
private String mLabel;
|
|
||||||
|
|
||||||
private Record(String label)
|
|
||||||
{
|
|
||||||
mLabel = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return mLabel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
571
src/main/java/io/github/dsheirer/alias/TalkerAliasAutoAdder.java
Normal file
571
src/main/java/io/github/dsheirer/alias/TalkerAliasAutoAdder.java
Normal file
@@ -0,0 +1,571 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.alias;
|
||||||
|
|
||||||
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
|
import io.github.dsheirer.alias.id.AliasID;
|
||||||
|
import io.github.dsheirer.alias.id.radio.NXDNTypeDRadio;
|
||||||
|
import io.github.dsheirer.alias.id.radio.P25FullyQualifiedRadio;
|
||||||
|
import io.github.dsheirer.alias.id.radio.Radio;
|
||||||
|
import io.github.dsheirer.identifier.alias.TalkerAliasIdentifier;
|
||||||
|
import io.github.dsheirer.identifier.radio.FullyQualifiedRadioIdentifier;
|
||||||
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
|
import io.github.dsheirer.module.decode.nxdn.identifier.NXDNRadioIdentifier;
|
||||||
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
import javafx.application.Platform;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Automatically adds decoded talker aliases to an alias list as radio aliases, using the talker alias as the alias name,
|
||||||
|
* and renames a stored radio alias when the radio's talker alias changes.
|
||||||
|
*
|
||||||
|
* Talker aliases span up to 4 messages, so a decoded talker alias can be a fragment (the leading characters) of the
|
||||||
|
* full alias, even when the decoder reports it as complete. To avoid replacing a full alias with a fragment:
|
||||||
|
* <ul>
|
||||||
|
* <li>A decoded alias that is the start of the stored alias name is a fragment and never replaces it.</li>
|
||||||
|
* <li>A decoded alias that starts with the stored alias name is a longer version of a stored fragment and
|
||||||
|
* replaces it.</li>
|
||||||
|
* <li>Any other decoded alias that differs from the stored alias name replaces it only after it is decoded
|
||||||
|
* {@link #CONFIRMATIONS_REQUIRED} times in a row for the radio.</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* Only aliases whose only identifier is the radio are created or renamed. An alias that combines the radio with other
|
||||||
|
* identifiers (e.g. several radios or talkgroups) is left alone. The exception is a P25 radio's simple and fully
|
||||||
|
* qualified radio identifiers with the same radio ID: the second form decoded is added to the alias for the first
|
||||||
|
* form, including a user alias outside the managed group, instead of creating a second alias for the same radio.
|
||||||
|
*
|
||||||
|
* This class is thread safe. Talker aliases are received on decoder threads and the alias model is updated on the
|
||||||
|
* JavaFX application thread.
|
||||||
|
*/
|
||||||
|
public class TalkerAliasAutoAdder implements BiConsumer<RadioIdentifier,TalkerAliasIdentifier>
|
||||||
|
{
|
||||||
|
private static final Logger mLog = LoggerFactory.getLogger(TalkerAliasAutoAdder.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Group assigned to aliases created from talker aliases.
|
||||||
|
*/
|
||||||
|
public static final String ALIAS_GROUP = "Talker Alias";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of consecutive times a different talker alias must be decoded for a radio before it replaces the stored
|
||||||
|
* alias name.
|
||||||
|
*/
|
||||||
|
public static final int CONFIRMATIONS_REQUIRED = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interval for re-checking the stored alias for a talker alias that was already checked, so that a renamed or
|
||||||
|
* deleted alias is restored without checking the alias list for every decoded talker alias.
|
||||||
|
*/
|
||||||
|
private static final long RECHECK_INTERVAL_MS = 30_000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Outcome of comparing a decoded talker alias with the stored alias name.
|
||||||
|
*/
|
||||||
|
public enum Decision
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The stored alias name matches the talker alias.
|
||||||
|
*/
|
||||||
|
UNCHANGED,
|
||||||
|
/**
|
||||||
|
* The talker alias is a fragment of the stored alias name.
|
||||||
|
*/
|
||||||
|
FRAGMENT,
|
||||||
|
/**
|
||||||
|
* The talker alias differs from the stored alias name and is waiting for more decodes.
|
||||||
|
*/
|
||||||
|
AWAIT_CONFIRMATION,
|
||||||
|
/**
|
||||||
|
* The talker alias replaces the stored alias name.
|
||||||
|
*/
|
||||||
|
UPDATE
|
||||||
|
}
|
||||||
|
|
||||||
|
private final AliasModel mAliasModel;
|
||||||
|
private final String mAliasListName;
|
||||||
|
//Guarded by this
|
||||||
|
private final Map<String,Candidate> mCandidates = new HashMap<>();
|
||||||
|
private final Map<String,Checked> mChecked = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
* @param aliasModel to add aliases to
|
||||||
|
* @param aliasListName of the alias list to add aliases to
|
||||||
|
*/
|
||||||
|
public TalkerAliasAutoAdder(AliasModel aliasModel, String aliasListName)
|
||||||
|
{
|
||||||
|
mAliasModel = aliasModel;
|
||||||
|
mAliasListName = aliasListName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the alias list that talker aliases are added to.
|
||||||
|
*/
|
||||||
|
public String getAliasListName()
|
||||||
|
{
|
||||||
|
return mAliasListName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Processes a talker alias that is assigned to a radio.
|
||||||
|
* @param radio that the talker alias belongs to
|
||||||
|
* @param talkerAlias for the radio
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void accept(RadioIdentifier radio, TalkerAliasIdentifier talkerAlias)
|
||||||
|
{
|
||||||
|
if(radio == null || talkerAlias == null || mAliasListName == null || mAliasListName.isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String value = normalize(talkerAlias.getValue());
|
||||||
|
Radio aliasId = createAliasId(radio);
|
||||||
|
|
||||||
|
if(value == null || aliasId == null || !aliasId.isValid())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String key = getKey(aliasId);
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
int confirmations;
|
||||||
|
|
||||||
|
synchronized(this)
|
||||||
|
{
|
||||||
|
Checked checked = mChecked.get(key);
|
||||||
|
|
||||||
|
if(checked != null && checked.value().equals(value) && (now - checked.timestamp()) < RECHECK_INTERVAL_MS)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
confirmations = confirm(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
runOnFxThread(() -> apply(radio, aliasId, key, value, confirmations));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Counts the consecutive decodes of the talker alias for the radio. A fragment of the talker alias that is
|
||||||
|
* waiting for confirmation doesn't interrupt the count, because fragments are decoded while the full alias is
|
||||||
|
* assembled.
|
||||||
|
* @return number of consecutive decodes of the value, including this one.
|
||||||
|
*/
|
||||||
|
private int confirm(String key, String value)
|
||||||
|
{
|
||||||
|
Candidate candidate = mCandidates.get(key);
|
||||||
|
|
||||||
|
if(candidate != null && candidate.value().equals(value))
|
||||||
|
{
|
||||||
|
candidate = new Candidate(value, candidate.count() + 1);
|
||||||
|
mCandidates.put(key, candidate);
|
||||||
|
return candidate.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(candidate != null && isFragment(value, candidate.value()))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
mCandidates.put(key, new Candidate(value, 1));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates or updates the alias for the radio. Runs on the JavaFX application thread.
|
||||||
|
*/
|
||||||
|
private synchronized void apply(RadioIdentifier radio, Radio aliasId, String key, String value, int confirmations)
|
||||||
|
{
|
||||||
|
AliasList aliasList = mAliasModel.getAliasList(mAliasListName);
|
||||||
|
Alias existing = findExactMatch(aliasList.getAliases(radio), aliasId);
|
||||||
|
|
||||||
|
if(existing == null)
|
||||||
|
{
|
||||||
|
existing = findCompanion(aliasList.aliases(), radio, aliasId);
|
||||||
|
|
||||||
|
if(existing != null)
|
||||||
|
{
|
||||||
|
//Add the radio to the alias for the same radio's other identifier form, then continue below to
|
||||||
|
//compare the talker alias with the alias name (only managed aliases are renamed).
|
||||||
|
existing.addAliasID(aliasId);
|
||||||
|
aliasList.updateAlias(existing);
|
||||||
|
mLog.info("Talker alias radio [" + aliasId + "] added to existing alias [" + existing.getName() +
|
||||||
|
"] in alias list [" + mAliasListName + "]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(existing == null)
|
||||||
|
{
|
||||||
|
Alias alias = new Alias(value);
|
||||||
|
alias.setAliasListName(mAliasListName);
|
||||||
|
alias.setGroup(ALIAS_GROUP);
|
||||||
|
alias.addAliasID(aliasId);
|
||||||
|
mAliasModel.addAlias(alias);
|
||||||
|
markChecked(key, value);
|
||||||
|
mLog.info("Talker alias [" + value + "] added for radio [" + aliasId + "] to alias list [" +
|
||||||
|
mAliasListName + "]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!ALIAS_GROUP.equals(existing.getGroup()))
|
||||||
|
{
|
||||||
|
//Only maintain aliases in the managed group. Existing user aliases must not be renamed or duplicated.
|
||||||
|
markChecked(key, value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getIdentityCount(existing) > 1)
|
||||||
|
{
|
||||||
|
//The alias also identifies other radios or talkgroups - leave it alone.
|
||||||
|
markChecked(key, value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String stored = normalize(existing.getName());
|
||||||
|
|
||||||
|
switch(decide(stored, value, confirmations))
|
||||||
|
{
|
||||||
|
case UPDATE:
|
||||||
|
existing.setName(value);
|
||||||
|
markChecked(key, value);
|
||||||
|
mLog.info("Talker alias for radio [" + aliasId + "] in alias list [" + mAliasListName +
|
||||||
|
"] changed from [" + stored + "] to [" + value + "]");
|
||||||
|
break;
|
||||||
|
case UNCHANGED:
|
||||||
|
case FRAGMENT:
|
||||||
|
markChecked(key, value);
|
||||||
|
break;
|
||||||
|
case AWAIT_CONFIRMATION:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void markChecked(String key, String value)
|
||||||
|
{
|
||||||
|
mChecked.put(key, new Checked(value, System.currentTimeMillis()));
|
||||||
|
mCandidates.remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compares the decoded talker alias with the stored alias name.
|
||||||
|
* @param stored alias name, normalized, or null
|
||||||
|
* @param decoded talker alias, normalized
|
||||||
|
* @param confirmations number of consecutive decodes of the talker alias
|
||||||
|
* @return decision
|
||||||
|
*/
|
||||||
|
@VisibleForTesting
|
||||||
|
static Decision decide(String stored, String decoded, int confirmations)
|
||||||
|
{
|
||||||
|
if(stored == null || stored.isEmpty())
|
||||||
|
{
|
||||||
|
return Decision.UPDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(stored.equals(decoded))
|
||||||
|
{
|
||||||
|
return Decision.UNCHANGED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFragment(decoded, stored))
|
||||||
|
{
|
||||||
|
return Decision.FRAGMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
//A longer version of a stored fragment.
|
||||||
|
if(isFragment(stored, decoded) && !hasUndecodableCharacters(decoded))
|
||||||
|
{
|
||||||
|
return Decision.UPDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//A different alias that may be a corrupted or mis-assembled alias. It's replaced only once confirmed, and an
|
||||||
|
//alias that has undecodable characters (e.g. a partial multi-byte character) never replaces a stored alias.
|
||||||
|
if(confirmations >= CONFIRMATIONS_REQUIRED && !hasUndecodableCharacters(decoded))
|
||||||
|
{
|
||||||
|
return Decision.UPDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Decision.AWAIT_CONFIRMATION;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the value is a fragment (the leading characters) of the full value.
|
||||||
|
*/
|
||||||
|
@VisibleForTesting
|
||||||
|
static boolean isFragment(String value, String full)
|
||||||
|
{
|
||||||
|
return value != null && full != null && value.length() < full.length() && full.startsWith(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean hasUndecodableCharacters(String value)
|
||||||
|
{
|
||||||
|
return value.indexOf('<27>') >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes padding, control characters and trailing undecodable characters (e.g. from a partial multi-byte
|
||||||
|
* character at the end of an alias fragment) from the talker alias.
|
||||||
|
* @param value to normalize
|
||||||
|
* @return normalized value or null if the value is empty.
|
||||||
|
*/
|
||||||
|
@VisibleForTesting
|
||||||
|
static String normalize(String value)
|
||||||
|
{
|
||||||
|
if(value == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder(value.length());
|
||||||
|
|
||||||
|
for(int i = 0; i < value.length(); i++)
|
||||||
|
{
|
||||||
|
char c = value.charAt(i);
|
||||||
|
|
||||||
|
if(!Character.isISOControl(c))
|
||||||
|
{
|
||||||
|
sb.append(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int end = sb.length();
|
||||||
|
|
||||||
|
while(end > 0 && (sb.charAt(end - 1) == '<27>' || Character.isWhitespace(sb.charAt(end - 1))))
|
||||||
|
{
|
||||||
|
end--;
|
||||||
|
}
|
||||||
|
|
||||||
|
String normalized = sb.substring(0, end).trim();
|
||||||
|
return normalized.isEmpty() ? null : normalized;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a radio alias identifier that exactly matches the radio.
|
||||||
|
* @param radio identifier
|
||||||
|
* @return alias identifier or null if the radio protocol isn't known.
|
||||||
|
*/
|
||||||
|
@VisibleForTesting
|
||||||
|
static Radio createAliasId(RadioIdentifier radio)
|
||||||
|
{
|
||||||
|
if(radio instanceof FullyQualifiedRadioIdentifier fqri && fqri.getProtocol() == Protocol.APCO25)
|
||||||
|
{
|
||||||
|
return new P25FullyQualifiedRadio(fqri.getWacn(), fqri.getSystem(), fqri.getRadio());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(radio instanceof NXDNRadioIdentifier nxdn && nxdn.isTypeD())
|
||||||
|
{
|
||||||
|
return new NXDNTypeDRadio(nxdn.getTypeDHomeRepeater(), nxdn.getTypeDRadio());
|
||||||
|
}
|
||||||
|
|
||||||
|
Protocol protocol = radio.getProtocol();
|
||||||
|
|
||||||
|
if(protocol == null || protocol == Protocol.UNKNOWN || radio.getValue() == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Radio(protocol, radio.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the alias that has an identifier that exactly matches the radio (i.e. not a radio range).
|
||||||
|
*/
|
||||||
|
@VisibleForTesting
|
||||||
|
static Alias findExactMatch(List<Alias> aliases, Radio aliasId)
|
||||||
|
{
|
||||||
|
if(aliases != null)
|
||||||
|
{
|
||||||
|
for(Alias alias: aliases)
|
||||||
|
{
|
||||||
|
for(AliasID id: alias.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(isExactMatch(id, aliasId))
|
||||||
|
{
|
||||||
|
return alias;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isExactMatch(AliasID id, Radio aliasId)
|
||||||
|
{
|
||||||
|
if(aliasId instanceof P25FullyQualifiedRadio target)
|
||||||
|
{
|
||||||
|
return id instanceof P25FullyQualifiedRadio fqr && fqr.getHashKey().equals(target.getHashKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
return id instanceof Radio radio && !(id instanceof P25FullyQualifiedRadio) &&
|
||||||
|
radio.getProtocol() == aliasId.getProtocol() && radio.getValue() == aliasId.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the alias for the other identifier form of a P25 radio, so that a radio's simple and fully qualified
|
||||||
|
* identifiers share one alias instead of creating an alias for each. This includes user aliases outside the
|
||||||
|
* managed group, so that either identifier maps to the user's alias. The user alias is never renamed.
|
||||||
|
* <ul>
|
||||||
|
* <li>Fully qualified radio: the alias whose only identifier is the simple radio with the same radio
|
||||||
|
* ID. Only when the fully qualified radio isn't using a different local address (e.g. a roaming radio), since
|
||||||
|
* the radio ID then belongs to the home system and doesn't identify the radio on this system.</li>
|
||||||
|
* <li>Simple radio: the alias whose only identifier is a fully qualified radio with the same radio ID. None
|
||||||
|
* when more than one fully qualified radio alias matches.</li>
|
||||||
|
* </ul>
|
||||||
|
* @param aliases to search
|
||||||
|
* @param radio decoded radio identifier
|
||||||
|
* @param aliasId created from the decoded radio
|
||||||
|
* @return companion alias or null.
|
||||||
|
*/
|
||||||
|
@VisibleForTesting
|
||||||
|
static Alias findCompanion(List<Alias> aliases, RadioIdentifier radio, Radio aliasId)
|
||||||
|
{
|
||||||
|
if(aliases == null || aliasId.getProtocol() != Protocol.APCO25)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean fullyQualified = aliasId instanceof P25FullyQualifiedRadio;
|
||||||
|
|
||||||
|
if(fullyQualified && !(radio instanceof FullyQualifiedRadioIdentifier fqri &&
|
||||||
|
fqri.getValue() != null && fqri.getValue() == fqri.getRadio()))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Alias match = null;
|
||||||
|
|
||||||
|
for(Alias alias: aliases)
|
||||||
|
{
|
||||||
|
if(getSoleIdentity(alias) instanceof Radio candidate &&
|
||||||
|
(candidate instanceof P25FullyQualifiedRadio) != fullyQualified &&
|
||||||
|
candidate.getProtocol() == Protocol.APCO25 && candidate.getValue() == aliasId.getValue())
|
||||||
|
{
|
||||||
|
if(match != null)
|
||||||
|
{
|
||||||
|
//Ambiguous - more than one candidate.
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
match = alias;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Identifier of an alias that has exactly one identifier, excluding audio settings.
|
||||||
|
* @return identifier or null if the alias has none or more than one.
|
||||||
|
*/
|
||||||
|
private static AliasID getSoleIdentity(Alias alias)
|
||||||
|
{
|
||||||
|
AliasID sole = null;
|
||||||
|
|
||||||
|
for(AliasID id: alias.getAliasIdentifiers())
|
||||||
|
{
|
||||||
|
if(!id.isAudioIdentifier())
|
||||||
|
{
|
||||||
|
if(sole != null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
sole = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sole;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of identities (e.g. radios, talkgroups) in the alias, excluding audio settings like priority, record and
|
||||||
|
* streaming. A P25 radio's simple and fully qualified radio identifiers with the same radio ID count as one
|
||||||
|
* identity.
|
||||||
|
*/
|
||||||
|
private static int getIdentityCount(Alias alias)
|
||||||
|
{
|
||||||
|
List<AliasID> ids = alias.getAliasIdentifiers().stream().filter(id -> !id.isAudioIdentifier()).toList();
|
||||||
|
|
||||||
|
if(ids.size() == 2 && isRadioPair(ids.get(0), ids.get(1)))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ids.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the identifiers are the simple and fully qualified forms of the same P25 radio ID.
|
||||||
|
*/
|
||||||
|
private static boolean isRadioPair(AliasID a, AliasID b)
|
||||||
|
{
|
||||||
|
if(a instanceof P25FullyQualifiedRadio)
|
||||||
|
{
|
||||||
|
AliasID swap = a;
|
||||||
|
a = b;
|
||||||
|
b = swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
return a instanceof Radio simple && !(a instanceof P25FullyQualifiedRadio) &&
|
||||||
|
b instanceof P25FullyQualifiedRadio fqr && simple.getProtocol() == Protocol.APCO25 &&
|
||||||
|
simple.getValue() == fqr.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getKey(Radio aliasId)
|
||||||
|
{
|
||||||
|
if(aliasId instanceof P25FullyQualifiedRadio fqr)
|
||||||
|
{
|
||||||
|
return aliasId.getProtocol() + ":" + fqr.getHashKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
return aliasId.getProtocol() + ":" + aliasId.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs on the FX thread, or on this thread when the FX toolkit isn't running (headless).
|
||||||
|
*/
|
||||||
|
private static void runOnFxThread(Runnable runnable)
|
||||||
|
{
|
||||||
|
if(Platform.isFxApplicationThread())
|
||||||
|
{
|
||||||
|
runnable.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Platform.runLater(runnable);
|
||||||
|
}
|
||||||
|
catch(IllegalStateException ise)
|
||||||
|
{
|
||||||
|
runnable.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private record Candidate(String value, int count) {}
|
||||||
|
private record Checked(String value, long timestamp) {}
|
||||||
|
}
|
||||||
@@ -27,6 +27,9 @@ import io.github.dsheirer.alias.action.beep.BeepAction;
|
|||||||
import io.github.dsheirer.alias.action.clip.ClipAction;
|
import io.github.dsheirer.alias.action.clip.ClipAction;
|
||||||
import io.github.dsheirer.alias.action.script.ScriptAction;
|
import io.github.dsheirer.alias.action.script.ScriptAction;
|
||||||
import io.github.dsheirer.message.IMessage;
|
import io.github.dsheirer.message.IMessage;
|
||||||
|
import javafx.beans.Observable;
|
||||||
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
|
import javafx.util.Callback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alias action defines an action to execute when an alias is detected active.
|
* Alias action defines an action to execute when an alias is detected active.
|
||||||
@@ -41,10 +44,33 @@ import io.github.dsheirer.message.IMessage;
|
|||||||
@JacksonXmlRootElement(localName = "action")
|
@JacksonXmlRootElement(localName = "action")
|
||||||
public abstract class AliasAction
|
public abstract class AliasAction
|
||||||
{
|
{
|
||||||
|
private SimpleStringProperty mValueProperty = new SimpleStringProperty();
|
||||||
|
|
||||||
public AliasAction()
|
public AliasAction()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String property representation of this alias ID
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public SimpleStringProperty valueProperty()
|
||||||
|
{
|
||||||
|
return mValueProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the value property for this alias ID. Note: this method is intended to be invoked by all subclasses
|
||||||
|
* each time that any of the subclass member variable values change.
|
||||||
|
*/
|
||||||
|
public void updateValueProperty()
|
||||||
|
{
|
||||||
|
valueProperty().set(toString());
|
||||||
|
|
||||||
|
//Hack: harmless, but the list extractor does not consistently update unless we do this.
|
||||||
|
valueProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public abstract AliasActionType getType();
|
public abstract AliasActionType getType();
|
||||||
|
|
||||||
@@ -60,4 +86,12 @@ public abstract class AliasAction
|
|||||||
* Dismiss a persistent alias action
|
* Dismiss a persistent alias action
|
||||||
*/
|
*/
|
||||||
public abstract void dismiss(boolean reset);
|
public abstract void dismiss(boolean reset);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an observable property extractor for use with observable lists to detect changes internal to this object.
|
||||||
|
*/
|
||||||
|
public static Callback<AliasAction,Observable[]> extractor()
|
||||||
|
{
|
||||||
|
return (AliasAction aliasAction) -> new Observable[] {aliasAction.valueProperty()};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,339 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.action;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.Alias;
|
|
||||||
import io.github.dsheirer.alias.AliasEvent;
|
|
||||||
import io.github.dsheirer.alias.AliasEvent.Event;
|
|
||||||
import io.github.dsheirer.alias.AliasFactory;
|
|
||||||
import io.github.dsheirer.alias.AliasModel;
|
|
||||||
import io.github.dsheirer.gui.editor.Editor;
|
|
||||||
import io.github.dsheirer.gui.editor.EmptyEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.event.ListSelectionEvent;
|
|
||||||
import javax.swing.event.ListSelectionListener;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class AliasActionEditor extends Editor<Alias>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static ListModel<AliasAction> EMPTY_MODEL = new DefaultListModel<>();
|
|
||||||
private JList<AliasAction> mAliasActionList = new JList<>( EMPTY_MODEL );
|
|
||||||
private JButton mNewActionButton;
|
|
||||||
private JButton mCloneActionButton;
|
|
||||||
private JButton mDeleteActionButton;
|
|
||||||
private EditorContainer mEditorContainer = new EditorContainer();
|
|
||||||
|
|
||||||
private AliasModel mAliasModel;
|
|
||||||
|
|
||||||
public AliasActionEditor( AliasModel model )
|
|
||||||
{
|
|
||||||
mAliasModel = model;
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 3",
|
|
||||||
"[grow,fill][grow,fill][grow,fill]", "[][grow,fill][]" ) );
|
|
||||||
|
|
||||||
mAliasActionList.setVisibleRowCount( 6 );
|
|
||||||
mAliasActionList.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
|
|
||||||
mAliasActionList.setLayoutOrientation( JList.VERTICAL );
|
|
||||||
mAliasActionList.addListSelectionListener( new ListSelectionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void valueChanged( ListSelectionEvent event )
|
|
||||||
{
|
|
||||||
if( !event.getValueIsAdjusting() )
|
|
||||||
{
|
|
||||||
JList<?> list = (JList<?>)event.getSource();
|
|
||||||
|
|
||||||
Object selectedItem = list.getSelectedValue();
|
|
||||||
|
|
||||||
if( selectedItem != null && selectedItem instanceof AliasAction )
|
|
||||||
{
|
|
||||||
AliasAction selected = (AliasAction)selectedItem;
|
|
||||||
|
|
||||||
mEditorContainer.setAliasAction( selected );
|
|
||||||
|
|
||||||
mCloneActionButton.setEnabled( true );
|
|
||||||
mDeleteActionButton.setEnabled( true );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mCloneActionButton.setEnabled( false );
|
|
||||||
mDeleteActionButton.setEnabled( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
JScrollPane scroller = new JScrollPane( mAliasActionList );
|
|
||||||
add( scroller, "span,grow" );
|
|
||||||
|
|
||||||
add( mEditorContainer, "span,grow" );
|
|
||||||
|
|
||||||
mNewActionButton = new JButton( "New ..." );
|
|
||||||
mNewActionButton.setToolTipText( "Create a new Alias Action" );
|
|
||||||
mNewActionButton.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JPopupMenu menu = new JPopupMenu();
|
|
||||||
|
|
||||||
menu.add( new AddAliasActionItem( AliasActionType.BEEP ) );
|
|
||||||
menu.add( new AddAliasActionItem( AliasActionType.CLIP ) );
|
|
||||||
menu.add( new AddAliasActionItem( AliasActionType.SCRIPT ) );
|
|
||||||
|
|
||||||
menu.show( e.getComponent(), e.getX(), e.getY() );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
add( mNewActionButton );
|
|
||||||
|
|
||||||
mCloneActionButton = new JButton( "Clone" );
|
|
||||||
mCloneActionButton.setToolTipText( "Create a copy of the currently selected action" );
|
|
||||||
mCloneActionButton.setEnabled( false );
|
|
||||||
mCloneActionButton.addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
AliasAction selected = mAliasActionList.getSelectedValue();
|
|
||||||
|
|
||||||
if( selected != null )
|
|
||||||
{
|
|
||||||
AliasAction clone = AliasFactory.copyOf( selected );
|
|
||||||
|
|
||||||
if( clone != null )
|
|
||||||
{
|
|
||||||
addAliasActionToList( clone );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( mCloneActionButton );
|
|
||||||
|
|
||||||
mDeleteActionButton = new JButton( "Delete" );
|
|
||||||
mDeleteActionButton.setToolTipText( "Delete the currently selected action" );
|
|
||||||
mDeleteActionButton.setEnabled( false );
|
|
||||||
mDeleteActionButton.addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
final AliasAction selected = mAliasActionList.getSelectedValue();
|
|
||||||
|
|
||||||
if( selected != null )
|
|
||||||
{
|
|
||||||
int choice = JOptionPane.showConfirmDialog( mDeleteActionButton,
|
|
||||||
"Do you want to delete [" + selected.toString() + "]",
|
|
||||||
"Are you sure?", JOptionPane.YES_NO_OPTION );
|
|
||||||
|
|
||||||
if( choice == JOptionPane.YES_OPTION && hasItem() )
|
|
||||||
{
|
|
||||||
Alias alias = getItem();
|
|
||||||
|
|
||||||
alias.removeAliasAction( selected );
|
|
||||||
|
|
||||||
mAliasModel.broadcast( new AliasEvent( alias, Event.CHANGE ) );
|
|
||||||
|
|
||||||
setItem( alias );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( mDeleteActionButton, "wrap" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( Alias alias )
|
|
||||||
{
|
|
||||||
super.setItem( alias );
|
|
||||||
|
|
||||||
if( alias == null || alias.getAction().isEmpty() )
|
|
||||||
{
|
|
||||||
mAliasActionList.setModel( EMPTY_MODEL );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DefaultListModel<AliasAction> model = new DefaultListModel<>();
|
|
||||||
|
|
||||||
List<AliasAction> actions = alias.getAction();
|
|
||||||
|
|
||||||
Collections.sort( actions, new Comparator<AliasAction>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public int compare( AliasAction o1, AliasAction o2 )
|
|
||||||
{
|
|
||||||
return o1.toString().compareTo( o2.toString() );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
for( AliasAction action: actions )
|
|
||||||
{
|
|
||||||
model.addElement( action );
|
|
||||||
}
|
|
||||||
|
|
||||||
mAliasActionList.setModel( model );
|
|
||||||
}
|
|
||||||
|
|
||||||
mEditorContainer.setAliasAction( null );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
if( isModified() || mEditorContainer.isModified() )
|
|
||||||
{
|
|
||||||
if( mEditorContainer.isModified() )
|
|
||||||
{
|
|
||||||
mEditorContainer.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
|
|
||||||
if( hasItem() )
|
|
||||||
{
|
|
||||||
mAliasModel.broadcast( new AliasEvent( getItem(), Event.CHANGE ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EditorContainer extends JPanel
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private Editor<AliasAction> mEditor = new EmptyEditor<>();
|
|
||||||
|
|
||||||
public EditorContainer()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "","[grow,fill]", "[grow,fill]" ) );
|
|
||||||
|
|
||||||
add( mEditor );
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isModified()
|
|
||||||
{
|
|
||||||
if( mEditor != null )
|
|
||||||
{
|
|
||||||
return mEditor.isModified();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
if( mEditor != null )
|
|
||||||
{
|
|
||||||
mEditor.save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAliasAction( AliasAction aliasAction )
|
|
||||||
{
|
|
||||||
if( mEditor != null )
|
|
||||||
{
|
|
||||||
if( mEditor.isModified() )
|
|
||||||
{
|
|
||||||
int option = JOptionPane.showConfirmDialog(
|
|
||||||
EditorContainer.this,
|
|
||||||
"Action settings have changed. Do you want to save these changes?",
|
|
||||||
"Save Changes?",
|
|
||||||
JOptionPane.YES_NO_OPTION,
|
|
||||||
JOptionPane.QUESTION_MESSAGE );
|
|
||||||
|
|
||||||
if( option == JOptionPane.YES_OPTION )
|
|
||||||
{
|
|
||||||
mEditor.save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
removeAll();
|
|
||||||
|
|
||||||
//This will always give us an editor
|
|
||||||
mEditor = AliasFactory.getEditor( aliasAction );
|
|
||||||
|
|
||||||
add( mEditor );
|
|
||||||
|
|
||||||
revalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addAliasActionToList( final AliasAction action )
|
|
||||||
{
|
|
||||||
if( action != null && hasItem() )
|
|
||||||
{
|
|
||||||
final Alias alias = getItem();
|
|
||||||
|
|
||||||
alias.addAliasAction( action );
|
|
||||||
|
|
||||||
EventQueue.invokeLater( new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
setItem( alias );
|
|
||||||
|
|
||||||
mAliasActionList.setSelectedValue( action, true );
|
|
||||||
|
|
||||||
AliasActionEditor.this.setModified( true );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class AddAliasActionItem extends JMenuItem
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private AliasActionType mAliasActionType;
|
|
||||||
|
|
||||||
public AddAliasActionItem( AliasActionType type )
|
|
||||||
{
|
|
||||||
super( type.toString() );
|
|
||||||
|
|
||||||
mAliasActionType = type;
|
|
||||||
|
|
||||||
addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
final AliasAction action =
|
|
||||||
AliasFactory.getAliasAction( mAliasActionType );
|
|
||||||
|
|
||||||
addAliasActionToList( action );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.action;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.AliasEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface for receiving alias events. Each listener will receive
|
|
||||||
* notification of all alias events.
|
|
||||||
*/
|
|
||||||
public interface AliasActionListener
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Notifies the listener that an alias event has occurred
|
|
||||||
*/
|
|
||||||
public void aliasChanged( AliasEvent event );
|
|
||||||
}
|
|
||||||
@@ -1,21 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* * ******************************************************************************
|
||||||
* it under the terms of the GNU General Public License as published by
|
* * Copyright (C) 2014-2020 Dennis Sheirer
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* *
|
||||||
* (at your option) any later version.
|
* * This program is free software: you can redistribute it and/or modify
|
||||||
|
* * it under the terms of the GNU General Public License as published by
|
||||||
|
* * the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* * (at your option) any later version.
|
||||||
|
* *
|
||||||
|
* * This program is distributed in the hope that it will be useful,
|
||||||
|
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* * GNU General Public License for more details.
|
||||||
|
* *
|
||||||
|
* * You should have received a copy of the GNU General Public License
|
||||||
|
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* * *****************************************************************************
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* *****************************************************************************
|
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.alias.action;
|
package io.github.dsheirer.alias.action;
|
||||||
|
|
||||||
@@ -63,7 +65,7 @@ public class AliasActionManager extends Module implements IMessageListener, List
|
|||||||
{
|
{
|
||||||
if(alias != null && alias.hasActions())
|
if(alias != null && alias.hasActions())
|
||||||
{
|
{
|
||||||
for(AliasAction action: alias.getAction())
|
for(AliasAction action: alias.getAliasActions())
|
||||||
{
|
{
|
||||||
action.execute(alias, message);
|
action.execute(alias, message);
|
||||||
}
|
}
|
||||||
@@ -76,13 +78,13 @@ public class AliasActionManager extends Module implements IMessageListener, List
|
|||||||
@Override
|
@Override
|
||||||
public void reset()
|
public void reset()
|
||||||
{
|
{
|
||||||
//No actions neeeded
|
//No actions needed
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start()
|
public void start()
|
||||||
{
|
{
|
||||||
//No actions neeeded
|
//No actions needed
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -91,12 +93,6 @@ public class AliasActionManager extends Module implements IMessageListener, List
|
|||||||
//No actions neeeded
|
//No actions neeeded
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void dispose()
|
|
||||||
{
|
|
||||||
//No actions neeeded
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IMessageListener interface ... delegates to this class implementation of Listener<Message>
|
* IMessageListener interface ... delegates to this class implementation of Listener<Message>
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.github.dsheirer.alias.action;
|
package io.github.dsheirer.alias.action;
|
||||||
@@ -26,8 +25,8 @@ import io.github.dsheirer.alias.Alias;
|
|||||||
import io.github.dsheirer.message.IMessage;
|
import io.github.dsheirer.message.IMessage;
|
||||||
import io.github.dsheirer.util.ThreadPool;
|
import io.github.dsheirer.util.ThreadPool;
|
||||||
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.*;
|
||||||
import java.awt.EventQueue;
|
import java.awt.*;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
@@ -61,7 +60,7 @@ public abstract class RecurringAction extends AliasAction
|
|||||||
break;
|
break;
|
||||||
case UNTIL_DISMISSED:
|
case UNTIL_DISMISSED:
|
||||||
mPerpetualAction = ThreadPool.SCHEDULED.scheduleAtFixedRate(
|
mPerpetualAction = ThreadPool.SCHEDULED.scheduleAtFixedRate(
|
||||||
new PerformActionTask(alias, message), mPeriod, mPeriod, TimeUnit.SECONDS);
|
new PerformActionTask(alias, message), 0, mPeriod, TimeUnit.SECONDS);
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("<html><div width='250'>Alias [");
|
sb.append("<html><div width='250'>Alias [");
|
||||||
@@ -92,7 +91,7 @@ public abstract class RecurringAction extends AliasAction
|
|||||||
*/
|
*/
|
||||||
private void performThreadedAction(final Alias alias, final IMessage message)
|
private void performThreadedAction(final Alias alias, final IMessage message)
|
||||||
{
|
{
|
||||||
ThreadPool.SCHEDULED.schedule(() -> performAction(alias, message), 0, TimeUnit.SECONDS);
|
ThreadPool.CACHED.execute(() -> performAction(alias, message));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -120,6 +119,7 @@ public abstract class RecurringAction extends AliasAction
|
|||||||
public void setPeriod(int period)
|
public void setPeriod(int period)
|
||||||
{
|
{
|
||||||
mPeriod = period;
|
mPeriod = period;
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "interval")
|
@JacksonXmlProperty(isAttribute = true, localName = "interval")
|
||||||
@@ -131,14 +131,14 @@ public abstract class RecurringAction extends AliasAction
|
|||||||
public void setInterval(Interval interval)
|
public void setInterval(Interval interval)
|
||||||
{
|
{
|
||||||
mInterval = interval;
|
mInterval = interval;
|
||||||
|
|
||||||
mRunning.set(false);
|
mRunning.set(false);
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Interval
|
public enum Interval
|
||||||
{
|
{
|
||||||
ONCE("Once"),
|
ONCE("Once"),
|
||||||
DELAYED_RESET("Once, Reset After Delay"),
|
DELAYED_RESET("Once - Reset After Delay"),
|
||||||
UNTIL_DISMISSED("Until Dismissed");
|
UNTIL_DISMISSED("Until Dismissed");
|
||||||
|
|
||||||
private String mLabel;
|
private String mLabel;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.github.dsheirer.alias.action.beep;
|
package io.github.dsheirer.alias.action.beep;
|
||||||
@@ -24,10 +23,43 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
|||||||
import io.github.dsheirer.alias.Alias;
|
import io.github.dsheirer.alias.Alias;
|
||||||
import io.github.dsheirer.alias.action.AliasActionType;
|
import io.github.dsheirer.alias.action.AliasActionType;
|
||||||
import io.github.dsheirer.alias.action.RecurringAction;
|
import io.github.dsheirer.alias.action.RecurringAction;
|
||||||
|
import io.github.dsheirer.audio.AudioFormats;
|
||||||
|
import io.github.dsheirer.gui.preference.playback.ToneFrequency;
|
||||||
|
import io.github.dsheirer.gui.preference.playback.ToneUtil;
|
||||||
|
import io.github.dsheirer.gui.preference.playback.ToneVolume;
|
||||||
import io.github.dsheirer.message.IMessage;
|
import io.github.dsheirer.message.IMessage;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.sound.sampled.AudioSystem;
|
||||||
|
import javax.sound.sampled.Clip;
|
||||||
|
import javax.sound.sampled.DataLine;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.ByteOrder;
|
||||||
|
import java.nio.ShortBuffer;
|
||||||
|
|
||||||
public class BeepAction extends RecurringAction
|
public class BeepAction extends RecurringAction
|
||||||
{
|
{
|
||||||
|
private static final Logger mLog = LoggerFactory.getLogger(BeepAction.class);
|
||||||
|
private byte[] mToneBytes;
|
||||||
|
|
||||||
|
public BeepAction()
|
||||||
|
{
|
||||||
|
setInterval(Interval.ONCE);
|
||||||
|
float[] tone = ToneUtil.getTone(ToneFrequency.F700, ToneVolume.V10, 1000);
|
||||||
|
|
||||||
|
/* Little-endian byte buffer */
|
||||||
|
ByteBuffer buffer = ByteBuffer.allocate(tone.length * 2).order(ByteOrder.LITTLE_ENDIAN);
|
||||||
|
|
||||||
|
ShortBuffer shortBuffer = buffer.asShortBuffer();
|
||||||
|
|
||||||
|
for(float sample : tone)
|
||||||
|
{
|
||||||
|
shortBuffer.put((short) (sample * Short.MAX_VALUE));
|
||||||
|
}
|
||||||
|
|
||||||
|
mToneBytes = buffer.array();
|
||||||
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
||||||
@Override
|
@Override
|
||||||
@@ -39,12 +71,48 @@ public class BeepAction extends RecurringAction
|
|||||||
@Override
|
@Override
|
||||||
public void performAction(Alias alias, IMessage message )
|
public void performAction(Alias alias, IMessage message )
|
||||||
{
|
{
|
||||||
System.out.println( "\007" );
|
DataLine.Info info = new DataLine.Info(Clip.class, AudioFormats.PCM_SIGNED_8000_HZ_16_BIT_MONO);
|
||||||
|
|
||||||
|
if(!AudioSystem.isLineSupported(info))
|
||||||
|
{
|
||||||
|
mLog.error("Audio clip playback is not supported on this system");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Clip clip = (Clip)AudioSystem.getLine(info);
|
||||||
|
clip.open(AudioFormats.PCM_SIGNED_8000_HZ_16_BIT_MONO, mToneBytes, 0, mToneBytes.length);
|
||||||
|
clip.start();
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
mLog.error("Error attempting to play audio test tone");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return "Beep";
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Beep");
|
||||||
|
|
||||||
|
if(getInterval() != null)
|
||||||
|
{
|
||||||
|
switch(getInterval())
|
||||||
|
{
|
||||||
|
case ONCE:
|
||||||
|
sb.append(" Once");
|
||||||
|
break;
|
||||||
|
case DELAYED_RESET:
|
||||||
|
sb.append(" Once, Reset After ").append(getPeriod()).append(" Seconds");
|
||||||
|
break;
|
||||||
|
case UNTIL_DISMISSED:
|
||||||
|
sb.append(" Every ").append(getPeriod()).append(" Seconds Until Dismissed");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,185 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.action.beep;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.action.AliasAction;
|
|
||||||
import io.github.dsheirer.alias.action.RecurringAction;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.event.ChangeEvent;
|
|
||||||
import javax.swing.event.ChangeListener;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class BeepActionEditor extends DocumentListenerEditor<AliasAction>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT =
|
|
||||||
"<html><h3>Beep Action</h3>"
|
|
||||||
+ "This action will sound a beep according to the interval<br>"
|
|
||||||
+ "that you select:<br><br>"
|
|
||||||
+ "<b>Once:</b> Beep the first time the alias is active and<br>"
|
|
||||||
+ "never again<br><br>"
|
|
||||||
+ "<b>Once, Reset After Delay:</b> Beep once and suppress<br>"
|
|
||||||
+ "subsequent beeps for the specified period in seconds.<br>"
|
|
||||||
+ "After the reset period, beep again when the alias is active.<br><br>"
|
|
||||||
+ "<b>Until Dismissed:</b> Beep every period seconds until you<br>"
|
|
||||||
+ "click OK on the dialog that appears. Alerting is suppressed<br>"
|
|
||||||
+ "for 15 seconds after you click OK.<br>"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JComboBox<RecurringAction.Interval> mComboInterval;
|
|
||||||
private JSlider mPeriodSlider;
|
|
||||||
private JLabel mPeriodSliderLabel;
|
|
||||||
|
|
||||||
public BeepActionEditor( AliasAction aliasAction )
|
|
||||||
{
|
|
||||||
init();
|
|
||||||
|
|
||||||
setItem( aliasAction );
|
|
||||||
}
|
|
||||||
|
|
||||||
public BeepAction getBeepAction()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof BeepAction )
|
|
||||||
{
|
|
||||||
return (BeepAction)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Beep Interval:" ) );
|
|
||||||
|
|
||||||
mComboInterval = new JComboBox<RecurringAction.Interval>( RecurringAction.Interval.values() );
|
|
||||||
mComboInterval.setToolTipText( HELP_TEXT );
|
|
||||||
mComboInterval.addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
RecurringAction.Interval selected = mComboInterval
|
|
||||||
.getItemAt( mComboInterval.getSelectedIndex() );
|
|
||||||
|
|
||||||
if( selected != null )
|
|
||||||
{
|
|
||||||
/* Enable/disable period spinner based on selection */
|
|
||||||
boolean enabled = selected != RecurringAction.Interval.ONCE;
|
|
||||||
|
|
||||||
mPeriodSlider.setEnabled( enabled );
|
|
||||||
mPeriodSliderLabel.setEnabled( enabled );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add( mComboInterval, "wrap" );
|
|
||||||
|
|
||||||
final SpinnerModel model = new SpinnerNumberModel( 1, 1, 30, 1 );
|
|
||||||
model.addChangeListener( new ChangeListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void stateChanged( ChangeEvent e )
|
|
||||||
{
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
mPeriodSlider = new JSlider( JSlider.HORIZONTAL, 1, 60, 1 );
|
|
||||||
mPeriodSlider.setMajorTickSpacing( 10 );
|
|
||||||
mPeriodSlider.setMinorTickSpacing( 2 );
|
|
||||||
mPeriodSlider.setPaintTicks( true );
|
|
||||||
mPeriodSlider.setLabelTable( mPeriodSlider.createStandardLabels( 10, 10 ) );
|
|
||||||
mPeriodSlider.setPaintLabels( true );
|
|
||||||
mPeriodSlider.addChangeListener( new ChangeListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void stateChanged( ChangeEvent e )
|
|
||||||
{
|
|
||||||
mPeriodSliderLabel.setText( "Period: " + mPeriodSlider.getValue() );
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
mPeriodSlider.setToolTipText( HELP_TEXT );
|
|
||||||
|
|
||||||
mPeriodSliderLabel = new JLabel( "Period: " + mPeriodSlider.getValue() + " " );
|
|
||||||
add( mPeriodSliderLabel );
|
|
||||||
add( mPeriodSlider, "wrap,grow" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( BeepActionEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasAction item )
|
|
||||||
{
|
|
||||||
super.setItem( item );
|
|
||||||
|
|
||||||
if( hasItem() )
|
|
||||||
{
|
|
||||||
BeepAction beep = getBeepAction();
|
|
||||||
|
|
||||||
RecurringAction.Interval interval = beep.getInterval();
|
|
||||||
|
|
||||||
mComboInterval.setSelectedItem( interval );
|
|
||||||
|
|
||||||
boolean enabled = interval != RecurringAction.Interval.ONCE;
|
|
||||||
|
|
||||||
mPeriodSliderLabel.setEnabled( enabled );
|
|
||||||
mPeriodSlider.setEnabled( enabled );
|
|
||||||
mPeriodSlider.setValue( beep.getPeriod() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
if( hasItem() && isModified() )
|
|
||||||
{
|
|
||||||
BeepAction beep = getBeepAction();
|
|
||||||
|
|
||||||
beep.setInterval( (RecurringAction.Interval)mComboInterval.getSelectedItem() );
|
|
||||||
beep.setPeriod( mPeriodSlider.getValue() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -45,6 +45,7 @@ public class ClipAction extends RecurringAction
|
|||||||
|
|
||||||
public ClipAction()
|
public ClipAction()
|
||||||
{
|
{
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
||||||
@@ -62,6 +63,7 @@ public class ClipAction extends RecurringAction
|
|||||||
public void setPath(String path)
|
public void setPath(String path)
|
||||||
{
|
{
|
||||||
mFilePath = path;
|
mFilePath = path;
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -87,8 +89,7 @@ public class ClipAction extends RecurringAction
|
|||||||
{
|
{
|
||||||
mClip = AudioSystem.getClip();
|
mClip = AudioSystem.getClip();
|
||||||
|
|
||||||
AudioInputStream ais =
|
AudioInputStream ais = AudioSystem.getAudioInputStream(new File(mFilePath));
|
||||||
AudioSystem.getAudioInputStream(new File(mFilePath));
|
|
||||||
|
|
||||||
mClip.open(ais);
|
mClip.open(ais);
|
||||||
}
|
}
|
||||||
@@ -113,17 +114,33 @@ public class ClipAction extends RecurringAction
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
if(mFilePath == null)
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Play Audio Clip");
|
||||||
|
|
||||||
|
if(getInterval() != null)
|
||||||
{
|
{
|
||||||
return "Play Clip";
|
switch(getInterval())
|
||||||
|
{
|
||||||
|
case ONCE:
|
||||||
|
sb.append(" Once");
|
||||||
|
break;
|
||||||
|
case DELAYED_RESET:
|
||||||
|
sb.append(" Once, Reset After ").append(getPeriod()).append(" Seconds");
|
||||||
|
break;
|
||||||
|
case UNTIL_DISMISSED:
|
||||||
|
sb.append(" Every ").append(getPeriod()).append(" Seconds Until Dismissed");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if(getPath() == null)
|
||||||
{
|
{
|
||||||
return "Play Clip: " + mFilePath;
|
sb.append(" - (audio file empty)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,285 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.action.clip;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.action.AliasAction;
|
|
||||||
import io.github.dsheirer.alias.action.RecurringAction;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.event.ChangeEvent;
|
|
||||||
import javax.swing.event.ChangeListener;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
public class ClipActionEditor extends DocumentListenerEditor<AliasAction>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String PLEASE_SELECT_A_FILE = "Please select a file";
|
|
||||||
private static final String HELP_TEXT =
|
|
||||||
"<html><h3>Clip Action</h3>"
|
|
||||||
+ "This action will play an audio clip according to the interval<br>"
|
|
||||||
+ "that you select:<br><br>"
|
|
||||||
+ "<b>Once:</b> play the first time the alias is active and<br>"
|
|
||||||
+ "never again<br><br>"
|
|
||||||
+ "<b>Once, Reset After Delay:</b> play once and suppress<br>"
|
|
||||||
+ "subsequent runs for the specified period in seconds.<br>"
|
|
||||||
+ "After the reset period, play again when the alias is active.<br><br>"
|
|
||||||
+ "<b>Until Dismissed:</b> play every period seconds until you<br>"
|
|
||||||
+ "click OK on the dialog that appears. Alerting is suppressed<br>"
|
|
||||||
+ "for 15 seconds after you click OK.<br>"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JComboBox<RecurringAction.Interval> mComboInterval;
|
|
||||||
private JSlider mPeriodSlider;
|
|
||||||
private JLabel mPeriodSliderLabel;
|
|
||||||
private JTextField mTextFilePath;
|
|
||||||
|
|
||||||
public ClipActionEditor( AliasAction aliasAction )
|
|
||||||
{
|
|
||||||
init();
|
|
||||||
|
|
||||||
setItem( aliasAction );
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClipAction getClipAction()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof ClipAction )
|
|
||||||
{
|
|
||||||
return (ClipAction)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Play Interval:" ) );
|
|
||||||
|
|
||||||
mComboInterval = new JComboBox<RecurringAction.Interval>( RecurringAction.Interval.values() );
|
|
||||||
mComboInterval.setToolTipText( HELP_TEXT );
|
|
||||||
mComboInterval.addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
RecurringAction.Interval selected = mComboInterval
|
|
||||||
.getItemAt( mComboInterval.getSelectedIndex() );
|
|
||||||
|
|
||||||
if( selected != null )
|
|
||||||
{
|
|
||||||
/* Enable/disable period slider based on selection */
|
|
||||||
boolean enabled = selected != RecurringAction.Interval.ONCE;
|
|
||||||
|
|
||||||
mPeriodSlider.setEnabled( enabled );
|
|
||||||
mPeriodSliderLabel.setEnabled( enabled );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add( mComboInterval );
|
|
||||||
|
|
||||||
final SpinnerModel model = new SpinnerNumberModel( 1, 1, 30, 1 );
|
|
||||||
model.addChangeListener( new ChangeListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void stateChanged( ChangeEvent e )
|
|
||||||
{
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
mPeriodSlider = new JSlider( JSlider.HORIZONTAL, 1, 60, 1 );
|
|
||||||
mPeriodSlider.setMajorTickSpacing( 10 );
|
|
||||||
mPeriodSlider.setMinorTickSpacing( 2 );
|
|
||||||
mPeriodSlider.setPaintTicks( true );
|
|
||||||
mPeriodSlider.setLabelTable( mPeriodSlider.createStandardLabels( 10, 10 ) );
|
|
||||||
mPeriodSlider.setPaintLabels( true );
|
|
||||||
mPeriodSlider.addChangeListener( new ChangeListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void stateChanged( ChangeEvent e )
|
|
||||||
{
|
|
||||||
mPeriodSliderLabel.setText( "Period: " + mPeriodSlider.getValue() );
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
mPeriodSlider.setToolTipText( HELP_TEXT );
|
|
||||||
|
|
||||||
mPeriodSliderLabel = new JLabel( "Period: " + mPeriodSlider.getValue() + " " );
|
|
||||||
add( mPeriodSliderLabel );
|
|
||||||
add( mPeriodSlider, "wrap,grow" );
|
|
||||||
|
|
||||||
mTextFilePath = new JTextField( PLEASE_SELECT_A_FILE );
|
|
||||||
add( mTextFilePath, "growx,span" );
|
|
||||||
|
|
||||||
JButton fileButton = new JButton( "File" );
|
|
||||||
|
|
||||||
fileButton.addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
final JFileChooser chooser = new JFileChooser();
|
|
||||||
|
|
||||||
int value = chooser.showOpenDialog( ClipActionEditor.this );
|
|
||||||
|
|
||||||
if( value == JFileChooser.APPROVE_OPTION )
|
|
||||||
{
|
|
||||||
File file = chooser.getSelectedFile();
|
|
||||||
|
|
||||||
mTextFilePath.setText( file.getAbsolutePath() );
|
|
||||||
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
add( fileButton, "grow" );
|
|
||||||
|
|
||||||
JButton testButton = new JButton( "Test" );
|
|
||||||
|
|
||||||
testButton.addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
if( hasItem() )
|
|
||||||
{
|
|
||||||
String path = mTextFilePath.getText();
|
|
||||||
|
|
||||||
if( path == null || path.trim().isEmpty() )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( ClipActionEditor.this,
|
|
||||||
"Please select an audio file", PLEASE_SELECT_A_FILE,
|
|
||||||
JOptionPane.ERROR_MESSAGE );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( isModified() )
|
|
||||||
{
|
|
||||||
int option = JOptionPane.showConfirmDialog(
|
|
||||||
ClipActionEditor.this,
|
|
||||||
"Settings have changed. Do you want to save these changes?",
|
|
||||||
"Save Changes?",
|
|
||||||
JOptionPane.YES_NO_OPTION,
|
|
||||||
JOptionPane.QUESTION_MESSAGE );
|
|
||||||
|
|
||||||
if( option == JOptionPane.YES_OPTION )
|
|
||||||
{
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
new Thread( new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
getClipAction().play();
|
|
||||||
}
|
|
||||||
catch( Exception e1 )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( ClipActionEditor.this,
|
|
||||||
"Couldn't play audio clip [" + e1.getMessage() + "]",
|
|
||||||
"Error", JOptionPane.ERROR_MESSAGE );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
add( testButton, "grow,wrap" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( ClipActionEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasAction item )
|
|
||||||
{
|
|
||||||
super.setItem( item );
|
|
||||||
|
|
||||||
if( hasItem() )
|
|
||||||
{
|
|
||||||
ClipAction clip = getClipAction();
|
|
||||||
|
|
||||||
RecurringAction.Interval interval = clip.getInterval();
|
|
||||||
|
|
||||||
mComboInterval.setSelectedItem( interval );
|
|
||||||
|
|
||||||
boolean enabled = interval != RecurringAction.Interval.ONCE;
|
|
||||||
|
|
||||||
mPeriodSliderLabel.setEnabled( enabled );
|
|
||||||
mPeriodSlider.setEnabled( enabled );
|
|
||||||
mPeriodSlider.setValue( clip.getPeriod() );
|
|
||||||
|
|
||||||
String filepath = clip.getPath();
|
|
||||||
|
|
||||||
if( filepath != null && !filepath.isEmpty() )
|
|
||||||
{
|
|
||||||
mTextFilePath.setText( filepath );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mTextFilePath.setText( PLEASE_SELECT_A_FILE );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
if( hasItem() && isModified() )
|
|
||||||
{
|
|
||||||
ClipAction script = getClipAction();
|
|
||||||
|
|
||||||
script.setInterval( (RecurringAction.Interval)mComboInterval.getSelectedItem() );
|
|
||||||
script.setPeriod( mPeriodSlider.getValue() );
|
|
||||||
script.setPath( mTextFilePath.getText() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -39,6 +39,7 @@ public class ScriptAction extends RecurringAction
|
|||||||
|
|
||||||
public ScriptAction()
|
public ScriptAction()
|
||||||
{
|
{
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
||||||
@@ -56,6 +57,7 @@ public class ScriptAction extends RecurringAction
|
|||||||
public void setScript(String script)
|
public void setScript(String script)
|
||||||
{
|
{
|
||||||
mScript = script;
|
mScript = script;
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -104,13 +106,30 @@ public class ScriptAction extends RecurringAction
|
|||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
if(mScript == null)
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Run Script");
|
||||||
|
|
||||||
|
if(getInterval() != null)
|
||||||
{
|
{
|
||||||
return "Run Script";
|
switch(getInterval())
|
||||||
|
{
|
||||||
|
case ONCE:
|
||||||
|
sb.append(" Once");
|
||||||
|
break;
|
||||||
|
case DELAYED_RESET:
|
||||||
|
sb.append(" Once, Reset After ").append(getPeriod()).append(" Seconds");
|
||||||
|
break;
|
||||||
|
case UNTIL_DISMISSED:
|
||||||
|
sb.append(" Every ").append(getPeriod()).append(" Seconds Until Dismissed");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if(getScript() == null)
|
||||||
{
|
{
|
||||||
return "Run Script: " + mScript;
|
sb.append(" - (script file empty)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,281 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.action.script;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.action.AliasAction;
|
|
||||||
import io.github.dsheirer.alias.action.RecurringAction;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.event.ChangeEvent;
|
|
||||||
import javax.swing.event.ChangeListener;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
public class ScriptActionEditor extends DocumentListenerEditor<AliasAction>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String PLEASE_SELECT_A_FILE = "Please select a file";
|
|
||||||
private static final String HELP_TEXT =
|
|
||||||
"<html><h3>Script Action</h3>"
|
|
||||||
+ "This action will run a script according to the interval<br>"
|
|
||||||
+ "that you select:<br><br>"
|
|
||||||
+ "<b>Once:</b> run the first time the alias is active and<br>"
|
|
||||||
+ "never again<br><br>"
|
|
||||||
+ "<b>Once, Reset After Delay:</b> run once and suppress<br>"
|
|
||||||
+ "subsequent runs for the specified period in seconds.<br>"
|
|
||||||
+ "After the reset period, run again when the alias is active.<br><br>"
|
|
||||||
+ "<b>Until Dismissed:</b> run every period seconds until you<br>"
|
|
||||||
+ "click OK on the dialog that appears. Alerting is suppressed<br>"
|
|
||||||
+ "for 15 seconds after you click OK.<br>"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JComboBox<RecurringAction.Interval> mComboInterval;
|
|
||||||
private JSlider mPeriodSlider;
|
|
||||||
private JLabel mPeriodSliderLabel;
|
|
||||||
private JTextField mTextFilePath;
|
|
||||||
|
|
||||||
public ScriptActionEditor( AliasAction aliasAction )
|
|
||||||
{
|
|
||||||
init();
|
|
||||||
|
|
||||||
setItem( aliasAction );
|
|
||||||
}
|
|
||||||
|
|
||||||
public ScriptAction getScriptAction()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof ScriptAction )
|
|
||||||
{
|
|
||||||
return (ScriptAction)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Run Interval:" ) );
|
|
||||||
|
|
||||||
mComboInterval = new JComboBox<RecurringAction.Interval>( RecurringAction.Interval.values() );
|
|
||||||
mComboInterval.setToolTipText( HELP_TEXT );
|
|
||||||
mComboInterval.addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
RecurringAction.Interval selected = mComboInterval
|
|
||||||
.getItemAt( mComboInterval.getSelectedIndex() );
|
|
||||||
|
|
||||||
if( selected != null )
|
|
||||||
{
|
|
||||||
/* Enable/disable period slider based on selection */
|
|
||||||
boolean enabled = selected != RecurringAction.Interval.ONCE;
|
|
||||||
|
|
||||||
mPeriodSlider.setEnabled( enabled );
|
|
||||||
mPeriodSliderLabel.setEnabled( enabled );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add( mComboInterval );
|
|
||||||
|
|
||||||
final SpinnerModel model = new SpinnerNumberModel( 1, 1, 30, 1 );
|
|
||||||
model.addChangeListener( new ChangeListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void stateChanged( ChangeEvent e )
|
|
||||||
{
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
mPeriodSlider = new JSlider( JSlider.HORIZONTAL, 1, 60, 1 );
|
|
||||||
mPeriodSlider.setMajorTickSpacing( 10 );
|
|
||||||
mPeriodSlider.setMinorTickSpacing( 2 );
|
|
||||||
mPeriodSlider.setPaintTicks( true );
|
|
||||||
mPeriodSlider.setLabelTable( mPeriodSlider.createStandardLabels( 10, 10 ) );
|
|
||||||
mPeriodSlider.setPaintLabels( true );
|
|
||||||
mPeriodSlider.addChangeListener( new ChangeListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void stateChanged( ChangeEvent e )
|
|
||||||
{
|
|
||||||
mPeriodSliderLabel.setText( "Period: " + mPeriodSlider.getValue() );
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
mPeriodSlider.setToolTipText( HELP_TEXT );
|
|
||||||
|
|
||||||
mPeriodSliderLabel = new JLabel( "Period: " + mPeriodSlider.getValue() + " " );
|
|
||||||
add( mPeriodSliderLabel );
|
|
||||||
add( mPeriodSlider, "wrap,grow" );
|
|
||||||
|
|
||||||
mTextFilePath = new JTextField( PLEASE_SELECT_A_FILE );
|
|
||||||
add( mTextFilePath, "growx,span" );
|
|
||||||
|
|
||||||
JButton fileButton = new JButton( "File" );
|
|
||||||
|
|
||||||
fileButton.addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
final JFileChooser chooser = new JFileChooser();
|
|
||||||
|
|
||||||
int value = chooser.showOpenDialog( ScriptActionEditor.this );
|
|
||||||
|
|
||||||
if( value == JFileChooser.APPROVE_OPTION )
|
|
||||||
{
|
|
||||||
File file = chooser.getSelectedFile();
|
|
||||||
|
|
||||||
mTextFilePath.setText( file.getAbsolutePath() );
|
|
||||||
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
add( fileButton, "grow" );
|
|
||||||
|
|
||||||
JButton testButton = new JButton( "Test" );
|
|
||||||
testButton.addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent actionEvent )
|
|
||||||
{
|
|
||||||
String script = mTextFilePath.getText();
|
|
||||||
|
|
||||||
if( script == null || script.trim().isEmpty() )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( ScriptActionEditor.this,
|
|
||||||
"Please select a script file", PLEASE_SELECT_A_FILE,
|
|
||||||
JOptionPane.ERROR_MESSAGE );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( isModified() )
|
|
||||||
{
|
|
||||||
int option = JOptionPane.showConfirmDialog(
|
|
||||||
ScriptActionEditor.this,
|
|
||||||
"Settings have changed. Do you want to save these changes?",
|
|
||||||
"Save Changes?",
|
|
||||||
JOptionPane.YES_NO_OPTION,
|
|
||||||
JOptionPane.QUESTION_MESSAGE );
|
|
||||||
|
|
||||||
if( option == JOptionPane.YES_OPTION )
|
|
||||||
{
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
new Thread( new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
getScriptAction().play();
|
|
||||||
}
|
|
||||||
catch( Exception e1 )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( ScriptActionEditor.this,
|
|
||||||
e1.getMessage(), "Error", JOptionPane.ERROR_MESSAGE );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
add( testButton, "grow,wrap" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( ScriptActionEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasAction item )
|
|
||||||
{
|
|
||||||
super.setItem( item );
|
|
||||||
|
|
||||||
if( hasItem() )
|
|
||||||
{
|
|
||||||
ScriptAction script = getScriptAction();
|
|
||||||
|
|
||||||
RecurringAction.Interval interval = script.getInterval();
|
|
||||||
|
|
||||||
mComboInterval.setSelectedItem( interval );
|
|
||||||
|
|
||||||
boolean enabled = interval != RecurringAction.Interval.ONCE;
|
|
||||||
|
|
||||||
mPeriodSliderLabel.setEnabled( enabled );
|
|
||||||
mPeriodSlider.setEnabled( enabled );
|
|
||||||
mPeriodSlider.setValue( script.getPeriod() );
|
|
||||||
|
|
||||||
String filepath = script.getScript();
|
|
||||||
|
|
||||||
if( filepath != null && !filepath.isEmpty() )
|
|
||||||
{
|
|
||||||
mTextFilePath.setText( filepath );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mTextFilePath.setText( PLEASE_SELECT_A_FILE );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
if( hasItem() && isModified() )
|
|
||||||
{
|
|
||||||
ScriptAction script = getScriptAction();
|
|
||||||
|
|
||||||
script.setInterval( (RecurringAction.Interval)mComboInterval.getSelectedItem() );
|
|
||||||
script.setPeriod( mPeriodSlider.getValue() );
|
|
||||||
script.setScript( mTextFilePath.getText() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,21 @@
|
|||||||
/*******************************************************************************
|
/*
|
||||||
* SDR Trunk
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
* Copyright (C) 2014-2025 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
package io.github.dsheirer.alias.id;
|
package io.github.dsheirer.alias.id;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
@@ -22,53 +23,156 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
|
|||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||||
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
||||||
|
import io.github.dsheirer.alias.id.dcs.Dcs;
|
||||||
import io.github.dsheirer.alias.id.esn.Esn;
|
import io.github.dsheirer.alias.id.esn.Esn;
|
||||||
import io.github.dsheirer.alias.id.legacy.fleetsync.FleetsyncID;
|
import io.github.dsheirer.alias.id.legacy.fleetsync.FleetsyncID;
|
||||||
import io.github.dsheirer.alias.id.legacy.mdc.MDC1200ID;
|
import io.github.dsheirer.alias.id.legacy.mdc.MDC1200ID;
|
||||||
|
import io.github.dsheirer.alias.id.legacy.mobileID.Min;
|
||||||
import io.github.dsheirer.alias.id.legacy.mpt1327.MPT1327ID;
|
import io.github.dsheirer.alias.id.legacy.mpt1327.MPT1327ID;
|
||||||
import io.github.dsheirer.alias.id.legacy.nonrecordable.NonRecordable;
|
import io.github.dsheirer.alias.id.legacy.nonrecordable.NonRecordable;
|
||||||
import io.github.dsheirer.alias.id.legacy.talkgroup.LegacyTalkgroupID;
|
|
||||||
import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.mobileID.Min;
|
|
||||||
import io.github.dsheirer.alias.id.priority.Priority;
|
|
||||||
import io.github.dsheirer.alias.id.record.Record;
|
|
||||||
import io.github.dsheirer.alias.id.legacy.siteID.SiteID;
|
import io.github.dsheirer.alias.id.legacy.siteID.SiteID;
|
||||||
import io.github.dsheirer.alias.id.status.StatusID;
|
import io.github.dsheirer.alias.id.legacy.talkgroup.LegacyTalkgroupID;
|
||||||
|
import io.github.dsheirer.alias.id.legacy.uniqueID.UniqueID;
|
||||||
|
import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID;
|
||||||
|
import io.github.dsheirer.alias.id.priority.Priority;
|
||||||
|
import io.github.dsheirer.alias.id.radio.NXDNTypeDRadio;
|
||||||
|
import io.github.dsheirer.alias.id.radio.NXDNTypeDRadioRange;
|
||||||
|
import io.github.dsheirer.alias.id.radio.P25FullyQualifiedRadio;
|
||||||
|
import io.github.dsheirer.alias.id.radio.Radio;
|
||||||
|
import io.github.dsheirer.alias.id.radio.RadioRange;
|
||||||
|
import io.github.dsheirer.alias.id.record.Record;
|
||||||
|
import io.github.dsheirer.alias.id.status.UnitStatusID;
|
||||||
|
import io.github.dsheirer.alias.id.status.UserStatusID;
|
||||||
|
import io.github.dsheirer.alias.id.talkgroup.NXDNTypeDTalkgroup;
|
||||||
|
import io.github.dsheirer.alias.id.talkgroup.NXDNTypeDTalkgroupRange;
|
||||||
|
import io.github.dsheirer.alias.id.talkgroup.P25FullyQualifiedTalkgroup;
|
||||||
|
import io.github.dsheirer.alias.id.talkgroup.StreamAsTalkgroup;
|
||||||
import io.github.dsheirer.alias.id.talkgroup.Talkgroup;
|
import io.github.dsheirer.alias.id.talkgroup.Talkgroup;
|
||||||
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRange;
|
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRange;
|
||||||
import io.github.dsheirer.alias.id.legacy.uniqueID.UniqueID;
|
import io.github.dsheirer.alias.id.tone.TonesID;
|
||||||
|
import javafx.beans.Observable;
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
|
import javafx.util.Callback;
|
||||||
|
|
||||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
|
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
|
||||||
@JsonSubTypes({
|
@JsonSubTypes({
|
||||||
@JsonSubTypes.Type(value = BroadcastChannel.class, name = "broadcastChannel"),
|
@JsonSubTypes.Type(value = BroadcastChannel.class, name = "broadcastChannel"),
|
||||||
|
@JsonSubTypes.Type(value = Dcs.class, name = "dcs"),
|
||||||
@JsonSubTypes.Type(value = Esn.class, name = "esn"),
|
@JsonSubTypes.Type(value = Esn.class, name = "esn"),
|
||||||
@JsonSubTypes.Type(value = FleetsyncID.class, name = "fleetsyncID"),
|
@JsonSubTypes.Type(value = FleetsyncID.class, name = "fleetsyncID"),
|
||||||
|
@JsonSubTypes.Type(value = LegacyTalkgroupID.class, name = "talkgroupID"),
|
||||||
@JsonSubTypes.Type(value = LoJackFunctionAndID.class, name = "loJackFunctionAndID"),
|
@JsonSubTypes.Type(value = LoJackFunctionAndID.class, name = "loJackFunctionAndID"),
|
||||||
@JsonSubTypes.Type(value = MDC1200ID.class, name = "mdc1200ID"),
|
@JsonSubTypes.Type(value = MDC1200ID.class, name = "mdc1200ID"),
|
||||||
@JsonSubTypes.Type(value = Min.class, name = "min"),
|
@JsonSubTypes.Type(value = Min.class, name = "min"),
|
||||||
@JsonSubTypes.Type(value = MPT1327ID.class, name = "mpt1327ID"),
|
@JsonSubTypes.Type(value = MPT1327ID.class, name = "mpt1327ID"),
|
||||||
@JsonSubTypes.Type(value = NonRecordable.class, name = "nonRecordable"),
|
@JsonSubTypes.Type(value = NonRecordable.class, name = "nonRecordable"),
|
||||||
@JsonSubTypes.Type(value = Talkgroup.class, name = "talkgroup"),
|
@JsonSubTypes.Type(value = NXDNTypeDRadio.class, name = "nxdnTypeDRadio"),
|
||||||
@JsonSubTypes.Type(value = TalkgroupRange.class, name = "talkgroupRange"),
|
@JsonSubTypes.Type(value = NXDNTypeDRadioRange.class, name = "nxdnTypeDRadioRange"),
|
||||||
|
@JsonSubTypes.Type(value = NXDNTypeDTalkgroup.class, name = "nxdnTypeDTalkgroup"),
|
||||||
|
@JsonSubTypes.Type(value = NXDNTypeDTalkgroupRange.class, name = "nxdnTypeDTalkgroupRange"),
|
||||||
|
@JsonSubTypes.Type(value = P25FullyQualifiedRadio.class, name = "p25FullyQualifiedRadio"),
|
||||||
|
@JsonSubTypes.Type(value = P25FullyQualifiedTalkgroup.class, name = "p25FullyQualifiedTalkgroup"),
|
||||||
@JsonSubTypes.Type(value = Priority.class, name = "priority"),
|
@JsonSubTypes.Type(value = Priority.class, name = "priority"),
|
||||||
|
@JsonSubTypes.Type(value = Radio.class, name = "radio"),
|
||||||
|
@JsonSubTypes.Type(value = RadioRange.class, name = "radioRange"),
|
||||||
@JsonSubTypes.Type(value = Record.class, name = "record"),
|
@JsonSubTypes.Type(value = Record.class, name = "record"),
|
||||||
@JsonSubTypes.Type(value = SiteID.class, name = "siteID"),
|
@JsonSubTypes.Type(value = SiteID.class, name = "siteID"),
|
||||||
@JsonSubTypes.Type(value = StatusID.class, name = "statusID"),
|
@JsonSubTypes.Type(value = StreamAsTalkgroup.class, name = "streamAsTalkgroup"),
|
||||||
@JsonSubTypes.Type(value = LegacyTalkgroupID.class, name = "talkgroupID"),
|
@JsonSubTypes.Type(value = Talkgroup.class, name = "talkgroup"),
|
||||||
|
@JsonSubTypes.Type(value = TalkgroupRange.class, name = "talkgroupRange"),
|
||||||
|
@JsonSubTypes.Type(value = TonesID.class, name = "tones"),
|
||||||
|
@JsonSubTypes.Type(value = UserStatusID.class, name = "statusID"),
|
||||||
|
@JsonSubTypes.Type(value = UnitStatusID.class, name = "unitStatusID"),
|
||||||
@JsonSubTypes.Type(value = UniqueID.class, name = "uniqueID")
|
@JsonSubTypes.Type(value = UniqueID.class, name = "uniqueID")
|
||||||
})
|
})
|
||||||
@JacksonXmlRootElement(localName = "id")
|
@JacksonXmlRootElement(localName = "id")
|
||||||
public abstract class AliasID
|
public abstract class AliasID
|
||||||
{
|
{
|
||||||
|
private SimpleStringProperty mValueProperty = new SimpleStringProperty();
|
||||||
|
private BooleanProperty mOverlapProperty = new SimpleBooleanProperty();
|
||||||
|
|
||||||
public AliasID()
|
public AliasID()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String property representation of this alias ID
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public SimpleStringProperty valueProperty()
|
||||||
|
{
|
||||||
|
return mValueProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this alias identifier overlaps with any other alias identifier in the same alias list
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public BooleanProperty overlapProperty()
|
||||||
|
{
|
||||||
|
return mOverlapProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the overlap flag for this alias id. Overlap indicates that this identifier collides with another
|
||||||
|
* identifier within the same alias list.
|
||||||
|
*/
|
||||||
|
public void setOverlap(boolean overlap)
|
||||||
|
{
|
||||||
|
mOverlapProperty.set(overlap);
|
||||||
|
updateValueProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the value property for this alias ID. Note: this method is intended to be invoked by all subclasses
|
||||||
|
* each time that any of the subclass member variable values change.
|
||||||
|
*/
|
||||||
|
public void updateValueProperty()
|
||||||
|
{
|
||||||
|
if(overlapProperty().get())
|
||||||
|
{
|
||||||
|
valueProperty().set(toString() + " - Error: Overlap");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
valueProperty().set(toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
//Hack: harmless, but the list extractor does not consistently update unless we do this.
|
||||||
|
valueProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public abstract AliasIDType getType();
|
public abstract AliasIDType getType();
|
||||||
|
|
||||||
public abstract boolean matches(AliasID id);
|
public abstract boolean matches(AliasID id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this alias ID overlaps with another alias ID.
|
||||||
|
* Note: this method is intended to be overridden by certain subclass implementations.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean overlaps(AliasID id)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public abstract boolean isValid();
|
public abstract boolean isValid();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the identifier is an audio identifier (monitor, record, stream)
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public abstract boolean isAudioIdentifier();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an observable property extractor for use with observable lists to detect changes internal to this object.
|
||||||
|
*/
|
||||||
|
public static Callback<AliasID,Observable[]> extractor()
|
||||||
|
{
|
||||||
|
return (AliasID aid) -> new Observable[] {aid.valueProperty(), aid.overlapProperty()};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,22 +14,35 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.alias.id;
|
package io.github.dsheirer.alias.id;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
public enum AliasIDType
|
public enum AliasIDType
|
||||||
{
|
{
|
||||||
BROADCAST_CHANNEL("Audio Broadcast Channel"),
|
BROADCAST_CHANNEL("Audio Broadcast Channel"),
|
||||||
|
DCS("Digital Coded Squelch (DCS)"),
|
||||||
ESN("ESN"),
|
ESN("ESN"),
|
||||||
INVERT("Audio Inversion"),
|
INVERT("Audio Inversion"),
|
||||||
LOJACK("LoJack"),
|
LOJACK("LoJack"),
|
||||||
LTR_NET_UID("LTR-Net UID"),
|
LTR_NET_UID("LTR-Net UID"),
|
||||||
MIN("Passport MIN"),
|
MIN("Passport MIN"),
|
||||||
|
NXDN_TYPE_D_RADIO_ID("NXDN Type-D Radio ID"),
|
||||||
|
NXDN_TYPE_D_RADIO_ID_RANGE("NXDN Type-D Radio ID Range"),
|
||||||
|
NXDN_TYPE_D_TALKGROUP("NXDN Type-D Talkgroup"),
|
||||||
|
NXDN_TYPE_D_TALKGROUP_RANGE("NXDN Type-D Talkgroup Range"),
|
||||||
|
P25_FULLY_QUALIFIED_RADIO_ID("P25 Fully Qualified Radio ID"),
|
||||||
|
P25_FULLY_QUALIFIED_TALKGROUP("P25 Fully Qualified Talkgroup"),
|
||||||
PRIORITY("Audio Priority"),
|
PRIORITY("Audio Priority"),
|
||||||
|
RADIO_ID("Radio ID"),
|
||||||
|
RADIO_ID_RANGE("Radio ID Range"),
|
||||||
RECORD("Record"),
|
RECORD("Record"),
|
||||||
SITE("Site"),
|
SITE("Site"),
|
||||||
STATUS("Status"),
|
STATUS("User Status"),
|
||||||
|
TONES("Tone Sequence"),
|
||||||
|
UNIT_STATUS("Unit Status"),
|
||||||
TALKGROUP("Talkgroup"),
|
TALKGROUP("Talkgroup"),
|
||||||
TALKGROUP_RANGE("Talkgroup Range"),
|
TALKGROUP_RANGE("Talkgroup Range"),
|
||||||
|
|
||||||
@@ -48,6 +60,11 @@ public enum AliasIDType
|
|||||||
mLabel = label;
|
mLabel = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Values used by the View-By alias editor
|
||||||
|
public static EnumSet<AliasIDType> VIEW_BY_VALUES = EnumSet.of(TALKGROUP, TALKGROUP_RANGE, RADIO_ID, RADIO_ID_RANGE,
|
||||||
|
NXDN_TYPE_D_RADIO_ID, NXDN_TYPE_D_RADIO_ID_RANGE, NXDN_TYPE_D_TALKGROUP, NXDN_TYPE_D_TALKGROUP_RANGE,
|
||||||
|
P25_FULLY_QUALIFIED_RADIO_ID, P25_FULLY_QUALIFIED_TALKGROUP, UNIT_STATUS, STATUS, TONES);
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return mLabel;
|
return mLabel;
|
||||||
|
|||||||
@@ -1,373 +0,0 @@
|
|||||||
/*
|
|
||||||
* ******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* *****************************************************************************
|
|
||||||
*/
|
|
||||||
package io.github.dsheirer.alias.id;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.Alias;
|
|
||||||
import io.github.dsheirer.alias.AliasEvent;
|
|
||||||
import io.github.dsheirer.alias.AliasFactory;
|
|
||||||
import io.github.dsheirer.alias.AliasModel;
|
|
||||||
import io.github.dsheirer.audio.broadcast.BroadcastModel;
|
|
||||||
import io.github.dsheirer.gui.editor.Editor;
|
|
||||||
import io.github.dsheirer.gui.editor.EmptyEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.DefaultListModel;
|
|
||||||
import javax.swing.JButton;
|
|
||||||
import javax.swing.JList;
|
|
||||||
import javax.swing.JMenuItem;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JPopupMenu;
|
|
||||||
import javax.swing.JScrollPane;
|
|
||||||
import javax.swing.ListModel;
|
|
||||||
import javax.swing.ListSelectionModel;
|
|
||||||
import javax.swing.event.ListSelectionEvent;
|
|
||||||
import javax.swing.event.ListSelectionListener;
|
|
||||||
import java.awt.EventQueue;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class AliasIdentifierEditor extends Editor<Alias>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static ListModel<AliasID> EMPTY_MODEL = new DefaultListModel<>();
|
|
||||||
private JList<AliasID> mAliasIDList = new JList<>(EMPTY_MODEL);
|
|
||||||
private JButton mNewIDButton;
|
|
||||||
private JButton mCloneIDButton;
|
|
||||||
private JButton mDeleteIDButton;
|
|
||||||
private EditorContainer mEditorContainer = new EditorContainer();
|
|
||||||
|
|
||||||
private AliasModel mAliasModel;
|
|
||||||
private BroadcastModel mBroadcastModel;
|
|
||||||
|
|
||||||
public AliasIdentifierEditor(AliasModel aliasModel, BroadcastModel broadcastModel)
|
|
||||||
{
|
|
||||||
mAliasModel = aliasModel;
|
|
||||||
mBroadcastModel = broadcastModel;
|
|
||||||
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
setLayout(new MigLayout("fill,wrap 3",
|
|
||||||
"[grow,fill][grow,fill][grow,fill]", "[][grow,fill][]"));
|
|
||||||
|
|
||||||
mAliasIDList.setVisibleRowCount(6);
|
|
||||||
mAliasIDList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
|
||||||
mAliasIDList.setLayoutOrientation(JList.VERTICAL);
|
|
||||||
mAliasIDList.addListSelectionListener(new ListSelectionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void valueChanged(ListSelectionEvent event)
|
|
||||||
{
|
|
||||||
if(!event.getValueIsAdjusting())
|
|
||||||
{
|
|
||||||
JList<?> list = (JList<?>)event.getSource();
|
|
||||||
|
|
||||||
Object selectedItem = list.getSelectedValue();
|
|
||||||
|
|
||||||
if(selectedItem != null && selectedItem instanceof AliasID)
|
|
||||||
{
|
|
||||||
AliasID selected = (AliasID)selectedItem;
|
|
||||||
|
|
||||||
mEditorContainer.setAliasID(selected);
|
|
||||||
|
|
||||||
mCloneIDButton.setEnabled(true);
|
|
||||||
mDeleteIDButton.setEnabled(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mCloneIDButton.setEnabled(false);
|
|
||||||
mDeleteIDButton.setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scroller = new JScrollPane(mAliasIDList);
|
|
||||||
add(scroller, "span,grow");
|
|
||||||
|
|
||||||
add(mEditorContainer, "span,grow");
|
|
||||||
|
|
||||||
mNewIDButton = new JButton("New ...");
|
|
||||||
mNewIDButton.setToolTipText("Create a new Alias Identifier");
|
|
||||||
mNewIDButton.addMouseListener(new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(MouseEvent e)
|
|
||||||
{
|
|
||||||
JPopupMenu menu = new JPopupMenu();
|
|
||||||
|
|
||||||
menu.add(new AddAliasIdentifierItem(AliasIDType.TALKGROUP));
|
|
||||||
menu.add(new AddAliasIdentifierItem(AliasIDType.TALKGROUP_RANGE));
|
|
||||||
menu.add(new AddAliasIdentifierItem(AliasIDType.ESN));
|
|
||||||
// menu.add(new AddAliasIdentifierItem(AliasIDType.LOJACK));
|
|
||||||
menu.add(new AddAliasIdentifierItem(AliasIDType.STATUS));
|
|
||||||
|
|
||||||
menu.addSeparator();
|
|
||||||
|
|
||||||
menu.add(new AddAliasIdentifierItem(AliasIDType.BROADCAST_CHANNEL));
|
|
||||||
|
|
||||||
if(hasItem())
|
|
||||||
{
|
|
||||||
Alias alias = getItem();
|
|
||||||
|
|
||||||
if(!alias.isRecordable())
|
|
||||||
{
|
|
||||||
menu.add(new AddAliasIdentifierItem(AliasIDType.RECORD));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!alias.hasCallPriority())
|
|
||||||
{
|
|
||||||
menu.add(new AddAliasIdentifierItem(AliasIDType.PRIORITY));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
menu.show(e.getComponent(), e.getX(), e.getY());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
add(mNewIDButton);
|
|
||||||
|
|
||||||
mCloneIDButton = new JButton("Clone");
|
|
||||||
mCloneIDButton.setToolTipText("Create a copy of the currently selected identifier");
|
|
||||||
mCloneIDButton.setEnabled(false);
|
|
||||||
mCloneIDButton.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
AliasID selected = mAliasIDList.getSelectedValue();
|
|
||||||
|
|
||||||
if(selected != null)
|
|
||||||
{
|
|
||||||
AliasID clone = AliasFactory.copyOf(selected);
|
|
||||||
|
|
||||||
if(clone != null)
|
|
||||||
{
|
|
||||||
addAliasIDToList(clone);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(mCloneIDButton);
|
|
||||||
|
|
||||||
mDeleteIDButton = new JButton("Delete");
|
|
||||||
mDeleteIDButton.setToolTipText("Delete the currently selected identifier");
|
|
||||||
mDeleteIDButton.setEnabled(false);
|
|
||||||
mDeleteIDButton.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
final AliasID selected = mAliasIDList.getSelectedValue();
|
|
||||||
|
|
||||||
if(selected != null)
|
|
||||||
{
|
|
||||||
int choice = JOptionPane.showConfirmDialog(mDeleteIDButton,
|
|
||||||
"Do you want to delete [" + selected.toString() + "]",
|
|
||||||
"Are you sure?", JOptionPane.YES_NO_OPTION);
|
|
||||||
|
|
||||||
if(choice == JOptionPane.YES_OPTION && hasItem())
|
|
||||||
{
|
|
||||||
Alias alias = getItem();
|
|
||||||
|
|
||||||
alias.removeAliasID(selected);
|
|
||||||
|
|
||||||
mAliasModel.broadcast(new AliasEvent(alias, AliasEvent.Event.CHANGE));
|
|
||||||
|
|
||||||
setItem(alias);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(mDeleteIDButton, "wrap");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem(Alias alias)
|
|
||||||
{
|
|
||||||
super.setItem(alias);
|
|
||||||
|
|
||||||
if(alias == null || alias.getId().isEmpty())
|
|
||||||
{
|
|
||||||
mAliasIDList.setModel(EMPTY_MODEL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DefaultListModel<AliasID> model = new DefaultListModel<AliasID>();
|
|
||||||
|
|
||||||
List<AliasID> ids = alias.getId();
|
|
||||||
|
|
||||||
Collections.sort(ids, new Comparator<AliasID>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public int compare(AliasID o1, AliasID o2)
|
|
||||||
{
|
|
||||||
return o1.toString().compareTo(o2.toString());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
for(AliasID id : ids)
|
|
||||||
{
|
|
||||||
model.addElement(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
mAliasIDList.setModel(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
mEditorContainer.setAliasID(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
if(isModified() || mEditorContainer.isModified())
|
|
||||||
{
|
|
||||||
if(mEditorContainer.isModified())
|
|
||||||
{
|
|
||||||
mEditorContainer.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
|
|
||||||
if(hasItem())
|
|
||||||
{
|
|
||||||
mAliasModel.broadcast(new AliasEvent(getItem(), AliasEvent.Event.CHANGE));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EditorContainer extends JPanel
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private Editor<AliasID> mEditor = new EmptyEditor<>();
|
|
||||||
|
|
||||||
public EditorContainer()
|
|
||||||
{
|
|
||||||
setLayout(new MigLayout("", "[grow,fill]", "[grow,fill]"));
|
|
||||||
|
|
||||||
add(mEditor);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isModified()
|
|
||||||
{
|
|
||||||
if(mEditor != null)
|
|
||||||
{
|
|
||||||
return mEditor.isModified();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
if(mEditor != null)
|
|
||||||
{
|
|
||||||
mEditor.save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAliasID(AliasID aliasID)
|
|
||||||
{
|
|
||||||
if(mEditor != null)
|
|
||||||
{
|
|
||||||
if(mEditor.isModified())
|
|
||||||
{
|
|
||||||
int option = JOptionPane.showConfirmDialog(
|
|
||||||
EditorContainer.this,
|
|
||||||
"Identifier settings have changed. Do you want to save these changes?",
|
|
||||||
"Save Changes?",
|
|
||||||
JOptionPane.YES_NO_OPTION,
|
|
||||||
JOptionPane.QUESTION_MESSAGE);
|
|
||||||
|
|
||||||
if(option == JOptionPane.YES_OPTION)
|
|
||||||
{
|
|
||||||
mEditor.save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
removeAll();
|
|
||||||
|
|
||||||
//This will always give us an editor
|
|
||||||
mEditor = AliasFactory.getEditor(aliasID, mBroadcastModel);
|
|
||||||
|
|
||||||
add(mEditor);
|
|
||||||
|
|
||||||
revalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addAliasIDToList(final AliasID id)
|
|
||||||
{
|
|
||||||
if(id != null && hasItem())
|
|
||||||
{
|
|
||||||
final Alias alias = getItem();
|
|
||||||
|
|
||||||
alias.addAliasID(id);
|
|
||||||
|
|
||||||
EventQueue.invokeLater(new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
setItem(alias);
|
|
||||||
|
|
||||||
mAliasIDList.setSelectedValue(id, true);
|
|
||||||
|
|
||||||
AliasIdentifierEditor.this.setModified(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class AddAliasIdentifierItem extends JMenuItem
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private AliasIDType mAliasIDType;
|
|
||||||
|
|
||||||
public AddAliasIdentifierItem(AliasIDType type)
|
|
||||||
{
|
|
||||||
super(type.toString());
|
|
||||||
|
|
||||||
mAliasIDType = type;
|
|
||||||
|
|
||||||
addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
final AliasID id = AliasFactory.getAliasID(mAliasIDType);
|
|
||||||
|
|
||||||
addAliasIDToList(id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
46
src/main/java/io/github/dsheirer/alias/id/INXDNTypeD.java
Normal file
46
src/main/java/io/github/dsheirer/alias/id/INXDNTypeD.java
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.alias.id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NXDN Type-D alias identifier composed of a home repeater and a radio or talkgroup identifier value.
|
||||||
|
*/
|
||||||
|
public interface INXDNTypeD
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Home repeater for the identifier
|
||||||
|
*/
|
||||||
|
int getHomeRepeater();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the home repeater for the identifier
|
||||||
|
*/
|
||||||
|
void setHomeRepeater(int homeRepeater);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Radio or talkgroup value, without the home repeater.
|
||||||
|
*/
|
||||||
|
int getIdentifier();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the radio or talkgroup value, without the home repeater.
|
||||||
|
*/
|
||||||
|
void setIdentifier(int identifier);
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.alias.id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NXDN Type-D alias identifier range of radio or talkgroup values that share a common home repeater.
|
||||||
|
*/
|
||||||
|
public interface INXDNTypeDRange
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Home repeater for the range
|
||||||
|
*/
|
||||||
|
int getHomeRepeater();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the home repeater for the range
|
||||||
|
*/
|
||||||
|
void setHomeRepeater(int homeRepeater);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minimum radio or talkgroup value, without the home repeater.
|
||||||
|
*/
|
||||||
|
int getMinIdentifier();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the minimum radio or talkgroup value, without the home repeater.
|
||||||
|
*/
|
||||||
|
void setMinIdentifier(int identifier);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maximum radio or talkgroup value, without the home repeater.
|
||||||
|
*/
|
||||||
|
int getMaxIdentifier();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the maximum radio or talkgroup value, without the home repeater.
|
||||||
|
*/
|
||||||
|
void setMaxIdentifier(int identifier);
|
||||||
|
}
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.Validate;
|
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public class WildcardID implements Comparable<WildcardID>
|
|
||||||
{
|
|
||||||
public static final String WILDCARD = "*";
|
|
||||||
public static final String REGEX_WILDCARD = ".";
|
|
||||||
|
|
||||||
private String mValue;
|
|
||||||
private Pattern mPattern;
|
|
||||||
private int mWeight;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wildcard identifier for matching to string identifiers containing single-character (*) wildcard values.
|
|
||||||
*
|
|
||||||
* Supports ordering from most-specific to least-specific using the build-in weighting calculation where identifier
|
|
||||||
* patterns containing fewer wildcards closer to the least significant digit will be weighted more heavily than
|
|
||||||
* identifier patterns containing more wildcards, or wildcard characters in the most significant digits.
|
|
||||||
*
|
|
||||||
* @param value is a string value containing one or more asterisk (*) single character wildcard with a maximum
|
|
||||||
* length of 10 characters.
|
|
||||||
*
|
|
||||||
* @throws AssertionError if the value is null, longer than 10 characters, or doesn't contain at least 1 asterisk
|
|
||||||
* @throws IllegalArgumentException if the value cannot be compiled as a regular expression after converting the
|
|
||||||
* asterisk characters to the regex single-character wildcard value (.)
|
|
||||||
*/
|
|
||||||
public WildcardID(String value)
|
|
||||||
{
|
|
||||||
Validate.isTrue(value != null && value.contains(WILDCARD) && value.length() < 10);
|
|
||||||
|
|
||||||
mValue = value;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
mPattern = Pattern.compile(value.replace(WILDCARD, REGEX_WILDCARD));
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
throw new IllegalArgumentException("Invalid regex pattern for alias ID value [" + value + "]", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
mWeight = calculateWeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String value()
|
|
||||||
{
|
|
||||||
return mValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates if the id matches the internal regex pattern for this wildcard alias ID
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public boolean matches(String id)
|
|
||||||
{
|
|
||||||
return id != null && mPattern.matcher(id).matches();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int weight()
|
|
||||||
{
|
|
||||||
return mWeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculates a weighting value for wildcard character quantity and significant digit location
|
|
||||||
*/
|
|
||||||
private int calculateWeight()
|
|
||||||
{
|
|
||||||
int weight = 0;
|
|
||||||
int characterCount = -1;
|
|
||||||
|
|
||||||
for( int x = 0; x < mValue.length(); x++)
|
|
||||||
{
|
|
||||||
if(mValue.substring(x, x + 1).equals(WILDCARD))
|
|
||||||
{
|
|
||||||
weight += (int)(Math.pow(2, mValue.length() - x - 1)); //Position weight
|
|
||||||
characterCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
weight += (int)(Math.pow(2, characterCount)) * 1000; //Character count weight
|
|
||||||
|
|
||||||
return weight;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int compareTo(WildcardID otherWildcardID)
|
|
||||||
{
|
|
||||||
return Integer.compare(this.weight(), otherWildcardID.weight());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +1,24 @@
|
|||||||
/*******************************************************************************
|
/*
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* * ******************************************************************************
|
||||||
* it under the terms of the GNU General Public License as published by
|
* * Copyright (C) 2014-2020 Dennis Sheirer
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* *
|
||||||
* (at your option) any later version.
|
* * This program is free software: you can redistribute it and/or modify
|
||||||
|
* * it under the terms of the GNU General Public License as published by
|
||||||
|
* * the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* * (at your option) any later version.
|
||||||
|
* *
|
||||||
|
* * This program is distributed in the hope that it will be useful,
|
||||||
|
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* * GNU General Public License for more details.
|
||||||
|
* *
|
||||||
|
* * You should have received a copy of the GNU General Public License
|
||||||
|
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* * *****************************************************************************
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
*/
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id.broadcast;
|
package io.github.dsheirer.alias.id.broadcast;
|
||||||
|
|
||||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
@@ -31,6 +34,12 @@ public class BroadcastChannel extends AliasID implements Comparable<BroadcastCha
|
|||||||
//JAXB Constructor
|
//JAXB Constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(BroadcastChannel other)
|
public int compareTo(BroadcastChannel other)
|
||||||
{
|
{
|
||||||
@@ -94,6 +103,7 @@ public class BroadcastChannel extends AliasID implements Comparable<BroadcastCha
|
|||||||
public void setChannelName(String channel)
|
public void setChannelName(String channel)
|
||||||
{
|
{
|
||||||
mChannelName = channel;
|
mChannelName = channel;
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
||||||
@@ -118,13 +128,6 @@ public class BroadcastChannel extends AliasID implements Comparable<BroadcastCha
|
|||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
if(isValid())
|
return isValid() ? mChannelName : "(invalid)";
|
||||||
{
|
|
||||||
return "Broadcast Channel: " + mChannelName;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return "Broadcast Channel: None Selected";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,129 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id.broadcast;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
|
|
||||||
import io.github.dsheirer.audio.broadcast.BroadcastModel;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class BroadcastChannelEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>Audio Broadcast Channel</h3>"
|
|
||||||
+ "Name of a audio streaming broadcast configuration<br>"
|
|
||||||
+ "to be used for streaming audio to an external<br>"
|
|
||||||
+ "streaming server";
|
|
||||||
|
|
||||||
private JComboBox<String> mBroadcastConfigurations;
|
|
||||||
private BroadcastModel mBroadcastModel;
|
|
||||||
|
|
||||||
public BroadcastChannelEditor(AliasID aliasID, BroadcastModel broadcastModel)
|
|
||||||
{
|
|
||||||
mBroadcastModel = broadcastModel;
|
|
||||||
|
|
||||||
initGUI();
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 1", "[]", "[][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Broadcast Channel" ), "grow" );
|
|
||||||
|
|
||||||
List<String> channelNames = mBroadcastModel.getBroadcastConfigurationNames();
|
|
||||||
|
|
||||||
mBroadcastConfigurations = new JComboBox<String>(channelNames.toArray(new String[channelNames.size()]));
|
|
||||||
mBroadcastConfigurations.addActionListener(new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
setModified(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
add(mBroadcastConfigurations, "grow");
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( BroadcastChannelEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem(AliasID item)
|
|
||||||
{
|
|
||||||
super.setItem(item);
|
|
||||||
|
|
||||||
if(item instanceof BroadcastChannel)
|
|
||||||
{
|
|
||||||
BroadcastChannel channel = (BroadcastChannel)item;
|
|
||||||
|
|
||||||
if(channel.isValid())
|
|
||||||
{
|
|
||||||
mBroadcastConfigurations.setSelectedItem(channel.getChannelName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
String channel = (String)mBroadcastConfigurations.getSelectedItem();
|
|
||||||
|
|
||||||
BroadcastConfiguration selectedConfiguration = mBroadcastModel.getBroadcastConfiguration(channel);
|
|
||||||
|
|
||||||
|
|
||||||
if(selectedConfiguration != null)
|
|
||||||
{
|
|
||||||
((BroadcastChannel)getItem()).setChannelName(selectedConfiguration.getName());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
((BroadcastChannel)getItem()).setChannelName(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
111
src/main/java/io/github/dsheirer/alias/id/dcs/Dcs.java
Normal file
111
src/main/java/io/github/dsheirer/alias/id/dcs/Dcs.java
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.alias.id.dcs;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
|
import io.github.dsheirer.alias.id.AliasID;
|
||||||
|
import io.github.dsheirer.alias.id.AliasIDType;
|
||||||
|
import io.github.dsheirer.module.decode.squelch.dcs.DCSCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Digital Coded Squelch (DCS) tone identifier
|
||||||
|
*/
|
||||||
|
public class Dcs extends AliasID implements Comparable<Dcs>
|
||||||
|
{
|
||||||
|
private DCSCode mDCSCode;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AliasIDType getType()
|
||||||
|
{
|
||||||
|
return AliasIDType.DCS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean matches(AliasID id)
|
||||||
|
{
|
||||||
|
if(isValid() && id instanceof Dcs other)
|
||||||
|
{
|
||||||
|
return other.isValid() && getDCSCode().equals(other.getDCSCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DCS code
|
||||||
|
* @return DCS code or null.
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "code")
|
||||||
|
public DCSCode getDCSCode()
|
||||||
|
{
|
||||||
|
return mDCSCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the DCS code value.
|
||||||
|
* @param dcsCode to set
|
||||||
|
*/
|
||||||
|
public void setDCSCode(DCSCode dcsCode)
|
||||||
|
{
|
||||||
|
mDCSCode = dcsCode;
|
||||||
|
updateValueProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid()
|
||||||
|
{
|
||||||
|
return mDCSCode != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
if(isValid())
|
||||||
|
{
|
||||||
|
return getDCSCode().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return "DCS-Invalid - No Tone Selected";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Dcs o)
|
||||||
|
{
|
||||||
|
if(isValid())
|
||||||
|
{
|
||||||
|
if(o.isValid())
|
||||||
|
{
|
||||||
|
return getDCSCode().compareTo(o.getDCSCode());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id.esn;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class ESNEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT =
|
|
||||||
"<html><h3>Electronic Serial Number (ESN)</h3>"
|
|
||||||
+ "<b>ESN:</b> hexadecimal 0-9, A-F (e.g. <u>ABCD1234</u> )<br>"
|
|
||||||
+ "<b>Wildcard:</b> use an asterisk (*) to wildcard individual<br>"
|
|
||||||
+ "digits (e.g. <u>ABCD123*</u> or <u>AB**1**4</u>)"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JTextField mTextField;
|
|
||||||
|
|
||||||
public ESNEditor( AliasID aliasID )
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "ESN:" ) );
|
|
||||||
mTextField = new JTextField();
|
|
||||||
mTextField.getDocument().addDocumentListener( this );
|
|
||||||
mTextField.setToolTipText( HELP_TEXT );
|
|
||||||
add( mTextField, "growx,push" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( ESNEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public Esn getEsn()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof Esn )
|
|
||||||
{
|
|
||||||
return (Esn)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasID aliasID )
|
|
||||||
{
|
|
||||||
super.setItem( aliasID );
|
|
||||||
|
|
||||||
Esn esn = getEsn();
|
|
||||||
|
|
||||||
if( esn != null )
|
|
||||||
{
|
|
||||||
mTextField.setText( esn.getEsn() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
Esn esn = getEsn();
|
|
||||||
|
|
||||||
if( esn != null )
|
|
||||||
{
|
|
||||||
esn.setEsn( mTextField.getText() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -29,6 +29,12 @@ public class Esn extends AliasID
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "esn")
|
@JacksonXmlProperty(isAttribute = true, localName = "esn")
|
||||||
public String getEsn()
|
public String getEsn()
|
||||||
{
|
{
|
||||||
@@ -44,6 +50,7 @@ public class Esn extends AliasID
|
|||||||
public void setEsn(String esn )
|
public void setEsn(String esn )
|
||||||
{
|
{
|
||||||
mEsn = esn;
|
mEsn = esn;
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ public class FleetsyncID extends AliasID
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "ident")
|
@JacksonXmlProperty(isAttribute = true, localName = "ident")
|
||||||
public String getIdent()
|
public String getIdent()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,137 +0,0 @@
|
|||||||
/*
|
|
||||||
* ******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* *****************************************************************************
|
|
||||||
*/
|
|
||||||
package io.github.dsheirer.alias.id.legacy.fleetsync;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.swing.JFormattedTextField;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JTextField;
|
|
||||||
import javax.swing.text.MaskFormatter;
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Cursor;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class FleetsyncIDEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private final static Logger mLog = LoggerFactory.getLogger( FleetsyncIDEditor.class );
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>Fleetsync Identifier</h3>"
|
|
||||||
+ "<b>Fleetsync:</b> ggg-uuuu where g=Group and u=Unit (e.g. <u>001-0001</u>)<br>"
|
|
||||||
+ "<b>Wildcard:</b> use an asterisk (*) for each digit (e.g. <u>001-****</u>)"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JTextField mTextField;
|
|
||||||
|
|
||||||
public FleetsyncIDEditor( AliasID aliasID )
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Fleetsync ID:" ) );
|
|
||||||
|
|
||||||
MaskFormatter formatter = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//Mask: 3 digits - 4 digits
|
|
||||||
formatter = new MaskFormatter( "###-####" );
|
|
||||||
}
|
|
||||||
catch( Exception e )
|
|
||||||
{
|
|
||||||
//Do nothing, the mask was invalid
|
|
||||||
}
|
|
||||||
|
|
||||||
mTextField = new JFormattedTextField( formatter );
|
|
||||||
mTextField.getDocument().addDocumentListener( this );
|
|
||||||
mTextField.setToolTipText( HELP_TEXT );
|
|
||||||
|
|
||||||
add( mTextField, "growx,push" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( FleetsyncIDEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public FleetsyncID getFleetsyncID()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof FleetsyncID )
|
|
||||||
{
|
|
||||||
return (FleetsyncID)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasID aliasID )
|
|
||||||
{
|
|
||||||
super.setItem( aliasID );
|
|
||||||
|
|
||||||
FleetsyncID fleetsync = getFleetsyncID();
|
|
||||||
|
|
||||||
if( fleetsync != null )
|
|
||||||
{
|
|
||||||
mTextField.setText( fleetsync.getIdent() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
FleetsyncID fleetsync = getFleetsyncID();
|
|
||||||
|
|
||||||
if( fleetsync != null )
|
|
||||||
{
|
|
||||||
fleetsync.setIdent( mTextField.getText() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -32,6 +32,12 @@ public class MDC1200ID extends AliasID
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "ident")
|
@JacksonXmlProperty(isAttribute = true, localName = "ident")
|
||||||
public String getIdent()
|
public String getIdent()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,133 +0,0 @@
|
|||||||
/*
|
|
||||||
* ******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* *****************************************************************************
|
|
||||||
*/
|
|
||||||
package io.github.dsheirer.alias.id.legacy.mdc;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.JFormattedTextField;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JTextField;
|
|
||||||
import javax.swing.text.MaskFormatter;
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Cursor;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class MDC1200IDEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>MDC-1200 Identifier</h3>"
|
|
||||||
+ "<b>MDC-1200:</b> four digit [0-9] value (e.g. <u>1234</u>)<br>"
|
|
||||||
+ "<b>Wildcard:</b> use an asterisk (*) to wildcard individual<br>"
|
|
||||||
+ "digits (e.g. <u>123*</u> or <u>**34</u>)"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JTextField mTextField;
|
|
||||||
|
|
||||||
public MDC1200IDEditor(AliasID aliasID)
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem(aliasID);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout(new MigLayout("fill,wrap 2", "[right][left]", "[][]"));
|
|
||||||
|
|
||||||
add(new JLabel("MDC-1200 ID:"));
|
|
||||||
|
|
||||||
MaskFormatter formatter = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//Mask: 4 digits
|
|
||||||
formatter = new MaskFormatter("####");
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
//Do nothing, the mask was invalid
|
|
||||||
}
|
|
||||||
|
|
||||||
mTextField = new JFormattedTextField(formatter);
|
|
||||||
mTextField.getDocument().addDocumentListener(this);
|
|
||||||
mTextField.setToolTipText(HELP_TEXT);
|
|
||||||
add(mTextField, "growx,push");
|
|
||||||
|
|
||||||
JLabel help = new JLabel("Help ...");
|
|
||||||
help.setForeground(Color.BLUE.brighter());
|
|
||||||
help.setCursor(new Cursor(Cursor.HAND_CURSOR));
|
|
||||||
help.addMouseListener(new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(MouseEvent e)
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog(MDC1200IDEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(help, "align left");
|
|
||||||
}
|
|
||||||
|
|
||||||
public MDC1200ID getMDC1200ID()
|
|
||||||
{
|
|
||||||
if(getItem() instanceof MDC1200ID)
|
|
||||||
{
|
|
||||||
return (MDC1200ID)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem(AliasID aliasID)
|
|
||||||
{
|
|
||||||
super.setItem(aliasID);
|
|
||||||
|
|
||||||
MDC1200ID mdc = getMDC1200ID();
|
|
||||||
|
|
||||||
if(mdc != null)
|
|
||||||
{
|
|
||||||
mTextField.setText(mdc.getIdent());
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
MDC1200ID mdc = getMDC1200ID();
|
|
||||||
|
|
||||||
if(mdc != null)
|
|
||||||
{
|
|
||||||
mdc.setIdent(mTextField.getText());
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id.legacy.mobileID;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.text.MaskFormatter;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class MINEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>Passport Mobile ID (MIN)</h3>"
|
|
||||||
+ "<b>MIN:</b> six character hex value (e.g. <u>AB12CD</u>)<br>"
|
|
||||||
+ "<b>Wildcard:</b> use an asterisk (*) to wildcard individual<br>"
|
|
||||||
+ "digits (e.g. <u>AB**CD</u> or <u>AB12**</u>)"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JTextField mTextField;
|
|
||||||
|
|
||||||
public MINEditor( AliasID aliasID )
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "MIN:" ) );
|
|
||||||
|
|
||||||
MaskFormatter formatter = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//Mask: 6 hex characters
|
|
||||||
formatter = new MaskFormatter( "HHHHHH" );
|
|
||||||
}
|
|
||||||
catch( Exception e )
|
|
||||||
{
|
|
||||||
//Do nothing, the mask was invalid
|
|
||||||
}
|
|
||||||
|
|
||||||
mTextField = new JFormattedTextField( formatter );
|
|
||||||
mTextField.getDocument().addDocumentListener( this );
|
|
||||||
mTextField.setToolTipText( HELP_TEXT );
|
|
||||||
add( mTextField, "growx,push" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( MINEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public Min getMin()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof Min )
|
|
||||||
{
|
|
||||||
return (Min)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasID aliasID )
|
|
||||||
{
|
|
||||||
super.setItem( aliasID );
|
|
||||||
|
|
||||||
Min min = getMin();
|
|
||||||
|
|
||||||
if( min != null )
|
|
||||||
{
|
|
||||||
mTextField.setText( min.getMin() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
Min min = getMin();
|
|
||||||
|
|
||||||
if( min != null )
|
|
||||||
{
|
|
||||||
min.setMin( mTextField.getText() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -33,6 +33,12 @@ public class Min extends AliasID
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "min")
|
@JacksonXmlProperty(isAttribute = true, localName = "min")
|
||||||
public String getMin()
|
public String getMin()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,6 +32,12 @@ public class MPT1327ID extends AliasID
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "ident")
|
@JacksonXmlProperty(isAttribute = true, localName = "ident")
|
||||||
public String getIdent()
|
public String getIdent()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,135 +0,0 @@
|
|||||||
/*
|
|
||||||
* ******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* *****************************************************************************
|
|
||||||
*/
|
|
||||||
package io.github.dsheirer.alias.id.legacy.mpt1327;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.JFormattedTextField;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JTextField;
|
|
||||||
import javax.swing.text.MaskFormatter;
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Cursor;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class MPT1327IDEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>MPT-1327 Identifier</h3>"
|
|
||||||
+ "<b>MPT-1327:</b> decimal (0-9) format ppp-iiii where<br>"
|
|
||||||
+ "p=Prefix and i=Ident (e.g. <u>123-0001</u>)<br>"
|
|
||||||
+ "<b>Wildcard:</b> use an asterisk (*) to wildcard individual<br>"
|
|
||||||
+ "digits (e.g. <u>ABCD123*</u> or <u>AB**1**4</u>)"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JTextField mTextField;
|
|
||||||
|
|
||||||
public MPT1327IDEditor( AliasID aliasID )
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "MPT-1327 ID:" ) );
|
|
||||||
|
|
||||||
MaskFormatter formatter = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//Mask: 3 digits - 4 digits
|
|
||||||
formatter = new MaskFormatter( "***-****" );
|
|
||||||
}
|
|
||||||
catch( Exception e )
|
|
||||||
{
|
|
||||||
//Do nothing, the mask was invalid
|
|
||||||
}
|
|
||||||
|
|
||||||
mTextField = new JFormattedTextField( formatter );
|
|
||||||
mTextField.getDocument().addDocumentListener( this );
|
|
||||||
mTextField.setToolTipText( HELP_TEXT );
|
|
||||||
|
|
||||||
add( mTextField, "growx,push" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( MPT1327IDEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public MPT1327ID getMPT1327ID()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof MPT1327ID )
|
|
||||||
{
|
|
||||||
return (MPT1327ID)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasID aliasID )
|
|
||||||
{
|
|
||||||
super.setItem( aliasID );
|
|
||||||
|
|
||||||
MPT1327ID mpt = getMPT1327ID();
|
|
||||||
|
|
||||||
if( mpt != null )
|
|
||||||
{
|
|
||||||
mTextField.setText( mpt.getIdent() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
MPT1327ID mpt = getMPT1327ID();
|
|
||||||
|
|
||||||
if( mpt != null )
|
|
||||||
{
|
|
||||||
mpt.setIdent( mTextField.getText() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -33,6 +33,12 @@ public class NonRecordable extends AliasID
|
|||||||
return AliasIDType.NON_RECORDABLE;
|
return AliasIDType.NON_RECORDABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid()
|
public boolean isValid()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
/*
|
|
||||||
* ******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* *****************************************************************************
|
|
||||||
*/
|
|
||||||
package io.github.dsheirer.alias.id.legacy.nonrecordable;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Cursor;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class NonRecordableEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>Audio Non-Recordable</h3>"
|
|
||||||
+ "This identifies an alias as non-recordable.<br><br>"
|
|
||||||
+ "The alias can still be monitored but associated audio will<br>"
|
|
||||||
+ "not be recorded.<br><br>"
|
|
||||||
+ "The default behavior when audio recording is enabled for a<br>"
|
|
||||||
+ "channel is to record all aliases except any alias with a<br>"
|
|
||||||
+ "non-recordable identifier";
|
|
||||||
|
|
||||||
public NonRecordableEditor(AliasID aliasID)
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem(aliasID);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout(new MigLayout("fill,wrap 1", "[]", "[][]"));
|
|
||||||
|
|
||||||
add(new JLabel("Non-Recordable"), "wrap");
|
|
||||||
|
|
||||||
JLabel help = new JLabel("Help ...");
|
|
||||||
help.setForeground(Color.BLUE.brighter());
|
|
||||||
help.setCursor(new Cursor(Cursor.HAND_CURSOR));
|
|
||||||
help.addMouseListener(new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(MouseEvent e)
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog(NonRecordableEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(help, "align left");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -29,6 +29,12 @@ public class SiteID extends AliasID
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "site")
|
@JacksonXmlProperty(isAttribute = true, localName = "site")
|
||||||
public String getSite()
|
public String getSite()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id.legacy.siteID;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class SiteIDEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>Site Identifier</h3>"
|
|
||||||
+ "<b>LTR-Net:</b> decimal (0-9) (e.g. <u>019</u>)<br>"
|
|
||||||
+ "<b>MPT-1327:</b> 5 digits (0-9) (e.g. <u>23619</u>)<br>"
|
|
||||||
+ "<b>Passport:</b> 3 digits (0-9) (e.g. <u>019</u>)<br>"
|
|
||||||
+ "<b>P25:</b> hex (0-9, A-F) format RR-SS where RR = RF Subsystem<br>"
|
|
||||||
+ "and SS = Site Number (e.g. RFSS 1 Site 1F: <u>01-1F</u>)"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JTextField mTextField;
|
|
||||||
|
|
||||||
public SiteIDEditor( AliasID aliasID )
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Site ID:" ) );
|
|
||||||
mTextField = new JTextField();
|
|
||||||
mTextField.getDocument().addDocumentListener( this );
|
|
||||||
mTextField.setToolTipText( HELP_TEXT );
|
|
||||||
add( mTextField, "growx,push" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( SiteIDEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public SiteID getSiteID()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof SiteID )
|
|
||||||
{
|
|
||||||
return (SiteID)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasID aliasID )
|
|
||||||
{
|
|
||||||
super.setItem( aliasID );
|
|
||||||
|
|
||||||
SiteID siteID = getSiteID();
|
|
||||||
|
|
||||||
if( siteID != null )
|
|
||||||
{
|
|
||||||
mTextField.setText( siteID.getSite() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
SiteID siteID = getSiteID();
|
|
||||||
|
|
||||||
if( siteID != null )
|
|
||||||
{
|
|
||||||
siteID.setSite( mTextField.getText() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -38,6 +38,12 @@ public class LegacyTalkgroupID extends AliasID
|
|||||||
mTalkgroup = talkgroup;
|
mTalkgroup = talkgroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "talkgroup")
|
@JacksonXmlProperty(isAttribute = true, localName = "talkgroup")
|
||||||
public String getTalkgroup()
|
public String getTalkgroup()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,121 +0,0 @@
|
|||||||
/*
|
|
||||||
* ******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* *****************************************************************************
|
|
||||||
*/
|
|
||||||
package io.github.dsheirer.alias.id.legacy.talkgroup;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JTextField;
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Cursor;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class LegacyTalkgroupIDEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT =
|
|
||||||
"<html><h3>Talkgroup Identifier</h3>"
|
|
||||||
+ "<b>P25:</b> 4 or 6 hex characters (e.g. <u>AB12</u> or <u>ABC123</u>)<br>"
|
|
||||||
+ "<b>LTR:</b> A-HH-TTT where A=Area H=Home T=Talkgroup (<u>0-01-128</u>)<br>"
|
|
||||||
+ "<b>Passport</b>: 5-digit number (<u>12345</u> or <u>00023</u>)<br>"
|
|
||||||
+ "<br>"
|
|
||||||
+ "<b>Wildcard:</b> use an asterisk (*) in place of each talkgroup digit (e.g. <u>0*1*5</u>)"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JTextField mTextField;
|
|
||||||
|
|
||||||
public LegacyTalkgroupIDEditor(AliasID aliasID)
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem(aliasID);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout(new MigLayout("fill,wrap 2", "[right][left]", "[][]"));
|
|
||||||
|
|
||||||
add(new JLabel("Talkgroup:"));
|
|
||||||
|
|
||||||
mTextField = new JTextField();
|
|
||||||
mTextField.getDocument().addDocumentListener(this);
|
|
||||||
mTextField.setToolTipText(HELP_TEXT);
|
|
||||||
add(mTextField, "growx,push");
|
|
||||||
|
|
||||||
JLabel help = new JLabel("Help ...");
|
|
||||||
help.setForeground(Color.BLUE.brighter());
|
|
||||||
help.setCursor(new Cursor(Cursor.HAND_CURSOR));
|
|
||||||
help.addMouseListener(new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(MouseEvent e)
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog(LegacyTalkgroupIDEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(help, "align left");
|
|
||||||
}
|
|
||||||
|
|
||||||
public LegacyTalkgroupID getTalkgroupID()
|
|
||||||
{
|
|
||||||
if(getItem() instanceof LegacyTalkgroupID)
|
|
||||||
{
|
|
||||||
return (LegacyTalkgroupID)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem(AliasID aliasID)
|
|
||||||
{
|
|
||||||
super.setItem(aliasID);
|
|
||||||
|
|
||||||
LegacyTalkgroupID talkgroup = getTalkgroupID();
|
|
||||||
|
|
||||||
if(talkgroup != null)
|
|
||||||
{
|
|
||||||
mTextField.setText(talkgroup.getTalkgroup());
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
LegacyTalkgroupID talkgroup = getTalkgroupID();
|
|
||||||
|
|
||||||
if(talkgroup != null)
|
|
||||||
{
|
|
||||||
talkgroup.setTalkgroup(mTextField.getText());
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -29,6 +29,12 @@ public class UniqueID extends AliasID
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "uid")
|
@JacksonXmlProperty(isAttribute = true, localName = "uid")
|
||||||
public int getUid()
|
public int getUid()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id.legacy.uniqueID;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class UniqueIDEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>LTR-Net Unique ID (UID)</h3>"
|
|
||||||
+ "<b>UID:</b> identifier assigned to each radio in<br>"
|
|
||||||
+ "the range <u>1 - 2097152</u>"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JTextField mTextField;
|
|
||||||
|
|
||||||
public UniqueIDEditor( AliasID aliasID )
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Unique ID:" ) );
|
|
||||||
mTextField = new JTextField();
|
|
||||||
mTextField.getDocument().addDocumentListener( this );
|
|
||||||
mTextField.setToolTipText( HELP_TEXT );
|
|
||||||
add( mTextField, "growx,push" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( UniqueIDEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public UniqueID getUniqueID()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof UniqueID )
|
|
||||||
{
|
|
||||||
return (UniqueID)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasID aliasID )
|
|
||||||
{
|
|
||||||
super.setItem( aliasID );
|
|
||||||
|
|
||||||
UniqueID uid = getUniqueID();
|
|
||||||
|
|
||||||
if( uid != null )
|
|
||||||
{
|
|
||||||
mTextField.setText( String.valueOf( uid.getUid() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
UniqueID uid = getUniqueID();
|
|
||||||
|
|
||||||
if( uid != null )
|
|
||||||
{
|
|
||||||
int id = 0;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
id = Integer.parseInt( mTextField.getText() );
|
|
||||||
}
|
|
||||||
catch( Exception e )
|
|
||||||
{
|
|
||||||
//Do nothing, we couldn't parse the value
|
|
||||||
}
|
|
||||||
|
|
||||||
uid.setUid( id );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -32,6 +32,12 @@ public class LoJackFunctionAndID extends AliasID
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "id")
|
@JacksonXmlProperty(isAttribute = true, localName = "id")
|
||||||
public String getID()
|
public String getID()
|
||||||
{
|
{
|
||||||
@@ -41,6 +47,7 @@ public class LoJackFunctionAndID extends AliasID
|
|||||||
public void setID(String id)
|
public void setID(String id)
|
||||||
{
|
{
|
||||||
mID = id;
|
mID = id;
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "function")
|
@JacksonXmlProperty(isAttribute = true, localName = "function")
|
||||||
@@ -52,6 +59,7 @@ public class LoJackFunctionAndID extends AliasID
|
|||||||
public void setFunction(LJ1200Message.Function function)
|
public void setFunction(LJ1200Message.Function function)
|
||||||
{
|
{
|
||||||
mFunction = function;
|
mFunction = function;
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,160 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id.lojack;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import io.github.dsheirer.module.decode.lj1200.LJ1200Message;
|
|
||||||
import io.github.dsheirer.module.decode.lj1200.LJ1200Message.Function;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.text.MaskFormatter;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class LoJackIDEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private JTextField mTextField;
|
|
||||||
|
|
||||||
private JComboBox<LJ1200Message.Function> mFunctionCombo;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>LoJack Function and Identifier</h3>"
|
|
||||||
+ "<b>Function Code:</b> <u>1Y-SITE ID</u><br>"
|
|
||||||
+ "<b>ID:</b> 5 numbers or characters (e.g. <u>1BN47</u>)<br>"
|
|
||||||
+ "<br>"
|
|
||||||
+ "<b>Wildcard:</b> use an asterisk (*) to wildcard ID<br>"
|
|
||||||
+ "characters (e.g. <u>AB*CD</u> or <u>***12</u> or <u>*****</u>)<br><br>"
|
|
||||||
+ "The middle character in a reply ID code identifies the<br>"
|
|
||||||
+ "entity. Valid ID middle characters are:<br>"
|
|
||||||
+ "<li><b>Tower:</b> X,Y</li>"
|
|
||||||
+ "<li><b>Transponder:</b> 0-9,A,C-H,J-N,P-W</li>"
|
|
||||||
+ "<li><b>Not Used:</b> B,I,O,Z</li>"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
public LoJackIDEditor( AliasID aliasID )
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Function:" ) );
|
|
||||||
mFunctionCombo = new JComboBox<LJ1200Message.Function>( Function.values() );
|
|
||||||
mFunctionCombo.addActionListener( new ActionListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void actionPerformed( ActionEvent e )
|
|
||||||
{
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
mFunctionCombo.setToolTipText( HELP_TEXT );
|
|
||||||
add( mFunctionCombo, "growx, push" );
|
|
||||||
|
|
||||||
add( new JLabel( "ID:" ) );
|
|
||||||
|
|
||||||
MaskFormatter formatter = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//Mask: any character or number, 5 places
|
|
||||||
formatter = new MaskFormatter( "AAAAA" );
|
|
||||||
}
|
|
||||||
catch( Exception e )
|
|
||||||
{
|
|
||||||
//Do nothing, the mask was invalid
|
|
||||||
}
|
|
||||||
|
|
||||||
mTextField = new JFormattedTextField( formatter );
|
|
||||||
mTextField.getDocument().addDocumentListener( this );
|
|
||||||
mTextField.setToolTipText( HELP_TEXT );
|
|
||||||
add( mTextField, "growx,push" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( LoJackIDEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public LoJackFunctionAndID getLoJackID()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof LoJackFunctionAndID )
|
|
||||||
{
|
|
||||||
return (LoJackFunctionAndID)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasID aliasID )
|
|
||||||
{
|
|
||||||
super.setItem( aliasID );
|
|
||||||
|
|
||||||
LoJackFunctionAndID lojack = getLoJackID();
|
|
||||||
|
|
||||||
if( lojack != null )
|
|
||||||
{
|
|
||||||
mFunctionCombo.setSelectedItem( lojack.getFunction() );
|
|
||||||
mTextField.setText( lojack.getID() );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mFunctionCombo.setSelectedItem( null );
|
|
||||||
mTextField.setText( null );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
LoJackFunctionAndID lojack = getLoJackID();
|
|
||||||
|
|
||||||
if( lojack != null )
|
|
||||||
{
|
|
||||||
lojack.setID( mTextField.getText() );
|
|
||||||
lojack.setFunction( (Function)mFunctionCombo.getSelectedItem() );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -39,6 +39,17 @@ public class Priority extends AliasID
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Priority(int priority)
|
||||||
|
{
|
||||||
|
mPriority = priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid()
|
public boolean isValid()
|
||||||
{
|
{
|
||||||
@@ -63,6 +74,7 @@ public class Priority extends AliasID
|
|||||||
public void setPriority(int priority)
|
public void setPriority(int priority)
|
||||||
{
|
{
|
||||||
mPriority = priority;
|
mPriority = priority;
|
||||||
|
updateValueProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
|
|||||||
@@ -1,163 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id.priority;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.event.ChangeEvent;
|
|
||||||
import javax.swing.event.ChangeListener;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class PriorityEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public static final String DO_NOT_MONITOR = "Do Not Monitor";
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>Call Audio Priority</h3>"
|
|
||||||
+ "Priority determines which calls have priority for playback<br>"
|
|
||||||
+ "over your computer speakers, or designates an alias for<br>"
|
|
||||||
+ "no-monitoring if you don't want to hear calls from an alias.<br><br>"
|
|
||||||
+ "Lower values indicate higher priority levels.<br><br>"
|
|
||||||
+ "<b>Do Not Monitor: </b> slide priority all the way to the right"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JSlider mPrioritySlider;
|
|
||||||
private JLabel mPrioritySliderLabel;
|
|
||||||
|
|
||||||
public PriorityEditor( AliasID aliasID )
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) );
|
|
||||||
|
|
||||||
mPrioritySlider = new JSlider( JSlider.HORIZONTAL,
|
|
||||||
Priority.MIN_PRIORITY,
|
|
||||||
Priority.MAX_PRIORITY + 1,
|
|
||||||
Priority.MIN_PRIORITY );
|
|
||||||
|
|
||||||
mPrioritySlider.setMajorTickSpacing( 20 );
|
|
||||||
mPrioritySlider.setMinorTickSpacing( 5 );
|
|
||||||
mPrioritySlider.setPaintTicks( true );
|
|
||||||
mPrioritySlider.setLabelTable( mPrioritySlider.createStandardLabels( 20, 20 ) );
|
|
||||||
mPrioritySlider.setPaintLabels( true );
|
|
||||||
mPrioritySlider.addChangeListener( new ChangeListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void stateChanged( ChangeEvent e )
|
|
||||||
{
|
|
||||||
int priority = mPrioritySlider.getValue();
|
|
||||||
|
|
||||||
if( priority == Priority.MAX_PRIORITY + 1 )
|
|
||||||
{
|
|
||||||
mPrioritySliderLabel.setText( "Priority: Do Not Monitor" );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mPrioritySliderLabel.setText( "Priority: " + priority );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( true );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
mPrioritySlider.setToolTipText( HELP_TEXT );
|
|
||||||
|
|
||||||
mPrioritySliderLabel = new JLabel( "Priority: " + mPrioritySlider.getValue() + " " );
|
|
||||||
add( mPrioritySliderLabel, "span,align center" );
|
|
||||||
add( mPrioritySlider, "span,grow" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( PriorityEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public Priority getPriority()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof Priority )
|
|
||||||
{
|
|
||||||
return (Priority)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasID aliasID )
|
|
||||||
{
|
|
||||||
super.setItem( aliasID );
|
|
||||||
|
|
||||||
Priority priority = getPriority();
|
|
||||||
|
|
||||||
if( priority != null )
|
|
||||||
{
|
|
||||||
int value = priority.getPriority();
|
|
||||||
|
|
||||||
if( value == Priority.DO_NOT_MONITOR )
|
|
||||||
{
|
|
||||||
value = Priority.MAX_PRIORITY + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
mPrioritySlider.setValue( value );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
Priority priority = getPriority();
|
|
||||||
|
|
||||||
if( priority != null )
|
|
||||||
{
|
|
||||||
int value = mPrioritySlider.getValue();
|
|
||||||
|
|
||||||
if( value == Priority.MAX_PRIORITY + 1 )
|
|
||||||
{
|
|
||||||
value = Priority.DO_NOT_MONITOR;
|
|
||||||
}
|
|
||||||
|
|
||||||
priority.setPriority( value );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.alias.id.radio;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.github.dsheirer.alias.id.AliasIDType;
|
||||||
|
import io.github.dsheirer.alias.id.INXDNTypeD;
|
||||||
|
import io.github.dsheirer.preference.identifier.talkgroup.NXDNTalkgroupFormatter;
|
||||||
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NXDN Type-D radio. The value is the over-the-air 16-bit identifier that combines the home repeater and radio so that
|
||||||
|
* it matches the value of an NXDN Type-D radio identifier.
|
||||||
|
*/
|
||||||
|
public class NXDNTypeDRadio extends Radio implements INXDNTypeD
|
||||||
|
{
|
||||||
|
public NXDNTypeDRadio()
|
||||||
|
{
|
||||||
|
//No-arg JAXB constructor
|
||||||
|
setProtocol(Protocol.NXDN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
* @param homeRepeater for the radio
|
||||||
|
* @param radio value, without the home repeater
|
||||||
|
*/
|
||||||
|
public NXDNTypeDRadio(int homeRepeater, int radio)
|
||||||
|
{
|
||||||
|
super(Protocol.NXDN, NXDNTalkgroupFormatter.toTypeDValue(homeRepeater, radio));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AliasIDType getType()
|
||||||
|
{
|
||||||
|
return AliasIDType.NXDN_TYPE_D_RADIO_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@Override
|
||||||
|
public int getHomeRepeater()
|
||||||
|
{
|
||||||
|
return NXDNTalkgroupFormatter.getTypeDHomeRepeater(getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setHomeRepeater(int homeRepeater)
|
||||||
|
{
|
||||||
|
setValue(NXDNTalkgroupFormatter.toTypeDValue(homeRepeater, getIdentifier()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@Override
|
||||||
|
public int getIdentifier()
|
||||||
|
{
|
||||||
|
return NXDNTalkgroupFormatter.getTypeDIdentifier(getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setIdentifier(int identifier)
|
||||||
|
{
|
||||||
|
setValue(NXDNTalkgroupFormatter.toTypeDValue(getHomeRepeater(), identifier));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Type-D Radio ID:").append(NXDNTalkgroupFormatter.toTypeD(getHomeRepeater(), getIdentifier(), true));
|
||||||
|
sb.append(" Protocol:").append(getProtocol());
|
||||||
|
|
||||||
|
if(!isValid())
|
||||||
|
{
|
||||||
|
sb.append(" **NOT VALID**");
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.alias.id.radio;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.github.dsheirer.alias.id.AliasIDType;
|
||||||
|
import io.github.dsheirer.alias.id.INXDNTypeDRange;
|
||||||
|
import io.github.dsheirer.preference.identifier.talkgroup.NXDNTalkgroupFormatter;
|
||||||
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NXDN Type-D radio range for a single home repeater. The min and max values are the over-the-air 16-bit identifiers
|
||||||
|
* that combine the home repeater and radio.
|
||||||
|
*/
|
||||||
|
public class NXDNTypeDRadioRange extends RadioRange implements INXDNTypeDRange
|
||||||
|
{
|
||||||
|
public NXDNTypeDRadioRange()
|
||||||
|
{
|
||||||
|
//No-arg JAXB constructor
|
||||||
|
setProtocol(Protocol.NXDN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
* @param homeRepeater for the range
|
||||||
|
* @param minRadio value, without the home repeater
|
||||||
|
* @param maxRadio value, without the home repeater
|
||||||
|
*/
|
||||||
|
public NXDNTypeDRadioRange(int homeRepeater, int minRadio, int maxRadio)
|
||||||
|
{
|
||||||
|
super(Protocol.NXDN, NXDNTalkgroupFormatter.toTypeDValue(homeRepeater, minRadio),
|
||||||
|
NXDNTalkgroupFormatter.toTypeDValue(homeRepeater, maxRadio));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AliasIDType getType()
|
||||||
|
{
|
||||||
|
return AliasIDType.NXDN_TYPE_D_RADIO_ID_RANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@Override
|
||||||
|
public int getHomeRepeater()
|
||||||
|
{
|
||||||
|
return NXDNTalkgroupFormatter.getTypeDHomeRepeater(getMinRadio());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setHomeRepeater(int homeRepeater)
|
||||||
|
{
|
||||||
|
int min = getMinIdentifier();
|
||||||
|
int max = getMaxIdentifier();
|
||||||
|
setMinRadio(NXDNTalkgroupFormatter.toTypeDValue(homeRepeater, min));
|
||||||
|
setMaxRadio(NXDNTalkgroupFormatter.toTypeDValue(homeRepeater, max));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@Override
|
||||||
|
public int getMinIdentifier()
|
||||||
|
{
|
||||||
|
return NXDNTalkgroupFormatter.getTypeDIdentifier(getMinRadio());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMinIdentifier(int identifier)
|
||||||
|
{
|
||||||
|
setMinRadio(NXDNTalkgroupFormatter.toTypeDValue(getHomeRepeater(), identifier));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@Override
|
||||||
|
public int getMaxIdentifier()
|
||||||
|
{
|
||||||
|
return NXDNTalkgroupFormatter.getTypeDIdentifier(getMaxRadio());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMaxIdentifier(int identifier)
|
||||||
|
{
|
||||||
|
setMaxRadio(NXDNTalkgroupFormatter.toTypeDValue(getHomeRepeater(), identifier));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Valid when the base range is valid and both ends of the range use the same home repeater.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean isValid()
|
||||||
|
{
|
||||||
|
return super.isValid() && getHomeRepeater() == NXDNTalkgroupFormatter.getTypeDHomeRepeater(getMaxRadio());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Type-D Radio ID Range:").append(NXDNTalkgroupFormatter.toTypeD(getHomeRepeater(), getMinIdentifier(), true));
|
||||||
|
sb.append(" to ").append(NXDNTalkgroupFormatter.toTypeD(getHomeRepeater(), getMaxIdentifier(), true));
|
||||||
|
sb.append(" Protocol:").append(getProtocol());
|
||||||
|
|
||||||
|
if(!isValid())
|
||||||
|
{
|
||||||
|
sb.append(" **NOT VALID**");
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.alias.id.radio;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
|
import io.github.dsheirer.alias.id.AliasIDType;
|
||||||
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fully qualified radio. Note: this is only for P25.
|
||||||
|
*/
|
||||||
|
public class P25FullyQualifiedRadio extends Radio
|
||||||
|
{
|
||||||
|
private int mWacn;
|
||||||
|
private int mSystem;
|
||||||
|
|
||||||
|
public P25FullyQualifiedRadio()
|
||||||
|
{
|
||||||
|
//No-arg JAXB constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
* @param wacn for the radio
|
||||||
|
* @param system for the radio
|
||||||
|
* @param id for the radio
|
||||||
|
*/
|
||||||
|
public P25FullyQualifiedRadio(int wacn, int system, int id)
|
||||||
|
{
|
||||||
|
super(Protocol.APCO25, id);
|
||||||
|
mWacn = wacn;
|
||||||
|
mSystem = system;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AliasIDType getType()
|
||||||
|
{
|
||||||
|
return AliasIDType.P25_FULLY_QUALIFIED_RADIO_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WACN for this radio
|
||||||
|
* @return wacn
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "wacn")
|
||||||
|
public int getWacn()
|
||||||
|
{
|
||||||
|
return mWacn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the WACN for this radio
|
||||||
|
* @param wacn for this radio
|
||||||
|
*/
|
||||||
|
public void setWacn(int wacn)
|
||||||
|
{
|
||||||
|
mWacn = wacn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* System for this radio
|
||||||
|
* @return system
|
||||||
|
*/
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "system")
|
||||||
|
public int getSystem()
|
||||||
|
{
|
||||||
|
return mSystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the system for this radio
|
||||||
|
* @param system for this radio
|
||||||
|
*/
|
||||||
|
public void setSystem(int system)
|
||||||
|
{
|
||||||
|
mSystem = system;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
sb.append("Fully Qualified Radio ID:").append(getWacn());
|
||||||
|
sb.append(".").append(getSystem());
|
||||||
|
sb.append(".").append(getValue());
|
||||||
|
sb.append(" Protocol:").append((getProtocol()));
|
||||||
|
|
||||||
|
if(!isValid())
|
||||||
|
{
|
||||||
|
sb.append(" **NOT VALID**");
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hashable string key for use in a lookup map
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public String getHashKey()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(getWacn());
|
||||||
|
sb.append(".").append(getSystem());
|
||||||
|
sb.append(".").append(getValue());
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
143
src/main/java/io/github/dsheirer/alias/id/radio/Radio.java
Normal file
143
src/main/java/io/github/dsheirer/alias/id/radio/Radio.java
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* * ******************************************************************************
|
||||||
|
* * Copyright (C) 2014-2019 Dennis Sheirer
|
||||||
|
* *
|
||||||
|
* * This program is free software: you can redistribute it and/or modify
|
||||||
|
* * it under the terms of the GNU General Public License as published by
|
||||||
|
* * the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* * (at your option) any later version.
|
||||||
|
* *
|
||||||
|
* * This program is distributed in the hope that it will be useful,
|
||||||
|
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* * GNU General Public License for more details.
|
||||||
|
* *
|
||||||
|
* * You should have received a copy of the GNU General Public License
|
||||||
|
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* * *****************************************************************************
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package io.github.dsheirer.alias.id.radio;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
|
import io.github.dsheirer.alias.id.AliasID;
|
||||||
|
import io.github.dsheirer.alias.id.AliasIDType;
|
||||||
|
import io.github.dsheirer.alias.id.talkgroup.TalkgroupFormatter;
|
||||||
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Integer radio identifier with protocol.
|
||||||
|
*/
|
||||||
|
public class Radio extends AliasID implements Comparable<Radio>
|
||||||
|
{
|
||||||
|
private Protocol mProtocol = Protocol.UNKNOWN;
|
||||||
|
private int mValue;
|
||||||
|
|
||||||
|
public Radio()
|
||||||
|
{
|
||||||
|
//No arg JAXB constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
public Radio(Protocol protocol, int value)
|
||||||
|
{
|
||||||
|
mProtocol = protocol;
|
||||||
|
mValue = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "value")
|
||||||
|
public int getValue()
|
||||||
|
{
|
||||||
|
return mValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(int value)
|
||||||
|
{
|
||||||
|
mValue = value;
|
||||||
|
updateValueProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "protocol")
|
||||||
|
public Protocol getProtocol()
|
||||||
|
{
|
||||||
|
return mProtocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProtocol(Protocol protocol)
|
||||||
|
{
|
||||||
|
mProtocol = protocol;
|
||||||
|
updateValueProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid()
|
||||||
|
{
|
||||||
|
if(mProtocol == null || mProtocol == Protocol.UNKNOWN)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
RadioFormat radioFormat = RadioFormat.get(mProtocol);
|
||||||
|
return radioFormat.getMinimumValidValue() <= mValue && mValue <= radioFormat.getMaximumValidValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
sb.append("Radio ID:").append(TalkgroupFormatter.format(mProtocol, mValue));
|
||||||
|
sb.append(" Protocol:").append((mProtocol));
|
||||||
|
|
||||||
|
if(!isValid())
|
||||||
|
{
|
||||||
|
sb.append(" **NOT VALID**");
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean matches(AliasID id)
|
||||||
|
{
|
||||||
|
if(id instanceof Radio)
|
||||||
|
{
|
||||||
|
Radio tgid = (Radio)id;
|
||||||
|
return (getProtocol() == tgid.getProtocol()) && (getValue() == tgid.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
||||||
|
@Override
|
||||||
|
public AliasIDType getType()
|
||||||
|
{
|
||||||
|
return AliasIDType.RADIO_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Radio other)
|
||||||
|
{
|
||||||
|
if(other == null)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getProtocol().equals(other.getProtocol()))
|
||||||
|
{
|
||||||
|
return Integer.compare(getValue(), other.getValue());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return getProtocol().compareTo(other.getProtocol());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
125
src/main/java/io/github/dsheirer/alias/id/radio/RadioFormat.java
Normal file
125
src/main/java/io/github/dsheirer/alias/id/radio/RadioFormat.java
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.alias.id.radio;
|
||||||
|
|
||||||
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Radio ID protocol identifier entry masks and min/max valid ranges and valid range descriptions
|
||||||
|
*
|
||||||
|
* Note: the getMask() value is intended for use with a MaskFormatter attached to a JFormattedTextField. The
|
||||||
|
* protocol masks that have a dash (-) use the # (any digit) character and the protocol masks that do not have
|
||||||
|
* a formatting dash use an asterisk (*). Within the editor(s) that use this enumeration, the editor must use
|
||||||
|
* a setValidCharacters() on the mask formatter whenever it detects the mask containing one or more asterisks.
|
||||||
|
*/
|
||||||
|
public enum RadioFormat
|
||||||
|
{
|
||||||
|
APCO25("********", 0, 0xFFFFFF, "0 to 16,777,215",
|
||||||
|
"<html>APCO25 valid range is 0 to 16,777,215"),
|
||||||
|
DMR("********", 0, 0xFFFFFF, "0 to 16,777,215",
|
||||||
|
"<html>DMR unit id valid range is 0 to 16,777,215"),
|
||||||
|
NXDN("*****", 1, 0xFFFF, "1 to 65,535", "NXDN valid range is 1 to 65,535"),
|
||||||
|
PASSPORT("********", 0, 0x7FFFFF, "0 to 8,388,607",
|
||||||
|
"<html>PASSPORT valid range is 0 to 8,388,607"),
|
||||||
|
UNKNOWN("********", 1, 0xFFFFFF, "1 to 16,777,215",
|
||||||
|
"<html>Unknown protocol valid value range is 1-16,777,215");
|
||||||
|
|
||||||
|
private String mMask;
|
||||||
|
private int mMinimumValue;
|
||||||
|
private int mMaximumValue;
|
||||||
|
private String mValidRangeDescription;
|
||||||
|
private String mValidRangeHelpText;
|
||||||
|
|
||||||
|
RadioFormat(String mask, int minimumValue, int maximumValue, String validRangeDescription, String validRangeHelpText)
|
||||||
|
{
|
||||||
|
mMask = mask;
|
||||||
|
mMinimumValue = minimumValue;
|
||||||
|
mMaximumValue = maximumValue;
|
||||||
|
mValidRangeDescription = validRangeDescription;
|
||||||
|
mValidRangeHelpText = validRangeHelpText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMask()
|
||||||
|
{
|
||||||
|
return mMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minimum valid value for the protocol
|
||||||
|
*/
|
||||||
|
public int getMinimumValidValue()
|
||||||
|
{
|
||||||
|
return mMinimumValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maximum valid value for the protocol
|
||||||
|
*/
|
||||||
|
public int getMaximumValidValue()
|
||||||
|
{
|
||||||
|
return mMaximumValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the value is valid for the protocol
|
||||||
|
*/
|
||||||
|
public boolean isValid(int value)
|
||||||
|
{
|
||||||
|
return getMinimumValidValue() <= value && value <= getMaximumValidValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Short description of the valid value range
|
||||||
|
*/
|
||||||
|
public String getValidRangeDescription()
|
||||||
|
{
|
||||||
|
return mValidRangeDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Help text for valid value ranges
|
||||||
|
*/
|
||||||
|
public String getValidRangeHelpText()
|
||||||
|
{
|
||||||
|
return mValidRangeHelpText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RadioFormat get(Protocol protocol)
|
||||||
|
{
|
||||||
|
if(protocol == null)
|
||||||
|
{
|
||||||
|
return UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(protocol)
|
||||||
|
{
|
||||||
|
case APCO25:
|
||||||
|
return APCO25;
|
||||||
|
case DMR:
|
||||||
|
return DMR;
|
||||||
|
case NXDN:
|
||||||
|
return NXDN;
|
||||||
|
case PASSPORT:
|
||||||
|
return PASSPORT;
|
||||||
|
default:
|
||||||
|
return UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.alias.id.radio;
|
||||||
|
|
||||||
|
import io.github.dsheirer.preference.identifier.IntegerFormat;
|
||||||
|
import io.github.dsheirer.preference.identifier.talkgroup.APCO25TalkgroupFormatter;
|
||||||
|
import io.github.dsheirer.preference.identifier.talkgroup.AbstractIntegerFormatter;
|
||||||
|
import io.github.dsheirer.preference.identifier.talkgroup.DMRTalkgroupFormatter;
|
||||||
|
import io.github.dsheirer.preference.identifier.talkgroup.NXDNTalkgroupFormatter;
|
||||||
|
import io.github.dsheirer.preference.identifier.talkgroup.UnknownTalkgroupFormatter;
|
||||||
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Protocol-specific formatting of radio id values and parsing of formatted radio id values.
|
||||||
|
*/
|
||||||
|
public class RadioFormatter
|
||||||
|
{
|
||||||
|
private final static Logger mLog = LoggerFactory.getLogger(RadioFormatter.class);
|
||||||
|
private static Map<Protocol,AbstractIntegerFormatter> mFormatterMap = new EnumMap<>(Protocol.class);
|
||||||
|
|
||||||
|
static
|
||||||
|
{
|
||||||
|
mFormatterMap.put(Protocol.APCO25, new APCO25TalkgroupFormatter());
|
||||||
|
mFormatterMap.put(Protocol.DMR, new DMRTalkgroupFormatter());
|
||||||
|
mFormatterMap.put(Protocol.NXDN, new NXDNTalkgroupFormatter());
|
||||||
|
mFormatterMap.put(Protocol.UNKNOWN, new UnknownTalkgroupFormatter());
|
||||||
|
}
|
||||||
|
|
||||||
|
public RadioFormatter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses the formatted value into an integer using a protocol specific formatter
|
||||||
|
*/
|
||||||
|
public static int parse(Protocol protocol, String value) throws ParseException
|
||||||
|
{
|
||||||
|
AbstractIntegerFormatter formatter = mFormatterMap.get(protocol);
|
||||||
|
|
||||||
|
if(formatter == null)
|
||||||
|
{
|
||||||
|
formatter = mFormatterMap.get(Protocol.UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
return formatter.parse(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formats the integer value using a protocol-specific formatter
|
||||||
|
*/
|
||||||
|
public static String format(Protocol protocol, int value)
|
||||||
|
{
|
||||||
|
AbstractIntegerFormatter formatter = mFormatterMap.get(protocol);
|
||||||
|
|
||||||
|
if(formatter == null)
|
||||||
|
{
|
||||||
|
formatter = mFormatterMap.get(Protocol.UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
return formatter.format(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formats the integer value to the specified integer format using the protocol specific formatter
|
||||||
|
*/
|
||||||
|
public static String format(Protocol protocol, int value, IntegerFormat format)
|
||||||
|
{
|
||||||
|
AbstractIntegerFormatter formatter = mFormatterMap.get(protocol);
|
||||||
|
|
||||||
|
if(formatter == null)
|
||||||
|
{
|
||||||
|
formatter = mFormatterMap.get(Protocol.UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
return formatter.format(value, format);
|
||||||
|
}
|
||||||
|
}
|
||||||
208
src/main/java/io/github/dsheirer/alias/id/radio/RadioRange.java
Normal file
208
src/main/java/io/github/dsheirer/alias/id/radio/RadioRange.java
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* * ******************************************************************************
|
||||||
|
* * Copyright (C) 2014-2019 Dennis Sheirer
|
||||||
|
* *
|
||||||
|
* * This program is free software: you can redistribute it and/or modify
|
||||||
|
* * it under the terms of the GNU General Public License as published by
|
||||||
|
* * the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* * (at your option) any later version.
|
||||||
|
* *
|
||||||
|
* * This program is distributed in the hope that it will be useful,
|
||||||
|
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* * GNU General Public License for more details.
|
||||||
|
* *
|
||||||
|
* * You should have received a copy of the GNU General Public License
|
||||||
|
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* * *****************************************************************************
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package io.github.dsheirer.alias.id.radio;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
|
import io.github.dsheirer.alias.id.AliasID;
|
||||||
|
import io.github.dsheirer.alias.id.AliasIDType;
|
||||||
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Integer radio identifier range of values with protocol.
|
||||||
|
*/
|
||||||
|
public class RadioRange extends AliasID implements Comparable<RadioRange>
|
||||||
|
{
|
||||||
|
private Protocol mProtocol = Protocol.UNKNOWN;
|
||||||
|
private int mMinRadio;
|
||||||
|
private int mMaxRadio;
|
||||||
|
|
||||||
|
public RadioRange()
|
||||||
|
{
|
||||||
|
//No arg JAXB constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a radio range of from - to radio values (inclusive) for the specified protocol
|
||||||
|
* @param protocol for the radio range
|
||||||
|
* @param minRadio starting or minimum radio value
|
||||||
|
* @param maxRadio ending or maximum radio value
|
||||||
|
*/
|
||||||
|
public RadioRange(Protocol protocol, int minRadio, int maxRadio)
|
||||||
|
{
|
||||||
|
mProtocol = protocol;
|
||||||
|
mMinRadio = minRadio;
|
||||||
|
mMaxRadio = maxRadio;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "min")
|
||||||
|
public int getMinRadio()
|
||||||
|
{
|
||||||
|
return mMinRadio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinRadio(int minRadio)
|
||||||
|
{
|
||||||
|
mMinRadio = minRadio;
|
||||||
|
updateValueProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "max")
|
||||||
|
public int getMaxRadio()
|
||||||
|
{
|
||||||
|
return mMaxRadio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxRadio(int maxRadio)
|
||||||
|
{
|
||||||
|
mMaxRadio = maxRadio;
|
||||||
|
updateValueProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "protocol")
|
||||||
|
public Protocol getProtocol()
|
||||||
|
{
|
||||||
|
return mProtocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProtocol(Protocol protocol)
|
||||||
|
{
|
||||||
|
mProtocol = protocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid()
|
||||||
|
{
|
||||||
|
if(mProtocol == null || mProtocol == Protocol.UNKNOWN)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
RadioFormat radioFormat = RadioFormat.get(mProtocol);
|
||||||
|
return radioFormat.getMinimumValidValue() <= mMinRadio &&
|
||||||
|
mMinRadio <= radioFormat.getMaximumValidValue() &&
|
||||||
|
radioFormat.getMinimumValidValue() <= mMaxRadio &&
|
||||||
|
mMaxRadio <= radioFormat.getMaximumValidValue() &&
|
||||||
|
mMinRadio < mMaxRadio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
sb.append("Radio ID Range:").append(RadioFormatter.format(mProtocol, mMinRadio));
|
||||||
|
sb.append(" to ").append(RadioFormatter.format(mProtocol, mMaxRadio));
|
||||||
|
sb.append(" Protocol:").append(mProtocol != null ? mProtocol : "unspecified");
|
||||||
|
|
||||||
|
if(!isValid())
|
||||||
|
{
|
||||||
|
sb.append(" **NOT VALID**");
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean matches(AliasID id)
|
||||||
|
{
|
||||||
|
if(id instanceof RadioRange)
|
||||||
|
{
|
||||||
|
RadioRange tgid = (RadioRange)id;
|
||||||
|
return (getProtocol() == tgid.getProtocol()) &&
|
||||||
|
(getMinRadio() == tgid.getMinRadio()) &&
|
||||||
|
(getMaxRadio() == tgid.getMaxRadio());
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this radio range contains/includes the value
|
||||||
|
* @param radioValue
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean contains(int radioValue)
|
||||||
|
{
|
||||||
|
return getMinRadio() <= radioValue && radioValue <= getMaxRadio();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean overlaps(AliasID other)
|
||||||
|
{
|
||||||
|
return other instanceof RadioRange && overlaps((RadioRange)other);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this talkgroup range overlaps the talkgroup range argument.
|
||||||
|
* @param radioRange to check for overlap
|
||||||
|
* @return true if the ranges overlap
|
||||||
|
*/
|
||||||
|
public boolean overlaps(RadioRange radioRange)
|
||||||
|
{
|
||||||
|
return contains(radioRange.getMinRadio()) ||
|
||||||
|
contains(radioRange.getMaxRadio()) ||
|
||||||
|
(getMinRadio() < radioRange.getMinRadio() &&
|
||||||
|
radioRange.getMaxRadio() < getMaxRadio()) ||
|
||||||
|
(radioRange.getMinRadio() < getMinRadio() &&
|
||||||
|
getMaxRadio() < radioRange.getMaxRadio());
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
||||||
|
@Override
|
||||||
|
public AliasIDType getType()
|
||||||
|
{
|
||||||
|
return AliasIDType.RADIO_ID_RANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(RadioRange other)
|
||||||
|
{
|
||||||
|
if(other == null)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getProtocol().equals(other.getProtocol()))
|
||||||
|
{
|
||||||
|
if(getMinRadio() == other.getMinRadio())
|
||||||
|
{
|
||||||
|
return Integer.compare(getMaxRadio(), other.getMaxRadio());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Integer.compare(getMinRadio(), other.getMinRadio());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return getProtocol().compareTo(other.getProtocol());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,12 @@ public class Record extends AliasID
|
|||||||
return AliasIDType.RECORD;
|
return AliasIDType.RECORD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid()
|
public boolean isValid()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
* ******************************************************************************
|
|
||||||
* sdrtrunk
|
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* *****************************************************************************
|
|
||||||
*/
|
|
||||||
package io.github.dsheirer.alias.id.record;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Cursor;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class RecordEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>Record Audio</h3>"
|
|
||||||
+ "Any audio associated with this alias will be recorded.<br><br>";
|
|
||||||
|
|
||||||
public RecordEditor(AliasID aliasID )
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 1", "[]", "[][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Record Audio" ), "wrap" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( RecordEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id.status;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.alias.id.AliasIDType;
|
|
||||||
|
|
||||||
public class StatusID extends AliasID
|
|
||||||
{
|
|
||||||
private int mStatus;
|
|
||||||
|
|
||||||
public StatusID()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "status")
|
|
||||||
public int getStatus()
|
|
||||||
{
|
|
||||||
return mStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(int status)
|
|
||||||
{
|
|
||||||
this.mStatus = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isValid()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return "Status: " + String.format("%03d", mStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean matches(AliasID id)
|
|
||||||
{
|
|
||||||
boolean retVal = false;
|
|
||||||
|
|
||||||
if(id instanceof StatusID)
|
|
||||||
{
|
|
||||||
StatusID statusId = (StatusID)id;
|
|
||||||
|
|
||||||
retVal = (mStatus == statusId.getStatus());
|
|
||||||
}
|
|
||||||
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
|
||||||
@Override
|
|
||||||
public AliasIDType getType()
|
|
||||||
{
|
|
||||||
return AliasIDType.STATUS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014-2016 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package io.github.dsheirer.alias.id.status;
|
|
||||||
|
|
||||||
import io.github.dsheirer.alias.id.AliasID;
|
|
||||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.text.MaskFormatter;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
|
|
||||||
public class StatusIDEditor extends DocumentListenerEditor<AliasID>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final String HELP_TEXT = "<html>"
|
|
||||||
+ "<h3>Status Identifier</h3>"
|
|
||||||
+ "Status numbers are used in some protocols like Fleetsync.<br><br>"
|
|
||||||
+ "The status number is assigned a meaning in the radio. You<br>"
|
|
||||||
+ "can assign a 3 digit status code (use leading zeros) to an<br>"
|
|
||||||
+ "alias where the alias contains the status meaning.<br><br>"
|
|
||||||
+ "<b>Status:</b> <u>001</u> engine start"
|
|
||||||
+ "</html>";
|
|
||||||
|
|
||||||
private JTextField mTextField;
|
|
||||||
|
|
||||||
public StatusIDEditor( AliasID aliasID )
|
|
||||||
{
|
|
||||||
initGUI();
|
|
||||||
|
|
||||||
setItem( aliasID );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI()
|
|
||||||
{
|
|
||||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) );
|
|
||||||
|
|
||||||
add( new JLabel( "Status:" ) );
|
|
||||||
|
|
||||||
MaskFormatter formatter = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//Mask: 3 digits
|
|
||||||
formatter = new MaskFormatter( "###" );
|
|
||||||
}
|
|
||||||
catch( Exception e )
|
|
||||||
{
|
|
||||||
//Do nothing, the mask was invalid
|
|
||||||
}
|
|
||||||
|
|
||||||
mTextField = new JFormattedTextField( formatter );
|
|
||||||
mTextField.getDocument().addDocumentListener( this );
|
|
||||||
mTextField.setToolTipText( HELP_TEXT );
|
|
||||||
add( mTextField, "growx,push" );
|
|
||||||
|
|
||||||
JLabel help = new JLabel( "Help ..." );
|
|
||||||
help.setForeground( Color.BLUE.brighter() );
|
|
||||||
help.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
|
|
||||||
help.addMouseListener( new MouseAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void mouseClicked( MouseEvent e )
|
|
||||||
{
|
|
||||||
JOptionPane.showMessageDialog( StatusIDEditor.this,
|
|
||||||
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
add( help, "align left" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public StatusID getStatusID()
|
|
||||||
{
|
|
||||||
if( getItem() instanceof StatusID )
|
|
||||||
{
|
|
||||||
return (StatusID)getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItem( AliasID aliasID )
|
|
||||||
{
|
|
||||||
super.setItem( aliasID );
|
|
||||||
|
|
||||||
StatusID statusID = getStatusID();
|
|
||||||
|
|
||||||
if( statusID != null )
|
|
||||||
{
|
|
||||||
mTextField.setText( String.format( "%03d", statusID.getStatus() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
StatusID statusID = getStatusID();
|
|
||||||
|
|
||||||
if( statusID != null )
|
|
||||||
{
|
|
||||||
int status = 0;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
status = Integer.valueOf( mTextField.getText() );
|
|
||||||
}
|
|
||||||
catch( Exception e )
|
|
||||||
{
|
|
||||||
//Do nothing, we couldn't parse the value
|
|
||||||
}
|
|
||||||
|
|
||||||
statusID.setStatus( status );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2020 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
package io.github.dsheirer.alias.id.status;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
|
import io.github.dsheirer.alias.id.AliasID;
|
||||||
|
import io.github.dsheirer.alias.id.AliasIDType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unit Status
|
||||||
|
*/
|
||||||
|
public class UnitStatusID extends AliasID
|
||||||
|
{
|
||||||
|
private int mStatus;
|
||||||
|
|
||||||
|
public UnitStatusID()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "status")
|
||||||
|
public int getStatus()
|
||||||
|
{
|
||||||
|
return mStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status)
|
||||||
|
{
|
||||||
|
mStatus = status;
|
||||||
|
updateValueProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Unit Status: ").append(String.format("%03d", mStatus));
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean matches(AliasID id)
|
||||||
|
{
|
||||||
|
boolean retVal = false;
|
||||||
|
|
||||||
|
if(id instanceof UnitStatusID)
|
||||||
|
{
|
||||||
|
UnitStatusID userStatusId = (UnitStatusID)id;
|
||||||
|
|
||||||
|
retVal = (mStatus == userStatusId.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
||||||
|
@Override
|
||||||
|
public AliasIDType getType()
|
||||||
|
{
|
||||||
|
return AliasIDType.UNIT_STATUS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2020 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
package io.github.dsheirer.alias.id.status;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
|
import io.github.dsheirer.alias.id.AliasID;
|
||||||
|
import io.github.dsheirer.alias.id.AliasIDType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User Status
|
||||||
|
*/
|
||||||
|
public class UserStatusID extends AliasID
|
||||||
|
{
|
||||||
|
private int mStatus;
|
||||||
|
|
||||||
|
public UserStatusID()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAudioIdentifier()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "status")
|
||||||
|
public int getStatus()
|
||||||
|
{
|
||||||
|
return mStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status)
|
||||||
|
{
|
||||||
|
mStatus = status;
|
||||||
|
updateValueProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("User Status: ").append(String.format("%03d", mStatus));
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean matches(AliasID id)
|
||||||
|
{
|
||||||
|
boolean retVal = false;
|
||||||
|
|
||||||
|
if(id instanceof UserStatusID)
|
||||||
|
{
|
||||||
|
UserStatusID userStatusId = (UserStatusID)id;
|
||||||
|
|
||||||
|
retVal = (mStatus == userStatusId.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
||||||
|
@Override
|
||||||
|
public AliasIDType getType()
|
||||||
|
{
|
||||||
|
return AliasIDType.STATUS;
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user