X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2Fui%2FGuiReaderPropertiesPane.java;fp=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2Fui%2FGuiReaderPropertiesPane.java;h=0000000000000000000000000000000000000000;hb=d7367179b645781b4e0e4fc24893cb1e6725c14c;hp=2c9c7e79372eeda2214892b7aecf66497f1a0c9c;hpb=1387a30ab59dbf4071f2c5e5e0e08ca98c75b726;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderPropertiesPane.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderPropertiesPane.java deleted file mode 100644 index 2c9c7e7..0000000 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderPropertiesPane.java +++ /dev/null @@ -1,99 +0,0 @@ -package be.nikiroo.fanfix.reader.ui; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Font; -import java.util.Map; - -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; -import javax.swing.ImageIcon; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTextArea; - -import be.nikiroo.fanfix.data.MetaData; -import be.nikiroo.fanfix.data.Story; -import be.nikiroo.fanfix.library.BasicLibrary; -import be.nikiroo.fanfix.reader.BasicReader; - -/** - * A panel displaying properties and other information of a {@link Story}. - * - * @author niki - */ -public class GuiReaderPropertiesPane extends JPanel { - private static final long serialVersionUID = 1L; - private final int space = 10; - - /** - * Create a new {@link GuiReaderPropertiesPane}. - * - * @param lib - * the library to use for the cover image - * @param meta - * the meta to describe - */ - public GuiReaderPropertiesPane(BasicLibrary lib, MetaData meta) { - // Image - ImageIcon img = GuiReaderCoverImager.generateCoverIcon(lib, meta); - - setLayout(new BorderLayout()); - - // Main panel - JPanel mainPanel = new JPanel(new BorderLayout()); - JPanel mainPanelKeys = new JPanel(); - mainPanelKeys.setLayout(new BoxLayout(mainPanelKeys, BoxLayout.Y_AXIS)); - JPanel mainPanelValues = new JPanel(); - mainPanelValues.setLayout(new BoxLayout(mainPanelValues, - BoxLayout.Y_AXIS)); - - mainPanel.add(mainPanelKeys, BorderLayout.WEST); - mainPanel.add(mainPanelValues, BorderLayout.CENTER); - - Map desc = BasicReader.getMetaDesc(meta); - - Color trans = new Color(0, 0, 0, 1); - Color base = mainPanelValues.getBackground(); - for (String key : desc.keySet()) { - JTextArea jKey = new JTextArea(key); - jKey.setFont(new Font(jKey.getFont().getFontName(), Font.BOLD, jKey - .getFont().getSize())); - jKey.setEditable(false); - jKey.setLineWrap(false); - jKey.setBackground(trans); - mainPanelKeys.add(jKey); - - final JTextArea jValue = new JTextArea(desc.get(key)); - jValue.setEditable(false); - jValue.setLineWrap(false); - jValue.setBackground(base); - mainPanelValues.add(jValue); - } - - // Image - JLabel imgLabel = new JLabel(img); - imgLabel.setVerticalAlignment(JLabel.TOP); - - // Borders - mainPanelKeys.setBorder(BorderFactory.createEmptyBorder(space, space, - space, space)); - mainPanelValues.setBorder(BorderFactory.createEmptyBorder(space, space, - space, space)); - imgLabel.setBorder(BorderFactory.createEmptyBorder(0, space, space, 0)); - - // Add all - add(imgLabel, BorderLayout.WEST); - add(mainPanel, BorderLayout.CENTER); - } - - /** - * The invisible border size (multiply by 2 if you need the total width or - * the total height). - * - * @return the invisible border thickness - */ - public int getBorderThickness() { - return space; - } -}