import java.awt.Desktop;
import java.io.IOException;
import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
import java.util.concurrent.ExecutionException;
import javax.swing.JEditorPane;
*/
public class Main extends be.nikiroo.fanfix.Main {
private boolean busy;
+ private boolean kiosk;
/**
* The main entry point of the application.
* It overrides some function of Fanfix's Main.
*
* @param args
- * the arguments (none, or will be passed to Fanfix)
+ * the arguments (none, "--kiosk" (fullceen, no decorations,
+ * Nimbus Look & Feel) or will be passed to Fanfix)
*/
public static void main(String[] args) {
new Main().start(args);
}
+ @Override
+ public void start(String[] args) {
+ List<String> argsList = new ArrayList<String>();
+ for (String arg : args) {
+ if ("--kiosk".equals(arg)) {
+ kiosk = true;
+ } else {
+ argsList.add(arg);
+ }
+ }
+
+ super.start(argsList.toArray(new String[0]));
+ }
+
@Override
protected VersionCheck checkUpdates() {
new SwingWorker<VersionCheck, Void>() {
@Override
protected void start() throws IOException {
- UIUtils.setLookAndFeel();
+ if (kiosk) {
+ UIUtils.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
+ } else {
+ UIUtils.setLookAndFeel();
+ }
+
Instance.init();
JFrame main = new MainFrame();
+
+ if (kiosk) {
+ main.setUndecorated(kiosk);
+ main.setExtendedState(JFrame.MAXIMIZED_BOTH);
+ }
+
main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
main.setVisible(true);
}
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
+import java.awt.event.WindowEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
+import javax.swing.JSeparator;
import javax.swing.JSplitPane;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
}
});
+ JMenuItem mnuExit = new JMenuItem("Exit", KeyEvent.VK_X);
+ mnuExit.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ MainFrame.this.dispatchEvent(new WindowEvent(MainFrame.this,
+ WindowEvent.WINDOW_CLOSING));
+ }
+ });
+
file.add(mnuDownload);
file.add(mnuImprtFile);
file.add(mnuSearch);
+ file.add(new JSeparator());
+ file.add(mnuExit);
// EDIT
view.add(mnuSidePane);
view.add(mnuDetailsPane);
view.add(mnuThumbs);
+ view.add(new JSeparator());
view.add(mnuWord);
//
static final Color SPINE_COLOR_RIGHT = new Color(100, 100, 100);
static final Color BORDER = Color.black;
- public static final Color UNCACHED_ICON_COLOR = Color.green.darker();
- // new Color(0, 80, 220);
+ public static final Color UNCACHED_ICON_COLOR = Color.gray;
+ public static final Color CACHED_ICON_COLOR = Color.green.darker();
public static final int TEXT_HEIGHT = 50;
public static final int TEXT_WIDTH = COVER_WIDTH + 40;
g.setColor(color);
g.fillRect(clip.x, clip.y, clip.width, clip.height);
- UIUtils.drawEllipse3D(g, UNCACHED_ICON_COLOR,
+ UIUtils.drawEllipse3D(g,
+ cached ? CACHED_ICON_COLOR : UNCACHED_ICON_COLOR,
COVER_WIDTH + HOFFSET + 30, 10, 20, 20, cached);
}
}
iconNotCached = new JLabel(" ○ ");
iconNotCached.setForeground(BookCoverImager.UNCACHED_ICON_COLOR);
- iconCached.setForeground(BookCoverImager.UNCACHED_ICON_COLOR);
+ iconCached.setForeground(BookCoverImager.CACHED_ICON_COLOR);
iconCached.setPreferredSize(iconNotCached.getPreferredSize());
title = new JLabel();