projects
/
jSite2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added more german i18n
[jSite2.git]
/
src
/
net
/
pterodactylus
/
jsite
/
gui
/
MainWindow.java
diff --git
a/src/net/pterodactylus/jsite/gui/MainWindow.java
b/src/net/pterodactylus/jsite/gui/MainWindow.java
index
30a9eea
..
b5bc5fb
100644
(file)
--- a/
src/net/pterodactylus/jsite/gui/MainWindow.java
+++ b/
src/net/pterodactylus/jsite/gui/MainWindow.java
@@
-36,6
+36,7
@@
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;
+import net.pterodactylus.jsite.core.Project;
import net.pterodactylus.jsite.i18n.I18n;
import net.pterodactylus.jsite.i18n.I18nable;
import net.pterodactylus.jsite.i18n.gui.I18nAction;
import net.pterodactylus.jsite.i18n.I18n;
import net.pterodactylus.jsite.i18n.I18nable;
import net.pterodactylus.jsite.i18n.gui.I18nAction;
@@
-46,7
+47,7
@@
import net.pterodactylus.util.swing.SwingUtils;
/**
* Defines the main window of the application.
/**
* Defines the main window of the application.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
* @version $Id$
*/
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
* @version $Id$
*/
@@
-71,12
+72,18
@@
public class MainWindow extends JFrame implements I18nable {
private I18nMenu languageMenu;
/** The about menu. */
private I18nMenu languageMenu;
/** The about menu. */
- private I18nMenu aboutMenu;
+ private I18nMenu helpMenu;
+
+ /** The tabbed project pane. */
+ private JTabbedPane projectPane;
+
+ /** The project overview panel. */
+ private Box projectOverviewPanel;
/**
* Creates a new main window that redirects all actions to the given swing
* interface.
/**
* Creates a new main window that redirects all actions to the given swing
* interface.
- *
+ *
* @param swingInterface
* The swing interface to receive all actions
*/
* @param swingInterface
* The swing interface to receive all actions
*/
@@
-97,7
+104,7
@@
public class MainWindow extends JFrame implements I18nable {
/**
* Sets the text of the status bar.
/**
* Sets the text of the status bar.
- *
+ *
* @param text
* The text of the status bar
*/
* @param text
* The text of the status bar
*/
@@
-105,6
+112,23
@@
public class MainWindow extends JFrame implements I18nable {
statusBar.setText(text);
}
statusBar.setText(text);
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Container getContentPane() {
+ return contentPane;
+ }
+
+ /**
+ * Returns the currently selected project.
+ *
+ * @return The currently selected project
+ */
+ public Project getSelectedProject() {
+ return null;
+ }
+
//
// PRIVATE METHODS
//
//
// PRIVATE METHODS
//
@@
-136,13
+160,17
@@
public class MainWindow extends JFrame implements I18nable {
menuBar.add(languageMenu);
for (I18nAction languageAction: swingInterface.getLanguageActions()) {
menuBar.add(languageMenu);
for (I18nAction languageAction: swingInterface.getLanguageActions()) {
- languageMenu.add(
languageAction
);
+ languageMenu.add(
new FixedJMenuItem(languageAction)
);
}
}
- aboutMenu = new I18nMenu("mainWindow.menu.help");
- menuBar.add(aboutMenu);
+ JPanel spacerPanel = new JPanel();
+ spacerPanel.setOpaque(false);
+ menuBar.add(spacerPanel);
+
+ helpMenu = new I18nMenu("mainWindow.menu.help");
+ menuBar.add(helpMenu);
-
about
Menu.add(new FixedJMenuItem(swingInterface.getHelpAboutAction()));
+
help
Menu.add(new FixedJMenuItem(swingInterface.getHelpAboutAction()));
setJMenuBar(menuBar);
setJMenuBar(menuBar);
@@
-186,11
+214,12
@@
public class MainWindow extends JFrame implements I18nable {
getContentPane().add(upperPanel, BorderLayout.PAGE_START);
contentPane.setBorder(new EmptyBorder(12, 12, 12, 12));
getContentPane().add(upperPanel, BorderLayout.PAGE_START);
contentPane.setBorder(new EmptyBorder(12, 12, 12, 12));
-
JTabbedPane tabbed
Pane = new JTabbedPane(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
- upperPanel.add(
tabbed
Pane, BorderLayout.CENTER);
+
project
Pane = new JTabbedPane(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
+ upperPanel.add(
project
Pane, BorderLayout.CENTER);
- Box projectOverviewPanel = new Box(BoxLayout.PAGE_AXIS);
- tabbedPane.add(I18n.get("mainWindow.pane.overview.title"), projectOverviewPanel);
+ projectOverviewPanel = new Box(BoxLayout.PAGE_AXIS);
+ projectOverviewPanel.setName(I18n.get("mainWindow.pane.overview.title"));
+ projectPane.add(projectOverviewPanel);
projectOverviewPanel.setBorder(new EmptyBorder(12, 12, 12, 12));
projectOverviewPanel.add(Box.createVerticalGlue());
JButton addProjectButton = new JButton(swingInterface.getAddProjectAction());
projectOverviewPanel.setBorder(new EmptyBorder(12, 12, 12, 12));
projectOverviewPanel.add(Box.createVerticalGlue());
JButton addProjectButton = new JButton(swingInterface.getAddProjectAction());
@@
-202,14
+231,6
@@
public class MainWindow extends JFrame implements I18nable {
// getContentPane().add(lowerPanel, BorderLayout.CENTER);
}
// getContentPane().add(lowerPanel, BorderLayout.CENTER);
}
- /**
- * {@inheritDoc}
- */
- @Override
- public Container getContentPane() {
- return contentPane;
- }
-
//
// INTERFACE I18nable
//
//
// INTERFACE I18nable
//
@@
-218,12
+239,28
@@
public class MainWindow extends JFrame implements I18nable {
* {@inheritDoc}
*/
public void updateI18n() {
* {@inheritDoc}
*/
public void updateI18n() {
+ swingInterface.getConfigureAction().updateI18n();
+ swingInterface.getImportConfigAction().updateI18n();
+ swingInterface.getQuitAction().updateI18n();
swingInterface.getManageNodesAction().updateI18n();
swingInterface.getNodeConnectAction().updateI18n();
swingInterface.getNodeDisconnectAction().updateI18n();
swingInterface.getManageNodesAction().updateI18n();
swingInterface.getNodeConnectAction().updateI18n();
swingInterface.getNodeDisconnectAction().updateI18n();
+ swingInterface.getAddProjectAction().updateI18n();
+ swingInterface.getCloneProjectAction().updateI18n();
+ swingInterface.getDeleteProjectAction().updateI18n();
+ swingInterface.getHelpAboutAction().updateI18n();
+ jSiteMenu.updateI18n();
nodeMenu.updateI18n();
languageMenu.updateI18n();
nodeMenu.updateI18n();
languageMenu.updateI18n();
+ for (I18nAction languageAction: swingInterface.getLanguageActions()) {
+ languageAction.updateI18n();
+ }
+ helpMenu.updateI18n();
getJMenuBar().revalidate();
getJMenuBar().revalidate();
+ projectOverviewPanel.setName(I18n.get("mainWindow.pane.overview.title"));
+ for (int componentIndex = 0; componentIndex < projectPane.getTabCount(); componentIndex++) {
+ projectPane.setTitleAt(componentIndex, projectPane.getComponentAt(componentIndex).getName());
+ }
SwingUtils.repackCentered(this);
}
SwingUtils.repackCentered(this);
}