Skip to content

Commit

Permalink
Perdi o controle da minha vida e agora estou revivendo um projeto de …
Browse files Browse the repository at this point in the history
…6 anos atrás
  • Loading branch information
JGSMoreira committed Mar 25, 2024
1 parent 824a653 commit 51ce083
Show file tree
Hide file tree
Showing 27 changed files with 4,995 additions and 326 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/nbproject/private/
/build/
/dist/
Binary file not shown.
Binary file added lib/javafx-swt.jar
Binary file not shown.
Binary file added lib/javafx.base.jar
Binary file not shown.
Binary file added lib/javafx.controls.jar
Binary file not shown.
Binary file added lib/javafx.fxml.jar
Binary file not shown.
Binary file added lib/javafx.graphics.jar
Binary file not shown.
Binary file added lib/javafx.media.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/javafx.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
javafx.version=22
javafx.runtime.version=22+30
javafx.runtime.build=30
Binary file added lib/javafx.swing.jar
Binary file not shown.
Binary file added lib/javafx.web.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions lib/nblibraries.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libs.CopyLibs.classpath=\
${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
libs.CopyLibs.displayName=CopyLibs Task
libs.CopyLibs.prop-version=3.0
23 changes: 23 additions & 0 deletions nbproject/UPDATED.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
======================================
Project SamEBrabo build script updated
======================================

Project build script file jfx-impl.xml in nbproject sub-directory has not been recognized
as compliant with this version of NetBeans JavaFX support module. To ensure correct
and complete functionality within this NetBeans installation the script file has been
backed up to jfx-impl_backup.xml and then updated to the currently supported state.

FX Project build script auto-update may be triggered on project open either after
NetBeans installation update or by manual changes in jfx-impl.xml. Please note that
changing jfx-impl.xml manually is not recommended. Any build customization code should
be placed only in build.xml in project root directory.

Remark: The auto-update mechanism can be disabled by setting property
javafx.disable.autoupdate=true
Automatic opening of this notification when project files are updated can be disabled by setting property
javafx.disable.autoupdate.notification=true
(in build.properties, private.properties or project.properties).

Remark: Files nbproject/jfx-impl_backup*.xml and this file nbproject/UPDATED.TXT
are not used when building the project and can be freely deleted.

792 changes: 598 additions & 194 deletions nbproject/build-impl.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions nbproject/configs/Run_as_WebStart.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Do not modify this property in this configuration. It can be re-generated.
$label=Run as WebStart
2 changes: 2 additions & 0 deletions nbproject/configs/Run_in_Browser.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Do not modify this property in this configuration. It can be re-generated.
$label=Run in Browser
6 changes: 3 additions & 3 deletions nbproject/genfiles.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ build.xml.script.CRC32=2387528d
build.xml.stylesheet.CRC32=[email protected]
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=29ccef3d
nbproject/build-impl.xml.script.CRC32=6a219795
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
nbproject/build-impl.xml.data.CRC32=8608a7c6
nbproject/build-impl.xml.script.CRC32=019993cc
nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.110.0.48
218 changes: 183 additions & 35 deletions nbproject/jfx-impl.xml

Large diffs are not rendered by default.

4,049 changes: 4,049 additions & 0 deletions nbproject/jfx-impl_backup.xml

Large diffs are not rendered by default.

51 changes: 47 additions & 4 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=SamEBrabo
application.vendor=Joao
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
Expand All @@ -22,35 +23,61 @@ compile.on.save.unsupported.javafx=true
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.modulepath=\
${run.modulepath}
debug.test.classpath=\
${run.test.classpath}
debug.test.modulepath=\
${run.test.modulepath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/SamEBrabo.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.javafx-swt.jar=lib/javafx-swt.jar
file.reference.javafx.base.jar=lib/javafx.base.jar
file.reference.javafx.controls.jar=lib/javafx.controls.jar
file.reference.javafx.fxml.jar=lib/javafx.fxml.jar
file.reference.javafx.graphics.jar=lib/javafx.graphics.jar
file.reference.javafx.media.jar=lib/javafx.media.jar
file.reference.javafx.swing.jar=lib/javafx.swing.jar
file.reference.javafx.web.jar=lib/javafx.web.jar
includes=**
# Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects
jar.archive.disabled=true
jar.compress=false
javac.classpath=\
${file.reference.javafx-swt.jar}:\
${file.reference.javafx.base.jar}:\
${file.reference.javafx.controls.jar}:\
${file.reference.javafx.fxml.jar}:\
${file.reference.javafx.graphics.jar}:\
${file.reference.javafx.media.jar}:\
${file.reference.javafx.swing.jar}:\
${file.reference.javafx.web.jar}:\
${javafx.classpath.extension}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.external.vm=false
javac.modulepath=
javac.processormodulepath=
javac.processorpath=\
${javac.classpath}
javac.source=1.8
javac.target=1.8
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
javac.test.modulepath=\
${javac.modulepath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.html5=false
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
Expand All @@ -62,14 +89,19 @@ javadoc.windowtitle=
javafx.application.implementation.version=1.0
javafx.binarycss=false
javafx.classpath.extension=\
${java.home}/lib/javaws.jar:\
${java.home}/lib/deploy.jar:\
${java.home}/lib/plugin.jar
${platforms.JDK_1.8.home}/jre/lib/javaws.jar:\
${platforms.JDK_1.8.home}/jre/lib/deploy.jar:\
${platforms.JDK_1.8.home}/jre/lib/plugin.jar
javafx.deploy.adddesktopshortcut=false
javafx.deploy.addstartmenushortcut=false
javafx.deploy.allowoffline=true
# If true, application update mode is set to 'background', if false, update mode is set to 'eager'
javafx.deploy.backgroundupdate=false
javafx.deploy.disable.proxy=false
javafx.deploy.embedJNLP=true
javafx.deploy.includeDT=true
javafx.deploy.installpermanently=false
javafx.deploy.permissionselevated=false
# Definir como verdadeiro impede a cria\u00e7\u00e3o de c\u00f3pia tempor\u00e1ria de artefatos de implanta\u00e7\u00e3o antes de cada execu\u00e7\u00e3o (desativa as execu\u00e7\u00f5es atuais)
javafx.disable.concurrent.runs=false
# Definir como verdadeiro ativa v\u00e1rias execu\u00e7\u00f5es simult\u00e2neas do mesmo WebStart ou projeto Run-in-Browser
Expand All @@ -90,6 +122,11 @@ javafx.preloader.type=none
javafx.rebase.libs=false
javafx.run.height=600
javafx.run.width=800
javafx.signing.blob=false
javafx.signing.enabled=false
javafx.signing.type=notsigned
jlink.launcher=false
jlink.launcher.name=SamEBrabo
# Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects
jnlp.enabled=false
# Main class for Java launcher
Expand All @@ -100,14 +137,20 @@ manifest.custom.codebase=*
manifest.custom.permissions=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
mkdist.disabled=false
native.bundling.enabled=false
platform.active=JDK_1.8
run.classpath=\
${dist.jar}:\
${javac.classpath}:\
${build.classes.dir}
run.modulepath=\
${javac.modulepath}
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
run.test.modulepath=\
${javac.test.modulepath}
source.encoding=UTF-8
src.dir=src
test.src.dir=test
4 changes: 4 additions & 0 deletions nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
</buildExtensions>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>SamEBrabo</name>
<explicit-platform explicit-source-supported="true"/>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
<definitions>.\lib\nblibraries.properties</definitions>
</libraries>
</configuration>
</project>
43 changes: 8 additions & 35 deletions src/br/com/sam/control/ImagemController.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,21 @@
*/
package br.com.sam.control;

import br.com.sam.seila.TipoMeme;
import java.awt.image.RenderedImage;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.embed.swing.SwingFXUtils;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.image.WritableImage;
import javafx.scene.layout.Pane;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import javafx.stage.Window;
import javax.imageio.ImageIO;

Expand All @@ -33,9 +30,9 @@
*/
public class ImagemController implements Initializable {

private String tipo;
private String textosup;
private String textoinf;
private final TipoMeme tipo;
private final String textosup;
private final String textoinf;
private Window janela;
@FXML
private Label lblsuperior;
Expand All @@ -46,35 +43,10 @@ public class ImagemController implements Initializable {
@FXML
private Pane painelmeme;

/**
* Initializes the controller class.
*/

public void receberDados(){
lblsuperior.setText(textosup);
lblinferior.setText(textoinf);
verificaTipo();
}

public void verificaTipo(){
if (tipo == "irineu"){
imgfoto.setImage(new Image("/img/irineu.jpg"));
}
if (tipo == "capeto"){
imgfoto.setImage(new Image("/img/capeto.png"));
}
if (tipo == "reflexao"){
imgfoto.setImage(new Image("/img/reflexo.png"));
}
if (tipo == "vd1"){
imgfoto.setImage(new Image("/img/vd1.png"));
}
if (tipo == "vd2"){
imgfoto.setImage(new Image("/img/vd2.png"));
}
if (tipo == "vd3"){
imgfoto.setImage(new Image("/img/vd3.png"));
}
imgfoto.setImage(new Image(tipo.getDiretorio()));
}

@FXML
Expand All @@ -95,12 +67,13 @@ public void alterarImagem(){
public void exportarMeme(){
FileChooser fileChooser = new FileChooser();
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("Imagens PNG (*.PNG)", "*.png"));
fileChooser.setInitialFileName(textosup + " " + textoinf);

File file = fileChooser.showSaveDialog(null);

if(file != null){
try {
WritableImage writableImage = new WritableImage((int)painelmeme.getWidth(), (int)painelmeme.getHeight());
WritableImage writableImage = new WritableImage((int) painelmeme.getWidth(), (int) painelmeme.getHeight());
painelmeme.snapshot(null, writableImage);
RenderedImage renderedImage = SwingFXUtils.fromFXImage(writableImage, null);
ImageIO.write(renderedImage, "png", file);
Expand All @@ -110,7 +83,7 @@ public void exportarMeme(){
}
}

public ImagemController(String superior, String inferior, String tipo){
public ImagemController(String superior, String inferior, TipoMeme tipo){
this.textosup = superior;
this.textoinf = inferior;
this.tipo = tipo;
Expand Down
54 changes: 15 additions & 39 deletions src/br/com/sam/control/MenuController.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@
*/
package br.com.sam.control;

import br.com.sam.seila.TipoMeme;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.collections.ObservableArray;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup;
import javafx.stage.Stage;

/**
Expand All @@ -34,24 +32,10 @@ public class MenuController implements Initializable {
@FXML
private TextField txtinferior;
@FXML
private Button btnirineu;
@FXML
private RadioButton rdirineu;
@FXML
private ToggleGroup aaa;
@FXML
private RadioButton rdreflexao;
@FXML
private RadioButton rdvd1;
@FXML
private RadioButton rdvd2;
@FXML
private RadioButton rdvd3;
@FXML
private RadioButton rdcapeto;
private ComboBox cbTipoMeme;

@FXML
public void gerarMeme(String tipo){
public void gerarMeme(TipoMeme tipo){
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/br/com/sam/view/Imagem.fxml"));
loader.setControllerFactory(c -> {return new ImagemController(txtsuperior.getText(), txtinferior.getText(), tipo);});
Expand All @@ -69,29 +53,21 @@ public void gerarMeme(String tipo){
}

@FXML
public void enviaDados(){
if(rdcapeto.isSelected()){
gerarMeme("capeto");
}
if(rdirineu.isSelected()){
gerarMeme("irineu");
}
if(rdreflexao.isSelected()){
gerarMeme("reflexao");
}
if(rdvd1.isSelected()){
gerarMeme("vd1");
}
if(rdvd2.isSelected()){
gerarMeme("vd2");
}
if(rdvd3.isSelected()){
gerarMeme("vd3");
}
public void enviaDados(){
TipoMeme tipoMeme = TipoMeme.valueOfNome((String) cbTipoMeme.getValue());
gerarMeme(tipoMeme);
}

@Override
public void initialize(URL url, ResourceBundle rb) {
ObservableList<String> items = FXCollections.observableArrayList();

for (TipoMeme item : TipoMeme.values()){
items.add(item.getNome());
}

cbTipoMeme.setItems(items);
cbTipoMeme.setValue(TipoMeme.IRINEU.getNome());

}

Expand Down
Loading

0 comments on commit 51ce083

Please sign in to comment.