Skip to content

Commit 50b3409

Browse files
committed
Fix #11, Fix #9, Fix #12
1 parent 375266a commit 50b3409

13 files changed

+478
-102
lines changed

pom.xml

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<name>pirilampo</name>
88
<modelVersion>4.0.0</modelVersion>
99
<groupId>pirilampo</groupId>
10-
<version>1.1.1</version>
10+
<version>1.1.2</version>
1111

1212
<dependencies>
1313
<!-- https://mvnrepository.com/artifact/io.cucumber/gherkin -->
@@ -93,6 +93,12 @@
9393
<artifactId>slf4j-simple</artifactId>
9494
<version>1.7.22</version>
9595
</dependency>
96+
<dependency>
97+
<groupId>junit</groupId>
98+
<artifactId>junit</artifactId>
99+
<version>4.12</version>
100+
<scope>test</scope>
101+
</dependency>
96102
</dependencies>
97103

98104
<build>

src/main/java/br/com/pirilampo/controller/MainController.java

+41-1
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,27 @@
33
import br.com.pirilampo.util.Compilador;
44
import br.com.pirilampo.util.ExceptionUtil;
55
import javafx.application.Platform;
6+
import javafx.fxml.Initializable;
67
import javafx.scene.control.Alert;
78
import javafx.stage.DirectoryChooser;
89
import javafx.stage.FileChooser;
910
import javafx.stage.Stage;
1011

1112
import java.io.File;
13+
import java.net.URL;
14+
import java.util.ResourceBundle;
1215

