Commit 2223c545 authored by YuFan Jia's avatar YuFan Jia 💤
Browse files

feat( ):

parent 76f9b52a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -11,6 +11,10 @@ public class BasicBackground {
	public static StartMenuUI thisStartMenuUI;
	public static JFrame backFrame;

	public static Font standardFont(int size) {
		return new Font("Calibri", Font.PLAIN, size);
	}

	public BasicBackground() {
		initComponents();
		thisChessGameUI = new ChessGameUI();
+5 −3
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ package GameUI;
import java.awt.*;
import java.awt.event.*;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.DecimalFormat;

import javax.swing.*;
@@ -42,10 +43,10 @@ public class ChessGameUI extends JPanel {
			thisGameCore.setImportpath(tem);
	}

	private void exportButtonActionPerformed() throws FileNotFoundException {// export按钮触发事件
	private void exportButtonActionPerformed() throws IOException {// export按钮触发事件
		String tem = new FileChooser(false).Path();
		if (tem != null) {
			thisGameCore.setImportpath(tem);
			thisGameCore.setExportPath(tem);
		}
	}

@@ -155,7 +156,8 @@ public class ChessGameUI extends JPanel {
				exportButton.addActionListener(e -> {
					try {
						exportButtonActionPerformed();
					} catch (FileNotFoundException e1) {

					} catch (IOException e1) {
						// TODO Auto-generated catch block
						e1.printStackTrace();
					}
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ public class PlayerName extends JPanel {

		// ======== WhitePlayerImage ========
		{

			WhitePlayerImage.setPreferredSize(new DimensionUIResource(70, 70));
		}

+18 −5
Original line number Diff line number Diff line
package GameUI;

import java.awt.*;
import java.io.FileNotFoundException;

import javax.swing.*;
import javax.swing.plaf.basic.BasicHTML;

/**
 * @author uint44t
@@ -21,9 +22,14 @@ public class StartMenuUI extends JPanel {
		BasicBackground.thisChessGameUI.thisGameCore.restart();
	}

	private void loadButtonActionPerformed() {
		new FileChooser(true);
		// todo: add import methord
	private void loadButtonActionPerformed() throws FileNotFoundException {
		String tem = new FileChooser(true).Path();
		if (tem != null) {
			BasicBackground.thisChessGameUI.thisGameCore.setImportpath(tem);
			BasicBackground.backFrame.remove(BasicBackground.thisStartMenuUI);
			BasicBackground.changePanel(BasicBackground.thisChessGameUI);
		}

	}

	private void exitButtonActionPerformed() {
@@ -100,7 +106,14 @@ public class StartMenuUI extends JPanel {
					// ---- loadButton ----
					loadButton.setText("Load");
					loadButton.setFont(buttonsStandard);
					loadButton.addActionListener(e -> loadButtonActionPerformed());
					loadButton.addActionListener(e -> {
						try {
							loadButtonActionPerformed();
						} catch (FileNotFoundException e1) {
							// TODO Auto-generated catch block
							e1.printStackTrace();
						}
					});
					panel4.add(loadButton);
				}
				panel2.add(panel4);
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public class StatusUI extends JPanel {
		JPanel scorePanel = new JPanel();
		JLabel ScoreTitle = new JLabel();
		JLabel vacant = new JLabel();
		Font standard = new Font("\u6977\u4f53", Font.BOLD, 18);
		Font standard = BasicBackground.standardFont(18);

		// ======== scorePanel ========
		{
Loading