From: yukihane Date: Sat, 25 Jun 2011 02:00:02 +0000 (+0900) Subject: index on dev20110528_setting_reduce: 9817594 フィールド名修正 X-Git-Tag: test20110903_ver2.a.0~251 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e07ad9bf4ab2e9dd4b46f0b7cb6289e62ecfe3ae;p=coroid%2Finqubus.git index on dev20110528_setting_reduce: 9817594 フィールド名修正 --- diff --git a/frontend/docs/nextspec.xlsx b/frontend/docs/nextspec.xlsx new file mode 100644 index 0000000..bc9be45 Binary files /dev/null and b/frontend/docs/nextspec.xlsx differ diff --git a/frontend/docs/ユースケース.docx b/frontend/docs/ユースケース.docx new file mode 100644 index 0000000..2ef39f4 Binary files /dev/null and b/frontend/docs/ユースケース.docx differ diff --git a/frontend/src/saccubus/converter/Converter.java b/frontend/src/saccubus/converter/Converter.java index d2a3868..b3ff1da 100644 --- a/frontend/src/saccubus/converter/Converter.java +++ b/frontend/src/saccubus/converter/Converter.java @@ -32,11 +32,11 @@ public class Converter extends AbstractCommand implements Runnable, Callable data = (List) transferable.getTransferData(DataFlavor.javaFileListFlavor); Collection targets = Target.from(data); targetModel.addTarget(targets); - } else { + } else if (transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) { String data = (String) transferable.getTransferData(DataFlavor.stringFlavor); - Matcher matcher = pattern.matcher(data); + Matcher matcher = movieIdPattern.matcher(data); if (matcher.find()) { - System.out.println("matched" + matcher.group(1)); + String movieId = matcher.group(1); + Target target = Target.fromId(movieId); + targetModel.addTarget(target); } else { return false; } } - return true; + return false; } catch (Exception e) { e.printStackTrace(); return false; diff --git a/frontend/src/yukihane/inqubuss/model/Target.java b/frontend/src/yukihane/inqubuss/model/Target.java index 2b12187..82bbd45 100644 --- a/frontend/src/yukihane/inqubuss/model/Target.java +++ b/frontend/src/yukihane/inqubuss/model/Target.java @@ -14,6 +14,10 @@ public class Target { return list; } + public static Target fromId(String movieId) { + return new Target(movieId); + } + private Location movie; private Location comment; private Location ownerComment; @@ -23,6 +27,10 @@ public class Target { movie = new Location(f); } + private Target(String movieId) { + movie = new Location(movieId); + } + public Location getComment() { return comment; } diff --git a/frontend/src/yukihane/inqubuss/model/TargetsTableModel.java b/frontend/src/yukihane/inqubuss/model/TargetsTableModel.java index f8a1e62..7685798 100644 --- a/frontend/src/yukihane/inqubuss/model/TargetsTableModel.java +++ b/frontend/src/yukihane/inqubuss/model/TargetsTableModel.java @@ -70,6 +70,11 @@ public class TargetsTableModel extends AbstractTableModel { if (before < after) { fireTableRowsInserted(before, after - 1); } + } + public void addTarget(Target t) { + List list = new ArrayList(1); + list.add(t); + addTarget(list); } } diff --git a/frontend/src/yukihane/inqubuss/worker/TargetPumper.java b/frontend/src/yukihane/inqubuss/worker/TargetPumper.java new file mode 100644 index 0000000..84b4087 --- /dev/null +++ b/frontend/src/yukihane/inqubuss/worker/TargetPumper.java @@ -0,0 +1,25 @@ +package yukihane.inqubuss.worker; + +import javax.swing.event.TableModelEvent; +import javax.swing.event.TableModelListener; +import saccubus.ConvertStopFlag; +import saccubus.converter.Converter; +import saccubus.net.TextProgressListener; + +/** + * + * @author yuki + */ +public class TargetPumper implements TableModelListener{ + + @Override + public void tableChanged(TableModelEvent e) { + System.out.println(e.getType()); + } + + public void exec(){ +// Converter conv = new Converter(tag, time, setting.toProfile(), TextProgressListener.EMPTY_LISTENER, new ConvertStopFlag( +// ConvertStopFlag.StateChangeListener.EMPTY_LISTENER)); + } + +} diff --git a/frontend/test/saccubus/converter/ConverterTest.java b/frontend/test/saccubus/converter/ConverterTest.java index b889b01..487255d 100644 --- a/frontend/test/saccubus/converter/ConverterTest.java +++ b/frontend/test/saccubus/converter/ConverterTest.java @@ -9,15 +9,15 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import static org.junit.Assert.*; import saccubus.ConvertStopFlag; +import saccubus.net.TextProgressListener; /** * * @author yuki */ public class ConverterTest { - + @BeforeClass public static void setUpClass() throws Exception { } @@ -25,19 +25,28 @@ public class ConverterTest { @AfterClass public static void tearDownClass() throws Exception { } - + @Before public void setUp() { } - + @After public void tearDown() { } @Test - public void testConverter() throws Exception{ - Converter conv = new Converter("sm7139747",null,null,null,null); - conv.call(); + public void testConverter() throws Exception { + TextProgressListener listener = new TextProgressListener() { + + @Override + public void setText(String text) { + System.out.println(text); + } + }; + ConvertStopFlag flag = new ConvertStopFlag(ConvertStopFlag.StateChangeListener.EMPTY_LISTENER); + + Converter conv = new Converter("sm7139747", null, null, listener, flag); + conv.call(); } // /** // * Test of call method, of class Converter.