???
This commit is contained in:
@@ -2,16 +2,26 @@ package com.flaremicro.flaretv.visualforecast;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public class VisualForecastFrame extends JFrame {
|
||||
import com.flaremicro.flaretv.visualforecast.providerapi.ForecastProviderManager;
|
||||
|
||||
public class VisualForecastFrame extends JFrame implements WindowListener, KeyListener{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private RenderPanel contentPane;
|
||||
private RenderPanel renderPane;
|
||||
private ForecastProviderManager forecastProviderManager;
|
||||
private Executor executor;
|
||||
private PropertyManager propertyManager;
|
||||
private boolean isFullscreen = false;
|
||||
|
||||
/**
|
||||
* Launch the application.
|
||||
@@ -22,24 +32,118 @@ public class VisualForecastFrame extends JFrame {
|
||||
try {
|
||||
VisualForecastFrame frame = new VisualForecastFrame();
|
||||
frame.setVisible(true);
|
||||
frame.init();
|
||||
//GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()[1].setFullScreenWindow(frame);
|
||||
frame.createBufferStrategy(2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void end()
|
||||
{
|
||||
if(executor != null)
|
||||
executor.end();
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
end();
|
||||
executor = new Executor(this.renderPane, 30);
|
||||
executor.begin();
|
||||
|
||||
forecastProviderManager = new ForecastProviderManager();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the frame.
|
||||
*/
|
||||
public VisualForecastFrame() {
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
setBounds(100, 100, 640*2, 480*2);
|
||||
contentPane = new RenderPanel();
|
||||
contentPane.setBorder(null);
|
||||
contentPane.setLayout(new BorderLayout(0, 0));
|
||||
setContentPane(contentPane);
|
||||
renderPane = new RenderPanel();
|
||||
renderPane.setBorder(null);
|
||||
renderPane.setLayout(new BorderLayout(0, 0));
|
||||
setContentPane(renderPane);
|
||||
setUndecorated(true);
|
||||
addWindowListener(this);
|
||||
addKeyListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowOpened(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
|
||||
end();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowIconified(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowDeiconified(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowActivated(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowDeactivated(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyTyped(KeyEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
if(e.getKeyCode() == KeyEvent.VK_F11)
|
||||
{
|
||||
if(isFullscreen)
|
||||
{
|
||||
isFullscreen = false;
|
||||
this.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
|
||||
setBounds(100, 100, 640*2, 480*2);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
isFullscreen = true;
|
||||
this.getGraphicsConfiguration().getDevice().setFullScreenWindow(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user