From 3e8783d7cd43637ddb4ff05aa6b814380304eb51 Mon Sep 17 00:00:00 2001 From: Marc Froehlich Date: Sun, 14 Apr 2024 23:09:37 +0200 Subject: [PATCH] - There had been changes at the preferences xml and the database. Thatswhy for the DB there is an update method now and some checks if the XML is valid. That are simple checks, just to prevent crashing... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Selectable bands Its now possible to select which bands you want to activate. Please select your bands and click save and restart the software. There will only appear buttonds and field which are related to the bands which you have choosen. - Unworkable tags for each callsign. It´s now possible to set NOT-QRV tags for each station for each band. If an OM tells you for example, that he is not QRV at 144 MHz, you can set the "unworkable" flag for him and able to filter his callsign out of the chatmember-list - QTF-Arrow The button "show path in AS" now got an arrow which shows the QTF of the selected station while the button is still out of function (will work that out some time) --- .../controller/ChatController.java | 18 + .../kst4contest/controller/DBController.java | 188 +++++- .../java/kst4contest/model/ChatMember.java | 19 +- .../kst4contest/model/ChatPreferences.java | 187 +++++- .../view/Kst4ContestApplication.java | 576 ++++++++++++++++-- 5 files changed, 915 insertions(+), 73 deletions(-) diff --git a/src/main/java/kst4contest/controller/ChatController.java b/src/main/java/kst4contest/controller/ChatController.java index ea2cbaf..381f4fb 100644 --- a/src/main/java/kst4contest/controller/ChatController.java +++ b/src/main/java/kst4contest/controller/ChatController.java @@ -1121,6 +1121,24 @@ category = new ChatCategory(2); chatMember.setWorked5600(getWorkedDataFromDb.get(chatMember.getCallSign()).isWorked5600()); ; chatMember.setWorked10G(getWorkedDataFromDb.get(chatMember.getCallSign()).isWorked10G()); + /** + * v1.2 since here + * TODO: Change that, this ins not generative + */ + + chatMember.setQrv144(getWorkedDataFromDb.get(chatMember.getCallSign()).isQrv144()); + ; + chatMember.setQrv432(getWorkedDataFromDb.get(chatMember.getCallSign()).isQrv432()); + ; + chatMember.setQrv1240(getWorkedDataFromDb.get(chatMember.getCallSign()).isQrv1240()); + ; + chatMember.setQrv2300(getWorkedDataFromDb.get(chatMember.getCallSign()).isQrv2300()); + ; + chatMember.setQrv3400(getWorkedDataFromDb.get(chatMember.getCallSign()).isQrv3400()); + ; + chatMember.setQrv5600(getWorkedDataFromDb.get(chatMember.getCallSign()).isQrv5600()); + ; + chatMember.setQrv10G(getWorkedDataFromDb.get(chatMember.getCallSign()).isQrv10G()); ; } diff --git a/src/main/java/kst4contest/controller/DBController.java b/src/main/java/kst4contest/controller/DBController.java index e55e3db..dff8ea5 100644 --- a/src/main/java/kst4contest/controller/DBController.java +++ b/src/main/java/kst4contest/controller/DBController.java @@ -104,9 +104,76 @@ public class DBController { } }); + versionUpdateOfDBCheckAndChangeV11ToV12(); //TODO: newer version DB update should be called here } + /** + * While the first version of this software has other needs to the db tables than the 1.2 and following versions + * this method will check if the database file of the user is compatible and make it compatible if it´s not. + *
+ * v1.1 -> v1.2: Chatmember entities will get additional fields for not-QRV-band-info + *
+ * I check only the first field "notqrv144", if it does not exist, I creating all fields neccessarry for v1.2 + */ + public void versionUpdateOfDBCheckAndChangeV11ToV12() { + + try { + Statement stmt = connection.createStatement(); + ResultSet rs = stmt.executeQuery( + "SELECT * FROM ChatMember where notQRV144 != 0;"); + stmt.close(); + } catch (SQLException ex) { + + System.out.println("DBH, Info: updating DB fields for version change v1.1 -> v1.2"); + + try { + + PreparedStatement ps = connection.prepareStatement( + "ALTER TABLE ChatMember ADD notQRV144 BOOLEAN DEFAULT 0" + ";"); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement( + "ALTER TABLE ChatMember ADD notQRV432 BOOLEAN DEFAULT 0" + ";"); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement( + "ALTER TABLE ChatMember ADD notQRV1240 BOOLEAN DEFAULT 0" + ";"); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement( + "ALTER TABLE ChatMember ADD notQRV2300 BOOLEAN DEFAULT 0" + ";"); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement( + "ALTER TABLE ChatMember ADD notQRV3400 BOOLEAN DEFAULT 0" + ";"); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement( + "ALTER TABLE ChatMember ADD notQRV5600 BOOLEAN DEFAULT 0" + ";"); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement( + "ALTER TABLE ChatMember ADD notQRV10G BOOLEAN DEFAULT 0" + ";"); + ps.addBatch(); + ps.executeBatch(); + + connection.setAutoCommit(false); + connection.setAutoCommit(true); + } catch (SQLException e) { + + } + } + + + } + // private void handleDB() { // try { // Statement stmt = connection.createStatement(); @@ -172,6 +239,7 @@ public class DBController { * "worked3400" BOOLEAN,
* "worked5600" BOOLEAN,
* "worked10G" BOOLEAN,
+ *
!!! since v1.2 there is a not-qrv info for each band, too !!! * * @throws SQLException */ @@ -184,7 +252,7 @@ public class DBController { // if (!rs.next()) { PreparedStatement ps = connection.prepareStatement( - "INSERT OR IGNORE INTO ChatMember VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT(callsign) DO UPDATE SET qra = '" + "INSERT OR IGNORE INTO ChatMember VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT(callsign) DO UPDATE SET qra = '" + chatMemberToStore.getQra() + "', name = '" + chatMemberToStore.getName() + "', lastActivityDateTime = '" + chatMemberToStore.getLastActivity() + "' where callsign = '" + chatMemberToStore.getCallSign() + "';"); @@ -201,6 +269,16 @@ public class DBController { ps.setInt(10, helper_booleanIntConverter(chatMemberToStore.isWorked3400())); ps.setInt(11, helper_booleanIntConverter(chatMemberToStore.isWorked5600())); ps.setInt(12, helper_booleanIntConverter(chatMemberToStore.isWorked10G())); + /** + * Here starts v1.2 + */ + ps.setInt(13, helper_booleanIntConverter(!chatMemberToStore.isQrv144())); + ps.setInt(14, helper_booleanIntConverter(!chatMemberToStore.isQrv432())); + ps.setInt(15, helper_booleanIntConverter(!chatMemberToStore.isQrv1240())); + ps.setInt(16, helper_booleanIntConverter(!chatMemberToStore.isQrv2300())); + ps.setInt(17, helper_booleanIntConverter(!chatMemberToStore.isQrv3400())); + ps.setInt(18, helper_booleanIntConverter(!chatMemberToStore.isQrv5600())); + ps.setInt(19, helper_booleanIntConverter(!chatMemberToStore.isQrv10G())); ps.addBatch(); @@ -273,6 +351,18 @@ public class DBController { updateWkdData.setWorked5600(helper_IntToBooleanConverter(rs.getInt("worked5600"))); updateWkdData.setWorked10G(helper_IntToBooleanConverter(rs.getInt("worked10G"))); + /** + * v1.2 since here + */ + + updateWkdData.setQrv144(!helper_IntToBooleanConverter(rs.getInt("notQRV144"))); + updateWkdData.setQrv432(!helper_IntToBooleanConverter(rs.getInt("notQRV432"))); + updateWkdData.setQrv1240(!helper_IntToBooleanConverter(rs.getInt("notQRV1240"))); + updateWkdData.setQrv2300(!helper_IntToBooleanConverter(rs.getInt("notQRV2300"))); + updateWkdData.setQrv3400(!helper_IntToBooleanConverter(rs.getInt("notQRV3400"))); + updateWkdData.setQrv5600(!helper_IntToBooleanConverter(rs.getInt("notQRV5600"))); + updateWkdData.setQrv10G(!helper_IntToBooleanConverter(rs.getInt("notQRV10G"))); + fetchedWorkeddata.put(updateWkdData.getCallSign(), updateWkdData); // System.out.println( @@ -333,6 +423,18 @@ public class DBController { checkForThis.setWorked5600(helper_IntToBooleanConverter(rs.getInt("worked5600"))); checkForThis.setWorked10G(helper_IntToBooleanConverter(rs.getInt("worked10G"))); + /** + * v1.2 since here + */ + + checkForThis.setWorked144(helper_IntToBooleanConverter(rs.getInt("notQRV144"))); + checkForThis.setWorked432(helper_IntToBooleanConverter(rs.getInt("notQRV432"))); + checkForThis.setWorked1240(helper_IntToBooleanConverter(rs.getInt("notQRV1240"))); + checkForThis.setWorked2300(helper_IntToBooleanConverter(rs.getInt("notQRV2300"))); + checkForThis.setWorked3400(helper_IntToBooleanConverter(rs.getInt("notQRV3400"))); + checkForThis.setWorked5600(helper_IntToBooleanConverter(rs.getInt("notQRV5600"))); + checkForThis.setWorked10G(helper_IntToBooleanConverter(rs.getInt("notQRV10G"))); + System.out.println( "[DBH, Info:] providing callsign wkd info, wkd, 144, 432, ... for UA5 new chatmember : " + checkForThis.toString()); @@ -367,7 +469,9 @@ public class DBController { * Usage: User triggered after User clicked the reset-wkd button, may in each * new contest period
*
- * + * + * modified for work with v1.2 + * * @return true if reset was successful * * @throws SQLException @@ -377,7 +481,8 @@ public class DBController { try { Statement stmt = connection.createStatement(); - int affected = stmt.executeUpdate("update ChatMember set worked = 0, worked144 = 0, worked432 = 0, worked1240 = 0, worked2300 = 0, worked3400 = 0, worked5600 = 0, worked10G = 0;"); + int affected = stmt.executeUpdate("update ChatMember set worked = 0, worked144 = 0, worked432 = 0, worked1240 = 0, worked2300 = 0, worked3400 = 0, worked5600 = 0, worked10G = 0" + + ", notQrv144 = 0, notQrv432 = 0, notQrv1240 = 0, notQrv2300 = 0, notQrv3400 = 0, notQrv5600 = 0, notQrv10G = 0;"); stmt.close(); @@ -517,6 +622,77 @@ public class DBController { } } + public boolean updateNotQRVInfoOnChatMember(ChatMember chatMemberToStore) throws SQLException { + try { + Statement stmt = connection.createStatement(); + + /** + * at first, mark the station as worked, always + */ + PreparedStatement ps = connection.prepareStatement("UPDATE ChatMember set notQrv144 = ? WHERE CallSign = ?"); + + ps.setInt(1, helper_booleanIntConverter(!chatMemberToStore.isQrv144())); + ps.setString(2, chatMemberToStore.getCallSign()); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement("UPDATE ChatMember set notQrv432 = ? WHERE CallSign = ?"); + + ps.setInt(1, helper_booleanIntConverter(!chatMemberToStore.isQrv432())); + ps.setString(2, chatMemberToStore.getCallSign()); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement("UPDATE ChatMember set notQrv1240 = ? WHERE CallSign = ?"); + + ps.setInt(1, helper_booleanIntConverter(!chatMemberToStore.isQrv1240())); + ps.setString(2, chatMemberToStore.getCallSign()); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement("UPDATE ChatMember set notQrv2300 = ? WHERE CallSign = ?"); + + ps.setInt(1, helper_booleanIntConverter(!chatMemberToStore.isQrv2300())); + ps.setString(2, chatMemberToStore.getCallSign()); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement("UPDATE ChatMember set notQrv3400 = ? WHERE CallSign = ?"); + + ps.setInt(1, helper_booleanIntConverter(!chatMemberToStore.isQrv3400())); + ps.setString(2, chatMemberToStore.getCallSign()); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement("UPDATE ChatMember set notQrv5600 = ? WHERE CallSign = ?"); + + ps.setInt(1, helper_booleanIntConverter(!chatMemberToStore.isQrv5600())); + ps.setString(2, chatMemberToStore.getCallSign()); + ps.addBatch(); + ps.executeBatch(); + + ps = connection.prepareStatement("UPDATE ChatMember set notQrv10G = ? WHERE CallSign = ?"); + + ps.setInt(1, helper_booleanIntConverter(!chatMemberToStore.isQrv10G())); + ps.setString(2, chatMemberToStore.getCallSign()); + ps.addBatch(); + ps.executeBatch(); + + connection.setAutoCommit(false); + connection.setAutoCommit(true); + + + stmt.close(); + + } catch (SQLException e) { + System.err.println("[DBH, ERROR:] Couldn't handle DB-Query"); + e.printStackTrace(); + connection.close(); + return false; + } + return true; + } + private int helper_booleanIntConverter(boolean convertToInt) { if (convertToInt) { @@ -545,11 +721,15 @@ public class DBController { dummy.setName("Team Test"); dummy.setLastActivity(new Utils4KST().time_generateActualTimeInDateFormat()); dummy.setWorked5600(true); + +// dbc.versionUpdateOfDBCheckAndChangeV11ToV12(); +// dbc.fetchChatMemberNOTQRVBandInfoForOnlyOneCallsignFromDB(); +// dbc.updateNOTQRVBandInfoOnChatMember(); // dummy.setWorked432(true); // dbc.storeChatMember(dummy); - dbc.updateWkdInfoOnChatMember(dummy); +// dbc.updateWkdInfoOnChatMember(dummy); // dbc.handleDB(); } diff --git a/src/main/java/kst4contest/model/ChatMember.java b/src/main/java/kst4contest/model/ChatMember.java index bff41d1..5f89ab7 100644 --- a/src/main/java/kst4contest/model/ChatMember.java +++ b/src/main/java/kst4contest/model/ChatMember.java @@ -40,14 +40,17 @@ public class ChatMember { boolean worked5600; boolean worked10G; - boolean qrv144; - boolean qrv432; - boolean qrv1240; - boolean qrv2300; - boolean qrv3400; - boolean qrv5600; - boolean qrv10G; - boolean qrvAny; + /** + * Chatmember is qrv at all band except we initialize anything other, depending to user entry + */ + boolean qrv144 = true; + boolean qrv432 = true; + boolean qrv1240 = true; + boolean qrv2300 = true; + boolean qrv3400 = true; + boolean qrv5600 = true; + boolean qrv10G = true; + boolean qrvAny = true; diff --git a/src/main/java/kst4contest/model/ChatPreferences.java b/src/main/java/kst4contest/model/ChatPreferences.java index d18a734..5a816bc 100644 --- a/src/main/java/kst4contest/model/ChatPreferences.java +++ b/src/main/java/kst4contest/model/ChatPreferences.java @@ -145,6 +145,15 @@ public class ChatPreferences { ChatCategory loginChatCategory = new ChatCategory(2); IntegerProperty actualQTF = new SimpleIntegerProperty(360); // will be updated by user at runtime! + boolean stn_bandActive144; + boolean stn_bandActive432; + boolean stn_bandActive1240; + boolean stn_bandActive2300; + boolean stn_bandActive3400; + boolean stn_bandActive5600; + boolean stn_bandActive10G; + + /** * Log Synch preferences @@ -598,6 +607,34 @@ public class ChatPreferences { stn_qtfDefault.setTextContent(this.stn_qtfDefault+""); station.appendChild(stn_qtfDefault); + Element stn_bandActive144 = doc.createElement("stn_bandActive144"); + stn_bandActive144.setTextContent(this.stn_bandActive144+""); + station.appendChild(stn_bandActive144); + + Element stn_bandActive432 = doc.createElement("stn_bandActive432"); + stn_bandActive432.setTextContent(this.stn_bandActive432+""); + station.appendChild(stn_bandActive432); + + Element stn_bandActive1240 = doc.createElement("stn_bandActive1240"); + stn_bandActive1240.setTextContent(this.stn_bandActive1240+""); + station.appendChild(stn_bandActive1240); + + Element stn_bandActive2300 = doc.createElement("stn_bandActive2300"); + stn_bandActive2300.setTextContent(this.stn_bandActive2300+""); + station.appendChild(stn_bandActive2300); + + Element stn_bandActive3400 = doc.createElement("stn_bandActive3400"); + stn_bandActive3400.setTextContent(this.stn_bandActive3400+""); + station.appendChild(stn_bandActive3400); + + Element stn_bandActive5600 = doc.createElement("stn_bandActive5600"); + stn_bandActive5600.setTextContent(this.stn_bandActive5600+""); + station.appendChild(stn_bandActive5600); + + Element stn_bandActive10G = doc.createElement("stn_bandActive10G"); + stn_bandActive10G.setTextContent(this.stn_bandActive10G+""); + station.appendChild(stn_bandActive10G); + // Element salary = doc.createElement("salary"); // salary.setAttribute("currency", "USD"); // salary.setTextContent("5000"); @@ -896,11 +933,104 @@ public class ChatPreferences { double qtfDefault = Double.parseDouble(element.getElementsByTagName("stn_qtfDefault").item(0).getTextContent()); stn_qtfDefault = qtfDefault; + try { + + String stnUses144 = element + .getElementsByTagName("stn_bandActive144").item(0) + .getTextContent(); + + if (stnUses144.equals("true")) { + + stn_bandActive144 = true; + } else { + stn_bandActive144 = false; + } + + String stnUses432 = element + .getElementsByTagName("stn_bandActive432").item(0) + .getTextContent(); + + if (stnUses432.equals("true")) { + + stn_bandActive432 = true; + } else { + stn_bandActive432 = false; + } + + String stnUses1240 = element + .getElementsByTagName("stn_bandActive1240").item(0) + .getTextContent(); + + if (stnUses1240.equals("true")) { + + stn_bandActive1240 = true; + } else { + stn_bandActive1240 = false; + } + + String stnUses2300 = element + .getElementsByTagName("stn_bandActive2300").item(0) + .getTextContent(); + + if (stnUses2300.equals("true")) { + + stn_bandActive2300 = true; + } else { + stn_bandActive2300 = false; + } + + String stnUses3400 = element + .getElementsByTagName("stn_bandActive3400").item(0) + .getTextContent(); + + if (stnUses3400.equals("true")) { + + stn_bandActive3400 = true; + } else { + stn_bandActive3400 = false; + } + + String stnUses5600 = element + .getElementsByTagName("stn_bandActive5600").item(0) + .getTextContent(); + + if (stnUses5600.equals("true")) { + + stn_bandActive5600 = true; + } else { + stn_bandActive5600 = false; + } + + String stnUses10G = element + .getElementsByTagName("stn_bandActive10G").item(0) + .getTextContent(); + + if (stnUses10G.equals("true")) { + + stn_bandActive10G = true; + } else { + stn_bandActive10G = false; + } + + } catch (NullPointerException tooOldConfigFileOrFormatError) { + /** + * In program version 1 there had not been these settings in the xml and not founding em + * would cause an exception and dumb values for the preferences. So we have to initialize + * these variables and later write a proper configfile which can be used correctly then. + */ + stn_bandActive144 = true; + stn_bandActive432 = true; + stn_bandActive1240 = true; + stn_bandActive2300 = true; + stn_bandActive3400 = true; + stn_bandActive5600 = true; + stn_bandActive10G = true; + } System.out.println("[ChatPreferences, info]: Current Element: " + node.getNodeName() + " --> call: " + call + " / " + password + " / " + loginDisplayedName + " / " + qra - + " / " + category + " / " + antennaBeamWidthDeg + " / " + maxQRBDefault + " / " + qtfDefault); + + " / " + category + " / " + antennaBeamWidthDeg + " / " + maxQRBDefault + " / " + qtfDefault + " qrv144: " + stn_bandActive144); } } @@ -1297,6 +1427,61 @@ public class ChatPreferences { } + public boolean isStn_bandActive144() { + return stn_bandActive144; + } + + public void setStn_bandActive144(boolean stn_bandActive144) { + this.stn_bandActive144 = stn_bandActive144; + } + + public boolean isStn_bandActive432() { + return stn_bandActive432; + } + + public void setStn_bandActive432(boolean stn_bandActive432) { + this.stn_bandActive432 = stn_bandActive432; + } + + public boolean isStn_bandActive1240() { + return stn_bandActive1240; + } + + public void setStn_bandActive1240(boolean stn_bandActive1240) { + this.stn_bandActive1240 = stn_bandActive1240; + } + + public boolean isStn_bandActive2300() { + return stn_bandActive2300; + } + + public void setStn_bandActive2300(boolean stn_bandActive2300) { + this.stn_bandActive2300 = stn_bandActive2300; + } + + public boolean isStn_bandActive3400() { + return stn_bandActive3400; + } + + public void setStn_bandActive3400(boolean stn_bandActive3400) { + this.stn_bandActive3400 = stn_bandActive3400; + } + + public boolean isStn_bandActive5600() { + return stn_bandActive5600; + } + + public void setStn_bandActive5600(boolean stn_bandActive5600) { + this.stn_bandActive5600 = stn_bandActive5600; + } + + public boolean isStn_bandActive10G() { + return stn_bandActive10G; + } + + public void setStn_bandActive10G(boolean stn_bandActive10G) { + this.stn_bandActive10G = stn_bandActive10G; + } /** * diff --git a/src/main/java/kst4contest/view/Kst4ContestApplication.java b/src/main/java/kst4contest/view/Kst4ContestApplication.java index e1b6bd7..f877201 100644 --- a/src/main/java/kst4contest/view/Kst4ContestApplication.java +++ b/src/main/java/kst4contest/view/Kst4ContestApplication.java @@ -10,6 +10,7 @@ import java.util.function.Predicate; import javafx.beans.binding.Bindings; import javafx.scene.control.*; +import javafx.scene.image.ImageView; import javafx.scene.input.*; import javafx.scene.layout.*; import javafx.scene.media.Media; @@ -46,6 +47,10 @@ import javafx.util.Callback; import kst4contest.locatorUtils.DirectionUtils; import kst4contest.model.*; +import javafx.scene.shape.Line; +import javafx.scene.shape.Polygon; +import javafx.scene.Group; + public class Kst4ContestApplication extends Application { // private static final Kst4ContestApplication dbcontroller = new DBController(); @@ -63,6 +68,41 @@ public class Kst4ContestApplication extends Application { Timer timer_updatePrivatemessageTable; // same here VBox selectedCallSignFurtherInfoPane = new VBox(); + public static Node createArrow(double deg) { + // Convert degrees to radians + double rad = Math.toRadians(90-180 - deg); + + // Length of the arrow line + double arrowLength = 6; + + // Coordinates of the arrow tip + double tipX = arrowLength * Math.cos(rad); + double tipY = arrowLength * Math.sin(rad); + + // Draw the arrow line + Line arrowLine = new Line(0, 0, tipX, -tipY); + arrowLine.setStroke(Color.LIGHTGREEN); + + // Calculate coordinates for the arrowhead + double arrowheadAngle = Math.toRadians(20); // Angle of arrowhead + double arrowheadLength = 15; // Length of arrowhead + double arrowheadX1 = tipX + arrowheadLength * Math.cos(rad - arrowheadAngle); + double arrowheadY1 = tipY + arrowheadLength * Math.sin(rad - arrowheadAngle); + double arrowheadX2 = tipX + arrowheadLength * Math.cos(rad + arrowheadAngle); + double arrowheadY2 = tipY + arrowheadLength * Math.sin(rad + arrowheadAngle); + + // Draw the arrowhead + Polygon arrowhead = new Polygon( + 0, 0, // tip + arrowheadX1, -arrowheadY1, // left corner + arrowheadX2, -arrowheadY2 // right corner + ); + arrowhead.setFill(Color.GREEN); + + // Return the arrow element (line + polygon) + return new javafx.scene.Group(arrowLine, arrowhead); + } + private BorderPane generateFurtherInfoAbtSelectedCallsignBP(ChatMember selectedCallSignInfoStageChatMember) { selectedCallSignInfoBorderPane = new BorderPane(); @@ -73,19 +113,7 @@ public class Kst4ContestApplication extends Application { TableView initFurtherInfoAbtCallsignMSGTable = initFurtherInfoAbtCallsignMSGTable(); -// ChatMember dummy = new ChatMember(); -// dummy.setCallSign("DM5M"); -// dummy.setQra("JO51IJ"); -// dummy.setQrb(0.0); -// dummy.setQTFdirection(0.0); -// dummy.setName("me"); -// dummy.setState(0); -// -// selectedCallSignInfoStageChatMember = dummy; - - Label selectedCallSignInfoLblQTFInfo = new Label("QTF:" + selectedCallSignInfoStageChatMember.getQTFdirection() + " deg"); -// System.out.println("qtfinfolabel should show: " + selectedCallSignInfoStageChatMember.getQrb()); Label selectedCallSignInfoLblQRBInfo = new Label("QRB: " + selectedCallSignInfoStageChatMember.getQrb() + " km"); @@ -99,31 +127,219 @@ public class Kst4ContestApplication extends Application { selectedCallSignDownerSiteGridPane.add(new Label("Last activity: " + new Utils4KST().time_convertEpochToReadable(selectedCallSignInfoStageChatMember.getActivityTimeLastInEpoch()+"")), 0,2,1,1); selectedCallSignDownerSiteGridPane.add(new Label(("(" + Utils4KST.time_getSecondsBetweenEpochAndNow(selectedCallSignInfoStageChatMember.getActivityTimeLastInEpoch()+"") /60%60) +" min ago)"), 0,3,1,1); +// selectedCallSignDownerSiteGridPane.add(createArrow(selectedCallSignInfoStageChatMember.getQTFdirection()),1,2,2,2); //moved to as button + /** * users qrv info setting will follow here */ - CheckBox chkbx_tagMemberNotQRVFurtherInfoPane = new CheckBox("tag NOT QRV ALL"); - chkbx_tagMemberNotQRVFurtherInfoPane.setSelected(selectedCallSignInfoStageChatMember.isQrvAny()); - chkbx_tagMemberNotQRVFurtherInfoPane.selectedProperty().addListener(new ChangeListener() { +// CheckBox chkbx_tagMemberNotQRVFurtherInfoPane = new CheckBox("tag NOT QRV ALL"); +// chkbx_tagMemberNotQRVFurtherInfoPane.setSelected(selectedCallSignInfoStageChatMember.isQrvAny()); +// chkbx_tagMemberNotQRVFurtherInfoPanefurtherInfoPnl_chkbx_notQRV144 + + CheckBox furtherInfoPnl_chkbx_notQRV144 = new CheckBox("tag not qrv 144"); + furtherInfoPnl_chkbx_notQRV144.setSelected(!selectedCallSignInfoStageChatMember.isQrv144()); + furtherInfoPnl_chkbx_notQRV144.selectedProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { - //if selected: NOT QRV; if NOT selected: is qrv! if (!newValue) { - chkbx_tagMemberNotQRVFurtherInfoPane.selectedProperty().setValue(true); + selectedCallSignInfoStageChatMember.setQrv144(true); } else { - chkbx_tagMemberNotQRVFurtherInfoPane.selectedProperty().setValue(false); + selectedCallSignInfoStageChatMember.setQrv144(false); + } + try { + + chatcontroller.getDbHandler().updateNotQRVInfoOnChatMember(selectedCallSignInfoStageChatMember); + } catch (Exception e) { + //do nothing, upodate was not possible } } }); - selectedCallSignDownerSiteGridPane.add(new CheckBox("tag not qrv 144"), 2,0,1,1); - selectedCallSignDownerSiteGridPane.add(new CheckBox("tag not qrv 432"), 2,1,1,1); - selectedCallSignDownerSiteGridPane.add(new CheckBox("tag not qrv 23cm"), 2,2,1,1); - selectedCallSignDownerSiteGridPane.add(new CheckBox("tag not qrv 13cm"), 2,3,1,1); - selectedCallSignDownerSiteGridPane.add(new CheckBox("tag not qrv 9cm"), 3,0,1,1); - selectedCallSignDownerSiteGridPane.add(new CheckBox("tag not qrv 6cm"), 3,1,1,1); - selectedCallSignDownerSiteGridPane.add(new CheckBox("tag not qrv 3cm"), 3,2,1,1); - selectedCallSignDownerSiteGridPane.add(new CheckBox("tag not qrv all"), 3,3,1,1); + CheckBox furtherInfoPnl_chkbx_notQRV432 = new CheckBox("tag not qrv 432"); + furtherInfoPnl_chkbx_notQRV432.setSelected(!selectedCallSignInfoStageChatMember.isQrv432()); + furtherInfoPnl_chkbx_notQRV432.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + if (!newValue) { + selectedCallSignInfoStageChatMember.setQrv432(true); + } else { + selectedCallSignInfoStageChatMember.setQrv432(false); + } + + try { + + chatcontroller.getDbHandler().updateNotQRVInfoOnChatMember(selectedCallSignInfoStageChatMember); + } catch (Exception e) { + //do nothing, upodate was not possible + } + } + }); + + CheckBox furtherInfoPnl_chkbx_notQRV23 = new CheckBox("tag not qrv 23cm"); + furtherInfoPnl_chkbx_notQRV23.setSelected(!selectedCallSignInfoStageChatMember.isQrv1240()); + furtherInfoPnl_chkbx_notQRV23.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + if (!newValue) { + selectedCallSignInfoStageChatMember.setQrv1240(true); + } else { + selectedCallSignInfoStageChatMember.setQrv1240(false); + } + + try { + + chatcontroller.getDbHandler().updateNotQRVInfoOnChatMember(selectedCallSignInfoStageChatMember); + } catch (Exception e) { + //do nothing, upodate was not possible + } + } + }); + + CheckBox furtherInfoPnl_chkbx_notQRV13 = new CheckBox("tag not qrv 13cm"); + furtherInfoPnl_chkbx_notQRV13.setSelected(!selectedCallSignInfoStageChatMember.isQrv2300()); + furtherInfoPnl_chkbx_notQRV13.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + if (!newValue) { + selectedCallSignInfoStageChatMember.setQrv2300(true); + } else { + selectedCallSignInfoStageChatMember.setQrv2300(false); + } + + try { + + chatcontroller.getDbHandler().updateNotQRVInfoOnChatMember(selectedCallSignInfoStageChatMember); + } catch (Exception e) { + //do nothing, upodate was not possible + } + } + }); + + CheckBox furtherInfoPnl_chkbx_notQRV9 = new CheckBox("tag not qrv 9cm"); + furtherInfoPnl_chkbx_notQRV9.setSelected(!selectedCallSignInfoStageChatMember.isQrv3400()); + furtherInfoPnl_chkbx_notQRV9.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + if (!newValue) { + selectedCallSignInfoStageChatMember.setQrv3400(true); + } else { + selectedCallSignInfoStageChatMember.setQrv3400(false); + } + + try { + + chatcontroller.getDbHandler().updateNotQRVInfoOnChatMember(selectedCallSignInfoStageChatMember); + } catch (Exception e) { + //do nothing, upodate was not possible + } + } + }); + + CheckBox furtherInfoPnl_chkbx_notQRV6 = new CheckBox("tag not qrv 6cm"); + furtherInfoPnl_chkbx_notQRV6.setSelected(!selectedCallSignInfoStageChatMember.isQrv5600()); + furtherInfoPnl_chkbx_notQRV6.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + if (!newValue) { + selectedCallSignInfoStageChatMember.setQrv5600(true); + } else { + selectedCallSignInfoStageChatMember.setQrv5600(false); + } + + try { + + chatcontroller.getDbHandler().updateNotQRVInfoOnChatMember(selectedCallSignInfoStageChatMember); + } catch (Exception e) { + //do nothing, upodate was not possible + } + } + }); + + CheckBox furtherInfoPnl_chkbx_notQRV3 = new CheckBox("tag not qrv 3cm"); + furtherInfoPnl_chkbx_notQRV3.setSelected(!selectedCallSignInfoStageChatMember.isQrv10G()); + furtherInfoPnl_chkbx_notQRV3.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + if (!newValue) { + selectedCallSignInfoStageChatMember.setQrv10G(true); + } else { + selectedCallSignInfoStageChatMember.setQrv10G(false); + } + + try { + + chatcontroller.getDbHandler().updateNotQRVInfoOnChatMember(selectedCallSignInfoStageChatMember); + } catch (Exception e) { + //do nothing, upodate was not possible + } + } + }); + + CheckBox furtherInfoPnl_chkbx_notQRVall = new CheckBox("tag not qrv all"); + furtherInfoPnl_chkbx_notQRVall.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + if (!newValue) { + selectedCallSignInfoStageChatMember.setQrv144(true); + selectedCallSignInfoStageChatMember.setQrv432(true); + selectedCallSignInfoStageChatMember.setQrv1240(true); + selectedCallSignInfoStageChatMember.setQrv2300(true); + selectedCallSignInfoStageChatMember.setQrv3400(true); + selectedCallSignInfoStageChatMember.setQrv5600(true); + selectedCallSignInfoStageChatMember.setQrv10G(true); + } else { + selectedCallSignInfoStageChatMember.setQrv144(false); + selectedCallSignInfoStageChatMember.setQrv432(false); + selectedCallSignInfoStageChatMember.setQrv1240(false); + selectedCallSignInfoStageChatMember.setQrv2300(false); + selectedCallSignInfoStageChatMember.setQrv3400(false); + selectedCallSignInfoStageChatMember.setQrv5600(false); + selectedCallSignInfoStageChatMember.setQrv10G(false); + } + + try { + + chatcontroller.getDbHandler().updateNotQRVInfoOnChatMember(selectedCallSignInfoStageChatMember); + } catch (Exception e) { + //do nothing, upodate was not possible + } + } + }); + + selectedCallSignDownerSiteGridPane.add(furtherInfoPnl_chkbx_notQRV144, 2,0,1,1); + selectedCallSignDownerSiteGridPane.add(furtherInfoPnl_chkbx_notQRV432, 2,1,1,1); + selectedCallSignDownerSiteGridPane.add(furtherInfoPnl_chkbx_notQRV23, 2,2,1,1); + selectedCallSignDownerSiteGridPane.add(furtherInfoPnl_chkbx_notQRV13, 2,3,1,1); + selectedCallSignDownerSiteGridPane.add(furtherInfoPnl_chkbx_notQRV9, 3,0,1,1); + selectedCallSignDownerSiteGridPane.add(furtherInfoPnl_chkbx_notQRV6, 3,1,1,1); + selectedCallSignDownerSiteGridPane.add(furtherInfoPnl_chkbx_notQRV3, 3,2,1,1); + selectedCallSignDownerSiteGridPane.add(furtherInfoPnl_chkbx_notQRVall, 3,3,1,1); + + if (!chatcontroller.getChatPreferences().isStn_bandActive144()) { + furtherInfoPnl_chkbx_notQRV144.setVisible(false); + } + if (!chatcontroller.getChatPreferences().isStn_bandActive432()) { + furtherInfoPnl_chkbx_notQRV432.setVisible(false); + } + + if (!chatcontroller.getChatPreferences().isStn_bandActive1240()) { + furtherInfoPnl_chkbx_notQRV23.setVisible(false); + } + if (!chatcontroller.getChatPreferences().isStn_bandActive2300()) { + furtherInfoPnl_chkbx_notQRV13.setVisible(false); + } + if (!chatcontroller.getChatPreferences().isStn_bandActive3400()) { + furtherInfoPnl_chkbx_notQRV9.setVisible(false); + } + if (!chatcontroller.getChatPreferences().isStn_bandActive5600()) { + furtherInfoPnl_chkbx_notQRV6.setVisible(false); + } + if (!chatcontroller.getChatPreferences().isStn_bandActive10G()) { + furtherInfoPnl_chkbx_notQRV3.setVisible(false); + } + + + /** * users qrv info setting ending @@ -137,6 +353,8 @@ public class Kst4ContestApplication extends Application { } }); + selectedCallSignShowAsPathBtn.setGraphic(createArrow(selectedCallSignInfoStageChatMember.getQTFdirection())); + selectedCallSignDownerSiteGridPane.add(selectedCallSignShowAsPathBtn, 1,0,1,2); @@ -460,6 +678,7 @@ public class Kst4ContestApplication extends Application { return qra; } }); + qtfCol.prefWidthProperty().bind(tbl_chatMemberTable.widthProperty().divide(15)); TableColumn qrgCol = new TableColumn("QRG"); qrgCol.setCellValueFactory(new Callback, ObservableValue>() { @@ -563,7 +782,11 @@ public class Kst4ContestApplication extends Application { return lastActEpoch; } }); + lastActCol.prefWidthProperty().bind(tbl_chatMemberTable.widthProperty().divide(32)); +/** + * section of worked flag in chatmember table + */ TableColumn workedCol = new TableColumn("worked"); workedCol.setCellValueFactory(new Callback, ObservableValue>() { @@ -582,7 +805,7 @@ public class Kst4ContestApplication extends Application { } }); - TableColumn wkdAny_subcol = new TableColumn("wkd"); + TableColumn wkdAny_subcol = new TableColumn("wkdany"); wkdAny_subcol .setCellValueFactory(new Callback, ObservableValue>() { @@ -731,20 +954,105 @@ public class Kst4ContestApplication extends Application { shf3_subcol.prefWidthProperty().bind(tbl_chatMemberTable.widthProperty().divide(32)); -// TableColumn unworkableCol = new TableColumn("qrv"); -// unworkableCol.setCellFactory(CheckBoxTableCell.forTableColumn("lalala", c -> -// System.out.println(c.getCallSign()))); + /** + * section of NOT-QRV flag in chatmember table + */ -// TableColumn uhfCol_subcol = new TableColumn("432"); //TODO: Worked band analysis -// TableColumn shf23_subcol = new TableColumn("23"); -// TableColumn shf13_subcol = new TableColumn("13"); -// TableColumn shf9_subcol = new TableColumn("9"); -// TableColumn shf6_subcol = new TableColumn("6"); -// TableColumn shf3_subcol = new TableColumn("3"); - workedCol.getColumns().addAll(wkdAny_subcol, vhfCol_subcol, uhfCol_subcol, shf23_subcol, shf13_subcol, - shf9_subcol, shf6_subcol, shf3_subcol); // TODO: automatize enabling to users bandChoice + TableColumn notQRVCol = new TableColumn("NOT QRV @"); + notQRVCol.setCellValueFactory(new Callback, ObservableValue>() { - tbl_chatMemberTable.getColumns().addAll(callSignCol, nameCol, qraCol, qtfCol, qrgCol, lastActCol, airScoutCol, workedCol); + @Override + public ObservableValue call(CellDataFeatures cellDataFeatures) { + SimpleStringProperty wkd = new SimpleStringProperty(); + + wkd.setValue(""); + + if (!cellDataFeatures.getValue().isQrv144()) { + wkd.setValue(wkd.getValue() + "144 "); + } else { + wkd.setValue(wkd.getValue().replace("144 ","")); + } + + if (!cellDataFeatures.getValue().isQrv432()) { + wkd.setValue(wkd.getValue() + "70 "); + } else { + wkd.setValue(wkd.getValue().replace("70 ","")); + } + + if (!cellDataFeatures.getValue().isQrv1240()) { + wkd.setValue(wkd.getValue() + "SHF23 "); + } else { + wkd.setValue(wkd.getValue().replace("SHFcm ","")); + } + + if (!cellDataFeatures.getValue().isQrv2300()) { + wkd.setValue(wkd.getValue() + "SHF13 "); + } else { + wkd.setValue(wkd.getValue().replace("SHF13 ","")); + } + + if (!cellDataFeatures.getValue().isQrv3400()) { + wkd.setValue(wkd.getValue() + "SHF9 "); + } else { + wkd.setValue(wkd.getValue().replace("SHF9 ","")); + } + + if (!cellDataFeatures.getValue().isQrv5600()) { + wkd.setValue(wkd.getValue() + "SHF6 "); + } else { + wkd.setValue(wkd.getValue().replace("SHF6 ","")); + } + + if (!cellDataFeatures.getValue().isQrv10G()) { + wkd.setValue(wkd.getValue() + "SHF3 "); + } else { + wkd.setValue(wkd.getValue().replace("SHF3 ","")); + } + + + return wkd; + } + }); + + + + + /** + * add now only cols which affects the used band of my station + */ + + if (chatcontroller.getChatPreferences().isStn_bandActive144()) { + workedCol.getColumns().add(vhfCol_subcol); + } + if (chatcontroller.getChatPreferences().isStn_bandActive432()) { + workedCol.getColumns().add(uhfCol_subcol); + } + + if (chatcontroller.getChatPreferences().isStn_bandActive1240()) { + workedCol.getColumns().add(shf23_subcol); + } + if (chatcontroller.getChatPreferences().isStn_bandActive2300()) { + workedCol.getColumns().add(shf13_subcol); + } + if (chatcontroller.getChatPreferences().isStn_bandActive3400()) { + workedCol.getColumns().add(shf9_subcol); + } + if (chatcontroller.getChatPreferences().isStn_bandActive5600()) { + workedCol.getColumns().add(shf6_subcol); + } + if (chatcontroller.getChatPreferences().isStn_bandActive10G()) { + workedCol.getColumns().add(shf3_subcol); + } + + /** + * The worked any col makes sense in all cases + */ + workedCol.getColumns().add(wkdAny_subcol); + + + + + tbl_chatMemberTable.getColumns().addAll(callSignCol, nameCol, qraCol, qtfCol, qrgCol, lastActCol, airScoutCol, workedCol, notQRVCol); // tbl_chatMemberTable.setItems(chatcontroller.getLst_chatMemberListFiltered()); @@ -2475,11 +2783,13 @@ public class Kst4ContestApplication extends Application { Button btnOptionspnlConnect; ContextMenu chatMessageContextMenu; // public due need to update it on modify ContextMenu chatMemberContextMenu;// public due need to update it on modify + HBox chatMemberTableFilterQTFAndQRBHbox; + FlowPane flwPane_textSnippets; Stage clusterAndQSOMonStage; Stage stage_selectedCallSignInfoStage; - ChatMember selectedCallSignInfoStageChatMember = new ChatMember(); + ChatMember selectedCallSignInfoStageChatMember; BorderPane selectedCallSignInfoBorderPane; @@ -3439,7 +3749,10 @@ public class Kst4ContestApplication extends Application { } else { - selectedCallSignInfoStageChatMember = selectedChatMember.getList().get(0); +// selectedCallSignInfoStageChatMember = selectedChatMember.getList().get(0); //TODO: may need reference to original chatmember object + selectedCallSignInfoStageChatMember = chatcontroller.getLst_chatMemberList() + .get(chatcontroller.checkListForChatMemberIndexByCallSign( + selectedChatMember.getList().get(0))); selectedCallSignFurtherInfoPane.getChildren().clear(); selectedCallSignFurtherInfoPane.getChildren().add(generateFurtherInfoAbtSelectedCallsignBP(selectedCallSignInfoStageChatMember)); @@ -3490,7 +3803,7 @@ public class Kst4ContestApplication extends Application { BorderPane chatMemberTableBorderPane = new BorderPane(); chatMemberTableBorderPane.setCenter(tbl_chatMember); - HBox chatMemberTableFilterQTFAndQRBHbox = new HBox(); + chatMemberTableFilterQTFAndQRBHbox = new HBox(); chatMemberTableFilterQTFAndQRBHbox.setSpacing(10); // chatMemberTableFilterQTFAndQRBHbox.set @@ -3763,7 +4076,7 @@ public class Kst4ContestApplication extends Application { @Override public boolean test(ChatMember chatMember) { - if (chatMember.isWorked144()) { + if (chatMember.isWorked144() || !chatMember.isQrv144()) { return false; } else return true; @@ -3780,6 +4093,7 @@ public class Kst4ContestApplication extends Application { } } }); +// btnTglwkd144.setVisible(chatcontroller.getChatPreferences().isStn_bandActive144()); ToggleButton btnTglwkd432 = new ToggleButton("432"); @@ -3787,7 +4101,7 @@ public class Kst4ContestApplication extends Application { @Override public boolean test(ChatMember chatMember) { - if (chatMember.isWorked432()) { + if (chatMember.isWorked432() || !chatMember.isQrv432()) { return false; } else return true; @@ -3804,6 +4118,7 @@ public class Kst4ContestApplication extends Application { } } }); +// btnTglwkd432.setVisible(chatcontroller.getChatPreferences().isStn_bandActive432()); ToggleButton btnTglwkd23 = new ToggleButton("23"); @@ -3812,7 +4127,7 @@ public class Kst4ContestApplication extends Application { @Override public boolean test(ChatMember chatMember) { - if (chatMember.isWorked1240()) { + if (chatMember.isWorked1240() || !chatMember.isQrv1240()) { return false; } else return true; @@ -3836,7 +4151,7 @@ public class Kst4ContestApplication extends Application { @Override public boolean test(ChatMember chatMember) { - if (chatMember.isWorked2300()) { + if (chatMember.isWorked2300() || !chatMember.isQrv2300()) { return false; } else return true; @@ -3860,7 +4175,7 @@ public class Kst4ContestApplication extends Application { @Override public boolean test(ChatMember chatMember) { - if (chatMember.isWorked3400()) { + if (chatMember.isWorked3400() || !chatMember.isQrv3400()) { return false; } else return true; @@ -3885,7 +4200,7 @@ public class Kst4ContestApplication extends Application { @Override public boolean test(ChatMember chatMember) { - if (chatMember.isWorked5600()) { + if (chatMember.isWorked5600() || !chatMember.isQrv5600()) { return false; } else return true; @@ -3910,7 +4225,7 @@ public class Kst4ContestApplication extends Application { @Override public boolean test(ChatMember chatMember) { - if (chatMember.isWorked10G()) { + if (chatMember.isWorked10G() || !chatMember.isQrv10G()) { return false; } else return true; @@ -3953,17 +4268,39 @@ public class Kst4ContestApplication extends Application { } }); - btnTglInactive.setTooltip(new Tooltip("not implemented yet!")); + btnTglInactive.setTooltip(new Tooltip("Hide inactive stations")); - chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(new Label("Hide: ")); + chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(new Label("Hide worked:\nHide un-QRV: ")); chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd); - chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd144); - chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd432); - chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd23); - chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd13); - chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd9); - chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd6); - chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd3); + + /** + * add only filter buttons at the callsigntable which affects used bands + */ + if (chatcontroller.getChatPreferences().isStn_bandActive144()) { + chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd144); + } + if (chatcontroller.getChatPreferences().isStn_bandActive432()) { + chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd432); + } + + if (chatcontroller.getChatPreferences().isStn_bandActive1240()) { + chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd23); + } + if (chatcontroller.getChatPreferences().isStn_bandActive2300()) { + chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd13); + } + if (chatcontroller.getChatPreferences().isStn_bandActive3400()) { + chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd9); + } + if (chatcontroller.getChatPreferences().isStn_bandActive5600()) { + chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd6); + + } + if (chatcontroller.getChatPreferences().isStn_bandActive10G()) { + chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglwkd3); + + } + chatMemberTableFilterWorkedBandFiltersHbx.getChildren().add(btnTglInactive); chatMemberTableFilterWorkedBandFiltersHbx.setAlignment(Pos.CENTER_LEFT); chatMemberTableFilterWorkedBandFiltersHbx.setSpacing(5); @@ -4385,7 +4722,126 @@ public class Kst4ContestApplication extends Application { vbxStation.getChildren().addAll( generateLabeledSeparator(100, "Set your Login Credentials and Station Parameters here"), grdPnlStation); vbxStation.getChildren().addAll(generateLabeledSeparator(50, - "Don´t forget to reset the worked stations information before starting a new contest!")); + "! ! ! ! Don´t forget to reset the worked stations information before starting a new contest ! ! ! !")); + + + CheckBox settings_chkbx_QRV144 = new CheckBox("My station uses 2m band"); + settings_chkbx_QRV144.setSelected(chatcontroller.getChatPreferences().isStn_bandActive144()); + settings_chkbx_QRV144.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + chatcontroller.getChatPreferences().setStn_bandActive144( + settings_chkbx_QRV144.isSelected()); + System.out.println("[Main.java, Info]: setted my 144 qrv setting to: " + + chatcontroller.getChatPreferences().isStn_bandActive144()); + chatMemberTableFilterQTFAndQRBHbox.setVisible(false); + chatMemberTableFilterQTFAndQRBHbox.setVisible(true); + } + }); + + CheckBox settings_chkbx_QRV432 = new CheckBox("My station uses 70cm band"); + settings_chkbx_QRV432.setSelected(chatcontroller.getChatPreferences().isStn_bandActive432()); + settings_chkbx_QRV432.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + chatcontroller.getChatPreferences().setStn_bandActive432( + settings_chkbx_QRV432.isSelected()); + System.out.println("[Main.java, Info]: setted my 432 qrv setting to: " + + chatcontroller.getChatPreferences().isStn_bandActive432()); + } + }); + + CheckBox settings_chkbx_QRV1240 = new CheckBox("My station uses 23cm band"); + settings_chkbx_QRV1240.setSelected(chatcontroller.getChatPreferences().isStn_bandActive1240()); + settings_chkbx_QRV1240.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + chatcontroller.getChatPreferences().setStn_bandActive1240( + settings_chkbx_QRV1240.isSelected()); + System.out.println("[Main.java, Info]: setted my 1240 qrv setting to: " + + chatcontroller.getChatPreferences().isStn_bandActive1240()); + } + }); + + CheckBox settings_chkbx_QRV2300 = new CheckBox("My station uses 13cm band"); + settings_chkbx_QRV2300.setSelected(chatcontroller.getChatPreferences().isStn_bandActive2300()); + settings_chkbx_QRV2300.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + chatcontroller.getChatPreferences().setStn_bandActive2300( + settings_chkbx_QRV2300.isSelected()); + System.out.println("[Main.java, Info]: setted my 2300 qrv setting to: " + + chatcontroller.getChatPreferences().isStn_bandActive2300()); + } + }); + + CheckBox settings_chkbx_QRV3400 = new CheckBox("My station uses 9cm band"); + settings_chkbx_QRV3400.setSelected(chatcontroller.getChatPreferences().isStn_bandActive3400()); + settings_chkbx_QRV3400.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + chatcontroller.getChatPreferences().setStn_bandActive3400( + settings_chkbx_QRV3400.isSelected()); + System.out.println("[Main.java, Info]: setted my 3400 qrv setting to: " + + chatcontroller.getChatPreferences().isStn_bandActive3400()); + } + }); + + CheckBox settings_chkbx_QRV5600 = new CheckBox("My station uses 6cm band"); + settings_chkbx_QRV5600.setSelected(chatcontroller.getChatPreferences().isStn_bandActive5600()); + settings_chkbx_QRV5600.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + chatcontroller.getChatPreferences().setStn_bandActive5600( + settings_chkbx_QRV5600.isSelected()); + System.out.println("[Main.java, Info]: setted my 5600 qrv setting to: " + + chatcontroller.getChatPreferences().isStn_bandActive5600()); + } + }); + + CheckBox settings_chkbx_QRV10G = new CheckBox("My station uses 3cm band"); + settings_chkbx_QRV10G.setSelected(chatcontroller.getChatPreferences().isStn_bandActive10G()); + settings_chkbx_QRV10G.selectedProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, Boolean oldValue, Boolean newValue) { + chatcontroller.getChatPreferences().setStn_bandActive10G( + settings_chkbx_QRV10G.isSelected()); + System.out.println("[Main.java, Info]: setted my 10G qrv setting to: " + + chatcontroller.getChatPreferences().isStn_bandActive10G()); + } + }); + + + GridPane grdPnlStation_bands = new GridPane(); + grdPnlStation_bands.setPadding(new Insets(10, 10, 10, 10)); + grdPnlStation_bands.setVgap(5); + grdPnlStation_bands.setHgap(5); + + grdPnlStation_bands.add(new Label("Define on which bands you will be qrv today (changes UI a bit ... click save, then restart!)"), 0, 0, 3,1); + grdPnlStation_bands.add(settings_chkbx_QRV144, 0, 1); + grdPnlStation_bands.add(settings_chkbx_QRV432, 1, 1); + grdPnlStation_bands.add(settings_chkbx_QRV1240, 2, 1); + grdPnlStation_bands.add(settings_chkbx_QRV2300, 0, 2); + grdPnlStation_bands.add(settings_chkbx_QRV3400, 1, 2); + grdPnlStation_bands.add(settings_chkbx_QRV5600, 2, 2); + grdPnlStation_bands.add(settings_chkbx_QRV10G, 0, 3); + grdPnlStation_bands.setMaxWidth(555.0); + + grdPnlStation_bands.setStyle(" -fx-border-color: lightgray;\n" + + " -fx-vgap: 5;\n" + + " -fx-hgap: 5;\n" + + " -fx-padding: 5;"); + + vbxStation.getChildren().add(new Label(" ")); //need some space there + vbxStation.getChildren().add(grdPnlStation_bands); + +// vbxStation.getChildren().add(settings_chkbx_QRV144); +// vbxStation.getChildren().add(settings_chkbx_QRV432); +// vbxStation.getChildren().add(settings_chkbx_qRV1240); +// vbxStation.getChildren().add(settings_chkbx_QRV2300); +// vbxStation.getChildren().add(settings_chkbx_QRV3400); +// vbxStation.getChildren().add(settings_chkbx_QRV5600); +// vbxStation.getChildren().add(settings_chkbx_QRV10G); /************************************************************************************* * Log synch settings Tab @@ -5025,7 +5481,7 @@ public class Kst4ContestApplication extends Application { tblVw_worked = initWkdStnTable(); // tblVw_worked.setItems(); TODO - Button btn_wkdDB_reset = new Button("Reset worked-data"); + Button btn_wkdDB_reset = new Button("Reset worked-tags and NOT-QRV-tags"); btn_wkdDB_reset.setOnAction(new EventHandler() { @Override public void handle(ActionEvent event) {