import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JCheckBox;
+import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
cbVideoLocal.setToolTipText(FILE_LOCALBUTTON_TOOLTIP);
fldVideo = new JTextField();
fldVideo.setToolTipText(FILE_INPUTFIELD_TOOLTIP);
+ btnVideo.addActionListener(
+ new FileChooseAction(MainFrame.this, JFileChooser.FILES_ONLY, fldVideo));
final JLabel lblComment = new JLabel();
fldBackLog.setToolTipText("YYYY/MM/DD hh:mm:ss形式、あるいは1970/01/01からの経過秒を入力します。");
});
fldComment = new JTextField();
fldComment.setToolTipText(FILE_INPUTFIELD_TOOLTIP);
+ btnComment.addActionListener(
+ new FileChooseAction(MainFrame.this, JFileChooser.FILES_ONLY, fldComment));
final JLabel lblOutput = new JLabel();
cbOutputEnable = new JCheckBox();
fldOutput = new JTextField();
.addComponent(fldComment, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
.addComponent(fldOutput, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
)
+ .addGroup(glInputMain.createParallelGroup()
+ .addComponent(btnVideo)
+ .addComponent(btnComment)
+ )
.addContainerGap()
)
);
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(glInputMain.createParallelGroup(Alignment.BASELINE)
.addComponent(lblVideo)
+ .addComponent(cbVideoLocal)
.addComponent(fldVideo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(cbVideoLocal))
+ .addComponent(btnVideo)
+ )
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(glInputMain.createParallelGroup(Alignment.BASELINE)
.addComponent(lblComment)
+ .addComponent(cbCommentLocal)
.addComponent(fldComment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(cbCommentLocal))
+ .addComponent(btnComment)
+ )
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(glInputMain.createParallelGroup(Alignment.BASELINE)
.addComponent(lblOutput)
);
pack();
+ setMinimumSize(getSize());
/*
* 画面のサイズや位置を前回終了時のものに設定する
setSize(windowWidth, windowHeight);
}
+ // TODO 最大化した状態で終了した場合の考慮
final int windowPosX = p.getSystemWindowPosX();
final int windowPosY = p.getSystemWindowPosY();
- if (windowPosX > 0 && windowPosY > 0) {
+ if (windowPosX > 1024 && windowPosY > 1024) {
setLocation(windowPosX, windowPosY);
} else {
setLocationByPlatform(true);
final ItemSelectable source = evt.getItemSelectable();
+ JButton button;
JTextField field;
File dir;
if (source == cbVideoLocal) {
+ button = btnVideo;
field = fldVideo;
dir = new File(p.getVideoDir());
} else {
+ button = btnComment;
field = fldComment;
dir = new File(p.getCommentDir());
}
final boolean useLocal = (evt.getStateChange() == ItemEvent.SELECTED);
+ button.setEnabled(useLocal);
+
String text;
if (useLocal) {
final File f = searchFileMatchId(dir, fldId.getText());
private final JTextField fldBackLog = new JTextField();
private final JCheckBox cbVideoLocal;
private final JTextField fldVideo;
+ private final JButton btnVideo = new JButton("...");
private final JCheckBox cbCommentLocal;
private final JTextField fldComment;
+ private final JButton btnComment = new JButton("...");
private final JCheckBox cbOutputEnable;
private final JTextField fldOutput;
// 入力領域 - ffmpeg
fldBackLog.setEnabled(false);
cbBackLog.setEnabled(true);
- final boolean movieLocal = p.getVideoUseLocal();
- cbVideoLocal.setSelected(movieLocal);
- if (!movieLocal) {
+ final boolean videoLocal = p.getVideoUseLocal();
+ cbVideoLocal.setSelected(videoLocal);
+ if (!videoLocal) {
fldVideo.setText(p.getVideoFileNamePattern());
}
+ btnVideo.setEnabled(videoLocal);
final boolean commentLocal = p.getCommentUseLocal();
cbCommentLocal.setSelected(commentLocal);
if (!commentLocal) {
fldComment.setText(p.getCommentFileNamePattern());
}
+ btnComment.setEnabled(commentLocal);
final boolean convert = p.getOutputEnable();
cbOutputEnable.setSelected(convert);