diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..8d7bea6 --- /dev/null +++ b/.classpath @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..465190b --- /dev/null +++ b/.project @@ -0,0 +1,37 @@ + + + Final + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope new file mode 100644 index 0000000..92e666d --- /dev/null +++ b/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..63864f1 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=9 +org.eclipse.jdt.core.compiler.compliance=9 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=9 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..ee81a1e --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..d970c5d --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 0000000..04cad8c --- /dev/null +++ b/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,2 @@ +disabled=06target +eclipse.preferences.version=1 diff --git a/WebContent/CSS/style.css b/WebContent/CSS/style.css new file mode 100644 index 0000000..268acac --- /dev/null +++ b/WebContent/CSS/style.css @@ -0,0 +1,508 @@ +@charset "ISO-8859-1"; + + +.wrapper { + display: grid; + grid-template-columns: repeat(16, [col-start] 1fr); + grid-gap: 10px; +} +.wrapper > * { + grid-column: col-start / span 16; +} +.main-nav { + background: #f1f1f1; + -webkit-box-shadow: 0 10px 5px #888888; + -moz-box-shadow: 0 10px 5px #888888; + box-shadow: 0 10px 5px #888888; +} +.main-footer { + background: #ff8306; + } + +.main-head { + background: #ff8306; +} + +.cn { + display: flex; + justify-content: center; + align-items: center; + height:100%; +} + +@media (min-width: 500px) { + + .side { + grid-column: col-start / span 3; + grid-row: 3; + } + .ad { + grid-column: col-start / span 3; + grid-row: 4; + } + .content, .main-footer { + grid-column: col-start 4 / span 9; + } + nav ul { + display: flex; + justify-content: space-between; + } +} + +@media (min-width: 700px) { + +.main-head { + grid-column: col-start / span 16; + grid-row: 1; + } +.main-nav { + grid-column: col-start / span 2; + grid-row: 2 / 4; + } + +.graph { + grid-column: col-start 1 / span 16; + grid-row: 2; + } + +.team { + grid-column: col-start 1 / span 3; + grid-row: 2; + + } + .side { + grid-column: col-start 15 / span 2; + grid-row: 2; + } + .ad { + grid-column: col-start 15 / span 2; + grid-row: 3; + } + .main-footer { + grid-column: col-start / span 16; + } + nav ul { + flex-direction: column; + } + + .listing { + list-style: none; + display: grid; + grid-gap: 10px; + grid-auto-flow: dense; + grid-template-columns: repeat(auto-fill,minmax(350px, 1fr)); + padding:10px; + padding-top:0px; + margin:0px; +} + .listing li { + border: 1px solid #ffe066; + border-radius: 5px; + display: flex; + flex-direction: column; + background:#ffffff; + } + .listing .wide { + grid-column-end: span 2; + } + .listing .superwide { + grid-column-end: span 3; + } + +.listingTeam { + list-style: none; + display: grid; + grid-gap: 10px; + grid-auto-flow: dense; + grid-template-columns: repeat(auto-fill,minmax(500px, 600px)); + padding:10px; + padding-top:0px; + margin:0px; + flex-direction: row; +} + .listingTeam li { + border: 1px solid #ffe066; + border-radius: 5px; + display: flex; + flex-direction: column; + background:#ffffff; + } + .listingTeam .wide { + grid-column-end: span 2; + } + +} + + + + +body { + background: #ff8306; + color: #444; + font: 100%/20px 'Helvetica Neue', helvetica, arial, sans-serif; + text-shadow: 0 1px 0 #974b00; + -moz-user-select: -moz-none; + -webkit-user-select: none; + -khtml-user-select: none; + -o-user-select: none; + user-select: none; +} +.cadre +{ + background: #000051; + border: 5px solid #fff; + display: inline-block; + max-width: 100%; + padding-bottom: 10px; +} + +.HeaderDiv +{ + background: linear-gradient(#777, #444); + color: #fff; + text-shadow: 0 1px 0 #000; + font-size: 12px ; + font-weight: bold; +} + +.tableTrade { + background: #000051; + border-collapse: collapse; + font-size: 9px; + text-shadow: 0 1px 0 #ffffff; + line-height: 12px; + -ms-user-select:none; + width:100%; + +} + +.tableTrade > thead > tr > th +{ + border-right: 1px solid #fff; + border-left: 1px solid #e8e8e8; + font-weight: bold; + padding: 2px 1px; + position: relative; + text-shadow: 0 1px 0 #000; + font-size: 9px ; + + -ms-user-select:none; +} + +.tableTrade > thead > tr > th:first-child +{ + border-left: 0px solid ; +} +.tableTrade > thead > tr > th:last-child +{ + border-right: 0px solid ; +} + + + + +.tableTrade > thead > tr.Header > th +{ + background: linear-gradient(#777, #444); + color: #fff; + text-align:center; +} + +.tableTrade > thead > tr.Header > th.focus { + background: linear-gradient(#959595, #d4d4d4); + cursor: pointer; +} + +.tableTrade > tbody > tr.ligneHead > th +{ + padding: 2px 3px; + border-right: 1px solid #fff; + border-left: 1px solid #e8e8e8; + background: linear-gradient(#c0c0c0, #efefef); + color: #2b2b2b; + text-align:center; +} +.tableTrade > tbody > tr.ligneHead > th:first-child +{ + border-left: 0px solid ; +} +.tableTrade > tbody > tr.ligneHead > th:last-child +{ + border-right: 0px solid ; +} + +.tableTrade > tbody > tr > th.positive +{ + background: linear-gradient(#91ff91, #d5ffd5); + color: #004000; +} +.tableTrade > tbody > tr > th.negative +{ + background: linear-gradient(#ff8c8c, #ffd5d5); + color: #710000; +} +.tableTrade > tbody > tr > th.neutral +{ + background: linear-gradient(#ffdab5, #ffeedd); + color: #ff8306; +} +.tableTrade > tbody > tr.tab:nth-child(odd) > td.positive +{ + background: linear-gradient(#91ff91, #d5ffd5); + color: #004000; +} +.tableTrade > tbody > tr.tab:nth-child(odd) > td.negative +{ + background: linear-gradient(#ff8c8c, #ffd5d5); + color: #710000; +} +.tableTrade > tbody > tr.tab:nth-child(odd) > td.neutral +{ + background: linear-gradient(#ffdab5, #ffeedd); + color: #ff8306; +} +.tableTrade > tbody > tr.tab:nth-child(even) > td.positive +{ + background: linear-gradient(#91ff91, #d5ffd5); + color: #004000; +} +.tableTrade > tbody > tr.tab:nth-child(even) > td.negative +{ + background: linear-gradient(#ff8c8c, #ffd5d5); + color: #710000; +} +.tableTrade > tbody > tr.tab:nth-child(even) > td.neutral +{ + background: linear-gradient(#ffdab5, #ffeedd); + color: #ff8306; +} + +.tableTrade > tbody > tr.tab > td:hover { + background: linear-gradient(#c9c9c9, #eeeeee); + transition: all 300ms; +} + +.tableTrade > tbody > tr > td +{ + font-size: 9px ; + border-right: 1px solid #fff; + border-left: 1px solid #e8e8e8; + padding: 2px 1px; + position: relative; + transition: all 300ms; + text-align:center; + -ms-user-select:none; +} +.tableTrade > tbody > tr > td:first-child +{ + border-left: 0px solid ; +} +.tableTrade > tbody > tr > td:last-child +{ + border-right: 0px solid ; +} + +.tableTrade > tbody > tr.freeAgentInjured > td { + background: linear-gradient(#c0c0c0, #e6e6e6); +} + +.tableTrade > tbody > tr.tab:nth-child(odd) > td +{ + background: linear-gradient(#f3f3f3, #fafafa); + color: #2b2b2b; +} +.tableTrade > tbody > tr.tab:nth-child(even) > td +{ + background: linear-gradient(#f3f3f3, #ffffff); + color: #2b2b2b; +} + +.tableTrade > tbody > tr.tab:hover > td +{ + background: #8cffff; + cursor: pointer; +} + + +.tableTrade > tbody > tr:nth-child(odd).displayed > td +{ + background: linear-gradient(#26bf73, #7ae4af); +} +.tableTrade > tbody > tr:nth-child(even).displayed > td +{ + background: linear-gradient(#48db92, #a5edc9); +} +.tableTrade > tbody > tr:nth-child(odd).selected > td +{ + background-color: #9FAFD1; +} +.tableTrade > tbody > tr:nth-child(even).selected > td +{ + background-color: #B0BED9; +} + + +.tableTrade > tbody > tr.tab:nth-child(odd) > td +{ + background: linear-gradient(#f3f3f3, #fafafa); + color: #2b2b2b; +} +.tableTrade > tbody > tr.tab:nth-child(even) > td +{ + background: linear-gradient(#f3f3f3, #ffffff); + color: #2b2b2b; +} + + + + + +.tableTrade > tbody > tr.hidden +{ + display: none; +} + + + + + + +strong { + font-weight: bold; +} + +em { + font-style: italic; +} + + + +.asc:after {content: "\25B2"; } +.desc:after {content: "\25BC"; } + +.focus { + background-color: #ff00ff; + color: #fff; + cursor: pointer; + font-weight: bold; +} +.selected { + background-color: #ff00ff; + color: #fff; + font-weight: bold; +} + + +#myInput { + background-image: url('../PICS/searchicon.png'); /* Add a search icon to input */ + background-position: 5px 6px; /* Position the search icon */ + background-repeat: no-repeat; /* Do not repeat the icon image */ + width: 100%; /* Full-width */ + font-size: 14px; /* Increase font-size */ + padding: 6px 10px 6px 40px; /* Add some padding */ + border: 1px solid #ddd; /* Add a grey border */ + margin-bottom: 6px; /* Add some space below the input */ + margin-top: 6px; /* Add some space below the input */ +} + +.positive +{ + background: linear-gradient(#91ff91, #d5ffd5); + color: #004000; + +} +.negative +{ + background: linear-gradient(#ff8c8c, #ffd5d5); + color: #710000; +} +.neutral +{ + background: linear-gradient(#ff9d3c, #ffc78e); + color: #ff8040; +} + +#everything-wrapper { + display : none; +} + + +span { + display: block; + margin: 0 auto; +} + +span[class*="l-"] { + height: 4px; width: 4px; + background: #000; + display: inline-block; + margin: 12px 2px; + + border-radius: 100%; + -webkit-border-radius: 100%; + -moz-border-radius: 100%; + + -webkit-animation: loader 4s infinite; + -webkit-animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415); + -webkit-animation-fill-mode: both; + -moz-animation: loader 4s infinite; + -moz-animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415); + -moz-animation-fill-mode: both; + -ms-animation: loader 4s infinite; + -ms-animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415); + -ms-animation-fill-mode: both; + animation: loader 4s infinite; + animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415); + animation-fill-mode: both; +} + +span.l-1 {-webkit-animation-delay: 1s;animation-delay: 1s;-ms-animation-delay: 1s;-moz-animation-delay: 1s;} +span.l-2 {-webkit-animation-delay: 0.8s;animation-delay: 0.8s;-ms-animation-delay: 0.8s;-moz-animation-delay: 0.8s;} +span.l-3 {-webkit-animation-delay: 0.6s;animation-delay: 0.6s;-ms-animation-delay: 0.6s;-moz-animation-delay: 0.6s;} +span.l-4 {-webkit-animation-delay: 0.4s;animation-delay: 0.4s;-ms-animation-delay: 0.4s;-moz-animation-delay: 0.4s;} +span.l-5 {-webkit-animation-delay: 0.2s;animation-delay: 0.2s;-ms-animation-delay: 0.2s;-moz-animation-delay: 0.2s;} +span.l-6 {-webkit-animation-delay: 0;animation-delay: 0;-ms-animation-delay: 0;-moz-animation-delay: 0;} + +@-webkit-keyframes loader { + 0% {-webkit-transform: translateX(-30px); opacity: 0;} + 25% {opacity: 1;} + 50% {-webkit-transform: translateX(30px); opacity: 0;} + 100% {opacity: 0;} +} + +@-moz-keyframes loader { + 0% {-moz-transform: translateX(-30px); opacity: 0;} + 25% {opacity: 1;} + 50% {-moz-transform: translateX(30px); opacity: 0;} + 100% {opacity: 0;} +} + +@-keyframes loader { + 0% {-transform: translateX(-30px); opacity: 0;} + 25% {opacity: 1;} + 50% {-transform: translateX(30px); opacity: 0;} + 100% {opacity: 0;} +} + +@-ms-keyframes loader { + 0% {-ms-transform: translateX(-30px); opacity: 0;} + 25% {opacity: 1;} + 50% {-ms-transform: translateX(30px); opacity: 0;} + 100% {opacity: 0;} + + +} + + +dfs{ + color: #f0f0f0; +} + +select { + font-size:16px; + cursor: pointer; + background: linear-gradient(#ffe6cc, #ffffff); + width :100%; +} + + diff --git a/WebContent/DIV_FA.jsp b/WebContent/DIV_FA.jsp new file mode 100644 index 0000000..f46dfa6 --- /dev/null +++ b/WebContent/DIV_FA.jsp @@ -0,0 +1,273 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +team +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Actual Projection
Proj with FA
Difference
+ + + + + + + diff --git a/WebContent/DIV_graph.jsp b/WebContent/DIV_graph.jsp new file mode 100644 index 0000000..befadb2 --- /dev/null +++ b/WebContent/DIV_graph.jsp @@ -0,0 +1,97 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +GRAPH +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + +
+ + + + + diff --git a/WebContent/DIV_maxPace.jsp b/WebContent/DIV_maxPace.jsp new file mode 100644 index 0000000..ed2984e --- /dev/null +++ b/WebContent/DIV_maxPace.jsp @@ -0,0 +1,92 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +MaxPace +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SlotPlayedPace
+ + + + + + + diff --git a/WebContent/DIV_team.jsp b/WebContent/DIV_team.jsp new file mode 100644 index 0000000..2ead444 --- /dev/null +++ b/WebContent/DIV_team.jsp @@ -0,0 +1,182 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +League Teams +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/WebContent/DIV_trade.jsp b/WebContent/DIV_trade.jsp new file mode 100644 index 0000000..87cdb11 --- /dev/null +++ b/WebContent/DIV_trade.jsp @@ -0,0 +1,407 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +team +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + +<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
T1 tradeT1 tradeACTUAL PROJECTION
DIFFERENCES
RK DPT DTOT RDTOT PDRK DPT D
+
+ + + + diff --git a/WebContent/META-INF/MANIFEST.MF b/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/WebContent/META-INF/maven/FantasyManager/FantasyManager/pom.properties b/WebContent/META-INF/maven/FantasyManager/FantasyManager/pom.properties new file mode 100644 index 0000000..f21c394 --- /dev/null +++ b/WebContent/META-INF/maven/FantasyManager/FantasyManager/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Mon Oct 22 16:28:29 CEST 2018 +m2e.projectLocation=C\:\\Users\\lejay\\eclipse-workspace\\sd.zip_expanded\\FantasyManager +m2e.projectName=FantasyManager +groupId=FantasyManager +artifactId=FantasyManager +version=0.0.1-SNAPSHOT diff --git a/WebContent/META-INF/maven/FantasyManager/FantasyManager/pom.xml b/WebContent/META-INF/maven/FantasyManager/FantasyManager/pom.xml new file mode 100644 index 0000000..37f789a --- /dev/null +++ b/WebContent/META-INF/maven/FantasyManager/FantasyManager/pom.xml @@ -0,0 +1,81 @@ + + 4.0.0 + FantasyManager + FantasyManager + 0.0.1-SNAPSHOT + + src + + + maven-compiler-plugin + 3.7.0 + + 1.8 + 1.8 + + + + maven-war-plugin + 3.0.0 + + WebContent + + + + + + + com.google.visualization + visualization-datasource + 1.1.1 + + + com.fasterxml.jackson.core + jackson-core + 2.9.2 + + + com.fasterxml.jackson.core + jackson-annotations + 2.9.2 + + + + com.fasterxml.jackson.core + jackson-databind + 2.9.2 + + + org.jsoup + jsoup + 1.9.1 + + + + + com.google.code.gson + gson + 2.3.1 + + + + mysql + mysql-connector-java + 5.1.39 + + + io.webfolder + ui4j-webkit + 3.1.0 + + + + org.seleniumhq.selenium + selenium-firefox-driver + 3.13.0 + + + + + war + \ No newline at end of file diff --git a/WebContent/PAGE_league.jsp b/WebContent/PAGE_league.jsp new file mode 100644 index 0000000..1a78d8d --- /dev/null +++ b/WebContent/PAGE_league.jsp @@ -0,0 +1,419 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +Insert title here +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
    + +
  • +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
  • + +
  • + + + + + + + + + + + + + + + + + + <%-- + + + + + + --%> + + + + + + <%-- + + --%> + + + + + + + + + + + + + + +
    ESPN RANKINGRELATIVEPROJECTION
    TEAMGPESPN PTSE-RKREL PTSR-RKPROJ PTSP-RK
    +
  • + +
  • + +
    +
    +
    +
    + Buildind RK Graph + + + + + + +
    +
    +
    +
  • + + + +
  • +
    + +
    + +
    +
    + + + + + + + +
    +
    +
    +
  • +
    +
    + +
  • + +
    +
    +
    +
    + Calculating Max & Pace + + + + + + +
    +
    +
    + +
  • + +
+
+ +
+ + + + + + + \ No newline at end of file diff --git a/WebContent/PAGE_team.jsp b/WebContent/PAGE_team.jsp new file mode 100644 index 0000000..059333f --- /dev/null +++ b/WebContent/PAGE_team.jsp @@ -0,0 +1,566 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +team +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + + + + + + + + + + + + +

Find Free Agents

+ + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Actual Projection
Proj with FA
Difference
+ +
+
+ + + + + + diff --git a/WebContent/PAGE_trade.jsp b/WebContent/PAGE_trade.jsp new file mode 100644 index 0000000..c5db199 --- /dev/null +++ b/WebContent/PAGE_trade.jsp @@ -0,0 +1,185 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +trade +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + + + + + + +
+
+ +
+
+ +
+ +
+
+ + + +
+
    +
  • + +
    +
  • + +
  • + +
    +
  • + + +
+
+
The footer
+
+ + + + + + + diff --git a/WebContent/PICS/Fantasy-Basketball-badge.png b/WebContent/PICS/Fantasy-Basketball-badge.png new file mode 100644 index 0000000..2af1aa6 Binary files /dev/null and b/WebContent/PICS/Fantasy-Basketball-badge.png differ diff --git a/WebContent/PICS/Thumbs.db b/WebContent/PICS/Thumbs.db new file mode 100644 index 0000000..6d30321 Binary files /dev/null and b/WebContent/PICS/Thumbs.db differ diff --git a/WebContent/PICS/arr.png b/WebContent/PICS/arr.png new file mode 100644 index 0000000..7ebb1fb Binary files /dev/null and b/WebContent/PICS/arr.png differ diff --git a/WebContent/PICS/searchicon.png b/WebContent/PICS/searchicon.png new file mode 100644 index 0000000..714bec5 Binary files /dev/null and b/WebContent/PICS/searchicon.png differ diff --git a/WebContent/WEB-INF/lib/jquery.rowselector.min.js b/WebContent/WEB-INF/lib/jquery.rowselector.min.js new file mode 100644 index 0000000..2cdb176 --- /dev/null +++ b/WebContent/WEB-INF/lib/jquery.rowselector.min.js @@ -0,0 +1 @@ +!function(s){"use strict";s.fn.selectedrows=function(){var t,e=s(this[0]);if("TABLE"===e.prop("tagName").toUpperCase()&&void 0!==e.attr("data-rs-selectable")){var a=e.attr("data-rs-class")||"selected";t=s(e).find("tbody tr."+a)}return t}}(jQuery),$(document).ready(function(){"use strict";var s={};$("body").on("mouseover","table[data-rs-selectable]",function(){$(this).addClass("unselectable").attr("unselectable","on")}),$("body").on("click","table[data-rs-selectable] tr",function(t){var e=$(this),a=e.closest("table"),r=a.attr("data-rs-type")||"many",l=a.attr("data-rs-class")||"selected";if("none"!==r)if("one"===r)$(this).siblings().removeClass(l).end().addClass(l);else if($(this).toggleClass(l),t.shiftKey){var i=s[a.id]||!1;if(i&&this!==i&&$(this).hasClass(l)===$(i).hasClass(l))for(var n=this.rowIndex>i.rowIndex?i:this,d=this.rowIndex>i.rowIndex?this:i,o=$(this).hasClass(l),c=$(n).nextAll("tr"),h=0,f=c.length;f>h&&c[h]!==d;h+=1)o?$(c[h]).addClass(l):$(c[h]).removeClass(l)}s[a.id]=this,$(a).trigger("clicked.rs.row")})}); \ No newline at end of file diff --git a/WebContent/WEB-INF/lib/jstl-1.2.jar b/WebContent/WEB-INF/lib/jstl-1.2.jar new file mode 100644 index 0000000..0fd275e Binary files /dev/null and b/WebContent/WEB-INF/lib/jstl-1.2.jar differ diff --git a/WebContent/WEB-INF/lib/mysql-connector-java-5.0.8-bin.jar b/WebContent/WEB-INF/lib/mysql-connector-java-5.0.8-bin.jar new file mode 100644 index 0000000..0170c3e Binary files /dev/null and b/WebContent/WEB-INF/lib/mysql-connector-java-5.0.8-bin.jar differ diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml new file mode 100644 index 0000000..1848c7f --- /dev/null +++ b/WebContent/WEB-INF/web.xml @@ -0,0 +1,25 @@ + + + FantasyManager + + + index.jspindex.htmlindex.htm + + default.html + default.htm + default.jsp + + + + FreeAgent + FreeAgent + test.serv.Team + + + FreeAgent + /FreeAgent + + + + + \ No newline at end of file diff --git a/WebContent/index.jsp b/WebContent/index.jsp new file mode 100644 index 0000000..e041c6c --- /dev/null +++ b/WebContent/index.jsp @@ -0,0 +1,57 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + + + + + + +league + + + + + +

Choose League

+ +
+ +
+ +
+ Year :
+
+ League ID :
+
+
+
+
+
+ NBA Fantasy + +
+ + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..bc9f831 --- /dev/null +++ b/pom.xml @@ -0,0 +1,108 @@ + + 4.0.0 + Final + Final + 0.0.1-SNAPSHOT + war + + src + + + maven-compiler-plugin + 3.7.0 + + 9 + + + + maven-war-plugin + 3.0.0 + + WebContent + + + + + + + + com.google.visualization + visualization-datasource + 1.1.1 + + + com.fasterxml.jackson.core + jackson-core + 2.9.2 + + + + com.fasterxml.jackson.core + jackson-annotations + 2.9.2 + + + + com.fasterxml.jackson.core + jackson-databind + 2.9.2 + + + org.jsoup + jsoup + 1.9.1 + + + + + com.google.code.gson + gson + 2.8.1 + + + + mysql + mysql-connector-java + 6.0.6 + + + io.webfolder + ui4j-webkit + 3.1.0 + + + + org.seleniumhq.selenium + selenium-server + 3.4.0 + + + + org.seleniumhq.selenium + selenium-firefox-driver + 3.4.0 + + + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + + + com.google.guava + guava + 21.0 + + + + com.codeborne + phantomjsdriver + 1.4.1 + + + + + + \ No newline at end of file diff --git a/src/call_content/CALL_Rebuild.java b/src/call_content/CALL_Rebuild.java new file mode 100644 index 0000000..50d71f7 --- /dev/null +++ b/src/call_content/CALL_Rebuild.java @@ -0,0 +1,64 @@ +package call_content; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.visualization.datasource.datatable.DataTable; +import com.google.visualization.datasource.render.JsonRenderer; + +import functions.GRAPH_rebuild; +import jsoupImport.ImportLineups; + + +/** + * Servlet implementation class FreeAgent + */ +@WebServlet("/CALL_Rebuild" ) +public class CALL_Rebuild extends HttpServlet { + private static final long serialVersionUID = 1L; + public static float maxVal=0; + public static float lowVal=100; + public static DataTable data; + /** + * @see HttpServlet#HttpServlet() + */ + public CALL_Rebuild() { + super(); + // TODO Auto-generated constructor stub + } + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + //appelé lors du clic test fa + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + try { + + new ImportLineups(); + new GRAPH_rebuild(); + + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + +} diff --git a/src/call_content/GRAPH_CALL.java b/src/call_content/GRAPH_CALL.java new file mode 100644 index 0000000..76d822e --- /dev/null +++ b/src/call_content/GRAPH_CALL.java @@ -0,0 +1,132 @@ +package call_content; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.visualization.datasource.datatable.DataTable; +import com.google.visualization.datasource.render.JsonRenderer; + +import functions.GRAPH_init; + + +/** + * Servlet implementation class FreeAgent + */ +@WebServlet("/GRAPH_CALL" ) +public class GRAPH_CALL extends HttpServlet { + private static final long serialVersionUID = 1L; + public static float maxVal=0; + public static float lowVal=100; + public static DataTable data; + /** + * @see HttpServlet#HttpServlet() + */ + public GRAPH_CALL() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + PrintWriter out = response.getWriter(); + + JsonNode root = null; + String json = JsonRenderer.renderDataTable(data, true, false).toString(); + + try{ + com.fasterxml.jackson.core.JsonParser parser = new JsonFactory().createJsonParser(json); + root = new ObjectMapper().readTree(parser); + }catch(Exception e){ + e.printStackTrace(); + } + + response.setContentType("application/json"); + + out.println(root.toString()); + + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + //appelé lors du clic test fa + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + + PrintWriter out = response.getWriter(); + + int width = 0; + int height = 0; + String title =""; + String divGraph =""; + String legPos =""; + int heightPour = 0; + int widthPour = 0 ; + int left = 0; + int top = 0; + int direc; + String typeGraph = request.getParameter("typeGraph"); + + data = new GRAPH_init().data(typeGraph); + + + if(typeGraph.equals("mainGraph")) { + width = 710; + height = 295; + title = ""; + left = 50 ; + top = 10; + divGraph = "chart_div"; + legPos = "right"; + heightPour = 90; + widthPour = 70; + direc = 1; + }else { + width = 350; + height = 200; + title = ""; + left = 35 ; + top = 10; + divGraph = typeGraph; + legPos = "none"; + heightPour = 90; + widthPour = 90; + if(typeGraph.equals("TO")) { + direc = -1; + }else { + direc = 1; + } + } + + request.setAttribute("divGraph", divGraph); + request.setAttribute("maxVal", maxVal); + request.setAttribute("lowVal", lowVal); + request.setAttribute("width", width); + request.setAttribute("height", height); + request.setAttribute("title", title); + request.setAttribute("left", left); + request.setAttribute("top", top); + request.setAttribute("legPos", legPos); + request.setAttribute("direc", direc); + request.setAttribute("heightPour", heightPour); + request.setAttribute("widthPour", widthPour); + + RequestDispatcher rd = getServletContext().getRequestDispatcher("/DIV_graph.jsp"); + rd.forward(request, response); + + } + +} diff --git a/src/call_divs/CALL_DIV_maxPace.java b/src/call_divs/CALL_DIV_maxPace.java new file mode 100644 index 0000000..02efbda --- /dev/null +++ b/src/call_divs/CALL_DIV_maxPace.java @@ -0,0 +1,63 @@ +package call_divs; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import call_pages.CALL_Fantasy; +import objects.Player; +import objects.Slot; +import objects.Teams; + +/** + * Servlet implementation class FreeAgent + */ +@WebServlet("/CALL_DIV_maxPace" ) +public class CALL_DIV_maxPace extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public CALL_DIV_maxPace() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + + + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + //appelé lors du clic test fa + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + + response.getWriter().append("Served at: ").append(request.getContextPath()); + response.setContentType("text/html"); + + request.setAttribute("slotList", CALL_Fantasy.l1.leagueTeams.get(0).slots); + request.setAttribute("teamList", CALL_Fantasy.l1.leagueTeams); + + RequestDispatcher rd = getServletContext().getRequestDispatcher("/DIV_maxPace.jsp"); + rd.forward(request, response); + + } + +} diff --git a/src/call_divs/CALL_DIV_team.java b/src/call_divs/CALL_DIV_team.java new file mode 100644 index 0000000..306a7bd --- /dev/null +++ b/src/call_divs/CALL_DIV_team.java @@ -0,0 +1,95 @@ +package call_divs; + +import java.io.IOException; +import java.util.ArrayList; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import call_pages.CALL_Fantasy; +import objects.Player; + +/** + * Servlet implementation class FreeAgent + */ +@WebServlet("/CALL_DIV_team" ) +public class CALL_DIV_team extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public CALL_DIV_team() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + response.getWriter().append("Served at: ").append(request.getContextPath()); + + response.setContentType("text/html"); + + String team = request.getParameter("selectedT"); + int chosenT = Integer.parseInt(team); + String otherT = request.getParameter("otherT"); + int chosenO = Integer.parseInt(otherT); + + + ArrayList playersChosenT = CALL_Fantasy.l1.leagueTeams.get(chosenT).players; + ArrayList playersOtherT = CALL_Fantasy.l1.leagueTeams.get(chosenO).players; + + + //supprime les éventuels autre joueurs ajouté + for (int x = 0; x < playersChosenT.size();x++) { + playersChosenT.get(x).inTrade = false; + if(playersChosenT.get(x).teamID != chosenT) { + System.out.println("remove " + playersChosenT.get(x).getnom() + " from " + CALL_Fantasy.l1.leagueTeams.get(chosenT).getName()); + playersChosenT.remove(x); + x-=1; + } + } + for (int x = 0; x < playersOtherT.size();x++) { + if(playersOtherT.get(x).teamID != chosenT && playersOtherT.get(x).teamID != chosenO) { + System.out.println("remove " + playersOtherT.get(x).getnom() + " from " + CALL_Fantasy.l1.leagueTeams.get(chosenO).getName()); + playersOtherT.remove(x); + x-=1; + } + } + + //ajoute les joueurs de l autre équipe + for (int x = 0; x < playersOtherT.size();x++) { + if(playersOtherT.get(x).teamID != chosenT && !playersOtherT.get(x).inTrade) { + playersChosenT.add(playersOtherT.get(x)); + System.out.println("add " + playersOtherT.get(x).getnom() + " in " + CALL_Fantasy.l1.leagueTeams.get(chosenT).getName()); + } + } + + request.setAttribute("teamID", chosenT); + request.setAttribute("team2ID", chosenO); + request.setAttribute("Tplayers", playersChosenT); + request.setAttribute("tableName", request.getParameter("tableName")); + request.setAttribute("otherTableName", request.getParameter("otherTableName")); + + RequestDispatcher rd = getServletContext().getRequestDispatcher("/DIV_team.jsp"); + rd.forward(request, response); + + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + //appelé lors du clic test fa + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + + } + +} diff --git a/src/call_divs/CALL_DIV_trade.java b/src/call_divs/CALL_DIV_trade.java new file mode 100644 index 0000000..ec3e494 --- /dev/null +++ b/src/call_divs/CALL_DIV_trade.java @@ -0,0 +1,141 @@ +package call_divs; + +import java.io.IOException; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import call_pages.CALL_Fantasy; +import functions.FA_testPlayer; +import functions.TRADE_test; +import jsoupImport.ImportPlayerStats; +import jsoupImport.ImportPlayers; +import objects.Player; +import objects.Stat; +import objects.Teams; + +/** + * Servlet implementation class FreeAgent + */ +@WebServlet("/DIV_trade" ) +public class CALL_DIV_trade extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public CALL_DIV_trade() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + response.getWriter().append("Served at: ").append(request.getContextPath()); + final DecimalFormat f = new DecimalFormat("0.#"); + final DecimalFormat in = new DecimalFormat("0.##"); + + //récupère les ID des équipes + int T1 = Integer.parseInt(request.getParameter("team1")); + int T2 = Integer.parseInt(request.getParameter("team2")); + Teams team1 = CALL_Fantasy.l1.leagueTeams.get(T1); + Teams team2 = CALL_Fantasy.l1.leagueTeams.get(T2); + + //recupere les listes de joueurs tradé + String stringSelT1 = request.getParameter("selTeam1"); + String stringSelT2 = request.getParameter("selTeam2"); + List listP1 = + Stream.of(stringSelT1.split(",")) + .collect(Collectors.toList()); + List listP2 = + Stream.of(stringSelT2.split(",")) + .collect(Collectors.toList()); + + //définit les joueurs comme InTrade + for (int x=0 ;x otherTstats = new ArrayList(); + for (Teams teamX : CALL_Fantasy.l1.leagueTeams) { + if(teamX.getName()!=team1.getName() && teamX.getName()!=team2.getName()) { + otherTstats.add(f.format(teamX.getProjTot())); + } + } + request.setAttribute("otherTeamStats", otherTstats); + + RequestDispatcher rd = getServletContext().getRequestDispatcher("/DIV_trade.jsp"); + rd.forward(request, response); + + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + //appelé lors du clic test fa + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + + } + + + + +} diff --git a/src/call_pages/CALL_Fantasy.java b/src/call_pages/CALL_Fantasy.java new file mode 100644 index 0000000..ca47c27 --- /dev/null +++ b/src/call_pages/CALL_Fantasy.java @@ -0,0 +1,145 @@ +package call_pages; + +import java.io.*; +import java.io.PrintWriter; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.firefox.FirefoxProfile; +import org.openqa.selenium.phantomjs.PhantomJSDriver; +import org.openqa.selenium.phantomjs.PhantomJSDriverService; +import org.openqa.selenium.remote.DesiredCapabilities; +import org.openqa.selenium.support.ui.WebDriverWait; + +import com.google.gson.Gson; + +import functions.GRAPH_init; +import functions.GRAPH_rebuild; +import functions.MySQLAccess; +import functions.PROJ_analysis; +import jsoupImport.ImportPlayers; +import jsoupImport.ImportTeams; +import jsoupImport.ImportVars; +import objects.League; + +import objects.Teams; + +import java.util.ArrayList; +import java.util.Collections; + +import call_pages.CALL_Fantasy; + +/** + * Servlet implementation class stat + */ +@WebServlet("/fantasyServlet") +public class CALL_Fantasy extends HttpServlet { + + private static final long serialVersionUID = 1L; + public static ArrayList leagueTeams; + public static League l1; + public static MySQLAccess dao = new MySQLAccess(); + public static WebDriver driver; + public static WebDriverWait wait; + + /** + * @see HttpServlet#HttpServlet() + */ + public CALL_Fantasy() { + super(); + // TODO Auto-generated constructor stub + } + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + //appelé depuis la page league jsp pour récup les infos du graph + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + //lancé sur clic btn choose league + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + HttpSession session = request.getSession(); + + String year = request.getParameter("year"); + String league = request.getParameter("league"); + + if(l1 == null) { + leagueTeams = new ArrayList(); + l1 = new League("",league,year); // TODO: set year + try { + + System.setProperty("webdriver.gecko.driver", "geckodriver.exe"); + + /*DesiredCapabilities DesireCaps = new DesiredCapabilities(); + DesireCaps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "phantomjs.exe"); + WebDriver driver = new PhantomJSDriver(DesireCaps);*/ + FirefoxProfile fProfile = new FirefoxProfile(); + + fProfile.setPreference("permissions.default.image", 2 ); + + driver = new FirefoxDriver(fProfile); + + wait = new WebDriverWait(driver, 20); + + dao.testIfExist(); + + + new ImportTeams();// fait importlinup et graph rebuild + + + //classe par rank relatif avant display et apres calculf fait dans graph rebuild pour le moment + for (int z = 0; z < CALL_Fantasy.l1.nbTeams; z++) { + CALL_Fantasy.l1.leagueTeams.get(z).setValToRank((float)CALL_Fantasy.l1.leagueTeams.get(z).getTotalrotPtsRel()); + } + Collections.sort(CALL_Fantasy.l1.leagueTeams); + Collections.reverse(CALL_Fantasy.l1.leagueTeams); + + + //importe les joueurs des équipes pour projection + new ImportPlayers(); + PROJ_analysis.calculate(); //need import players + for(Teams teamX : CALL_Fantasy.l1.leagueTeams) { + teamX.setProjRKX(teamX.getProjRK()); + teamX.setProjTotX(teamX.getProjTot()); + } + + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + RequestDispatcher rd = getServletContext().getRequestDispatcher("/index.jsp"); + rd.forward(request, response); + } + } + + String statsJson = new Gson().toJson(CALL_Fantasy.l1.loadStatBaseTeam); + request.setAttribute("statsJson", statsJson); + request.setAttribute("statsBase", CALL_Fantasy.l1.loadStatBaseTeam); + + session.setAttribute("teamList", CALL_Fantasy.l1.leagueTeams); + request.setAttribute("leagueName", CALL_Fantasy.l1.getName()); + request.setAttribute("season", CALL_Fantasy.l1.getSeason()); + request.setAttribute("day", CALL_Fantasy.l1.nbDaysPlayed); + request.setAttribute("totDays", CALL_Fantasy.l1.getNbTotalDays()); + + RequestDispatcher rd = getServletContext().getRequestDispatcher("/PAGE_league.jsp"); + rd.forward(request, response); + + } +} + + + + diff --git a/src/call_pages/CALL_Team.java b/src/call_pages/CALL_Team.java new file mode 100644 index 0000000..cfdc498 --- /dev/null +++ b/src/call_pages/CALL_Team.java @@ -0,0 +1,185 @@ +package call_pages; + +import java.io.*; +import java.io.PrintWriter; +import java.text.DecimalFormat; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.google.gson.Gson; + +import call_pages.CALL_Fantasy; +import functions.FA_testPlayer; +import functions.PROJ_analysis; +import functions.RANKS_fill; + +import jsoupImport.ImportLineups; +import jsoupImport.ImportPlayerStats; +import jsoupImport.ImportPlayers; +import jsoupImport.ImportTeams; +import objects.League; +import objects.Player; +import objects.Stat; +import objects.Teams; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + + +/** + * Servlet implementation class stat + */ +@WebServlet("/teamServlet") +public class CALL_Team extends HttpServlet { + + /** + * @see HttpServlet#HttpServlet() + */ + public CALL_Team() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + //appelé lors du choix d une équipe + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + + String team = request.getParameter("teamId"); + int chosenT = Integer.parseInt(team); + final DecimalFormat f = new DecimalFormat("0.#"); + final DecimalFormat in = new DecimalFormat("0.##"); + + Teams team1 = CALL_Fantasy.l1.leagueTeams.get(0);; + for (int x=0;x PROJ_analysis : needed for fillPlayerRKinTeam + ArrayList players = team1.players; + + if(action != null) { + bestPlayer = team1.players.get(Integer.parseInt(playerId)); + }else { + //-----------remove players if added in trade panel------------------------ + for (int x=0;x maxPoint) { + bestPlayer = playerx; + maxPoint = playerx.getPotPoint(); + } + } + } + + FA_testPlayer.mainFA.clear(); + + FA_testPlayer.testPlayer(CALL_Fantasy.l1.leagueTeams.get(chosenT),bestPlayer); + //-----------calcule la nouvelle projection + PROJ_analysis.calculate(); + + Collections.sort(FA_testPlayer.mainFA, new ListOfStatComparator()); + Collections.reverse(FA_testPlayer.mainFA); + + request.setAttribute("team1", team1); + request.setAttribute("team1Stats", team1.stats); + request.setAttribute("nbTeam", CALL_Fantasy.l1.leagueTeams.size()); + request.setAttribute("mainFA", FA_testPlayer.mainFA); + request.setAttribute("statBase", FA_testPlayer.mainFA.get(0)); + + request.setAttribute("team1projectedRK", f.format(team1.getProjRK())); + request.setAttribute("team1projTot", f.format(team1.getProjTot())); + ArrayList otherTstats = new ArrayList(); + for (Teams teamX : CALL_Fantasy.l1.leagueTeams) { + if(teamX.getName()!=team1.getName()) { + otherTstats.add(f.format(teamX.getProjTot())); + } + } + request.setAttribute("otherTeamStats", otherTstats); + + ArrayList potPts = new ArrayList(); + ArrayList potRK = new ArrayList(); + for (Player player : players) { + potPts.add(String.valueOf(player.getPotPoint())); + potRK.add(String.valueOf(player.getPotRK())); + player.setValToRank((float)player.getPotPoint()); + } + Collections.sort(players); + Collections.reverse(players); + + + String potPtsJson = new Gson().toJson(potPts); + String potRKJson = new Gson().toJson(potRK); + request.setAttribute("potPtsJson", potPtsJson); + request.setAttribute("potRKJson", potRKJson); + + request.setAttribute("playerList", players); + request.setAttribute("teamID", chosenT); + request.setAttribute("player", bestPlayer); + + if(action != null) { + RequestDispatcher rd = getServletContext().getRequestDispatcher("/DIV_FA.jsp"); + rd.forward(request, response); + }else { + RequestDispatcher rd = getServletContext().getRequestDispatcher("/PAGE_team.jsp"); + rd.forward(request, response); + } + + + } + static final class ListOfStatComparator implements Comparator < ArrayList < Stat >> { + + @Override + public int compare(ArrayList < Stat > o1, ArrayList < Stat > o2) { + // do other error checks here as well... such as null. outofbounds, etc + return o1.get(0).compareTo(o2.get(0)); + } + + } +} diff --git a/src/call_pages/CALL_Trade.java b/src/call_pages/CALL_Trade.java new file mode 100644 index 0000000..ff839f4 --- /dev/null +++ b/src/call_pages/CALL_Trade.java @@ -0,0 +1,53 @@ +package call_pages; + +import java.io.*; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import call_pages.CALL_Fantasy; + + + +/** + * Servlet implementation class stat + */ +@WebServlet("/tradeServlet") +public class CALL_Trade extends HttpServlet { + + /** + * @see HttpServlet#HttpServlet() + */ + public CALL_Trade() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + //appelé lors clic btn trade + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + response.setContentType("text/html"); + + request.setAttribute("teamList", CALL_Fantasy.l1.leagueTeams); + + RequestDispatcher rd = getServletContext().getRequestDispatcher("/PAGE_trade.jsp"); + rd.forward(request, response); + + } + +} diff --git a/src/call_pages/TESTcss.java b/src/call_pages/TESTcss.java new file mode 100644 index 0000000..1a1f9e1 --- /dev/null +++ b/src/call_pages/TESTcss.java @@ -0,0 +1,5 @@ +package call_pages; + +public class TESTcss { + +} diff --git a/src/functions/DB_handler.java b/src/functions/DB_handler.java new file mode 100644 index 0000000..8865bde --- /dev/null +++ b/src/functions/DB_handler.java @@ -0,0 +1,24 @@ +/*package functions; + + //-----------------RETURN THE DAY FOR A SPECIFIED RECORD NUMBER----------------------(TEAM) + public Date getDate(int jour) { + Date d = new Date() ; + SQLiteDatabase db = this.getWritableDatabase(); + String selectQuery = "SELECT " + KEY_DAY + " FROM " + TABLE_RECORDS + " WHERE " + KEY_RECORDCOUNT + " = '" + jour +"'" ; + Cursor cursor = db.rawQuery(selectQuery, null); + if(cursor.moveToFirst()) + { + try{ + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); // here set the pattern as you date in string was containing like date/month/year + d = sdf.parse(cursor.getString(0)); + }catch(ParseException ex){ + // handle parsing exception if date string was different from the pattern applying into the SimpleDateFormat contructor + } + } + cursor.close(); + return d; + } + +} + +*/ \ No newline at end of file diff --git a/src/functions/FA_testPlayer.java b/src/functions/FA_testPlayer.java new file mode 100644 index 0000000..040c5b1 --- /dev/null +++ b/src/functions/FA_testPlayer.java @@ -0,0 +1,143 @@ +package functions; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; + +import call_pages.CALL_Fantasy; +import objects.League; +import objects.Player; +import objects.Stat; +import objects.Teams; + +/** + * Created by LeJay on 22.02.2017. + */ + +public class FA_testPlayer extends CALL_Fantasy { + + /** + * + */ + private static final long serialVersionUID = 1L; + public static ArrayList> mainFA = new ArrayList<>(); + public static Player[] players = new Player[400]; + public static double maxPts = 0.0; + public static double maxRK = 1000.0; + int nbPlay = 0; + public static int sortKey; + + public static void testPlayer(Teams teams, Player playerX){ + + maxPts = 0.0; + maxRK = 1000.0; + + int Pcode = 0; + for(Player players : teams.players){ + if(players.getnom().equals(playerX.getnom())){ + break; + } + Pcode++; + } + + teams.setInTrade(true); + //met en mémoire le joueur remplacé + Player rePutPlayer = playerX; + + //----------------------------loop all league players + for (Player playerFA : l1.leaguePlayers) { + if (playerFA.isFA) { + int nbStat = 0; + + ArrayList subFA = new ArrayList(1 + l1.nbStatsTeam + l1.nbTeams * 2); + + //echange un player contre un freeAgent + teams.players.set(Pcode,playerFA); + playerX = teams.players.get(Pcode); + + //-----------calcule la nouvelle projection + PROJ_analysis.calculate(); + + // RK-P + //enregistre l'impact sur chaque stats (ranking et valeur) + classement + Stat valGeneral = new Stat("RK-P"); + valGeneral.setPlayer(playerX.getnom()); + //nom joueur droppé in team name of stat + valGeneral.setTeam(rePutPlayer.getnom()); + valGeneral.setProjectedRK(teams.getProjRK()); + valGeneral.setValProjection(Double.toString(teams.getProjTot())); + valGeneral.setValToRank(Float.parseFloat(valGeneral.getValProjection())); + subFA.add(valGeneral); + nbStat++; + + if (teams.getProjTot() > maxPts) { + maxPts = teams.getProjTot(); + } + if (teams.getProjRK() < maxRK) { + maxRK = teams.getProjRK(); + } + + //----------------------------loop all stats + //add projection results for each stat category + for (int j = 0; j <= l1.loopStatsTeam; j++) { + Stat valStats = new Stat(l1.loadStatBaseTeam.get(j).getName()); + valStats.setPlayer(playerX.getnom()); + valStats.setTeam(teams.getName()); + valStats.setProjectedRK(teams.stats.get(j).getProjectedRK()); + valStats.setValProjection(teams.stats.get(j).getValProjection()); + subFA.add(valStats); + nbStat++; + } + //----------------------------loop all other teams + //add impact on other players ranking + for (Teams teamX : l1.leagueTeams) { + if (!teamX.getName().equals(teams.getName())) { + Stat impacts = new Stat(teamX.getName()); + impacts.setPlayer(playerX.getnom()); + impacts.setTeam(teams.getName()); + impacts.setProjectedRK(teamX.getProjRK()); + impacts.setValProjection(Double.toString(teamX.getProjTot())); + subFA.add(impacts); + nbStat++; + } + } + + if((teams.getProjTot() > teams.getProjTotX()-1)) { + mainFA.add(subFA); + } + + } + + } + + sortKey=0; + Collections.sort(mainFA, new ListOfStatComparator()); + sortKey=1; + Collections.sort(mainFA, new ListOfStatComparator()); + Collections.reverse(mainFA); + + //replace le bon joueur dans d'équipe + teams.players.set(Pcode,rePutPlayer); + teams.players.get(Pcode).setInTrade(false); + teams.players.get(Pcode).setPotPoint(maxPts); + teams.players.get(Pcode).setPotRK(maxRK); + teams.players.get(Pcode).faToCalculate = false; + + teams.setInTrade(false); + } + + static final class ListOfStatComparator implements Comparator < ArrayList < Stat >> { + + @Override + public int compare(ArrayList < Stat > o1, ArrayList < Stat > o2) { + // do other error checks here as well... such as null. outofbounds, etc + if(sortKey==0) { + return new Float(o1.get(0).getProjectedRK()).compareTo(new Float(o2.get(0).getProjectedRK())); + }else { + return new Float(o1.get(0).getValProjection()).compareTo(new Float(o2.get(0).getValProjection())); + } + } + } + +} diff --git a/src/functions/GRAPH_init.java b/src/functions/GRAPH_init.java new file mode 100644 index 0000000..99c2b61 --- /dev/null +++ b/src/functions/GRAPH_init.java @@ -0,0 +1,121 @@ +package functions; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import com.google.visualization.datasource.base.TypeMismatchException; +import com.google.visualization.datasource.datatable.ColumnDescription; +import com.google.visualization.datasource.datatable.DataTable; +import com.google.visualization.datasource.datatable.value.ValueType; + +import call_content.GRAPH_CALL; +import call_pages.CALL_Fantasy; +import objects.Stat; + + +public class GRAPH_init { // called from importTeams + + public DataTable data(String type){ + + + GRAPH_CALL.maxVal=0; + GRAPH_CALL.lowVal=100; + + int nbDay = 0; + float test =0; + + try { + nbDay = CALL_Fantasy.dao.nbDay(); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + + + + + DataTable data = new DataTable(); + ArrayList cols = new ArrayList(); + + //cree les colonnes pour les données du graphique + cols.add(new ColumnDescription("id", ValueType.NUMBER, "Day")); + for(int i = 0; i< CALL_Fantasy.l1.nbTeams;i++) { + cols.add(new ColumnDescription(CALL_Fantasy.l1.leagueTeams.get(i).getName(), ValueType.NUMBER, CALL_Fantasy.l1.leagueTeams.get(i).getName())); + } + data.addColumns(cols); + + try { + //parcours les jours + for(int i = 0; i< CALL_Fantasy.l1.nbDaysPlayed;i++) { // + + List valuesPoint = new ArrayList(CALL_Fantasy.l1.nbTeams+1); + List valuesStat = new ArrayList(CALL_Fantasy.l1.nbTeams+1); //CALL_Fantasy.l1.nbTeams+1 + + + if(type.equals("mainGraph")) { + valuesPoint.add((float) i); + }else { + valuesStat.add((float) i); + } + + + + // parcours les équipes + for(int j = 0; j< CALL_Fantasy.l1.nbTeams;j++) { + //recupere les données de la DB --- need ImportLineups + try { + if(type.equals("mainGraph")) { + test = CALL_Fantasy.dao.stat(CALL_Fantasy.l1.leagueTeams.get(j).getID(),i); + valuesPoint.add(test); + }else { + test = CALL_Fantasy.dao.statVal(CALL_Fantasy.l1.leagueTeams.get(j).getID(),i,type); + System.out.println(test); + valuesStat.add(test); + } + + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + if(i==nbDay-1){ + if(GRAPH_CALL.maxValtest && test !=0)GRAPH_CALL.lowVal=test; + } + + } + + if(type.equals("mainGraph")) { + data.addRowFromValues(valuesPoint.toArray()); + }else { + data.addRowFromValues(valuesStat.toArray()); + } + + } + + if(type.contains("%")) { + GRAPH_CALL.maxVal = (float) (GRAPH_CALL.maxVal * 1.01); + GRAPH_CALL.lowVal = (float) (GRAPH_CALL.lowVal *0.99); + }else { + GRAPH_CALL.maxVal = (float) (GRAPH_CALL.maxVal * 1.03); + GRAPH_CALL.lowVal = (float) (GRAPH_CALL.lowVal *0.97); + } + + if(GRAPH_CALL.maxValtest) {GRAPH_CALL.lowVal=test;} + + } catch (TypeMismatchException e) { + System.out.println("Invalid type!"); + } + + return data; + + } + + + +} diff --git a/src/functions/GRAPH_rebuild.java b/src/functions/GRAPH_rebuild.java new file mode 100644 index 0000000..d3739ce --- /dev/null +++ b/src/functions/GRAPH_rebuild.java @@ -0,0 +1,141 @@ +package functions; + +import call_pages.CALL_Fantasy; +import jsoupImport.ImportLineups; +import objects.Teams; + +public class GRAPH_rebuild { + + + public GRAPH_rebuild() throws Exception { + + String title; + //erase table + CALL_Fantasy.dao.delRecord(""); // can be removed in some case + + //--------Reset leagueTeams Season Stats---------------- + for (int i = 0; i < CALL_Fantasy.l1.leagueTeams.size(); i++) { + CALL_Fantasy.l1.leagueTeams.get(i).setGamesPlayed(0); + for (int b = 0; b <= CALL_Fantasy.l1.loopStatsTeam; b++) + if (CALL_Fantasy.l1.leagueTeams.get(i).stats.get(b).getName().contains("/")) + CALL_Fantasy.l1.leagueTeams.get(i).stats.get(b).setValSeason(0 + "/" + 0); + else + CALL_Fantasy.l1.leagueTeams.get(i).stats.get(b).setValSeason("" + 0); + } + + //loop through all period--------------------------------------------PERIOD + for (int periode = 0; periode < CALL_Fantasy.l1.getNbDaysPlayed(); periode++) { + + //test if record exist for that period + if (CALL_Fantasy.dao.periodExist(periode) == 0){ + + //-----------------go through teams to set ranks at period---------TEAM + for (int i = 0; i < CALL_Fantasy.l1.nbTeams; i++) { //first row is the col names so skip it. + //reset nbgames for the new team + int nbGames = 0; + int newNBgames =0; + //go through all stats to increment for each period-----------------STATS + for (int b = 0; b <= CALL_Fantasy.l1.loopStatsTeam; b++) { + //skip team stat decomposed -- not in ranking but used to calculate % + if (!CALL_Fantasy.l1.loadStatBaseTeam.get(b).getName().contains("/")) { + //reset totals for the new stat + int totStat = 0; + int totStat1 = 0; + int totStat2 = 0; + //go through all slots of that period to gather all stats----------------------SLOTS + for (int k = 0; k < CALL_Fantasy.l1.leagueTeams.get(i).slots.length; k++) { + if (CALL_Fantasy.l1.leagueTeams.get(i).slots[k] != null) { + if (CALL_Fantasy.l1.leagueTeams.get(i).slots[k].players[periode] != null) { + //don't count players aligned on bench slot + if (!CALL_Fantasy.l1.leagueTeams.get(i).slots[k].getNomPos().equals("Bench") && !CALL_Fantasy.l1.leagueTeams.get(i).slots[k].getNomPos().equals("IR")) { + if(b==0)nbGames++; + if (!CALL_Fantasy.l1.leagueTeams.get(i).slots[k].players[periode].stats.get(b).getName().contains("/")) { + totStat += Integer.parseInt(CALL_Fantasy.l1.leagueTeams.get(i).slots[k].players[periode].stats.get(b).getStatVal()); + } else { + String[] decomp = CALL_Fantasy.l1.leagueTeams.get(i).slots[k].players[periode].stats.get(b).getStatVal().split("/"); + totStat1 += Integer.parseInt(decomp[0]); + totStat2 += Integer.parseInt(decomp[1]); + } + } + } + } + } + if(b==0) { + newNBgames = CALL_Fantasy.l1.leagueTeams.get(i).getGamesPlayed() + nbGames; + CALL_Fantasy.l1.leagueTeams.get(i).setGamesPlayed(newNBgames); + } + if (!CALL_Fantasy.l1.leagueTeams.get(i).stats.get(b).getName().contains("%")) { + //calculate and set new total for further use + + //System.out.println(Fantasy.l1.leagueTeams.get(i).getName()); + //System.out.println(Fantasy.l1.leagueTeams.get(i).stats.get(b).getName()); + //System.out.println(Fantasy.l1.leagueTeams.get(i).stats.get(b).getValSeason()); + + int newTotal = Integer.parseInt(CALL_Fantasy.l1.leagueTeams.get(i).stats.get(b).getValSeason())+totStat; + CALL_Fantasy.l1.leagueTeams.get(i).stats.get(b).setValSeason(""+newTotal); + //calculate and set new relative for actual use + float newRalative=0; + if(newNBgames!=0){ + newRalative =(float) newTotal/newNBgames; + } + CALL_Fantasy.l1.leagueTeams.get(i).stats.get(b).setValRelative(newRalative); + } else { + //b+1 because inverted stats bwtween player and team + String[] decomp = CALL_Fantasy.l1.leagueTeams.get(i).stats.get(b+1).getValSeason().split("/"); + //calculate and set new total for further use + int newTotal1 = Integer.parseInt(decomp[0].replace(".0",""))+totStat1; + int newTotal2 = Integer.parseInt(decomp[1].replace(".0",""))+totStat2; + CALL_Fantasy.l1.leagueTeams.get(i).stats.get(b+1).setValSeason(newTotal1+"/"+newTotal2); + + float totStatPourcent; + if (newTotal2!=0){ + totStatPourcent = (float)newTotal1 / newTotal2 * 100; + }else{ + totStatPourcent = 100 ; + } + CALL_Fantasy.l1.leagueTeams.get(i).stats.get(b).setValRelative(totStatPourcent); + } + } + }//end loop stats + + }//end loop team + + //----------------------fill stat ranks + RANKS_fill.fillStatRank(); + //float[] arrVal = RANKS_fill.fillStatRankTEST(); + //-------------fill team ranks--------------- + RANKS_fill.fillTeamRank(); + //float[] arrVal2 = RANKS_fill.fillTeamRankTEST(); + + System.out.println("period -- "+periode); + + //enregistre le ranking relatif + int nbRec = CALL_Fantasy.dao.nbDay() + 1; + for (int i = 0; i < Teams.getNumOfInstances(); i++) { + for (int j = 0; j <= CALL_Fantasy.l1.loopStatsTeam; j++) { + if(!CALL_Fantasy.l1.loadStatBaseTeam.get(j).getName().contains("/")){ + System.out.println(CALL_Fantasy.l1.leagueTeams.get(i).getName() + "/" + CALL_Fantasy.l1.leagueTeams.get(i).stats.get(j).getRank()); + CALL_Fantasy.dao.addRecord(CALL_Fantasy.l1.leagueTeams.get(i).stats.get(j), CALL_Fantasy.l1.leagueTeams.get(i), nbRec,periode); + } + } + } + + }//if period exist + + }//end loop period + + } + + boolean isDouble(String str) { + try { + Double.parseDouble(str); + return true; + } catch (NumberFormatException e) { + return false; + } + } + +} + + + diff --git a/src/functions/Main.java b/src/functions/Main.java new file mode 100644 index 0000000..2d87e0b --- /dev/null +++ b/src/functions/Main.java @@ -0,0 +1,12 @@ +package functions; + + +public class Main { + + public static void main(String[] args) throws Exception { + MySQLAccess dao = new MySQLAccess(); + dao.readTeam(); + } + + +} \ No newline at end of file diff --git a/src/functions/MySQLAccess.java b/src/functions/MySQLAccess.java new file mode 100644 index 0000000..df140b2 --- /dev/null +++ b/src/functions/MySQLAccess.java @@ -0,0 +1,660 @@ +package functions; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.ibm.icu.text.SimpleDateFormat; +import com.ibm.icu.util.Calendar; + +import call_pages.CALL_Fantasy; +import objects.Player; +import objects.Stat; +import objects.Teams; + +public class MySQLAccess { + + // Database Name + private static final String DATABASE_NAME = "test30"; + + private static final String DATABASE_DRIVER = "com.mysql.jdbc.Driver"; + private static final String DATABASE_URL = "jdbc:mysql://localhost:3306/" + DATABASE_NAME ; + private static final String USERNAME = "root"; + private static final String PASSWORD = "1800vevey"; + private static final String MAX_POOL = "30000"; + + // Contacts table name + private static final String TABLE_TEAMS = "teams"; + private static final String TABLE_RECORDS = "records"; + private static final String TABLE_STATS = "stats"; + + // Contacts Table Columns names + private static final String KEY_ID = "id"; + + private static final String KEY_TEAM = "team"; + + private static final String KEY_TOTREL = "totalRelatif"; + + private static final String KEY_DAY = "Day"; + private static final String KEY_TEAMID = "teamid"; + + private static final String KEY_STATID = "statid"; + private static final String KEY_STATNAME = "statname"; + + private static final String KEY_PLAYER = "player"; + private static final String KEY_SLOT = "position"; + private static final String KEY_SLOTID = "slotID"; + + private static final String KEY_PERIOD = "period"; + + private static final String KEY_VALSTAT = "valstat"; + private static final String KEY_RKSTAT = "rkstat"; + private static final String KEY_RECORDCOUNT = "recordCount"; + + private static Connection connect = null; + private static Statement statement = null; + private static PreparedStatement preparedStatement = null; + private static ResultSet resultSet = null; + + public static void main(String[] args) throws Exception { + MySQLAccess dao = new MySQLAccess(); + dao.createDataBase(); + dao.createTable(); + + //dao.addTeam(); + //dao.readTeam(); + //dao.addStat(); + dao.readStats(); + + } + + public void testIfExist() throws Exception { + try { + boolean exist = false; + + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306"; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + + ResultSet resultSet = connect.getMetaData().getCatalogs(); + + while (resultSet.next()) { + + String databaseName = resultSet.getString(1); + if(databaseName.equals(DATABASE_NAME)){ + exist = true; + } + } + resultSet.close(); + + if(exist == false) { + CALL_Fantasy.dao.createDataBase(); + CALL_Fantasy.dao.createTable(); + } + + + } catch (Exception e) {throw e;} finally {close();} + } + + public void createDataBase() throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306"; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + String hrappSQL = "CREATE DATABASE "+ DATABASE_NAME; + statement.executeUpdate(hrappSQL); + + } catch (Exception e) {throw e;} finally {close();} + } + + public void createTable() throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + +/* String CREATE_TEAMS_TABLE = "CREATE TABLE " + TABLE_TEAMS + "(" + + KEY_ID + " INTEGER PRIMARY KEY," + KEY_TEAM + " TEXT" +")"; + statement.executeUpdate(CREATE_TEAMS_TABLE);*/ + + String CREATE_RECORDS_TABLE = "CREATE TABLE " + TABLE_RECORDS + "(" + + KEY_ID + " INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT," + KEY_DAY + " TEXT," + KEY_TEAMID + " TEXT," + KEY_PERIOD + " INTEGER," + + KEY_STATNAME + " TEXT," + KEY_VALSTAT + " TEXT," + KEY_RKSTAT + " TEXT," + KEY_RECORDCOUNT + " TEXT" +")"; + statement.executeUpdate(CREATE_RECORDS_TABLE); + + String CREATE_STATS_TABLE = "CREATE TABLE " + TABLE_STATS + "(" + + KEY_ID + " INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT," + KEY_STATNAME + " TEXT," + KEY_VALSTAT + " TEXT," + KEY_PLAYER + " TEXT," + + KEY_SLOT + " TEXT," + KEY_SLOTID + " INTEGER," + KEY_TEAMID + " INTEGER," + KEY_PERIOD + " INTEGER" + ")"; + statement.executeUpdate(CREATE_STATS_TABLE); + + } catch (Exception e) {throw e;} finally {close();} + } + + + //---------------ADD PLAYER STAT RECORD TO THE DATABASE ------------ + public void addStat(Stat stat, Player player, int teamID) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + // PreparedStatements can use variables and are more efficient + preparedStatement = connect + .prepareStatement("insert into " + TABLE_STATS + " ("+KEY_STATNAME+", "+KEY_PLAYER+","+KEY_TEAMID+","+KEY_VALSTAT+","+KEY_SLOTID+","+KEY_SLOT+","+KEY_PERIOD+") values (?, ?, ?, ?, ?, ?, ?)"); + + // Parameters start with 1 + preparedStatement.setString(1, stat.getName()); + preparedStatement.setString(2, player.getnom()); + preparedStatement.setInt(3, teamID); + preparedStatement.setString(4, stat.getStatVal()); + preparedStatement.setInt(5, stat.getSlotID()); + preparedStatement.setString(6, stat.getSlot()); + preparedStatement.setInt(7, stat.getPeriod()); + + preparedStatement.executeUpdate(); + + } catch (Exception e) {throw e;} finally { + if (preparedStatement != null) { + try { + preparedStatement.close(); + } catch (SQLException e) { /*ignored*/ } + } + if (statement != null) { + try { + statement.close(); + } catch (SQLException e) { /*ignored*/ } + } + if (connect != null) { + try { + connect.close(); + } catch (SQLException e) { /*ignored*/ } + } + + } + } + + //---------------ADD TEAM RELATIVE STAT RECORD TO THE DATABASE ------------ + public void addRecord(Stat stat, Teams teams, float rec, int period) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + + + statement = connect.createStatement(); + + // PreparedStatements can use variables and are more efficient + preparedStatement = connect + .prepareStatement("insert into " + TABLE_RECORDS + " ("+KEY_DAY+", "+KEY_TEAMID+","+KEY_STATNAME+","+KEY_VALSTAT+","+KEY_RKSTAT+","+KEY_RECORDCOUNT+","+KEY_PERIOD+") values (?, ?, ?, ?, ?, ?, ?)"); + + Date d1 = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + String dayOf = sdf.format(d1); + + // Parameters start with 1 + preparedStatement.setString(1, dayOf); + preparedStatement.setInt(2, teams.getID()); + preparedStatement.setString(3, stat.getName()); + preparedStatement.setDouble(4, stat.getValRelative()); + preparedStatement.setDouble(5, stat.getRank()); + preparedStatement.setFloat(6, rec); + preparedStatement.setInt(7, period); + + //System.out.println("Ranking Record for team : " + teams.getName() + "("+teams.getID()+") / " + stat.getName() + " / " + stat.getRank() + " / " + period); + + preparedStatement.executeUpdate(); + + } catch (Exception e) {throw e;} finally { + + if (preparedStatement != null) { + try { + preparedStatement.close(); + } catch (SQLException e) { /*ignored*/ } + } + if (statement != null) { + try { + statement.close(); + } catch (SQLException e) { /*ignored*/ } + } + if (connect != null) { + try { + connect.close(); + } catch (SQLException e) { /*ignored*/ } + } + } + } + + public List getStatList(Teams teams,int period) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + List records = new ArrayList(); + + resultSet = statement + .executeQuery("SELECT * FROM " + TABLE_STATS + " WHERE " + KEY_TEAMID + " = " + teams.getID() + " AND " + KEY_PERIOD + " = " + period); + + while (resultSet.next()) { + + Stat stat = new Stat(resultSet.getString(KEY_STATNAME)); + stat.setPeriod(resultSet.getInt(KEY_PERIOD)); + stat.setSlot(resultSet.getString(KEY_SLOT)); + stat.setSlotID(resultSet.getInt(KEY_SLOTID)); + stat.setPlayer(resultSet.getString(KEY_PLAYER));//4 + stat.setStatVal(resultSet.getString(KEY_VALSTAT)); + + records.add(stat); + } + + return records; + + } catch (Exception e) {throw e;} finally {connect.close();} + } + + + //-----------List of record for a TEAM and a day--------------------(TEAM) + public List getAllShops() throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + List shopList = new ArrayList(); + String test= Integer.toString(Calendar.DAY_OF_MONTH) + "/" + Integer.toString(Calendar.MONTH) + "/" + Integer.toString(Calendar.YEAR); + + resultSet = statement + .executeQuery( "SELECT * FROM " + TABLE_RECORDS + " WHERE Day = '"+test+"'"); + + while (resultSet.next()) { + Stat shop = new Stat(""); + double d = Double.parseDouble(resultSet.getString(4)); + int i = (int) d; + shop.setValRelative(i); + System.out.println(resultSet.getString(0) + "-" + resultSet.getString(1) + "-" + resultSet.getString(2) + "-" + resultSet.getString(3) + "-" + resultSet.getString(4)+ "-" + resultSet.getString(5)); + // Adding contact to list + shopList.add(shop); + } + + return shopList; + + } catch (Exception e) {throw e;} finally {close();} + } + + + //-----------List of PLAYER stat record for a team and a day--------------------(PLAYER) + public List getRecordsList(Teams teams,int period) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + List records = new ArrayList(); + + resultSet = statement + .executeQuery("SELECT * FROM " + TABLE_RECORDS + " WHERE " + KEY_TEAMID + " = " + teams.getID() + " AND " + KEY_PERIOD + " = " + period); + + while (resultSet.next()) { + + Stat stat = new Stat(resultSet.getString(KEY_STATNAME)); + stat.setRank(resultSet.getInt(KEY_RKSTAT)); + stat.setValRelative(resultSet.getFloat(KEY_VALSTAT)); + + records.add(stat); + } + + return records; + + } catch (Exception e) {throw e;} finally {close();} + } + + + //-----------REBUILD MADE / ATTEMPT from DB--------------------(TEAM) + public String rebuildMA(Teams teams, String stat) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + int sumTeamMA =0; + int sumTeamAT =0; + + resultSet = statement + .executeQuery("SELECT " + KEY_VALSTAT + " FROM " + TABLE_STATS + " WHERE " + KEY_STATNAME + " = '" + stat + + "' AND " + KEY_TEAMID + " = " + teams.getID() + " AND " + KEY_SLOT + "<> 'Bench'"); + + while (resultSet.next()) { + + String[] decomp2 = resultSet.getString(KEY_VALSTAT).split("/"); + int val1 = (int) Float.parseFloat(decomp2[0]); + int val2 = (int) Float.parseFloat(decomp2[1]); + sumTeamMA += val1; + sumTeamAT += val2; + + } + + String valMadeAttempt = sumTeamMA + "/" + sumTeamAT; + + return valMadeAttempt; + + } catch (Exception e) {throw e;} finally {close();} + } + + + // --------------RETURN TOTAL OF RELATIVE POINT RANK FOR A TEAM---------------- + public float stat(int team, int period) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + // Result set get the result of the SQL query + resultSet = statement + .executeQuery("SELECT SUM(" + KEY_RKSTAT + ") FROM " + TABLE_RECORDS + " WHERE " + KEY_TEAMID + " = '" + team + "' AND " + KEY_PERIOD + " = '" + period +"'"); + + float value =0 ; + while (resultSet.next()) + { + value = resultSet.getFloat(1); + } + + return value; + + } catch (Exception e) {throw e;} finally {close();} + } + + + //---------------DEL TEAM RECORD FROM THE DATABASE ------------ + public void delRecord(String dayOf) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + String query = "DELETE FROM "+TABLE_RECORDS; + PreparedStatement preparedStmt = connect.prepareStatement(query); + preparedStmt.execute(); + + } catch (Exception e) {throw e;} finally {close();} + } + + + //-----------Test if day is RECORDED-------------------- + public int periodExist(int period) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + resultSet = statement + .executeQuery( "SELECT COUNT(" + KEY_PERIOD + ") FROM " + TABLE_RECORDS + " WHERE " + KEY_PERIOD + " = " + period); + + int maxID = 0; + if (resultSet.next()) { + maxID = resultSet.getInt(1); + } + + return maxID; + + } catch (Exception e) {throw e;} finally {close();} + } + + //-----------Test if day is RECORDED-------------------- + public int countSLOT(Teams team, int slotID) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + resultSet = statement + .executeQuery("SELECT COUNT(" + KEY_PERIOD + ") FROM " + TABLE_STATS + " WHERE " + KEY_TEAMID + " = " + team.getID() + " AND " + KEY_SLOTID + " = " + slotID); + + int slotCount = 0; + if (resultSet.next()) { + slotCount = resultSet.getInt(1); + } + + return slotCount; + + } catch (Exception e) {throw e;} finally {close();} + } + + + + // --------------RETURN TOTAL OF RELATIVE POINT RANK FOR A TEAM---------------- + public float statVal(int team, int period, String Stat) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + // Result set get the result of the SQL query + resultSet = statement + .executeQuery("SELECT " + KEY_VALSTAT+ " FROM " + TABLE_RECORDS + " WHERE " + KEY_TEAMID + " = '" + team + + "' AND " + KEY_PERIOD + " = '" + period +"' AND " + KEY_STATNAME + " = '" + Stat + "'" ); + + resultSet.next(); + + return Float.parseFloat(resultSet.getString(KEY_VALSTAT)); + + + } catch (Exception e) {throw e;} finally {close();} + } + + public void addTeam() throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + // PreparedStatements can use variables and are more efficient + preparedStatement = connect + .prepareStatement("insert into teams values (?, ?)"); + // "myuser, webpage, datum, summary, COMMENTS from feedback.comments"); + // Parameters start with 1 + preparedStatement.setInt(1, 2); + preparedStatement.setString(2, "TestEmail"); + preparedStatement.executeUpdate(); + + } catch (Exception e) {throw e;} finally {close();} + } + + + // ------------RETURN LAST DAY RECORDED---------------- + public Integer getLastPeriod() throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + // Result set get the result of the SQL query + resultSet = statement + .executeQuery("SELECT MAX("+ KEY_PERIOD + ") FROM " + TABLE_RECORDS); + + int maxID = 0; + if (resultSet.next()) { + maxID = resultSet.getInt(1); + } + + return maxID; + + } catch (Exception e) {throw e;} finally {close();} + } + + public Integer nbDay() throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + // Result set get the result of the SQL query + resultSet = statement + .executeQuery("SELECT COUNT(DISTINCT " + KEY_PERIOD + ") FROM " + TABLE_RECORDS); + + + int maxID = 0; + if (resultSet.next()) { + maxID = resultSet.getInt(1); + } + return maxID; + + + } catch (Exception e) {throw e;} finally {close();} + } + + public void readTeam() throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + // Result set get the result of the SQL query + resultSet = statement + .executeQuery("select * from teams"); + + writeResultSet(resultSet); + + } catch (Exception e) {throw e;} finally {close();} + } + + public Integer dayRecorded(Teams teams,int period) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + resultSet = statement + .executeQuery("SELECT COUNT(" + KEY_PERIOD + ") FROM " + TABLE_STATS + " WHERE " + KEY_TEAMID + " = " + teams.getID() + " AND " + KEY_PERIOD + " = " + period); + + int maxID = 0; + if (resultSet.next()) { + maxID = resultSet.getInt(1); + } + + return maxID; + + } catch (Exception e) {throw e;} finally {close();} + } + + + //---------------DEL PLAYER STAT RECORD from THE DATABASE ------------ + public void delStat(Teams teams, int period) throws Exception { + try { + // This will load the MySQL driver, each DB has its own driver + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + + String query = "DELETE FROM " + TABLE_STATS + " WHERE " + KEY_TEAMID + " = " + teams.getID() + + " AND " + KEY_PERIOD + " = " + period; + PreparedStatement preparedStmt = connect.prepareStatement(query); + preparedStmt.execute(); + + + } catch (Exception e) {throw e;} finally {close();} + } + + + private void writeResultSet(ResultSet resultSet) throws SQLException { + // ResultSet is initially before the first data set + while (resultSet.next()) { + // It is possible to get the columns via name + // also possible to get the columns via the column number + // which starts at 1 + // e.g. resultSet.getSTring(2); + String user = resultSet.getString("team"); + System.out.println("User: " + user); + + } + } + + private void readStats() throws Exception { + // ResultSet is initially before the first data set + try { + Class.forName(DATABASE_DRIVER).newInstance(); + String url = "jdbc:mysql://localhost:3306/"+ DATABASE_NAME; + connect = DriverManager.getConnection(url, USERNAME, PASSWORD); + statement = connect.createStatement(); + + // Result set get the result of the SQL query + resultSet = statement + .executeQuery("SELECT * FROM " + TABLE_RECORDS ); + + + while (resultSet.next()) { + // It is possible to get the columns via name + // also possible to get the columns via the column number + // which starts at 1 + // e.g. resultSet.getSTring(2); + System.out.println("Team id : " + resultSet.getString(KEY_TEAMID) + " Stat : " + resultSet.getString(KEY_STATNAME) + " Value : " + resultSet.getString(KEY_RKSTAT) + " Period : " + resultSet.getString(KEY_PERIOD)); + + } + + + + } catch (Exception e) {throw e;} finally {close();} + + } + + // You need to close the resultSet + private static void close() { + try { + if (resultSet != null) { + resultSet.close(); + } + + if (statement != null) { + statement.close(); + } + + if (connect != null) { + connect.close(); + } + } catch (Exception e) { + + } + } + +} \ No newline at end of file diff --git a/src/functions/PROJ_analysis.java b/src/functions/PROJ_analysis.java new file mode 100644 index 0000000..41a117f --- /dev/null +++ b/src/functions/PROJ_analysis.java @@ -0,0 +1,219 @@ +package functions; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collections; + +import call_pages.CALL_Fantasy; +import objects.Player; +import objects.Stat; +import objects.Teams; + +/** + * Created by LeJay on 05.02.2017. + */ + +public class PROJ_analysis extends CALL_Fantasy { //called from FA_test or btnProjection or btnTeam + + private Teams team; + int perdiod; + private int nbGame; + + + public PROJ_analysis(){ + //calculate(); + } // also fill player RK in team if not yet filled + + public static void calculate(){ + + float total =0; + final DecimalFormat f = new DecimalFormat("0.#"); + final DecimalFormat in = new DecimalFormat("0.##"); + + l1.nbGP = l1.getNbDaysPlayed()/2; + l1.nbGR = l1.nbGS - l1.nbGP; + + //------- + for(Teams teamX : l1.leagueTeams) { + + float TeamRemain = (820 - teamX.getGamesPlayed())/10; + + //ne pas recalculer le total de projection si le joueur n'est pas impliqué dans un trade + if(teamX.getInTrade() || teamX.getProjRK()==(double) 0.0) { + //-----------Calculate end season projection for each stat of each PLAYER-------ALL + for (Player playerX : teamX.players) { + + //calculate only if not yet done for this player + if(playerX.stats.get(0).getValProjection()==null && playerX.teamID == teamX.getID()) { + for (Stat statX : playerX.stats) { + if (isNumeric(statX.getStatVal())) { + float valProj = Float.parseFloat(statX.getStatVal()) * TeamRemain; + statX.setValProjection(Float.toString(valProj));//remaining points + } else { + statX.setValProjection("0"); + } + if (statX.getStatVal().contains("/")) { + String[] decomp = statX.getStatVal().split("/"); + if (isNumeric(decomp[0])) { + float valProj1 = Float.parseFloat(decomp[0]) * TeamRemain; + float valProj2 = Float.parseFloat(decomp[1]) * TeamRemain; + statX.setValProjection(valProj1 + "/" + valProj2);//remaining points + } else { + statX.setValProjection("0/0"); + } + } + + if (statX.getName().equals("PTS")) { + break; + } + } + } + + } + + //----------------add projection totals from players to team stats + for (Stat teamStatX : teamX.stats) { + + if (teamStatX != null) { + int statCtr = 0; //3PM is 4th stat in playerStat + for (statCtr = 0; statCtr < l1.loadStatBasePlayer.size(); statCtr++) + if (teamStatX.getName().equals(l1.loadStatBasePlayer.get(statCtr).getName())) + break; + + if (!teamStatX.getName().contains("%")) { + if (!teamStatX.getName().contains("/")) { + float sumPlayerProj = 0; + for (Player playerX : teamX.players){ + if (playerX.teamID == teamX.getID() && playerX.isToCount) { + sumPlayerProj += (int) Float.parseFloat(playerX.stats.get(statCtr).getValProjection()); + System.out.println(playerX.getnom() + " -added va- " + sumPlayerProj); + } + } + + + + float valProjection = Float.parseFloat(teamStatX.getValSeason()) + sumPlayerProj; + teamStatX.setValProjection(Float.toString(valProjection)); + } else { + + //sum player stats just created + float sumPlayerProj1 = 0; + float sumPlayerProj2 = 0; + for (Player playerX : teamX.players) { + if (playerX.teamID == teamX.getID() && playerX.isToCount){ + String[] decomp = playerX.stats.get(statCtr).getValProjection().split("/"); + float valProj1 = Float.parseFloat(decomp[0]); + float valProj2 = Float.parseFloat(decomp[1]); + sumPlayerProj1 += valProj1; + sumPlayerProj2 += valProj2; + } + } + + //need loaded info from db + //apply projection to % and / + String[] decomp2 = teamStatX.getValSeason().split("/"); + int valSeas1 = (int) Float.parseFloat(decomp2[0]); + int valSeas2 = (int) Float.parseFloat(decomp2[1]); + sumPlayerProj1 += valSeas1; + sumPlayerProj2 += valSeas2; + String valProjection = sumPlayerProj1 + "/" + sumPlayerProj2; + float valProjPourcent = sumPlayerProj1 / sumPlayerProj2 * 100; + //float valProjPourcent = Float.parseFloat(teamX.stats.get(statCtr).getValSeason()); + //statCtr points to % stat + teamX.stats.get(statCtr).setValProjection(Float.toString(valProjPourcent)); + teamStatX.setValProjection(valProjection); + + } + } + } + } + + } + } + + + //----------------add projection RANK to team stats + ArrayList arrVal = new ArrayList(); + // go through all stats and all teams + for (int j = 0; j < l1.loadStatBaseTeam.size(); j++) { + if(!l1.loadStatBaseTeam.get(j).getName().contains("/")){ + arrVal.clear(); + //---------------add team stats to array + for (int i = 0; i < l1.nbTeams; i++) { + + System.out.println(l1.leagueTeams.get(i).stats.get(j).getValProjection()); + l1.leagueTeams.get(i).stats.get(j).setValToRank(Float.parseFloat(l1.leagueTeams.get(i).stats.get(j).getValProjection())); + arrVal.add(l1.leagueTeams.get(i).stats.get(j)); + } + + //for (int i = 0; i < arrVal.size(); i++) {System.out.println(arrVal.get(i).getName() + "/" + arrVal.get(i).getValProjection());} + if (l1.leagueTeams.get(0).stats.get(j).getName().equals("TO")) { + Collections.sort(arrVal); + } else { + Collections.sort(arrVal, Collections.reverseOrder()); + } + //for (int i = 0; i < arrVal.size(); i++) {System.out.println(arrVal.get(i).getName() + "/" + arrVal.get(i).getValProjection());} + RANKS_fill.fillRANK("projection",arrVal,null,null); + } + } + + //-------------fill team ranks--------------- + ArrayList arrVal2 = new ArrayList(); + for (int i = 0; i < l1.nbTeams; i++) { + //fill total relative pts + Double tot = 0.0; + for (int j = 0; j <= l1.loopStatsTeam; j++) { + if (!l1.loadStatBaseTeam.get(j).getName().contains("/")) { + tot += l1.leagueTeams.get(i).stats.get(j).getProjectedRK(); + } + } + l1.leagueTeams.get(i).setProjTot(tot); + l1.leagueTeams.get(i).setValToRank((float)l1.leagueTeams.get(i).getProjTot()); + arrVal2.add(l1.leagueTeams.get(i)); + } + //for (int i = 0; i < arrVal2.size(); i++)System.out.println(arrVal2.get(i).getTotalrotPtsRel()); + Collections.sort(arrVal2); + //for (int i = 0; i < arrVal2.size(); i++)System.out.println(arrVal2.get(i).getTotalrotPtsRel()); + RANKS_fill.fillRANK("teamProjection",null,arrVal2,null); + + //SHOW_tab.printTeams(); + //btn_Team.setEnabled(true); + + //format stats for display + for(Teams teamX : l1.leagueTeams) { + for (Stat statX : teamX.stats) { + if(statX.getName().contains("/")) { + String decomp[] = statX.getValProjection().split("/"); + float val1 = Float.parseFloat(decomp[0]); + float val2 = Float.parseFloat(decomp[1]); + statX.setValProjection((int)val1 + "/" + (int)val2); + }else if(statX.getName().contains("%")) { + float val = Float.parseFloat(statX.getValProjection()); + statX.setValProjection(in.format(val)); + }else { + float val1 = Float.parseFloat(statX.getValProjection()); + statX.setValProjection(String.valueOf((int)val1)); + } + } + + //teamX.setProjRK(Double.parseDouble(f.format(teamX.getProjRK()))); + //teamX.setProjTot(Double.parseDouble(f.format(teamX.getProjTot()))); + } + } + + public static boolean isNumeric(String str) + { + try + { + double d = Double.parseDouble(str); + } + catch(NumberFormatException nfe) + { + return false; + } + return true; + } + + +} + diff --git a/src/functions/RANKS_fill.java b/src/functions/RANKS_fill.java new file mode 100644 index 0000000..5aa2dd5 --- /dev/null +++ b/src/functions/RANKS_fill.java @@ -0,0 +1,317 @@ +package functions; + + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collections; + +import call_pages.CALL_Fantasy; +import objects.League; +import objects.Player; +import objects.Stat; +import objects.Teams; + +/** + * Created by LeJay on 14.02.2017. + */ + +public class RANKS_fill extends CALL_Fantasy { + private RANKS_fill() { + + } +// //-------------------------------------------------------------fill stat ranks TEST +// public static float[] fillStatRankTEST(){ +// double pts = l1.nbTeams; +// float[] arrVal = new float[l1.nbTeams]; +// // go through all stats and all teams +// for (int j = 0; j < l1.loopStatsTeam; j++) { +// if(!l1.loadStatBaseTeam.get(j).getName().contains("/")){ +// //---------------add team stats to array +// for (int i = 0; i < l1.nbTeams; i++) { +// arrVal.get(i) = leagueTeams.get(i).stats.get(j).getValRelative(); +// } +// double[] rank = rankFantasy(arrVal); +// +// for (int i = 0; i < rank.length; i++) +// System.out.println(""+rank.get(i)); +// +// for (int i = 0; i < l1.nbTeams; i++) { +// if(!leagueTeams.get(i).stats.get(j).getName().equals("TO")) +// leagueTeams.get(i).stats.get(j).setRank(rank.get(i)); +// else +// leagueTeams.get(i).stats.get(j).setRank(l1.nbTeams+1-rank.get(i)); +// } +// } +// } +// return arrVal; +// } +// +// //-------------------------------------------------------------fill team ranks TEST +// public static float[] fillTeamRankTEST(){ +// +// float[] arrVal2 = new float[l1.nbTeams]; +// for (int i = 0; i < l1.nbTeams; i++) { +// //fill total relative pts +// Double tot = 0.0; +// for (int j = 0; j < l1.loopStatsTeam; j++) { +// if(!l1.loadStatBaseTeam.get(j).getName().contains("/")){ +// tot += leagueTeams.get(i).stats.get(j).getRank(); +// } +// } +// leagueTeams.get(i).setTotalrotPtsRel(tot); +// arrVal2.get(i) = (float) leagueTeams.get(i).getTotalrotPtsRel(); +// } +// double[] rank = rankFantasy(arrVal2); +// +// for (int i = 0; i < rank.length; i++) +// System.out.println(""+rank.get(i)); +// +// for (int i = 0; i < l1.nbTeams; i++) { +// leagueTeams.get(i).setRelativeRK(rank.get(i)); +// } +// return arrVal2; +// } + + //-------------------------------------------------------------fill ranks + public static void fillRANK(String type, ArrayList arrStat, ArrayList arrTeam , ArrayList arrPlayer) { + + int nbLoop =0; + if(arrStat!=null) nbLoop = arrStat.size(); + if(arrTeam!=null) nbLoop = arrTeam.size(); + if(arrPlayer!=null) nbLoop = arrPlayer.size(); + + int pts = nbLoop; + + for (int k = 0; k < nbLoop; k++) { + switch (type) { + case "relative":arrStat.get(k).setRank(pts);break; + case "projection":arrStat.get(k).setProjectedRK(pts);break; + case "teamRelative":arrTeam.get(k).setRelativeRK(pts);break; + case "teamProjection":arrTeam.get(k).setProjRK(pts);break; + case "playerINteam":arrPlayer.get(k).setInterRK(pts); + //si le rank du player est plus grand que le nombre de player a compter + if(pts>l1.nbPtoCnt){arrPlayer.get(k).isToCount = false;} + else{arrPlayer.get(k).isToCount = true;} + break; + } + pts -= 1; + } + for (int k = 0; k < nbLoop; k++) { + int nbSameVal = 1; + for (int sameVal = 1; sameVal < nbLoop; sameVal++) + if (k + sameVal < nbLoop) + switch (type) { + case "relative": + if (arrStat.get(k).getValRelative() == arrStat.get(k + sameVal).getValRelative()) + nbSameVal++;break; + case "projection": + if (arrStat.get(k).getValProjection() == arrStat.get(k + sameVal).getValProjection()) + nbSameVal++;break; + case "teamRelative": + if (arrTeam.get(k).getTotalrotPtsRel() == arrTeam.get(k + sameVal).getTotalrotPtsRel()) + nbSameVal++;break; + case "teamProjection": + if (arrTeam.get(k).getProjTot() == arrTeam.get(k + sameVal).getProjTot()) + nbSameVal++;break; + case "playerINteam": + if (arrPlayer.get(k).getInterRK() == arrPlayer.get(k + sameVal).getInterVal()) + nbSameVal++;break; + } + + if (nbSameVal != 1) { + double nbpt = 0.0; + for (int z = 0; z < nbSameVal; z++) { + if (k + z < nbLoop) + switch (type) { + case "relative":nbpt += arrStat.get(k + z).getRank();break; + case "projection":nbpt += arrStat.get(k + z).getProjectedRK();break; + case "teamRelative":nbpt += arrTeam.get(k + z).getRelativeRK();break; + case "teamProjection":nbpt += arrTeam.get(k + z).getProjRK();break; + case "playerINteam":nbpt += arrPlayer.get(k + z).getInterRK();break; + } + } + double newRank = nbpt / nbSameVal; + for (int z = 0; z < nbSameVal; z++) { + if (k + z < nbLoop) + switch (type) { + case "relative":arrStat.get(k + z).setRank(newRank);break; + case "projection":arrStat.get(k + z).setProjectedRK(newRank);break; + case "teamRelative":arrTeam.get(k + z).setRelativeRK(newRank);break; + case "teamProjection":arrTeam.get(k + z).setProjRK(newRank);break; + case "playerINteam":arrPlayer.get(k + z).setInterRK(newRank);break; + } + } + } + } + /* switch (type) { + case "relative":for (int i = 0; i < arrStat.size(); i++)System.out.println(arrStat.get(i).getRank());;break; + case "projection":for (int i = 0; i < arrStat.size(); i++)System.out.println(arrStat.get(i).getProjectedRK());;break; + case "teamRelative":for (int i = 0; i < arrTeam.size(); i++)System.out.println(arrTeam.get(i).getRelativeRK());;break; + case "teamProjection":for (int i = 0; i < arrTeam.size(); i++)System.out.println(arrTeam.get(i).getProjRK());;break; + case "playerINteam":for (int i = 0; i < arrPlayer.size(); i++)System.out.println(arrPlayer.get(i).getInterVal());;break; + }*/ + } + + //-------------------------------------------------------------fill stat ranks + public static void fillStatRank(){ + double pts = l1.nbTeams; + ArrayList arrVal = new ArrayList(); + // go through all stats and all teams + for (int j = 0; j <= l1.loopStatsTeam; j++) { + if(!l1.loadStatBaseTeam.get(j).getName().contains("/")){ + arrVal.clear(); + //---------------add team stats to array + for (int i = 0; i < l1.nbTeams; i++) { + l1.leagueTeams.get(i).stats.get(j).setValToRank(l1.leagueTeams.get(i).stats.get(j).getValRelative()* 10000); + arrVal.add(l1.leagueTeams.get(i).stats.get(j)); + } + //for (int i = 0; i < arrVal.size(); i++) {System.out.println(arrVal.get(i).getName() + "/" + arrVal.get(i).getValRelative());} + if (l1.leagueTeams.get(0).stats.get(j).getName().equals("TO")) { + Collections.sort(arrVal); + } else { + Collections.sort(arrVal, Collections.reverseOrder()); + } + //for (int i = 0; i < arrVal.size(); i++) {System.out.println(arrVal.get(i).getName() + "/" + arrVal.get(i).getValRelative());} + fillRANK("relative",arrVal,null,null); + } + } + } + + //-------------------------------------------------------------------FILL TEAM RANK + public static void fillTeamRank() { + ArrayList arrVal2 = new ArrayList(); + for (int i = 0; i < l1.nbTeams; i++) { + //fill total relative pts + Double tot = 0.0; + for (int j = 0; j <= l1.loopStatsTeam; j++) { + if (!l1.loadStatBaseTeam.get(j).getName().contains("/")) { + tot += l1.leagueTeams.get(i).stats.get(j).getRank(); + } + } + l1.leagueTeams.get(i).setTotalrotPtsRel(tot); + l1.leagueTeams.get(i).setValToRank((float)l1.leagueTeams.get(i).getTotalrotPtsRel()); + arrVal2.add(l1.leagueTeams.get(i)); + } + //for (int i = 0; i < arrVal2.size(); i++)System.out.println(arrVal2.get(i).getTotalrotPtsRel()); + Collections.sort(arrVal2); + //for (int i = 0; i < arrVal2.size(); i++)System.out.println(arrVal2.get(i).getTotalrotPtsRel()); + fillRANK("teamRelative",null,arrVal2,null); + } + + + //--------------------------------------------------FILL PLAYER RANK IN TEAM---need projection & load from db + public static void fillPlayerRKinTeam(Teams team) {//called from btn teamlist + float minP = 100; + //fill % impact difference in stat->valRot + for (Player playerX :team.players) { + if (!playerX.stats.get(0).getStatVal().contains("--")){ + for (int j = 0; j < l1.nbStatsPlayer; j++) { + if (l1.loadStatBasePlayer.get(j).getName().contains("/")) { + String[] decomp = playerX.stats.get(j).getStatVal().split("/"); + //get remaining attempt + float remPlayerAttempt = Float.parseFloat(decomp[1]); + //get % of player + float pourPlayer = Float.parseFloat(playerX.stats.get(j+1).getStatVal()); + //define impact + float remMadePlayer = remPlayerAttempt * pourPlayer; + float pourcTeamProj = Float.parseFloat(team.stats.get(j).getValProjection()); + float pourcDiff = pourPlayer - pourcTeamProj; + float value = pourcDiff * remPlayerAttempt; + playerX.stats.get(j).setValRot(value); // rot used to store %impact + if (value < minP) minP = value; + } + } + } + } + //loop to add min val to all difference and increment total val + float sumVals = 0; + for (Player playerX :team.players) { + if (!playerX.stats.get(0).getStatVal().contains("--")) { + for (int j = 0; j < l1.nbStatsPlayer; j++) { + if (l1.loadStatBasePlayer.get(j).getName().contains("/")) { + playerX.stats.get(j).setValRot(playerX.stats.get(j).getValRot() + minP); // rot used to store %impact + sumVals += playerX.stats.get(j).getValRot() + minP; + } + } + } + } + //loop to set % of impact + for (Player playerX :team.players) { + if (!playerX.stats.get(0).getStatVal().contains("--")) { + for (int j = 0; j < l1.nbStatsPlayer; j++) { + if (l1.loadStatBasePlayer.get(j).getName().contains("/")) { + playerX.stats.get(j).setValRot(playerX.stats.get(j).getValRot() / sumVals); // rot used to store %impact + } + } + } + } + + ArrayList arrVal3 = new ArrayList(); + for (Player playerX :team.players) { + + if (!playerX.stats.get(0).getStatVal().contains("--")) { + //fill impact of player in overall result % + float tot = (float) 0.0; + float totPourc = (float) 0; + //loop until nb stat player + for (int j = 0; j < l1.nbStatsTeam; j++) { + if (!playerX.stats.get(j).getName().contains("/")) { + if (playerX.stats.get(j).getName().contains("%")) { + totPourc = (float) playerX.stats.get(j).getValRot(); + } else {// % equals to remain player / remain team + String teamRemain = team.stats.get(j).getValProjection(); + float valProj = Float.parseFloat(playerX.stats.get(j).getValProjection()); + totPourc = valProj / Float.parseFloat(teamRemain); + } + // end value is a % of project stat PK points + totPourc = (float) team.stats.get(j).getProjectedRK() * totPourc *10; + //ajoute la valeur du stat + playerX.stats.get(j).setValRot(totPourc); + //incremente pour la valeur totale du joueur + tot += totPourc; + } + } + // ajoute valeur au joueur & ajoute le joueur a l'array + playerX.setInterVal(tot); + playerX.setValToRank(playerX.getInterVal()); + arrVal3.add(playerX); + } + } + //for (int i = 0; i < arrVal2.size(); i++)System.out.println(arrVal2.get(i).getTotalrotPtsRel()); + Collections.sort(arrVal3); + //for (int i = 0; i < arrVal2.size(); i++)System.out.println(arrVal2.get(i).getTotalrotPtsRel()); + fillRANK("playerINteam",null,null,arrVal3); + + } + + //--------------------------------------------------FILL PLAYER RANK IN TEAM---no need projection + public static void fillPlayerRKinTeamOWN(Teams team) {//called after import + ArrayList arrVal3 = new ArrayList(); + for (Player playerX :team.players) { + if (!playerX.stats.get(0).getStatVal().contains("--")) { + for(Stat stat : playerX.stats) { + if(stat.getName().equals("%OWN")){ + playerX.setValToRank(Float.parseFloat(stat.getStatVal())); + arrVal3.add(playerX); + } + } + } + } + //for (int i = 0; i < arrVal2.size(); i++)System.out.println(arrVal2.get(i).getTotalrotPtsRel()); + Collections.sort(arrVal3); + //for (int i = 0; i < arrVal2.size(); i++)System.out.println(arrVal2.get(i).getTotalrotPtsRel()); + fillRANK("playerINteam",null,null,arrVal3); + } + + + //---------------------------------------------------------round 2 decimals + public Float roundTwoDecimals(double d) { + DecimalFormat twoDForm = new DecimalFormat("#.##"); + return Float.valueOf(twoDForm.format(d)); + } + + +} + + + diff --git a/src/functions/TRADE_test.java b/src/functions/TRADE_test.java new file mode 100644 index 0000000..17272f8 --- /dev/null +++ b/src/functions/TRADE_test.java @@ -0,0 +1,282 @@ +package functions; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import call_pages.CALL_Fantasy; +import objects.League; +import objects.Player; +import objects.Stat; +import objects.Teams; + +/** + * Created by LeJay on 22.02.2017. + */ + +public class TRADE_test extends CALL_Fantasy { + + private static final long serialVersionUID = 1L; + public static ArrayList> mainTRADE = new ArrayList<>(); + public static double maxPts = 0.0; + public static double maxRK = 0.0; + public static int sortKey; + int nbPlay = 0; + + public static ArrayList> SetTrade(Teams team1,Teams team2){ + + int nbt1PSelected = 0; + int nbt2PSelected = 0; + mainTRADE = new ArrayList<>(); + team1.setInTrade(true); + team2.setInTrade(true); + + // test si joueur joueur séléctioné dans équipe + for (Player playerX : team1.players) { + if(playerX.inTrade && playerX.teamID == team1.getID()){ + nbt1PSelected +=1; + } + } + for (Player playerX : team2.players) { + if(playerX.inTrade && playerX.teamID == team2.getID()){ + nbt2PSelected +=1; + } + } + + // si joueur selectionne dans les 2 equipes + if (nbt1PSelected>0 && nbt2PSelected>0) { + mainTRADE.add(Execute(team1, team2,true)); + // si joueur selectionne seulement dans team 1 -> teste toute les combi de T2 + }else if (nbt1PSelected>0){ + recursiveOtherT(0,0,nbt1PSelected,team1,team2,false,true); + // si joueur selectionne seulement dand team 2-> teste toute les combi de T1 + }else if (nbt2PSelected>0){ + recursiveOtherT(0,0,nbt2PSelected,team2,team1,true,true); + // si aucun joueur selectionné teste toutes les combi entre les 2 joueurs + }else { + + for (Player playerX : team1.players) { + if(playerX.teamID == team1.getID()){ + nbt1PSelected +=1; + } + } + //---false ne compte pas les resultats negatif + for (int x=nbt1PSelected-1;x>nbt1PSelected-3;x--) { + recursiveTeam(0,0,nbt1PSelected-x,team1,team2, false); + } + +/* if(mainTRADE.size()<5) { + for (int x=nbt1PSelected-1;x>nbt1PSelected-3;x--) { + recursiveTeam(0,0,nbt1PSelected-x,team1,team2, true); + } + }*/ + + } + + sortKey = l1.loopStatsTeam + 6; + Collections.sort(mainTRADE, new ListOfStatComparator()); + sortKey = l1.loopStatsTeam + 2; + Collections.sort(mainTRADE, new ListOfStatComparator()); + sortKey = l1.loopStatsTeam + 3; + Collections.sort(mainTRADE, new ListOfStatComparator()); + Collections.reverse(mainTRADE); + + for(int x = 0 ; x200) { + mainTRADE.remove(x); + } + } + + //reset projection + PROJ_analysis.calculate(); + team1.setInTrade(false); + team2.setInTrade(false); + + return mainTRADE; + } + + public static void recursiveOtherT(int boucleID, int playerStart , int nbt1PSelected, Teams team1, Teams team2, boolean inversed , boolean countNeg) { + + if (boucleID < nbt1PSelected) { + for (int x = playerStart; x < team2.players.size();x++) { + if(team2.players.get(x).getOrgTeamID() == team2.getID()) { + team2.players.get(x).setInTrade(true); + //team2.players.get(x).setteamID(team1.getCode()); + if (boucleID==nbt1PSelected-1) { + if(inversed) { + ArrayList tst = Execute(team2,team1, countNeg); + if(tst != null) { + mainTRADE.add(tst); + } + }else { + ArrayList tst = Execute(team1,team2, countNeg); + if(tst != null) { + mainTRADE.add(tst); + } + } + }else { + recursiveOtherT(boucleID+1,x+1,nbt1PSelected,team1,team2, inversed , countNeg); + } + //team2.players.get(x).setteamID(team2.getCode()); + team2.players.get(x).setInTrade(false); + } + } + } + } + + public static void recursiveTeam(int boucleID,int playerStart, int nbt1PSelected, Teams team1, Teams team2, boolean countNeg) { + if (boucleID < nbt1PSelected) { + for (int x = playerStart; x < team1.players.size();x++) { + if(team1.players.get(x).getOrgTeamID() == team1.getID()) { + team1.players.get(x).setInTrade(true); + //team1.players.get(x).setteamID(team2.getCode()); + if (boucleID==nbt1PSelected-1) { + recursiveOtherT(0,0,nbt1PSelected,team1,team2,false, countNeg); + }else { + recursiveTeam(boucleID+1,x+1,nbt1PSelected,team1,team2, countNeg); + } + //team1.players.get(x).setteamID(team1.getCode()); + team1.players.get(x).setInTrade(false); + } + } + } + } + //----executre le calcul du trade en fonction des joueurs "inTrade" de chaque équipe---- + public static ArrayList Execute(Teams team1,Teams team2,boolean countNeg){ + + String p1Trade=""; + String p2Trade=""; + final DecimalFormat f = new DecimalFormat("0.#"); + final DecimalFormat in = new DecimalFormat("0.##"); + + //change le team code des joueurs de la team 1 + for (Player playerT1 : team1.players) { + if (playerT1.inTrade && playerT1.getOrgTeamID() == team1.getID()){ // && playerT1.getteamID() == team1.getCode() + playerT1.teamID = team2.getID(); + p1Trade += playerT1.getnom() + " / "; + } + } + + //change le team code des joueurs de la team 2 + for (Player playerT2 : team2.players) { + if (playerT2.inTrade && playerT2.getOrgTeamID() == team2.getID()){ // && playerT2.getteamID() == team2.getCode() + playerT2.teamID = team1.getID(); + p2Trade += playerT2.getnom() + " / "; + } + } + + //-----------calcule la nouvelle projection + PROJ_analysis.calculate(); + + // RK-P + //enregistre l'impact sur chaque stats (ranking et valeur) + classement -------------------- P1 + ArrayList subFA = new ArrayList(); + Stat valGeneral = new Stat("RK-P"); + valGeneral.setPlayer(p1Trade); + //nom joueur droppé in team name of stat + valGeneral.setTeam(p2Trade); + valGeneral.setProjectedRK(team1.getProjRK()); + valGeneral.setValProjection(f.format(team1.getProjTot())); + valGeneral.setValToRank(Float.parseFloat(valGeneral.getValProjection())); + subFA.add(valGeneral); + //----------------------------loop all stats + //add projection results for each stat category + for (int j = 0; j < l1.loopStatsTeam; j++) { + Stat valStats = new Stat(l1.loadStatBaseTeam.get(j).getName()); + valStats.setProjectedRK(team1.stats.get(j).getProjectedRK()); + valStats.setValProjection(team1.stats.get(j).getValProjection()); + subFA.add(valStats); + } + + //-----------------------CREATE IMPACT COLUMS----------------------------------- + Stat valImpactR = new Stat("IMP"); // RK D + valImpactR.setValProjection(f.format(team1.getProjRKX()-team1.getProjRK())); + subFA.add(valImpactR); + Stat valImpactP = new Stat("IMP"); //PT D + valImpactP.setValProjection(f.format(team1.getProjTot()-team1.getProjTotX())); + subFA.add(valImpactP); + + Stat valImpactR12 = new Stat("IMP"); // TOT R + valImpactR12.setValProjection(f.format(team1.getProjRKX()-team1.getProjRK() + team2.getProjRKX()-team2.getProjRK())); // valRot used to store totals diff + subFA.add(valImpactR12); + + Stat valImpactP12 = new Stat("IMP"); //TOT P + valImpactP12.setValProjection(f.format(team1.getProjTot()-team1.getProjTotX() + team2.getProjTot()-team2.getProjTotX())); // valRot used to store totals diff + subFA.add(valImpactP12); + + Stat valImpactR2 = new Stat("IMP"); // RK D + valImpactR2.setValProjection(f.format(team2.getProjRKX()-team2.getProjRK())); + subFA.add(valImpactR2); + + Stat valImpactP2 = new Stat("IMP"); // PT D + valImpactP2.setValProjection(f.format(team2.getProjTot()-team2.getProjTotX())); + subFA.add(valImpactP2); + + //enregistre l'impact sur chaque stats (ranking et valeur) + classement --------------------- P2 + valGeneral = new Stat("RK-P"); + valGeneral.setPlayer(p2Trade); + //nom joueur droppé in team name of stat + valGeneral.setTeam(p1Trade); + valGeneral.setProjectedRK(team2.getProjRK()); + valGeneral.setValProjection(f.format(team2.getProjTot())); + valGeneral.setValToRank(Float.parseFloat(valGeneral.getValProjection())); + subFA.add(valGeneral); + + //----------------------------loop all stats + //add projection results for each stat category + for (int j = 1; j < l1.loopStatsTeam+1; j++) { + Stat valStats = new Stat(l1.loadStatBaseTeam.get(j - 1).getName()); + valStats.setProjectedRK(team2.stats.get(j - 1).getProjectedRK()); + valStats.setValProjection(team2.stats.get(j - 1).getValProjection()); + subFA.add(valStats); + } + //--------------------------------------------------------------------------loop all other teams + //add impact on other players ranking + for (Teams teamX : l1.leagueTeams) { + if (!teamX.getName().equals(team1.getName()) && !teamX.getName().equals(team2.getName())) { + Stat impacts = new Stat(teamX.getSurn()); + impacts.setProjectedRK(teamX.getProjRK()); + impacts.setValProjection(f.format(teamX.getProjTot())); + subFA.add(impacts); + } + } + + //redefini le bon id de team + for (int i = 0;i> { + + @Override + public int compare(ArrayList < Stat > o1, ArrayList < Stat > o2) { + // do other error checks here as well... such as null. outofbounds, etc + return new Float(o1.get(sortKey).getValProjection()).compareTo(new Float(o2.get(sortKey).getValProjection())); + } + + } + +} diff --git a/src/jsoupImport/ImportLineups.java b/src/jsoupImport/ImportLineups.java new file mode 100644 index 0000000..e15622f --- /dev/null +++ b/src/jsoupImport/ImportLineups.java @@ -0,0 +1,280 @@ +package jsoupImport; + +import java.util.concurrent.Future; + +import javax.servlet.RequestDispatcher; + +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import call_pages.CALL_Fantasy; +import functions.GRAPH_rebuild; +import functions.MySQLAccess; +import functions.PROJ_analysis; +import objects.League; +import objects.Player; +import objects.Slot; +import objects.Stat; +import objects.Teams; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +/** * Created by LeJay on 19.02.2017. */ + +public class ImportLineups extends CALL_Fantasy { + + public ImportLineups() { + + //new Thread(new Runnable() { + // public void run() { + + Document doc; + + try { + + driver.get("http://fantasy.espn.com/basketball/team?leagueId=" + l1.getCode() + + "&teamId=" + l1.leagueTeams.get(1).getID());// + "&seasonId=" + l1.getSeason() + + //"&scoringPeriodId=" + l1.getNbDaysPlayed() + "&statSplit=singleScoringPeriodn"); + + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@class='jsx-2810852873 table--cell opp ml4']")));// instead of id u can use cssSelector or xpat + String content = driver.getPageSource(); + + doc = Jsoup.parse(content); + + //select player name table + Element tablePlayer = doc.select("table.Table2__right-aligned.Table2__table-fixed.Table2__Table--fixed--left.Table2__table").get(0); //select the first table. + Elements rowsPlayer = tablePlayer.select("tr"); + Element rowPlayer; + Elements colsPlayer; + + //select stat table + Element tableStat = doc.select("table.Table2__table-scroller.Table2__right-aligned.Table2__table").get(0); //select the first table. + Elements rowsStat = tableStat.select("tr"); + Element rowStat; + Elements colsStat; + + + + rowStat = rowsStat.select("tr.Table2__header-row.Table2__tr.Table2__even").get(1); + colsStat = rowStat.select("th"); + //----------create stats list from first line 0 + int nbStat = 0; + Stat[] loadStatBase = new Stat[colsStat.size()]; + for (int k = 1; k < colsStat.size()-3; k++) { // 6 is col FGM + + if (!colsStat.get(k).text().replaceAll("\\s","").equals("")){ + loadStatBase[nbStat] = new Stat(colsStat.get(k).text().replaceAll("\\s", "")); + nbStat += 1; + } + String test = colsStat.get(k).text().replaceAll("\\s",""); + if(colsStat.get(k).text().replaceAll("\\s","").equals("+/-")){ + break ; + }; + } + + for (int t = 0; t < l1.nbTeams; t++) { + + + + for (int periode = 0 ; periode < l1.getNbDaysPlayed(); periode++) { + + //test si record n'existe pas déjà dans la DB pour cette equipe et ce jour + int test5 = dao.dayRecorded(l1.leagueTeams.get(t),periode); + int test6 = dao.dayRecorded(l1.leagueTeams.get(t),periode+1); + int test7 = dao.dayRecorded(l1.leagueTeams.get(t),periode+2); + int test8 = dao.dayRecorded(l1.leagueTeams.get(t),periode+7); + + //si le nombre de record est bien un multiple du nombre de stats + if( (((test5==0) && (test6==0) && (test7==0) && (test8==0)) || test5%nbStat > 0) ) {//need to skip empty days + + //efface les records présent s'il n'était pas complet + if(test5%nbStat > 0 )dao.delStat(l1.leagueTeams.get(t),periode); + + int periodeF = periode+1; + + driver.get("http://fantasy.espn.com/basketball/team?leagueId=" + l1.getCode() + + "&teamId=" + l1.leagueTeams.get(t).getID() + "&statSplit=singleScoringPeriod&scoringPeriodId=" + periodeF); + + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@class='jsx-2810852873 table--cell opp ml4']")));// instead of id u can use cssSelector or xpat + + content = driver.getPageSource(); + + doc = Jsoup.parse(content); + + //select player name table + tablePlayer = doc.select("table.Table2__right-aligned.Table2__table-fixed.Table2__Table--fixed--left.Table2__table").get(0); //select the first table. + rowsPlayer = tablePlayer.select("tr"); + + + + //select stat table + tableStat = doc.select("table.Table2__table-scroller.Table2__right-aligned.Table2__table").get(0); //select the first table. + rowsStat = tableStat.select("tr"); + + + + int nbSlot = 0; + // go through SLOT list------------Slot LOOP-------- + for (int i = 2; i < rowsPlayer.size(); i++) { //first rows + + rowPlayer = rowsPlayer.get(i); + colsPlayer = rowPlayer.select("td"); + + rowStat = rowsStat.get(i); + colsStat = rowStat.select("td"); + + if (!colsPlayer.get(0).text().equals("SLOT") && !colsPlayer.get(0).text().equals("Bench") && //take out bench for + colsPlayer.get(1).text().length() > 6 && !colsStat.get(6).text().equals("--") && !colsStat.get(0).text().equals("0")) { + + + String word = colsPlayer.select("a.link.clr-link.pointer").get(0).text().replace("*", ""); + + //create player + + l1.leagueTeams.get(t).slots[nbSlot].players[periode] = new Player(word); + l1.leagueTeams.get(t).slots[nbSlot].players[periode].setteamID(l1.leagueTeams.get(t).getID()); + + + //--------------Add DAILY Stats to player + + //-----------------------------------------------Create a copy of Stat list + ArrayList loadStat = new ArrayList(); + + nbStat = 0; + for (int k = 1; k < colsStat.size() - 3; k++) { //first row is the col names so skip it. + + //System.out.println(cols.get(k).text()); + + if (!colsStat.get(k).text().replaceAll("\\s", "").equals("")) { + loadStat.add(new Stat(loadStatBase[nbStat].getName())); + loadStat.get(nbStat).setStatVal(colsStat.get(k).text()); + loadStat.get(nbStat).setSlot(colsPlayer.get(0).text()); + loadStat.get(nbStat).setPeriod(periode); + loadStat.get(nbStat).setSlotID(i-2); + //enregistre le stat dans la database + dao.addStat(loadStat.get(nbStat), l1.leagueTeams.get(t).slots[nbSlot].players[periode], l1.leagueTeams.get(t).getID()); + //System.out.println(loadStatBase[nbStat].getName() + " ----- " +colsStat.get(k).text()); + nbStat += 1; + } + + if(nbStat > l1.loadStatBasePlayer.size()){break;}; + } + + //ajoute les stats au joueur ajouté au slot + l1.leagueTeams.get(t).slots[nbSlot].players[periode].setStats(loadStat); + + String log = periode + "--->" + colsPlayer.get(1).text(); + for (int k = 1; k < colsStat.size()-3; k++) { + log += "/" + colsStat.get(k).text(); + } + System.out.println(log); + } + + nbSlot += 1; + + } + + }else{ + // --------------------LOAD DATA from DB + List records = dao.getStatList(l1.leagueTeams.get(t),periode); + + // go through record list------------record LOOP-------- + for (int i = 0; i < records.size(); i+=nbStat) { //first rows + + //----Get Record list from the DB ------ recréer et affecte un stat + ArrayList loadStats = new ArrayList(); //set stat name + for (int s = 0; s < nbStat; s++) { + loadStats.add(records.get(i+s)); + } + + int slotID = records.get(i).getSlotID(); + + try { + + //add player in period list & attach stats + l1.leagueTeams.get(t).slots[slotID].players[periode] = new Player(records.get(i).getPlayer()); //set Nom + l1.leagueTeams.get(t).slots[slotID].setNomPos(records.get(i).getSlot()); + l1.leagueTeams.get(t).slots[slotID].setSlotID(slotID); + l1.leagueTeams.get(t).slots[slotID].players[periode].setStats(loadStats); + + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } + + } + System.out.println("loaded stat" ); + if(l1.leagueTeams.get(t).getName().equals("La Tour LeJay")){ + int odi = 1; + odi+=1; + }; + + } + + }//end loop periode + }//end loop team + + + for (int t = 0; t < l1.nbTeams; t++) { + // fill TOTAL ATTEMPT / MADE for FG & FT --------- need to come from importLineUps + //loop team stats fill only composed stats + for (Stat statTeamX : l1.leagueTeams.get(t).stats) { + if (statTeamX != null) + if (statTeamX.getName().contains("/")) { + float totStat1 = 0; + float totStat2 = 0; + //loop slots + for (Slot slotX : l1.leagueTeams.get(t).slots) { + if (slotX != null) + //Do not count players aligned on the bench + if (!slotX.getNomPos().contains("Bench") && slotX.players != null) //&& slotX.players != null + //loop slot players + + for (Player playerX : slotX.players) + if (playerX != null) { + //loop stats + for (Stat statX : playerX.stats) + //focus on actual team stat to fill (loop1) + if (statX.getName().equals(statTeamX.getName())) { + String[] decomp = statX.getStatVal().split("/"); + float valStat1 = Float.parseFloat(decomp[0]); + float valStat2 = Float.parseFloat(decomp[1]); + totStat1 += valStat1; + totStat2 += valStat2; + } + } + }//for slots + String valStatSeason = totStat1 + "/" + totStat2; + statTeamX.setValSeason(valStatSeason); + }//if stat / + }//for team stat + }//for team + + + //new PROJ_analysis().calculate(); + + + + } catch (IOException e) { + e.printStackTrace(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // } + //}).start(); + } +} + diff --git a/src/jsoupImport/ImportPlayerStats.java b/src/jsoupImport/ImportPlayerStats.java new file mode 100644 index 0000000..a446e1c --- /dev/null +++ b/src/jsoupImport/ImportPlayerStats.java @@ -0,0 +1,161 @@ +package jsoupImport; + + + + +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import call_pages.CALL_Fantasy; +import objects.League; +import objects.Player; +import objects.Stat; +import objects.Teams; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; + +/** + * Created by LeJay on 19.02.2017. + */ + +public class ImportPlayerStats extends CALL_Fantasy { //called from btn of selected team in Fragment team + + public ImportPlayerStats() throws IOException { + + if(l1.leaguePlayers.size() <= l1.leagueTeams.size()*15) { + + ArrayList players = new ArrayList(); + + String title; + Document doc; + int nbStat; + + driver.get("http://fantasy.espn.com/basketball/players/add?leagueId=" + l1.getCode() ); + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//tr[@class='Table2__tr Table2__tr--lg Table2__odd']")));// instead of id u can use cssSelector or xpath of ur element. + String content = driver.getPageSource(); + + //-----create stats list from first line 0 + doc = Jsoup.parse(content); + + // add all player com.example.lejay.fantasy.objects + int nbPlayer = 0; + //for (int z = 0; z < 400; z+=50) { + + //http://fantasy.espn.com/basketball/league/standings?leagueId=209346 + //http://fantasy.espn.com/basketball/players/add?leagueId=209346 + + //tst = "http://fantasy.espn.com/basketball/players/add?leagueId=" + l1.getCode() + + // "&seasonId="+ l1.getSeason() +"&context=freeagency&view=stats&version=currSeason&startIndex=" + z; + + //doc = Jsoup.connect("http://games.espn.com/fba/freeagency?leagueId=" + l1.getCode() + + // "&seasonId="+ l1.getSeason() +"&context=freeagency&view=stats&version=currSeason&startIndex=" + z).get(); + + //select player name table + Element tablePlayer = doc.select("table.Table2__right-aligned.Table2__table-fixed.Table2__Table--fixed--left.Table2__table").get(0); //select the first table. + Elements rowsPlayer = tablePlayer.select("tr"); + Element rowPlayer; + Elements colsPlayer; + + //select stat table + Element tableStat = doc.select("table.Table2__table-scroller.Table2__right-aligned.Table2__table").get(0); //select the first table. + Elements rowsStat = tableStat.select("tr"); + Element rowStat; + Elements colsStat; + + if (l1.loadStatBasePlayer.size()==0){ + //'-------------create and fill Stats name' + + rowStat = doc.select("tr.Table2__header-row.Table2__tr.Table2__even").get(3); + colsStat = rowStat.select("th"); + for (int k = 1; k < colsStat.size()-1; k++) { + l1.loadStatBasePlayer.add(new Stat(colsStat.get(k).text())); + } + l1.setNbStatsPlayer(l1.loadStatBasePlayer.size()); + } + + // get page title + title = doc.title(); + System.out.println("title : " + title); + + // go through players list + for (int i = 2; i < rowsPlayer.size(); i++) { //first row is the col names so skip it. + + rowPlayer = rowsPlayer.get(i); + colsPlayer = rowPlayer.select("td"); + + rowStat = rowsStat.get(i); + colsStat = rowStat.select("td"); + + String log = ""; + + + // le nom + String word = colsPlayer.select("a.link.clr-link.pointer").get(0).text(); + String nomFranchise = colsPlayer.select("span.playerinfo__playerteam").get(0).text(); + String[] positions = colsPlayer.select("span.playerinfo__playerpos.ttu").get(0).text().split(", "); + + //create player + l1.leaguePlayers.add(new Player(word)); + nbPlayer = l1.leaguePlayers.size()-1; + + l1.leaguePlayers.get(nbPlayer).setPositions(positions); + l1.leaguePlayers.get(nbPlayer).setFranchise(nomFranchise); + + + /*if(cols.get(2).text().substring(0,2).equals("WA")){ + l1.leaguePlayers.get(nbPlayer).setIsFA(true); + l1.leaguePlayers.get(nbPlayer).isToCount = true; + } + else{players.get(nbPlayer).setIsFA(false);}*/ + + + //-----------------------------------------------Create a copy of Stat list + ArrayList loadStat = new ArrayList(); + + nbStat = 0; + for (int k = 1; k < colsStat.size()-3; k++) { //first row is the col names so skip it. + if (!colsStat.get(k).text().replaceAll("\\s","").equals("")) { + loadStat.add(new Stat(l1.loadStatBasePlayer.get(nbStat).getName())); + loadStat.get(nbStat).setStatVal(colsStat.get(k).text()); + nbStat += 1; + } + if(nbStat > l1.loadStatBasePlayer.size()){break;}; + } + + //ajoute les stats au joueur apres l avoir créé + l1.leaguePlayers.get(nbPlayer).setStats(loadStat); + + nbPlayer+=1; + + for (int k = 0; k < colsStat.size(); k++) { + log += "/" + colsStat.get(k).text(); + } + System.out.println(log); + } + + System.out.println("yo"); + + + } +/* @Override + protected void onPostExecute(Void result) { + // Set title into TextView + //TextView txttitle = (TextView) findViewById(R.id.titletxt); + //txttitle.setText(title); + + FragmentPlayers.btn_tstFA.setEnabled(true); + +// mProgressDialog.dismiss(); + }*/ + + } +} + diff --git a/src/jsoupImport/ImportPlayers.java b/src/jsoupImport/ImportPlayers.java new file mode 100644 index 0000000..4e14fc8 --- /dev/null +++ b/src/jsoupImport/ImportPlayers.java @@ -0,0 +1,161 @@ +package jsoupImport; + +import functions.*; +import objects.Player; +import objects.Stat; + +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import call_pages.CALL_Fantasy; + +import java.io.IOException; +import java.util.ArrayList; + +/** + * Created by LeJay on 19.02.2017. + */ + +public class ImportPlayers extends CALL_Fantasy {//called from MainActivity + + public ImportPlayers() { + + //new Thread(new Runnable() { + // public void run() { + + String title; + int nbStat; + + //dbHandler = new DB_handler(context); //need to be in async + + Document doc; + for (int t = 0; t < l1.nbTeams; t++) { + + //create list of player + l1.leagueTeams.get(t).players = new ArrayList(); + + driver.get("http://fantasy.espn.com/basketball/team?leagueId=" + l1.getCode() + + "&teamId=" + l1.leagueTeams.get(t).getID() + "&statSplit=currSeason");// + "&seasonId=" + l1.getSeason() + + //"&scoringPeriodId=" + l1.getNbDaysPlayed() + "&statSplit=singleScoringPeriodn"); + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@class='jsx-2810852873 table--cell opp ml4']")));// instead of id u can use cssSelector or xpat + String content = driver.getPageSource(); + + doc = Jsoup.parse(content); + + // get page title + title = doc.title(); + System.out.println("title : " + title); + + //select player name table + Element tablePlayer = doc.select("table.Table2__right-aligned.Table2__table-fixed.Table2__Table--fixed--left.Table2__table").get(0); //select the first table. + Elements rowsPlayer = tablePlayer.select("tr"); + Element rowPlayer; + Elements colsPlayer; + + //select stat table + Element tableStat = doc.select("table.Table2__table-scroller.Table2__right-aligned.Table2__table").get(0); //select the first table. + Elements rowsStat = tableStat.select("tr"); + Element rowStat; + Elements colsStat; + + int nbPlayer = 0; + // go through players list + for (int i = 2; i < rowsPlayer.size(); i++) { //first row is the col names so skip it. + + rowPlayer = rowsPlayer.get(i); + colsPlayer = rowPlayer.select("td"); + + rowStat = rowsStat.get(i); + colsStat = rowStat.select("td"); + + String log = ""; + +// System.out.println(cols.get(0).text()); +// for (int k = 0; k < cols.size(); k++) { +// log += "/" + cols.get(k).text(); +// } +// System.out.println(log); + + if (!colsPlayer.get(1).text().equals("Empty") && !colsPlayer.get(1).text().equals("")) { + + + // le nom + String word = colsPlayer.select("a.link.clr-link.pointer").get(0).text(); + String nomFranchise = colsPlayer.select("span.playerinfo__playerteam").get(0).text(); + String[] positions = colsPlayer.select("span.playerinfo__playerpos.ttu").get(0).text().split(", "); + + l1.leagueTeams.get(t).players.add(new Player(word)); + + int tt = l1.leagueTeams.get(t).players.size(); + Player player = l1.leagueTeams.get(t).players.get(tt-1); + player.setPositions(positions); + player.setFranchise(nomFranchise); + + //-----------------------------------------------Create a copy of Stat list + ArrayList loadStat = new ArrayList(); + nbStat = 0; + int nbSpace=0; + for (int k = 1; k < colsStat.size()-1; k++) { //first row is the col names so skip it. + System.out.println(colsStat.get(k).text()); + if (!colsStat.get(k).text().replaceAll("\\s","").equals("")) { + loadStat.add(new Stat(l1.loadStatBasePlayer.get(nbStat-nbSpace).getName())); + loadStat.get(nbStat-nbSpace).setStatVal(colsStat.get(k-nbSpace).text()); + }else{ + nbSpace++; + } + nbStat += 1; + + if(nbStat > l1.loadStatBasePlayer.size()){break;}; + } + //ajoute les stats au joueur apres l avoir créé + player.setStats(loadStat); + player.setIsFA(false); + player.teamID = l1.leagueTeams.get(t).getID(); + player.setOrgTeamID(l1.leagueTeams.get(t).getID()); + + l1.leaguePlayers.add(player); + + nbPlayer += 1; + + } + + } + + System.out.println("yo"); + + RANKS_fill.fillPlayerRKinTeamOWN(l1.leagueTeams.get(t)); + + }//end loop team + + + + + } + + /*@Override + protected void onPostExecute(Void result) { + + SHOW_tab.printTeams(); + + //projection need actual total attempt / made just calculated + btn_Proj.setEnabled(true); + + // Fragment f = getFragmentManager().findFragmentById(R.id.frag_teams); + // if(f != null){ + // for(Teams teams : l1.leagueTeams){ + // FragmentTeams.btn_teams[teams.getCode()].setEnabled(true); + // } + // } + + PROJ_analysis.calculate(); + + //mProgressDialog.dismiss(); + }*/ + // }).start(); + //} +} diff --git a/src/jsoupImport/ImportTeams.java b/src/jsoupImport/ImportTeams.java new file mode 100644 index 0000000..8256278 --- /dev/null +++ b/src/jsoupImport/ImportTeams.java @@ -0,0 +1,429 @@ +package jsoupImport; + +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.remote.DesiredCapabilities; +import org.openqa.selenium.WebElement; + +import org.openqa.selenium.support.ui.ExpectedCondition; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +import com.ibm.icu.text.SimpleDateFormat; + +import call_content.GRAPH_CALL; +import call_pages.CALL_Fantasy; + +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; + +import javax.servlet.http.HttpServletResponse; +import javax.swing.JOptionPane; + +import functions.GRAPH_init; +import functions.GRAPH_rebuild; +import functions.MySQLAccess; +import functions.RANKS_fill; +import io.webfolder.ui4j.api.browser.BrowserEngine; +import io.webfolder.ui4j.api.browser.BrowserFactory; +import io.webfolder.ui4j.api.browser.Page; +import objects.League; +import objects.Slot; +import objects.Stat; +import objects.Teams; + +public class ImportTeams extends CALL_Fantasy { + + + public ImportTeams() throws Exception { + + + driver.get("http://fantasy.espn.com/basketball/league/standings?leagueId=" + l1.getCode()); + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("disneyid-iframe")));// instead of id u can use cssSelector or xpath of ur element. + driver.switchTo().frame(driver.findElement(By.id("disneyid-iframe"))); + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//input[@type='email']")));// instead of id u can use cssSelector or xpath of ur element. + WebElement element = driver.findElement(By.xpath("//input[@type='email']")); + element.sendKeys("jeremie07@gmail.com"); + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//input[@type='password']")));// instead of id u can use cssSelector or xpath of ur element. + element = driver.findElement(By.xpath("//input[@type='password']")); + element.sendKeys("1800vevey"); + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[@class='btn btn-primary btn-submit ng-isolate-scope']")));// instead of id u can use cssSelector or xpath of ur element. + element = driver.findElement(By.cssSelector("button[class='btn btn-primary btn-submit ng-isolate-scope']")); + element.click(); + + driver.switchTo().defaultContent(); + + wait.until(ExpectedConditions.elementToBeClickable(By.className("dropdown__select")));// instead of id u can use cssSelector or xpath of ur element. + String content = driver.getPageSource(); + + Elements colsStatName; + Document doc; + String title; + ArrayList leagueTeams = new ArrayList(); + try { + + // connect to STANDINGS + //doc = Jsoup.connect("http://fantasy.espn.com/basketball/league/standings?leagueId=" + l1.getCode()).get(); + + + + + doc = Jsoup.parse(content); + String leagueName = doc.select("h3").get(0).text().replace("Standings", ""); + + l1.setName(leagueName); + + + //----------------------GET TEAMS ID------------------ + Elements links = doc.select("a[class]"); + + int nbTeam = 0; + String nomTeam = ""; + String nomJoueur =""; + String surn = ""; + for (Element link : links) { + + if (link.attr("class").contains("NavMain__SubNav__Link") && link.attr("href").contains("fromTeamId=")) { + + String test = link.select("span.sub").text(); + + if(test.equals(l1.getName())) { + String find[] = link.attr("href").split("fromTeamId="); + int teamID = Integer.parseInt(find[1]); + nomTeam = link.select("span.NavMain__Text").text().replace(" " + l1.getName(), ""); + + leagueTeams.add(new Teams(nomTeam, nbTeam)); + leagueTeams.get(nbTeam).setNomJoueur(nomTeam); + leagueTeams.get(nbTeam).setID(teamID); + + nbTeam += 1; + } + + + }else if (link.attr("class").contains("NavMain__SubNav__Link") && link.attr("href").contains("teamId=") && !link.attr("href").contains("fromTeamId=")) { + + String find[] = link.attr("href").split("teamId="); + int teamID = Integer.parseInt(find[1]); + + nomTeam = link.select("span.NavMain__Text").text(); + String find2[] = nomTeam.split(Pattern.quote("(")); + String find3[] = find2[1].split(Pattern.quote(")")); + surn = find3[0]; + nomTeam = find2[0].substring(0, find2[0].length() -1); + + nomJoueur = link.select("span.owner-name").text(); + + leagueTeams.add(new Teams(nomTeam, nbTeam)); + leagueTeams.get(nbTeam).setNomJoueur(nomJoueur); + leagueTeams.get(nbTeam).setID(teamID); + leagueTeams.get(nbTeam).setSurn(surn); + + // + + nbTeam += 1; + + } + + } + + + + // -----------------SCAN league and add teams stats---------> + title = doc.title(); + System.out.println("title : " + title); + + Element table = doc.select("table").get(2); //select the first table. + System.out.println("table : " + table); + Elements rows = table.select("tr"); + Element row = rows.get(0); + Elements cols = row.select("td"); + + + + //'-------------create and fill Stats name' + Element startRow = rows.get(2); + colsStatName = startRow.select("span"); + + row = rows.get(2); + cols = row.select("span"); + int nbPourcent =0; + for (int k = 0; k < cols.size() + nbPourcent; k++) { + l1.loadStatBaseTeam.add(new Stat(cols.get(k-nbPourcent).text())); + if(cols.get(k-nbPourcent).text().contains("%")){ + nbPourcent +=1; + k+=1; + String nomStat = cols.get(k-nbPourcent).text().replace("%",""); + l1.loadStatBaseTeam.add(new Stat(nomStat + "M/"+ nomStat+"A")); + } + l1.setLoopStatsTeam(k); + } + l1.setNbStatsTeam(l1.loopStatsTeam-nbPourcent); + + + table = doc.select("table").get(1); //select the first table. + rows = table.select("tr"); + + + // --------------------go through charts rows + for (int i = 2; i <= rows.size()-2 ; i++) { //first row is the col names so skip it. + + // go through team table + table = doc.select("table").get(1); //select the first table. + rows = table.select("tr"); + row = rows.get(i); + cols = row.select("td"); + + System.out.println("team : " + cols.get(1)); + + nomTeam = cols.get(1).text(); + + for(Teams team : leagueTeams) { + if (team.getName().equals(nomTeam)) { + nbTeam = team.getCode(); + break; + } + } + + leagueTeams.get(nbTeam).setRK(Double.parseDouble(cols.get(0).text())); + + // go through stats table + table = doc.select("table").get(2); //select the first table. + rows = table.select("tr"); + row = rows.get(i+1); + cols = row.select("td"); + + //Create a copy of Stat list + ArrayList loadStat = new ArrayList(); + + double totalPoints = 0.0; + //parcours les colonnes contenant les valeurs---- Create stat + for (int k = 0; k < cols.size(); k++) { + + for (int b = 0; b <= l1.loopStatsTeam; b++) { + //skip les 2 stats de pourcentage splitté---décalage de 2 col entre ligne stat et ligne valeur + if(l1.loadStatBaseTeam.get(b).getName().equals(colsStatName.get(k).text())){ + + //System.out.println(l1.loadStatBaseTeam.get(b).getName()); + + loadStat.add(new Stat(l1.loadStatBaseTeam.get(b).getName())); + loadStat.get(b).setValRot(Double.parseDouble(cols.get(k).text())); + totalPoints += loadStat.get(b).getValRot() ; + loadStat.get(b).setTeam(nomTeam); + //create stat MADE / ATTEMPT + if(loadStat.get(b).getName().contains("%")){ + loadStat.add(new Stat(l1.loadStatBaseTeam.get(b+1).getName())); + loadStat.get(b+1).setTeam(nomTeam); + + } + + } + } + + } + + + //associate stats with created team + leagueTeams.get(nbTeam).setStats(loadStat); + leagueTeams.get(nbTeam).setTotalrotPts(totalPoints); + + + } + + l1.setNbTeams(Teams.getNumOfInstances()); + + + //-----------------go through season total chart + for (int i = 2; i <= rows.size()-1 ; i++) { //first row is the col names so skip it. + + // go through team table + table = doc.select("table").get(1); //select the first table. + rows = table.select("tr"); + row = rows.get(i); + cols = row.select("td"); + + System.out.println("team : " + cols.get(1)); + + nomTeam = cols.get(1).text(); + + for(Teams team : leagueTeams) { + if (team.getName().equals(nomTeam)) { + nbTeam = team.getCode(); + break; + } + } + + table = doc.select("table").get(9); //select the first table. + rows = table.select("tr"); + row = rows.get(i); + cols = row.select("td"); + int nbGames = Integer.parseInt(cols.get(0).text()); + leagueTeams.get(nbTeam).setGamesPlayed(nbGames); + //create list of Slot + leagueTeams.get(nbTeam).slots = new Slot[30]; + + table = doc.select("table").get(8); //select the first table. + rows = table.select("tr"); + row = rows.get(i); + cols = row.select("td"); + for (int k = 0; k < cols.size(); k++) { + for (int b = 0; b < l1.loadStatBaseTeam.size(); b++) { + //stats starts at 1 in colsStatName + //skip les 2 stats de pourcentage splitté - decalage de 2 entre col start et col valeur + if (l1.loadStatBaseTeam.get(b).getName().equals(colsStatName.get(k).text())) { + if (l1.loadStatBaseTeam.get(b).getName().contains("%")) { + leagueTeams.get(nbTeam).stats.get(b).setValRelative(Float.parseFloat(cols.get(k).text())*100); + } else { // sinon calcul le relatif + + + leagueTeams.get(nbTeam).stats.get(b).setValSeason(cols.get(k).text()); + + System.out.println(leagueTeams.get(nbTeam).getName()); + System.out.println(leagueTeams.get(nbTeam).stats.get(b).getName()); + System.out.println(leagueTeams.get(nbTeam).stats.get(b).getValSeason()); + + //calculate relative stat skip FT% & FG% + if (nbGames != 0 && isDouble(cols.get(k).text())) { + int totStat = Integer.parseInt(cols.get(k).text()); + float totStatrel = (float) totStat / nbGames; + leagueTeams.get(nbTeam).stats.get(b).setValRelative(totStatrel); + } + + System.out.println(leagueTeams.get(nbTeam).stats.get(b).getValRelative()); + + } + } + + + //si / load from db + if (l1.loadStatBaseTeam.get(b).getName().contains("/")) { + String valSeas = dao.rebuildMA(leagueTeams.get(nbTeam), l1.loadStatBaseTeam.get(b).getName()); + leagueTeams.get(nbTeam).stats.get(b).setValSeason(valSeas); + } + + } + } + System.out.println(cols.get(1).text()); + } + System.out.println("yo"); + } catch (IOException e) { + JOptionPane.showMessageDialog(null, "ESPN not respondig ... try again later"); + e.printStackTrace(); + + } + + + if(leagueTeams.get(0).getGamesPlayed() == 0) { + // --------------------if teams stats are empty (games in progress) LOAD DATA from DB + for (int t = 0; t < l1.nbTeams; t++) { + List records = dao.getRecordsList(leagueTeams.get(t), dao.getLastPeriod()); + // go through record list------------record LOOP-------- + int d =0; + for (int i = 0; i < records.size(); i ++) { //first rows + //----Get Record list from the DB ------ recréer et affecte un stat + leagueTeams.get(t).stats.get(i+d).setValRelative(records.get(i).getValRelative()); + leagueTeams.get(t).stats.get(i+d).setRank(records.get(i).getRank()); + if(records.get(i).getName().contains("%")) { + d++; + } + + } + } + } + + //ajoute la liste d'équipe a la lique + l1.setLeagueTeams(leagueTeams); + //resize array to fit nb team + //l1.leagueTeams = Arrays.copyOf(l1.leagueTeams, l1.nbTeams); + + + new ImportVars(); + + //enregistre le ranking relatif si nouveau + int d1 = l1.getNbDaysPlayed(); //new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); // here set the pattern as you date in string was containing like date/month/year + int d2 = dao.getLastPeriod(); + String day1 = sdf.format(d1); + String day2 = sdf.format(d2); + + if (d1 == d2 + 1 && l1.leagueTeams.get(0).getGamesPlayed() != 0 && l1.leagueTeams.get(0).stats.get(4).getValRelative() != 0) { + /*int nbRec = dao.nbDay() + 1; + for (int i = 0; i < Teams.getNumOfInstances(); i++) { + for (int j = 0; j <= l1.loopStatsTeam; j++) { + if (!l1.loadStatBaseTeam.get(j).getName().contains("/")) { + + System.out.println(l1.leagueTeams.get(i).getName() + "/" + l1.leagueTeams.get(i).stats.get(j).getRank()); + dao.addRecord(l1.leagueTeams.get(i).stats.get(j), l1.leagueTeams.get(i), nbRec, l1.getNbDaysPlayed()); + } + } + }*/ + }else { + + + } + + new ImportLineups(); + + //----------------------fill stat ranks + RANKS_fill.fillStatRank(); + //float[] arrVal = RANKS_fill.fillStatRankTEST(); + //-------------fill team ranks--------------- + RANKS_fill.fillTeamRank(); + //float[] arrVal2 = RANKS_fill.fillTeamRankTEST(); + + new GRAPH_rebuild(); + //can graph init + + + + // FILL MAXPACE------------------------------------------------- + float slotMax = CALL_Fantasy.l1.nbTotalDays; + float seasonPercent = CALL_Fantasy.l1.nbDaysPlayed / slotMax; + float pacePercent = 82 * seasonPercent; + float pacePercentUtil = 82 * 3 * seasonPercent; + for(Teams team : CALL_Fantasy.l1.leagueTeams) { + for(Slot slot : team.slots) { + if (!slot.getNomPos().equals("UTIL")) { + slot.setGamesPlayed(CALL_Fantasy.dao.countSLOT(team, slot.getSlotID())/CALL_Fantasy.l1.nbStatsPlayer); + double pace = slot.getGamesPlayed() - pacePercent; + slot.setPace(pace); + }else { + int utilCount = CALL_Fantasy.dao.countSLOT(team, slot.getSlotID())/CALL_Fantasy.l1.nbStatsPlayer + CALL_Fantasy.dao.countSLOT(team, slot.getSlotID()+1)/CALL_Fantasy.l1.nbStatsPlayer +CALL_Fantasy.dao.countSLOT(team, slot.getSlotID()+2)/CALL_Fantasy.l1.nbStatsPlayer; + slot.setGamesPlayed(utilCount); + double pace = slot.getGamesPlayed() - pacePercentUtil; + slot.setPace(pace); + break; + } + } + } + + + } + + private Object getWebKit() { + // TODO Auto-generated method stub + return null; + } + + boolean isDouble(String str) { + try { + Double.parseDouble(str); + return true; + } catch (NumberFormatException e) { + return false; + } + } + +} diff --git a/src/jsoupImport/ImportVars.java b/src/jsoupImport/ImportVars.java new file mode 100644 index 0000000..b4ab03f --- /dev/null +++ b/src/jsoupImport/ImportVars.java @@ -0,0 +1,113 @@ +package jsoupImport; + +import functions.*; +import objects.Player; +import objects.Slot; +import objects.Stat; + +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import call_pages.CALL_Fantasy; + +import java.io.IOException; +import java.util.ArrayList; + +/** + * Created by LeJay on 19.02.2017. + */ + +public class ImportVars extends CALL_Fantasy {//called from MainActivity + + public ImportVars() { + + //new Thread(new Runnable() { + // public void run() { + Document doc; + String title; + int nbStat; + + driver.get("http://fantasy.espn.com/basketball/team?leagueId=" + l1.getCode() + + "&teamId=" + l1.leagueTeams.get(1).getID() + "&statSplit=currSeason");// + "&seasonId=" + l1.getSeason() + + //"&scoringPeriodId=" + l1.getNbDaysPlayed() + "&statSplit=singleScoringPeriodn"); + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@class='jsx-2810852873 table--cell opp ml4']")));// instead of id u can use cssSelector or xpat + String content = driver.getPageSource(); + + doc = Jsoup.parse(content); + + Elements days = doc.select("div.jsx-1917748593.custom--day"); //select the first table. + + int nbdays = 0; + int currentnbdays = 0; + for (Element day : days) { + if (day.attr("class").contains("is-current")) { + currentnbdays=nbdays;} + nbdays+=1; + } + + l1.setNbDaysPlayed(currentnbdays); + l1.setnbTotalDays(nbdays); + + //select player name table + Element tablePlayer = doc.select("table.Table2__right-aligned.Table2__table-fixed.Table2__Table--fixed--left.Table2__table").get(0); //select the first table. + Elements rowsPlayer = tablePlayer.select("tr"); + Element rowPlayer; + Elements colsPlayer; + + //select stat table + Element tableStat = doc.select("table.Table2__table-scroller.Table2__right-aligned.Table2__table").get(0); //select the first table. + Elements rowsStat = tableStat.select("tr"); + Element rowStat; + Elements colsStat; + + + if (l1.loadStatBasePlayer.size()==0){ + //'-------------create and fill Stats name' + + rowStat = doc.select("tr.Table2__header-row.Table2__tr.Table2__even").get(4); + colsStat = rowStat.select("th"); + for (int k = 1; k < colsStat.size()-1; k++) { + l1.loadStatBasePlayer.add(new Stat(colsStat.get(k).text())); + } + l1.setNbStatsPlayer(l1.loadStatBasePlayer.size()-2); + } + + + + int nbSlot = 0; + // go through SLOT list------------Slot LOOP-------- + for (int i = 2; i < rowsPlayer.size(); i++) { //first rows + + rowPlayer = rowsPlayer.get(i); + colsPlayer = rowPlayer.select("td"); + + rowStat = rowsStat.get(i); + colsStat = rowStat.select("td"); + + //recup le nom du slot + String slotName = colsPlayer.get(0).text(); + + for (int t = 0; t < l1.nbTeams; t++) { + l1.leagueTeams.get(t).slots[nbSlot] = new Slot(slotName); + l1.leagueTeams.get(t).slots[nbSlot].setSlotID(nbSlot); + l1.leagueTeams.get(t).slots[nbSlot].players = (new Player[l1.nbTotalDays]); + } + + nbSlot += 1; + + } + + + + + + + } + + +} diff --git a/src/jsoupImport/LoadTester.java b/src/jsoupImport/LoadTester.java new file mode 100644 index 0000000..0832a3e --- /dev/null +++ b/src/jsoupImport/LoadTester.java @@ -0,0 +1,57 @@ +package jsoupImport; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.text.MessageFormat; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import call_pages.CALL_Fantasy; +import functions.PROJ_analysis; +import objects.Teams; + +@WebServlet("/LoadTester") +public class LoadTester extends HttpServlet { + +public static final AtomicInteger counter = new AtomicInteger(0); +public static final int maxThreadCount = 100; + +/** + * @see HttpServlet#HttpServlet() + */ +public LoadTester() throws InterruptedException { + super(); + // TODO Auto-generated constructor stub + + } +/** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ +protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + + new ImportPlayerStats();//needed for test fa + //new ImportLineups();//--> PROJ_analysis : needed for fillPlayerRKinTeam +} + +/** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ +//appelé lors clic btn trade +protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + +} + +}//end class ComplexLoadTester \ No newline at end of file diff --git a/src/jsoupImport/geckodriver.exe b/src/jsoupImport/geckodriver.exe new file mode 100644 index 0000000..cea74f2 Binary files /dev/null and b/src/jsoupImport/geckodriver.exe differ diff --git a/src/jsoupImport/phantomjs.exe b/src/jsoupImport/phantomjs.exe new file mode 100644 index 0000000..c644886 Binary files /dev/null and b/src/jsoupImport/phantomjs.exe differ diff --git a/src/objects/League.java b/src/objects/League.java new file mode 100644 index 0000000..dbc71bd --- /dev/null +++ b/src/objects/League.java @@ -0,0 +1,59 @@ +package objects; + +import java.util.ArrayList; + +/** + * Created by LeJay on 19.02.2017. + */ + +public class League { + + private String name; + private int code; + private int season; + public ArrayList leagueTeams = new ArrayList(); + public ArrayList leaguePlayers = new ArrayList(); + public String selectedT; + public int nbDaysPlayed; + public int nbTotalDays; + public int nbTeams; + public int nbStatsPlayer; + public int nbStatsTeam; + public int loopStatsTeam; + public ArrayList loadStatBaseTeam = new ArrayList(); + public ArrayList loadStatBasePlayer = new ArrayList(); + public static int nbPtoCnt=10; + public static int nbGS=82; + public static int nbGR; + public static int nbGP; + // constructor + public League(String name, String league, String year) { + this.name = name; + this.code = Integer.parseInt(league); + this.season = Integer.parseInt(year); + } + + // getter + public String getName() { return name; } + public int getCode() { return code; } + public ArrayList getLeagueTeams() { return leagueTeams; } + public ArrayList getLeaguePlayers() { return leaguePlayers; } + public int getSeason() { return season; } + public String getSelectedT() { return selectedT; } + public int getNbDaysPlayed() { return nbDaysPlayed; } + public int getNbTotalDays() { return nbTotalDays; } + + // setter + public void setName(String name) { this.name = name; } + public void setCode(int code) { this.code = code; } + public void setLeagueTeams(ArrayList leagueTeams) { this.leagueTeams = leagueTeams; } + public void setLeaguePlayers(ArrayList leaguePlayers) { this.leaguePlayers = leaguePlayers; } + public void setSeason(int season) { this.season = season; } + public void setSelectedT(String selectedT) { this.selectedT = selectedT; } + public void setNbDaysPlayed(int nbDaysPlayed) { this.nbDaysPlayed = nbDaysPlayed; } + public void setnbTotalDays(int nbTotalDays) { this.nbTotalDays = nbTotalDays; } + public void setNbTeams(int nbTeams) { this.nbTeams = nbTeams; } + public void setNbStatsPlayer(int nbStatsPlayer) { this.nbStatsPlayer = nbStatsPlayer; } + public void setNbStatsTeam(int nbStatsTeam) { this.nbStatsTeam = nbStatsTeam; } + public void setLoopStatsTeam(int loopStatsTeam) { this.loopStatsTeam = loopStatsTeam; } +} diff --git a/src/objects/Player.java b/src/objects/Player.java new file mode 100644 index 0000000..f67a703 --- /dev/null +++ b/src/objects/Player.java @@ -0,0 +1,89 @@ +package objects; + +import java.io.Serializable; +import java.util.ArrayList; + +/** + * Created by LeJay on 19.02.2017. + */ + +public class Player implements Serializable, Comparable{ + + public int ID; + public int teamID; + public String nom; + public String franchise; + public String[] positions; + public ArrayList stats = new ArrayList(); + public Boolean isFA = true; + public Boolean inTrade = false; + public Boolean isToCount = true; + public double interRK; + private float interVal; + private float valToRank; + private double potPoint; + private double potRK; + public boolean faToCalculate = true; + public int orgTeamID; + + + private int TPTS; + private int GMP; + + private static int counter; + + // constructor + public Player(String nom) { + this.nom = nom; + counter++; + } + + @Override + public int compareTo(Player o) { + double compareQuantity = ((Player) o).getValToRank(); + double d = this.getValToRank() - compareQuantity; + int i = (int) d; + //ascending order + return i; + } + + // getter + public int getteamID() {return teamID;} + public String getnom() {return nom;} + public int getTPTS() {return TPTS;} + public int getGMP() {return GMP;} + public String[] getPosition() {return positions;} + public String getFranchise() {return franchise;} + public ArrayList getStats() {return stats;} + public static int getNumOfInstances() { + return counter; + } + public boolean getIsFA() {return isFA;} + public boolean getInTrade() { return inTrade; } + public float getValToRank() { return valToRank; } + public String[] getPositions() { return positions; } + public double getInterRK() {return interRK;} + public double getPotPoint() {return potPoint;} + public double getPotRK() {return potRK;} + public float getInterVal() {return interVal;} + public boolean getFaToCalculate() {return faToCalculate;} + public int getOrgTeamID() {return orgTeamID;} + // setter + public void setteamID(int team) {this.teamID = teamID;} + public void setnom(String nom) {this.nom = nom;} + public void setTPTS(int TPTS) {this.TPTS = TPTS;} + public void setGMP(int GMP) {this.GMP = GMP;} + public void setPositions(String[] positions) {this.positions = positions;} + public void setFranchise(String franchise) {this.franchise = franchise;} + public void setStats(ArrayList stats) {this.stats = stats;} + public void setIsFA(boolean isFA) {this.isFA = isFA;} + public void setInTrade(boolean inTrade) { this.inTrade = inTrade; } + public void setValToRank(float valToRank) { this.valToRank = valToRank; } + public void setInterRK(double interRK) {this.interRK = interRK;} + public void setInterVal(float interVal) {this.interVal = interVal;} + public void setPotPoint(double potPoint) {this.potPoint = potPoint;} + public void setPotRK(double potRK) {this.potRK = potRK;} + public void setFaToCalculate(boolean faToCalculate) {this.faToCalculate = faToCalculate;} + public void setOrgTeamID(int orgTeamID) {this.orgTeamID = orgTeamID;} +} + diff --git a/src/objects/Record.java b/src/objects/Record.java new file mode 100644 index 0000000..0f41d3c --- /dev/null +++ b/src/objects/Record.java @@ -0,0 +1,78 @@ +package objects; + +import java.util.ArrayList; + +public class Record { + + private int id; + private int ptsPlayer1; + private int ptsPlayer2; + private int ptsPlayer3; + private int ptsPlayer4; + private int ptsPlayer5; + private int ptsPlayer6; + + public Record(int id, int ptsPlayer1, int ptsPlayer2, int ptsPlayer3, int ptsPlayer4, int ptsPlayer5, + int ptsPlayer6) { + super(); + this.id = id; + this.ptsPlayer1 = ptsPlayer1; + this.ptsPlayer2 = ptsPlayer2; + this.ptsPlayer3 = ptsPlayer3; + this.ptsPlayer4 = ptsPlayer4; + this.ptsPlayer5 = ptsPlayer5; + this.ptsPlayer6 = ptsPlayer6; + } + + public int getPtsPlayer1() { + return ptsPlayer1; + } + + public void setPtsPlayer1(int ptsPlayer1) { + this.ptsPlayer1 = ptsPlayer1; + } + + public int getPtsPlayer2() { + return ptsPlayer2; + } + + public void setPtsPlayer2(int ptsPlayer2) { + this.ptsPlayer2 = ptsPlayer2; + } + + public int getPtsPlayer3() { + return ptsPlayer3; + } + + public void setPtsPlayer3(int ptsPlayer3) { + this.ptsPlayer3 = ptsPlayer3; + } + + public int getPtsPlayer4() { + return ptsPlayer4; + } + + public void setPtsPlayer4(int ptsPlayer4) { + this.ptsPlayer4 = ptsPlayer4; + } + + public int getPtsPlayer5() { + return ptsPlayer5; + } + + public void setPtsPlayer5(int ptsPlayer5) { + this.ptsPlayer5 = ptsPlayer5; + } + + public int getPtsPlayer6() { + return ptsPlayer6; + } + + public void setPtsPlayer6(int ptsPlayer6) { + this.ptsPlayer6 = ptsPlayer6; + } + + + + +} diff --git a/src/objects/Slot.java b/src/objects/Slot.java new file mode 100644 index 0000000..6a77fd5 --- /dev/null +++ b/src/objects/Slot.java @@ -0,0 +1,35 @@ +package objects; + +/** + * Created by LeJay on 19.02.2017. + */ + +public class Slot { + + public String nomPos; + public int slotID; + public Player[] players; + + public int gamesRemaining; + public int gamesPlayed; + public double pace; + + public Slot(String nomPos){ + this.nomPos = nomPos; + } + + public String getNomPos() { return nomPos; } + public Player[] getPlayers() { return players; } + public int getGamesRemaining() { return gamesRemaining; } + public int getGamesPlayed() { return gamesPlayed; } + public double getPace() { return pace; } + + public int getSlotID() { return slotID; } + + public void setNomPos(String nomPos) { this.nomPos = nomPos; } + public void setPlayers(Player[] players) { this.players = players; } + public void setGamesRemaining(int nom) { this.gamesRemaining = gamesRemaining; } + public void setGamesPlayed(int gamesPlayed) { this.gamesPlayed = gamesPlayed; } + public void setPace(double pace) { this.pace = pace; } + public void setSlotID(int slotID) { this.slotID = slotID; } +} diff --git a/src/objects/Stat.java b/src/objects/Stat.java new file mode 100644 index 0000000..36c9b0a --- /dev/null +++ b/src/objects/Stat.java @@ -0,0 +1,80 @@ +package objects; + +import java.io.Serializable; + +/** + * Created by LeJay on 19.02.2017. + */ + +public class Stat implements Serializable, Comparable{ + + private String name; + private int code; + private String team; + private double valRot; + private String valSeason; + private float valRelative; + private String ValProjection; + private double rank; + private double projectedRK; + private String statVal; + private String player; + private String slot; + private int slotID; + private int period; + private float valToRank; + + + public Stat(String name) { + this.name = name; + } + + @Override + public int compareTo(Stat o) { + + float compareQuantity = ((Stat) o).getValToRank(); + + float d = this.getValToRank() - compareQuantity; + int i = (int) d; + + //ascending order + return i; + + //descending order + //return compareQuantity - this.quantity; + } + + // getter + public String getName() { return name; } + public String getTeam() { return team; } + public double getValRot() { return valRot; } + public String getValSeason() { return valSeason; } + public float getValRelative() { return valRelative; } + public double getRank() { return rank; } + public double getCode() { return code; } + public String getStatVal() { return statVal; } + public String getPlayer() { return player; } + public String getSlot() { return slot; } + public int getSlotID() { return slotID; } + public int getPeriod() { return period; } + public String getValProjection() { return ValProjection; } + public float getValToRank() { return valToRank; } + public double getProjectedRK() { return projectedRK; } + + // setter + public void setName(String name) { this.name = name; } + public void setTeam(String team) { this.team = team; } + public void setValRot(double valRot) { this.valRot = valRot; } + public void setValSeason(String valSeason) { this.valSeason = valSeason; } + public void setValRelative(float valRelative) { this.valRelative = valRelative; } + public void setRank(double rank) { this.rank = rank; } + public void setCode(int code) { this.code = code; } + public void setStatVal(String statVal) { this.statVal = statVal; } + public void setPlayer(String player) { this.player = player; } + public void setSlot(String slot) { this.slot = slot; } + public void setSlotID(int slotID) { this.slotID = slotID; } + public void setPeriod(int period) { this.period = period; } + public void setValProjection(String valProjection) { this.ValProjection = valProjection; } + public void setValToRank(float valToRank) { this.valToRank = valToRank; } + public void setProjectedRK(double projectedRK) { this.projectedRK = projectedRK; } +} diff --git a/src/objects/Teams.java b/src/objects/Teams.java new file mode 100644 index 0000000..489c6dc --- /dev/null +++ b/src/objects/Teams.java @@ -0,0 +1,111 @@ +package objects; + +import java.io.Serializable; +import java.util.ArrayList; + +/** + * Created by LeJay on 19.02.2017. + */ + +public class Teams implements Serializable, Comparable{ + + private String name; + private String surn; + private String nomJoueur; + public int code; + private int ID; + //public LineUp[] lineup; + public ArrayList stats = new ArrayList(); + public ArrayList players = new ArrayList(); + public Slot[] slots; + + private int gamesPlayed; + private double totalrotPts; + private double totalrotPtsRel; + private double RK; + private double relativeRK; + private double projTot; + private double projTotX; + private double projRK; + private double projRKX; + private float valToRank; + private boolean inTrade; + + public String selectedP; + + + private static int counter; + + //TeamStats rotisserie= new TeamStats(,0,0,0,0,0,0,0,0,0,0,0); + //TeamStats season= new TeamStats(,0,0,0,0,0,0,0,0,0,0,0); + public static int getNumOfInstances() { + return counter; + } + + // constructor + public Teams(String name, int code) { + this.name = name; + this.code = code; + counter++; + } + + + @Override + public int compareTo(Teams o) { + + double compareQuantity = ((Teams) o).getValToRank(); + double d = this.getValToRank() - compareQuantity; + + int i = (int) d; + + //ascending order + return i; + //descending order + //return compareQuantity - this.quantity; + } + + // getter + public String getName() { return name; } + public String getSurn() { return surn; } + public String getNomJoueur() { return nomJoueur; } + public int getCode() { return code; } + public ArrayList getStats() { return stats; } + public double getTotalrotPts() { return totalrotPts; } + public double getTotalrotPtsRel() { return totalrotPtsRel; } + public int getGamesPlayed() { return gamesPlayed; } + public double getRelativeRK() { return relativeRK; } + public double getProjTot() { return projTot; } + public double getProjRK() { return projRK; } + public double getProjTotX() { return projTotX; } + public double getProjRKX() { return projRKX; } + public float getValToRank() { return valToRank; } + public ArrayList getPlayer() { return players; } + public int getID() { return ID; } + public boolean getInTrade() { return inTrade; } + public String getSelectedP() { return selectedP; } + public double getRK() {return RK;} + public Slot[] getSlots() {return slots;} + + // setter + public void setName(String name) { this.name = name; } + public void setSurn(String surn) { this.surn = surn; } + public void setNomJoueur(String surn) { this.nomJoueur = nomJoueur; } + public void setCode(int code) { this.code = code; } + public void setStats(ArrayList stats) { this.stats = stats; } + public void setTotalrotPts(double totalrotPts) { this.totalrotPts = totalrotPts; } + public void setTotalrotPtsRel(double totalrotPtsRel) { this.totalrotPtsRel = totalrotPtsRel; } + public void setGamesPlayed(int gamesPlayed) { this.gamesPlayed = gamesPlayed; } + public void setRelativeRK(double relativeRK) { this.relativeRK = relativeRK; } + public void setProjTot(double projTot) { this.projTot = projTot; } + public void setProjRK(double projRK) { this.projRK = projRK; } + public void setProjTotX(double projTotX) { this.projTotX = projTotX; } + public void setProjRKX(double projRKX) { this.projRKX = projRKX; } + public void setValToRank(float valToRank) { this.valToRank = valToRank; } + public void setPlayers(ArrayList players) { this.players = players; } + public void setID(int ID) { this.ID = ID; } + // public void setSlots(ArrayList slots) { this.slots = slots; } + public void setInTrade(boolean inTrade) { this.inTrade = inTrade; } + public void setSelectedP(String selectedP) {this.selectedP = selectedP; } + public void setRK(double RK) {this.RK = RK;} + public void setSlots(Slot[] slots) {this.slots = slots;} +} \ No newline at end of file diff --git a/target/Final-0.0.1-SNAPSHOT.war b/target/Final-0.0.1-SNAPSHOT.war new file mode 100644 index 0000000..4e2f2db Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT.war differ diff --git a/target/Final-0.0.1-SNAPSHOT/CSS/style.css b/target/Final-0.0.1-SNAPSHOT/CSS/style.css new file mode 100644 index 0000000..ab635ed --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/CSS/style.css @@ -0,0 +1,504 @@ +@charset "ISO-8859-1"; + + +.wrapper { + display: grid; + grid-template-columns: repeat(16, [col-start] 1fr); + grid-gap: 10px; +} +.wrapper > * { + grid-column: col-start / span 16; +} +.main-nav { + background: #f1f1f1; + -webkit-box-shadow: 0 10px 5px #888888; + -moz-box-shadow: 0 10px 5px #888888; + box-shadow: 0 10px 5px #888888; +} +.main-footer { + background: #ff8306; + } + +.main-head { + background: #ff8306; +} + +.cn { + display: flex; + justify-content: center; + align-items: center; + height:100%; +} + +@media (min-width: 500px) { + + .side { + grid-column: col-start / span 3; + grid-row: 3; + } + .ad { + grid-column: col-start / span 3; + grid-row: 4; + } + .content, .main-footer { + grid-column: col-start 4 / span 9; + } + nav ul { + display: flex; + justify-content: space-between; + } +} + +@media (min-width: 700px) { + +.main-head { + grid-column: col-start / span 16; + grid-row: 1; + } +.main-nav { + grid-column: col-start / span 2; + grid-row: 2 / 4; + } + +.graph { + grid-column: col-start 1 / span 16; + grid-row: 2; + } + +.team { + grid-column: col-start 1 / span 3; + grid-row: 2; + + } + .side { + grid-column: col-start 15 / span 2; + grid-row: 2; + } + .ad { + grid-column: col-start 15 / span 2; + grid-row: 3; + } + .main-footer { + grid-column: col-start / span 16; + } + nav ul { + flex-direction: column; + } + + .listing { + list-style: none; + display: grid; + grid-gap: 10px; + grid-auto-flow: dense; + grid-template-columns: repeat(auto-fill,minmax(350px, 1fr)); + padding:10px; + padding-top:0px; + margin:0px; +} + .listing li { + border: 1px solid #ffe066; + border-radius: 5px; + display: flex; + flex-direction: column; + background:#ffffff; + } + .listing .wide { + grid-column-end: span 2; + } + +.listingTeam { + list-style: none; + display: grid; + grid-gap: 10px; + grid-auto-flow: dense; + grid-template-columns: repeat(auto-fill,minmax(500px, 600px)); + padding:10px; + padding-top:0px; + margin:0px; + flex-direction: row; +} + .listingTeam li { + border: 1px solid #ffe066; + border-radius: 5px; + display: flex; + flex-direction: column; + background:#ffffff; + } + .listingTeam .wide { + grid-column-end: span 2; + } + +} + + + + +body { + background: #ff8306; + color: #444; + font: 100%/20px 'Helvetica Neue', helvetica, arial, sans-serif; + text-shadow: 0 1px 0 #974b00; + -moz-user-select: -moz-none; + -webkit-user-select: none; + -khtml-user-select: none; + -o-user-select: none; + user-select: none; +} +.cadre +{ + background: #000051; + border: 5px solid #fff; + display: inline-block; + max-width: 100%; + padding-bottom: 10px; +} + +.HeaderDiv +{ + background: linear-gradient(#777, #444); + color: #fff; + text-shadow: 0 1px 0 #000; + font-size: 12px ; + font-weight: bold; +} + +.tableTrade { + background: #000051; + border-collapse: collapse; + font-size: 9px; + text-shadow: 0 1px 0 #ffffff; + line-height: 12px; + -ms-user-select:none; + width:100%; + +} + +.tableTrade > thead > tr > th +{ + border-right: 1px solid #fff; + border-left: 1px solid #e8e8e8; + font-weight: bold; + padding: 2px 1px; + position: relative; + text-shadow: 0 1px 0 #000; + font-size: 9px ; + + -ms-user-select:none; +} + +.tableTrade > thead > tr > th:first-child +{ + border-left: 0px solid ; +} +.tableTrade > thead > tr > th:last-child +{ + border-right: 0px solid ; +} + + + + +.tableTrade > thead > tr.Header > th +{ + background: linear-gradient(#777, #444); + color: #fff; + text-align:center; +} + +.tableTrade > thead > tr.Header > th.focus { + background: linear-gradient(#959595, #d4d4d4); + cursor: pointer; +} + +.tableTrade > tbody > tr.ligneHead > th +{ + padding: 2px 3px; + border-right: 1px solid #fff; + border-left: 1px solid #e8e8e8; + background: linear-gradient(#c0c0c0, #efefef); + color: #2b2b2b; + text-align:center; +} +.tableTrade > tbody > tr.ligneHead > th:first-child +{ + border-left: 0px solid ; +} +.tableTrade > tbody > tr.ligneHead > th:last-child +{ + border-right: 0px solid ; +} + +.tableTrade > tbody > tr > th.positive +{ + background: linear-gradient(#91ff91, #d5ffd5); + color: #004000; +} +.tableTrade > tbody > tr > th.negative +{ + background: linear-gradient(#ff8c8c, #ffd5d5); + color: #710000; +} +.tableTrade > tbody > tr > th.neutral +{ + background: linear-gradient(#ffdab5, #ffeedd); + color: #ff8306; +} +.tableTrade > tbody > tr.tab:nth-child(odd) > td.positive +{ + background: linear-gradient(#91ff91, #d5ffd5); + color: #004000; +} +.tableTrade > tbody > tr.tab:nth-child(odd) > td.negative +{ + background: linear-gradient(#ff8c8c, #ffd5d5); + color: #710000; +} +.tableTrade > tbody > tr.tab:nth-child(odd) > td.neutral +{ + background: linear-gradient(#ffdab5, #ffeedd); + color: #ff8306; +} +.tableTrade > tbody > tr.tab:nth-child(even) > td.positive +{ + background: linear-gradient(#91ff91, #d5ffd5); + color: #004000; +} +.tableTrade > tbody > tr.tab:nth-child(even) > td.negative +{ + background: linear-gradient(#ff8c8c, #ffd5d5); + color: #710000; +} +.tableTrade > tbody > tr.tab:nth-child(even) > td.neutral +{ + background: linear-gradient(#ffdab5, #ffeedd); + color: #ff8306; +} + +.tableTrade > tbody > tr.tab > td:hover { + background: linear-gradient(#c9c9c9, #eeeeee); + transition: all 300ms; +} + +.tableTrade > tbody > tr > td +{ + font-size: 9px ; + border-right: 1px solid #fff; + border-left: 1px solid #e8e8e8; + padding: 2px 1px; + position: relative; + transition: all 300ms; + text-align:center; + -ms-user-select:none; +} +.tableTrade > tbody > tr > td:first-child +{ + border-left: 0px solid ; +} +.tableTrade > tbody > tr > td:last-child +{ + border-right: 0px solid ; +} + +.tableTrade > tbody > tr.freeAgentInjured > td { + background: linear-gradient(#c0c0c0, #e6e6e6); +} + +.tableTrade > tbody > tr.tab:nth-child(odd) > td +{ + background: linear-gradient(#f3f3f3, #fafafa); + color: #2b2b2b; +} +.tableTrade > tbody > tr.tab:nth-child(even) > td +{ + background: linear-gradient(#f3f3f3, #ffffff); + color: #2b2b2b; +} + +.tableTrade > tbody > tr.tab:hover > td +{ + background: #8cffff; + cursor: pointer; +} + + +.tableTrade > tbody > tr:nth-child(odd).displayed > td +{ + background: linear-gradient(#26bf73, #7ae4af); +} +.tableTrade > tbody > tr:nth-child(even).displayed > td +{ + background: linear-gradient(#48db92, #a5edc9); +} +.tableTrade > tbody > tr:nth-child(odd).selected > td +{ + background-color: #9FAFD1; +} +.tableTrade > tbody > tr:nth-child(even).selected > td +{ + background-color: #B0BED9; +} + + +.tableTrade > tbody > tr.tab:nth-child(odd) > td +{ + background: linear-gradient(#f3f3f3, #fafafa); + color: #2b2b2b; +} +.tableTrade > tbody > tr.tab:nth-child(even) > td +{ + background: linear-gradient(#f3f3f3, #ffffff); + color: #2b2b2b; +} + + + + + +.tableTrade > tbody > tr.hidden +{ + display: none; +} + + + + + + +strong { + font-weight: bold; +} + +em { + font-style: italic; +} + + + +.asc:after {content: "\25B2"; } +.desc:after {content: "\25BC"; } + +.focus { + background-color: #ff00ff; + color: #fff; + cursor: pointer; + font-weight: bold; +} +.selected { + background-color: #ff00ff; + color: #fff; + font-weight: bold; +} + + +#myInput { + background-image: url('../PICS/searchicon.png'); /* Add a search icon to input */ + background-position: 5px 6px; /* Position the search icon */ + background-repeat: no-repeat; /* Do not repeat the icon image */ + width: 100%; /* Full-width */ + font-size: 14px; /* Increase font-size */ + padding: 6px 10px 6px 40px; /* Add some padding */ + border: 1px solid #ddd; /* Add a grey border */ + margin-bottom: 6px; /* Add some space below the input */ + margin-top: 6px; /* Add some space below the input */ +} + +.positive +{ + background: linear-gradient(#91ff91, #d5ffd5); + color: #004000; +} +.negative +{ + background: linear-gradient(#ff8c8c, #ffd5d5); + color: #710000; +} +.neutral +{ + background: linear-gradient(#ff9d3c, #ffc78e); + color: #ff8040; +} + +#everything-wrapper { + display : none; +} + + +span { + display: block; + margin: 0 auto; +} + +span[class*="l-"] { + height: 4px; width: 4px; + background: #000; + display: inline-block; + margin: 12px 2px; + + border-radius: 100%; + -webkit-border-radius: 100%; + -moz-border-radius: 100%; + + -webkit-animation: loader 4s infinite; + -webkit-animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415); + -webkit-animation-fill-mode: both; + -moz-animation: loader 4s infinite; + -moz-animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415); + -moz-animation-fill-mode: both; + -ms-animation: loader 4s infinite; + -ms-animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415); + -ms-animation-fill-mode: both; + animation: loader 4s infinite; + animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415); + animation-fill-mode: both; +} + +span.l-1 {-webkit-animation-delay: 1s;animation-delay: 1s;-ms-animation-delay: 1s;-moz-animation-delay: 1s;} +span.l-2 {-webkit-animation-delay: 0.8s;animation-delay: 0.8s;-ms-animation-delay: 0.8s;-moz-animation-delay: 0.8s;} +span.l-3 {-webkit-animation-delay: 0.6s;animation-delay: 0.6s;-ms-animation-delay: 0.6s;-moz-animation-delay: 0.6s;} +span.l-4 {-webkit-animation-delay: 0.4s;animation-delay: 0.4s;-ms-animation-delay: 0.4s;-moz-animation-delay: 0.4s;} +span.l-5 {-webkit-animation-delay: 0.2s;animation-delay: 0.2s;-ms-animation-delay: 0.2s;-moz-animation-delay: 0.2s;} +span.l-6 {-webkit-animation-delay: 0;animation-delay: 0;-ms-animation-delay: 0;-moz-animation-delay: 0;} + +@-webkit-keyframes loader { + 0% {-webkit-transform: translateX(-30px); opacity: 0;} + 25% {opacity: 1;} + 50% {-webkit-transform: translateX(30px); opacity: 0;} + 100% {opacity: 0;} +} + +@-moz-keyframes loader { + 0% {-moz-transform: translateX(-30px); opacity: 0;} + 25% {opacity: 1;} + 50% {-moz-transform: translateX(30px); opacity: 0;} + 100% {opacity: 0;} +} + +@-keyframes loader { + 0% {-transform: translateX(-30px); opacity: 0;} + 25% {opacity: 1;} + 50% {-transform: translateX(30px); opacity: 0;} + 100% {opacity: 0;} +} + +@-ms-keyframes loader { + 0% {-ms-transform: translateX(-30px); opacity: 0;} + 25% {opacity: 1;} + 50% {-ms-transform: translateX(30px); opacity: 0;} + 100% {opacity: 0;} + + +} + + +dfs{ + color: #f0f0f0; +} + +select { + font-size:16px; + cursor: pointer; + background: linear-gradient(#ffe6cc, #ffffff); + width :100%; +} + + diff --git a/target/Final-0.0.1-SNAPSHOT/DIV_FA.jsp b/target/Final-0.0.1-SNAPSHOT/DIV_FA.jsp new file mode 100644 index 0000000..f46dfa6 --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/DIV_FA.jsp @@ -0,0 +1,273 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +team +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Actual Projection
Proj with FA
Difference
+ + + + + + + diff --git a/target/Final-0.0.1-SNAPSHOT/DIV_graph.jsp b/target/Final-0.0.1-SNAPSHOT/DIV_graph.jsp new file mode 100644 index 0000000..b4e6c8a --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/DIV_graph.jsp @@ -0,0 +1,92 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +GRAPH +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + +
+ + + + + diff --git a/target/Final-0.0.1-SNAPSHOT/DIV_team.jsp b/target/Final-0.0.1-SNAPSHOT/DIV_team.jsp new file mode 100644 index 0000000..2ead444 --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/DIV_team.jsp @@ -0,0 +1,182 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +League Teams +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/target/Final-0.0.1-SNAPSHOT/DIV_trade.jsp b/target/Final-0.0.1-SNAPSHOT/DIV_trade.jsp new file mode 100644 index 0000000..87cdb11 --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/DIV_trade.jsp @@ -0,0 +1,407 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +team +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + +<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
T1 tradeT1 tradeACTUAL PROJECTION
DIFFERENCES
RK DPT DTOT RDTOT PDRK DPT D
+
+ + + + diff --git a/target/Final-0.0.1-SNAPSHOT/META-INF/MANIFEST.MF b/target/Final-0.0.1-SNAPSHOT/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/target/Final-0.0.1-SNAPSHOT/META-INF/maven/FantasyManager/FantasyManager/pom.properties b/target/Final-0.0.1-SNAPSHOT/META-INF/maven/FantasyManager/FantasyManager/pom.properties new file mode 100644 index 0000000..f21c394 --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/META-INF/maven/FantasyManager/FantasyManager/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Mon Oct 22 16:28:29 CEST 2018 +m2e.projectLocation=C\:\\Users\\lejay\\eclipse-workspace\\sd.zip_expanded\\FantasyManager +m2e.projectName=FantasyManager +groupId=FantasyManager +artifactId=FantasyManager +version=0.0.1-SNAPSHOT diff --git a/target/Final-0.0.1-SNAPSHOT/META-INF/maven/FantasyManager/FantasyManager/pom.xml b/target/Final-0.0.1-SNAPSHOT/META-INF/maven/FantasyManager/FantasyManager/pom.xml new file mode 100644 index 0000000..37f789a --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/META-INF/maven/FantasyManager/FantasyManager/pom.xml @@ -0,0 +1,81 @@ + + 4.0.0 + FantasyManager + FantasyManager + 0.0.1-SNAPSHOT + + src + + + maven-compiler-plugin + 3.7.0 + + 1.8 + 1.8 + + + + maven-war-plugin + 3.0.0 + + WebContent + + + + + + + com.google.visualization + visualization-datasource + 1.1.1 + + + com.fasterxml.jackson.core + jackson-core + 2.9.2 + + + com.fasterxml.jackson.core + jackson-annotations + 2.9.2 + + + + com.fasterxml.jackson.core + jackson-databind + 2.9.2 + + + org.jsoup + jsoup + 1.9.1 + + + + + com.google.code.gson + gson + 2.3.1 + + + + mysql + mysql-connector-java + 5.1.39 + + + io.webfolder + ui4j-webkit + 3.1.0 + + + + org.seleniumhq.selenium + selenium-firefox-driver + 3.13.0 + + + + + war + \ No newline at end of file diff --git a/target/Final-0.0.1-SNAPSHOT/PAGE_league.jsp b/target/Final-0.0.1-SNAPSHOT/PAGE_league.jsp new file mode 100644 index 0000000..b63536e --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/PAGE_league.jsp @@ -0,0 +1,352 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +Insert title here +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+
+ +
+
+
+ + + + + + + + + +
+
    +
  • + + + + + + + + + + + + + + + + + + <%-- + + + + + + --%> + + + + + + <%-- + + --%> + + + + + + + + + + + + + + +
    ESPN RANKINGRELATIVEPROJECTION
    TEAMGPESPN PTSE-RKREL PTSR-RKPROJ PTSP-RK
    +
  • + +
  • + +
    +
    +
    +
    + Buildind RK Graph + + + + + + +
    +
    +
    +
  • + + + +
  • +
    + +
    + +
    +
    + + + + + + + +
    +
    +
    +
  • +
    +
    +
+
+ +
+ + + + + + + \ No newline at end of file diff --git a/target/Final-0.0.1-SNAPSHOT/PAGE_team.jsp b/target/Final-0.0.1-SNAPSHOT/PAGE_team.jsp new file mode 100644 index 0000000..059333f --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/PAGE_team.jsp @@ -0,0 +1,566 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +team +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + + + + + + + + + + + + +

Find Free Agents

+ + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Actual Projection
Proj with FA
Difference
+ +
+
+ + + + + + diff --git a/target/Final-0.0.1-SNAPSHOT/PAGE_trade.jsp b/target/Final-0.0.1-SNAPSHOT/PAGE_trade.jsp new file mode 100644 index 0000000..c5db199 --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/PAGE_trade.jsp @@ -0,0 +1,185 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +trade +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + + + + + + +
+
+ +
+
+ +
+ +
+
+ + + +
+
    +
  • + +
    +
  • + +
  • + +
    +
  • + + +
+
+
The footer
+
+ + + + + + + diff --git a/target/Final-0.0.1-SNAPSHOT/PICS/Fantasy-Basketball-badge.png b/target/Final-0.0.1-SNAPSHOT/PICS/Fantasy-Basketball-badge.png new file mode 100644 index 0000000..2af1aa6 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/PICS/Fantasy-Basketball-badge.png differ diff --git a/target/Final-0.0.1-SNAPSHOT/PICS/Thumbs.db b/target/Final-0.0.1-SNAPSHOT/PICS/Thumbs.db new file mode 100644 index 0000000..6d30321 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/PICS/Thumbs.db differ diff --git a/target/Final-0.0.1-SNAPSHOT/PICS/arr.png b/target/Final-0.0.1-SNAPSHOT/PICS/arr.png new file mode 100644 index 0000000..7ebb1fb Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/PICS/arr.png differ diff --git a/target/Final-0.0.1-SNAPSHOT/PICS/searchicon.png b/target/Final-0.0.1-SNAPSHOT/PICS/searchicon.png new file mode 100644 index 0000000..714bec5 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/PICS/searchicon.png differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_divs/CALL_DIV_team.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_divs/CALL_DIV_team.class new file mode 100644 index 0000000..3407a1f Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_divs/CALL_DIV_team.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_divs/CALL_DIV_trade.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_divs/CALL_DIV_trade.class new file mode 100644 index 0000000..11314fb Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_divs/CALL_DIV_trade.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Fantasy.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Fantasy.class new file mode 100644 index 0000000..ad8b416 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Fantasy.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Team$ListOfStatComparator.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Team$ListOfStatComparator.class new file mode 100644 index 0000000..4c01777 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Team$ListOfStatComparator.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Team.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Team.class new file mode 100644 index 0000000..af2e63d Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Team.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Trade.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Trade.class new file mode 100644 index 0000000..a8e82a8 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/CALL_Trade.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/TESTcss.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/TESTcss.class new file mode 100644 index 0000000..218e758 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/call_pages/TESTcss.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/CALL_Rebuild.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/CALL_Rebuild.class new file mode 100644 index 0000000..bd22d9b Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/CALL_Rebuild.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/FA_testPlayer$ListOfStatComparator.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/FA_testPlayer$ListOfStatComparator.class new file mode 100644 index 0000000..f0ae389 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/FA_testPlayer$ListOfStatComparator.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/FA_testPlayer.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/FA_testPlayer.class new file mode 100644 index 0000000..7f1c13e Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/FA_testPlayer.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/GRAPH_CALL.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/GRAPH_CALL.class new file mode 100644 index 0000000..416c7ee Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/GRAPH_CALL.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/GRAPH_init.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/GRAPH_init.class new file mode 100644 index 0000000..75b2938 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/GRAPH_init.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/GRAPH_rebuild.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/GRAPH_rebuild.class new file mode 100644 index 0000000..8e76c0c Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/GRAPH_rebuild.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/Main.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/Main.class new file mode 100644 index 0000000..b306bde Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/Main.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/MySQLAccess.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/MySQLAccess.class new file mode 100644 index 0000000..894a76c Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/MySQLAccess.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/PROJ_analysis.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/PROJ_analysis.class new file mode 100644 index 0000000..c1425f4 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/PROJ_analysis.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/RANKS_fill.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/RANKS_fill.class new file mode 100644 index 0000000..7526974 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/RANKS_fill.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/TRADE_test$ListOfStatComparator.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/TRADE_test$ListOfStatComparator.class new file mode 100644 index 0000000..1b2363f Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/TRADE_test$ListOfStatComparator.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/TRADE_test.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/TRADE_test.class new file mode 100644 index 0000000..42be3a0 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/functions/TRADE_test.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportLineups.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportLineups.class new file mode 100644 index 0000000..42e62a5 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportLineups.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportPlayerStats.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportPlayerStats.class new file mode 100644 index 0000000..3ec5556 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportPlayerStats.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportPlayers.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportPlayers.class new file mode 100644 index 0000000..d5b4818 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportPlayers.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportTeams.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportTeams.class new file mode 100644 index 0000000..e909fb4 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/ImportTeams.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/LoadTester.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/LoadTester.class new file mode 100644 index 0000000..4616d3c Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/jsoupImport/LoadTester.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/League.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/League.class new file mode 100644 index 0000000..b36fa95 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/League.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Player.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Player.class new file mode 100644 index 0000000..43c782f Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Player.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Record.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Record.class new file mode 100644 index 0000000..9e8822e Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Record.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Slot.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Slot.class new file mode 100644 index 0000000..21616c3 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Slot.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Stat.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Stat.class new file mode 100644 index 0000000..8e503bc Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Stat.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Teams.class b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Teams.class new file mode 100644 index 0000000..2685b23 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/classes/objects/Teams.class differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/byte-buddy-1.8.3.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/byte-buddy-1.8.3.jar new file mode 100644 index 0000000..9728556 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/byte-buddy-1.8.3.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-codec-1.10.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-codec-1.10.jar new file mode 100644 index 0000000..1d7417c Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-codec-1.10.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-exec-1.3.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-exec-1.3.jar new file mode 100644 index 0000000..9a64351 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-exec-1.3.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-lang-2.4.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-lang-2.4.jar new file mode 100644 index 0000000..532939e Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-lang-2.4.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-logging-1.1.1.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-logging-1.1.1.jar new file mode 100644 index 0000000..1deef14 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/commons-logging-1.1.1.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/gson-2.8.1.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/gson-2.8.1.jar new file mode 100644 index 0000000..5222355 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/gson-2.8.1.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/guava-r07.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/guava-r07.jar new file mode 100644 index 0000000..9ff5f89 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/guava-r07.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/httpclient-4.5.5.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/httpclient-4.5.5.jar new file mode 100644 index 0000000..7796b0e Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/httpclient-4.5.5.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/httpcore-4.4.9.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/httpcore-4.4.9.jar new file mode 100644 index 0000000..cddba28 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/httpcore-4.4.9.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/icu4j-4.0.1.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/icu4j-4.0.1.jar new file mode 100644 index 0000000..b88299e Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/icu4j-4.0.1.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-annotations-2.9.2.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-annotations-2.9.2.jar new file mode 100644 index 0000000..3866300 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-annotations-2.9.2.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-core-2.9.2.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-core-2.9.2.jar new file mode 100644 index 0000000..ff26a3f Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-core-2.9.2.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-databind-2.9.2.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-databind-2.9.2.jar new file mode 100644 index 0000000..8a340d8 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-databind-2.9.2.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jquery.rowselector.min.js b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jquery.rowselector.min.js new file mode 100644 index 0000000..2cdb176 --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jquery.rowselector.min.js @@ -0,0 +1 @@ +!function(s){"use strict";s.fn.selectedrows=function(){var t,e=s(this[0]);if("TABLE"===e.prop("tagName").toUpperCase()&&void 0!==e.attr("data-rs-selectable")){var a=e.attr("data-rs-class")||"selected";t=s(e).find("tbody tr."+a)}return t}}(jQuery),$(document).ready(function(){"use strict";var s={};$("body").on("mouseover","table[data-rs-selectable]",function(){$(this).addClass("unselectable").attr("unselectable","on")}),$("body").on("click","table[data-rs-selectable] tr",function(t){var e=$(this),a=e.closest("table"),r=a.attr("data-rs-type")||"many",l=a.attr("data-rs-class")||"selected";if("none"!==r)if("one"===r)$(this).siblings().removeClass(l).end().addClass(l);else if($(this).toggleClass(l),t.shiftKey){var i=s[a.id]||!1;if(i&&this!==i&&$(this).hasClass(l)===$(i).hasClass(l))for(var n=this.rowIndex>i.rowIndex?i:this,d=this.rowIndex>i.rowIndex?this:i,o=$(this).hasClass(l),c=$(n).nextAll("tr"),h=0,f=c.length;f>h&&c[h]!==d;h+=1)o?$(c[h]).addClass(l):$(c[h]).removeClass(l)}s[a.id]=this,$(a).trigger("clicked.rs.row")})}); \ No newline at end of file diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jsoup-1.9.1.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jsoup-1.9.1.jar new file mode 100644 index 0000000..9160b2b Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jsoup-1.9.1.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jstl-1.2.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jstl-1.2.jar new file mode 100644 index 0000000..0fd275e Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/jstl-1.2.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/mysql-connector-java-5.0.8-bin.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/mysql-connector-java-5.0.8-bin.jar new file mode 100644 index 0000000..0170c3e Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/mysql-connector-java-5.0.8-bin.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/mysql-connector-java-6.0.6.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/mysql-connector-java-6.0.6.jar new file mode 100644 index 0000000..1f6c958 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/mysql-connector-java-6.0.6.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/okhttp-3.10.0.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/okhttp-3.10.0.jar new file mode 100644 index 0000000..1c3cfb8 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/okhttp-3.10.0.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/okio-1.14.1.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/okio-1.14.1.jar new file mode 100644 index 0000000..c5eff37 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/okio-1.14.1.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/opencsv-1.8.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/opencsv-1.8.jar new file mode 100644 index 0000000..cc8200b Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/opencsv-1.8.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/selenium-api-3.13.0.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/selenium-api-3.13.0.jar new file mode 100644 index 0000000..3e6b071 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/selenium-api-3.13.0.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/selenium-firefox-driver-3.13.0.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/selenium-firefox-driver-3.13.0.jar new file mode 100644 index 0000000..f2760bf Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/selenium-firefox-driver-3.13.0.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/selenium-remote-driver-3.13.0.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/selenium-remote-driver-3.13.0.jar new file mode 100644 index 0000000..bc9a955 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/selenium-remote-driver-3.13.0.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/ui4j-webkit-3.1.0.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/ui4j-webkit-3.1.0.jar new file mode 100644 index 0000000..8c32ed1 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/ui4j-webkit-3.1.0.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/visualization-datasource-1.1.1.jar b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/visualization-datasource-1.1.1.jar new file mode 100644 index 0000000..8c0bf41 Binary files /dev/null and b/target/Final-0.0.1-SNAPSHOT/WEB-INF/lib/visualization-datasource-1.1.1.jar differ diff --git a/target/Final-0.0.1-SNAPSHOT/WEB-INF/web.xml b/target/Final-0.0.1-SNAPSHOT/WEB-INF/web.xml new file mode 100644 index 0000000..1848c7f --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/WEB-INF/web.xml @@ -0,0 +1,25 @@ + + + FantasyManager + + + index.jspindex.htmlindex.htm + + default.html + default.htm + default.jsp + + + + FreeAgent + FreeAgent + test.serv.Team + + + FreeAgent + /FreeAgent + + + + + \ No newline at end of file diff --git a/target/Final-0.0.1-SNAPSHOT/index.jsp b/target/Final-0.0.1-SNAPSHOT/index.jsp new file mode 100644 index 0000000..7c3f39c --- /dev/null +++ b/target/Final-0.0.1-SNAPSHOT/index.jsp @@ -0,0 +1,57 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + + + + + + +league + + + + + +

Choose League

+ +
+ +
+ +
+ Year :
+
+ League ID :
+
+
+
+
+
+ NBA Fantasy + +
+ + + + + \ No newline at end of file diff --git a/target/classes/call_content/CALL_Rebuild.class b/target/classes/call_content/CALL_Rebuild.class new file mode 100644 index 0000000..a245aff Binary files /dev/null and b/target/classes/call_content/CALL_Rebuild.class differ diff --git a/target/classes/call_content/GRAPH_CALL.class b/target/classes/call_content/GRAPH_CALL.class new file mode 100644 index 0000000..e008c53 Binary files /dev/null and b/target/classes/call_content/GRAPH_CALL.class differ diff --git a/target/classes/call_divs/CALL_DIV_maxPace.class b/target/classes/call_divs/CALL_DIV_maxPace.class new file mode 100644 index 0000000..f877966 Binary files /dev/null and b/target/classes/call_divs/CALL_DIV_maxPace.class differ diff --git a/target/classes/call_divs/CALL_DIV_team.class b/target/classes/call_divs/CALL_DIV_team.class new file mode 100644 index 0000000..7ffab14 Binary files /dev/null and b/target/classes/call_divs/CALL_DIV_team.class differ diff --git a/target/classes/call_divs/CALL_DIV_trade.class b/target/classes/call_divs/CALL_DIV_trade.class new file mode 100644 index 0000000..add2fd8 Binary files /dev/null and b/target/classes/call_divs/CALL_DIV_trade.class differ diff --git a/target/classes/call_pages/CALL_Fantasy.class b/target/classes/call_pages/CALL_Fantasy.class new file mode 100644 index 0000000..a5db4d0 Binary files /dev/null and b/target/classes/call_pages/CALL_Fantasy.class differ diff --git a/target/classes/call_pages/CALL_Team$ListOfStatComparator.class b/target/classes/call_pages/CALL_Team$ListOfStatComparator.class new file mode 100644 index 0000000..3432076 Binary files /dev/null and b/target/classes/call_pages/CALL_Team$ListOfStatComparator.class differ diff --git a/target/classes/call_pages/CALL_Team.class b/target/classes/call_pages/CALL_Team.class new file mode 100644 index 0000000..46f3472 Binary files /dev/null and b/target/classes/call_pages/CALL_Team.class differ diff --git a/target/classes/call_pages/CALL_Trade.class b/target/classes/call_pages/CALL_Trade.class new file mode 100644 index 0000000..83adadf Binary files /dev/null and b/target/classes/call_pages/CALL_Trade.class differ diff --git a/target/classes/call_pages/TESTcss.class b/target/classes/call_pages/TESTcss.class new file mode 100644 index 0000000..10fe289 Binary files /dev/null and b/target/classes/call_pages/TESTcss.class differ diff --git a/target/classes/functions/FA_testPlayer$ListOfStatComparator.class b/target/classes/functions/FA_testPlayer$ListOfStatComparator.class new file mode 100644 index 0000000..8723e97 Binary files /dev/null and b/target/classes/functions/FA_testPlayer$ListOfStatComparator.class differ diff --git a/target/classes/functions/FA_testPlayer.class b/target/classes/functions/FA_testPlayer.class new file mode 100644 index 0000000..6d85215 Binary files /dev/null and b/target/classes/functions/FA_testPlayer.class differ diff --git a/target/classes/functions/GRAPH_init.class b/target/classes/functions/GRAPH_init.class new file mode 100644 index 0000000..8219ad1 Binary files /dev/null and b/target/classes/functions/GRAPH_init.class differ diff --git a/target/classes/functions/GRAPH_rebuild.class b/target/classes/functions/GRAPH_rebuild.class new file mode 100644 index 0000000..b236c4d Binary files /dev/null and b/target/classes/functions/GRAPH_rebuild.class differ diff --git a/target/classes/functions/Main.class b/target/classes/functions/Main.class new file mode 100644 index 0000000..44b689b Binary files /dev/null and b/target/classes/functions/Main.class differ diff --git a/target/classes/functions/MySQLAccess.class b/target/classes/functions/MySQLAccess.class new file mode 100644 index 0000000..2b801d3 Binary files /dev/null and b/target/classes/functions/MySQLAccess.class differ diff --git a/target/classes/functions/PROJ_analysis.class b/target/classes/functions/PROJ_analysis.class new file mode 100644 index 0000000..f63ebf7 Binary files /dev/null and b/target/classes/functions/PROJ_analysis.class differ diff --git a/target/classes/functions/RANKS_fill.class b/target/classes/functions/RANKS_fill.class new file mode 100644 index 0000000..1458fcd Binary files /dev/null and b/target/classes/functions/RANKS_fill.class differ diff --git a/target/classes/functions/TRADE_test$ListOfStatComparator.class b/target/classes/functions/TRADE_test$ListOfStatComparator.class new file mode 100644 index 0000000..698d9a8 Binary files /dev/null and b/target/classes/functions/TRADE_test$ListOfStatComparator.class differ diff --git a/target/classes/functions/TRADE_test.class b/target/classes/functions/TRADE_test.class new file mode 100644 index 0000000..180426e Binary files /dev/null and b/target/classes/functions/TRADE_test.class differ diff --git a/target/classes/jsoupImport/ImportLineups.class b/target/classes/jsoupImport/ImportLineups.class new file mode 100644 index 0000000..67adcc8 Binary files /dev/null and b/target/classes/jsoupImport/ImportLineups.class differ diff --git a/target/classes/jsoupImport/ImportPlayerStats.class b/target/classes/jsoupImport/ImportPlayerStats.class new file mode 100644 index 0000000..c01311c Binary files /dev/null and b/target/classes/jsoupImport/ImportPlayerStats.class differ diff --git a/target/classes/jsoupImport/ImportPlayers.class b/target/classes/jsoupImport/ImportPlayers.class new file mode 100644 index 0000000..6f0d8fd Binary files /dev/null and b/target/classes/jsoupImport/ImportPlayers.class differ diff --git a/target/classes/jsoupImport/ImportTeams.class b/target/classes/jsoupImport/ImportTeams.class new file mode 100644 index 0000000..f7a4764 Binary files /dev/null and b/target/classes/jsoupImport/ImportTeams.class differ diff --git a/target/classes/jsoupImport/ImportVars.class b/target/classes/jsoupImport/ImportVars.class new file mode 100644 index 0000000..d1f3391 Binary files /dev/null and b/target/classes/jsoupImport/ImportVars.class differ diff --git a/target/classes/jsoupImport/LoadTester.class b/target/classes/jsoupImport/LoadTester.class new file mode 100644 index 0000000..549908f Binary files /dev/null and b/target/classes/jsoupImport/LoadTester.class differ diff --git a/target/classes/jsoupImport/geckodriver.exe b/target/classes/jsoupImport/geckodriver.exe new file mode 100644 index 0000000..cea74f2 Binary files /dev/null and b/target/classes/jsoupImport/geckodriver.exe differ diff --git a/target/classes/jsoupImport/phantomjs.exe b/target/classes/jsoupImport/phantomjs.exe new file mode 100644 index 0000000..c644886 Binary files /dev/null and b/target/classes/jsoupImport/phantomjs.exe differ diff --git a/target/classes/objects/League.class b/target/classes/objects/League.class new file mode 100644 index 0000000..35b02a5 Binary files /dev/null and b/target/classes/objects/League.class differ diff --git a/target/classes/objects/Player.class b/target/classes/objects/Player.class new file mode 100644 index 0000000..735364b Binary files /dev/null and b/target/classes/objects/Player.class differ diff --git a/target/classes/objects/Record.class b/target/classes/objects/Record.class new file mode 100644 index 0000000..509438c Binary files /dev/null and b/target/classes/objects/Record.class differ diff --git a/target/classes/objects/Slot.class b/target/classes/objects/Slot.class new file mode 100644 index 0000000..507ef28 Binary files /dev/null and b/target/classes/objects/Slot.class differ diff --git a/target/classes/objects/Stat.class b/target/classes/objects/Stat.class new file mode 100644 index 0000000..bd9ac03 Binary files /dev/null and b/target/classes/objects/Stat.class differ diff --git a/target/classes/objects/Teams.class b/target/classes/objects/Teams.class new file mode 100644 index 0000000..f15f0f6 Binary files /dev/null and b/target/classes/objects/Teams.class differ diff --git a/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF b/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF new file mode 100644 index 0000000..1fa94e7 --- /dev/null +++ b/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Built-By: lejay +Build-Jdk: 9.0.1 +Created-By: Maven Integration for Eclipse + diff --git a/target/m2e-wtp/web-resources/META-INF/maven/Final/Final/pom.properties b/target/m2e-wtp/web-resources/META-INF/maven/Final/Final/pom.properties new file mode 100644 index 0000000..cdded12 --- /dev/null +++ b/target/m2e-wtp/web-resources/META-INF/maven/Final/Final/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Tue Sep 14 01:15:05 CEST 2021 +m2e.projectLocation=C\:\\Users\\lejay\\eclipse-workspace\\Final +m2e.projectName=Final +groupId=Final +artifactId=Final +version=0.0.1-SNAPSHOT diff --git a/target/m2e-wtp/web-resources/META-INF/maven/Final/Final/pom.xml b/target/m2e-wtp/web-resources/META-INF/maven/Final/Final/pom.xml new file mode 100644 index 0000000..bc9f831 --- /dev/null +++ b/target/m2e-wtp/web-resources/META-INF/maven/Final/Final/pom.xml @@ -0,0 +1,108 @@ + + 4.0.0 + Final + Final + 0.0.1-SNAPSHOT + war + + src + + + maven-compiler-plugin + 3.7.0 + + 9 + + + + maven-war-plugin + 3.0.0 + + WebContent + + + + + + + + com.google.visualization + visualization-datasource + 1.1.1 + + + com.fasterxml.jackson.core + jackson-core + 2.9.2 + + + + com.fasterxml.jackson.core + jackson-annotations + 2.9.2 + + + + com.fasterxml.jackson.core + jackson-databind + 2.9.2 + + + org.jsoup + jsoup + 1.9.1 + + + + + com.google.code.gson + gson + 2.8.1 + + + + mysql + mysql-connector-java + 6.0.6 + + + io.webfolder + ui4j-webkit + 3.1.0 + + + + org.seleniumhq.selenium + selenium-server + 3.4.0 + + + + org.seleniumhq.selenium + selenium-firefox-driver + 3.4.0 + + + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + + + com.google.guava + guava + 21.0 + + + + com.codeborne + phantomjsdriver + 1.4.1 + + + + + + \ No newline at end of file diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..4166401 --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,4 @@ +#Created by Apache Maven 3.5.2 +groupId=Final +artifactId=Final +version=0.0.1-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..7ce36c1 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,30 @@ +functions\RANKS_fill.class +call_pages\CALL_Fantasy.class +jsoupImport\ImportPlayerStats.class +functions\FA_testPlayer$ListOfStatComparator.class +functions\GRAPH_init.class +functions\GRAPH_rebuild.class +objects\Teams.class +jsoupImport\ImportTeams.class +objects\Player.class +objects\Slot.class +call_divs\CALL_DIV_trade.class +call_divs\CALL_DIV_team.class +functions\PROJ_analysis.class +functions\MySQLAccess.class +functions\TRADE_test$ListOfStatComparator.class +jsoupImport\ImportPlayers.class +functions\GRAPH_CALL.class +call_pages\CALL_Trade.class +call_pages\TESTcss.class +functions\TRADE_test.class +objects\Record.class +jsoupImport\LoadTester.class +functions\CALL_Rebuild.class +objects\League.class +jsoupImport\ImportLineups.class +call_pages\CALL_Team.class +functions\FA_testPlayer.class +functions\Main.class +call_pages\CALL_Team$ListOfStatComparator.class +objects\Stat.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..a51a354 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,28 @@ +C:\Users\lejay\eclipse-workspace\Final\src\functions\GRAPH_rebuild.java +C:\Users\lejay\eclipse-workspace\Final\src\jsoupImport\ImportLineups.java +C:\Users\lejay\eclipse-workspace\Final\src\jsoupImport\ImportTeams.java +C:\Users\lejay\eclipse-workspace\Final\src\functions\RANKS_fill.java +C:\Users\lejay\eclipse-workspace\Final\src\call_pages\TESTcss.java +C:\Users\lejay\eclipse-workspace\Final\src\call_pages\CALL_Trade.java +C:\Users\lejay\eclipse-workspace\Final\src\jsoupImport\ImportPlayers.java +C:\Users\lejay\eclipse-workspace\Final\src\objects\Stat.java +C:\Users\lejay\eclipse-workspace\Final\src\objects\League.java +C:\Users\lejay\eclipse-workspace\Final\src\objects\Player.java +C:\Users\lejay\eclipse-workspace\Final\src\jsoupImport\ImportPlayerStats.java +C:\Users\lejay\eclipse-workspace\Final\src\functions\PROJ_analysis.java +C:\Users\lejay\eclipse-workspace\Final\src\functions\TRADE_test.java +C:\Users\lejay\eclipse-workspace\Final\src\objects\Slot.java +C:\Users\lejay\eclipse-workspace\Final\src\functions\FA_testPlayer.java +C:\Users\lejay\eclipse-workspace\Final\src\functions\Main.java +C:\Users\lejay\eclipse-workspace\Final\src\call_divs\CALL_DIV_trade.java +C:\Users\lejay\eclipse-workspace\Final\src\functions\GRAPH_CALL.java +C:\Users\lejay\eclipse-workspace\Final\src\functions\CALL_Rebuild.java +C:\Users\lejay\eclipse-workspace\Final\src\jsoupImport\LoadTester.java +C:\Users\lejay\eclipse-workspace\Final\src\objects\Teams.java +C:\Users\lejay\eclipse-workspace\Final\src\functions\MySQLAccess.java +C:\Users\lejay\eclipse-workspace\Final\src\functions\GRAPH_init.java +C:\Users\lejay\eclipse-workspace\Final\src\call_divs\CALL_DIV_team.java +C:\Users\lejay\eclipse-workspace\Final\src\call_pages\CALL_Fantasy.java +C:\Users\lejay\eclipse-workspace\Final\src\functions\DB_handler.java +C:\Users\lejay\eclipse-workspace\Final\src\objects\Record.java +C:\Users\lejay\eclipse-workspace\Final\src\call_pages\CALL_Team.java