Added:
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleCommon/src/main/java/org/mozzes/application/example/common/ExampleConstants.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/ApplicationContext.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/ExampleSwingClient.java
Deleted:
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/ExampleSwingApplication.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/Server.java
Modified:
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleServer/src/main/java/org/mozzes/application/example/server/ExampleServer.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/AbstractCRUDPanel.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/AbstractCreateEditDialog.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/ImagePanel.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/MainFrame.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/edit/MatchCreateEditDialog.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/edit/TeamCreateEditDialog.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/main/MatchAdministrationPanel.java
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/main/TeamAdministrationPanel.java
=======================================
--- /dev/null
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleCommon/src/main/java/org/mozzes/application/example/common/ExampleConstants.java
Thu Mar 4 02:25:49 2010
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2010 Mozzart
+ *
+ *
+ * This file is part of mozzes.
+ *
+ * mozzes is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * mozzes is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with mozzes. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.mozzes.application.example.common;
+
+public class ExampleConstants {
+
+ public static final String HOST = "localhost";
+ public static final int PORT = 1234;
+}
=======================================
--- /dev/null
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/ApplicationContext.java
Thu Mar 4 02:25:49 2010
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2010 Mozzart
+ *
+ *
+ * This file is part of mozzes.
+ *
+ * mozzes is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * mozzes is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with mozzes. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.mozzes.application.example.swing;
+
+import java.lang.reflect.UndeclaredThrowableException;
+
+import javax.swing.JOptionPane;
+
+import org.mozzes.application.common.client.MozzesClient;
+import org.mozzes.application.example.common.ExampleConstants;
+import org.mozzes.application.remoting.client.RemoteClientConfiguration;
+
+public class ApplicationContext {
+
+ private static ApplicationContext instance;
+
+ private final MozzesClient client;
+
+ private ApplicationContext() {
+ client = new MozzesClient(new
RemoteClientConfiguration(ExampleConstants.HOST, ExampleConstants.PORT));
+ }
+
+ private static ApplicationContext getInstance() {
+ if (instance == null) {
+ try {
+ instance = new ApplicationContext();
+ } catch (UndeclaredThrowableException e) {
+
JOptionPane.showMessageDialog(ExampleSwingClient.getApplicationMainFrame(),
+ "Server is not starated!");
+ System.exit(1);
+ }
+ }
+ return instance;
+ }
+
+ public static <T> T getService(Class<T> serviceInterface) {
+ return getInstance().client.getService(serviceInterface);
+ }
+}
=======================================
--- /dev/null
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/ExampleSwingClient.java
Thu Mar 4 02:25:49 2010
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2010 Mozzart
+ *
+ *
+ * This file is part of mozzes.
+ *
+ * mozzes is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * mozzes is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with mozzes. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.mozzes.application.example.swing;
+
+import java.awt.Dimension;
+
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UIManager.LookAndFeelInfo;
+
+import org.mozzes.application.example.swing.gui.MainFrame;
+import org.mozzes.swing.mgf.localization.Localization;
+
+
+
+public class ExampleSwingClient {
+ private static final Dimension WINDOW_SIZE = new Dimension(800, 600);
+ private static JFrame applicationMainFrame;
+
+ public static void main(String[] args) {
+ org.mozzes.swing.mgf.localization.Localization.getValue(
+
org.mozzes.swing.mgf.localization.LocalizationKey.INVALID_NUMBER_FORMAT_MESSAGE);
+ Localization.initialize("en");
+ setLookAndFeel();
+ showMainFrame();
+ }
+
+ private static void showMainFrame() {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ applicationMainFrame = new MainFrame();
+ applicationMainFrame.setSize(WINDOW_SIZE);
+ applicationMainFrame.setLocationRelativeTo(null);
+
+ applicationMainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ applicationMainFrame.setVisible(true);
+ }
+ });
+ }
+
+ public static void setLookAndFeel() {
+ try {
+ // In Java version 7 Nimbus will move to plaf.nimbus
+ // That's way we are loading it like this (and for falling back to
default)
+ for (LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
+ if ("Nimbus".equals(laf.getName())) {
+ UIManager.setLookAndFeel(laf.getClassName());
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace(System.err);
+ }
+ }
+
+ public static JFrame getApplicationMainFrame() {
+ return applicationMainFrame;
+ }
+}
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/ExampleSwingApplication.java
Sat Feb 27 06:56:25 2010
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2010 Mozzart
- *
- *
- * This file is part of mozzes.
- *
- * mozzes is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * mozzes is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with mozzes. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.mozzes.application.example.swing;
-
-import java.awt.Dimension;
-
-import javax.swing.JFrame;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.UIManager.LookAndFeelInfo;
-
-import org.mozzes.application.example.swing.gui.MainFrame;
-import org.mozzes.swing.mgf.localization.Localization;
-
-
-
-public class ExampleSwingApplication {
- private static final Dimension WINDOW_SIZE = new Dimension(800, 600);
- private static JFrame applicationMainFrame;
-
- public static void main(String[] args) {
- // ExampleServer.main(null);
- org.mozzes.swing.mgf.localization.Localization.getValue(
-
org.mozzes.swing.mgf.localization.LocalizationKey.INVALID_NUMBER_FORMAT_MESSAGE);
- Localization.initialize("sr");
- setAmadeusLookAndFeel();
- showMainFrame();
- }
-
- private static void showMainFrame() {
- SwingUtilities.invokeLater(new Runnable() {
-
- public void run() {
- applicationMainFrame = new MainFrame();
- applicationMainFrame.setSize(WINDOW_SIZE);
- applicationMainFrame.setLocationRelativeTo(null);
-
- applicationMainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- applicationMainFrame.setVisible(true);
- }
- });
- }
-
- public static void setAmadeusLookAndFeel() {
- try {
- // In Java version 7 Nimbus will move to plaf.nimbus
- // That's way we are loading it like this (and for falling back to
default)
- for (LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(laf.getName())) {
- UIManager.setLookAndFeel(laf.getClassName());
- }
- }
- } catch (Exception e) {
- e.printStackTrace(System.err);
- }
- }
-
- public static JFrame getApplicationMainFrame() {
- return applicationMainFrame;
- }
-}
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/Server.java
Sat Feb 27 06:56:25 2010
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2010 Mozzart
- *
- *
- * This file is part of mozzes.
- *
- * mozzes is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * mozzes is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with mozzes. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.mozzes.application.example.swing;
-
-import java.lang.reflect.UndeclaredThrowableException;
-
-import javax.swing.JOptionPane;
-
-import org.mozzes.application.common.client.MozzesClient;
-import org.mozzes.application.example.common.service.MatchAdministration;
-import org.mozzes.application.example.common.service.TeamAdministration;
-import org.mozzes.application.remoting.client.RemoteClientConfiguration;
-
-
-
-public class Server {
- private static final String HOST = "localhost";
- private static final int PORT = 1234;
-
- private static Server instance;
-
- private final MozzesClient client;
-
- private Server() {
- MozzesClient mozzesClient = null;
- try {
- mozzesClient = new MozzesClient(new RemoteClientConfiguration(HOST,
PORT));
- } catch (UndeclaredThrowableException e) {
-
JOptionPane.showMessageDialog(ExampleSwingApplication.getApplicationMainFrame(),
- "Server nije pokrenut!");
- System.exit(1);
- }
- client = mozzesClient;
- }
-
- private static Server getInstance() {
- if (instance == null)
- instance = new Server();
- return instance;
- }
-
- public static TeamAdministration getTeamAdministrationService() {
- return getInstance().client.getService(TeamAdministration.class);
- }
-
- public static MatchAdministration getMatchAdministrationService() {
- return getInstance().client.getService(MatchAdministration.class);
- }
-}
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleServer/src/main/java/org/mozzes/application/example/server/ExampleServer.java
Sat Feb 27 09:02:30 2010
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleServer/src/main/java/org/mozzes/application/example/server/ExampleServer.java
Thu Mar 4 02:25:49 2010
@@ -20,6 +20,7 @@
*/
package org.mozzes.application.example.server;
+import org.mozzes.application.example.common.ExampleConstants;
import org.mozzes.application.example.common.service.MatchAdministration;
import org.mozzes.application.example.common.service.TeamAdministration;
import
org.mozzes.application.example.server.service.MatchAdministrationImpl;
@@ -34,12 +35,11 @@
public class ExampleServer {
- private static final int PORT = 1234;
public MozzesServerConfiguration createServerConfiguration() {
MozzesServerConfiguration cfg = new MozzesServerConfiguration();
cfg.addApplicationModule(new
HibernatePlugin(HibernateConfigurationType.ANNOTATION));
- cfg.addApplicationModule(new RemotingPlugin(PORT));
+ cfg.addApplicationModule(new RemotingPlugin(ExampleConstants.PORT));
cfg.addApplicationModule(new
RestJerseyModule("http://localhost:8000/", "org.mozzes.application.example.rest.jersey"));
cfg.addService(MatchAdministration.class, MatchAdministrationImpl.class);
@@ -50,23 +50,7 @@
private void start() {
MozzesServer server = new MozzesServer(createServerConfiguration());
server.start();
-
-// Team t1 = new Team();
-// t1.setName("Crvena zvezda");
-// Team t2 = new Team();
-// t2.setName("Partizan");
-//
-// t1 =
server.getLocalClient().getService(TeamAdministration.class).save(t1);
-// t2 =
server.getLocalClient().getService(TeamAdministration.class).save(t2);
-//
log.info(server.getLocalClient().getService(TeamAdministration.class).findAll());
-//
-// server.getLocalClient().getService(MatchAdministration.class).save(
-// new Match(new Date(), t1, t2, new Result(2, 1)));
-//
log.info(server.getLocalClient().getService(MatchAdministration.class).findAll());
-
- }
-
-// private static final Logger log = Logger.getLogger(ExampleServer.class);
+ }
public static void main(String[] args) {
new ExampleServer().start();
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/AbstractCRUDPanel.java
Sat Feb 27 06:56:25 2010
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/AbstractCRUDPanel.java
Thu Mar 4 02:25:49 2010
@@ -51,9 +51,10 @@
private final DataModel<T> model = new DefaultDataModel<T>();
private final TableBuilder<T> table;
- private JButton btnNew = new JButton("Novi");
- private JButton btnEdit = new JButton("Izmeni");
- private JButton btnDelete = new JButton("Izbrisi");
+ private JButton btnReload = new JButton("Reload");
+ private JButton btnNew = new JButton("New");
+ private JButton btnEdit = new JButton("Edit");
+ private JButton btnDelete = new JButton("Delete");
private final AbstractCreateEditDialog<T> editDialog;
@@ -81,6 +82,12 @@
public void selectionChanged(SelectionListDataSource<T> source,
SelectionChangedEvent<T> event) {
setButtonsState();
}
+ });
+ btnReload.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ reload();
+ }
});
btnDelete.addActionListener(new ActionListener() {
@Override
@@ -117,16 +124,25 @@
setLayout(new BorderLayout());
add(table.getRenderComponent(), BorderLayout.CENTER);
- JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
- buttons.add(btnNew);
- buttons.add(btnEdit);
- buttons.add(btnDelete);
- add(buttons, BorderLayout.SOUTH);
+ JPanel pnlCrudButtons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
+ pnlCrudButtons.add(btnNew);
+ pnlCrudButtons.add(btnEdit);
+ pnlCrudButtons.add(btnDelete);
+
+ JPanel pnlButtons = new JPanel(new BorderLayout());
+ pnlButtons.add(btnReload, BorderLayout.WEST);
+ pnlButtons.add(pnlCrudButtons, BorderLayout.CENTER);
+
+ add(pnlButtons, BorderLayout.SOUTH);
}
private void loadData() {
source.setData(service.findAll());
}
+
+ private void reload() {
+ loadData();
+ }
private void addNewItem() {
editDialog.newObject();
@@ -149,8 +165,8 @@
if (selected == null || selected.isEmpty())
return;
int result = JOptionPane.showConfirmDialog(this,
- "Da li ste sigurni da zelite da obrisete objekate.",
- "Potvrda brisanja", JOptionPane.YES_NO_OPTION);
+ "Are you sure you want to delete objects?",
+ "Delete confirmation", JOptionPane.YES_NO_OPTION);
if (result != JOptionPane.YES_OPTION)
return;
try {
@@ -160,7 +176,7 @@
}
} catch (Exception e) {
e.printStackTrace(System.err);
- JOptionPane.showMessageDialog(this, e.getMessage(), "Greska!",
+ JOptionPane.showMessageDialog(this, e.getMessage(), "Error!",
JOptionPane.ERROR_MESSAGE);
}
}
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/AbstractCreateEditDialog.java
Sat Feb 27 06:56:25 2010
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/AbstractCreateEditDialog.java
Thu Mar 4 02:25:49 2010
@@ -34,7 +34,7 @@
import javax.swing.JPanel;
import org.mozzes.application.example.common.service.Administration;
-import org.mozzes.application.example.swing.ExampleSwingApplication;
+import org.mozzes.application.example.swing.ExampleSwingClient;
import org.mozzes.swing.mgf.datasource.BeanDataSource;
import org.mozzes.swing.mgf.datasource.impl.BeanCopyDataSource;
import org.mozzes.validation.ValidationUtils;
@@ -108,7 +108,7 @@
}
private static Frame getFrame() {
- return ExampleSwingApplication.getApplicationMainFrame();
+ return ExampleSwingClient.getApplicationMainFrame();
}
private void initLayout() {
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/ImagePanel.java
Sat Feb 27 06:56:25 2010
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/ImagePanel.java
Thu Mar 4 02:25:49 2010
@@ -112,7 +112,7 @@
@Override
public String getDescription() {
- return "Slike";
+ return "Images";
}
private String takeExtension(File f) {
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/MainFrame.java
Sat Feb 27 06:56:25 2010
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/MainFrame.java
Thu Mar 4 02:25:49 2010
@@ -38,10 +38,10 @@
private void initTabs() {
TeamAdministrationPanel teamAdministration = new
TeamAdministrationPanel();
- tabs.addTab("Timovi", teamAdministration);
+ tabs.addTab("Teams", teamAdministration);
MatchAdministrationPanel matchAdministration = new
MatchAdministrationPanel();
- tabs.addTab("Mecevi", matchAdministration);
+ tabs.addTab("Matches", matchAdministration);
}
}
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/edit/MatchCreateEditDialog.java
Sat Feb 27 06:56:25 2010
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/edit/MatchCreateEditDialog.java
Thu Mar 4 02:25:49 2010
@@ -34,7 +34,9 @@
import org.mozzes.application.example.common.domain.Match;
import org.mozzes.application.example.common.domain.Result;
import org.mozzes.application.example.common.domain.Team;
-import org.mozzes.application.example.swing.Server;
+import org.mozzes.application.example.common.service.MatchAdministration;
+import org.mozzes.application.example.common.service.TeamAdministration;
+import org.mozzes.application.example.swing.ApplicationContext;
import org.mozzes.application.example.swing.gui.AbstractCreateEditDialog;
import org.mozzes.swing.mgf.binding.Binder;
import org.mozzes.swing.mgf.datamodel.fields.PropertyField;
@@ -45,10 +47,10 @@
public class MatchCreateEditDialog extends AbstractCreateEditDialog<Match>
{
private static final long serialVersionUID = 1L;
- private JLabel lblHome = new JLabel("Domacin:");
- private JLabel lblGuest = new JLabel("Gost:");
- private JLabel lblStartTime = new JLabel("Vreme pocetka:");
- private JLabel lblResult = new JLabel("Rezultat:");
+ private JLabel lblHome = new JLabel("Home team:");
+ private JLabel lblGuest = new JLabel("Visitor team:");
+ private JLabel lblStartTime = new JLabel("Start time:");
+ private JLabel lblResult = new JLabel("Result:");
private ComboBoxRenderModel<Team> cmbHome = new
ComboBoxRenderModel<Team>(Team.class);
private ComboBoxRenderModel<Team> cmbGuest = new
ComboBoxRenderModel<Team>(Team.class);
@@ -58,7 +60,7 @@
private JTextField txtResultVisitor = new JTextField();
public MatchCreateEditDialog() {
- super(Server.getMatchAdministrationService(), getEmptyMatch());
+ super(ApplicationContext.getService(MatchAdministration.class),
getEmptyMatch());
initialize();
@@ -78,7 +80,7 @@
}
private void loadData() {
- List<Team> teams = Server.getTeamAdministrationService().findAll();
+ List<Team> teams =
ApplicationContext.getService(TeamAdministration.class).findAll();
cmbHome.setValues(teams, true);
cmbGuest.setValues(teams, true);
}
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/edit/TeamCreateEditDialog.java
Sat Feb 27 06:56:25 2010
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/edit/TeamCreateEditDialog.java
Thu Mar 4 02:25:49 2010
@@ -33,7 +33,8 @@
import javax.swing.JTextField;
import org.mozzes.application.example.common.domain.Team;
-import org.mozzes.application.example.swing.Server;
+import org.mozzes.application.example.common.service.TeamAdministration;
+import org.mozzes.application.example.swing.ApplicationContext;
import org.mozzes.application.example.swing.gui.AbstractCreateEditDialog;
import org.mozzes.application.example.swing.gui.ImagePanel;
import org.mozzes.swing.mgf.binding.Binder;
@@ -61,7 +62,7 @@
private ImagePanel imagePanel = new ImagePanel();
public TeamCreateEditDialog() {
- super(Server.getTeamAdministrationService(), new Team());
+ super(ApplicationContext.getService(TeamAdministration.class), new
Team());
initialize();
setSize(new Dimension(640, 480));
setLocationRelativeTo(null);
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/main/MatchAdministrationPanel.java
Sat Feb 27 06:56:25 2010
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/main/MatchAdministrationPanel.java
Thu Mar 4 02:25:49 2010
@@ -25,7 +25,8 @@
import org.mozzes.application.example.common.domain.Match;
import org.mozzes.application.example.common.domain.Result;
import org.mozzes.application.example.common.domain.Team;
-import org.mozzes.application.example.swing.Server;
+import org.mozzes.application.example.common.service.MatchAdministration;
+import org.mozzes.application.example.swing.ApplicationContext;
import org.mozzes.application.example.swing.gui.AbstractCRUDPanel;
import org.mozzes.application.example.swing.gui.edit.MatchCreateEditDialog;
import org.mozzes.swing.mgf.datamodel.DataModel;
@@ -37,15 +38,15 @@
private static final long serialVersionUID = 1L;
public MatchAdministrationPanel() {
- super(Server.getMatchAdministrationService(), new
MatchCreateEditDialog());
+ super(ApplicationContext.getService(MatchAdministration.class), new
MatchCreateEditDialog());
}
@Override
protected void initModel(DataModel<Match> model) {
- model.addField(new PropertyField<Match,
Team>(Team.class, "homeTeam", "Domacin"));
- model.addField(new PropertyField<Match,
Team>(Team.class, "visitorTeam", "Gost"));
- model.addField(new PropertyField<Match,
Date>(Date.class, "startTime", "Vreme pocetka"));
- model.addField(new PropertyField<Match,
Result>(Result.class, "result", "Rezultat"));
+ model.addField(new PropertyField<Match,
Team>(Team.class, "homeTeam", "Home team"));
+ model.addField(new PropertyField<Match,
Team>(Team.class, "visitorTeam", "Visitor team"));
+ model.addField(new PropertyField<Match,
Date>(Date.class, "startTime", "Start time"));
+ model.addField(new PropertyField<Match,
Result>(Result.class, "result", "Result"));
}
}
=======================================
---
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/main/TeamAdministrationPanel.java
Sat Feb 27 06:56:25 2010
+++
/trunk/mozzesApplication/mozzesApplicationExample/mozzesApplicationExampleSwingClient/src/main/java/org/mozzes/application/example/swing/gui/main/TeamAdministrationPanel.java
Thu Mar 4 02:25:49 2010
@@ -21,7 +21,8 @@
package org.mozzes.application.example.swing.gui.main;
import org.mozzes.application.example.common.domain.Team;
-import org.mozzes.application.example.swing.Server;
+import org.mozzes.application.example.common.service.TeamAdministration;
+import org.mozzes.application.example.swing.ApplicationContext;
import org.mozzes.application.example.swing.gui.AbstractCRUDPanel;
import org.mozzes.application.example.swing.gui.edit.TeamCreateEditDialog;
import org.mozzes.swing.mgf.datamodel.DataModel;
@@ -32,12 +33,12 @@
private static final long serialVersionUID = 1L;
public TeamAdministrationPanel() {
- super(Server.getTeamAdministrationService(), new TeamCreateEditDialog());
+ super(ApplicationContext.getService(TeamAdministration.class), new
TeamCreateEditDialog());
}
@Override
protected void initModel(DataModel<Team> model) {
- model.addField(new PropertyField<Team,
String>(String.class, "name", "Naziv"));
- model.addField(new PropertyField<Team,
String>(String.class, "webAddress", "Web adresa"));
+ model.addField(new PropertyField<Team,
String>(String.class, "name", "Name"));
+ model.addField(new PropertyField<Team,
String>(String.class, "webAddress", "Web address"));
}
}