/**
* The Swing user interface.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
* @version $Id$
*/
/** Whether to beautify the GUI. */
private boolean beautify;
+ /** The control font. */
+ private String controlFont;
+
+ /** The user font. */
+ private String userFont;
+
/**
* Creates a new swing interface.
- *
+ *
* @param core
* The core to operate on
* @param configDirectory
loadConfig();
if (beautify) {
System.setProperty("swing.aatext", "true");
- System.setProperty("swing.plaf.metal.controlFont", "Tahoma");
- System.setProperty("swing.plaf.metal.userFont", "Tahoma");
+ if (controlFont != null) {
+ System.setProperty("swing.plaf.metal.controlFont", controlFont);
+ }
+ if (userFont != null) {
+ System.setProperty("swing.plaf.metal.userFont", userFont);
+ }
}
initActions();
initDialogs();
/**
* Returns the core that is controlled by the Swing interface.
- *
+ *
* @return The core
*/
Core getCore() {
/**
* Returns the main window of the Swing interface.
- *
+ *
* @return The main window
*/
MainWindow getMainWindow() {
/**
* Returns the “configure” action.
- *
+ *
* @return The “configure” action
*/
I18nAction getConfigureAction() {
/**
* Returns the “import config” action.
- *
+ *
* @return The “import config” action
*/
I18nAction getImportConfigAction() {
/**
* Returns the “quit” action.
- *
+ *
* @return The “quit” action
*/
I18nAction getQuitAction() {
/**
* Returns the “manage nodes” action.
- *
+ *
* @return The “manage nodes” action
*/
I18nAction getManageNodesAction() {
/**
* Returns the “connect to node” action.
- *
+ *
* @return The “connect to node” action
*/
I18nAction getNodeConnectAction() {
/**
* Returns the “disconnect from node” action.
- *
+ *
* @return The “disconnect from node” action
*/
I18nAction getNodeDisconnectAction() {
/**
* Returns all language actions.
- *
+ *
* @return All language actions
*/
List<I18nAction> getLanguageActions() {
/**
* Returns the “about” action.
- *
+ *
* @return The “about” action
*/
I18nAction getHelpAboutAction() {
/**
* Returns the “add project” action.
- *
+ *
* @return The “add project” action
*/
I18nAction getAddProjectAction() {
/**
* Returns the “clone project” action.
- *
+ *
* @return The “clone project” action
*/
I18nAction getCloneProjectAction() {
/**
* Returns the “delete project” action.
- *
+ *
* @return The “delete project” action
*/
I18nAction getDeleteProjectAction() {
if (configProperties.containsKey("beautify")) {
beautify = Boolean.valueOf(configProperties.getProperty("beautify"));
}
+ if (configProperties.containsKey("controlFont")) {
+ controlFont = configProperties.getProperty("controlFont");
+ }
+ if (configProperties.containsKey("userFont")) {
+ userFont = configProperties.getProperty("userFont");
+ }
}
/**
File configFile = new File(configDirectory, "swing-interface.properties");
Properties configProperties = new Properties();
configProperties.setProperty("beautify", String.valueOf(beautify));
+ if (controlFont != null) {
+ configProperties.setProperty("controlFont", controlFont);
+ }
+ if (userFont != null) {
+ configProperties.setProperty("userFont", userFont);
+ }
FileOutputStream configOutputStream = null;
try {
configOutputStream = new FileOutputStream(configFile);
*/
private void configure() {
configurationDialog.setBeautify(beautify);
+ configurationDialog.setControlFont(controlFont);
+ configurationDialog.setUserFont(userFont);
configurationDialog.setVisible(true);
if (!configurationDialog.wasCancelled()) {
beautify = configurationDialog.getBeautify();
+ controlFont = configurationDialog.getControlFont();
+ userFont = configurationDialog.getUserFont();
saveConfig();
}
}
/**
* Changes the language of the interface. This method also disables the
* action for the newly set language and enables all others.
- *
+ *
* @param newLocale
* The new language
* @param languageAction