Skip to content

Commit 24e6357

Browse files
authored
Add files via upload
1 parent 5c8bb60 commit 24e6357

19 files changed

Lines changed: 434 additions & 0 deletions

File tree

Campeonato/nb-configuration.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project-shared-configuration>
3+
<!--
4+
This file contains additional configuration written by modules in the NetBeans IDE.
5+
The configuration is intended to be shared among all the users of project and
6+
therefore it is assumed to be part of version control checkout.
7+
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
8+
-->
9+
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
10+
<!--
11+
Properties that influence various parts of the IDE, especially code formatting and the like.
12+
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
13+
That way multiple projects can share the same settings (useful for formatting rules for example).
14+
Any value defined here will override the pom.xml file value but is only applicable to the current project.
15+
-->
16+
<netbeans.compile.on.save>none</netbeans.compile.on.save>
17+
</properties>
18+
</project-shared-configuration>

Campeonato/nbactions.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<actions>
3+
<action>
4+
<actionName>run</actionName>
5+
<goals>
6+
<goal>clean</goal>
7+
<goal>package</goal>
8+
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
9+
</goals>
10+
<properties>
11+
<runfx.args>-jar "${project.build.directory}/${project.build.finalName}.jar"</runfx.args>
12+
</properties>
13+
</action>
14+
<action>
15+
<actionName>debug</actionName>
16+
<goals>
17+
<goal>clean</goal>
18+
<goal>package</goal>
19+
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
20+
</goals>
21+
<properties>
22+
<runfx.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Dglass.disableGrab=true -jar "${project.build.directory}/${project.build.finalName}.jar"</runfx.args>
23+
<jpda.listen>true</jpda.listen>
24+
</properties>
25+
</action>
26+
</actions>

