<Component id="useMovieLocalCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="commentLabel" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="commentFileField" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="commentFileSelectButton" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <Component id="useCommentLocalCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="commentLabel" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="commentFileField" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="commentFileSelectButton" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="useCommentLocalCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Properties>
<Property name="text" type="java.lang.String" value="local"/>
</Properties>
+ <Events>
+ <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="useMovieLocalCheckBoxItemStateChanged"/>
+ </Events>
</Component>
<Component class="javax.swing.JTextField" name="movieFileField">
</Component>
<Properties>
<Property name="text" type="java.lang.String" value="local"/>
</Properties>
+ <Events>
+ <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="useCommentLocalCheckBoxItemStateChanged"/>
+ </Events>
</Component>
<Component class="javax.swing.JTextField" name="commentFileField">
</Component>
<Properties>
<Property name="text" type="java.lang.String" value="変換"/>
</Properties>
+ <Events>
+ <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="outputConvertCheckBoxItemStateChanged"/>
+ </Events>
</Component>
<Component class="javax.swing.JTextField" name="outputFileField">
</Component>
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
+import java.awt.event.ItemEvent;
import java.io.File;
import java.util.Collection;
import java.util.List;
import javax.swing.TransferHandler;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
+import org.apache.commons.io.FilenameUtils;
import yukihane.inqubus.conifg.Properties;
import yukihane.inqubus.model.Target;
import yukihane.inqubus.model.TargetsTableModel;
movieLabel.setText("動画");
useMovieLocalCheckBox.setText("local");
+ useMovieLocalCheckBox.addItemListener(new java.awt.event.ItemListener() {
+ public void itemStateChanged(java.awt.event.ItemEvent evt) {
+ useMovieLocalCheckBoxItemStateChanged(evt);
+ }
+ });
movieFileSelectButton.setText("...");
commentLabel.setText("コメント");
useCommentLocalCheckBox.setText("local");
+ useCommentLocalCheckBox.addItemListener(new java.awt.event.ItemListener() {
+ public void itemStateChanged(java.awt.event.ItemEvent evt) {
+ useCommentLocalCheckBoxItemStateChanged(evt);
+ }
+ });
commentFileSelectButton.setText("...");
outputLabel.setText("出力");
outputConvertCheckBox.setText("変換");
+ outputConvertCheckBox.addItemListener(new java.awt.event.ItemListener() {
+ public void itemStateChanged(java.awt.event.ItemEvent evt) {
+ outputConvertCheckBoxItemStateChanged(evt);
+ }
+ });
outputFileSelectButton.setText("...");
.addComponent(movieFileSelectButton)
.addComponent(useMovieLocalCheckBox))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(commentLabel)
- .addComponent(commentFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(commentFileSelectButton))
+ .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(commentLabel)
+ .addComponent(commentFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(commentFileSelectButton)
.addComponent(useCommentLocalCheckBox))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
pack();
}// </editor-fold>//GEN-END:initComponents
+private void useMovieLocalCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_useMovieLocalCheckBoxItemStateChanged
+ final boolean useLocal = (evt.getStateChange() == ItemEvent.SELECTED);
+ movieFileSelectButton.setEnabled(useLocal);
+}//GEN-LAST:event_useMovieLocalCheckBoxItemStateChanged
+
+private void useCommentLocalCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_useCommentLocalCheckBoxItemStateChanged
+ final boolean useLocal = (evt.getStateChange() == ItemEvent.SELECTED);
+ commentFileSelectButton.setEnabled(useLocal);
+}//GEN-LAST:event_useCommentLocalCheckBoxItemStateChanged
+
+private void outputConvertCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_outputConvertCheckBoxItemStateChanged
+ final boolean convert = (evt.getStateChange() == ItemEvent.SELECTED);
+ outputFileField.setEnabled(convert);
+ outputFileSelectButton.setEnabled(convert);
+}//GEN-LAST:event_outputConvertCheckBoxItemStateChanged
+
/**
* @param args the command line arguments
*/
// End of variables declaration//GEN-END:variables
private void initInputPanel() {
-// Properties.INSTANCE.getUseMovieFileLocal();
+ idField.setText("");
+
+ final Properties p = Properties.INSTANCE;
+
+ final boolean movieLocal = p.getUseMovieFileLocal();
+ useMovieLocalCheckBox.setSelected(movieLocal);
+ movieFileSelectButton.setEnabled(movieLocal);
+
+ final boolean commentLocal = p.getCommentFileLocal();
+ useCommentLocalCheckBox.setSelected(commentLocal);
+ commentFileSelectButton.setEnabled(commentLocal);
+
+ final boolean convert = p.getOutputConvert();
+ outputConvertCheckBox.setSelected(convert);
+ outputFileField.setEnabled(convert);
+ outputFileField.setText(p.getOutputFile().toString());
+ outputFileSelectButton.setEnabled(convert);
+
}
private class DownloadListTransferHandler extends TransferHandler {