📄 tvcontrol.java
字号:
/* * Copyright (C) 2005 by Enrico Chiaretti - enrico.chiaretti@gmail.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *//* * TvControl.java * * Created on 2 giugno 2005, 12.41 * mainframe - control center *//** this is the mainframe user form for the application. * @author enrico chiaretti */import java.awt.Dimension;import org.omg.SendingContext.RunTime;public class TvControl extends javax.swing.JFrame{ private java.util.Vector mChannels; private TvChannel mCurrentChannel = null; // this works well when running application from user directory // if you run from /usr/local/jvtv you'll need to have root privileges to save the file! (bad) // any idea about it? private TvActions mActions = new TvActions(); /** Creates new form TvControl */ public TvControl() { java.util.Vector DisplayNames = new java.util.Vector(); int i; wellcome(); mChannels = mActions.readChannels(); initComponents(); // display channel names for (i=0;i<mChannels.size();i++) { DisplayNames.add( ((TvChannel)mChannels.get(i)).toString() ); } jLstCanali.setListData(DisplayNames); setBounds(50, 50, 400, 90 + 300); setTitle("JVTV 0.6 (GPL)"); } private void wellcome() { System.out.println("JVTV, Copyright (C) 2005 Enrico Chiaretti, released under the GNU GPL License"); System.out.println("JVTV comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions"); System.out.println("http://www.opensource.org/licenses/gpl-license.php"); // System.out.println(jvtvhome); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { jLstCanali = new javax.swing.JList(); jBtnRunPlayer = new javax.swing.JButton(); jToolBar1 = new javax.swing.JToolBar(); jButtonLoadList = new MyButton(); jButtonSave = new MyButton(); jButtonSaveas = new MyButton(); jSeparator4 = new javax.swing.JSeparator(); jButtonAdd = new MyButton(); jButtonRemove = new MyButton(); jButtonMod = new MyButton(); jSeparator5 = new javax.swing.JSeparator(); jButtonEndplay = new MyButton(); jSeparator3 = new javax.swing.JSeparator(); jButton1 = new MyButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenuChannel = new javax.swing.JMenu(); jMenuItemLoad = new javax.swing.JMenuItem(); jMenuItemSave = new javax.swing.JMenuItem(); jMenuItemSaveas = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); jMenuItemAdd = new javax.swing.JMenuItem(); jMenuItemMod = new javax.swing.JMenuItem(); jSeparator2 = new javax.swing.JSeparator(); jMenuItemExit = new javax.swing.JMenuItem(); jMenuFaq = new javax.swing.JMenu(); jMenuItemFaq = new javax.swing.JMenuItem(); jMenuItemAbout = new javax.swing.JMenuItem(); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jScrollPan = new javax.swing.JScrollPane(); jSeparator6 = new javax.swing.JSeparator(); jButtonRec = new MyButton(); jButtonStopRec = new MyButton(); jButtonSetRec = new MyButton(); jLstCanali.setFont(new java.awt.Font("Dialog", 1, 14)); jLstCanali.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { jLstCanaliValueChanged(evt); } }); jLstCanali.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { jLstCanaliMouseReleased(evt); } }); jScrollPan.getViewport().setView(jLstCanali); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { exitForm(evt); } }); jBtnRunPlayer.setText("run Gmplayer"); jBtnRunPlayer.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jBtnRunPlayerActionPerformed(evt); } }); jButtonLoadList.setIcon(new javax.swing.ImageIcon("images/fileopen.png")); jButtonLoadList.setToolTipText("Load list from alternate file"); jButtonLoadList.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonLoadListActionPerformed(evt); } }); jToolBar1.add(jButtonLoadList); jButtonSave.setIcon(new javax.swing.ImageIcon("images/filesave.png")); jButtonSave.setToolTipText("Save list"); jButtonSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonSaveActionPerformed(evt); } }); jToolBar1.add(jButtonSave); jButtonSaveas.setIcon(new javax.swing.ImageIcon("images/filesaveas.png")); jButtonSaveas.setToolTipText("Save list to alternate file"); jButtonSaveas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonSaveasActionPerformed(evt); } }); jSeparator4.setOrientation(javax.swing.SwingConstants.VERTICAL); jSeparator4.setMaximumSize(new java.awt.Dimension(5, 0)); jSeparator4.setPreferredSize(new java.awt.Dimension(5, 2)); jToolBar1.add(jSeparator4); jButtonAdd.setIcon(new javax.swing.ImageIcon("images/edit_add.png")); jButtonAdd.setToolTipText("Add new channel to list"); jButtonAdd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonAddActionPerformed(evt); } }); //jToolBar1.add(jButtonAdd); jButtonRemove.setIcon(new javax.swing.ImageIcon("images/edit_remove.png")); jButtonRemove.setToolTipText("Remove channel from list"); jButtonRemove.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonRemoveActionPerformed(evt); } }); //jToolBar1.add(jButtonRemove); jButtonMod.setIcon(new javax.swing.ImageIcon("images/edit.png")); jButtonMod.setToolTipText("Modify selected channel"); jButtonMod.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonModActionPerformed(evt); } }); //jToolBar1.add(jButtonMod); jSeparator5.setOrientation(javax.swing.SwingConstants.VERTICAL); jSeparator5.setMaximumSize(new java.awt.Dimension(5, 0)); jSeparator5.setPreferredSize(new java.awt.Dimension(20, 2)); jToolBar1.add(jSeparator5); jButtonEndplay.setIcon(new javax.swing.ImageIcon("images/kill.png")); jButtonEndplay.setToolTipText("End watching tv ;("); jButtonEndplay.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonEndplayActionPerformed(evt); } }); jToolBar1.add(jButtonEndplay); jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL); jSeparator3.setMaximumSize(new java.awt.Dimension(5, 0)); jSeparator3.setPreferredSize(new java.awt.Dimension(5, 0)); jToolBar1.add(jSeparator3); jButtonRec.setIcon(new javax.swing.ImageIcon("images/recordtv.png")); jButtonRec.setToolTipText("Record tv"); jButtonRec.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonRecActionPerformed(evt); } }); jToolBar1.add(jButtonRec); jButtonStopRec.setIcon(new javax.swing.ImageIcon("images/stop.png")); jButtonStopRec.setToolTipText("Stop record tv"); jButtonStopRec.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonStopRecActionPerformed(evt); } }); jToolBar1.add(jButtonStopRec); jButtonSetRec.setIcon(new javax.swing.ImageIcon("images/recordset.png")); jButtonSetRec.setToolTipText("Recording Options"); jButtonSetRec.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonSetRecActionPerformed(evt); } }); jToolBar1.add(jButtonSetRec); jSeparator6.setOrientation(javax.swing.SwingConstants.VERTICAL); jSeparator6.setMaximumSize(new java.awt.Dimension(5, 0)); jSeparator6.setPreferredSize(new java.awt.Dimension(5, 0)); jToolBar1.add(jSeparator6); jButton1.setText("???"); jToolBar1.add(jButton1); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jToolBar1.setFloatable(false); jMenuChannel.setText("Channel List"); jMenuItemLoad.setText("Load list"); jMenuItemLoad.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemLoadActionPerformed(evt); } }); jMenuChannel.add(jMenuItemLoad); jMenuItemSave.setText("Save list"); jMenuItemSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemSaveActionPerformed(evt); } }); jMenuChannel.add(jMenuItemSave); jMenuItemSaveas.setText("Save list as "); jMenuItemSaveas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemSaveasActionPerformed(evt); } }); jMenuChannel.add(jMenuItemSaveas); jMenuChannel.add(jSeparator1); jMenuItemAdd.setText("Add channel to list"); jMenuItemAdd.addActionListener(new java.awt.event.ActionListener() {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -