Skip to content

Commit

Permalink
Testando
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoaragao committed May 9, 2016
1 parent 56a4cc0 commit a223038
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 18 deletions.
9 changes: 9 additions & 0 deletions src/tiagojavaprogramador/drone/adapter/AdapterJTable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package tiagojavaprogramador.drone.adapter;
/** @author Tiago Alexandre Soares Aragão - [email protected] - http://tiagojavaprogramador.blogspot.com */

public class AdapterJTable {

public static void main(String[] args){

}
}
18 changes: 9 additions & 9 deletions src/tiagojavaprogramador/drone/command/Cmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
*/
public class Cmd {

private String resposta = "";
private String comando = "";
private String line;
private String resposta = "response";
private String comando = "command";
private String line = "line_response";

public String comandosDownload(String comandos) {
this.comando = comandos;
Thread tw = new Thread(new Runnable() {
@Override
public void run() {
try {

ProcessBuilder builders = new ProcessBuilder("cmd.exe", "/c", comando);
builders.redirectErrorStream(true);
Process z = builders.start();
BufferedReader rs = new BufferedReader(new InputStreamReader(z.getInputStream()));

String multipleLine = "";
boolean tentativas = false;
while (true) {
Expand All @@ -45,8 +45,8 @@ public void run() {

if (line.equals("100")) {
resposta = "type_percent=Download concluido!";
}else{
resposta = "type_percent=" + line;
} else {
resposta = "type_percent=" + line;
}
}

Expand All @@ -55,9 +55,9 @@ public void run() {
}
}
} catch (IOException e) {
resposta = "type_error=";
resposta = "type_error=Erro na entrada de dados, consulte o desenvolverdor do sistema!";
} catch (NullPointerException e) {
resposta = "type_error=";
resposta = "type_error=Erro, não houve resposta do servidor, ou não há conteudo a ser mostrado!";
}
}
});
Expand Down
9 changes: 9 additions & 0 deletions src/tiagojavaprogramador/drone/controller/GetJSON.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package tiagojavaprogramador.drone.controller;
/** @author Tiago Alexandre Soares Aragão - [email protected] - http://tiagojavaprogramador.blogspot.com */

public class GetJSON {

public static void main(String[] args){

}
}
20 changes: 17 additions & 3 deletions src/tiagojavaprogramador/drone/controller/GetVideoInfo.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
package tiagojavaprogramador.drone.controller;
/** @author Tiago Alexandre Soares Aragão - [email protected] - http://tiagojavaprogramador.blogspot.com */

import tiagojavaprogramador.drone.command.Cmd;
import tiagojavaprogramador.drone.model.Video;

/** @author Tiago Alexandre Soares Aragão
* [email protected]
* http://tiagojavaprogramador.blogspot.com */

public class GetVideoInfo {

public static void main(String[] args){

private String url;

//recebe url do youtube com id do video
public GetVideoInfo(String url) {
this.url = url;
}

Cmd cmd;
Video video;


}
48 changes: 46 additions & 2 deletions src/tiagojavaprogramador/drone/model/Video.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,51 @@

public class Video {

public static void main(String[] args){

private String idVideo;
private String descVideo;
private String linkVideo;
private String linkDownVideo;
private String urlImage;

public String getIdVideo() {
return idVideo;
}

public void setIdVideo(String idVideo) {
this.idVideo = idVideo;
}

public String getDescVideo() {
return descVideo;
}

public void setDescVideo(String descVideo) {
this.descVideo = descVideo;
}

public String getLinkVideo() {
return linkVideo;
}

public void setLinkVideo(String linkVideo) {
this.linkVideo = linkVideo;
}

public String getLinkDownVideo() {
return linkDownVideo;
}

public void setLinkDownVideo(String linkDownVideo) {
this.linkDownVideo = linkDownVideo;
}

public String getUrlImage() {
return urlImage;
}

public void setUrlImage(String urlImage) {
this.urlImage = urlImage;
}


}
22 changes: 20 additions & 2 deletions src/tiagojavaprogramador/drone/view/MainView.form
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,31 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="309" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="48" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="229" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" value="Testar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
24 changes: 22 additions & 2 deletions src/tiagojavaprogramador/drone/view/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,41 @@ public MainView() {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

jButton1 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jButton1.setText("Testar");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(26, 26, 26)
.addComponent(jButton1)
.addContainerGap(309, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(48, 48, 48)
.addComponent(jButton1)
.addContainerGap(229, Short.MAX_VALUE))
);

pack();
}// </editor-fold>//GEN-END:initComponents

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

}//GEN-LAST:event_jButton1ActionPerformed


public static void main(String args[]) {

Expand Down Expand Up @@ -56,6 +75,7 @@ public void run() {
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
// End of variables declaration//GEN-END:variables

}

0 comments on commit a223038

Please sign in to comment.