<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
- <Component id="outputConvertCheckBox" min="-2" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="outputFileField" pref="317" max="32767" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="outputFileSelectButton" min="-2" max="-2" attributes="0"/>
- </Group>
- <Group type="102" alignment="0" attributes="0">
- <Component id="useCommentLocalCheckBox" min="-2" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="commentFileField" pref="317" max="32767" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="commentFileSelectButton" min="-2" max="-2" attributes="0"/>
- </Group>
- <Group type="102" alignment="0" attributes="0">
<Component id="useMovieLocalCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="movieFileField" pref="317" max="32767" attributes="0"/>
<Component id="movieFileSelectButton" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="idField" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
+ <Group type="102" alignment="1" attributes="0">
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="outputConvertCheckBox" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="outputFileField" pref="317" max="32767" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="1" attributes="0">
+ <Component id="useCommentLocalCheckBox" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="commentFileField" pref="317" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="commentFileSelectButton" min="-2" max="-2" attributes="0"/>
+ </Group>
</Group>
</Group>
<Component id="applyButton" alignment="1" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="outputLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="outputFileField" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="outputFileSelectButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="outputConvertCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<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"/>
+ <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="useMovieLocalCheckBoxItemStateChanged"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="commentFileField">
</Component>
<Component class="javax.swing.JTextField" name="outputFileField">
</Component>
- <Component class="javax.swing.JButton" name="outputFileSelectButton">
- <Properties>
- <Property name="text" type="java.lang.String" value="..."/>
- </Properties>
- </Component>
<Component class="javax.swing.JButton" name="applyButton">
<Properties>
<Property name="text" type="java.lang.String" value="適用"/>
outputLabel = new javax.swing.JLabel();
outputConvertCheckBox = new javax.swing.JCheckBox();
outputFileField = new javax.swing.JTextField();
- outputFileSelectButton = new javax.swing.JButton();
applyButton = new javax.swing.JButton();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
useCommentLocalCheckBox.setText("local");
useCommentLocalCheckBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
- useCommentLocalCheckBoxItemStateChanged(evt);
+ useMovieLocalCheckBoxItemStateChanged(evt);
}
});
}
});
- outputFileSelectButton.setText("...");
-
applyButton.setText("適用");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
- .addComponent(outputConvertCheckBox)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(outputFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(outputFileSelectButton))
- .addGroup(jPanel3Layout.createSequentialGroup()
- .addComponent(useCommentLocalCheckBox)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(commentFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(commentFileSelectButton))
- .addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(useMovieLocalCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(movieFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(movieFileSelectButton))
- .addComponent(idField, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addComponent(idField, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
+ .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
+ .addComponent(outputConvertCheckBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(outputFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE))
+ .addGroup(jPanel3Layout.createSequentialGroup()
+ .addComponent(useCommentLocalCheckBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(commentFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE)))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(commentFileSelectButton))))
.addComponent(applyButton, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap())
);
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(outputLabel)
.addComponent(outputFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(outputFileSelectButton)
.addComponent(outputConvertCheckBox))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(applyButton)
@Override
public boolean accept(File dir, String name) {
- return pattern.matcher(name).matches();
+ return pattern.matcher(name).find();
}
});
btn = movieFileSelectButton;
field = movieFileField;
dir = p.getMovieDirectory();
- } else{
+ } else {
btn = commentFileSelectButton;
field = commentFileField;
dir = p.getCommentDirectory();
field.setText(text);
}//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);
-
- final Properties p = Properties.INSTANCE;
- String text;
- if (useLocal) {
- final File f = searchFileMatchId(p.getCommentDirectory(), idField.getText());
- if (f != null) {
- text = f.getPath();
- } else {
- text = "";
- }
- } else {
- text = p.getFileNamePattern();
- }
- commentFileField.setText(text);
-}//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
private void idFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_idFieldFocusLost
private javax.swing.JLabel movieLabel;
private javax.swing.JCheckBox outputConvertCheckBox;
private javax.swing.JTextField outputFileField;
- private javax.swing.JButton outputFileSelectButton;
private javax.swing.JLabel outputLabel;
private javax.swing.JCheckBox useCommentLocalCheckBox;
private javax.swing.JCheckBox useMovieLocalCheckBox;
final boolean movieLocal = p.getUseMovieFileLocal();
useMovieLocalCheckBox.setSelected(movieLocal);
movieFileSelectButton.setEnabled(movieLocal);
+ if (!movieLocal) {
+ movieFileField.setText(p.getFileNamePattern());
+ }
final boolean commentLocal = p.getCommentFileLocal();
useCommentLocalCheckBox.setSelected(commentLocal);
commentFileSelectButton.setEnabled(commentLocal);
+ if (!commentLocal) {
+ commentFileField.setText(p.getFileNamePattern());
+ }
final boolean convert = p.getOutputConvert();
outputConvertCheckBox.setSelected(convert);
outputFileField.setEnabled(convert);
- outputFileField.setText(p.getOutputFile().toString());
- outputFileSelectButton.setEnabled(convert);
+ outputFileField.setText(p.getFileNamePattern());
}