From 2a3291ab796f4e6b7229f9a6260e9b299f2d9b37 Mon Sep 17 00:00:00 2001 From: yukihane Date: Sat, 12 May 2012 17:41:18 +0900 Subject: [PATCH] add check box "owner comment only" --- frontend/src/yukihane/inqubus/gui/MainFrame.java | 54 ++++++++++++++---------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/frontend/src/yukihane/inqubus/gui/MainFrame.java b/frontend/src/yukihane/inqubus/gui/MainFrame.java index 1749f7a..969d32f 100644 --- a/frontend/src/yukihane/inqubus/gui/MainFrame.java +++ b/frontend/src/yukihane/inqubus/gui/MainFrame.java @@ -22,7 +22,6 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; import java.io.IOException; -import java.net.MalformedURLException; import java.net.URL; import java.nio.file.FileSystem; import java.nio.file.FileSystems; @@ -32,8 +31,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.SortedSet; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.swing.BorderFactory; import javax.swing.DefaultComboBoxModel; import javax.swing.DropMode; @@ -61,6 +58,8 @@ import javax.swing.border.BevelBorder; import javax.swing.table.TableModel; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.lang.builder.ToStringBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import saccubus.MainFrame_AboutBox; import saccubus.util.WayBackTimeParser; import saccubus.worker.profile.CommentProfile; @@ -215,18 +214,12 @@ public class MainFrame extends JFrame { cbBackLogReduce.setToolTipText("「コメントの量を減らす」場合はチェックを付けます。"); cbCommentLocal = new JCheckBox(); - cbCommentLocal.addItemListener(new ItemListener() { + cbOwnerComment = new JCheckBox(); - @Override - public void itemStateChanged(ItemEvent e) { - final boolean selected = (e.getStateChange() == ItemEvent.SELECTED); - cbBackLogReduce.setEnabled(!selected); - cbBackLog.setEnabled(!selected); - } - }); btnComment.addActionListener( new FileChooseActionListener(MainFrame.this, JFileChooser.FILES_ONLY, fldComment)); fldComment.setTransferHandler(new ContentTransferHandler(fldComment.getTransferHandler(), cbCommentLocal)); + final JLabel lblOutput = new JLabel(); cbOutputEnable = new JCheckBox(); fldOutput = new JTextField(); @@ -300,14 +293,20 @@ public class MainFrame extends JFrame { lblComment.setText("コメント"); cbCommentLocal.setText("local"); - cbCommentLocal.addItemListener(new java.awt.event.ItemListener() { + cbCommentLocal.addItemListener(new ItemListener() { @Override - public void itemStateChanged(java.awt.event.ItemEvent evt) { - useMovieLocalCheckBoxItemStateChanged(evt); + public void itemStateChanged(ItemEvent e) { + useMovieLocalCheckBoxItemStateChanged(e); + final boolean selected = (e.getStateChange() == ItemEvent.SELECTED); + cbBackLogReduce.setEnabled(!selected); + cbBackLog.setEnabled(!selected); + cbOwnerComment.setEnabled(!selected); } }); + cbOwnerComment.setText("投コメのみ"); + lblOutput.setText("出力"); cbOutputEnable.setText("変換"); @@ -329,12 +328,6 @@ public class MainFrame extends JFrame { .addComponent(lblId) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(cmbId, GroupLayout.PREFERRED_SIZE, 100, Short.MAX_VALUE) - .addPreferredGap(ComponentPlacement.UNRELATED) - .addComponent(cbBackLogReduce) - .addPreferredGap(ComponentPlacement.UNRELATED) - .addComponent(cbBackLog) - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(fldBackLog, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE) .addContainerGap() ) .addGroup(glInputMain.createSequentialGroup() @@ -362,6 +355,16 @@ public class MainFrame extends JFrame { ) .addContainerGap() ) + .addGroup(glInputMain.createSequentialGroup() + .addGap(100) + .addComponent(cbOwnerComment) + .addPreferredGap(ComponentPlacement.UNRELATED) + .addComponent(cbBackLogReduce) + .addPreferredGap(ComponentPlacement.UNRELATED) + .addComponent(cbBackLog) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(fldBackLog, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE) + ) ); glInputMain.setVerticalGroup( @@ -371,9 +374,6 @@ public class MainFrame extends JFrame { .addGroup(glInputMain.createParallelGroup(Alignment.BASELINE) .addComponent(cmbId, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(lblId) - .addComponent(cbBackLogReduce) - .addComponent(cbBackLog) - .addComponent(fldBackLog) ) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(glInputMain.createParallelGroup(Alignment.BASELINE) @@ -391,6 +391,13 @@ public class MainFrame extends JFrame { ) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(glInputMain.createParallelGroup(Alignment.BASELINE) + .addComponent(cbOwnerComment) + .addComponent(cbBackLogReduce) + .addComponent(cbBackLog) + .addComponent(fldBackLog) + ) + .addPreferredGap(ComponentPlacement.RELATED) + .addGroup(glInputMain.createParallelGroup(Alignment.BASELINE) .addComponent(lblOutput) .addComponent(fldOutput, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(cbOutputEnable) @@ -689,6 +696,7 @@ public class MainFrame extends JFrame { private final FileComboBox cmbComment = new FileComboBox(); private final JTextField fldComment = cmbComment.getEditorComponent(); private final JButton btnComment = new JButton("..."); + private final JCheckBox cbOwnerComment; private final JCheckBox cbOutputEnable; private final JTextField fldOutput; // 入力領域 - ffmpeg -- 2.11.0