import javax.swing.JLabel;
import javax.swing.JPanel;
-import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Story;
import be.nikiroo.fanfix.reader.Reader;
private Date lastClick;
private List<BookActionListener> listeners;
- private MetaData meta;
+ private GuiReaderBookInfo info;
private boolean cached;
/**
*
* @param reader
* the associated reader
- * @param meta
- * the story {@link MetaData} or source (if no LUID)
+ * @param info
+ * the information about the story to represent
* @param cached
* TRUE if it is locally cached
* @param seeWordCount
* TRUE to see word counts, FALSE to see authors
*/
- public GuiReaderBook(Reader reader, MetaData meta, boolean cached,
+ public GuiReaderBook(Reader reader, GuiReaderBookInfo info, boolean cached,
boolean seeWordCount) {
this.cached = cached;
- this.meta = meta;
-
- String optSecondary = meta.getAuthor();
- if (seeWordCount) {
- if (meta.getWords() >= 4000) {
- optSecondary = "" + (meta.getWords() / 1000) + "k";
- } else if (meta.getWords() > 0) {
- optSecondary = "" + meta.getWords();
- } else {
- optSecondary = "";
- }
-
- if (!optSecondary.isEmpty()) {
- if (meta.isImageDocument()) {
- optSecondary += " images";
- } else {
- optSecondary += " words";
- }
- }
- }
+ this.info = info;
- if (optSecondary != null && !optSecondary.isEmpty()) {
- optSecondary = "(" + optSecondary + ")";
- } else {
- optSecondary = "";
- }
+ String optSecondary = info.getSecondaryInfo(seeWordCount);
icon = new JLabel(GuiReaderCoverImager.generateCoverIcon(
- reader.getLibrary(), getMeta()));
+ reader.getLibrary(), info));
title = new JLabel(
String.format(
"<html>"
+ "%s" + "<br>" + "<span style='color: %s;'>"
+ "%s" + "</span>" + "</body>" + "</html>",
GuiReaderCoverImager.TEXT_WIDTH,
- GuiReaderCoverImager.TEXT_HEIGHT, meta.getTitle(),
+ GuiReaderCoverImager.TEXT_HEIGHT, info.getMainInfo(),
AUTHOR_COLOR, optSecondary));
setLayout(new BorderLayout(10, 10));
}
/**
- * The Library {@link MetaData} of the book represented by this item.
+ * The information about the book represented by this item.
*
* @return the meta
*/
- public MetaData getMeta() {
- return meta;
+ public GuiReaderBookInfo getInfo() {
+ return info;
}
/**
--- /dev/null
+package be.nikiroo.fanfix.reader.ui;
+
+import be.nikiroo.fanfix.data.MetaData;
+import be.nikiroo.fanfix.library.BasicLibrary;
+import be.nikiroo.utils.Image;
+
+public class GuiReaderBookInfo {
+ public enum Type {
+ /** A normal story, which can be "read". */
+ STORY,
+ /**
+ * A special, empty story that represents a source/type common to one or
+ * more normal stories.
+ */
+ SOURCE,
+ /** A special, empty story that represents an author. */
+ AUTHOR
+ }
+
+ private Type type;
+ private String id;
+ private String value;
+ private String count;
+
+ private MetaData meta;
+
+ // use the fromXXX methods
+ private GuiReaderBookInfo(Type type, String id, String value) {
+ this.type = type;
+ this.id = id;
+ this.value = value;
+ }
+
+ public String getMainInfo() {
+ return value;
+ }
+
+ public String getSecondaryInfo(boolean seeCount) {
+ String author = meta == null ? null : meta.getAuthor();
+ String secondaryInfo = seeCount ? count : author;
+
+ if (secondaryInfo != null && !secondaryInfo.trim().isEmpty()) {
+ secondaryInfo = "(" + secondaryInfo + ")";
+ } else {
+ secondaryInfo = "";
+ }
+
+ return secondaryInfo;
+ }
+
+ /**
+ * A unique ID for this {@link GuiReaderBookInfo}.
+ *
+ * @return the unique ID
+ */
+ public String getId() {
+ return id;
+ }
+
+ // can return null for non-books
+ public MetaData getMeta() {
+ return meta;
+ }
+
+ public Image getBaseImage(BasicLibrary lib) {
+ switch (type) {
+ case STORY:
+ return lib.getCover(meta.getLuid());
+ case SOURCE:
+ return lib.getSourceCover(value);
+ case AUTHOR:
+ return lib.getAuthorCover(value);
+ }
+
+ return null;
+ }
+
+ static public GuiReaderBookInfo fromMeta(MetaData meta) {
+ String uid = meta.getUuid();
+ if (uid == null || uid.trim().isEmpty()) {
+ uid = meta.getLuid();
+ }
+
+ GuiReaderBookInfo info = new GuiReaderBookInfo(Type.STORY, uid,
+ meta.getTitle());
+
+ info.meta = meta;
+ info.count = formatNumber(meta.getWords(),
+ meta.isImageDocument() ? "images" : "words");
+
+ return info;
+ }
+
+ static public GuiReaderBookInfo fromSource(BasicLibrary lib, String source) {
+ GuiReaderBookInfo info = new GuiReaderBookInfo(Type.SOURCE, "source_"
+ + source, source);
+
+ info.count = formatNumber(lib.getListBySource(source).size(), "stories");
+
+ return info;
+ }
+
+ static public GuiReaderBookInfo fromAuthor(BasicLibrary lib, String author) {
+ GuiReaderBookInfo info = new GuiReaderBookInfo(Type.AUTHOR, "author_"
+ + author, author);
+
+ info.count = formatNumber(lib.getListByAuthor(author).size(), "stories");
+
+ return info;
+ }
+
+ static private String formatNumber(long number, String ofWhat) {
+ String displayNumber;
+ if (number >= 4000) {
+ displayNumber = "" + (number / 1000) + "k";
+ } else if (number > 0) {
+ displayNumber = "" + number;
+ } else {
+ displayNumber = "";
+ }
+
+ if (!displayNumber.isEmpty()) {
+ displayNumber += " " + ofWhat;
+ }
+
+ return displayNumber;
+ }
+}
import be.nikiroo.fanfix.Instance;
import be.nikiroo.fanfix.data.MetaData;
-import be.nikiroo.fanfix.data.Story;
import be.nikiroo.fanfix.library.BasicLibrary;
import be.nikiroo.utils.Image;
import be.nikiroo.utils.ui.ImageUtilsAwt;
*
* @param lib
* the library the meta comes from
- * @param meta
+ * @param info
* the {@link MetaData}
*
* @return the icon
*/
- static public ImageIcon generateCoverIcon(BasicLibrary lib, MetaData meta) {
+ static public ImageIcon generateCoverIcon(BasicLibrary lib,
+ GuiReaderBookInfo info) {
BufferedImage resizedImage = null;
- String id = getIconId(meta);
+ String id = getIconId(info);
InputStream in = Instance.getCache().getFromCache(id);
if (in != null) {
if (resizedImage == null) {
try {
- Image cover = null;
- if (meta.getLuid() != null) {
- cover = lib.getCover(meta.getLuid());
- }
- if (cover == null) {
- cover = lib.getSourceCover(meta.getSource());
- }
-
+ Image cover = info.getBaseImage(lib);
resizedImage = new BufferedImage(SPINE_WIDTH + COVER_WIDTH,
SPINE_HEIGHT + COVER_HEIGHT + HOFFSET,
BufferedImage.TYPE_4BYTE_ABGR);
+
Graphics2D g = resizedImage.createGraphics();
- g.setColor(Color.white);
- g.fillRect(0, HOFFSET, COVER_WIDTH, COVER_HEIGHT);
- if (cover != null) {
- BufferedImage coverb = ImageUtilsAwt.fromImage(cover);
- g.drawImage(coverb, 0, HOFFSET, COVER_WIDTH, COVER_HEIGHT,
- null);
- } else {
- g.setColor(Color.black);
- g.drawLine(0, HOFFSET, COVER_WIDTH, HOFFSET + COVER_HEIGHT);
- g.drawLine(COVER_WIDTH, HOFFSET, 0, HOFFSET + COVER_HEIGHT);
+ try {
+ g.setColor(Color.white);
+ g.fillRect(0, HOFFSET, COVER_WIDTH, COVER_HEIGHT);
+
+ if (cover != null) {
+ BufferedImage coverb = ImageUtilsAwt.fromImage(cover);
+ g.drawImage(coverb, 0, HOFFSET, COVER_WIDTH,
+ COVER_HEIGHT, null);
+ } else {
+ g.setColor(Color.black);
+ g.drawLine(0, HOFFSET, COVER_WIDTH, HOFFSET
+ + COVER_HEIGHT);
+ g.drawLine(COVER_WIDTH, HOFFSET, 0, HOFFSET
+ + COVER_HEIGHT);
+ }
+ } finally {
+ g.dispose();
}
- g.dispose();
if (id != null) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
/**
* Manually clear the icon set for this item.
*
- * @param meta
- * the meta of the story or source (if luid is null)
+ * @param info
+ * the info about the story or source/type or author
*/
- static public void clearIcon(MetaData meta) {
- String id = getIconId(meta);
+ static public void clearIcon(GuiReaderBookInfo info) {
+ String id = getIconId(info);
Instance.getCache().removeFromCache(id);
}
/**
- * Get a unique ID from this meta (note that if the luid is null, it is
- * considered a source and not a {@link Story}).
+ * Get a unique ID from this {@link GuiReaderBookInfo} (note that it can be
+ * a story, a fake item for a source/type or a fake item for an author).
*
- * @param meta
- * the meta
+ * @param info
+ * the info
* @return the unique ID
*/
- static private String getIconId(MetaData meta) {
- String id = null;
-
- String key = meta.getUuid();
- if (meta.getLuid() == null) {
- // a fake meta (== a source)
- key = "source_" + meta.getSource();
- }
-
- id = key + ".thumb_" + SPINE_WIDTH + "x" + COVER_WIDTH + "+"
+ static private String getIconId(GuiReaderBookInfo info) {
+ return info.getId() + ".thumb_" + SPINE_WIDTH + "x" + COVER_WIDTH + "+"
+ SPINE_HEIGHT + "+" + COVER_HEIGHT + "@" + HOFFSET;
-
- return id;
}
}
import be.nikiroo.fanfix.bundles.UiConfig;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Story;
+import be.nikiroo.fanfix.library.BasicLibrary;
import be.nikiroo.fanfix.library.LocalLibrary;
import be.nikiroo.fanfix.output.BasicOutput.OutputType;
import be.nikiroo.fanfix.reader.BasicReader;
private GuiReader reader;
private GuiReaderMainPanel mainPanel;
- private enum MoveAction {
- SOURCE, TITLE, AUTHOR
+ /**
+ * The different modification actions you can use on {@link Story} items.
+ *
+ * @author niki
+ */
+ private enum ChangeAction {
+ /** Change the source/type, that is, move it to another source. */
+ SOURCE,
+ /** Change its name. */
+ TITLE,
+ /** Change its author. */
+ AUTHOR
}
/**
popup.addSeparator();
popup.add(createMenuItemExport());
popup.add(createMenuItemMoveTo(true));
- popup.add(createMenuItemSetCover());
+ popup.add(createMenuItemSetCoverForSource());
+ popup.add(createMenuItemSetCoverForAuthor());
popup.add(createMenuItemClearCache());
popup.add(createMenuItemRedownload());
popup.addSeparator();
public void run() {
try {
reader.getLibrary().export(
- selectedBook.getMeta().getLuid(),
- type, path, pg);
+ selectedBook.getInfo().getMeta()
+ .getLuid(), type, path, pg);
} catch (IOException e) {
Instance.getTraceHandler().error(e);
}
mainPanel.outOfUi(null, new Runnable() {
@Override
public void run() {
- reader.clearLocalReaderCache(selectedBook.getMeta()
- .getLuid());
+ reader.clearLocalReaderCache(selectedBook.getInfo()
+ .getMeta().getLuid());
selectedBook.setCached(false);
GuiReaderCoverImager.clearIcon(selectedBook
- .getMeta());
+ .getInfo());
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
}
JMenuItem item = new JMenuItem("New type...");
- item.addActionListener(createMoveAction(MoveAction.SOURCE, null));
+ item.addActionListener(createMoveAction(ChangeAction.SOURCE, null));
changeTo.add(item);
changeTo.addSeparator();
List<String> list = groupedSources.get(type);
if (list.size() == 1 && list.get(0).isEmpty()) {
item = new JMenuItem(type);
- item.addActionListener(createMoveAction(MoveAction.SOURCE, type));
+ item.addActionListener(createMoveAction(ChangeAction.SOURCE,
+ type));
changeTo.add(item);
} else {
JMenu dir = new JMenu(type);
}
item = new JMenuItem(itemName);
- item.addActionListener(createMoveAction(MoveAction.SOURCE,
- actualType));
+ item.addActionListener(createMoveAction(
+ ChangeAction.SOURCE, actualType));
dir.add(item);
}
changeTo.add(dir);
JMenuItem newItem = new JMenuItem("New author...");
changeTo.add(newItem);
changeTo.addSeparator();
- newItem.addActionListener(createMoveAction(MoveAction.AUTHOR, null));
+ newItem.addActionListener(createMoveAction(ChangeAction.AUTHOR, null));
// Existing authors
if (libOk) {
JMenuItem item = new JMenuItem(
value.isEmpty() ? "[unknown]" : value);
item.addActionListener(createMoveAction(
- MoveAction.AUTHOR, value));
+ ChangeAction.AUTHOR, value));
group.add(item);
}
changeTo.add(group);
for (String value : groupedAuthors.values().iterator().next()) {
JMenuItem item = new JMenuItem(
value.isEmpty() ? "[unknown]" : value);
- item.addActionListener(createMoveAction(MoveAction.AUTHOR,
- value));
+ item.addActionListener(createMoveAction(
+ ChangeAction.AUTHOR, value));
changeTo.add(item);
}
}
@SuppressWarnings("unused") boolean libOk) {
JMenuItem changeTo = new JMenuItem("Rename...");
changeTo.setMnemonic(KeyEvent.VK_R);
- changeTo.addActionListener(createMoveAction(MoveAction.TITLE, null));
+ changeTo.addActionListener(createMoveAction(ChangeAction.TITLE, null));
return changeTo;
}
- private ActionListener createMoveAction(final MoveAction what,
+ private ActionListener createMoveAction(final ChangeAction what,
final String type) {
return new ActionListener() {
@Override
if (selectedBook != null) {
String changeTo = type;
if (type == null) {
+ MetaData meta = selectedBook.getInfo().getMeta();
String init = "";
- if (what == MoveAction.SOURCE) {
- init = selectedBook.getMeta().getSource();
- } else if (what == MoveAction.TITLE) {
- init = selectedBook.getMeta().getTitle();
- } else if (what == MoveAction.AUTHOR) {
- init = selectedBook.getMeta().getAuthor();
+ if (what == ChangeAction.SOURCE) {
+ init = meta.getSource();
+ } else if (what == ChangeAction.TITLE) {
+ init = meta.getTitle();
+ } else if (what == ChangeAction.AUTHOR) {
+ init = meta.getAuthor();
}
Object rep = JOptionPane.showInputDialog(
mainPanel.outOfUi(null, new Runnable() {
@Override
public void run() {
- if (what == MoveAction.SOURCE) {
- reader.changeSource(selectedBook.getMeta()
- .getLuid(), fChangeTo);
- } else if (what == MoveAction.TITLE) {
- reader.changeTitle(selectedBook.getMeta()
- .getLuid(), fChangeTo);
- } else if (what == MoveAction.AUTHOR) {
- reader.changeAuthor(selectedBook.getMeta()
- .getLuid(), fChangeTo);
+ String luid = selectedBook.getInfo().getMeta()
+ .getLuid();
+ if (what == ChangeAction.SOURCE) {
+ reader.changeSource(luid, fChangeTo);
+ } else if (what == ChangeAction.TITLE) {
+ reader.changeTitle(luid, fChangeTo);
+ } else if (what == ChangeAction.AUTHOR) {
+ reader.changeAuthor(luid, fChangeTo);
}
mainPanel.unsetSelectedBook();
}
/**
- * Create the redownload (then delete original) menu item.
+ * Create the re-download (then delete original) menu item.
*
* @return the item
*/
public void actionPerformed(ActionEvent e) {
final GuiReaderBook selectedBook = mainPanel.getSelectedBook();
if (selectedBook != null) {
- final MetaData meta = selectedBook.getMeta();
+ final MetaData meta = selectedBook.getInfo().getMeta();
mainPanel.imprt(meta.getUrl(), new StoryRunnable() {
@Override
public void run(Story story) {
mainPanel.outOfUi(null, new Runnable() {
@Override
public void run() {
- reader.delete(selectedBook.getMeta().getLuid());
+ reader.delete(selectedBook.getInfo().getMeta()
+ .getLuid());
mainPanel.unsetSelectedBook();
}
});
@Override
public void run() {
new GuiReaderPropertiesFrame(reader, selectedBook
- .getMeta()).setVisible(true);
+ .getInfo()).setVisible(true);
}
});
}
public void actionPerformed(ActionEvent e) {
final GuiReaderBook selectedBook = mainPanel.getSelectedBook();
if (selectedBook != null) {
- if (selectedBook.getMeta().getLuid() == null) {
+ if (selectedBook.getInfo().getMeta().getLuid() == null) {
mainPanel.removeBookPanes();
- mainPanel.addBookPane(selectedBook.getMeta()
+ mainPanel.addBookPane(selectedBook.getInfo().getMeta()
.getSource(), true);
mainPanel.refreshBooks();
} else {
*
* @return the item
*/
- private JMenuItem createMenuItemSetCover() {
+ private JMenuItem createMenuItemSetCoverForSource() {
JMenuItem open = new JMenuItem("Set as cover for source", KeyEvent.VK_C);
open.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final GuiReaderBook selectedBook = mainPanel.getSelectedBook();
if (selectedBook != null) {
- reader.getLibrary().setSourceCover(
- selectedBook.getMeta().getSource(),
- selectedBook.getMeta().getLuid());
- MetaData source = selectedBook.getMeta().clone();
- source.setLuid(null);
- GuiReaderCoverImager.clearIcon(source);
+ BasicLibrary lib = reader.getLibrary();
+ String luid = selectedBook.getInfo().getMeta().getLuid();
+ String source = selectedBook.getInfo().getMeta()
+ .getSource();
+
+ lib.setSourceCover(source, luid);
+
+ GuiReaderBookInfo sourceInfo = GuiReaderBookInfo
+ .fromSource(lib, source);
+ GuiReaderCoverImager.clearIcon(sourceInfo);
+ }
+ }
+ });
+
+ return open;
+ }
+
+ /**
+ * Create the SetCover menu item for a book to change the linked source
+ * cover.
+ *
+ * @return the item
+ */
+ private JMenuItem createMenuItemSetCoverForAuthor() {
+ JMenuItem open = new JMenuItem("Set as cover for author", KeyEvent.VK_A);
+ open.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ final GuiReaderBook selectedBook = mainPanel.getSelectedBook();
+ if (selectedBook != null) {
+ BasicLibrary lib = reader.getLibrary();
+ String luid = selectedBook.getInfo().getMeta().getLuid();
+ String author = selectedBook.getInfo().getMeta()
+ .getAuthor();
+
+ lib.setAuthorCover(author, luid);
+
+ GuiReaderBookInfo authorInfo = GuiReaderBookInfo
+ .fromAuthor(lib, author);
+ GuiReaderCoverImager.clearIcon(authorInfo);
}
}
});
import java.util.ArrayList;
import java.util.List;
-import javax.management.RuntimeErrorException;
import javax.swing.JLabel;
import javax.swing.JPanel;
-import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.reader.ui.GuiReaderBook.BookActionListener;
import be.nikiroo.utils.ui.WrapLayout;
private BookActionListener action;
private Color backgroundColor;
private GuiReader reader;
- private List<MetaData> stories;
+ private List<GuiReaderBookInfo> infos;
private List<GuiReaderBook> books;
private JPanel pane;
private boolean words; // words or authors (secondary info on books)
*/
public void setActionListener(BookActionListener action) {
this.action = action;
- refreshBooks(stories, words);
+ refreshBooks(infos, words);
}
/**
* @param seeWordcount
* TRUE to see word counts, FALSE to see authors
*/
- public void refreshBooks(List<MetaData> stories, boolean seeWordcount) {
- this.stories = stories;
+ public void refreshBooks(List<GuiReaderBookInfo> stories,
+ boolean seeWordcount) {
+ this.infos = stories;
this.words = seeWordcount;
books = new ArrayList<GuiReaderBook>();
pane.removeAll();
if (stories != null) {
- for (MetaData meta : stories) {
- GuiReaderBook book = new GuiReaderBook(reader, meta,
- reader.isCached(meta.getLuid()), seeWordcount);
+ for (GuiReaderBookInfo info : stories) {
+ boolean isCached = false;
+ if (info.getMeta() != null) {
+ isCached = reader.isCached(info.getMeta().getLuid());
+ }
+
+ GuiReaderBook book = new GuiReaderBook(reader, info, isCached,
+ seeWordcount);
if (backgroundColor != null) {
book.setBackground(backgroundColor);
}
public void refreshBooks() {
BasicLibrary lib = helper.getReader().getLibrary();
for (GuiReaderGroup group : booksByType.keySet()) {
- List<MetaData> stories = lib
- .getListBySource(booksByType.get(group));
- group.refreshBooks(stories, words);
+ List<GuiReaderBookInfo> infos = new ArrayList<GuiReaderBookInfo>();
+ for (MetaData meta : lib.getListBySource(booksByType.get(group))) {
+ infos.add(GuiReaderBookInfo.fromMeta(meta));
+ }
+ group.refreshBooks(infos, words);
}
for (GuiReaderGroup group : booksByAuthor.keySet()) {
- List<MetaData> stories = lib.getListByAuthor(booksByAuthor
- .get(group));
- group.refreshBooks(stories, words);
+ List<GuiReaderBookInfo> infos = new ArrayList<GuiReaderBookInfo>();
+ for (MetaData meta : lib.getListByAuthor(booksByAuthor.get(group))) {
+ infos.add(GuiReaderBookInfo.fromMeta(meta));
+ }
+ group.refreshBooks(infos, words);
}
pane.repaint();
@Override
public void run() {
try {
- helper.getReader()
- .read(book.getMeta().getLuid(), false, pg);
+ helper.getReader().read(book.getInfo().getMeta().getLuid(),
+ false, pg);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
private void addListPane(String name, List<String> values,
final boolean type) {
- // Sources -> i18n
- GuiReaderGroup bookPane = new GuiReaderGroup(helper.getReader(), name,
- color);
+ GuiReader reader = helper.getReader();
+ BasicLibrary lib = reader.getLibrary();
- List<MetaData> metas = new ArrayList<MetaData>();
- for (String source : values) {
- MetaData mSource = new MetaData();
- mSource.setLuid(null);
- mSource.setTitle(source);
- mSource.setSource(source);
- metas.add(mSource);
+ GuiReaderGroup bookPane = new GuiReaderGroup(reader, name, color);
+
+ List<GuiReaderBookInfo> infos = new ArrayList<GuiReaderBookInfo>();
+ for (String value : values) {
+ if (type) {
+ infos.add(GuiReaderBookInfo.fromSource(lib, value));
+ } else {
+ infos.add(GuiReaderBookInfo.fromAuthor(lib, value));
+ }
}
- bookPane.refreshBooks(metas, false);
+ bookPane.refreshBooks(infos, false);
this.invalidate();
pane.invalidate();
@Override
public void action(final GuiReaderBook book) {
removeBookPanes();
- addBookPane(book.getMeta().getSource(), type);
+ addBookPane(book.getInfo().getMainInfo(), type);
refreshBooks();
}
});
* @param meta
* the meta to describe
*/
- public GuiReaderPropertiesFrame(Reader reader, MetaData meta) {
+ public GuiReaderPropertiesFrame(Reader reader, GuiReaderBookInfo info) {
+ MetaData meta = info.getMeta();
+
// Borders
int top = 20;
int space = 10;
// Image
ImageIcon img = GuiReaderCoverImager.generateCoverIcon(
- reader.getLibrary(), meta);
+ reader.getLibrary(), info);
// frame
setTitle(meta.getLuid() + ": " + meta.getTitle());
mainPanel.add(mainPanelKeys, BorderLayout.WEST);
mainPanel.add(mainPanelValues, BorderLayout.CENTER);
- List<Entry<String, String>> infos = BasicReader.getMetaDesc(meta);
+ List<Entry<String, String>> desc = BasicReader.getMetaDesc(meta);
Color trans = new Color(0, 0, 0, 1);
- for (Entry<String, String> info : infos) {
- JTextArea key = new JTextArea(info.getKey());
+ for (Entry<String, String> descLine : desc) {
+ JTextArea key = new JTextArea(descLine.getKey());
key.setFont(new Font(key.getFont().getFontName(), Font.BOLD, key
.getFont().getSize()));
key.setEditable(false);
key.setBackground(trans);
mainPanelKeys.add(key);
- JTextArea value = new JTextArea(info.getValue());
+ JTextArea value = new JTextArea(descLine.getValue());
value.setEditable(false);
value.setLineWrap(false);
value.setBackground(trans);