Skip to content

Commit

Permalink
Replace PAX Prime with PAX West
Browse files Browse the repository at this point in the history
-Maintained small Prime compatibility (Preferences and such)
-Updated Play Alarm tooltip in Setup GUI
  • Loading branch information
SunnyBat committed May 19, 2016
1 parent 5596832 commit a538e45
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/com/github/sunnybat/paxchecker/Expo.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
public enum Expo {

PRIME, EAST, SOUTH, AUS;
WEST, EAST, SOUTH, AUS;

@Override
public String toString() {
Expand All @@ -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")) {
Expand Down
6 changes: 3 additions & 3 deletions src/com/github/sunnybat/paxchecker/browser/PaxsiteReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private static int getPartnerID(Expo expo) {
return 48;
}
switch (expo) {
case PRIME:
case WEST:
case EAST:
case SOUTH:
return 48;
Expand All @@ -278,7 +278,7 @@ private static int getSellerID(Expo expo) {
return 16886;
}
switch (expo) {
case PRIME:
case WEST:
return 16886;
case EAST:
return 17792;
Expand All @@ -297,7 +297,7 @@ private static int getVenueID(Expo expo) {
return 13961;
}
switch (expo) {
case PRIME:
case WEST:
return 13961;
case EAST:
return 16418;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/com/github/sunnybat/paxchecker/setup/Instructions.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1>Important Note</h1>
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!<br>
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!
Expand Down
2 changes: 1 addition & 1 deletion src/com/github/sunnybat/paxchecker/setup/Setup.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
9 changes: 6 additions & 3 deletions src/com/github/sunnybat/paxchecker/setup/SetupCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/com/github/sunnybat/paxchecker/setup/SetupGUI.form
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,14 @@
<Component class="javax.swing.JCheckBox" name="JCBPlayAlarm">
<Properties>
<Property name="text" type="java.lang.String" value="Play Alarm when Tickets Found"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;html&gt;&#xa;If checked, the program will play a sound when an update to&lt;br&gt;&#xa;the PAX Prime website OR the Showclix website (whichever one(s)&lt;br&gt;&#xa;you have enabled) is found.&#xa;&lt;/html&gt;"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;html&gt;&#xa;If checked, the program will play a sound when&lt;br&gt;&#xa;a new link is found.&#xa;&lt;/html&gt;"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="JCBExpo">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="4">
<StringItem index="0" value="PAX Prime"/>
<StringItem index="0" value="PAX West"/>
<StringItem index="1" value="PAX East"/>
<StringItem index="2" value="PAX South"/>
<StringItem index="3" value="PAX Aus"/>
Expand Down
7 changes: 4 additions & 3 deletions src/com/github/sunnybat/paxchecker/setup/SetupGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -596,9 +597,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
});

JCBPlayAlarm.setText("Play Alarm when Tickets Found");
JCBPlayAlarm.setToolTipText("<html>\nIf checked, the program will play a sound when an update to<br>\nthe PAX Prime website OR the Showclix website (whichever one(s)<br>\nyou have enabled) is found.\n</html>");
JCBPlayAlarm.setToolTipText("<html>\nIf checked, the program will play a sound when<br>\na new link is found.\n</html>");

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");

Expand Down

0 comments on commit a538e45

Please sign in to comment.