[Japi-cvs] SF.net SVN: japi:[642] progs
Status: Beta
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2008-10-06 12:36:25
|
Revision: 642
http://japi.svn.sourceforge.net/japi/?rev=642&view=rev
Author: christianhujer
Date: 2008-10-06 12:36:01 +0000 (Mon, 06 Oct 2008)
Log Message:
-----------
Added module for batcher prototype.
Added Paths:
-----------
progs/batcher/
progs/batcher/trunk/
progs/batcher/trunk/Batcher.iml
progs/batcher/trunk/src/
progs/batcher/trunk/src/net/
progs/batcher/trunk/src/net/sf/
progs/batcher/trunk/src/net/sf/japi/
progs/batcher/trunk/src/net/sf/japi/progs/
progs/batcher/trunk/src/net/sf/japi/progs/batcher/
progs/batcher/trunk/src/net/sf/japi/progs/batcher/Main.java
progs/batcher/trunk/src/net/sf/japi/progs/batcher/action.properties
Added: progs/batcher/trunk/Batcher.iml
===================================================================
--- progs/batcher/trunk/Batcher.iml (rev 0)
+++ progs/batcher/trunk/Batcher.iml 2008-10-06 12:36:01 UTC (rev 642)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="annotations" level="project" />
+ <orderEntry type="library" name="jlfgr-1_0" level="project" />
+ <orderEntry type="library" name="junit" level="project" />
+ <orderEntry type="module" module-name="libs-swing-about" />
+ <orderEntry type="module" module-name="libs-swing-action" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Property changes on: progs/batcher/trunk/Batcher.iml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:eol-style
+ LF
Added: progs/batcher/trunk/src/net/sf/japi/progs/batcher/Main.java
===================================================================
--- progs/batcher/trunk/src/net/sf/japi/progs/batcher/Main.java (rev 0)
+++ progs/batcher/trunk/src/net/sf/japi/progs/batcher/Main.java 2008-10-06 12:36:01 UTC (rev 642)
@@ -0,0 +1,66 @@
+package net.sf.japi.progs.batcher;
+
+import java.awt.Frame;
+import java.awt.Toolkit;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import javax.swing.JFrame;
+import javax.swing.WindowConstants;
+import net.sf.japi.swing.ActionBuilder;
+import net.sf.japi.swing.ActionBuilderFactory;
+import net.sf.japi.swing.ActionMethod;
+import org.jetbrains.annotations.NotNull;
+
+/** Main class of Batcher
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class Main {
+
+ /** Action Builder. */
+ @NotNull
+ private static final ActionBuilder actionBuilder = ActionBuilderFactory.getInstance().getActionBuilder(Main.class);
+
+ /**
+ * Main program.
+ * @param args Command line arguments (ignored).
+ */
+ public static void main(final String... args){
+ new Main();
+ }
+
+ /** The program frame. */
+ private final JFrame frame;
+
+ /** Creates Main. */
+ public Main() {
+ frame = new JFrame(actionBuilder.getString("window.title"));
+ frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+ frame.setJMenuBar(actionBuilder.createMenuBar(true, "Main", this));
+ frame.setSize(Toolkit.getDefaultToolkit().getScreenSize());
+ frame.setExtendedState(Frame.MAXIMIZED_BOTH);
+ frame.addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(final WindowEvent e) {
+ quit();
+ }
+ });
+ frame.setVisible(true);
+ }
+
+ /** Quits the program. */
+ @ActionMethod
+ public void quit() {
+ if (isQuitRequested()) {
+ frame.setVisible(false);
+ frame.dispose();
+ }
+ }
+
+ /** Asks whether quitting is requested.
+ * @return <code>true</code> if quitting is requested, otherwise <code>false</code>.
+ */
+ public boolean isQuitRequested() {
+ return actionBuilder.showQuestionDialog(frame, "reallyQuit");
+ }
+
+} // class Main
Property changes on: progs/batcher/trunk/src/net/sf/japi/progs/batcher/Main.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: progs/batcher/trunk/src/net/sf/japi/progs/batcher/action.properties
===================================================================
--- progs/batcher/trunk/src/net/sf/japi/progs/batcher/action.properties (rev 0)
+++ progs/batcher/trunk/src/net/sf/japi/progs/batcher/action.properties 2008-10-06 12:36:01 UTC (rev 642)
@@ -0,0 +1,9 @@
+window.title=Batcher
+Main.menubar=file
+file.menu=quit
+file.text=File
+file.mnemonic=F
+quit.text=Quit
+quit.mnemonic=Q
+reallyQuit.message=Do you really want to quit this program?
+reallyQuit.title=Quit Batcher
Property changes on: progs/batcher/trunk/src/net/sf/japi/progs/batcher/action.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|