Campeonato/pom.xml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>com.mycompany</groupId>
6+
<artifactId>Campeonato</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
<packaging>jar</packaging>
9+
10+
<name>Campeonato</name>
11+
12+
<properties>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<mainClass>com.mycompany.campeonato.MainApp</mainClass>
15+
</properties>
16+
17+
<organization>
18+
<!-- Used as the 'Vendor' for JNLP generation -->
19+
<name>Your Organisation</name>
20+
</organization>
21+
22+
<build>
23+
<plugins>
24+
<plugin>
25+
<groupId>org.apache.maven.plugins</groupId>
26+
<artifactId>maven-dependency-plugin</artifactId>
27+
<version>2.6</version>
28+
<executions>
29+
<execution>
30+
<id>unpack-dependencies</id>
31+
<phase>package</phase>
32+
<goals>
33+
<goal>unpack-dependencies</goal>
34+
</goals>
35+
<configuration>
36+
<excludeScope>system</excludeScope>
37+
<excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
38+
<outputDirectory>${project.build.directory}/classes</outputDirectory>
39+
</configuration>
40+
</execution>
41+
</executions>
42+
</plugin>
43+
<plugin>
44+
<groupId>org.codehaus.mojo</groupId>
45+
<artifactId>exec-maven-plugin</artifactId>
46+
<version>1.2.1</version>
47+
<executions>
48+
<execution>
49+
<id>unpack-dependencies</id>
50+
51+
<phase>package</phase>
52+
<goals>
53+
<goal>exec</goal>
54+
</goals>
55+
<configuration>
56+
<executable>${java.home}/../bin/javafxpackager</executable>
57+
<arguments>
58+
<argument>-createjar</argument>
59+
<argument>-nocss2bin</argument>
60+
<argument>-appclass</argument>
61+
<argument>${mainClass}</argument>
62+
<argument>-srcdir</argument>
63+
<argument>${project.build.directory}/classes</argument>
64+
<argument>-outdir</argument>
65+
<argument>${project.build.directory}</argument>
66+
<argument>-outfile</argument>
67+
<argument>${project.build.finalName}.jar</argument>
68+
</arguments>
69+
</configuration>
70+
</execution>
71+
<execution>
72+
<id>default-cli</id>
73+
<goals>
74+
<goal>exec</goal>
75+
</goals>
76+
<configuration>
77+
<executable>${java.home}/bin/java</executable>
78+
<commandlineArgs>${runfx.args}</commandlineArgs>
79+
</configuration>
80+
</execution>
81+
</executions>
82+
</plugin>
83+
<plugin>
84+
<groupId>org.apache.maven.plugins</groupId>
85+
<artifactId>maven-compiler-plugin</artifactId>
86+
<version>3.1</version>
87+
<configuration>
88+
<source>1.7</source>
89+
<target>1.7</target>
90+
<compilerArguments>
91+
<bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath>
92+
</compilerArguments>
93+
</configuration>
94+
</plugin>
95+
<plugin>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-surefire-plugin</artifactId>
98+
<version>2.16</version>
99+
<configuration>
100+
<additionalClasspathElements>
101+
<additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement>
102+
</additionalClasspathElements>
103+
</configuration>
104+
</plugin>
105+
</plugins>
106+
</build>
107+
108+
</project>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.mycompany.campeonato;
2+
3+
import javafx.application.Application;
4+
import static javafx.application.Application.launch;
5+
import javafx.fxml.FXMLLoader;
6+
import javafx.scene.Parent;
7+
import javafx.scene.Scene;
8+
import javafx.stage.Stage;
9+
10+
11+
public class MainApp extends Application {
12+
13+
@Override
14+
public void start(Stage stage) throws Exception {
15+
Parent root = FXMLLoader.load(getClass().getResource("/fxml/Principal.fxml"));
16+
17+
Scene scene = new Scene(root);
18+
scene.getStylesheets().add("/styles/Styles.css");
19+
20+
stage.setTitle("Sistema de campeonato");
21+
stage.setScene(scene);
22+
stage.show();
23+
}
24+
25+
/**
26+
* The main() method is ignored in correctly deployed JavaFX application.
27+
* main() serves only as fallback in case the application can not be
28+
* launched through deployment artifacts, e.g., in IDEs with limited FX
29+
* support. NetBeans ignores main().
30+
*
31+
* @param args the command line arguments
32+
*/
33+
public static void main(String[] args) {
34+
launch(args);
35+
}
36+
37+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package model;
7+
8+
/**
9+
*
10+
* @author deinfo
11+
*/
12+
public class Jogo extends Time {
13+
String timeA, timeB;
14+
byte golA, golB;
15+
16+
public String getTimeA() {
17+
return timeA;
18+
}
19+
20+
public void setTimeA(String timeA) {
21+
this.timeA = timeA;
22+
}
23+
24+
public String getTimeB() {
25+
return timeB;
26+
}
27+
28+
public void setTimeB(String timeB) {
29+
this.timeB = timeB;
30+
}
31+
32+
public byte getGolA() {
33+
return golA;
34+
}
35+
36+
public void setGolA(byte golA) {
37+
this.golA = golA;
38+
}
39+
40+
public byte getGolB() {
41+
return golB;
42+
}
43+
44+
public void setGolB(byte golB) {
45+
this.golB = golB;
46+
}
47+
48+
public Jogo() {
49+
50+
}
51+
52+
public Jogo(String timeA, String golA, String timeB, String golB) {
53+
this.timeA = timeA.toUpperCase();
54+
this.timeB = timeB.toUpperCase();
55+
this.golA = Byte.parseByte(golA);
56+
this.golB = Byte.parseByte(golB);
57+
}
58+
59+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package model;
7+
8+
/**
9+
*
10+
* @author Gusta
11+
*/
12+
public class Time {
13+
String nome;
14+
int vit = 0, der = 0, emp = 0;
15+
int golP = 0, golN = 0;
16+
17+
public String getNome() {
18+
return nome;
19+
}
20+
21+
public void setNome(String nome) {
22+
this.nome = nome;
23+
}
24+
25+
public int getVit() {
26+
return vit;
27+
}
28+
29+
public void setVit(int vit) {
30+
if(vit > 0)
31+
this.vit = vit;
32+
}
33+
34+
public int getDer() {
35+
return der;
36+
}
37+
38+
public void setDer(int der) {
39+
if(der > 0)
40+
this.der = der;
41+
}
42+
43+
public int getEmp() {
44+
return emp;
45+
}
46+
47+
public void setEmp(int emp) {
48+
if(emp > 0)
49+
this.emp = emp;
50+
}
51+
52+
public int getGolP() {
53+
return golP;
54+
}
55+
56+
public void setGolP(int golP) {
57+
if(golP > 0)
58+
this.golP = golP;
59+
}
60+
61+
public int getGolN() {
62+
return golN;
63+
}
64+
65+
public void setGolN(int golN) {
66+
if(golN > 0)
67+
this.golN = golN;
68+
}
69+
70+
int saldoGols() {
71+
return golP - golN;
72+
}
73+
74+
int pontos() {
75+
return (vit*3) + emp;
76+
}
77+
78+
int partidas() {
79+
return vit + der + emp;
80+
}
81+
82+
void addVit() {
83+
this.vit++;
84+
}
85+
86+
void addEmp() {
87+
this.emp++;
88+
}
89+
90+
void addDer() {
91+
this.der++;
92+
}
93+
94+
public Time() {
95+
}
96+
97+
public Time(String nome) {
98+
this.nome = nome;
99+
}
100+
101+
102+
@Override
103+
public String toString() {
104+
return "Time{" + "nome=" + nome + '}';
105+
}
106+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package view;
2+
3+
import java.net.URL;
4+
import java.util.ResourceBundle;
5+
import javafx.event.ActionEvent;
6+
import javafx.fxml.FXML;
7+
import javafx.fxml.Initializable;
8+
import javafx.scene.control.Label;
9+
import model.Jogo;
10+
import model.Time;
11+
12+
public class PrincipalController implements Initializable {
13+
14+
@FXML
15+
private Label label;
16+
17+
@FXML
18+
private void handleButtonAction(ActionEvent event) {
19+
System.out.println("You clicked me!");
20+
label.setText("Hello World!");
21+
}
22+
23+
@Override
24+
public void initialize(URL url, ResourceBundle rb) {
25+
// TODO
26+
27+
Time time1 = new Time("Curintia");
28+
Time time2 = new Time("Framenguis");
29+
30+
Jogo jogo1 = new Jogo(time1.getNome(), "3", time2.getNome(), "2");
31+
System.out.println("NomeTime1: " + jogo1.getTimeA() + " GolsTimeA: " + jogo1.getGolA() + " NomeTimeB: " + jogo1.getTimeB() + " GolsTimeB: " + jogo1.getGolB());
32+
}
33+
}

0 commit comments

Comments
 (0)