Author: jflesch
Date: 2006-07-30 14:03:12 +0000 (Sun, 30 Jul 2006)
New Revision: 9820
Added:
trunk/apps/Thaw/images/go-first.png
trunk/apps/Thaw/images/go-jump.png
trunk/apps/Thaw/images/go-next.png
trunk/apps/Thaw/images/min-go-first.png
trunk/apps/Thaw/images/min-go-jump.png
trunk/apps/Thaw/images/min-go-next.png
trunk/apps/Thaw/images/min-preferences-system.png
trunk/apps/Thaw/images/min-system-log-out.png
trunk/apps/Thaw/images/min-system-search.png
trunk/apps/Thaw/images/min-view-refresh.png
trunk/apps/Thaw/images/preferences-system.png
trunk/apps/Thaw/images/process-stop.png
trunk/apps/Thaw/images/system-log-out.png
trunk/apps/Thaw/images/system-search.png
trunk/apps/Thaw/images/view-refresh.png
trunk/apps/Thaw/src/thaw/core/IconBox.java
Modified:
trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
trunk/apps/Thaw/src/thaw/core/Core.java
trunk/apps/Thaw/src/thaw/core/MainWindow.java
trunk/apps/Thaw/src/thaw/i18n/thaw.properties
trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java
trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java
trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java
trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java
Log:
Add icons
Added: trunk/apps/Thaw/images/go-first.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/go-first.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/go-jump.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/go-jump.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/go-next.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/go-next.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/min-go-first.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/min-go-first.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/min-go-jump.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/min-go-jump.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/min-go-next.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/min-go-next.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/min-preferences-system.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/min-preferences-system.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/min-system-log-out.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/min-system-log-out.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/min-system-search.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/min-system-search.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/min-view-refresh.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/min-view-refresh.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/preferences-system.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/preferences-system.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/process-stop.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/process-stop.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/system-log-out.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/system-log-out.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/system-search.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/system-search.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/view-refresh.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/view-refresh.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2006-07-30 12:11:15 UTC
(rev 9819)
+++ trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2006-07-30 14:03:12 UTC
(rev 9820)
@@ -174,7 +174,11 @@
/* should reinit the whole connection correctly */
core.getPluginManager().stopPlugins();
- core.initNodeConnection();
+
+ if(!core.initNodeConnection()) {
+ new WarningWindow(core,
I18n.getMessage("thaw.warning.unableToConnectTo")+ "
"+core.getConfig().getValue("nodeAddress")+":"+
core.getConfig().getValue("nodePort"));
+ }
+
core.getPluginManager().loadPlugins();
core.getPluginManager().runPlugins();
Modified: trunk/apps/Thaw/src/thaw/core/Core.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Core.java 2006-07-30 12:11:15 UTC (rev
9819)
+++ trunk/apps/Thaw/src/thaw/core/Core.java 2006-07-30 14:03:12 UTC (rev
9820)
@@ -85,8 +85,7 @@
return false;
if(!initNodeConnection())
- new WarningWindow(this,
I18n.getMessage("thaw.warning.unableToConnectTo")+ "
"+config.getValue("nodeAddress")+":"+
- config.getValue("nodePort"));
+ new WarningWindow(this,
I18n.getMessage("thaw.warning.unableToConnectTo")+ "
"+config.getValue("nodeAddress")+":"+ config.getValue("nodePort"));
if(!initGraphics())
return false;
@@ -256,6 +255,8 @@
public boolean initGraphics() {
initializeLookAndFeel();
+ IconBox.loadIcons();
+
mainWindow = new MainWindow(this);
configWindow = new ConfigWindow(this);
Added: trunk/apps/Thaw/src/thaw/core/IconBox.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/IconBox.java 2006-07-30 12:11:15 UTC (rev
9819)
+++ trunk/apps/Thaw/src/thaw/core/IconBox.java 2006-07-30 14:03:12 UTC (rev
9820)
@@ -0,0 +1,106 @@
+package thaw.core;
+
+import javax.swing.ImageIcon;
+
+/**
+ * This class is simply an helper to find and load quickly some common icons.
+ */
+public class IconBox {
+
+ /**
+ * Freenet logo :)
+ */
+ public static ImageIcon blueBunny;
+
+ public static ImageIcon connectAction;
+ public static ImageIcon minConnectAction;
+
+ public static ImageIcon disconnectAction;
+
+ public static ImageIcon queue;
+ public static ImageIcon minQueue;
+
+ public static ImageIcon insertions;
+ public static ImageIcon minInsertions;
+
+ public static ImageIcon downloads;
+ public static ImageIcon minDownloads;
+
+ public static ImageIcon settings;
+ public static ImageIcon minSettings;
+
+ public static ImageIcon reconnectAction;
+ public static ImageIcon minReconnectAction;
+
+ public static ImageIcon quitAction;
+ public static ImageIcon minQuitAction;
+
+ public static ImageIcon search;
+
+ /**
+ * Not really used
+ */
+ public IconBox() {
+
+ }
+
+ /**
+ * no warranty
+ */
+ public static void loadIcons() {
+ try {
+
+ blueBunny =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("blueBunny.png"));
+
+
+ connectAction =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("go-jump.png"));
+ minConnectAction =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("min-go-jump.png"));
+
+
+ disconnectAction =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("process-stop.png"));
+
+ queue =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("system-search.png"));
+ minQueue =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("min-system-search.png"));
+
+
+ insertions =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("go-next.png"));
+ minInsertions =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("min-go-next.png"));
+
+
+ downloads =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("go-first.png"));
+ minDownloads =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("min-go-first.png"));
+
+ settings =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("preferences-system.png"));
+ minSettings =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("min-preferences-system.png"));
+
+
+ reconnectAction =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("view-refresh.png"));
+ minReconnectAction =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("min-view-refresh.png"));
+
+ quitAction =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("system-log-out.png"));
+ minQuitAction =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("min-system-log-out.png"));
+
+ search =
+ new ImageIcon((new
IconBox()).getClass().getClassLoader().getResource("system-search.png"));
+ } catch(Exception e) {
+ Logger.notice(new IconBox(), "Exception while loading
icons: "+e);
+ }
+ }
+
+}
Modified: trunk/apps/Thaw/src/thaw/core/MainWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/MainWindow.java 2006-07-30 12:11:15 UTC
(rev 9819)
+++ trunk/apps/Thaw/src/thaw/core/MainWindow.java 2006-07-30 14:03:12 UTC
(rev 9820)
@@ -12,6 +12,7 @@
import java.awt.event.WindowEvent;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
+import javax.swing.Icon;
import java.awt.Font;
import thaw.i18n.I18n;
@@ -65,20 +66,25 @@
mainWindow = new JFrame("Thaw");
+ mainWindow.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+
mainWindow.setVisible(false);
try {
- mainWindow.setIconImage((new
ImageIcon(getClass().getClassLoader().getResource("blueBunny.png"))).getImage());
- } catch(java.lang.NullPointerException e) {
+ mainWindow.setIconImage(IconBox.blueBunny.getImage());
+ } catch(Throwable e) {
Logger.notice(this, "No icon");
}
menuBar = new JMenuBar();
fileMenu = new JMenu(I18n.getMessage("thaw.menu.file"));
- reconnectionFileMenuItem = new
JMenuItem(I18n.getMessage("thaw.menu.item.reconnect"));
- optionsFileMenuItem = new
JMenuItem(I18n.getMessage("thaw.menu.item.options"));
- quitFileMenuItem = new
JMenuItem(I18n.getMessage("thaw.menu.item.quit"));
+ reconnectionFileMenuItem = new
JMenuItem(I18n.getMessage("thaw.menu.item.reconnect"),
+
IconBox.minReconnectAction);
+ optionsFileMenuItem = new
JMenuItem(I18n.getMessage("thaw.menu.item.options"),
+ IconBox.minSettings);
+ quitFileMenuItem = new
JMenuItem(I18n.getMessage("thaw.menu.item.quit"),
+ IconBox.minQuitAction);
reconnectionFileMenuItem.addActionListener(this);
optionsFileMenuItem.addActionListener(this);
@@ -99,6 +105,8 @@
tabbedPane = new JTabbedPane();
+ //tabbedPane.setTabPlacement(JTabbedPane.RIGHT);
+
statusBar = new JLabel();
setStatus(null);
statusBar.setSize(500, 30);
@@ -147,6 +155,15 @@
return true;
}
+ /**
+ *??@see #addTab(String, java.awt.Component)
+ */
+ public boolean addTab(String tabName, Icon icon, java.awt.Component
panel) {
+ tabbedPane.addTab(tabName, icon, panel);
+
+ return true;
+ }
+
/**
* Used to remove a tab from the main window.
@@ -232,8 +249,9 @@
new JLabel(I18n.getMessage("thaw.about.l1")),
new JLabel(I18n.getMessage("thaw.about.l2")),
new JLabel(I18n.getMessage("thaw.about.l3")),
- new JLabel(I18n.getMessage("thaw.about.l4"))
- //new JLabel(I18n.getMessage("thaw.about.l3")),
+ new JLabel(I18n.getMessage("thaw.about.l4")),
+ new JLabel(""),
+ new JLabel(I18n.getMessage("thaw.about.l6"))
};
labels[0].setFont(new Font("Dialog", Font.BOLD, 30));
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2006-07-30 12:11:15 UTC
(rev 9819)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2006-07-30 14:03:12 UTC
(rev 9820)
@@ -154,3 +154,4 @@
thaw.about.l2=by Jerome Flesch
thaw.about.l3=2006(c) Freenet Project Incorporated
thaw.about.l4=under GPLv2
+thaw.about.l6=Icon theme "Gorilla" created by Jimmac
(http://jimmac.musichall.cz/icons.php)
\ No newline at end of file
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2006-07-30 12:11:15 UTC
(rev 9819)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2006-07-30 14:03:12 UTC
(rev 9820)
@@ -153,3 +153,4 @@
thaw.about.l2=par J?r?me Flesch
thaw.about.l3=2006(c) Freenet Project Incorporated
thaw.about.l4=sous GPLv2
+thaw.about.l6=Th?me d'icones "Gorilla" cr?? par Jimmac
(http://jimmac.musichall.cz/icons.php)
\ No newline at end of file
Modified: trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java 2006-07-30 12:11:15 UTC
(rev 9819)
+++ trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java 2006-07-30 14:03:12 UTC
(rev 9820)
@@ -26,7 +26,9 @@
fetchPanel = new FetchPanel(core, this);
-
core.getMainWindow().addTab(I18n.getMessage("thaw.common.download"),
fetchPanel.getPanel());
+
core.getMainWindow().addTab(I18n.getMessage("thaw.common.download"),
+ IconBox.minDownloads,
+ fetchPanel.getPanel());
return true;
}
Modified: trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java 2006-07-30 12:11:15 UTC
(rev 9819)
+++ trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java 2006-07-30 14:03:12 UTC
(rev 9820)
@@ -10,6 +10,7 @@
import javax.swing.ButtonGroup;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
+import javax.swing.JScrollPane;
import java.io.File;
import thaw.core.*;
@@ -21,6 +22,7 @@
private Core core;
private InsertPanel insertPanel;
+ private JScrollPane scrollPane;
public InsertPlugin() {
@@ -35,8 +37,12 @@
insertPanel = new InsertPanel(this,
Boolean.valueOf(core.getConfig().getValue("advancedMode")).booleanValue());
-
core.getMainWindow().addTab(I18n.getMessage("thaw.common.insertion"),
insertPanel.getPanel());
+ scrollPane = new JScrollPane(insertPanel.getPanel());
+
core.getMainWindow().addTab(I18n.getMessage("thaw.common.insertion"),
+ IconBox.minInsertions,
+ scrollPane);
+
return true;
}
@@ -44,7 +50,7 @@
public boolean stop() {
Logger.info(this, "Stopping plugin \"InsertPlugin\" ...");
- core.getMainWindow().removeTab(insertPanel.getPanel());
+ core.getMainWindow().removeTab(scrollPane);
return true;
}
Modified: trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java 2006-07-30 12:11:15 UTC
(rev 9819)
+++ trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java 2006-07-30 14:03:12 UTC
(rev 9820)
@@ -38,6 +38,8 @@
private boolean advancedMode = false;
+ private java.awt.Container panelAdded;
+
public QueueWatcher() {
}
@@ -55,8 +57,7 @@
panel = new JPanel();
- GridLayout layout = new GridLayout(2, 1);
- layout.setVgap(10);
+ GridLayout layout = new GridLayout(2, 1, 10, 10);
panel.setLayout(layout);
if(queuePanels[0].getPanel() != null)
@@ -84,11 +85,14 @@
mainPanel.addPropertyChangeListener(this);
mainPanel.setOneTouchExpandable(true);
-
core.getMainWindow().addTab(I18n.getMessage("thaw.common.status"), mainPanel);
+ panelAdded = mainPanel;
} else {
+ panelAdded = panel;
+ }
-
core.getMainWindow().addTab(I18n.getMessage("thaw.common.status"), panel);
- }
+
core.getMainWindow().addTab(I18n.getMessage("thaw.common.status"),
+ IconBox.minQueue,
+ panelAdded);
if(core.getConnectionManager() != null &&
core.getConnectionManager().isConnected()) {
core.getConnectionManager().addObserver(this);
@@ -114,10 +118,7 @@
core.getConfig().setValue("detailPanelFolded", ((new
Boolean(folded)).toString()));
- if(advancedMode)
- core.getMainWindow().removeTab(mainPanel);
- else
- core.getMainWindow().removeTab(panel);
+ core.getMainWindow().removeTab(panelAdded);
return true;
}
Modified: trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java
2006-07-30 12:11:15 UTC (rev 9819)
+++ trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java
2006-07-30 14:03:12 UTC (rev 9820)
@@ -86,10 +86,14 @@
if(isForInsertionQueue) {
label = new
JLabel(I18n.getMessage("thaw.common.insertions"));
+ label.setIcon(IconBox.insertions);
} else {
label = new
JLabel(I18n.getMessage("thaw.common.downloads"));
+ label.setIcon(IconBox.downloads);
}
+ label.setVerticalAlignment(JLabel.CENTER);
+
panel = new JPanel();
panel.setLayout(new BorderLayout());