From a538e45ff6f074e09dceb549ac9849bee78664c1 Mon Sep 17 00:00:00 2001 From: SunnyBat Date: Thu, 19 May 2016 01:44:35 -0700 Subject: [PATCH] Replace PAX Prime with PAX West -Maintained small Prime compatibility (Preferences and such) -Updated Play Alarm tooltip in Setup GUI --- src/com/github/sunnybat/paxchecker/Expo.java | 6 +++--- .../sunnybat/paxchecker/browser/PaxsiteReader.java | 6 +++--- .../sunnybat/paxchecker/browser/ShowclixReader.java | 6 +++--- .../sunnybat/paxchecker/resources/ResourceConstants.java | 2 +- .../github/sunnybat/paxchecker/setup/Instructions.html | 2 +- src/com/github/sunnybat/paxchecker/setup/Setup.java | 2 +- src/com/github/sunnybat/paxchecker/setup/SetupCLI.java | 9 ++++++--- src/com/github/sunnybat/paxchecker/setup/SetupGUI.form | 4 ++-- src/com/github/sunnybat/paxchecker/setup/SetupGUI.java | 7 ++++--- 9 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/com/github/sunnybat/paxchecker/Expo.java b/src/com/github/sunnybat/paxchecker/Expo.java index 775e90e..52727fc 100644 --- a/src/com/github/sunnybat/paxchecker/Expo.java +++ b/src/com/github/sunnybat/paxchecker/Expo.java @@ -6,7 +6,7 @@ */ public enum Expo { - PRIME, EAST, SOUTH, AUS; + WEST, EAST, SOUTH, AUS; @Override public String toString() { @@ -16,8 +16,8 @@ public String toString() { public static Expo parseExpo(String expo) { expo = expo.toLowerCase(); - if (expo.contains("prime")) { - return PRIME; + if (expo.contains("prime") || expo.contains("west")) { + return WEST; } else if (expo.contains("east")) { return EAST; } else if (expo.contains("south")) { diff --git a/src/com/github/sunnybat/paxchecker/browser/PaxsiteReader.java b/src/com/github/sunnybat/paxchecker/browser/PaxsiteReader.java index e46feca..8049043 100644 --- a/src/com/github/sunnybat/paxchecker/browser/PaxsiteReader.java +++ b/src/com/github/sunnybat/paxchecker/browser/PaxsiteReader.java @@ -93,18 +93,18 @@ private BufferedReader setUpConnection(URL urlToConnectTo) throws UnknownHostExc } /** - * Returns the HTTP address of the given PAX Expo. Be sure to only use the name of the expo (ex: prime) OR the full name (ex: pax prime) as the + * Returns the HTTP address of the given PAX Expo. Be sure to only use the name of the expo (ex: west) OR the full name (ex: pax west) as the * argument. * * @param expo The PAX expo to get the website link for - * @return The website link of the specified expo, or the PAX Prime link if invalid. + * @return The website link of the specified expo, or the PAX West link if invalid. */ public String getWebsiteLink(Expo expo) { if (expo == null) { return "http://west.paxsite.com"; } switch (expo) { - case PRIME: + case WEST: return "http://west.paxsite.com"; case EAST: return "http://east.paxsite.com"; diff --git a/src/com/github/sunnybat/paxchecker/browser/ShowclixReader.java b/src/com/github/sunnybat/paxchecker/browser/ShowclixReader.java index b70cc1c..946a925 100644 --- a/src/com/github/sunnybat/paxchecker/browser/ShowclixReader.java +++ b/src/com/github/sunnybat/paxchecker/browser/ShowclixReader.java @@ -261,7 +261,7 @@ private static int getPartnerID(Expo expo) { return 48; } switch (expo) { - case PRIME: + case WEST: case EAST: case SOUTH: return 48; @@ -278,7 +278,7 @@ private static int getSellerID(Expo expo) { return 16886; } switch (expo) { - case PRIME: + case WEST: return 16886; case EAST: return 17792; @@ -297,7 +297,7 @@ private static int getVenueID(Expo expo) { return 13961; } switch (expo) { - case PRIME: + case WEST: return 13961; case EAST: return 16418; diff --git a/src/com/github/sunnybat/paxchecker/resources/ResourceConstants.java b/src/com/github/sunnybat/paxchecker/resources/ResourceConstants.java index 5d67b5a..3c316d1 100644 --- a/src/com/github/sunnybat/paxchecker/resources/ResourceConstants.java +++ b/src/com/github/sunnybat/paxchecker/resources/ResourceConstants.java @@ -8,7 +8,7 @@ class ResourceConstants { public static final String RESOURCE_LOCATION = getResourceLocation(); - public static final String[] DEFAULT_FILE_NAMES = {"Alarm.wav", "Alert.png", "PAXPrime.png", "PAXEast.png", "PAXSouth.png", "PAXAus.png"}; + public static final String[] DEFAULT_FILE_NAMES = {"Alarm.wav", "Alert.png", "PAXWest.png", "PAXEast.png", "PAXSouth.png", "PAXAus.png"}; private static String getResourceLocation() { String os = System.getProperty("os.name").toLowerCase(); diff --git a/src/com/github/sunnybat/paxchecker/setup/Instructions.html b/src/com/github/sunnybat/paxchecker/setup/Instructions.html index 4a39007..d3d5dea 100644 --- a/src/com/github/sunnybat/paxchecker/setup/Instructions.html +++ b/src/com/github/sunnybat/paxchecker/setup/Instructions.html @@ -7,7 +7,7 @@

Important Note

Watch the Reddit Live thread (if there is one). Make sure your friends know to text you if they find out. Do NOT miss out because you relied on only one form of notification!
- So far, the program beat the Twitter notification for PAX Prime 2014 and + So far, the program beat the Twitter notification for PAX West 2014 and PAX South 2015. The Twitter notification came out before the program found the link for PAX East 2015, which has hopefully been fixed. Still, don't rely on only one notification form! diff --git a/src/com/github/sunnybat/paxchecker/setup/Setup.java b/src/com/github/sunnybat/paxchecker/setup/Setup.java index e42965d..ccfa7a9 100644 --- a/src/com/github/sunnybat/paxchecker/setup/Setup.java +++ b/src/com/github/sunnybat/paxchecker/setup/Setup.java @@ -100,7 +100,7 @@ public interface Setup { public int timeBetweenChecks(); /** - * Gets the name of the expo to check. Values returned include Prime, South, East, Aus. These may or may not be preceded with "PAX ". + * Gets the name of the expo to check. Values returned include West, South, East, Aus. These may or may not be preceded with "PAX ". * * @return The name of the expo to check */ diff --git a/src/com/github/sunnybat/paxchecker/setup/SetupCLI.java b/src/com/github/sunnybat/paxchecker/setup/SetupCLI.java index da05f0b..616f73b 100644 --- a/src/com/github/sunnybat/paxchecker/setup/SetupCLI.java +++ b/src/com/github/sunnybat/paxchecker/setup/SetupCLI.java @@ -92,7 +92,10 @@ public void promptForSettings() { case "prime": case "paxprime": case "pax prime": - expoToCheck = "PAX Prime"; + case "west": + case "paxwest": + case "pax west": + expoToCheck = "PAX West"; break; case "east": case "paxeast": @@ -113,8 +116,8 @@ public void promptForSettings() { expoToCheck = "PAX Aus"; break; default: - System.out.println("Invalid expo (" + input + ")! Setting to Prime..."); - expoToCheck = "PAX Prime"; + System.out.println("Invalid expo (" + input + ")! Setting to West..."); + expoToCheck = "PAX West"; break; } } catch (Exception e) { diff --git a/src/com/github/sunnybat/paxchecker/setup/SetupGUI.form b/src/com/github/sunnybat/paxchecker/setup/SetupGUI.form index 7b66c68..261bc29 100644 --- a/src/com/github/sunnybat/paxchecker/setup/SetupGUI.form +++ b/src/com/github/sunnybat/paxchecker/setup/SetupGUI.form @@ -285,14 +285,14 @@ - + - + diff --git a/src/com/github/sunnybat/paxchecker/setup/SetupGUI.java b/src/com/github/sunnybat/paxchecker/setup/SetupGUI.java index d74098b..9138c0e 100644 --- a/src/com/github/sunnybat/paxchecker/setup/SetupGUI.java +++ b/src/com/github/sunnybat/paxchecker/setup/SetupGUI.java @@ -179,7 +179,8 @@ public static final int getIndexOfEvent(String eventName) { return 0; } switch (eventName.toLowerCase()) { - case "pax prime": + case "pax prime": // Keep for backwards compatibility with Preferences + case "pax west": default: return 0; case "pax east": @@ -596,9 +597,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); JCBPlayAlarm.setText("Play Alarm when Tickets Found"); - JCBPlayAlarm.setToolTipText("\nIf checked, the program will play a sound when an update to
\nthe PAX Prime website OR the Showclix website (whichever one(s)
\nyou have enabled) is found.\n"); + JCBPlayAlarm.setToolTipText("\nIf checked, the program will play a sound when
\na new link is found.\n"); - JCBExpo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "PAX Prime", "PAX East", "PAX South", "PAX Aus" })); + JCBExpo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "PAX West", "PAX East", "PAX South", "PAX Aus" })); jLabel5.setText("PAX Expo to Check");