13-
public class MainController extends MainForm {
16+
public class MainController extends MainForm implements Initializable {
1417
private final String MSG_SELECIONAR_PASTA = "É necessário selecionar uma pasta!";
1518
private final String MSG_SELECIONAR_FEATURE = "É necessário selecionar uma feature!";
1619
private final String MSG_OPE_SUCESSO = "Operação realizada com sucesso!";
1720

21+
@Override
22+
public void initialize(URL location, ResourceBundle resources) {
23+
txtCorMenu.setText(Compilador.COR_MENU);
24+
txtRootMenuNome.setText(Compilador.NOME_MENU_RAIZ);
25+
}
26+
1827
public void selecionarFeature(){
1928
FileChooser chooser = new FileChooser();
2029
chooser.setTitle("Selecionar Feature");
@@ -97,6 +106,12 @@ public void pastaGerarHtml(){
97106
Compilador compilador = new Compilador();
98107

99108
if(txtPastaSrc.getText() != null && !txtPastaSrc.getText().trim().equals("")) {
109+
Compilador.setConfig(
110+
txtCorMenu.getText(),
111+
txtRootMenuNome.getText(),
112+
new File(txtBrandSrc.getText())
113+
);
114+
100115
new Thread(() -> {
101116
Platform.runLater(() -> progressBar.setProgress(-1));
102117
Platform.runLater(this::desabilitarBotoes);
@@ -146,6 +161,23 @@ public void pastaGerarPdf(){
146161
}
147162
}
148163

164+
public void selecionarBrand(){
165+
FileChooser chooser = new FileChooser();
166+
chooser.setTitle("Selecionar Imagens");
167+
168+
FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter(
169+
"Imagens",
170+
"*.jpg", "*.jpeg", "*.png"
171+
);
172+
chooser.getExtensionFilters().add(extFilter);
173+
174+
File file = chooser.showOpenDialog(new Stage());
175+
176+
if(file != null) {
177+
txtBrandSrc.setText(file.getAbsolutePath());
178+
}
179+
}
180+
149181
private void alertWarning(String title, String msg){
150182
Alert alert = new Alert(Alert.AlertType.WARNING);
151183
alert.setHeaderText(title);
@@ -169,6 +201,10 @@ private void desabilitarBotoes(){
169201
btnSelecionarPasta.setDisable(true);
170202
btnPastaGerarHtml.setDisable(true);
171203
btnPastaGerarPdf.setDisable(true);
204+
txtRootMenuNome.setDisable(true);
205+
txtBrandSrc.setDisable(true);
206+
btnBrandSrc.setDisable(true);
207+
txtCorMenu.setDisable(true);
172208
}
173209

174210
private void habilitarBotoes(){
@@ -178,5 +214,9 @@ private void habilitarBotoes(){
178214
btnSelecionarPasta.setDisable(false);
179215
btnPastaGerarHtml.setDisable(false);
180216
btnPastaGerarPdf.setDisable(false);
217+
txtRootMenuNome.setDisable(false);
218+
txtBrandSrc.setDisable(false);
219+
btnBrandSrc.setDisable(false);
220+
txtCorMenu.setDisable(false);
181221
}
182222
}

src/main/java/br/com/pirilampo/controller/MainForm.java

+17-36
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,21 @@
66
import javafx.scene.control.TextField;
77
import javafx.scene.control.ToggleGroup;
88

9-
public class MainForm {
10-
@FXML
11-
TextField txtNome;
12-
13-
@FXML
14-
TextField txtVersao;
15-
16-
@FXML
17-
TextField txtFeatureSrc;
18-
19-
@FXML
20-
TextField txtPastaSrc;
21-
22-
@FXML
23-
ProgressBar progressBar;
24-
25-
@FXML
26-
Button btnSelecionarFeature;
27-
28-
@FXML
29-
Button btnFeatureGerarHtml;
30-
31-
@FXML
32-
Button btnFeatureGerarPdf;
33-
34-
@FXML
35-
Button btnSelecionarPasta;
36-
37-
@FXML
38-
Button btnPastaGerarHtml;
39-
40-
@FXML
41-
Button btnPastaGerarPdf;
42-
43-
@FXML
44-
ToggleGroup rdoLayoutPdf;
9+
class MainForm {
10+
@FXML TextField txtNome;
11+
@FXML TextField txtVersao;
12+
@FXML TextField txtFeatureSrc;
13+
@FXML TextField txtPastaSrc;
14+
@FXML ProgressBar progressBar;
15+
@FXML Button btnSelecionarFeature;
16+
@FXML Button btnFeatureGerarHtml;
17+
@FXML Button btnFeatureGerarPdf;
18+
@FXML Button btnSelecionarPasta;
19+
@FXML Button btnPastaGerarHtml;
20+
@FXML Button btnPastaGerarPdf;
21+
@FXML ToggleGroup rdoLayoutPdf;
22+
@FXML TextField txtCorMenu;
23+
@FXML TextField txtRootMenuNome;
24+
@FXML TextField txtBrandSrc;
25+
@FXML Button btnBrandSrc;
4526
}
+94-51
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<?import javafx.geometry.*?>
4-
<?import javafx.scene.control.*?>
5-
<?import javafx.scene.layout.*?>
6-
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="br.com.pirilampo.controller.MainController">
3+
<?import javafx.geometry.Insets?>
4+
<?import javafx.scene.control.Button?>
5+
<?import javafx.scene.control.Label?>
6+
<?import javafx.scene.control.ProgressBar?>
7+
<?import javafx.scene.control.Separator?>
8+
<?import javafx.scene.control.TextField?>
9+
<?import javafx.scene.layout.ColumnConstraints?>
10+
<?import javafx.scene.layout.GridPane?>
11+
<?import javafx.scene.layout.RowConstraints?>
12+
13+
<?import javafx.scene.control.ToggleGroup?>
14+
<?import javafx.scene.control.RadioButton?>
15+
<GridPane
16+
vgap="10.0"
17+
maxHeight="-Infinity"
18+
maxWidth="-Infinity"
19+
minHeight="-Infinity"
20+
minWidth="-Infinity"
21+
prefHeight="600.0"
22+
prefWidth="600.0"
23+
xmlns="http://javafx.com/javafx/8.0.112"
24+
xmlns:fx="http://javafx.com/fxml/1"
25+
fx:controller="br.com.pirilampo.controller.MainController"
26+
>
727
<fx:define>
8-
<ToggleGroup fx:id="rdoLayoutPdf"/>
28+
<ToggleGroup fx:id="rdoLayoutPdf" />
929
</fx:define>
1030
<columnConstraints>
1131
<ColumnConstraints hgrow="ALWAYS" />
@@ -18,6 +38,7 @@
1838
<RowConstraints prefHeight="30.0" vgrow="ALWAYS" />
1939
<RowConstraints prefHeight="30.0" vgrow="ALWAYS" />
2040
<RowConstraints prefHeight="30.0" vgrow="ALWAYS" />
41+
<RowConstraints vgrow="ALWAYS" />
2142
<RowConstraints prefHeight="30.0" vgrow="ALWAYS" />
2243
<RowConstraints prefHeight="40.0" vgrow="ALWAYS" />
2344
<RowConstraints prefHeight="30.0" vgrow="ALWAYS" />
@@ -30,56 +51,78 @@
3051
<RowConstraints prefHeight="30.0" vgrow="ALWAYS" />
3152
<RowConstraints prefHeight="40.0" vgrow="ALWAYS" />
3253
<RowConstraints prefHeight="40.0" vgrow="ALWAYS" />
33-
<RowConstraints />
54+
<RowConstraints />
3455
</rowConstraints>
35-
<children>
36-
<Label style="-fx-font-size: 12px; -fx-font-weight: bolder" text="Dados do Projeto" GridPane.rowIndex="0" />
37-
<Label text="Nome:" GridPane.rowIndex="1" />
38-
<TextField fx:id="txtNome" text="Pirilampo" GridPane.rowIndex="2" />
39-
<Label text="Versão:" GridPane.rowIndex="3" />
40-
<TextField fx:id="txtVersao" text="1.0" GridPane.rowIndex="4" />
41-
<Label text="Layout PDF:" GridPane.rowIndex="5" />
42-
<RadioButton toggleGroup="$rdoLayoutPdf" text="Retrato" userData="R" mnemonicParsing="false" selected="true" GridPane.rowIndex="6"/>
43-
<RadioButton toggleGroup="$rdoLayoutPdf" text="Paisagem" userData="P" mnemonicParsing="false" GridPane.rowIndex="6">
44-
<GridPane.margin>
45-
<Insets left="100.0" />
46-
</GridPane.margin>
47-
</RadioButton>
48-
<Separator prefWidth="200.0" GridPane.rowIndex="7" />
56+
<padding>
57+
<Insets bottom="14.0" left="14.0" right="14.0" top="14.0" />
58+
</padding>
59+
<Label style="-fx-font-size: 12px; -fx-font-weight: bolder" text="Dados do Projeto" GridPane.rowIndex="0" />
60+
<Label text="Nome:" GridPane.rowIndex="1" />
61+
<TextField fx:id="txtNome" text="Pirilampo" GridPane.rowIndex="2" />
62+
<Label text="Versão:" GridPane.rowIndex="3" />
63+
<TextField fx:id="txtVersao" text="1.0" GridPane.rowIndex="4" />
64+
<Label text="Layout PDF:" GridPane.rowIndex="5" />
65+
<RadioButton toggleGroup="$rdoLayoutPdf" text="Retrato" userData="R" mnemonicParsing="false" selected="true" GridPane.rowIndex="6"/>
66+
<RadioButton toggleGroup="$rdoLayoutPdf" text="Paisagem" userData="P" mnemonicParsing="false" GridPane.rowIndex="6">
67+
<GridPane.margin>
68+
<Insets left="100.0"/>
69+
</GridPane.margin>
70+
</RadioButton>
4971

50-
<Label style="-fx-font-size: 12px; -fx-font-weight: bolder" text="Compilar Feature Individual" GridPane.rowIndex="8" />
51-
<Label text="Feature:" GridPane.rowIndex="9" />
52-
<TextField fx:id="txtFeatureSrc" maxWidth="400.0" GridPane.rowIndex="10" />
53-
<Button fx:id="btnSelecionarFeature" onAction="#selecionarFeature" text="Selecionar" GridPane.rowIndex="10">
72+
<GridPane hgap="10.0" GridPane.rowIndex="7">
73+
<columnConstraints>
74+
<ColumnConstraints hgrow="ALWAYS" />
75+
<ColumnConstraints hgrow="ALWAYS" />
76+
<ColumnConstraints hgrow="ALWAYS" />
77+
</columnConstraints>
78+
<rowConstraints>
79+
<RowConstraints prefHeight="30.0" vgrow="ALWAYS" />
80+
<RowConstraints prefHeight="30.0" vgrow="ALWAYS" />
81+
</rowConstraints>
82+
<Label text="Cor Menu:" GridPane.columnIndex="0" />
83+
<Label text="Nome menu Raiz:" GridPane.columnIndex="1" />
84+
<Label text="Logo:" GridPane.columnIndex="2" />
85+
<TextField fx:id="txtCorMenu" GridPane.columnIndex="0" GridPane.rowIndex="1" />
86+
<TextField fx:id="txtRootMenuNome" GridPane.columnIndex="1" GridPane.rowIndex="1" />
87+
<TextField fx:id="txtBrandSrc" maxWidth="100.0" GridPane.columnIndex="2" GridPane.rowIndex="1" />
88+
<Button fx:id="btnBrandSrc" onAction="#selecionarBrand" text="Selecionar" GridPane.columnIndex="2" GridPane.rowIndex="1">
5489
<GridPane.margin>
55-
<Insets left="414.0" />
90+
<Insets left="114.0" />
5691
</GridPane.margin>
5792
</Button>
58-
<Button fx:id="btnFeatureGerarHtml" onAction="#featureGerarHtml" text="Gerar HTML" GridPane.rowIndex="11" />
59-
<Button fx:id="btnFeatureGerarPdf" onAction="#featureGerarPdf" text="Gerar PDF" GridPane.rowIndex="11">
60-
<GridPane.margin>
61-
<Insets left="100.0" />
62-
</GridPane.margin>
63-
</Button>
64-
<Separator prefWidth="200.0" GridPane.rowIndex="12" />
93+
</GridPane>
6594

66-
<Label style="-fx-font-size: 12px; -fx-font-weight: bolder" text="Compilar Várias Feature" GridPane.rowIndex="13" />
67-
<Label text="Pasta:" GridPane.rowIndex="14" />
68-
<TextField fx:id="txtPastaSrc" maxWidth="400.0" GridPane.rowIndex="15" />
69-
<Button fx:id="btnSelecionarPasta" onAction="#selecionarPasta" text="Selecionar" GridPane.rowIndex="15">
70-
<GridPane.margin>
71-
<Insets left="414.0" />
72-
</GridPane.margin>
73-
</Button>
74-
<Button fx:id="btnPastaGerarHtml" onAction="#pastaGerarHtml" text="Gerar HTML" GridPane.rowIndex="16" />
75-
<Button fx:id="btnPastaGerarPdf" onAction="#pastaGerarPdf" text="Gerar PDF" GridPane.rowIndex="16">
76-
<GridPane.margin>
77-
<Insets left="100.0" />
78-
</GridPane.margin>
79-
</Button>
80-
<ProgressBar fx:id="progressBar" maxHeight="-Infinity" maxWidth="1.7976931348623157E308" progress="0.0" GridPane.rowIndex="18" />
81-
</children>
82-
<padding>
83-
<Insets bottom="14.0" left="14.0" right="14.0" top="14.0" />
84-
</padding>
95+
<Separator prefWidth="200.0" GridPane.rowIndex="8" />
96+
97+
<Label style="-fx-font-size: 12px; -fx-font-weight: bolder" text="Compilar Feature Individual" GridPane.rowIndex="9" />
98+
<Label text="Feature:" GridPane.rowIndex="10" />
99+
<TextField fx:id="txtFeatureSrc" maxWidth="400.0" GridPane.rowIndex="11" />
100+
<Button fx:id="btnSelecionarFeature" onAction="#selecionarFeature" text="Selecionar" GridPane.rowIndex="11">
101+
<GridPane.margin>
102+
<Insets left="414.0" />
103+
</GridPane.margin>
104+
</Button>
105+
<Button fx:id="btnFeatureGerarHtml" onAction="#featureGerarHtml" text="Gerar HTML" GridPane.rowIndex="12" />
106+
<Button fx:id="btnFeatureGerarPdf" onAction="#featureGerarPdf" text="Gerar PDF" GridPane.rowIndex="12">
107+
<GridPane.margin>
108+
<Insets left="100.0" />
109+
</GridPane.margin>
110+
</Button>
111+
<Separator prefWidth="200.0" GridPane.rowIndex="13" />
112+
113+
<Label style="-fx-font-size: 12px; -fx-font-weight: bolder" text="Compilar Várias Feature" GridPane.rowIndex="14" />
114+
<Label text="Pasta:" GridPane.rowIndex="15" />
115+
<TextField fx:id="txtPastaSrc" maxWidth="400.0" GridPane.rowIndex="16" />
116+
<Button fx:id="btnSelecionarPasta" onAction="#selecionarPasta" text="Selecionar" GridPane.rowIndex="16">
117+
<GridPane.margin>
118+
<Insets left="414.0" />
119+
</GridPane.margin>
120+
</Button>
121+
<Button fx:id="btnPastaGerarHtml" onAction="#pastaGerarHtml" text="Gerar HTML" GridPane.rowIndex="17" />
122+
<Button fx:id="btnPastaGerarPdf" onAction="#pastaGerarPdf" text="Gerar PDF" GridPane.rowIndex="17">
123+
<GridPane.margin>
124+
<Insets left="100.0" />
125+
</GridPane.margin>
126+
</Button>
127+
<ProgressBar fx:id="progressBar" maxHeight="-Infinity" maxWidth="1.7976931348623157E308" progress="0.0" GridPane.rowIndex="19" />
85128
</GridPane>

src/main/java/br/com/pirilampo/htmlTemplate/css/simple-sidebar.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@
110110
background: none;
111111
}
112112

113+
.sidebar-nav > .sidebar-brand img {
114+
max-height: 60px;
115+
}
116+
113117
.sidebar-nav ul {
114118
padding: 0;
115119
list-style: none;
@@ -151,7 +155,7 @@
151155

152156
#menu-toggle {
153157
position: absolute;
154-
background: #14171A !important;
158+
background: #14171A;
155159
z-index: 999999;
156160
padding: 5px 10px;
157161
display: block;

src/main/java/br/com/pirilampo/htmlTemplate/dist/feature-pasta-angular.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)