基于JavaFX实现的公园游船租船系统【软件工程】


问题描述

公园里有一个码头。管理人员想开发一个船舶管理系统。要求是:当游客租用船只时,管理员输入 S 以表示游客开始租用;管理员输入E以结束游客的租用,如此为一个租船的周期。一天结束后,需要打印输出租船的次数平均租船时间

其他需求

  • 输出最长一次租用的时间
  • 根据上午和下午的不同情况进行输出
  • 当与船只的通信出现问题时,可以对不完整的租用和归还信息进行删除(提示:考虑如船只丢失的情况)

主要实现功能

  • 图形化的操作页面,较好的用户交互
  • 实现了多个船只的租借和归还控制,并显示其当前的租用状态(可租用/租用中/已丢失)
  • 对于单个船只,点击船只出图标可选中,选中后可执行租用、归还操作,可以显示其租出、归还时间,租用时长以及该船只的被租用次数
  • 输出上午、下午、完整一天的统计信息,包括所有船只总租用次数、平均租用时长、最长租用时间
  • 设置公园开门和关门按钮,公园关门后会清楚重置数据,假如此时有船只正在租用未归坏,则判定其为丢失状态

改进建议

  • 优化对“船只丢失”问题的判定处理,实现类似船只寻呼的功能,如在船只丢失时模拟像船只发送信号,当若干次或限定时间内船只无回应则认为其丢失

成果展示


              

          


完整代码

https://github.com/HeyDYF/Rent-Boat

注:项目运行依赖JavaFX库需要JDK8及以上版本


​​​​​​​​核心代码

  • ​​​​​​​HelloApplication.java: 用于启动JavaFX应用程序​​​​​​​,创建stage,加载布局文件
  • HelloController.java: 控制界面元素和处理事件逻辑
  • hello-view.fxml: 使用XML格式定义界面中的组件布局和属性

​​​​​​​HelloApplication.java

package com.example.boat;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import java.io.IOException;
public class HelloApplication extends Application {
    @Override
    public void start(Stage stage) throws IOException {
        FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml"));
//        Scene scene = new Scene(fxmlLoader.load(), 1200, 800);

        Scene scene = new Scene(fxmlLoader.load());
        stage.setTitle("超级无敌租船系统");

        stage.setScene(scene);
        stage.getIcons().add(new Image("file:src/main/resources/img/boatLogo.png"));

        stage.show();
    }

    public static void main(String[] args) {

        launch();
    }
}

HelloController.java

package com.example.boat;

import javafx.event.ActionEvent;

