Skip to content

Commit d1dd781

Browse files
enable to connect to database through network
enable to read config from file
1 parent 8f28be8 commit d1dd781

File tree

287 files changed

+4719
-1234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

287 files changed

+4719
-1234
lines changed

Diff for: .classpath

+6-23
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="src" output="target/classes" path="src/main/java">
4-
<attributes>
5-
<attribute name="optional" value="true"/>
6-
<attribute name="maven.pomderived" value="true"/>
7-
</attributes>
8-
</classpathentry>
9-
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
10-
<attributes>
11-
<attribute name="optional" value="true"/>
12-
<attribute name="maven.pomderived" value="true"/>
13-
</attributes>
14-
</classpathentry>
15-
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
16-
<attributes>
17-
<attribute name="maven.pomderived" value="true"/>
18-
</attributes>
19-
</classpathentry>
20-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
21-
<attributes>
22-
<attribute name="maven.pomderived" value="true"/>
23-
</attributes>
24-
</classpathentry>
3+
<classpathentry kind="src" path="src/main/java"/>
4+
<classpathentry kind="src" path="src/test/java"/>
5+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
256
<classpathentry kind="lib" path="batik-all-1.7.jar"/>
267
<classpathentry kind="lib" path="xml-apis-ext.jar"/>
27-
<classpathentry kind="output" path="target/classes"/>
8+
<classpathentry kind="lib" path="lib/derbyclient.jar"/>
9+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
10+
<classpathentry kind="output" path="bin"/>
2811
</classpath>

Diff for: .settings/org.eclipse.jdt.core.prefs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
eclipse.preferences.version=1
2-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
3-
org.eclipse.jdt.core.compiler.compliance=1.7
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.compliance=1.8
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
47
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5-
org.eclipse.jdt.core.compiler.source=1.7
8+
org.eclipse.jdt.core.compiler.source=1.8

