Commit 658471f8 authored by Christopher Reis's avatar Christopher Reis

Added tracker thread

parent a9ebd350
...@@ -17,5 +17,6 @@ ...@@ -17,5 +17,6 @@
<classpathentry kind="lib" path="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.core.databinding_1.5.0.v20150422-0725.jar" sourcepath="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.core.databinding_1.5.0.v20150422-0725.jar"/> <classpathentry kind="lib" path="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.core.databinding_1.5.0.v20150422-0725.jar" sourcepath="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.core.databinding_1.5.0.v20150422-0725.jar"/>
<classpathentry kind="lib" path="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.core.databinding.observable_1.5.0.v20150422-0725.jar" sourcepath="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.core.databinding.observable_1.5.0.v20150422-0725.jar"/> <classpathentry kind="lib" path="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.core.databinding.observable_1.5.0.v20150422-0725.jar" sourcepath="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.core.databinding.observable_1.5.0.v20150422-0725.jar"/>
<classpathentry kind="lib" path="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.jface.databinding_1.7.0.v20150406-2148.jar" sourcepath="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.jface.databinding_1.7.0.v20150406-2148.jar"/> <classpathentry kind="lib" path="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.jface.databinding_1.7.0.v20150406-2148.jar" sourcepath="C:/Users/Christopher/Desktop/eclipse/plugins/org.eclipse.jface.databinding_1.7.0.v20150406-2148.jar"/>
<classpathentry kind="lib" path="jgoodies-forms-1.8.0.jar" sourcepath="jgoodies-forms-1.8.0-sources.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
...@@ -108,7 +108,7 @@ public class Application { ...@@ -108,7 +108,7 @@ public class Application {
}); });
mnFile.add(mntmSaveTleXml); mnFile.add(mntmSaveTleXml);
JMenuItem mntmCustomeSatelliteTrack = new JMenuItem("Custome Satellite Track"); JMenuItem mntmCustomeSatelliteTrack = new JMenuItem("Custom Satellite Track");
mnFile.add(mntmCustomeSatelliteTrack); mnFile.add(mntmCustomeSatelliteTrack);
JMenuItem mntmSettings = new JMenuItem("Settings"); JMenuItem mntmSettings = new JMenuItem("Settings");
...@@ -136,6 +136,12 @@ public class Application { ...@@ -136,6 +136,12 @@ public class Application {
menuBar.add(mnView); menuBar.add(mnView);
JMenuItem mntmSelectSatellite = new JMenuItem("Select Satellite"); JMenuItem mntmSelectSatellite = new JMenuItem("Select Satellite");
mntmSelectSatellite.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
(new Thread(new trackerThread())).start();
}
});
mnView.add(mntmSelectSatellite); mnView.add(mntmSelectSatellite);
JMenu mnWindows = new JMenu("Windows"); JMenu mnWindows = new JMenu("Windows");
......
package GUI;
import java.awt.EventQueue;
import javax.swing.JInternalFrame;
public class satelliteInfo extends JInternalFrame {
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
satelliteInfo frame = new satelliteInfo();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public satelliteInfo() {
setBounds(100, 100, 450, 300);
}
}
package GUI;
import java.awt.EventQueue;
import javax.swing.JInternalFrame;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.layout.FormSpecs;
import javax.swing.JLabel;
public class satelliteStatus extends JInternalFrame {
/**
* Create the frame.
*/
public satelliteStatus() {
setBounds(100, 100, 451, 576);
getContentPane().setLayout(new FormLayout(new ColumnSpec[] {
FormSpecs.RELATED_GAP_COLSPEC,
FormSpecs.DEFAULT_COLSPEC,
FormSpecs.RELATED_GAP_COLSPEC,
FormSpecs.DEFAULT_COLSPEC,},
new RowSpec[] {
FormSpecs.RELATED_GAP_ROWSPEC,
FormSpecs.DEFAULT_ROWSPEC,
FormSpecs.RELATED_GAP_ROWSPEC,
FormSpecs.DEFAULT_ROWSPEC,}));
}
}
...@@ -94,7 +94,8 @@ public class satelliteTree extends JInternalFrame { ...@@ -94,7 +94,8 @@ public class satelliteTree extends JInternalFrame {
BufferedImage img = null; BufferedImage img = null;
try { try {
img = ImageIO.read(new File("C:\\Users\\Christopher\\Documents\\GitHub\\Satellite\\satellite.png")); img = ImageIO.read(new File("D:\\MyDocuments\\GitHub\\Satellite\\satellite.png"));
//C:\\Users\\Christopher\\Documents\\GitHub\\Satellite\\satellite.png
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
package satellite;
public class tracker {
public static void main(String[] args) {
SatelliteDB satellites = new SatelliteDB("SatelliteDB");
satellites.readXML();
satellites.getSatellites_GPS();
satellites.getSatellites_NOAA();
satellites.getSatellites_Stations();
satellites.getSatellites_GEO();
satellites.getSatellites_Iridium();
satellites.writeToXML();
System.out.println("There are " + satellites.getSize() + " in the database!");
}
}
package satellite;
public class trackerThread implements Runnable{
int seconds = 0;
public void run(){
while(true){
System.out.println("Running for: "+ seconds);
seconds++;
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment