-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.独立战绩模块并新增战绩模式筛选功能
- Loading branch information
Showing
18 changed files
with
233 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/yalong/site/frame/panel/history/GameModeBox.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package yalong.site.frame.panel.history; | ||
|
||
import yalong.site.frame.panel.base.BaseButton; | ||
|
||
import java.awt.event.ActionListener; | ||
|
||
/** | ||
* @author WuYi | ||
*/ | ||
public class GameModeBox extends BaseButton { | ||
private final GameModeBox gameModeBox; | ||
|
||
public GameModeBox() { | ||
gameModeBox = this; | ||
this.setText("筛选需要的模式"); | ||
this.addActionListener(actionListener()); | ||
} | ||
|
||
private ActionListener actionListener() { | ||
return e -> { | ||
GameModeSelectFrame selectFrame = new GameModeSelectFrame("选择模式"); | ||
selectFrame.setVisible(true); | ||
}; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/main/java/yalong/site/frame/panel/history/GameModeSelectFrame.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package yalong.site.frame.panel.history; | ||
|
||
import yalong.site.bo.GameQueue; | ||
import yalong.site.cache.FrameSetting; | ||
import yalong.site.cache.GameDataCache; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
/** | ||
* @author WuYi | ||
*/ | ||
public class GameModeSelectFrame extends JFrame { | ||
private final JPanel gameModePanel = new JPanel(); | ||
|
||
private final JPanel allPanel = new JPanel(); | ||
|
||
private final JFrame jFrame; | ||
|
||
public GameModeSelectFrame(String topic) { | ||
jFrame = this; | ||
Image image = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/assets/logo.png")); | ||
this.setIconImage(image); | ||
this.setSize(FrameSetting.CHAMPION_SELECT_WIDTH, FrameSetting.CHAMPION_SELECT_HEIGHT); | ||
//窗口居中 | ||
this.setLocationRelativeTo(null); | ||
this.setName(topic); | ||
|
||
createButtons(); | ||
|
||
gameModePanel.setPreferredSize(new Dimension(FrameSetting.CHAMPION_SELECT_WIDTH, FrameSetting.CHAMPION_SELECT_HEIGHT - 50)); | ||
allPanel.add(gameModePanel); | ||
this.add(allPanel); | ||
gameModePanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2)); | ||
} | ||
|
||
|
||
public void createButtons() { | ||
gameModePanel.removeAll(); | ||
for (Integer key : GameDataCache.selectGameQueueList.keySet()) { | ||
GameQueue gameQueue = GameDataCache.selectGameQueueList.get(key); | ||
|
||
JCheckBox button = new JCheckBox(gameQueue.getName()); | ||
button.setSelected(gameQueue.isSelect()); | ||
button.addActionListener(e -> { | ||
gameQueue.setSelect(true); | ||
} | ||
); | ||
button.setPreferredSize(new Dimension(250, 30)); | ||
gameModePanel.add(button); | ||
} | ||
gameModePanel.revalidate(); | ||
gameModePanel.repaint(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ite/frame/panel/client/HistoryButton.java → ...te/frame/panel/history/HistoryButton.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ite/frame/panel/client/HistoryDetail.java → ...te/frame/panel/history/HistoryDetail.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../site/frame/panel/client/HistoryLine.java → ...site/frame/panel/history/HistoryLine.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
src/main/java/yalong/site/frame/panel/history/HistoryPane.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package yalong.site.frame.panel.history; | ||
|
||
import yalong.site.frame.panel.base.BasePanel; | ||
import yalong.site.frame.panel.client.SendScoreCheckBox; | ||
import yalong.site.frame.panel.client.ShowTeamBox; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.util.ArrayList; | ||
|
||
/** | ||
* @author WuYi | ||
*/ | ||
public class HistoryPane extends BasePanel { | ||
public HistoryPane() { | ||
this.setName("战绩"); | ||
} | ||
|
||
private static ArrayList<Component> loadAllPanel() { | ||
ArrayList<Component> list = new ArrayList<>(); | ||
|
||
list.add(new SendScoreCheckBox()); | ||
list.add(new ShowTeamBox()); | ||
list.add(new GameModeBox()); | ||
|
||
list.add(new HistoryButton()); | ||
list.add(new JPanel()); | ||
list.add(new JPanel()); | ||
|
||
list.add(new JPanel()); | ||
list.add(new JPanel()); | ||
list.add(new JPanel()); | ||
|
||
list.add(new JPanel()); | ||
list.add(new JPanel()); | ||
list.add(new JPanel()); | ||
|
||
list.add(new JPanel()); | ||
list.add(new JPanel()); | ||
list.add(new JPanel()); | ||
|
||
return list; | ||
} | ||
|
||
public static HistoryPane builder() { | ||
HistoryPane historyPane = new HistoryPane(); | ||
GridBagLayout layout = new GridBagLayout(); | ||
historyPane.setLayout(layout); | ||
ArrayList<Component> list = loadAllPanel(); | ||
for (int i = 0; i < list.size(); i++) { | ||
int y = i / 2; | ||
int x = i % 2; | ||
GridBagConstraints grid = new GridBagConstraints( | ||
// 第(0,0)个格子 | ||
x, y, | ||
// 占1列,占1行 | ||
1, 1, | ||
//横向占100%长度,纵向占100%长度 | ||
1, 1, | ||
//居中,组件小的话就两边铺满窗格 | ||
GridBagConstraints.CENTER, GridBagConstraints.NONE, | ||
// 窗格之间的距离 | ||
new Insets(0, 0, 0, 0), | ||
// 增加组件的首选宽度和高度 | ||
0, 0 | ||
); | ||
historyPane.add(list.get(i), grid); | ||
} | ||
return historyPane; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.