Added hourly forecast and message forecast
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package com.flaremicro.visualforecast;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
@@ -9,10 +10,13 @@ import java.awt.event.KeyListener;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.Timer;
|
||||
|
||||
import com.flaremicro.util.Util;
|
||||
import com.flaremicro.visualforecast.api.ForecastProvider;
|
||||
import com.flaremicro.visualforecast.api.ForecastProviderManager;
|
||||
|
||||
@@ -34,6 +38,7 @@ public class VisualForecastFrame extends JFrame implements WindowListener, KeyLi
|
||||
* Launch the application.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
final Map<String, String> arguments = Util.parseArgs(args, true);
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
try
|
||||
@@ -41,6 +46,29 @@ public class VisualForecastFrame extends JFrame implements WindowListener, KeyLi
|
||||
VisualForecastFrame frame = new VisualForecastFrame();
|
||||
frame.setVisible(true);
|
||||
frame.init();
|
||||
|
||||
if (arguments.containsKey("fullscreen"))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
int index = Integer.parseInt(arguments.get("fullscreen"));
|
||||
|
||||
GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
|
||||
if(index < 0 || devices.length < index)
|
||||
{
|
||||
JOptionPane.showMessageDialog(frame, arguments.get("fullscreen") + " does not exist as a screen index");
|
||||
}
|
||||
else
|
||||
{
|
||||
devices[index].setFullScreenWindow(frame);
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
JOptionPane.showMessageDialog(frame, arguments.get("fullscreen") + " is not a valid screen index");
|
||||
}
|
||||
}
|
||||
//GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()[1].setFullScreenWindow(frame);
|
||||
//frame.createBufferStrategy(2);
|
||||
}
|
||||
@@ -74,7 +102,6 @@ public class VisualForecastFrame extends JFrame implements WindowListener, KeyLi
|
||||
}
|
||||
});
|
||||
timer.start();
|
||||
|
||||
|
||||
new Thread() {
|
||||
public void run() {
|
||||
|
||||
Reference in New Issue
Block a user