Diff for: .svn/pristine/93/932388894265a617c36a7db6f942d017331660e5.svn-base renamed to .svn/pristine/0b/0bea349730299405f5ed2e6f71872eeea34f8801.svn-base

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class CardPanel extends Transparent_Panel{
3131
* @param panel
3232
* @param key
3333
*/
34-
void addPanel(JPanel panel, String key){
34+
public void addPanel(JPanel panel, String key){
3535
this.add(panel, key);
3636
}
3737

Diff for: .svn/pristine/92/92ab5cf7e2fc6c39bbc0dee3ddc59e80a0b7e9d5.svn-base renamed to .svn/pristine/0d/0d4ca4c2785be60353f5ee2f480aa23407c97827.svn-base

+30-30
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ public class TeamLogo extends JPanel{
5757

5858
private void setCentral(){
5959
CHI.setLocation(15, 0);
60-
MyLabel chiLabel = new MyLabel("Bulls", new Dimension(120,20), 5, 90);
60+
MyLabel chiLabel = new MyLabel("Bulls", new Dimension(120,20), (int) (CHI.getX()-CHI.getWidth()/6.5), 90);
6161
CLE.setLocation(15, 120);
62-
MyLabel cleLabel = new MyLabel("Cavaliers", new Dimension(120,20), 5, 210);
62+
MyLabel cleLabel = new MyLabel("Cavaliers", new Dimension(120,20), (int) (CHI.getX()-CHI.getWidth()/6.5), 210);
6363
DET.setLocation(15, 240);
64-
MyLabel detLabel = new MyLabel("Pistons", new Dimension(120,20), 5, 330);
64+
MyLabel detLabel = new MyLabel("Pistons", new Dimension(120,20), (int) (CHI.getX()-CHI.getWidth()/6.5), 330);
6565
IND.setLocation(15, 360);
66-
MyLabel indLabel = new MyLabel("Pacers", new Dimension(120,20), 5, 450);
66+
MyLabel indLabel = new MyLabel("Pacers", new Dimension(120,20), (int) (CHI.getX()-CHI.getWidth()/6.5), 450);
6767
MIL.setLocation(15, 480);
68-
MyLabel milLabel = new MyLabel("Bucks", new Dimension(120,20), 5, 570);
68+
MyLabel milLabel = new MyLabel("Bucks", new Dimension(120,20), (int) (CHI.getX()-CHI.getWidth()/6.5), 570);
6969
add(CHI);
7070
add(CLE);
7171
add(DET);
@@ -80,15 +80,15 @@ public class TeamLogo extends JPanel{
8080

8181
private void setAtlantic(){
8282
BKN.setLocation(153, 0);
83-
MyLabel bknLabel = new MyLabel("Nets", new Dimension(120,20), 143, 90);
83+
MyLabel bknLabel = new MyLabel("Nets", new Dimension(120,20), (int) (BKN.getX()-BKN.getWidth()/6.5), 90);
8484
NYK.setLocation(153, 120);
85-
MyLabel nykLabel = new MyLabel("Knicks", new Dimension(120,20), 143, 210);
85+
MyLabel nykLabel = new MyLabel("Knicks", new Dimension(120,20), (int) (BKN.getX()-BKN.getWidth()/6.5), 210);
8686
PHI.setLocation(153, 240);
87-
MyLabel phiLabel = new MyLabel("76ers", new Dimension(120,20), 143, 330);
87+
MyLabel phiLabel = new MyLabel("76ers", new Dimension(120,20), (int) (BKN.getX()-BKN.getWidth()/6.5), 330);
8888
TOR.setLocation(153, 360);
89-
MyLabel torLabel = new MyLabel("Raptors", new Dimension(120,20), 143, 450);
89+
MyLabel torLabel = new MyLabel("Raptors", new Dimension(120,20), (int) (BKN.getX()-BKN.getWidth()/6.5), 450);
9090
BOS.setLocation(153, 480);
91-
MyLabel bosLabel = new MyLabel("Celtics", new Dimension(120,20), 143, 570);
91+
MyLabel bosLabel = new MyLabel("Celtics", new Dimension(120,20), (int) (BKN.getX()-BKN.getWidth()/6.5), 570);
9292
add(BKN);
9393
add(NYK);
9494
add(PHI);
@@ -103,15 +103,15 @@ public class TeamLogo extends JPanel{
103103

104104
private void setSouthEast(){
105105
ATL.setLocation(290, 0);
106-
MyLabel atlLabel = new MyLabel("Hawks", new Dimension(120,20), 290, 90);
106+
MyLabel atlLabel = new MyLabel("Hawks", new Dimension(120,20), (int) (ATL.getX()-ATL.getWidth()/6.5), 90);
107107
CHA.setLocation(290, 120);
108-
MyLabel chaLabel = new MyLabel("Hornets", new Dimension(120,20), 290, 210);
108+
MyLabel chaLabel = new MyLabel("Hornets", new Dimension(120,20), (int) (ATL.getX()-ATL.getWidth()/6.5), 210);
109109
MIA.setLocation(290, 240);
110-
MyLabel miaLabel = new MyLabel("Heat", new Dimension(120,20), 290, 330);
110+
MyLabel miaLabel = new MyLabel("Heat", new Dimension(120,20), (int) (ATL.getX()-ATL.getWidth()/6.5), 330);
111111
ORL.setLocation(290, 360);
112-
MyLabel orlLabel = new MyLabel("Magic", new Dimension(120,20), 290, 450);
112+
MyLabel orlLabel = new MyLabel("Magic", new Dimension(120,20), (int) (ATL.getX()-ATL.getWidth()/6.5), 450);
113113
WAS.setLocation(290, 480);
114-
MyLabel wasLabel = new MyLabel("Wizards", new Dimension(120,20), 290, 570);
114+
MyLabel wasLabel = new MyLabel("Wizards", new Dimension(120,20), (int) (ATL.getX()-ATL.getWidth()/6.5), 570);
115115
add(ATL);
116116
add(atlLabel);
117117
add(CHA);
@@ -126,15 +126,15 @@ public class TeamLogo extends JPanel{
126126

127127
private void setNorthWest(){
128128
DEN.setLocation(428, 0);
129-
MyLabel denLabel = new MyLabel("Nuggets", new Dimension(120,20), 418, 90);
129+
MyLabel denLabel = new MyLabel("Nuggets", new Dimension(120,20), (int) (DEN.getX()-DEN.getWidth()/6.5), 90);
130130
MIN.setLocation(428, 120);
131-
MyLabel minLabel = new MyLabel("Timberwolves", new Dimension(120,20), 418, 210);
131+
MyLabel minLabel = new MyLabel("Timberwolves", new Dimension(120,20), (int) (DEN.getX()-DEN.getWidth()/6.5), 210);
132132
OKC.setLocation(428, 240);
133-
MyLabel okcLabel = new MyLabel("Thunder", new Dimension(120,20), 418, 330);
133+
MyLabel okcLabel = new MyLabel("Thunder", new Dimension(120,20), (int) (DEN.getX()-DEN.getWidth()/6.5), 330);
134134
POR.setLocation(428, 360);
135-
MyLabel porLabel = new MyLabel("Trail Blazers", new Dimension(120,20), 418, 450);
135+
MyLabel porLabel = new MyLabel("Trail Blazers", new Dimension(120,20), (int) (DEN.getX()-DEN.getWidth()/6.5), 450);
136136
UTA.setLocation(428, 480);
137-
MyLabel utaLabel = new MyLabel("Jazz", new Dimension(120,20), 418, 570);
137+
MyLabel utaLabel = new MyLabel("Jazz", new Dimension(120,20), (int) (DEN.getX()-DEN.getWidth()/6.5), 570);
138138
add(DEN);
139139
add(MIN);
140140
add(OKC);
@@ -149,15 +149,15 @@ public class TeamLogo extends JPanel{
149149

150150
private void setSouthWest(){
151151
DAL.setLocation(702, 0);
152-
MyLabel dalLabel = new MyLabel("Mavericks", new Dimension(120,20), 692, 90);
152+
MyLabel dalLabel = new MyLabel("Mavericks", new Dimension(120,20), (int) (DAL.getX()-DAL.getWidth()/6.5), 90);
153153
HOU.setLocation(702, 120);
154-
MyLabel houLabel = new MyLabel("Rockets", new Dimension(120,20), 692, 210);
154+
MyLabel houLabel = new MyLabel("Rockets", new Dimension(120,20), (int) (DAL.getX()-DAL.getWidth()/6.5), 210);
155155
MEM.setLocation(702, 240);
156-
MyLabel memLabel = new MyLabel("Grizzlies", new Dimension(120,20), 692, 330);
156+
MyLabel memLabel = new MyLabel("Grizzlies", new Dimension(120,20), (int) (DAL.getX()-DAL.getWidth()/6.5), 330);
157157
NOP.setLocation(702, 360);
158-
MyLabel nopLabel = new MyLabel("Pelicans", new Dimension(120,20), 692, 450);
158+
MyLabel nopLabel = new MyLabel("Pelicans", new Dimension(120,20), (int) (DAL.getX()-DAL.getWidth()/6.5), 450);
159159
SAS.setLocation(702, 480);
160-
MyLabel sasLabel = new MyLabel("Spurs", new Dimension(120,20), 692, 570);
160+
MyLabel sasLabel = new MyLabel("Spurs", new Dimension(120,20), (int) (DAL.getX()-DAL.getWidth()/6.5), 570);
161161
add(DAL);
162162
add(HOU);
163163
add(MEM);
@@ -172,15 +172,15 @@ public class TeamLogo extends JPanel{
172172

173173
private void setPacific(){
174174
GSW.setLocation(564, 0);
175-
MyLabel gswLabel = new MyLabel("Warriors", new Dimension(120,20), 564, 90);
175+
MyLabel gswLabel = new MyLabel("Warriors", new Dimension(120,20), (int) (GSW.getX()-GSW.getWidth()/6.5), 90);
176176
LAC.setLocation(564, 120);
177-
MyLabel lacLabel = new MyLabel("Clippers", new Dimension(120,20), 564, 210);
177+
MyLabel lacLabel = new MyLabel("Clippers", new Dimension(120,20), (int) (GSW.getX()-GSW.getWidth()/6.5), 210);
178178
LAL.setLocation(564, 240);
179-
MyLabel lalLabel = new MyLabel("Lakers", new Dimension(120,20), 564, 330);
179+
MyLabel lalLabel = new MyLabel("Lakers", new Dimension(120,20), (int) (GSW.getX()-GSW.getWidth()/6.5), 330);
180180
PHX.setLocation(564, 360);
181-
MyLabel phxLabel = new MyLabel("Suns", new Dimension(120,20), 564, 450);
181+
MyLabel phxLabel = new MyLabel("Suns", new Dimension(120,20), (int) (GSW.getX()-GSW.getWidth()/6.5), 450);
182182
SAC.setLocation(564, 480);
183-
MyLabel sacLabel = new MyLabel("Kings", new Dimension(120,20), 564, 570);
183+
MyLabel sacLabel = new MyLabel("Kings", new Dimension(120,20), (int) (GSW.getX()-GSW.getWidth()/6.5), 570);
184184
add(GSW);
185185
add(LAC);
186186
add(LAL);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package presentation.panel;
2+
3+
import java.awt.Dimension;
4+
5+
import javax.swing.JTextField;
6+
7+
import presentation.button.ControlButton;
8+
import presentation.button.SearchButton;
9+
import presentation.command.PlayerLastPageCommand;
10+
import presentation.command.PlayerNextPageCommand;
11+
import presentation.common.Admin;
12+
import presentation.common.ImgSys;
13+
import presentation.common.Transparent_Panel;
14+
import presentation.table.PlayerTable;
15+
16+
/**
17+
* 球员查询界面
18+
* @author HCW
19+
*
20+
*/
21+
public class PlayerListPanel extends Transparent_Panel{
22+
23+
/**
24+
*
25+
*/
26+
private static final long serialVersionUID = 1L;
27+
28+
private JTextField input;
29+
private SearchButton searchButton;
30+
private ControlButton nextPage;
31+
private ControlButton lastPage;
32+
33+
34+
public PlayerListPanel(int width, int height) {
35+
super(width, height);
36+
PlayerTable table = new PlayerTable((int) (width-50*Admin.proportion), (int)(height-200*Admin.proportion), (int) (getX()+25*Admin.proportion), (int) (getY()+80*Admin.proportion));
37+
input = new JTextField("请输入球员名字");
38+
input.setBounds((int) (5*Admin.proportion), (int) (5*Admin.proportion), (int) (100*Admin.proportion), (int) (25*Admin.proportion));
39+
searchButton = new SearchButton("search", new Dimension((int) (58*Admin.proportion), (int) (25*Admin.proportion)), (int) (115*Admin.proportion), (int) (5*Admin.proportion));
40+
nextPage = new ControlButton(new PlayerNextPageCommand(table),"next", new Dimension((int) (40*Admin.proportion),(int) (40*Admin.proportion)), (int) (getX()+600*Admin.proportion), (int) (getY() + 380*Admin.proportion));
41+
nextPage.setImg(ImgSys.nextPage);
42+
lastPage = new ControlButton(new PlayerLastPageCommand(table),"last", new Dimension((int) (40*Admin.proportion),(40)), (int) (getX()+200*Admin.proportion), (int) (getY() + 380*Admin.proportion));
43+
lastPage.setImg(ImgSys.lastPage);
44+
add(nextPage);
45+
add(lastPage);
46+
add(input);
47+
add(searchButton);
48+
add(table);
49+
}
50+
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package utility;
2+
3+
import java.io.File;
4+
import java.io.FileNotFoundException;
5+
import java.util.HashMap;
6+
import java.util.Scanner;
7+
8+
9+
public class Config {
10+
private static HashMap<String, String> configInfo;
11+
static{
12+
configInfo = new HashMap<String, String>();
13+
Scanner scanner = null;
14+
try {
15+
scanner = new Scanner(new File("config.conf"));
16+
} catch (FileNotFoundException e) {
17+
e.printStackTrace();
18+
}
19+
String line;
20+
String info[];
21+
while (scanner.hasNext()){
22+
line = scanner.nextLine();
23+
info = line.split("[=]");
24+
configInfo.put(info[0], info[1]);
25+
}
26+
scanner.close();
27+
}
28+
public static String getInfo(String infoName){
29+
return configInfo.get(infoName);
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package presentation.command;
2+
3+
import presentation.common.Admin;
4+
import presentation.main.UIController;
5+
import presentation.panel.TeamDataPanel;
6+
7+
public class TeamMoreCommand implements Command{
8+
9+
private String teamName;
10+
11+
public TeamMoreCommand(String name) {
12+
teamName = name;
13+
}
14+
15+
@Override
16+
public void excute() {
17+
UIController.getInstance().addPanel(new TeamDataPanel((int)(840*Admin.proportion), (int)(477*Admin.proportion), teamName), teamName+"data");
18+
UIController.getInstance().jumpTo(teamName+"data");
19+
}
20+
21+
}
Binary file not shown.

0 commit comments

Comments
 (0)