-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Demanda 23
- Loading branch information
Showing
77 changed files
with
4,031 additions
and
2,061 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
.idea | ||
*.iml | ||
src/main/java/br/com/pirilampo/htmlTemplate/bower_components | ||
src/main/java/br/com/pirilampo/htmlTemplate/node_modules | ||
src/main/java/br/com/pirilampo/htmlTemplate/.bowerrc | ||
src/main/resources/htmlTemplate/node_modules | ||
yarn-error.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package br.com.pirilampo.bean; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.LinkedHashSet; | ||
|
||
@Data | ||
public class Indice { | ||
private String name = null; | ||
private LinkedHashSet<String> values = new LinkedHashSet<>(); | ||
} |
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,36 @@ | ||
package br.com.pirilampo.bean; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.control.*; | ||
import javafx.scene.layout.GridPane; | ||
import javafx.scene.paint.Color; | ||
|
||
public class MainForm { | ||
@FXML protected GridPane root; | ||
@FXML protected TextField txtNome; | ||
@FXML protected TextField txtVersao; | ||
@FXML protected TextField txtLogoSrc; | ||
@FXML protected Button btnSelecionarLogoSrc; | ||
@FXML protected ToggleGroup tipLayoutPdf; | ||
@FXML protected ColorPicker clrMenu; | ||
@FXML protected ColorPicker clrTextoMenu; | ||
@FXML protected CheckBox sitEmbedarImagens; | ||
@FXML protected ToggleGroup tipCompilacao; | ||
@FXML protected TextField txtSrcFonte; | ||
@FXML protected TextField txtSrcFonteMaster; | ||
@FXML protected Button btnSelecionarFonte; | ||
@FXML protected Button btnSelecionarFonteMaster; | ||
@FXML protected Button btnGerarHtml; | ||
@FXML protected Button btnGerarPdf; | ||
@FXML protected ProgressBar progressBar; | ||
@FXML protected TextArea txtConsole; | ||
|
||
protected void setData(Parametro parametro){ | ||
this.txtNome.setText(parametro.getTxtNome()); | ||
this.txtVersao.setText(parametro.getTxtVersao()); | ||
this.txtLogoSrc.setText(parametro.getTxtLogoSrc()); | ||
this.clrMenu.setValue(Color.web(parametro.getClrMenu())); | ||
this.clrTextoMenu.setValue(Color.web(parametro.getClrTextoMenu())); | ||
this.sitEmbedarImagens.setSelected(parametro.getSitEmbedarImagens()); | ||
} | ||
} |
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,39 @@ | ||
package br.com.pirilampo.bean; | ||
|
||
import br.com.pirilampo.constant.Diff; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@Data | ||
public class Menu implements Comparable<Menu> { | ||
private String titulo; | ||
|
||
@ToString.Exclude | ||
private String url = null; | ||
|
||
@ToString.Exclude | ||
private Diff diff = Diff.NAO_COMPARADO; | ||
|
||
@ToString.Exclude | ||
private List<Menu> filho; | ||
|
||
public Menu(String titulo){ | ||
this.titulo = titulo; | ||
this.filho = new ArrayList<>(); | ||
} | ||
|
||
public List<Menu> getFilho(){ | ||
Collections.sort(this.filho); | ||
|
||
return this.filho; | ||
} | ||
|
||
@Override | ||
public int compareTo(Menu o) { | ||
return titulo.compareTo(o.getTitulo()); | ||
} | ||
} |
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,64 @@ | ||
package br.com.pirilampo.bean; | ||
|
||
import br.com.pirilampo.constant.Artefato; | ||
import br.com.pirilampo.constant.Compilacao; | ||
import br.com.pirilampo.constant.LayoutPdf; | ||
import javafx.scene.paint.Color; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.apache.commons.cli.CommandLine; | ||
import org.apache.commons.lang.StringUtils; | ||
|
||
import java.util.Properties; | ||
|
||
@NoArgsConstructor | ||
@Data | ||
public class Parametro { | ||
private String txtNome = "Pirilampo"; | ||
private String txtVersao = "1.0"; | ||
private String txtLogoSrc; | ||
private LayoutPdf tipLayoutPdf = LayoutPdf.RETRATO; | ||
private String clrMenu = "#14171A"; | ||
private String clrTextoMenu = "#DDDDDD"; | ||
private Boolean sitEmbedarImagens = true; | ||
private Compilacao tipCompilacao = Compilacao.PASTA; | ||
private Artefato artefato = Artefato.HTML; | ||
private String txtSrcFonte; | ||
private String txtSrcFonteMaster; | ||
private String txtOutputTarget; | ||
|
||
public Parametro(MainForm form){ | ||
this.txtNome = !StringUtils.isEmpty(form.txtNome.getText()) ? form.txtNome.getText() : this.txtNome; | ||
this.txtVersao = !StringUtils.isEmpty(form.txtVersao.getText()) ? form.txtVersao.getText() : this.txtVersao; | ||
this.txtLogoSrc = form.txtLogoSrc.getText(); | ||
this.tipLayoutPdf = LayoutPdf.valueOf((String) form.tipLayoutPdf.getSelectedToggle().getUserData()); | ||
this.clrMenu = colorHex(form.clrMenu.getValue()); | ||
this.clrTextoMenu = colorHex(form.clrTextoMenu.getValue()); | ||
this.sitEmbedarImagens = form.sitEmbedarImagens.isSelected(); | ||
this.tipCompilacao = Compilacao.valueOf((String) form.tipCompilacao.getSelectedToggle().getUserData()); | ||
this.txtSrcFonte = form.txtSrcFonte.getText(); | ||
this.txtSrcFonteMaster = form.txtSrcFonteMaster.getText(); | ||
} | ||
|
||
public Parametro(CommandLine cmd){ | ||
this.txtNome = cmd.getOptionValue("name"); | ||
this.txtVersao = cmd.getOptionValue("version"); | ||
this.txtSrcFonte = !StringUtils.isEmpty(cmd.getOptionValue("feature")) ? cmd.getOptionValue("feature") : this.txtSrcFonte; | ||
this.txtSrcFonte = !StringUtils.isEmpty(cmd.getOptionValue("feature_path")) ? cmd.getOptionValue("feature_path") : this.txtSrcFonte; | ||
this.txtSrcFonteMaster = cmd.getOptionValue("feature_path_master"); | ||
this.txtOutputTarget = cmd.getOptionValue("output"); | ||
} | ||
|
||
public Parametro(Properties properties){ | ||
this.txtNome = !StringUtils.isEmpty(properties.getProperty("txtNome")) ? properties.getProperty("txtNome") : this.txtNome; | ||
this.txtVersao = !StringUtils.isEmpty(properties.getProperty("txtVersao")) ? properties.getProperty("txtVersao") : this.txtVersao; | ||
this.txtLogoSrc = !StringUtils.isEmpty(properties.getProperty("txtLogoSrc")) ? properties.getProperty("txtLogoSrc") : this.txtLogoSrc; | ||
this.clrMenu = !StringUtils.isEmpty(properties.getProperty("clrMenu")) ? properties.getProperty("clrMenu") : this.clrMenu; | ||
this.clrTextoMenu = !StringUtils.isEmpty(properties.getProperty("clrTextoMenu")) ? properties.getProperty("clrTextoMenu") : this.clrTextoMenu; | ||
this.sitEmbedarImagens = !StringUtils.isEmpty(properties.getProperty("sitEmbedarImagens")) ? Boolean.valueOf(properties.getProperty("sitEmbedarImagens")) : this.sitEmbedarImagens; | ||
} | ||
|
||
public String colorHex(Color color){ | ||
return '#' + color.toString().substring(2, 8); | ||
} | ||
} |
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,17 @@ | ||
package br.com.pirilampo.bind; | ||
|
||
import javafx.application.Platform; | ||
import javafx.beans.property.SimpleStringProperty; | ||
import javafx.beans.property.StringProperty; | ||
import lombok.Getter; | ||
|
||
public final class ConsoleBind { | ||
@Getter | ||
private static StringProperty logData = new SimpleStringProperty(); | ||
|
||
public static void setLogData(String data) { | ||
try { | ||
Platform.runLater(() -> logData.set(data)); | ||
}catch (Exception ignored){} | ||
} | ||
} |
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,17 @@ | ||
package br.com.pirilampo.bind; | ||
|
||
import javafx.application.Platform; | ||
import javafx.beans.property.DoubleProperty; | ||
import javafx.beans.property.SimpleDoubleProperty; | ||
import lombok.Getter; | ||
|
||
public final class ProgressBind { | ||
@Getter | ||
private static DoubleProperty progress = new SimpleDoubleProperty(); | ||
|
||
public static void setProgress(double data) { | ||
try { | ||
Platform.runLater(() -> progress.set(data)); | ||
}catch (Exception ignored){} | ||
} | ||
} |
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,15 @@ | ||
package br.com.pirilampo.constant; | ||
|
||
public enum Artefato { | ||
HTML("HTML"), PDF("PDF"); | ||
|
||
private final String vl; | ||
|
||
Artefato(String vl){ | ||
this.vl = vl; | ||
} | ||
|
||
public String getValue(){ | ||
return vl; | ||
} | ||
} |
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,15 @@ | ||
package br.com.pirilampo.constant; | ||
|
||
public enum Compilacao { | ||
PASTA("PASTA"), FEATURE("FEATURE"), DIFF("DIFF"); | ||
|
||
private final String vl; | ||
|
||
Compilacao(String vl){ | ||
this.vl = vl; | ||
} | ||
|
||
public String getValue(){ | ||
return vl; | ||
} | ||
} |
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,18 @@ | ||
package br.com.pirilampo.constant; | ||
|
||
public enum Diff { | ||
NAO_COMPARADO(0), | ||
IGUAL(1), | ||
DIFERENTE(2), | ||
NOVO(3); | ||
|
||
private final Integer vl; | ||
|
||
Diff(Integer vl){ | ||
this.vl = vl; | ||
} | ||
|
||
public Integer getValue(){ | ||
return vl; | ||
} | ||
} |
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,37 @@ | ||
package br.com.pirilampo.constant; | ||
|
||
final public class HtmlTemplate { | ||
public static final String HTML_TEMPLATE = "<script type=\"text/ng-template\" id=\"%s\">%s</script>\n"; | ||
public static final String HTML_JAVASCRIPT = "<script type=\"text/javascript\">%s</script>\n"; | ||
public static final String HTML_CSS = "<style>%s</style>\n"; | ||
public static final String HTML_FEATURE_PDF = "<h1 class=\"page-header\">%s <small>%s <em>%s</em></small></h1>\n" + | ||
"%s\n<span style=\"page-break-after: always\"></span>"; | ||
|
||
|
||
// FEATURE | ||
public static final String HTML_TITULO = "<h2>%s</h2>\n"; | ||
public static final String HTML_PARAGRAFO = "<p>%s</p>\n"; | ||
public static final String HTML_STEP = "<p><span class=\"keyword\">%s</span> %s</p>\n"; | ||
public static final String HTML_CODE = "<pre>%s</pre>\n"; | ||
|
||
public static final String HTML_CHILDREN = "<div class=\"panel panel-default\">\n" + | ||
"<div class=\"panel-heading\" style=\"cursor: pointer;\" data-toggle=\"collapse\" data-target=\"#scenario-%s\"><h3>%s</h3></div>\n%s\n</div>\n"; | ||
public static final String HTML_CHILDREN_BODY = "<div id=\"scenario-%s\" class=\"panel-body collapse in\">%s</div>\n"; | ||
public static final String HTML_CHILDREN_TABLE = "<div class=\"table-responsive\">\n" + | ||
"<table class=\"table table-condensed table-bordered table-hover table-striped\">\n" + | ||
"<thead>\n%s\n</thead>\n" + | ||
"<tbody>\n%s\n</tbody>\n" + | ||
"</table>\n</div>\n"; | ||
public static final String HTML_CHILDREN_TABLE_TR = "<tr>%s</tr>\n"; | ||
public static final String HTML_CHILDREN_TABLE_TH = "<th>%s</th>\n"; | ||
public static final String HTML_CHILDREN_TABLE_TD = "<td>%s</td>\n"; | ||
|
||
// MENU | ||
public static final String HTML_MENU_FILHO = "\t\t<li><a href=\"#/feature/%s\">%s%s</a></li>\n"; | ||
public static final String HTML_MENU_PAI = "<li>\n" + | ||
"\t<a href=\"javascript:;\" data-toggle=\"collapse\" data-target=\"#menu-%s\">%s</a>\n" + | ||
"\t<ul id=\"menu-%s\" class=\"collapse\">\n%s\t</ul>\n" + | ||
"</li>\n"; | ||
public static final String HTML_MENU_ICON_DIFF_NOVO = "<span class=\"icon-diff-novo\"></span> "; | ||
public static final String HTML_MENU_ICON_DIFF_DIFERENTE = "<span class=\"icon-diff-diferente\"></span> "; | ||
} |
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,15 @@ | ||
package br.com.pirilampo.constant; | ||
|
||
public enum LayoutPdf { | ||
RETRATO("R"), PAISAGEM("P"); | ||
|
||
private final String vl; | ||
|
||
LayoutPdf(String vl){ | ||
this.vl = vl; | ||
} | ||
|
||
public String getValue(){ | ||
return vl; | ||
} | ||
} |
Oops, something went wrong.