import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class HelloController {

    long WholeTime = 0;
    long WholeTime_Day = 0;
    long WholeTime_Night = 0;
    int WholeCount = 0;
    int WholeCount_Day = 0;
    int WholeCount_Night = 0;
    long WholeMax = 0;
    long WholeMax_Day = 0;
    long WholeMax_Night = 0;


    int ParkFlag = 1;

    public class Boat {
        long Time_Start;
        long Time_End;

        long Time_Total;
        int Condition = 1;
        int numRent = 0;


    }

    Boat CurBoat = new Boat();
    Boat Boat1 = new Boat();

    Boat Boat2 = new Boat();
    Boat Boat3 = new Boat();
    Boat Boat4 = new Boat();

    @FXML
    Label Label_CurTime;
    @FXML
    Label Label_TotalTime;
    //Label_CurTime.Text(dateTimeString);
    Date now = new Date();
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String dateTimeString = df.format(now);


    @FXML
    private Label Label_Condition_CurBoat;

    @FXML
    private Label Label_Boat1_Condition;
    @FXML
    private Label Label_Boat2_Condition;
    @FXML
    private Label Label_Boat3_Condition;
    @FXML
    private Label Label_Boat4_Condition;


    @FXML
    private Pane Pane_CurBoat;

    Date date1;
    Date date2;
    Date date3;
    Date date4;
    @FXML
    private Label Label_Num_CurBoat;


    @FXML
    private TextArea text;


    @FXML
    void Button_Start_Click(ActionEvent event) {
        if (ParkFlag == 1) {
            if (CurBoat.Condition == 1) {
                Label_TotalTime.setText("");
                Date now = new Date();
                DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                String dateTimeString = df.format(now);

                Pane_CurBoat.setStyle("-fx-border-color: black; -fx-background-color:#FFD700; -fx-border-width: 5");
                Label_Condition_CurBoat.setText("状态:租用中");
                String str = String.valueOf(CurBoat.numRent);
                Label_Count.setText(str);

                if (CurBoat == Boat1) {
                    CurBoat.Time_Start = now.getTime();
                    date1 = now;
                    Boat1.Time_Start = CurBoat.Time_Start;
                    Pane_Boat_1.setStyle("-fx-border-color: black; -fx-background-color: #FFD700; -fx-border-width: 5");
                    Label_Boat1_Condition.setText("租用中");
                    CurBoat.Condition = Boat1.Condition = 0;
                }
                if (CurBoat == Boat2) {
                    date2 = now;
                    CurBoat.Time_Start = now.getTime();
                    Boat2.Time_Start = CurBoat.Time_Start;
                    Pane_Boat_2.setStyle("-fx-border-color: black; -fx-background-color: #FFD700; -fx-border-width: 5");
                    Label_Boat2_Condition.setText("租用中");
                    CurBoat.Condition = Boat2.Condition = 0;
                }
                if (CurBoat == Boat3) {
                    date3 = now;
                    CurBoat.Time_Start = now.getTime();
                    Boat3.Time_Start = CurBoat.Time_Start;
                    Pane_Boat_3.setStyle("-fx-border-color: black; -fx-background-color: #FFD700; -fx-border-width: 5");
                    Label_Boat3_Condition.setText("租用中");
                    CurBoat.Condition = Boat3.Condition = 0;
                }
                if (CurBoat == Boat4) {
                    date4 = now;
                    CurBoat.Time_Start = now.getTime();
                    Boat4.Time_Start = CurBoat.Time_Start;
                    Pane_Boat_4.setStyle("-fx-border-color: black; -fx-background-color: #FFD700; -fx-border-width: 5");
                    Label_Boat4_Condition.setText("租用中");
                    CurBoat.Condition = Boat4.Condition = 0;

                }
//                text.appendText("租出时间" + dateTimeString + "\n");

                CurBoat.Condition = 0;
                Label_StartTime.setText(dateTimeString);
                Label_EndTime.setText(" ");
            }
        }
    }

    @FXML
    private Label Label_Count;

    @FXML
    void Button_End_Click(ActionEvent event) {
        if (ParkFlag == 1) {
            if (CurBoat.Condition == 0) {

                Date now = new Date();
                DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                String dateTimeString = df.format(now);
                Pane_CurBoat.setStyle("-fx-border-color: black; -fx-background-color:	#2E8B57; -fx-border-width: 5");
                Label_Condition_CurBoat.setText("状态:可租用");
                if (CurBoat == Boat1) {
                    CurBoat.Time_End = now.getTime();
                    Boat1.Time_End = CurBoat.Time_End;
                    Pane_Boat_1.setStyle("-fx-border-color: black; -fx-background-color: 	#2E8B57; -fx-border-width: 5");
                    Label_Boat1_Condition.setText("可租用");
                    CurBoat.Condition = Boat1.Condition = 1;
                    Boat1.Time_Total = Boat1.Time_End - Boat1.Time_Start;


                }
                if (CurBoat == Boat2) {
                    CurBoat.Time_End = now.getTime();
                    Boat2.Time_End = CurBoat.Time_End;
                    Pane_Boat_2.setStyle("-fx-border-color: black; -fx-background-color: 	#2E8B57; -fx-border-width: 5");
                    Label_Boat2_Condition.setText("可租用");
                    CurBoat.Condition = Boat2.Condition = 1;
                    Boat2.Time_Total = Boat2.Time_End - Boat2.Time_Start;


                }
                if (CurBoat == Boat3) {
                    CurBoat.Time_End = now.getTime();
                    Boat3.Time_End = CurBoat.Time_End;
                    Pane_Boat_3.setStyle("-fx-border-color: black; -fx-background-color: 	#2E8B57; -fx-border-width: 5");
                    Label_Boat3_Condition.setText("可租用");
                    CurBoat.Condition = Boat3.Condition = 1;
                    Boat3.Time_Total = Boat3.Time_End - Boat3.Time_Start;

                }
                if (CurBoat == Boat4) {
                    CurBoat.Time_End = now.getTime();
                    Boat4.Time_End = CurBoat.Time_End;
                    Pane_Boat_4.setStyle("-fx-border-color: black; -fx-background-color: 	#2E8B57; -fx-border-width: 5");
                    Label_Boat4_Condition.setText("可租用");
                    CurBoat.Condition = Boat4.Condition = 1;
                    Boat4.Time_Total = Boat4.Time_End - Boat4.Time_Start;

                }
//                text.appendText("归还时间" + dateTimeString + "\n");

                CurBoat.numRent += 1;

                WholeCount += 1;

                if (now.getHours() < 12) {
                    WholeCount_Day += 1;
                }
                if (now.getHours() >= 12) {
                    WholeCount_Night += 1;
                }

                CurBoat.Time_Total = CurBoat.Time_End - CurBoat.Time_Start;
                String str = String.valueOf(Long.valueOf(CurBoat.Time_Total) / 1000);
                String str1 = String.valueOf(Long.valueOf(CurBoat.Time_Total) / 1000 / 60);//分钟
                String str2 = String.valueOf(Long.valueOf(CurBoat.Time_Total) / 1000 % 60);//分钟

                Label_TotalTime.setText(str1 + "分" + str2 + "秒");
//                text.appendText("合计时间:" + str + "秒\n");

                WholeTime += CurBoat.Time_Total;
                if (WholeMax < CurBoat.Time_Total) {
                    WholeMax = CurBoat.Time_Total;

                }
                if (now.getHours() < 12) {
                    WholeTime_Day += CurBoat.Time_Total;
                    if (WholeMax_Day < CurBoat.Time_Total) {
                        WholeMax_Day = CurBoat.Time_Total;
                    }
                }

                if (now.getHours() >= 12) {
                    WholeTime_Night += CurBoat.Time_Total;

                    if (WholeMax_Night < CurBoat.Time_Total) {
                        WholeMax_Night = CurBoat.Time_Total;
                    }
                }

                String str3 = String.valueOf(CurBoat.numRent);
                Label_Count.setText(str3);
                CurBoat.Condition = 1;
                Label_EndTime.setText(dateTimeString);
            }
        }
    }

    @FXML
    private Pane Pane_Boat_1;
    @FXML
    private Pane Pane_Boat_2;
    @FXML
    private Pane Pane_Boat_3;
    @FXML

    private Pane Pane_Boat_4;
    @FXML
    private Label Label_StartTime;
    @FXML
    private Label Label_EndTime;


    @FXML
    void Pane_Boat_1_Click(MouseEvent event) {
        if (ParkFlag == 1) {
            CurBoat = Boat1;
            Label_Num_CurBoat.setText("编号:1号船");

            Pane_CurBoat.setStyle("-fx-border-color: black; -fx-background-color: #4169E1; -fx-border-width: 5");
            Label_Condition_CurBoat.setText("状态:已选中");
            if (CurBoat.Condition == 1) {

                Label_StartTime.setText("");
                Label_EndTime.setText("");
                Label_TotalTime.setText("");

            }
            if (CurBoat.Condition == 0) {
                String Date1 = df.format(date1);
                Label_StartTime.setText(Date1);
                Label_EndTime.setText("");
                Label_TotalTime.setText("");

            }
            String str = String.valueOf(CurBoat.numRent);
            Label_Count.setText(str);
        }
    }

    @FXML
    void Pane_Boat_2_Click(MouseEvent event) {
        if (ParkFlag == 1) {
            CurBoat = Boat2;
            Label_Num_CurBoat.setText("编号:2号船");

            Pane_CurBoat.setStyle("-fx-border-color: black; -fx-background-color: #4169E1; -fx-border-width: 5");
            Label_Condition_CurBoat.setText("状态:已选中");
            if (CurBoat.Condition == 1) {

                Label_StartTime.setText("");
                Label_EndTime.setText("");
                Label_TotalTime.setText("");

            }
            if (CurBoat.Condition == 0) {
                String Date2 = df.format(date2);
                Label_StartTime.setText(Date2);
                Label_EndTime.setText("");
                Label_TotalTime.setText("");

            }
            String str = String.valueOf(CurBoat.numRent);
            Label_Count.setText(str);
        }
    }

    @FXML
    void Pane_Boat_3_Click(MouseEvent event) {
        if (ParkFlag == 1) {
            CurBoat = Boat3;
            Label_Num_CurBoat.setText("编号:3号船");

            Pane_CurBoat.setStyle("-fx-border-color: black; -fx-background-color: #4169E1; -fx-border-width: 5");
            Label_Condition_CurBoat.setText("状态:已选中");
            if (CurBoat.Condition == 1) {

                Label_StartTime.setText("");
                Label_EndTime.setText("");
                Label_TotalTime.setText("");

            }
            if (CurBoat.Condition == 0) {
                String Date3 = df.format(date3);
                Label_StartTime.setText(Date3);
                Label_EndTime.setText("");
                Label_TotalTime.setText("");

            }
            String str = String.valueOf(CurBoat.numRent);
            Label_Count.setText(str);
        }
    }

    @FXML
    void Pane_Boat_4_Click(MouseEvent event) {
        if (ParkFlag == 1) {
            CurBoat = Boat4;
            Label_Num_CurBoat.setText("编号:4号船");

            Pane_CurBoat.setStyle("-fx-border-color: black; -fx-background-color: #4169E1; -fx-border-width: 5");
            Label_Condition_CurBoat.setText("状态:已选中");
            if (CurBoat.Condition == 1) {

                Label_StartTime.setText("");
                Label_EndTime.setText("");
                Label_TotalTime.setText("");
            }
            if (CurBoat.Condition == 0) {
                String Date4 = df.format(date4);
                Label_StartTime.setText(Date4);
                Label_EndTime.setText("");
                Label_TotalTime.setText("");

            }
            String str = String.valueOf(CurBoat.numRent);
            Label_Count.setText(str);
        }
    }

    @FXML
    void getCount_Click(ActionEvent event) {
        if (ParkFlag == 1) {

            String str1 = String.valueOf(WholeCount_Day);
            String str2 = String.valueOf(WholeCount_Night);
            String str3 = String.valueOf(WholeCount);
            text.setText("上午次数:" + str1 + "次\n");
            text.appendText("下午次数:" + str2 + "次\n");
            text.appendText("合计次数:" + str3 + "次\n");
        }
    }

    @FXML
    void getAverageTime_Click(ActionEvent event) {
        if (ParkFlag == 1) {

            if (WholeCount == 0) {
                WholeCount = 1;
            }
            if (WholeCount_Day == 0) {
                WholeCount_Day = 1;
            }
            if (WholeCount_Night == 0) {
                WholeCount_Night = 1;
            }
            String str1 = String.valueOf(Long.valueOf(WholeTime_Day) / 1000 / WholeCount_Day);//上午平均的秒数
            String str2 = String.valueOf(Long.valueOf(WholeTime_Night) / 1000 / WholeCount_Night);//下午平均的秒数
            String str3 = String.valueOf(Long.valueOf(WholeTime) / 1000 / WholeCount);//今日平均的秒数

            String str4 = String.valueOf(Long.valueOf(WholeTime_Day) / 1000 / WholeCount_Day / 60);//上午平均的分钟
            String str5 = String.valueOf(Long.valueOf(WholeTime_Night) / 1000 / WholeCount_Night / 60);//下午平均的分钟
            String str6 = String.valueOf(Long.valueOf(WholeTime) / 1000 / WholeCount / 60);//今日平均的分钟

            String str7 = String.valueOf(Long.valueOf(WholeTime_Day) / 1000 / WholeCount_Day % 60);//上午平均的分钟
            String str8 = String.valueOf(Long.valueOf(WholeTime_Night) / 1000 / WholeCount_Night % 60);//下午平均的分钟
            String str9 = String.valueOf(Long.valueOf(WholeTime) / 1000 / WholeCount % 60);//今日平均的分钟

            text.setText("上午平均时间:" + str4 + "分" + str7 + "秒\n");
            text.appendText("下午平均时间:" + str5 + "分" + str8 + "秒\n");
            text.appendText("今日平均时间:" + str6 + "分" + str9 + "秒\n");
            if (WholeCount == 1) {
                WholeCount = 0;
            }
            if (WholeCount_Day == 1) {
                WholeCount_Day = 0;
            }
            if (WholeCount_Night == 1) {
                WholeCount_Night = 0;
            }
        }
    }

    @FXML
    void getLongestTime_Click(ActionEvent event) {
        if (ParkFlag == 1) {
            String str1 = String.valueOf(Long.valueOf(WholeMax_Day) / 1000 / 60);
            String str2 = String.valueOf(Long.valueOf(WholeMax_Night) / 1000 / 60);
            String str3 = String.valueOf(Long.valueOf(WholeMax) / 1000 / 60);

            String str4 = String.valueOf(Long.valueOf(WholeMax_Day) / 1000 % 60);
            String str5 = String.valueOf(Long.valueOf(WholeMax_Night) / 1000 % 60);
            String str6 = String.valueOf(Long.valueOf(WholeMax) / 1000 % 60);
            text.setText("上午最长时间:" + str1 + "分" + str4 + "秒\n");
            text.appendText("下午最长时间:" + str2 + "分" + str5 + "秒\n");
            text.appendText("今日最长时间:" + str3 + "分" + str6 + "秒\n");
        }
    }

    @FXML
    private Pane BigPane1;
    @FXML
    private Pane BigPane2;
    @FXML
    private Pane BigPane3;

    @FXML
    void ParkClose_Click(ActionEvent event) {
        ParkFlag = 0;
        BigPane1.setOpacity(0.3);
        BigPane2.setOpacity(0.3);
        BigPane3.setOpacity(0.3);
        if (Boat1.Condition == 0) {
            Pane_Boat_1.setStyle("-fx-border-color: black; -fx-background-color: #DC143C; -fx-border-width: 5");
            Label_Boat1_Condition.setText("已丢失");
            Boat1.Condition = -1;
        }
        if (Boat2.Condition == 0) {
            Pane_Boat_2.setStyle("-fx-border-color: black; -fx-background-color:#DC143C; -fx-border-width: 5");
            Label_Boat2_Condition.setText("已丢失");
            Boat2.Condition = -1;

        }
        if (Boat3.Condition == 0) {
            Pane_Boat_3.setStyle("-fx-border-color: black; -fx-background-color:#DC143C; -fx-border-width: 5");
            Label_Boat3_Condition.setText("已丢失");
            Boat3.Condition = -1;

        }
        if (Boat4.Condition == 0) {
            Pane_Boat_4.setStyle("-fx-border-color: black; -fx-background-color:#DC143C; -fx-border-width: 5");
            Label_Boat4_Condition.setText("已丢失");
            Boat4.Condition = -1;

        }
    }

    @FXML
    void ParkOpen_Click(ActionEvent event) {
        ParkFlag = 1;
        BigPane1.setOpacity(1);
        BigPane2.setOpacity(1);
        BigPane3.setOpacity(1);
        Pane_CurBoat.setStyle("-fx-border-color: black; -fx-background-color:Grey; -fx-border-width: 5");
        Label_Num_CurBoat.setText("请选择船只");
        Label_Condition_CurBoat.setText("当前不可用");
        Label_StartTime.setText("");
        Label_EndTime.setText("");
        Label_TotalTime.setText("");
        Label_Count.setText("");
        Boat1.numRent = 0;
        Boat2.numRent = 0;
        Boat3.numRent = 0;
        Boat4.numRent = 0;
        WholeCount = 0;
        WholeCount_Day = 0;
        WholeCount_Night = 0;
        WholeTime = 0;
        WholeTime_Day = 0;
        WholeTime_Night = 0;
        WholeMax = 0;
        WholeMax_Day = 0;
        WholeMax_Night = 0;
        text.setText("");

        if (Boat1.Condition == -1) {
            Pane_Boat_1.setStyle("-fx-border-color: black; -fx-background-color:	#2E8B57; -fx-border-width: 5");
            Label_Boat1_Condition.setText("可租用");
            Boat1.Condition = 1;
        }
        if (Boat2.Condition == -1) {
            Pane_Boat_2.setStyle("-fx-border-color: black; -fx-background-color:	#2E8B57; -fx-border-width: 5");
            Label_Boat2_Condition.setText("可租用");
            Boat2.Condition = 1;
        }
        if (Boat3.Condition == -1) {
            Pane_Boat_3.setStyle("-fx-border-color: black; -fx-background-color:	#2E8B57; -fx-border-width: 5");
            Label_Boat3_Condition.setText("可租用");
            Boat3.Condition = 1;
        }
        if (Boat4.Condition == -1) {
            Pane_Boat_4.setStyle("-fx-border-color: black; -fx-background-color:	#2E8B57; -fx-border-width: 5");
            Label_Boat4_Condition.setText("可租用");
            Boat4.Condition = 1;
        }
    }

    @FXML
    void ProVersion_Click(ActionEvent event) {
        Alert alert = new Alert(Alert.AlertType.INFORMATION); // 创建一个消息对话框
        alert.setHeaderText("【高级版】尚未解锁"); // 设置对话框的头部文本
        alert.show(); // 显示对话框
        alert.setContentText("更多高级功能正在开发中,敬请期待!");
        alert.show();
    }
}

