📄 preferencesview.java
字号:
/* * PreferencesView.java * * Created on December 13, 2002, 8:58 AM */package jcdwriter.ui;import jcdwriter.model.*;import java.util.Enumeration;import java.util.Vector;import javax.swing.*;import java.io.IOException;/** * * @author Ram Mallappa */public class PreferencesView extends javax.swing.JDialog { /** Creates new form PreferencesView */ public PreferencesView(java.awt.Frame parent, boolean modal, MKISOFSCommand mkisofsCmd, CDRECORDConfiguration cdrecordCmd, ApplicationSettings appSettings){ super(parent, modal); initComponents(); mkisofs = mkisofsCmd; cdrecord = cdrecordCmd; applicationSettings = appSettings; populateComponents(); getRootPane().setDefaultButton(okButton); } private void populateComponents(){ populateMKISOFSSettingsUsing(mkisofs); populateCDRECORDSettingsUsing(cdrecord); populateApplicationSettingsUsing(applicationSettings); } private void populateCDRECORDSettingsUsing(CDRECORDConfiguration aCDRECORDConfig) { Enumeration recordingDevices;/* if (aCDRECORDConfig.numberOfRecordingDevices() > 0){ recordingDevices = aCDRECORDConfig.allRecordingDevices().elements(); ((DefaultComboBoxModel)(recordingDeviceComboBox.getModel())).removeAllElements(); while(recordingDevices.hasMoreElements()) { ((DefaultComboBoxModel)(recordingDeviceComboBox.getModel())).addElement(recordingDevices.nextElement()); } } */ if (aCDRECORDConfig.isConfigured()) { ((DefaultComboBoxModel)(recordingDeviceComboBox.getModel())).addElement(aCDRECORDConfig.getRecorder()); recordingDeviceComboBox.getModel().setSelectedItem(aCDRECORDConfig.getRecorder()); } allowOverburnCheckBox.setSelected(aCDRECORDConfig.getOverburn()); speedTextField.setText(String.valueOf(aCDRECORDConfig.getSpeed())); ejectAfterWriteCheckBox.setSelected(aCDRECORDConfig.getEject()); forceWritingCheckBox.setSelected(aCDRECORDConfig.getForce()); dummyWriteCheckBox.setSelected(aCDRECORDConfig.dummy); diskAtOnceCheckBox.setSelected(aCDRECORDConfig.getDAO()); cdrecordLocationTextField.setText(aCDRECORDConfig.cdrecordExecutable()); } private void populateMKISOFSSettingsUsing(MKISOFSCommand aMKISOFSCmd) { rockRidgeCheckBox.setSelected(aMKISOFSCmd.getRockRidge()); ananRockRidgeCheckBox.setSelected(aMKISOFSCmd.getAnanymouseRockRidge()); jolietCheckBox.setSelected(aMKISOFSCmd.getJoliet()); allow32CharFileNamesCheckBox.setSelected(aMKISOFSCmd.getAllow32CharFileNames()); followSymLinkCheckBox.setSelected(aMKISOFSCmd.getFollowSymLinks()); generateTRANSTBLCheckBox.setSelected(aMKISOFSCmd.getGenerateTransTBLFiles()); omitTrailingPeriodsCheckBox.setSelected(aMKISOFSCmd.getOmitTrailingPeriods()); noDeepDirRelocCheckBox.setSelected(aMKISOFSCmd.getNoDeepDirRelocation()); filesCanBeginWithPeriodCheckBox.setSelected(aMKISOFSCmd.getFilesCanBeginWithPeriod()); excludeBackupFilesCheckBox.setSelected(aMKISOFSCmd.getExcludeBackupFiles()); mkisofsLocationTextField.setText(aMKISOFSCmd.mkisofsExecutable()); } private void populateApplicationSettingsUsing(ApplicationSettings appSettings) { cdImageLocationTextField.setText(appSettings.isoDiskImageDirectory()); diskLayoutFileLocationTextField.setText(appSettings.diskLayoutFileDirectory()); } private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; mainTabbedPane = new javax.swing.JTabbedPane(); mkisofsPanel = new javax.swing.JPanel(); rockRidgeCheckBox = new javax.swing.JCheckBox(); ananRockRidgeCheckBox = new javax.swing.JCheckBox(); jolietCheckBox = new javax.swing.JCheckBox(); allow32CharFileNamesCheckBox = new javax.swing.JCheckBox(); followSymLinkCheckBox = new javax.swing.JCheckBox(); generateTRANSTBLCheckBox = new javax.swing.JCheckBox(); omitTrailingPeriodsCheckBox = new javax.swing.JCheckBox(); noDeepDirRelocCheckBox = new javax.swing.JCheckBox(); filesCanBeginWithPeriodCheckBox = new javax.swing.JCheckBox(); excludeBackupFilesCheckBox = new javax.swing.JCheckBox(); mkisofsLocationTextField = new javax.swing.JTextField(); findMKISOFSLocationButton = new javax.swing.JButton(); mkisofsLocationLabel = new javax.swing.JLabel(); cdrecordPanel = new javax.swing.JPanel(); recordingDeviceComboBox = new javax.swing.JComboBox(); ejectAfterWriteCheckBox = new javax.swing.JCheckBox(); forceWritingCheckBox = new javax.swing.JCheckBox(); dummyWriteCheckBox = new javax.swing.JCheckBox(); recordingDeviceLabel = new javax.swing.JLabel(); allowOverburnCheckBox = new javax.swing.JCheckBox(); dummyPaddingLabel = new javax.swing.JLabel(); diskAtOnceCheckBox = new javax.swing.JCheckBox(); speedLabel = new javax.swing.JLabel(); speedTextField = new javax.swing.JTextField(); cdrecordLocationLabel = new javax.swing.JLabel(); cdrecordLocationTextField = new javax.swing.JTextField(); findCDRECORDLocationButton = new javax.swing.JButton(); scanForRecordingDevicesButton = new javax.swing.JButton(); generalPanel = new javax.swing.JPanel(); cdImageLocationTextField = new javax.swing.JTextField(); findCDLocationButton = new javax.swing.JButton(); cdImageLocationLabel = new javax.swing.JLabel(); diskLayoutFileLocationTextField = new javax.swing.JTextField(); findDiskLayoutFileLocationButton = new javax.swing.JButton(); diskLayoutFileLocationLabel = new javax.swing.JLabel(); buttonPanel = new javax.swing.JPanel(); okButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); applyButton = new javax.swing.JButton(); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); mainTabbedPane.setPreferredSize(new java.awt.Dimension(650, 300)); mkisofsPanel.setLayout(new java.awt.GridBagLayout()); mkisofsPanel.setToolTipText("mkisofs settings"); rockRidgeCheckBox.setText("Rock Ridge"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 50; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; mkisofsPanel.add(rockRidgeCheckBox, gridBagConstraints); ananRockRidgeCheckBox.setText("Anonymouse Rock Ridge"); ananRockRidgeCheckBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ananRockRidgeCheckBoxActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 50; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 50; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; mkisofsPanel.add(ananRockRidgeCheckBox, gridBagConstraints); jolietCheckBox.setText("Joliet"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 50; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; mkisofsPanel.add(jolietCheckBox, gridBagConstraints); allow32CharFileNamesCheckBox.setText("Allow 32 Char File Names"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 50; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 50; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; mkisofsPanel.add(allow32CharFileNamesCheckBox, gridBagConstraints); followSymLinkCheckBox.setText("Follow Symbolic Links"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 50; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; mkisofsPanel.add(followSymLinkCheckBox, gridBagConstraints); generateTRANSTBLCheckBox.setText("Generate TRANS.TBL"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 50; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 50; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; mkisofsPanel.add(generateTRANSTBLCheckBox, gridBagConstraints); omitTrailingPeriodsCheckBox.setText("Omit Trailing Period"); omitTrailingPeriodsCheckBox.setActionCommand("jCheckBox7"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.gridwidth = 50; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; mkisofsPanel.add(omitTrailingPeriodsCheckBox, gridBagConstraints); noDeepDirRelocCheckBox.setText("No Deep Dir Relocation"); noDeepDirRelocCheckBox.setActionCommand("jCheckBox8"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 50; gridBagConstraints.gridy = 3; gridBagConstraints.gridwidth = 50; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; mkisofsPanel.add(noDeepDirRelocCheckBox, gridBagConstraints); filesCanBeginWithPeriodCheckBox.setText("Files Can Begin With Period"); filesCanBeginWithPeriodCheckBox.setActionCommand("jCheckBox9"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 50; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; mkisofsPanel.add(filesCanBeginWithPeriodCheckBox, gridBagConstraints); excludeBackupFilesCheckBox.setText("Exclude Backup Files"); excludeBackupFilesCheckBox.setActionCommand("jCheckBox10"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 50; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 50; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; mkisofsPanel.add(excludeBackupFilesCheckBox, gridBagConstraints); mkisofsLocationTextField.setText("/usr/local/bin/mkisofs"); mkisofsLocationTextField.setInputVerifier(speedTextField.getInputVerifier()); mkisofsLocationTextField.setMinimumSize(null); mkisofsLocationTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { mkisofsLocationTextFieldActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 30; gridBagConstraints.gridy = 5; gridBagConstraints.gridwidth = 50; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.ipadx = 30; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -