-
Notifications
You must be signed in to change notification settings - Fork 2
/
ShowEmbeddedFile.java
executable file
·150 lines (116 loc) · 6.18 KB
/
ShowEmbeddedFile.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
public class ShowEmbeddedFile extends WizardPanel {
java.io.File inputFile,outputFile;
/** Creates new form ShowOutputFile */
public ShowEmbeddedFile(String display) {
super(display);
initComponents();
imageSplitPane.setDividerLocation(0.5);
imageSplitPane.
revalidate();
choiceButtonGroup.add(inputImageRadioButton);
choiceButtonGroup.add(outputImageRadioButton);
}
public void setImageFiles(java.io.File inputFile,java.io.File outputFile){
this.inputFile = inputFile;
this.outputFile = outputFile;
inputImageLabel.setIcon( new javax.swing.ImageIcon(inputFile.getAbsolutePath()));
inputFileNameLabel.setText("Input File : "+inputFile.getAbsolutePath());
outputImageLabel.setIcon( new javax.swing.ImageIcon(outputFile.getAbsolutePath()));
outputFileNameLabel.setText("Output File : "+outputFile.getAbsolutePath());
}
/** 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.
*/
private void initComponents() {//GEN-BEGIN:initComponents
choiceButtonGroup = new javax.swing.ButtonGroup();
imageSplitPane = new javax.swing.JSplitPane();
inputImagePanel = new javax.swing.JPanel();
inputImageScrollPane = new javax.swing.JScrollPane();
inputImageLabel = new javax.swing.JLabel();
inputFileNameLabel = new javax.swing.JLabel();
outputImagePanel = new javax.swing.JPanel();
outputImageScrollPane = new javax.swing.JScrollPane();
outputImageLabel = new javax.swing.JLabel();
outputFileNameLabel = new javax.swing.JLabel();
optionsPanel = new javax.swing.JPanel();
inputImageRadioButton = new javax.swing.JRadioButton();
outputImageRadioButton = new javax.swing.JRadioButton();
setLayout(new java.awt.BorderLayout());
imageSplitPane.setDividerLocation(100);
imageSplitPane.setOneTouchExpandable(true);
inputImagePanel.setLayout(new java.awt.BorderLayout());
inputImageLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
inputImageScrollPane.setViewportView(inputImageLabel);
inputImagePanel.add(inputImageScrollPane, java.awt.BorderLayout.CENTER);
inputImagePanel.add(inputFileNameLabel, java.awt.BorderLayout.NORTH);
imageSplitPane.setRightComponent(inputImagePanel);
outputImagePanel.setLayout(new java.awt.BorderLayout());
outputImageLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
outputImageScrollPane.setViewportView(outputImageLabel);
outputImagePanel.add(outputImageScrollPane, java.awt.BorderLayout.CENTER);
outputImagePanel.add(outputFileNameLabel, java.awt.BorderLayout.NORTH);
imageSplitPane.setLeftComponent(outputImagePanel);
add(imageSplitPane, java.awt.BorderLayout.CENTER);
inputImageRadioButton.setMnemonic('O');
inputImageRadioButton.setText("Play Output Audio");
inputImageRadioButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
inputImageRadioButtonActionPerformed(evt);
}
});
optionsPanel.add(inputImageRadioButton);
outputImageRadioButton.setMnemonic('i');
outputImageRadioButton.setText("Play Input Audio");
outputImageRadioButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
outputImageRadioButtonActionPerformed(evt);
}
});
optionsPanel.add(outputImageRadioButton);
add(optionsPanel, java.awt.BorderLayout.SOUTH);
}//GEN-END:initComponents
private void outputImageRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_outputImageRadioButtonActionPerformed
// Add your handling code here:
//imageSplitPane.setDividerLocation(0.0);
System.out.println("Code to play..");
System.out.println("Code to Play Audio...");
System.out.println("AudioFile Path"+ outputFile.getParent());
System.out.println("AudioFile Name..."+ outputFile.getName());
String url="file:///"+inputFile.getParent()+"//";
System.out.println("URL.."+ url);
/*new SoundApplication("file:///C://Shri//AudioHide//Audio1.4//","music.au");*/
new SoundApplication(url,outputFile.getName());
}//GEN-LAST:event_outputImageRadioButtonActionPerformed
private void inputImageRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inputImageRadioButtonActionPerformed
// Add your handling code here:
//imageSplitPane.setDividerLocation(1.0);
System.out.println("Code to play..");
System.out.println("Code to Play Audio...");
System.out.println("AudioFile Path"+ inputFile.getParent());
System.out.println("AudioFile Name..."+ inputFile.getName());
String url="file:///"+inputFile.getParent()+"//";
System.out.println("URL.."+ url);
/*new SoundApplication("file:///C://Shri//AudioHide//Audio1.4//","music.au");*/
new SoundApplication(url,inputFile.getName());
}//GEN-LAST:event_inputImageRadioButtonActionPerformed
public boolean doValidation() {
return true;
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel outputImageLabel;
private javax.swing.JScrollPane inputImageScrollPane;
private javax.swing.JLabel inputFileNameLabel;
private javax.swing.JRadioButton inputImageRadioButton;
private javax.swing.JRadioButton outputImageRadioButton;
private javax.swing.JPanel inputImagePanel;
private javax.swing.JScrollPane outputImageScrollPane;
private javax.swing.JLabel outputFileNameLabel;
private javax.swing.ButtonGroup choiceButtonGroup;
private javax.swing.JPanel outputImagePanel;
private javax.swing.JSplitPane imageSplitPane;
private javax.swing.JPanel optionsPanel;
private javax.swing.JLabel inputImageLabel;
// End of variables declaration//GEN-END:variables
}