hello-view.fxml​​​​​​​

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.text.*?>
<?import javafx.scene.effect.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<VBox alignment="TOP_CENTER" prefHeight="770.0" prefWidth="490.0" spacing="10.0" style="-fx-background-color: #E6E6FA;"
      xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
      fx:controller="com.example.boat.HelloController">

    <children>
        <Pane prefHeight="160.0" prefWidth="500.0" style="-fx-border-color: #BDB76B; -fx-border-width: 10;">
            <children>
                <Button layoutX="130.0" layoutY="100.0" mnemonicParsing="false" onAction="#ParkClose_Click"
                        prefHeight="40.0" prefWidth="100.0" style="-fx-border-color: grey; -fx-border-width: 4;"
                        text="公园关门">
                    <font>
                        <Font name="Microsoft YaHei" size="15.0"/>
                    </font>
                </Button>
                <Button layoutX="20.0" layoutY="100.0" mnemonicParsing="false" onAction="#ParkOpen_Click"
                        prefHeight="40.0" prefWidth="100.0" style="-fx-border-color: grey; -fx-border-width: 4;"
                        text="公园开门">
                    <font>
                        <Font name="Microsoft YaHei" size="15.0"/>
                    </font>
                </Button>
                <Label layoutX="20.0" layoutY="20.0" text="超级无敌租船系统" textFill="#9e1b1b">
                    <font>
                        <Font name="Microsoft YaHei" size="54.0"/>
                    </font>
                </Label>
                <Button layoutX="240.0" layoutY="100.0" mnemonicParsing="false" onAction="#ProVersion_Click"
                        prefHeight="40.0" prefWidth="210.0" style="-fx-border-color: grey; -fx-border-width: 4;"
                        text="【高级版】解锁更多功能">
                    <font>
                        <Font name="Microsoft YaHei" size="15.0"/>
                    </font>
                </Button>
            </children>
            <VBox.margin>
                <Insets left="10.0" right="10.0" top="10.0"/>
            </VBox.margin>
        </Pane>
        <Pane fx:id="BigPane1" prefHeight="180.0" prefWidth="500.0"
              style="-fx-border-color: #BDB76B; -fx-border-width: 10;">
            <VBox.margin>
                <Insets left="10.0" right="10.0"/>
            </VBox.margin>
            <children>
                <Pane fx:id="Pane_Boat_1" layoutX="20.0" layoutY="20.0" onMouseClicked="#Pane_Boat_1_Click"
                      prefHeight="100.0" prefWidth="100.0"
                      style="-fx-border-color: black; -fx-background-color: #2E8B57; -fx-border-width: 5;"/>
                <Label fx:id="Label_Boat1_Condition" alignment="CENTER" layoutX="20.0" layoutY="140.0" prefHeight="20.0"
                       prefWidth="100.0" text="可租用" textAlignment="CENTER" textOverrun="CLIP">
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                    <effect>
                        <Blend/>
                    </effect>
                </Label>
                <Label alignment="CENTER" layoutX="20.0" layoutY="120.0" prefHeight="20.0" prefWidth="100.0" text="1号船"
                       textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Label alignment="CENTER" layoutX="130.0" layoutY="120.0" prefHeight="20.0" prefWidth="100.0" text="2号船"
                       textAlignment="CENTER" textOverrun="CLIP" wrapText="true">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Label fx:id="Label_Boat2_Condition" alignment="CENTER" layoutX="130.0" layoutY="140.0"
                       prefHeight="20.0" prefWidth="100.0" text="可租用" textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Pane fx:id="Pane_Boat_2" layoutX="130.0" layoutY="20.0" onMouseClicked="#Pane_Boat_2_Click"
                      prefHeight="100.0" prefWidth="100.0"
                      style="-fx-border-color: black; -fx-background-color: #2E8B57; -fx-border-width: 5;"/>
                <Label alignment="CENTER" layoutX="240.0" layoutY="120.0" prefHeight="20.0" prefWidth="100.0" text="3号船"
                       textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Label fx:id="Label_Boat3_Condition" alignment="CENTER" layoutX="240.0" layoutY="140.0"
                       prefHeight="20.0" prefWidth="100.0" text="可租用" textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Pane fx:id="Pane_Boat_3" layoutX="240.0" layoutY="20.0" onMouseClicked="#Pane_Boat_3_Click"
                      prefHeight="100.0" prefWidth="100.0"
                      style="-fx-border-color: black; -fx-background-color: #2E8B57; -fx-border-width: 5;"/>
                <Label alignment="CENTER" layoutX="350.0" layoutY="120.0" prefHeight="20.0" prefWidth="100.0" text="4号船"
                       textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Label fx:id="Label_Boat4_Condition" alignment="CENTER" layoutX="350.0" layoutY="140.0"
                       prefHeight="20.0" prefWidth="100.0" text="可租用" textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Pane fx:id="Pane_Boat_4" layoutX="350.0" layoutY="20.0" onMouseClicked="#Pane_Boat_4_Click"
                      prefHeight="100.0" prefWidth="100.0"
                      style="-fx-border-color: black; -fx-background-color: #2E8B57; -fx-border-width: 5;"/>
            </children>
        </Pane>
        <Pane fx:id="BigPane2" prefHeight="210.0" prefWidth="500.0"
              style="-fx-border-color: #BDB76B; -fx-border-width: 10;">
            <VBox.margin>
                <Insets left="10.0" right="10.0"/>
            </VBox.margin>
            <children>
                <Button fx:id="Button_Start" layoutX="330.0" layoutY="100.0" mnemonicParsing="false"
                        onAction="#Button_Start_Click" prefHeight="40.0" prefWidth="120.0"
                        style="-fx-border-width: 4; -fx-border-color: grey;" text="开始租用">
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Button>
                <Button fx:id="Button_End" layoutX="330.0" layoutY="150.0" mnemonicParsing="false"
                        onAction="#Button_End_Click" prefHeight="40.0" prefWidth="120.0"
                        style="-fx-border-color: grey; -fx-border-width: 4;" text="结束租用">
                    <font>
                        <Font name="Microsoft YaHei" size="15.0"/>
                    </font>
                </Button>
                <Label fx:id="Label_Num_CurBoat" alignment="CENTER" layoutX="20.0" layoutY="130.0" prefHeight="20.0"
                       prefWidth="100.0" text="请选择船只" textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Label fx:id="Label_Condition_CurBoat" alignment="CENTER" layoutX="20.0" layoutY="160.0"
                       prefHeight="20.0" prefWidth="100.0" text="当前不可用" textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Pane fx:id="Pane_CurBoat" layoutX="20.0" layoutY="20.0" onMouseClicked="#Pane_Boat_1_Click"
                      prefHeight="100.0" prefWidth="100.0"
                      style="-fx-border-color: black; -fx-background-color: grey; -fx-border-width: 5;"/>
                <Label contentDisplay="TOP" layoutX="140.0" layoutY="20.0" prefHeight="30.0" prefWidth="80.0"
                       text="借出时间:" textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Label layoutX="140.0" layoutY="60.0" prefHeight="30.0" prefWidth="80.0" text="归还时间:"
                       textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Label fx:id="Label_StartTime" alignment="CENTER" layoutX="220.0" layoutY="20.0" prefHeight="30.0"
                       prefWidth="230.0"
                       style="-fx-border-color: grey; -fx-border-width: 4; -fx-background-color: #F5F5F5;" text=" "
                       textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="14.0"/>
                    </font>
                </Label>
                <Label fx:id="Label_EndTime" alignment="CENTER" layoutX="220.0" layoutY="60.0" prefHeight="30.0"
                       prefWidth="230.0"
                       style="-fx-border-color: grey; -fx-border-width: 4; -fx-background-color: #F5F5F5;"
                       textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="14.0"/>
                    </font>
                </Label>
                <Label layoutX="140.0" layoutY="155.0" prefHeight="30.0" prefWidth="120.0" text="今日租用次数:"
                       textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Label fx:id="Label_Count" alignment="CENTER" layoutX="250.0" layoutY="150.0" prefHeight="40.0"
                       prefWidth="50.0"
                       style="-fx-border-color: grey; -fx-border-width: 4; -fx-background-color: F5F5F5;"
                       textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="14.0"/>
                    </font>
                </Label>
                <Label contentDisplay="TOP" layoutX="140.0" layoutY="105.0" prefHeight="30.0" prefWidth="80.0"
                       text="租用时长:" textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="16.0"/>
                    </font>
                </Label>
                <Label fx:id="Label_TotalTime" alignment="CENTER" layoutX="220.0" layoutY="100.0" prefHeight="40.0"
                       prefWidth="80.0"
                       style="-fx-border-color: grey; -fx-border-width: 4; -fx-background-color: F5F5F5;"
                       textAlignment="CENTER" textOverrun="CLIP">
                    <effect>
                        <Blend/>
                    </effect>
                    <font>
                        <Font name="Microsoft YaHei" size="14.0"/>
                    </font>
                </Label>
            </children>
        </Pane>
        <Pane fx:id="BigPane3" prefHeight="170.0" prefWidth="500.0"
              style="-fx-border-color: #BDB76B; -fx-border-width: 10;">
            <children>
                <Button fx:id="getCount" layoutX="20.0" layoutY="20.0" mnemonicParsing="false"
                        onAction="#getCount_Click" prefHeight="40.0" prefWidth="120.0"
                        style="-fx-border-color: grey; -fx-border-width: 4;" text="租用次数统计">
                    <font>
                        <Font name="Microsoft YaHei" size="15.0"/>
                    </font>
                </Button>
                <Button fx:id="getAverageTime" layoutX="20.0" layoutY="65.0" mnemonicParsing="false"
                        onAction="#getAverageTime_Click" prefHeight="40.0" prefWidth="120.0"
                        style="-fx-border-color: grey; -fx-border-width: 4;" text="平均时间统计">
                    <font>
                        <Font name="Microsoft YaHei" size="15.0"/>
                    </font>
                </Button>
                <Button fx:id="getLongestTime" layoutX="20.0" layoutY="110.0" mnemonicParsing="false"
                        onAction="#getLongestTime_Click" prefHeight="40.0" prefWidth="120.0"
                        style="-fx-border-color: grey; -fx-border-width: 4;" text="最长租用时间">
                    <font>
                        <Font name="Microsoft YaHei" size="15.0"/>
                    </font>
                </Button>
                <TextArea fx:id="text" layoutX="150.0" layoutY="20.0" prefHeight="130.0" prefWidth="300.0"
                          style="-fx-border-color: grey; -fx-border-width: 4;">
                    <font>
                        <Font name="Microsoft YaHei" size="15.0"/>
                    </font>
                </TextArea>
            </children>
            <opaqueInsets>
                <Insets/>
            </opaqueInsets>
            <VBox.margin>
                <Insets bottom="10.0" left="10.0" right="10.0"/>
            </VBox.margin>
        </Pane>
    </children>
</VBox>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

超级丁丁车

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值