make it subtree
[fanfix.git] / reader / ui / GuiReaderPropertiesFrame.java
diff --git a/reader/ui/GuiReaderPropertiesFrame.java b/reader/ui/GuiReaderPropertiesFrame.java
new file mode 100644 (file)
index 0000000..9615d75
--- /dev/null
@@ -0,0 +1,40 @@
+package be.nikiroo.fanfix.reader.ui;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JFrame;
+
+import be.nikiroo.fanfix.bundles.StringIdGui;
+import be.nikiroo.fanfix.data.MetaData;
+import be.nikiroo.fanfix.data.Story;
+import be.nikiroo.fanfix.library.BasicLibrary;
+
+/**
+ * A frame displaying properties and other information of a {@link Story}.
+ * 
+ * @author niki
+ */
+public class GuiReaderPropertiesFrame extends JFrame {
+       private static final long serialVersionUID = 1L;
+
+       /**
+        * Create a new {@link GuiReaderPropertiesFrame}.
+        * 
+        * @param lib
+        *            the library to use for the cover image
+        * @param meta
+        *            the meta to describe
+        */
+       public GuiReaderPropertiesFrame(BasicLibrary lib, MetaData meta) {
+               setTitle(GuiReader.trans(StringIdGui.TITLE_STORY, meta.getLuid(),
+                               meta.getTitle()));
+
+               GuiReaderPropertiesPane desc = new GuiReaderPropertiesPane(lib, meta);
+               setSize(800,
+                               (int) desc.getPreferredSize().getHeight() + 2
+                                               * desc.getBorderThickness());
+
+               setLayout(new BorderLayout());
+               add(desc, BorderLayout.NORTH);
+       }
+}