@Override
public Window generateTooltip(BookInfo book,
boolean undecorated) {
- if (book != null && book.getMeta() != null) {
+ MetaData meta = book == null ? null : book.getMeta();
+ if (meta != null) {
PropertiesFrame tooltip = new PropertiesFrame(
- Instance.getInstance().getLibrary(),
- book.getMeta());
+ Instance.getInstance().getLibrary(), meta);
tooltip.setUndecorated(undecorated);
return tooltip;
}
public void setVisible(boolean b) {
super.setVisible(b);
- int titleBarHeight = Math
- .abs(getContentPane().getHeight() - getHeight());
+ if (b) {
+ int titleBarHeight = Math
+ .abs(getContentPane().getHeight() - getHeight());
- this.setSize(600, desc.getHeight() + titleBarHeight);
+ this.setSize(600, desc.getHeight() + titleBarHeight);
+ }
}
@Override