Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
样式修改
Browse files Browse the repository at this point in the history
  • Loading branch information
Civitasv committed Apr 26, 2021
1 parent 6726a45 commit c853b9e
Show file tree
Hide file tree
Showing 7 changed files with 253 additions and 106 deletions.
17 changes: 12 additions & 5 deletions src/main/java/com/civitasv/spider/util/MessageUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.civitasv.spider.MainApplication;
import javafx.application.Platform;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.control.DialogPane;
import javafx.scene.image.Image;
import javafx.stage.Stage;

Expand All @@ -14,17 +16,22 @@
public class MessageUtil {
/**
* 信息提示框
* @param type {@link Alert.AlertType}
* @param title
* @param header
* @param content
*
* @param type {@link Alert.AlertType}
* @param title 标题
* @param header 头信息
* @param content 具体内容
*/
public static void alert(Alert.AlertType type, String title, String header, String content) {
Alert alert = new Alert(type);
alert.setTitle(title);
alert.setHeaderText(header);
alert.setContentText(content);
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
DialogPane dialogPane = alert.getDialogPane();
dialogPane.getStylesheets().add(
MainApplication.class.getResource("myDialogs.css").toExternalForm());
dialogPane.getStyleClass().add("myDialog");
Stage stage = (Stage) dialogPane.getScene().getWindow();
stage.getIcons().add(new Image(MainApplication.class.getResourceAsStream("icon/icon.png")));
alert.showAndWait();
}
Expand Down
82 changes: 42 additions & 40 deletions src/main/resources/com/civitasv/spider/geocoding.fxml
Original file line number Diff line number Diff line change
@@ -1,94 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import javafx.collections.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import java.lang.String?>
<?import javafx.collections.FXCollections?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>

<VBox fx:id="main" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.civitasv.spider.controller.GeocodingController">
<VBox fx:id="main" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" styleClass="main" xmlns="http://javafx.com/javafx/8.0.271" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.civitasv.spider.controller.GeocodingController">
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
<Label text="高德key(不同key之间以英文逗号分割):"/>
<TextArea fx:id="keys" minHeight="-Infinity" minWidth="-Infinity" prefHeight="100.0" prefWidth="300.0"/>
<Label text="高德key(不同key之间以英文逗号分割):" />
<TextArea fx:id="keys" minHeight="-Infinity" minWidth="-Infinity" prefHeight="100.0" prefWidth="300.0" />
<HBox alignment="CENTER_LEFT" prefHeight="44.0" prefWidth="345.0">
<padding>
<Insets bottom="10.0" top="10.0"/>
<Insets bottom="10.0" top="10.0" />
</padding>
<Label prefHeight="18.0" prefWidth="100.0" text="开发者类型:"/>
<Label prefHeight="18.0" prefWidth="100.0" text="开发者类型:" />
<ChoiceBox fx:id="userType" prefWidth="150.0" value="个人开发者">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="个人开发者"/>
<String fx:value="个人认证开发者"/>
<String fx:value="企业开发者"/>
<String fx:value="个人开发者" />
<String fx:value="个人认证开发者" />
<String fx:value="企业开发者" />
</FXCollections>
</items>
</ChoiceBox>
</HBox>
<HBox alignment="CENTER_LEFT" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
<padding>
<Insets bottom="10.0" top="10.0"/>
<Insets bottom="10.0" top="10.0" />
</padding>
<Label prefWidth="100.0" text="线程数目:"/>
<TextField fx:id="threadNum" prefWidth="200.0" promptText="建议不大于QPS * keys_num * 0.1" HBox.hgrow="ALWAYS"/>
<Label prefWidth="100.0" text="线程数目:" />
<TextField fx:id="threadNum" prefWidth="200.0" promptText="建议不大于QPS * keys_num * 0.1" HBox.hgrow="ALWAYS" />
</HBox>
<HBox alignment="CENTER_LEFT" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
<padding>
<Insets bottom="10.0" top="10.0"/>
<Insets bottom="10.0" top="10.0" />
</padding>
<Label prefWidth="100.0" text="输入文件:"/>
<TextField fx:id="inputFile" prefWidth="125.0" HBox.hgrow="ALWAYS"/>
<Button onMouseClicked="#chooseFile" text="浏览">
<Label prefWidth="100.0" text="输入文件:" />
<TextField fx:id="inputFile" prefHeight="30.0" prefWidth="125.0" HBox.hgrow="ALWAYS" />
<Button onMouseClicked="#chooseFile" prefHeight="30.0" text="浏览">
<HBox.margin>
<Insets left="5.0"/>
<Insets left="5.0" />
</HBox.margin>
</Button>
</HBox>
<HBox alignment="CENTER_LEFT">
<padding>
<Insets bottom="10.0"/>
<Insets bottom="10.0" />
</padding>
<Label prefWidth="100.0" text="输出格式:"/>
<Label prefWidth="100.0" text="输出格式:" />
<ChoiceBox fx:id="format" prefWidth="150.0" value="json">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="json"/>
<String fx:value="csv"/>
<String fx:value="txt"/>
<String fx:value="json" />
<String fx:value="csv" />
<String fx:value="txt" />
</FXCollections>
</items>
</ChoiceBox>
</HBox>

<HBox alignment="CENTER_LEFT">
<padding>
<Insets bottom="10.0"/>
<Insets bottom="10.0" />
</padding>
<Label prefWidth="100.0" text="输出目录:"/>
<TextField fx:id="outputDirectory" prefWidth="125.0" HBox.hgrow="ALWAYS"/>
<Button onMouseClicked="#chooseDirectory" text="浏览">
<Label prefWidth="100.0" text="输出目录:" />
<TextField fx:id="outputDirectory" prefHeight="30.0" prefWidth="125.0" HBox.hgrow="ALWAYS" />
<Button onMouseClicked="#chooseDirectory" prefHeight="30.0" text="浏览">
<HBox.margin>
<Insets left="5.0"/>
<Insets left="5.0" />
</HBox.margin>
</Button>
</HBox>
<HBox>
<Button fx:id="execute" minWidth="-Infinity" mnemonicParsing="false" onMouseClicked="#execute" prefHeight="60.0"
prefWidth="250.0" text="执行" HBox.hgrow="ALWAYS"/>
<Button fx:id="cancel" minWidth="-Infinity" mnemonicParsing="false" onMouseClicked="#cancel" prefHeight="60.0"
prefWidth="150.0" text="取消" HBox.hgrow="ALWAYS">
<Button fx:id="execute" minWidth="-Infinity" mnemonicParsing="false" onMouseClicked="#execute" prefHeight="60.0" prefWidth="250.0" styleClass="execute" text="执行" HBox.hgrow="ALWAYS" />
<Button fx:id="cancel" minWidth="-Infinity" mnemonicParsing="false" onMouseClicked="#cancel" prefHeight="60.0" prefWidth="150.0" styleClass="cancel" text="取消" HBox.hgrow="ALWAYS">
<HBox.margin>
<Insets left="10.0"/>
<Insets left="10.0" />
</HBox.margin>
</Button>
</HBox>
<TextArea fx:id="messageDetail" prefWidth="400.0">
<VBox.margin>
<Insets top="10.0"/>
<Insets top="10.0" />
</VBox.margin>
</TextArea>
</VBox>
Binary file modified src/main/resources/com/civitasv/spider/icon/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions src/main/resources/com/civitasv/spider/myDialogs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.myDialog {
-fx-background-color: #393e46;
}

.myDialog > *.button-bar > *.container {
-fx-background-color: #393e46;
}

.myDialog > .button-bar > .container > .details-button {
-fx-font-weight: bold;
-fx-background-color: #393e46;
}

.myDialog > .button-bar > .container > .details-button.more {
-fx-background-color: #393e46;
}

.myDialog > .button-bar > .container > .details-button.less {
-fx-background-color: #393e46;
}

.myDialog > .button-bar > .container > .details-button:hover {
-fx-underline: true;
}

.myDialog > *.label.content {
-fx-font-size: 14px;
-fx-font-weight: bold;
-fx-text-fill: #eeeeee;
}
47 changes: 25 additions & 22 deletions src/main/resources/com/civitasv/spider/poi.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>

<VBox fx:id="main" alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8.0.271" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.civitasv.spider.controller.POIController">
<VBox fx:id="main" alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" styleClass="main" xmlns="http://javafx.com/javafx/8.0.271" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.civitasv.spider.controller.POIController">
<MenuBar>
<Menu mnemonicParsing="false" text="工具">
<MenuItem mnemonicParsing="false" onAction="#openGeocoding" text="地理编码" />
Expand Down Expand Up @@ -57,20 +57,23 @@
<Insets bottom="10.0" top="10.0" />
</padding>
<Label prefHeight="18.0" prefWidth="100.0" text="POI类型:" />
<TextField fx:id="types" prefWidth="250.0" promptText="使用逗号分割不同类型" HBox.hgrow="ALWAYS" />
<Button fx:id="poiType" onMouseClicked="#openPOITypes" prefHeight="25.0" prefWidth="150.0" text="POI分类编码">
<TextField fx:id="types" prefHeight="30.0" prefWidth="250.0" promptText="使用逗号分割不同类型" HBox.hgrow="ALWAYS" />
<Button fx:id="poiType" onMouseClicked="#openPOITypes" prefHeight="30.0" prefWidth="150.0" text="POI分类编码">
<HBox.margin>
<Insets left="5.0" />
</HBox.margin>
</Button>
<VBox.margin>
<Insets bottom="10.0" />
</VBox.margin>
</HBox>
<TabPane fx:id="tabs" tabClosingPolicy="UNAVAILABLE">
<Tab text="行政区">
<AnchorPane minHeight="0.0" minWidth="0.0">
<HBox alignment="CENTER" layoutX="18.0" layoutY="8.0">
<Label text="行政区代码:" />
<TextField fx:id="city" prefWidth="210.0" promptText="行政区六位代码" HBox.hgrow="ALWAYS" />
<Button mnemonicParsing="false" onMouseClicked="#chooseAdCode" text="行政区划代码">
<TextField fx:id="city" prefHeight="30.0" prefWidth="210.0" promptText="行政区六位代码" HBox.hgrow="ALWAYS" />
<Button mnemonicParsing="false" onMouseClicked="#chooseAdCode" prefHeight="30.0" text="行政区划代码">
<HBox.margin>
<Insets left="5.0" />
</HBox.margin>
Expand All @@ -85,17 +88,17 @@
<AnchorPane minHeight="0.0" minWidth="0.0">
<HBox alignment="CENTER" layoutX="18.0" layoutY="8.0">
<Label layoutX="14.0" layoutY="14.0" text="矩形:" />
<TextField fx:id="rectangle" layoutX="51.0" layoutY="10.0" prefWidth="300.0" promptText="矩形左上角经纬度#矩形右下角经纬度" HBox.hgrow="ALWAYS" />
<ChoiceBox fx:id="coordinateType" prefWidth="150.0" value="wgs84">
<TextField fx:id="rectangle" layoutX="51.0" layoutY="10.0" prefHeight="30.0" prefWidth="300.0" promptText="矩形左上角经纬度#矩形右下角经纬度" HBox.hgrow="ALWAYS" />
<ChoiceBox fx:id="coordinateType" prefHeight="30.0" prefWidth="150.0" value="wgs84">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="wgs84" />
<String fx:value="gcj02" />
</FXCollections>
</items>
<HBox.margin>
<Insets left="10.0" />
</HBox.margin>
<HBox.margin>
<Insets left="10.0" />
</HBox.margin>
</ChoiceBox>
</HBox>
<padding>
Expand All @@ -107,22 +110,22 @@
<AnchorPane minHeight="0.0" minWidth="0.0">
<HBox alignment="CENTER" layoutX="18.0" layoutY="8.0">
<Label layoutX="14.0" layoutY="14.0" text="文件目录:" />
<TextField fx:id="userFile" layoutX="75.0" layoutY="10.0" prefWidth="210.0" promptText="GeoJSO格式边界" HBox.hgrow="ALWAYS" />
<Button layoutX="293.0" layoutY="10.0" mnemonicParsing="false" onMouseClicked="#chooseFile" text="浏览">
<TextField fx:id="userFile" layoutX="75.0" layoutY="10.0" prefHeight="30.0" prefWidth="210.0" promptText="GeoJSO格式边界" HBox.hgrow="ALWAYS" />
<Button layoutX="293.0" layoutY="10.0" mnemonicParsing="false" onMouseClicked="#chooseFile" prefHeight="30.0" text="浏览">
<HBox.margin>
<Insets left="5.0" />
</HBox.margin>
</Button>
<ChoiceBox fx:id="coordinateType2" prefWidth="150.0" value="wgs84">
<ChoiceBox fx:id="coordinateType2" prefHeight="30.0" prefWidth="150.0" value="wgs84">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="wgs84" />
<String fx:value="gcj02" />
</FXCollections>
</items>
<HBox.margin>
<Insets left="10.0" />
</HBox.margin>
<HBox.margin>
<Insets left="10.0" />
</HBox.margin>
</ChoiceBox>
<padding>
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
Expand All @@ -141,7 +144,7 @@
</Label>
<TextField fx:id="threshold" prefHeight="25.0" prefWidth="150.0" text="850" />
<VBox.margin>
<Insets top="5.0" />
<Insets top="10.0" />
</VBox.margin>
</HBox>
<HBox alignment="CENTER_LEFT">
Expand Down Expand Up @@ -173,18 +176,18 @@
<Insets bottom="10.0" />
</padding>
<Label prefWidth="100.0" text="输出目录:" />
<TextField fx:id="outputDirectory" prefWidth="300.0" HBox.hgrow="ALWAYS" />
<Button fx:id="directoryBtn" onMouseClicked="#chooseDirectory" prefWidth="100.0" text="浏览">
<TextField fx:id="outputDirectory" prefHeight="30.0" prefWidth="300.0" HBox.hgrow="ALWAYS" />
<Button fx:id="directoryBtn" onMouseClicked="#chooseDirectory" prefHeight="30.0" prefWidth="100.0" text="浏览">
<HBox.margin>
<Insets left="5.0" />
</HBox.margin>
</Button>
</HBox>
<HBox>
<Button fx:id="execute" minWidth="-Infinity" mnemonicParsing="false" onMouseClicked="#execute" prefHeight="60.0" prefWidth="400.0" text="执行" HBox.hgrow="ALWAYS" />
<Button fx:id="cancel" minWidth="-Infinity" mnemonicParsing="false" onMouseClicked="#cancel" prefHeight="61.0" prefWidth="200.0" text="取消" HBox.hgrow="ALWAYS">
<Button fx:id="execute" minWidth="-Infinity" mnemonicParsing="false" onMouseClicked="#execute" prefHeight="60.0" prefWidth="400.0" styleClass="execute" text="执行" HBox.hgrow="ALWAYS" />
<Button fx:id="cancel" minWidth="-Infinity" mnemonicParsing="false" onMouseClicked="#cancel" prefHeight="61.0" prefWidth="200.0" styleClass="cancel" text="取消" HBox.hgrow="ALWAYS">
<HBox.margin>
<Insets />
<Insets left="5.0" />
</HBox.margin>
</Button>
</HBox>
Expand Down

0 comments on commit c853b9e

Please sign in to comment.