From aa335f2a1986353cb757dbbcb6255bab448dc99f Mon Sep 17 00:00:00 2001 From: mkersten Date: Tue, 23 Mar 2004 09:45:08 +0000 Subject: Working ajdoc to that generates advice links, with tests for generating spacewar documentation. --- ajdoc/src/org/aspectj/tools/ajdoc/Declaration.java | 9 +- .../src/org/aspectj/tools/ajdoc/HtmlDecorator.java | 447 +++----- .../org/aspectj/tools/ajdoc/JavadocExecutor.java | 3 + ajdoc/src/org/aspectj/tools/ajdoc/Main.java | 1 - ajdoc/src/org/aspectj/tools/ajdoc/SourceLine.java | 54 - .../src/org/aspectj/tools/ajdoc/StructureUtil.java | 19 + .../org/aspectj/tools/ajdoc/StubFileGenerator.java | 154 +-- .../src/org/aspectj/tools/ajdoc/SymbolManager.java | 120 +- ajdoc/testdata/simple/foo/AspectA.java | 17 + ajdoc/testdata/simple/foo/ClassA.java | 4 + ajdoc/testdata/spacewar/.classpath | 7 + ajdoc/testdata/spacewar/.cvsignore | 1 + ajdoc/testdata/spacewar/.project | 18 + .../testdata/spacewar/coordination/Condition.java | 37 + .../spacewar/coordination/CoordinationAction.java | 37 + .../spacewar/coordination/Coordinator.java | 449 ++++++++ .../testdata/spacewar/coordination/Exclusion.java | 33 + .../spacewar/coordination/MethodState.java | 45 + ajdoc/testdata/spacewar/coordination/Mutex.java | 86 ++ ajdoc/testdata/spacewar/coordination/Selfex.java | 55 + .../spacewar/coordination/TimeoutException.java | 27 + ajdoc/testdata/spacewar/coordination/lib.lst | 8 + ajdoc/testdata/spacewar/doc/allclasses-frame.html | 96 ++ .../testdata/spacewar/doc/allclasses-noframe.html | 96 ++ ajdoc/testdata/spacewar/doc/constant-values.html | 200 ++++ .../spacewar/doc/coordination/Condition.html | 216 ++++ .../doc/coordination/CoordinationAction.html | 216 ++++ .../spacewar/doc/coordination/Coordinator.html | 614 ++++++++++ .../spacewar/doc/coordination/Exclusion.html | 282 +++++ .../testdata/spacewar/doc/coordination/Method.html | 334 ++++++ .../spacewar/doc/coordination/MethodState.html | 333 ++++++ .../testdata/spacewar/doc/coordination/Mutex.html | 411 +++++++ .../testdata/spacewar/doc/coordination/Selfex.html | 411 +++++++ .../doc/coordination/TimeoutException.html | 284 +++++ .../spacewar/doc/coordination/package-frame.html | 66 ++ .../spacewar/doc/coordination/package-summary.html | 1 + .../spacewar/doc/coordination/package-tree.html | 155 +++ ajdoc/testdata/spacewar/doc/deprecated-list.html | 132 +++ ajdoc/testdata/spacewar/doc/help-doc.html | 187 +++ ajdoc/testdata/spacewar/doc/index-all.html | 1 + ajdoc/testdata/spacewar/doc/index.html | 26 + ajdoc/testdata/spacewar/doc/overview-frame.html | 44 + ajdoc/testdata/spacewar/doc/overview-summary.html | 146 +++ ajdoc/testdata/spacewar/doc/overview-tree.html | 182 +++ ajdoc/testdata/spacewar/doc/package-list | 2 + ajdoc/testdata/spacewar/doc/packages.html | 31 + ajdoc/testdata/spacewar/doc/resources/inherit.gif | Bin 0 -> 57 bytes ajdoc/testdata/spacewar/doc/serialized-form.html | 1 + ajdoc/testdata/spacewar/doc/spacewar/Bullet.html | 627 +++++++++++ ajdoc/testdata/spacewar/doc/spacewar/Debug.html | 356 ++++++ .../doc/spacewar/Display.DisplayAspect.html | 276 +++++ ajdoc/testdata/spacewar/doc/spacewar/Display.html | 646 +++++++++++ .../doc/spacewar/Display1.SpaceObjectPainting.html | 244 ++++ ajdoc/testdata/spacewar/doc/spacewar/Display1.html | 709 ++++++++++++ .../doc/spacewar/Display2.SpaceObjectPainting.html | 244 ++++ ajdoc/testdata/spacewar/doc/spacewar/Display2.html | 709 ++++++++++++ .../spacewar/doc/spacewar/EnergyPacket.html | 649 +++++++++++ .../doc/spacewar/EnergyPacketProducer.html | 360 ++++++ .../spacewar/doc/spacewar/EnsureShipIsAlive.html | 241 ++++ ajdoc/testdata/spacewar/doc/spacewar/Game.html | 659 +++++++++++ .../spacewar/doc/spacewar/GameSynchronization.html | 249 ++++ ajdoc/testdata/spacewar/doc/spacewar/InfoWin.html | 302 +++++ .../testdata/spacewar/doc/spacewar/KeyMapping.html | 365 ++++++ ajdoc/testdata/spacewar/doc/spacewar/Pilot.html | 369 ++++++ ajdoc/testdata/spacewar/doc/spacewar/Player.html | 448 ++++++++ .../spacewar/Registry.RegistrationProtection.html | 244 ++++ ajdoc/testdata/spacewar/doc/spacewar/Registry.html | 457 ++++++++ .../doc/spacewar/RegistrySynchronization.html | 249 ++++ ajdoc/testdata/spacewar/doc/spacewar/Robot.html | 474 ++++++++ ajdoc/testdata/spacewar/doc/spacewar/SWFrame.html | 494 ++++++++ ajdoc/testdata/spacewar/doc/spacewar/Ship.html | 1186 ++++++++++++++++++++ .../spacewar/doc/spacewar/SpaceObject.html | 616 ++++++++++ ajdoc/testdata/spacewar/doc/spacewar/Timer.html | 314 ++++++ .../spacewar/doc/spacewar/package-frame.html | 80 ++ .../spacewar/doc/spacewar/package-summary.html | 1 + .../spacewar/doc/spacewar/package-tree.html | 171 +++ ajdoc/testdata/spacewar/doc/stylesheet.css | 29 + ajdoc/testdata/spacewar/spacewar/.cvsignore | 1 + ajdoc/testdata/spacewar/spacewar/Bullet.java | 48 + ajdoc/testdata/spacewar/spacewar/Debug.java | 219 ++++ ajdoc/testdata/spacewar/spacewar/Display.java | 166 +++ ajdoc/testdata/spacewar/spacewar/Display1.java | 203 ++++ ajdoc/testdata/spacewar/spacewar/Display2.java | 138 +++ ajdoc/testdata/spacewar/spacewar/EnergyPacket.java | 44 + .../spacewar/spacewar/EnergyPacketProducer.java | 63 ++ .../spacewar/spacewar/EnsureShipIsAlive.java | 35 + ajdoc/testdata/spacewar/spacewar/Game.java | 215 ++++ .../spacewar/spacewar/GameSynchronization.java | 54 + ajdoc/testdata/spacewar/spacewar/Pilot.java | 44 + ajdoc/testdata/spacewar/spacewar/Player.java | 122 ++ ajdoc/testdata/spacewar/spacewar/Registry.java | 126 +++ .../spacewar/spacewar/RegistrySynchronization.java | 58 + ajdoc/testdata/spacewar/spacewar/Robot.java | 201 ++++ ajdoc/testdata/spacewar/spacewar/SWFrame.java | 92 ++ ajdoc/testdata/spacewar/spacewar/Ship.java | 296 +++++ ajdoc/testdata/spacewar/spacewar/SpaceObject.java | 106 ++ ajdoc/testdata/spacewar/spacewar/Timer.java | 53 + ajdoc/testdata/spacewar/spacewar/debug.lst | 2 + ajdoc/testdata/spacewar/spacewar/demo.lst | 19 + .../org/aspectj/tools/ajdoc/MainTestCase.java | 8 +- .../org/aspectj/tools/ajdoc/SpacewarTestCase.java | 48 + 101 files changed, 19679 insertions(+), 548 deletions(-) delete mode 100644 ajdoc/src/org/aspectj/tools/ajdoc/SourceLine.java create mode 100644 ajdoc/testdata/simple/foo/AspectA.java create mode 100644 ajdoc/testdata/spacewar/.classpath create mode 100644 ajdoc/testdata/spacewar/.cvsignore create mode 100644 ajdoc/testdata/spacewar/.project create mode 100644 ajdoc/testdata/spacewar/coordination/Condition.java create mode 100644 ajdoc/testdata/spacewar/coordination/CoordinationAction.java create mode 100644 ajdoc/testdata/spacewar/coordination/Coordinator.java create mode 100644 ajdoc/testdata/spacewar/coordination/Exclusion.java create mode 100644 ajdoc/testdata/spacewar/coordination/MethodState.java create mode 100644 ajdoc/testdata/spacewar/coordination/Mutex.java create mode 100644 ajdoc/testdata/spacewar/coordination/Selfex.java create mode 100644 ajdoc/testdata/spacewar/coordination/TimeoutException.java create mode 100644 ajdoc/testdata/spacewar/coordination/lib.lst create mode 100644 ajdoc/testdata/spacewar/doc/allclasses-frame.html create mode 100644 ajdoc/testdata/spacewar/doc/allclasses-noframe.html create mode 100644 ajdoc/testdata/spacewar/doc/constant-values.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/Condition.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/CoordinationAction.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/Coordinator.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/Exclusion.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/Method.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/MethodState.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/Mutex.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/Selfex.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/TimeoutException.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/package-frame.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/package-summary.html create mode 100644 ajdoc/testdata/spacewar/doc/coordination/package-tree.html create mode 100644 ajdoc/testdata/spacewar/doc/deprecated-list.html create mode 100644 ajdoc/testdata/spacewar/doc/help-doc.html create mode 100644 ajdoc/testdata/spacewar/doc/index-all.html create mode 100644 ajdoc/testdata/spacewar/doc/index.html create mode 100644 ajdoc/testdata/spacewar/doc/overview-frame.html create mode 100644 ajdoc/testdata/spacewar/doc/overview-summary.html create mode 100644 ajdoc/testdata/spacewar/doc/overview-tree.html create mode 100644 ajdoc/testdata/spacewar/doc/package-list create mode 100644 ajdoc/testdata/spacewar/doc/packages.html create mode 100644 ajdoc/testdata/spacewar/doc/resources/inherit.gif create mode 100644 ajdoc/testdata/spacewar/doc/serialized-form.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Bullet.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Debug.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Display.DisplayAspect.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Display.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Display1.SpaceObjectPainting.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Display1.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Display2.SpaceObjectPainting.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Display2.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/EnergyPacket.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/EnergyPacketProducer.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/EnsureShipIsAlive.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Game.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/GameSynchronization.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/InfoWin.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/KeyMapping.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Pilot.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Player.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Registry.RegistrationProtection.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Registry.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/RegistrySynchronization.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Robot.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/SWFrame.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Ship.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/SpaceObject.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/Timer.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/package-frame.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/package-summary.html create mode 100644 ajdoc/testdata/spacewar/doc/spacewar/package-tree.html create mode 100644 ajdoc/testdata/spacewar/doc/stylesheet.css create mode 100644 ajdoc/testdata/spacewar/spacewar/.cvsignore create mode 100644 ajdoc/testdata/spacewar/spacewar/Bullet.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Debug.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Display.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Display1.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Display2.java create mode 100644 ajdoc/testdata/spacewar/spacewar/EnergyPacket.java create mode 100644 ajdoc/testdata/spacewar/spacewar/EnergyPacketProducer.java create mode 100644 ajdoc/testdata/spacewar/spacewar/EnsureShipIsAlive.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Game.java create mode 100644 ajdoc/testdata/spacewar/spacewar/GameSynchronization.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Pilot.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Player.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Registry.java create mode 100644 ajdoc/testdata/spacewar/spacewar/RegistrySynchronization.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Robot.java create mode 100644 ajdoc/testdata/spacewar/spacewar/SWFrame.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Ship.java create mode 100644 ajdoc/testdata/spacewar/spacewar/SpaceObject.java create mode 100644 ajdoc/testdata/spacewar/spacewar/Timer.java create mode 100644 ajdoc/testdata/spacewar/spacewar/debug.lst create mode 100644 ajdoc/testdata/spacewar/spacewar/demo.lst create mode 100644 ajdoc/testsrc/org/aspectj/tools/ajdoc/SpacewarTestCase.java diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/Declaration.java b/ajdoc/src/org/aspectj/tools/ajdoc/Declaration.java index a68ad3be7..54f622654 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/Declaration.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/Declaration.java @@ -25,6 +25,11 @@ import java.util.*; // This lets us generate serialized files which interoperate with other code better import java.util.Vector; +import org.aspectj.asm.IProgramElement; + +/** + * @author Mik Kersten + */ public class Declaration implements Serializable { private int beginLine; private int endLine; @@ -246,7 +251,7 @@ public class Declaration implements Serializable { public boolean isType() { - return getKind().equals("interface") || getKind().equals("class"); + return getKind().equals("interface") || getKind().equals("class") || getKind().equals("aspect"); } public boolean hasBody() { @@ -254,7 +259,7 @@ public class Declaration implements Serializable { return kind.equals("class") || kind.endsWith("constructor") || (kind.endsWith("method") && getModifiers().indexOf("abstract") == -1 && getModifiers().indexOf("native") == -1); - } + } public boolean isIntroduced() { return kind.startsWith("introduced-"); diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java index 7bfa544d9..26eb12728 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java @@ -21,6 +21,9 @@ import org.aspectj.asm.AsmManager; import org.aspectj.asm.IProgramElement; import org.aspectj.asm.IRelationship; +/** + * @author Mik Kersten + */ class HtmlDecorator { static List visibleFileList = new ArrayList(); @@ -37,6 +40,7 @@ class HtmlDecorator { declIDTable = table; symbolManager = sm; for (int i = 0; i < inputFiles.length; i++) { + decorateHTMLFromDecls(symbolManager.getDeclarations(inputFiles[i].getCanonicalPath()), rootDir.getCanonicalPath() + Config.DIR_SEP_CHAR, docModifier, @@ -75,10 +79,9 @@ class HtmlDecorator { (docModifier.equals( "protected" ) && (decl.getModifiers().indexOf( "protected" ) != -1 || decl.getModifiers().indexOf( "public" ) != -1 )) || (docModifier.equals( "public" ) && decl.getModifiers().indexOf( "public" ) != -1) ) { - visibleFileList.add( getName( decl ) ); + visibleFileList.add(decl.getSignature()); String packageName = decl.getPackageName(); String filename = ""; - //System.out.println(">>>" + decl.getDeclaringType() + ", " + base); if ( packageName != null ) { int index1 = base.lastIndexOf(Config.DIR_SEP_CHAR); int index2 = base.lastIndexOf("."); @@ -95,27 +98,26 @@ class HtmlDecorator { } filename = newBase + Config.DIR_SEP_CHAR + packageName + Config.DIR_SEP_CHAR + currFileClass + //"." + - getName(decl) + ".html"; + decl.getSignature() + ".html"; nestedClass = true; - } - else { + } else { packageName = packageName.replace( '.','/' ); // !!! - filename = base + packageName + Config.DIR_SEP_CHAR + getName(decl) + ".html"; + filename = base + packageName + Config.DIR_SEP_CHAR + decl.getSignature() + ".html"; } } else { - filename = base + getName(decl) + ".html"; + filename = base + decl.getSignature() + ".html"; } if (!exceededNestingLevel) { decorateHTMLFile(new File(filename)); decorateHTMLFromDecls(decl.getDeclarations(), - base + getName(decl) + ".", + base + decl.getSignature() + ".", docModifier, nestedClass); } else { System.out.println("Warning: can not generate documentation for nested " + - "inner class: " + getName(decl) ); + "inner class: " + decl.getSignature() ); } } } @@ -156,7 +158,7 @@ class HtmlDecorator { if ( decl == null ) break; fileContents.delete(start, end + Config.DECL_ID_TERMINATOR.length()); - if ( decl.getKind().isTypeKind() ) { + if ( decl.getKind().isType() ) { isSecond = true; // addIntroductionDocumentation(decl, fileContents, index); // addAdviceDocumentation(decl, fileContents, index); @@ -168,15 +170,16 @@ class HtmlDecorator { else { decorateMemberDocumentation(decl, fileContents, index); } - } - + } + // Change "Class" to "Aspect", HACK: depends on "affects:" - if (fileContents.toString().indexOf("affects: ") != -1) { - int classStartIndex = fileContents.toString().indexOf("
\nClass "); + int classStartIndex = fileContents.toString().indexOf("
\nClass"); + if (classStartIndex != -1 && + fileContents.toString().indexOf("Advises:") != -1) { int classEndIndex = fileContents.toString().indexOf("", classStartIndex); - if (classStartIndex != -1 && classEndIndex != -1) { + if (classStartIndex != -1 && classEndIndex != -1) { String classLine = fileContents.toString().substring(classStartIndex, classEndIndex); - String aspectLine = "
\n" + "Aspect" + classLine.substring(11, classLine.length()); + String aspectLine = "
\n" + "Aspect " + classLine.substring(11, classLine.length()); fileContents.delete(classStartIndex, classEndIndex); fileContents.insert(classStartIndex, aspectLine); } @@ -188,33 +191,30 @@ class HtmlDecorator { } static void addAspectDocumentation(IProgramElement node, StringBuffer fileBuffer, int index ) { - List relations = AsmManager.getDefault().getRelationshipMap().get(node); - System.err.println("> relations: " + relations); +// List relations = AsmManager.getDefault().getRelationshipMap().get(node); +// System.err.println("> node: " + node + ", " + "relations: " + relations); -// if ( crosscuts.length > 0 ) { -// insertDeclarationsSummary(fileBuffer, crosscuts, "Pointcut Summary", index); -// insertDeclarationsDetails(fileBuffer, crosscuts, "Pointcut Detail", index); -// } + + List pointcuts = new ArrayList(); + List advice = new ArrayList(); + for (Iterator it = node.getChildren().iterator(); it.hasNext(); ) { + IProgramElement member = (IProgramElement)it.next(); + if (member.getKind().equals(IProgramElement.Kind.POINTCUT)) { + pointcuts.add(member); + } else if (member.getKind().equals(IProgramElement.Kind.ADVICE)) { + advice.add(member); + } + } + if (pointcuts.size() > 0) { + insertDeclarationsSummary(fileBuffer, pointcuts, "Pointcut Summary", index); + insertDeclarationsDetails(fileBuffer, pointcuts, "Pointcut Detail", index); + } + if (advice.size() > 0) { + insertDeclarationsSummary(fileBuffer, advice, "Advice Summary", index); + insertDeclarationsDetails(fileBuffer, advice, "Advice Detail", index); + } } - -// static void addPointcutDocumentation(IProgramElement decl, StringBuffer fileBuffer, int index ) { -// List AsmManager.getDefault().getRelationshipMap().get() -// Declaration[] crosscuts = decl.getCrosscutDeclarations(); -// if ( crosscuts.length > 0 ) { -// insertDeclarationsSummary(fileBuffer, crosscuts, "Pointcut Summary", index); -// insertDeclarationsDetails(fileBuffer, crosscuts, "Pointcut Detail", index); -// } -// } -// -// static void addAdviceDocumentation(IProgramElement decl, StringBuffer fileBuffer, int index ) { -// Declaration[] advice = decl.getAdviceDeclarations(); -// if ( advice.length > 0 ) { -// insertDeclarationsSummary(fileBuffer, advice, "Advice Summary", index); -// insertDeclarationsDetails(fileBuffer, advice, "Advice Detail", index); -// } -// } -// // static void addIntroductionDocumentation(IProgramElement decl, // StringBuffer fileBuffer, // int index ) { @@ -232,7 +232,7 @@ class HtmlDecorator { // } static void insertDeclarationsSummary(StringBuffer fileBuffer, - Declaration[] decls, + List decls, String kind, int index) { int insertIndex = findSummaryIndex(fileBuffer, index); @@ -247,8 +247,8 @@ class HtmlDecorator { insertIndex += tableHead.length(); // insert the body of the table - for ( int i = 0; i < decls.length; i++ ) { - Declaration decl = decls[i]; + for ( int i = 0; i < decls.size(); i++ ) { + IProgramElement decl = (IProgramElement)decls.get(i); // insert the table row accordingly String comment = generateSummaryComment(decl); @@ -257,8 +257,8 @@ class HtmlDecorator { entry += "" + "" + - "advice " + decl.getCrosscutDesignator() + "
" + - generateAdviceSignatures(decl) + "
 "; + "" + generateAdviceSignatures(decl) + + "
 "; if (!comment.equals("")) { entry += comment + "

"; } @@ -269,11 +269,11 @@ class HtmlDecorator { else if ( kind.equals( "Pointcut Summary" ) ) { entry += "" + - "" + decl.getModifiers() + "" + + "" + genAccessibility(decl) + "" + "\n" + "" + "" + - decl.getSignature() + "
 "; + decl.toLabelString() + "
 "; if (!comment.equals("")) { entry += comment + "

"; } @@ -287,7 +287,7 @@ class HtmlDecorator { "" + "" + "" + - "introduction " + decl.getCrosscutDesignator() + "

" + + "introduction " + decl.toLabelString() + "

" + generateIntroductionSignatures(decl, false) + generateAffects(decl, true); } @@ -303,8 +303,16 @@ class HtmlDecorator { insertIndex += tableTail.length(); } - static void insertDeclarationsDetails(StringBuffer fileBuffer, - Declaration[] decls, + private static String genAccessibility(IProgramElement decl) { + if (decl.getAccessibility().equals(IProgramElement.Accessibility.PACKAGE)) { + return "(package private)"; + } else { + return decl.getAccessibility().toString(); + } + } + + static void insertDeclarationsDetails(StringBuffer fileBuffer, + List decls, String kind, int index) { int insertIndex = findDetailsIndex(fileBuffer, index); @@ -323,22 +331,14 @@ class HtmlDecorator { insertIndex += detailsHeading.length(); // insert the details - for ( int i = 0; i < decls.length; i++ ) { - Declaration decl = decls[i]; + for ( int i = 0; i < decls.size(); i++ ) { + IProgramElement decl = (IProgramElement)decls.get(i); String entry = ""; // insert the table row accordingly entry += "\n"; if ( kind.equals( "Advice Detail" ) ) { - String designatorHREFLink = generateDesignatorHREFLink(decl); - if (designatorHREFLink != null) { - entry += - "

advice " + designatorHREFLink + "

"; - } - else { - entry += - "

advice " + decl.getCrosscutDesignator() + "

"; - } + entry += "

" + decl.getName() + "

"; entry += "" + generateAdviceSignatures(decl) + "\n" + "

" + @@ -348,20 +348,12 @@ class HtmlDecorator { else if (kind.equals("Pointcut Detail")) { entry += "

" + - decl.getSignature() + + decl.toLabelString() + "

" + generateDetailsComment(decl); } else if (kind.equals("Introduction Detail")) { - //String designatorHREFLink = generateDesignatorHREFLink(decl); - //if (designatorHREFLink != null) { - // entry += - // "

introduction " + designatorHREFLink + "

"; - //} - //else { - entry += - "

introduction " + decl.getCrosscutDesignator() + "

"; - //} + entry += "

introduction " + decl.toLabelString() + "

"; entry += generateIntroductionSignatures(decl, true) + generateAffects(decl, true) + @@ -369,7 +361,7 @@ class HtmlDecorator { } // insert the entry - if (i != decls.length-1) { + if (i != decls.size()-1) { entry += "


\n"; } else { @@ -419,180 +411,122 @@ class HtmlDecorator { static void decorateMemberDocumentation(IProgramElement node, StringBuffer fileContentsBuffer, int index ) { -// if (decl.isIntroduced()) { -// // !!! HACK, THIS HAS TO BE CHANGED WITH THE SYMBOL MANAGER -// String fname = decl.getFilename(); -// int index1 = fname.lastIndexOf('\\'); -// int index2 = fname.lastIndexOf(".java"); -// String introducingType = fname; -// if (index1 != -1 && index2 != -1) { -// introducingType = fname.substring(index1+1, index2); -// } -// //System.out.println( "decl: " + decl.getSignature() + ", ptb: " + decl.getFilename()); -// String hrefName = ""; -// if (decl.getPackageName() != null ) { -// hrefName = decl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR + -// introducingType; -// } -// else { -// hrefName = introducingType; -// } -// String hrefLink = generateAffectsHREFLink( hrefName ); -// fileContentsBuffer.insert( index, -// "
Introduced by: " + -// "" + -// hrefName.replace('/', '.') + "" ); // !!! don't replace -// return; -// } - - List relations = AsmManager.getDefault().getRelationshipMap().get(node); - -// Declaration[] ptb = decl.getPointedToBy(); - if (relations != null && !relations.isEmpty()) { + List targets = StructureUtil.getTargets(node, IRelationship.Kind.ADVICE); + if (targets != null && !targets.isEmpty()) { String prevName = ""; - String adviceDoc = "
Advised by: "; - for (Iterator it = relations.iterator(); it.hasNext(); ) { -// for ( int i = 0; i < ptb.length; i++ ) { - IRelationship curr = (IRelationship)it.next(); -// Declaration currDecl = ptb[i]; - String hrefName = ""; + + String adviceDoc + = "" + + "
 Advised by:"; + + for (Iterator it = targets.iterator(); it.hasNext(); ) { + String currHandle = (String)it.next(); + IProgramElement currDecl = AsmManager.getDefault().getHierarchy().findElementForHandle(currHandle); + + String hrefName = ""; + String hrefLink = ""; + if (currDecl.getPackageName() != null ) { + hrefName = currDecl.getPackageName().replace('.', '/'); + hrefLink = "";//+ currDecl.getPackageName() + Config.DIR_SEP_CHAR; + } + hrefName += Config.DIR_SEP_CHAR + + currDecl.getParent().toLinkLabelString() + + "." + currDecl.getName(); + + hrefLink += currDecl.getParent().toLinkLabelString() + ".html" + + "#" + currDecl.toLabelString(); + + adviceDoc = adviceDoc + + "" + + hrefName.replace('/', '.') + ""; -// if (currDecl.getPackageName() != null ) { -// hrefName = currDecl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR + -// currDecl.getDeclaringType(); -// } -// else { -// hrefName = currDecl.getDeclaringType(); -// } -// String hrefLink = generateAffectsHREFLink( hrefName ); -// if (!hrefName.equals(prevName)) { // !!! eliminates dupilcates since it's ordered -// if ( currDecl.getKind().equals( "advice" ) ) { -// if ( i > 0 ) { -// adviceDoc = adviceDoc + ", "; -// } -// adviceDoc = adviceDoc + -// "" -// + hrefName.replace('/', '.') + ""; // !!! don't replace -// } -// } - prevName = hrefName; + if (it.hasNext()) adviceDoc += ", "; } - //adviceDoc += "
 "; + adviceDoc += "
\n"; fileContentsBuffer.insert( index, adviceDoc ); - //return lineHead + adviceDoc + lineTail; - } - else { - ;// nop return lineHead + lineTail; } } /** * TODO: probably want to make this the same for intros and advice. */ - static String generateAffects( Declaration decl, boolean isIntroduction) { - Declaration[] decls = null; - if ( isIntroduction ) { - decls = decl.getTargets(); // !!! - } - else { - decls = decl.getPointsTo(); - } - List addedDecls = new ArrayList(); - List packageList = new ArrayList(); - for ( int i = 0; i < decls.length; i++ ) { - Declaration currDecl = decls[i]; - //if ( currDecl.getDeclaringType().equals( "not$found" ) ) { - // System.out.println( "!!!!!! " + currDecl.getSignature() ); - //} - if ( currDecl != null ) { - String extendedName = ""; - String packageName = currDecl.getPackageName(); - - // !!! HACK FOR INNER CLASSES, ONLY WORKS FOR 1 LEVEL OF NESTING !!! - String declaringType = currDecl.getDeclaringType(); - if (packageName != null && !packageName.equals("")) { - if (currDecl.isType() && declaringType != null && !declaringType.equals("not$found")) { - extendedName = packageName.replace('.', '/') + Config.DIR_SEP_CHAR + declaringType + "."; - } - else { - extendedName = packageName.replace('.', '/') + Config.DIR_SEP_CHAR; - } - } - - //System.out.println("extendedName: " + extendedName); - if ( isIntroduction ) { - if ( !addedDecls.contains(currDecl.getSignature() ) ) { - //addedDecls.add(currDecl.getPackageName() + "." + currDecl.getSignature()); - addedDecls.add(extendedName + currDecl.getSignature()); - } - } - else if ( !addedDecls.contains(currDecl.getDeclaringType() ) ) { - //addedDecls.add(currDecl.getPackageName() + "." + currDecl.getDeclaringType()); - addedDecls.add(extendedName + currDecl.getDeclaringType()); - } - } - } - Collections.sort(addedDecls, - new Comparator() { - public int compare(Object o1, Object o2) { - String s1 = (String)o1; - String s2 = (String)o2; - return s1.compareTo(s2); - } - } - ); + static String generateAffects(IProgramElement decl, boolean isIntroduction) { + List targets = StructureUtil.getTargets(decl, IRelationship.Kind.ADVICE); + if (targets == null) return null; + List packageList = new ArrayList(); String entry - = "" + - "\n"; + entry += "
 affects: "; - String prevType = ""; - for ( int j = 0; j < addedDecls.size(); j++ ) { - String currType = (String)addedDecls.get(j); - // don't add duplicates - if ( !currType.equals( prevType ) && currType.indexOf("not$found") == -1 ) { //!!! - if ( j > 0 ) { - entry += ", "; - } - if ( generateAffectsHREFLink(currType) != "" ) { - entry += "" + currType.replace('/', '.') + ""; // !!! don't replace - } - else { - entry += currType; - } + = "" + + "
 Advises:"; + + for (Iterator it = targets.iterator(); it.hasNext(); ) { + String currHandle = (String)it.next(); + IProgramElement currDecl = AsmManager.getDefault().getHierarchy().findElementForHandle(currHandle); + if (currDecl.getKind().equals(IProgramElement.Kind.CODE)) { + currDecl = currDecl.getParent(); // promote to enclosing + } + if (currDecl != null) { + String packagePath = ""; + if (currDecl.getPackageName() != null && !currDecl.getPackageName().equals("")) { + packagePath = currDecl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR; + } + String linkRef = ""; + String linkName = rootDir.getAbsolutePath() + "/"; + if (currDecl.getKind().isType()) { + linkName = packagePath + currDecl.getName(); + linkRef = currDecl.toLabelString() + ".html"; + } else { + + linkName = packagePath + currDecl.getParent().getName() + "." + currDecl.getName(); + linkRef = currDecl.getParent().getName() + ".html" + "#" + currDecl.toLabelString(); +// + // XXX: only one level of nested classes + if (currDecl.getParent().getParent().getKind().isType()) { + linkRef = currDecl.getParent().getParent().getName() + "." + linkRef; + } + } + entry += "" + linkName.replace('/', '.') + ""; // !!! don't replace + if (it.hasNext()) entry += ", "; +// if ( isIntroduction ) { +// if ( !addedDecls.contains(currDecl.getSourceSignature() ) ) { +// //addedDecls.add(currDecl.getPackageName() + "." + currDecl.getSignature()); +// addedDecls.add(packageName + currDecl.getSourceSignature()); +// } +// } } - prevType = currType; } - entry += "
\n
\n\n"; return entry; } - static String generateIntroductionSignatures(Declaration decl, boolean isDetails) { - Declaration[] decls = decl.getDeclarations(); - String entry = ""; - for ( int j = 0; j < decls.length; j++ ) { - Declaration currDecl = decls[j]; - if ( currDecl != null ) { - entry += - "" + - currDecl.getSignature() + - "
"; - } - if (isDetails) { - entry += generateDetailsComment(currDecl) + "

"; - } - else { - entry += generateSummaryComment(currDecl) + "

"; - } - } - return entry; + static String generateIntroductionSignatures(IProgramElement decl, boolean isDetails) { + return ""; + // Declaration[] decls = decl.getDeclarations(); +// String entry = ""; +// for ( int j = 0; j < decls.length; j++ ) { +// Declaration currDecl = decls[j]; +// if ( currDecl != null ) { +// entry += +// "" + +// currDecl.getSignature() + +// "
"; +// } +// if (isDetails) { +// entry += generateDetailsComment(currDecl) + "

"; +// } +// else { +// entry += generateSummaryComment(currDecl) + "

"; +// } +// } +// return entry; } - static String generateAdviceSignatures( Declaration decl ) { - return "" + decl.getSignature() + ""; + static String generateAdviceSignatures(IProgramElement decl ) { + return "" + decl.toLabelString() + ""; } - static String generateSummaryComment(Declaration decl) { + static String generateSummaryComment(IProgramElement decl) { String COMMENT_INDENT = "          "; // !!! String formattedComment = getFormattedComment(decl); int periodIndex = formattedComment.indexOf( '.' ); @@ -607,12 +541,12 @@ class HtmlDecorator { } } - static String generateDetailsComment(Declaration decl) { + static String generateDetailsComment(IProgramElement decl) { return getFormattedComment(decl); } - static String generateHREFName(Declaration decl) { - String hrefLink = decl.getSignature(); // !!! + static String generateHREFName(IProgramElement decl) { + String hrefLink = decl.toLabelString(); // !!! return hrefLink; } @@ -621,12 +555,11 @@ class HtmlDecorator { * Figure out the link relative to the package. */ static String generateAffectsHREFLink(String declaringType) { - //String offset = rootDir.getAbsolutePath() + "/" + declaringType.replace('.', '/') + ".html"; String link = rootDir.getAbsolutePath() + "/" + declaringType + ".html"; - //System.out.println(">>" + link); return link; } + /** * This formats a comment according to the rules in the Java Langauge Spec: * The text of a docuemntation comment consists of the characters between @@ -637,7 +570,7 @@ class HtmlDecorator { * * TODO: implement formatting or linking for tags. */ - static String getFormattedComment(Declaration decl) { + static String getFormattedComment(IProgramElement decl) { String formattedComment = ""; // strip the comment markers @@ -683,58 +616,8 @@ class HtmlDecorator { } } catch ( IOException ioe ) { throw new Error( "Couldn't format comment for declaration: " + - decl.getSignature() ); + decl.getName() ); } return formattedComment; } - - static String generateDesignatorHREFLink(Declaration decl) { - Declaration ccutDecl = decl.getCrosscutDeclaration(); - if (ccutDecl != null) { - // !!! the following stuff should use ccutDecl - return - "" + - ccutDecl.getSignature() + ""; - } - else { - //String link = decl.getCrosscutDesignator(); - //System.out.println(">> link: " + link); - //return - // "" + - // decl.getCrosscutDesignator() + ""; - //return null; - return null; - } - } - - - // *************************************************************************** // - // ** This stuff should be in Declaration ** // - // *************************************************************************** // - - static Declaration getCrosscutDeclaration(Declaration decl) { - //String filename = "D:\\Projects\\AJDoc\\apples\\TransportAspect.java"; - //Declaration[] decls = symbolManager.getDeclarations(filename); - //decls = decls[0].getDeclarations(); - //return decls[decls.length-2]; !!! - return null; - } - - static String getName(Declaration decl) { - return decl.getSignature(); - } } - - - // - // !!! this stub only guaranteed to work for classes or interfaces - // - /* - static String getFullyQualifiedName(Declaration decl) { - if ( decl.getDeclaringType() == null ) - return getName(decl); - else - return getFullyQualifiedName(decl.getDeclaringType()) + "$" + getName(decl); - } - */ \ No newline at end of file diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/JavadocExecutor.java b/ajdoc/src/org/aspectj/tools/ajdoc/JavadocExecutor.java index bc59f3511..e654be7b0 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/JavadocExecutor.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/JavadocExecutor.java @@ -26,6 +26,9 @@ import java.io.StringReader; import java.util.*; +/** + * @author Mik Kersten + */ class JavadocExecutor { static void callJavadoc( String[] javadocargs ) { final SecurityManager defaultSecurityManager = System.getSecurityManager(); diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/Main.java b/ajdoc/src/org/aspectj/tools/ajdoc/Main.java index 34f4bb433..706b9c9be 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/Main.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/Main.java @@ -108,7 +108,6 @@ public class Main implements Config { int i = 0; for ( ; i < ajcOptions.size(); i++ ) { argsToCompiler[i] = (String)ajcOptions.elementAt(i); - //System.out.println(">>> ajc: " + argsToCompiler[i]); } for ( int j = 0; j < inputFiles.length; j++) { argsToCompiler[i] = inputFiles[j].getAbsolutePath(); diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/SourceLine.java b/ajdoc/src/org/aspectj/tools/ajdoc/SourceLine.java deleted file mode 100644 index 76a11c585..000000000 --- a/ajdoc/src/org/aspectj/tools/ajdoc/SourceLine.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Common Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * Mik Kersten port to AspectJ 1.1+ code base - * ******************************************************************/ - -package org.aspectj.tools.ajdoc; -import java.io.Serializable; -import java.io.File; - -public class SourceLine implements Serializable { - public int line; - public String filename; - //boolean hasBody; - - public SourceLine(String filename, int line) { - this.line = line; - this.filename = filename; - } - - public String getDirectory() { - return new File(filename).getParent(); - } - - public int hashCode() { - return filename.hashCode() ^ line; - } - - public boolean equals(Object other) { - if (!(other instanceof SourceLine)) return false; - - SourceLine otherLine = (SourceLine)other; - - return otherLine.line == line && otherLine.filename.equals(filename); - } - - public String toString() { - return filename + "::" + line; - } - - /** - * @return true when the method has a corresponding signature in the source code - * @return false otherwise - */ - //public boolean hasBody() { return hasBody; } -} diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/StructureUtil.java b/ajdoc/src/org/aspectj/tools/ajdoc/StructureUtil.java index ff46e3807..65b1e7d81 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/StructureUtil.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/StructureUtil.java @@ -13,14 +13,33 @@ import java.io.File; import java.util.Iterator; +import java.util.List; import org.aspectj.asm.AsmManager; import org.aspectj.asm.IProgramElement; +import org.aspectj.asm.IRelationship; /** * @author Mik Kersten */ public class StructureUtil { + + + /** + * @return null if a relationship of that kind is not found + */ + public static List/*IProgramElement*/ getTargets(IProgramElement node, IRelationship.Kind kind) { + List relations = AsmManager.getDefault().getRelationshipMap().get(node); + List targets = null; + if (relations == null) return null; + for (Iterator it = relations.iterator(); it.hasNext(); ) { + IRelationship rtn = (IRelationship)it.next(); + if (rtn.getKind().equals(kind)) { + targets = rtn.getTargets(); + } + } + return targets; + } public static String getPackageDeclarationFromFile(File file) { IProgramElement fileNode = (IProgramElement)AsmManager.getDefault().getHierarchy().findElementForSourceFile(file.getAbsolutePath()); diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java b/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java index 3553b8702..19302e5a7 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java @@ -22,6 +22,9 @@ import java.util.List; import org.aspectj.asm.AsmManager; import org.aspectj.asm.IProgramElement; +/** + * @author Mik Kersten + */ class StubFileGenerator { static Hashtable declIDTable = null; @@ -38,8 +41,6 @@ class StubFileGenerator { static void processFile(SymbolManager symbolManager, File inputFile, File signatureFile) { try { - // Declaration[] decls = symbolManager.getDeclarations(inputFile.getCanonicalPath()); - PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(signatureFile.getCanonicalPath()))); String packageName = StructureUtil.getPackageDeclarationFromFile(inputFile); @@ -78,138 +79,65 @@ class StubFileGenerator { private static void processTypeDeclaration(IProgramElement classNode, PrintWriter writer) throws IOException { -// String formalComment = classNode.getFormalComment(); -// String fullSignature = classNode.getFullSignature(); -// Declaration[] ptbs = classNode.getPointedToBy(); -// Declaration[] subs = classNode.getDeclarations(); - String formalComment = addDeclID(classNode, classNode.getFormalComment()); writer.println(formalComment); - String signature = classNode.getSourceSignature();// StructureUtil.genSignature(classNode); + String signature = getnSourcesignature(classNode);// StructureUtil.genSignature(classNode); + writer.println(signature + " {" ); processMembers(classNode.getChildren(), writer, classNode.getKind().equals(IProgramElement.Kind.INTERFACE)); writer.println(); writer.println("}"); } - private static void processMembers(List/*IProgramElement*/ members, PrintWriter writer, boolean declaringTypeIsInterface) throws IOException { + /** + * Translates "aspect" to "class" + */ + private static String getnSourcesignature(IProgramElement classNode) { + String signature = classNode.getSourceSignature(); + int index = signature.indexOf("aspect"); + if (index != -1) { + signature = signature.substring(0, index) + + "class " + + signature.substring(index + 6, signature.length()); + } + return signature; + } + + private static void processMembers(List/*IProgramElement*/ members, PrintWriter writer, boolean declaringTypeIsInterface) throws IOException { for (Iterator it = members.iterator(); it.hasNext();) { IProgramElement member = (IProgramElement) it.next(); - if (member.getKind().isTypeKind()) { + if (member.getKind().isType() + && !member.getParent().getKind().equals(IProgramElement.Kind.METHOD)) { processTypeDeclaration(member, writer); } else { String formalComment = addDeclID(member, member.getFormalComment());; writer.println(formalComment); - String signature = member.getSourceSignature();//StructureUtil.genSignature(member); - writer.print(signature); - if (member.getKind().equals(IProgramElement.Kind.METHOD)) { + String signature = ""; + if (!member.getKind().equals(IProgramElement.Kind.POINTCUT) + && !member.getKind().equals(IProgramElement.Kind.ADVICE) ) { + signature = member.getSourceSignature();//StructureUtil.genSignature(member); + } + if (signature != null && + !member.getKind().isInterTypeMember()) { + writer.print(signature); + } else { +// System.err.println(">> skipping: " + member.getKind()); + } + + if (member.getKind().equals(IProgramElement.Kind.METHOD) || + member.getKind().equals(IProgramElement.Kind.CONSTRUCTOR)) { writer.println(" { }"); } else if (member.getKind().equals(IProgramElement.Kind.FIELD)) { - writer.println(";"); +// writer.println(";"); } } } } -// static void processClassDeclarations(IProgramElement fileNode, -// PrintWriter writer, -// boolean declaringDeclIsInterface) throws IOException { -//for (Iterator it = fileNode.getChildren().iterator(); it.hasNext(); ) { -//IProgramElement node = (IProgramElement)it.next(); -//proc -//} -//for (int i = 0; i < decls.length; i++) { -//Declaration decl = decls[i]; -// -////System.out.println( ">> sig: " + decl.getSignature() ); -//doDecl(decl, writer, declaringDeclIsInterface); -//} -//} - - -// -// if (decl.hasSignature()) { -// formalComment = addDeclID(decl, formalComment); -// -// writer.println(formalComment); -// -// // HACK: this should be in Declaration -// int implementsClauseIndex = fullSignature.indexOf(" implements"); -// if (implementsClauseIndex != -1) { -// String newSignature = ""; -// StringTokenizer st = new StringTokenizer(fullSignature.substring(implementsClauseIndex, fullSignature.length())); -// for (String element = (String)st.nextElement(); st.hasMoreElements(); element = (String)st.nextElement()) { -// if (element.indexOf("$MightHaveAspect") != -1 -// && element.indexOf("implements") != -1) { -// newSignature += element; -// } -// } -// if (!newSignature.equals("")) { -// writer.print(fullSignature.substring(0, implementsClauseIndex) -// + " implements " + newSignature + " " ); -// } else { -// writer.print(fullSignature.substring(0, implementsClauseIndex) + " " ); -// } -// } else { -// writer.print(fullSignature + " " ); -// } -// -// -// if ((!decl.hasBody() && !decl.getKind().equals( "interface" ) || -// (decl.getKind().equals( "method" ) && declaringDeclIsInterface)) && // !!! bug in Jim's API? -// !(decl.getKind().equals("initializer") && decl.getModifiers().indexOf("static") != -1 ) ) { -// -// if (decl.getModifiers().indexOf("static final") != -1) { -// String fullSig = decl.getFullSignature().trim(); -// String stripped = fullSig.substring(0, fullSig.lastIndexOf(' ')); -// String type = stripped.substring(stripped.lastIndexOf(' '), stripped.length()); -// -// if (type.equals("boolean")) { -// writer.println(" = false"); -// } else if (type.equals("char")) { -// writer.println(" = '0'"); -// } else if (type.equals("byte")) { -// writer.println(" = 0"); -// } else if (type.equals("short")) { -// writer.println(" = 0"); -// } else if (type.equals("int")) { -// writer.println(" = 0"); -// } else if (type.equals("long")) { -// writer.println(" = 0"); -// } else if (type.equals("float")) { -// writer.println(" = 0"); -// } else if (type.equals("double")) { -// writer.println(" = 0"); -// } else if (type.equals("String")) { -// writer.println(" = \"\""); -// } else { -// writer.println(" = null"); -// } -// } -// writer.println(";"); -//// } else if ((!decl.hasBody() && !decl.getKind().equals( "interface" ) || -//// (decl.getKind().equals( "method" ) && declaringDeclIsInterface)) && // !!! bug in Jim's API? -//// !(decl.getKind().equals("initializer") && decl.getModifiers().indexOf("static") != -1 ) ) { -//// -//// writer.println(";"); -// -// } else { -// if (subs != null) { -// if ( decl.getKind().equals( "interface" ) ) { -// declaringDeclIsInterface = true; -// } -// writer.println("{"); -// processDeclarations(subs, writer, declaringDeclIsInterface); -// writer.println("}"); -// } -// } -// writer.println(); -// } - static int nextDeclID = 0; static String addDeclID(IProgramElement decl, String formalComment) { String declID = "" + ++nextDeclID; @@ -238,18 +166,10 @@ class StubFileGenerator { int atsignPos = formalComment.indexOf('@'); int endPos = formalComment.indexOf("*/"); int periodPos = formalComment.indexOf("/**")+2; - //if ( atsignPos == -1 ) { - // periodPos = formalComment.lastIndexOf("."); - //} else { - // periodPos = formalComment.substring(0, atsignPos).lastIndexOf("."); - //} int position = 0; String periodPlaceHolder = ""; if ( periodPos != -1 ) { position = periodPos+1; - //if ( appendPeriod ) { - //periodPlaceHolder = "#"; - //} } else if ( atsignPos != -1 ) { string = string + "\n * "; diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/SymbolManager.java b/ajdoc/src/org/aspectj/tools/ajdoc/SymbolManager.java index 6c1a0dcbb..5e58d7fda 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/SymbolManager.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/SymbolManager.java @@ -19,100 +19,17 @@ import java.util.*; import org.aspectj.asm.*; - - - +/** + * @author Mik Kersten + */ public class SymbolManager { -// public static File mapFilenameToSymbolFile(String filename) { -// return mapFilenameToNewExtensionFile(filename, SYMBOL_FILE_EXTENSION); -// } -// -// public static File mapFilenameToSourceLinesFile(String filename) { -// return mapFilenameToNewExtensionFile(filename, SOURCE_LINES_FILE_EXTENSION); -// } -// -// public static File getSourceToOutputFile(String dirname) { -// return new File(dirname, ".ajsline"); -// } -// -// public static File getOutputToSourceFile(String dirname) { -// return new File(dirname, ".ajoline"); -// } - -// -// private static File mapFilenameToNewExtensionFile(String filename, String ext) { -// int lastDot = filename.lastIndexOf('.'); -// String basename = filename; -// if (lastDot != -1) { -// basename = basename.substring(0, lastDot); -// } -// -// return new File(basename+ext); -// } - private static SymbolManager INSTANCE = new SymbolManager(); public static SymbolManager getDefault() { return INSTANCE; } - /** - * @param filePath the full path to the preprocessed source file - * @param lineNumber line number in the preprocessed source file - * @return the SourceLine corresponding to the original file/line - * @see SourceLine - */ - public SourceLine mapToSourceLine(String filePath, int lineNumber) { - System.err.println("> mapping: " + filePath); - return null; -// Map map = lookupOutputToSource(filePath); -// -// if (map == null) return null; -// -// return (SourceLine)map.get(new SourceLine(filePath, lineNumber)); - } - - - /** - * @param filePath the full path to the original source file - * @param lineNumber line number in the original source file - * @return the SourceLine corresponding to the preprocessed file/line - * @see SourceLine - */ - public SourceLine mapToOutputLine(String filePath, int lineNumber) { - return null; -// Map map = lookupSourceToOutput(filePath); -// -// if (map == null) return null; -// -// return (SourceLine)map.get(new SourceLine(filePath, lineNumber)); - } - - - - /**** - public int mapToOutputLine(String filename, int line) { - Vector sourceLines = lookupSourceLines(filename); - - // do linear search here - if (sourceLines == null) return -1; - - for(int outputLine = 0; outputLine < sourceLines.size(); outputLine++) { - SourceLine sl = (SourceLine)sourceLines.elementAt(outputLine); - - if (sl == null) continue; - if (sl.line == line) { - String outputRoot = new File(filename).getName(); - String sourceRoot = new File(sl.filename).getName(); - if (outputRoot.equals(sourceRoot)) return outputLine + 1; - } - } - - return -1; - } - ****/ - /** * TODO: only works for one class @@ -133,14 +50,17 @@ public class SymbolManager { file.walk(walker); - System.err.println("> got: " + nodes); +// System.err.println("> got: " + nodes); return (Declaration[])nodes.toArray(new Declaration[nodes.size()]); // return lookupDeclarations(filename); } private boolean accept(IProgramElement node) { - return !node.getKind().equals(IProgramElement.Kind.IMPORT_REFERENCE); + return + !node.getKind().equals(IProgramElement.Kind.IMPORT_REFERENCE) + && !(node.getKind().isType() && + node.getParent().getKind().equals(IProgramElement.Kind.METHOD)); } private Declaration buildDecl(IProgramElement node) { @@ -168,7 +88,16 @@ public class SymbolManager { } signature += node.toSignatureString(); -// System.err.println(">>>> " + signature); + + String name = node.getName(); + if (node.getKind().isType()) { + name = genPartiallyQualifiedName(node, node.getName()); + } + + String declaringType = node.getParent().getName(); +// if (!node.getKind().isType()) { +// declaringType = node.getParent().getName(); +// } Declaration dec = new Declaration( node.getSourceLocation().getLine(), @@ -176,7 +105,7 @@ public class SymbolManager { node.getSourceLocation().getColumn(), -1, modifiers, - node.getName(), + name, signature, "", // crosscut designator node.getDeclaringType(), @@ -195,7 +124,16 @@ public class SymbolManager { // return getDeclarationAtPoint(filename, line, -1); // } - public Declaration getDeclarationAtPoint(String filename, int line, int column) { + private String genPartiallyQualifiedName(IProgramElement node, String name) { +// if (node.getParent() != null) System.err.println("%%% " + node.getParent()); + if (node.getParent() != null && node.getParent().getKind().isType()) { + name = node.getParent().getName() + '.' + name; + genPartiallyQualifiedName(node.getParent(), name); + } + return name; + } + + public Declaration getDeclarationAtPoint(String filename, int line, int column) { Declaration[] declarations = lookupDeclarations(filename); //System.out.println("getting "+filename+", "+line+":"+column); diff --git a/ajdoc/testdata/simple/foo/AspectA.java b/ajdoc/testdata/simple/foo/AspectA.java new file mode 100644 index 000000000..2f03301db --- /dev/null +++ b/ajdoc/testdata/simple/foo/AspectA.java @@ -0,0 +1,17 @@ + +package foo; + +public aspect AspectA { + + int foo; + + pointcut mumblePointcut(): execution(* ClassA.*(..)); + + before(): mumblePointcut() { + System.err.println("yo"); + } + + after(): mumblePointcut() { + System.err.println("yo"); + } +} \ No newline at end of file diff --git a/ajdoc/testdata/simple/foo/ClassA.java b/ajdoc/testdata/simple/foo/ClassA.java index 76bc4588e..1b357a788 100644 --- a/ajdoc/testdata/simple/foo/ClassA.java +++ b/ajdoc/testdata/simple/foo/ClassA.java @@ -21,6 +21,10 @@ public abstract class ClassA implements InterfaceI { } public void foo() { } + + static aspect InnerAspect { + String s; + } } class SubClass extends ClassA { diff --git a/ajdoc/testdata/spacewar/.classpath b/ajdoc/testdata/spacewar/.classpath new file mode 100644 index 000000000..3981ea294 --- /dev/null +++ b/ajdoc/testdata/spacewar/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ajdoc/testdata/spacewar/.cvsignore b/ajdoc/testdata/spacewar/.cvsignore new file mode 100644 index 000000000..ba077a403 --- /dev/null +++ b/ajdoc/testdata/spacewar/.cvsignore @@ -0,0 +1 @@ +bin diff --git a/ajdoc/testdata/spacewar/.project b/ajdoc/testdata/spacewar/.project new file mode 100644 index 000000000..4fbdcbb2b --- /dev/null +++ b/ajdoc/testdata/spacewar/.project @@ -0,0 +1,18 @@ + + + spacewar + + + + + + org.eclipse.ajdt.ui.ajbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.ajdt.ui.ajnature + + diff --git a/ajdoc/testdata/spacewar/coordination/Condition.java b/ajdoc/testdata/spacewar/coordination/Condition.java new file mode 100644 index 000000000..18bbafee2 --- /dev/null +++ b/ajdoc/testdata/spacewar/coordination/Condition.java @@ -0,0 +1,37 @@ +/* -*- Mode: Java; -*- + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +*/ + +package coordination; + + +/** + * Interface for pre-conditions that are passed to guardedEntry methods of + * Coordinator. + * Conditions should be passed as anonymous classes that simply implement + * the checkit method. + * + */ +public interface Condition { + + /** + * This method is called automatically by Coordinator.guardedEntry(...) + * and it's called everytime the coordination state changes. + */ + + public boolean checkit(); +} diff --git a/ajdoc/testdata/spacewar/coordination/CoordinationAction.java b/ajdoc/testdata/spacewar/coordination/CoordinationAction.java new file mode 100644 index 000000000..7825b95b7 --- /dev/null +++ b/ajdoc/testdata/spacewar/coordination/CoordinationAction.java @@ -0,0 +1,37 @@ +/* -*- Mode: Java; -*- + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +*/ + +package coordination; + + +/** + * Interface for coordination actions that are passed to guardedEntry methods of + * Coordinator. + * Coordination actions should be passed as anonymous classes that simply + * implement the doit method. + * + */ +public interface CoordinationAction { + /** + * This method is called by Coordinator.guardedEntry(...) and + * Coordinator.guardedExit(...). Use it for changing coordination state + * upon entering and exiting methods. + */ + + public void doit(); +} diff --git a/ajdoc/testdata/spacewar/coordination/Coordinator.java b/ajdoc/testdata/spacewar/coordination/Coordinator.java new file mode 100644 index 000000000..ea0522d6b --- /dev/null +++ b/ajdoc/testdata/spacewar/coordination/Coordinator.java @@ -0,0 +1,449 @@ +/* -*- Mode: Java; -*- + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +*/ + +package coordination; + +import java.util.*; //!!! + +/** + * The Coordinator class provides the basic functionality for synchronizing + * and coordinating different threads upon entering and exiting methods. + * It can be used in two different ways: + * 1) by instantiating regular coordinator objects that are used by aspects; or + * 2) by extending it (sub-classing) with coordinator aspects. + *

+ * Method invocations are the smallest units for defining critical sections + * and pre-conditions. The use of coordinators, either regular objects or aspect + * instances, should always end up by invoking guardedEntry(...) in a + * before weave and guardedExit(...) in an after weave for all methods that + * need coordination. guardedEntry and guardedExit are the methods that + * actually manage the synchronization and coordination constraints given + * by their parameters and by pre-existent exclusion markers. + *

+ * The synchronization of threads for the execution of critical section + * methods in an object is done by marking those methods as self- and/or + * mutually-exclusive (addSelfex, addMutex). + * Just by itself, addSelfex("M") does not enforce the self-exclusion + * of method M - enforcement is done by invoking guardedEntry before + * M is executed. Similarly, addMutex(new String[] {"M1", "M2"}) does + * not enforce the mutual exclusion between methods M1 and M2. + *

+ * A guardedEntry on a method that has been marked as self-exclusive + * ensures that the method is executed in the invoked object by only one thread + * at a time. A guardedEntry on a method that has been marked has mutually- + * exclusive with other methods ensures that the execution of that method + * by a thread in the invoked object temporarily blocks the execution by + * other threads of the methods that are in the same mutex set. + *

+ * The coordination of threads, i.e. their explicit suspension and + * resumption, is done through the use of pre-conditions and coordination + * actions that are passed as parameters to guardedEntry and guardedExit + * with the form of anonymous classes. + */ +public abstract aspect Coordinator { + private Hashtable methods = null; + private Vector exclusions = null; + + abstract protected pointcut synchronizationPoint(); + + public Coordinator() { + methods = new Hashtable(); + exclusions = new Vector(5); + } + + before (): synchronizationPoint() { + this.guardedEntry(thisJoinPointStaticPart.getSignature().getName()); + } + + after (): synchronizationPoint() { + this.guardedExit(thisJoinPointStaticPart.getSignature().getName()); + } + + /** + * Takes a multi-part method name (eg "BoundedBuffer.put") + * and marks that method as self-exclusive. + * No checks are made with respect to the existence of the method + * whose name is given. + */ + public synchronized void addSelfex(String methName) { + Selfex sex = new Selfex (methName); + + // update db of all exclusions in this coordinator + exclusions.addElement(sex); + + // update local info in method + Method aMeth = getOrSetMethod(methName); + aMeth.addExclusion(sex); + } + + /** + * Takes a multi-part method name (e.g. "BoundedBuffer.put") + * and removes that method from the list of self-exclusive methods. + */ + public synchronized void removeSelfex(String methName) { + for (int i = 0; i < exclusions.size(); i++) { + Exclusion sex = (Exclusion)exclusions.elementAt(i); + if ((sex instanceof Selfex) && + (((Selfex)sex).methodName.equals(methName))) { + + // update db of all exclusions in this coordinator + exclusions.removeElementAt(i); + + // update local info in method + Method aMeth = getOrSetMethod(methName); + aMeth.removeExclusion(sex); + } + } + } + + /** + * Takes an array of multi-part method names and marks those + * methods as mutually exclusive. + * No checks are made with respect to the existence of the methods + * whose names are given. + */ + public synchronized void addMutex(String[] methNames) { + Mutex mux = new Mutex(methNames); + + // update db of all exclusions in this coordinator + exclusions.addElement(mux); + + // update local info in each method + for (int i = 0; i < methNames.length; i++) { + Method aMeth = getOrSetMethod(methNames[i]); + aMeth.addExclusion(mux); + } + } + + /** + * Takes an array of multi-part method names that correspond + * to an existing mutex set and remove the mutual exclusion constraint. + * If the given mutex set does not exist, removeMutex does nothing. + */ + public synchronized void removeMutex(String[] methNames) { + for (int i = 0; i < exclusions.size(); i++) { + Exclusion mux = (Exclusion)exclusions.elementAt(i); + if (mux instanceof Mutex) { + boolean same = true; + for (int j = 0; j < methNames.length; j++) + if (!methNames[j].equals(((Mutex)mux).methodNames[j])) + same = false; + if (same) { + // update db of all exclusions in this coordinator + exclusions.removeElementAt(i); + + // update local info in each method involved + for (int j = 0; j < methNames.length; j++) { + Method aMeth = getOrSetMethod(methNames[j]); + aMeth.removeExclusion(mux); + } + } + } + } + } + + /** + * This method is the guard for enforcing all synchronization and + * coordination constraints of a given method, and it should be called + * just before the method is executed. + * In this form, only the method name is given. The only constraints + * checked are the exclusion constraints. + * If the method was previousely marked as selfex (through addSelfex), + * guardedEntry ensures that the method is executed only when no other + * thread is executing it. + * If the method was previousely marked as being in one or more mutex + * sets, guardedEntry ensures that the method is executed only when no other + * thread is executing any of the methods with which the give method is + * mutexed. + */ + public synchronized void guardedEntry(String methName) { + guardedEntry(methName, new Condition() { + public boolean checkit() { + return true; + } + }, null); + } + + /** + * Just like guardedEntry(String methName), but the given method is executed + * only when the given condition is true. + * guardedEntry is the guard for enforcing all synchronization and + * coordination constraints of a given method, and it should be called + * just before the method is executed. + * In this form, the method name is given along with a condition. + * The constraints checked are the exclusion constraints and whether + * the given condition is true. + * If the method was previousely marked as selfex (through addSelfex), + * guardedEntry ensures that the method is executed only when no other + * thread is executing it. + * If the method was previousely marked as being in one or more mutex + * sets, guardedEntry ensures that the method is executed only when no other + * thread is executing any of the methods with which the give method is + * mutexed. + * If the condition is false, guardedEntry suspends the current thread. + * That thread remains suspended until the condition becomes true, in + * which case all constraints are rechecked before the method is executed. + * When all exclusion constraints are checked and the given condition is + * true, the given method is executed. + */ + public synchronized void guardedEntry(String methName, Condition condition) { + guardedEntry(methName, condition, null); + } + + /** + * Just like guardedEntry(String methName), but with an additional + * coordination action that is executed before the given method is + * executed. + * guardedEntry is the guard for enforcing all synchronization and + * coordination constraints of a given method, and it should be called + * just before the method is executed. + * In this form, the method name is given along with a coordination action. + * The only constraints checked are the exclusion constraints. + * If the method was previousely marked as selfex (through addSelfex), + * guardedEntry ensures that the method is executed only when no other + * thread is executing it. + * If the method was previousely marked as being in one or more mutex + * sets, guardedEntry ensures that the method is executed only when no other + * thread is executing any of the methods with which the give method is + * mutexed. + * The given coordination action is executed just before the given method + * is executed. + */ + public synchronized void guardedEntry(String methName, + CoordinationAction action) { + guardedEntry(methName, new Condition() { + public boolean checkit() { + return true; + } + }, + action); + } + + /** + * Just like guardedEntry(String methName), but the given method is executed + * only when the given condition is true; the additional + * coordination action that is executed before the given method is + * executed. + * guardedEntry is the guard for enforcing all synchronization and + * coordination constraints of a given method, and it should be called + * just before the method is executed. + * In this form, the method name is given along with a condition and + * a coordination action. + * The constraints checked are the exclusion constraints and whether the + * given condition is true. + * If the method was previousely marked as selfex (through addSelfex), + * guardedEntry ensures that the method is executed only when no other + * thread is executing it. + * If the method was previousely marked as being in one or more mutex + * sets, guardedEntry ensures that the method is executed only when no other + * thread is executing any of the methods with which the give method is + * mutexed. + * If the condition is false, guardedEntry suspends the current thread. + * That thread remains suspended until the condition becomes true, in + * which case all constraints are rechecked before the method is executed. + * When all exclusion constraints are checked and the given condition is + * true, the given method is executed. + * The given coordination action is executed just before the given method + * is executed. + */ + public synchronized void guardedEntry(String methName, + Condition condition, + CoordinationAction action) { + Method aMeth = getOrSetMethod(methName); + boolean canGo = false; + + // test pre-conditions for entering the method + while (!canGo) { + canGo = true; + for (int i = 0; i < aMeth.exes.size() && canGo; i++) + if (!((Exclusion)aMeth.exes.elementAt(i)).testExclusion(aMeth.name)) { + canGo = false; + } + if (canGo && !condition.checkit()) { + canGo = false; + } + if (!canGo) + try { + wait(); + } catch (InterruptedException e) { } + } + + // OK. + enterMethod(aMeth, action); + } + + /** + * This method is similar to guardedEntry, but it takes + * an additional parameter - the milliseconds after which any suspension + * will abort with a timeout. + */ + public synchronized void guardedEntryWithTimeout(String methName, + long millis) + throws TimeoutException { + guardedEntryWithTimeout(methName, new Condition() { + public boolean checkit() { + return true; + } + }, null, millis); + } + + /** + * This method is similar to guardedEntry, but it takes + * an additional parameter - the milliseconds after which any suspension + * will abort with a timeout. + */ + public synchronized void guardedEntryWithTimeout(String methName, + Condition condition, + long millis) + throws TimeoutException { + guardedEntryWithTimeout(methName, condition, null, millis); + } + + /** + * This method is similar to guardedEntry, but it takes + * an additional parameter - the milliseconds after which any suspension + * will abort with a timeout. + */ + public synchronized void guardedEntryWithTimeout(String methName, + CoordinationAction action, + long millis) + throws TimeoutException { + guardedEntryWithTimeout(methName, new Condition() { + public boolean checkit() { + return true; + } + }, action, millis); + } + + /** + * This method is similar to guardedEntry, but it takes + * an additional parameter - the milliseconds after which any suspension + * will abort with a timeout. + */ + public synchronized void guardedEntryWithTimeout(String methName, + Condition condition, + CoordinationAction action, + long millis) + throws TimeoutException { + + Method aMeth = getOrSetMethod(methName); + boolean canGo = false; + long waitTime = millis; + long startTime = System.currentTimeMillis(); + + // test pre-conditions for entering the method + while (!canGo) { + canGo = true; + for (int i = 0; i < aMeth.exes.size() && canGo; i++) + if ((!((Exclusion)aMeth.exes.elementAt(i)).testExclusion(aMeth.name)) || + (!condition.checkit())) { + canGo = false; + } + if (!canGo) { + try { + wait(waitTime); + } catch (InterruptedException e) {} + + long now = System.currentTimeMillis(); + long timeSoFar = now - startTime; + if (timeSoFar >= millis) // timeout! + throw new TimeoutException(timeSoFar); + else // adjust time + waitTime = millis - timeSoFar; + } + } + + // OK. + enterMethod(aMeth, action); + } + + /** + * This method provides the means for updating all synchronization and + * coordination state after the execution of a given method, and it should be + * called after the method is executed. + * In this form, only the method name is given. + * The synchronization state for self- and mutual-exclusion is + * automatically upadted. + */ + public synchronized void guardedExit(String methName) { + guardedExit(methName, null); + } + + /** + * Just like guardedExit(String methName) but with an additional + * coordination action that is executed. + * guardedExit provides the means for updating all synchronization and + * coordination state after the execution of a given method, and it should be + * called after the method is executed. + * In this form, the method name is given along with a coordination action. + * The synchronization state for self- and mutual-exclusion is + * automatically upadted. + * The given coordination action is executed. + */ + public synchronized void guardedExit(String methName, + CoordinationAction action) { + Method aMeth = getOrSetMethod(methName); + + for (int i = 0; i < aMeth.exes.size(); i++) + ((Exclusion)aMeth.exes.elementAt(i)).exitExclusion(methName); + if (action != null) action.doit(); + notifyAll(); + } + + private Method getOrSetMethod(String methName) { + Method aMeth = null; + if (!methods.containsKey(methName)) { + methods.put(methName, (aMeth = new Method(methName))); + } + else { + aMeth = (Method) methods.get(methName); + } + return aMeth; + } + + private void enterMethod(Method aMeth, CoordinationAction action) { + for (int i = 0; i < aMeth.exes.size(); i++) + ((Exclusion)aMeth.exes.elementAt(i)).enterExclusion(aMeth.name); + + if (action != null) action.doit(); + } + + + +} + +class Method { + String name; + Vector exes = new Vector(3); + + Method(String n) { + name = n; + } + + void addExclusion(Exclusion ex) { + exes.addElement(ex); + } + + void removeExclusion(Exclusion ex) { + for (int i = 0; i < exes.size(); i++) { + if (exes.elementAt(i) == ex) + exes.removeElementAt(i); + } + } +} + diff --git a/ajdoc/testdata/spacewar/coordination/Exclusion.java b/ajdoc/testdata/spacewar/coordination/Exclusion.java new file mode 100644 index 000000000..9179cd6e0 --- /dev/null +++ b/ajdoc/testdata/spacewar/coordination/Exclusion.java @@ -0,0 +1,33 @@ +/* -*- Mode: Java; -*- + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +*/ + +package coordination; + + +interface Exclusion { + + boolean testExclusion(String methodName); + + void enterExclusion(String methodName); + + void exitExclusion(String methodName); + + // for debug !!! + void printNames(); +} + diff --git a/ajdoc/testdata/spacewar/coordination/MethodState.java b/ajdoc/testdata/spacewar/coordination/MethodState.java new file mode 100644 index 000000000..03a44378a --- /dev/null +++ b/ajdoc/testdata/spacewar/coordination/MethodState.java @@ -0,0 +1,45 @@ +/* -*- Mode: Java; -*- + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +*/ + +package coordination; + +import java.util.Vector; +import java.util.Enumeration; + + +class MethodState { + + Vector threads=new Vector(); + + void enterInThread (Thread t) { + threads.addElement(t); + } + + void exitInThread(Thread t) { + threads.removeElement(t); + } + + boolean hasOtherThreadThan(Thread t) { + Enumeration e = threads.elements(); + while (e.hasMoreElements()) + if (e.nextElement() != t) + return(true); + return (false); + } + +} diff --git a/ajdoc/testdata/spacewar/coordination/Mutex.java b/ajdoc/testdata/spacewar/coordination/Mutex.java new file mode 100644 index 000000000..2472137c6 --- /dev/null +++ b/ajdoc/testdata/spacewar/coordination/Mutex.java @@ -0,0 +1,86 @@ +/* -*- Mode: Java; -*- + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +*/ + +package coordination; + +import java.lang.String; + + +class Mutex implements Exclusion { + String[] methodNames; + MethodState[] methodStates; + + String prettyName; + + Mutex (String[] _methodNames) { + methodNames = _methodNames; + methodStates = new MethodState[methodNames.length]; + for (int i = 0; i < methodNames.length; i++) { + methodStates[i] = new MethodState(); + } + } + + private boolean isMethodIn (String _methodName) { + for (int i = 0; i < methodNames.length; i++) { + if (_methodName.equals(methodNames[i])) + return(true); + } + return(false); + } + + private MethodState getMethodState (String _methodName) { + for (int i = 0; i < methodNames.length; i++) { + if (_methodName.equals(methodNames[i])) + return(methodStates[i]); + } + return(null); + } + + public boolean testExclusion (String _methodName) { + Thread ct = Thread.currentThread(); + // + // Loop through each of the other methods in this exclusion set, to be sure + // that no other thread is running them. Note that we have to be careful + // about selfex. + // + for (int i = 0; i < methodNames.length; i++) { + if (!_methodName.equals(methodNames[i])) { + if (methodStates[i].hasOtherThreadThan(ct)) + return(false); + } + } + return (true); + } + + public void enterExclusion (String _methodName) { + MethodState methodState = getMethodState(_methodName); + methodState.enterInThread(Thread.currentThread()); + } + + public void exitExclusion (String _methodName) { + MethodState methodState = getMethodState(_methodName); + methodState.exitInThread(Thread.currentThread()); + } + + public void printNames() { + System.out.print("Mutex names: "); + for (int i = 0; i < methodNames.length; i++) + System.out.print(methodNames[i] + " "); + System.out.println(); + } +} diff --git a/ajdoc/testdata/spacewar/coordination/Selfex.java b/ajdoc/testdata/spacewar/coordination/Selfex.java new file mode 100644 index 000000000..ff73afd61 --- /dev/null +++ b/ajdoc/testdata/spacewar/coordination/Selfex.java @@ -0,0 +1,55 @@ +/* -*- Mode: Java; -*- + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +*/ + +package coordination; + + +import java.lang.String; + +class Selfex implements Exclusion { + String methodName; + Thread thread; + int count = 0; + + Selfex (String _methodName) { + methodName = _methodName; + } + + public boolean testExclusion (String _methodName) { + if (count == 0) + return(true); + return (thread == Thread.currentThread()); + } + + public void enterExclusion (String _methodName) { + count++; + thread = Thread.currentThread(); // note that if count wasn't 0 + // we aren't changing thread + } + + public void exitExclusion (String _methodName) { + count--; + if (count == 0) // not stricly necessary, but... + thread = null; + } + + public void printNames() { + System.out.println("Selfex name: " + methodName); + } + +} diff --git a/ajdoc/testdata/spacewar/coordination/TimeoutException.java b/ajdoc/testdata/spacewar/coordination/TimeoutException.java new file mode 100644 index 000000000..e16aa7f09 --- /dev/null +++ b/ajdoc/testdata/spacewar/coordination/TimeoutException.java @@ -0,0 +1,27 @@ +/* -*- Mode: Java; -*- + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +*/ + +package coordination; + + +public class TimeoutException extends Exception { + long time; + TimeoutException(long _time) { + time = _time; + } +} diff --git a/ajdoc/testdata/spacewar/coordination/lib.lst b/ajdoc/testdata/spacewar/coordination/lib.lst new file mode 100644 index 000000000..e0a4334fd --- /dev/null +++ b/ajdoc/testdata/spacewar/coordination/lib.lst @@ -0,0 +1,8 @@ +Condition.java +CoordinationAction.java +Coordinator.java +Exclusion.java +MethodState.java +Mutex.java +Selfex.java +TimeoutException.java diff --git a/ajdoc/testdata/spacewar/doc/allclasses-frame.html b/ajdoc/testdata/spacewar/doc/allclasses-frame.html new file mode 100644 index 000000000..cdf0442fe --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/allclasses-frame.html @@ -0,0 +1,96 @@ + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
Bullet +
+Condition +
+CoordinationAction +
+Coordinator +
+Debug +
+Display +
+Display.DisplayAspect +
+Display1 +
+Display1.SpaceObjectPainting +
+Display2 +
+Display2.SpaceObjectPainting +
+EnergyPacket +
+EnergyPacketProducer +
+EnsureShipIsAlive +
+Exclusion +
+Game +
+GameSynchronization +
+InfoWin +
+KeyMapping +
+Method +
+MethodState +
+Mutex +
+Pilot +
+Player +
+Registry +
+Registry.RegistrationProtection +
+RegistrySynchronization +
+Robot +
+SWFrame +
+Selfex +
+Ship +
+SpaceObject +
+TimeoutException +
+Timer +
+
+ + + diff --git a/ajdoc/testdata/spacewar/doc/allclasses-noframe.html b/ajdoc/testdata/spacewar/doc/allclasses-noframe.html new file mode 100644 index 000000000..ca0fccfca --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/allclasses-noframe.html @@ -0,0 +1,96 @@ + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
Bullet +
+Condition +
+CoordinationAction +
+Coordinator +
+Debug +
+Display +
+Display.DisplayAspect +
+Display1 +
+Display1.SpaceObjectPainting +
+Display2 +
+Display2.SpaceObjectPainting +
+EnergyPacket +
+EnergyPacketProducer +
+EnsureShipIsAlive +
+Exclusion +
+Game +
+GameSynchronization +
+InfoWin +
+KeyMapping +
+Method +
+MethodState +
+Mutex +
+Pilot +
+Player +
+Registry +
+Registry.RegistrationProtection +
+RegistrySynchronization +
+Robot +
+SWFrame +
+Selfex +
+Ship +
+SpaceObject +
+TimeoutException +
+Timer +
+
+ + + diff --git a/ajdoc/testdata/spacewar/doc/constant-values.html b/ajdoc/testdata/spacewar/doc/constant-values.html new file mode 100644 index 000000000..f861e0c19 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/constant-values.html @@ -0,0 +1,200 @@ + + + + + + +Constant Field Values + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +


+
+

+Constant Field Values

+
+
+Contents + + + + + + +
+spacewar.*
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
spacewar.spacewar.Ship
+static final intBULLET_SPEED10
+static final intCLOCKWISE1
+static final intCOUNTERCLOCKWISE-1
+static final doubleDEFAULT_ACCELERATION0.4d
+static final doubleDEFAULT_ANGULAR_VELOCITY0.2d
+static final intMAX_DAMAGE100
+static final intSTOP0
+ +

+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/Condition.html b/ajdoc/testdata/spacewar/doc/coordination/Condition.html new file mode 100644 index 000000000..49638a3cf --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/Condition.html @@ -0,0 +1,216 @@ + + + + + + +Condition + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +coordination +
+Interface Condition

+
+
+
public interface Condition
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ booleancheckit() + +
+          
+  +

+ + + + + + + + + + + + + + +
+Method Detail
+ +

+checkit

+
+public boolean checkit()
+
+
+

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/CoordinationAction.html b/ajdoc/testdata/spacewar/doc/coordination/CoordinationAction.html new file mode 100644 index 000000000..6b462ab60 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/CoordinationAction.html @@ -0,0 +1,216 @@ + + + + + + +CoordinationAction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +coordination +
+Interface CoordinationAction

+
+
+
public interface CoordinationAction
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voiddoit() + +
+          
+  +

+ + + + + + + + + + + + + + +
+Method Detail
+ +

+doit

+
+public void doit()
+
+
+

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/Coordinator.html b/ajdoc/testdata/spacewar/doc/coordination/Coordinator.html new file mode 100644 index 000000000..dac70c4af --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/Coordinator.html @@ -0,0 +1,614 @@ + + + + + + +Coordinator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +coordination +
+Aspect Coordinator

+
+java.lang.Object
+  extended bycoordination.Coordinator
+
+
+
Direct Known Subclasses:
GameSynchronization, RegistrySynchronization
+
+
+
+
public abstract class Coordinator
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + + +
Pointcut Summary
protectedsynchronizationPoint()
 

  + + + + + +
Advice Summary
before(): synchronizationPoint..
 
 Advises:spacewar.SpaceObject, spacewar.SpaceObject.die, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Display2.paintObjects, spacewar.Display1.paintObjects, spacewar.Robot.run, spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.clockTick, spacewar.Game.handleCollisions
+
+
after(): synchronizationPoint..
 
 Advises:spacewar.SpaceObject, spacewar.SpaceObject.die, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Display2.paintObjects, spacewar.Display1.paintObjects, spacewar.Robot.run, spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.clockTick, spacewar.Game.handleCollisions
+
+

  + + + + + + + + + + + + + +
+Constructor Summary
Coordinator() + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddMutex(java.lang.String[] methNames) + +
+          
+ voidaddSelfex(java.lang.String methName) + +
+          
+ voidguardedEntry(java.lang.String methName) + +
+          
+ voidguardedEntry(java.lang.String methName, + Condition condition) + +
+          
+ voidguardedEntry(java.lang.String methName, + Condition condition, + CoordinationAction action) + +
+          
+ voidguardedEntry(java.lang.String methName, + CoordinationAction action) + +
+          
+ voidguardedEntryWithTimeout(java.lang.String methName, + Condition condition, + CoordinationAction action, + long millis) + +
+          
+ voidguardedEntryWithTimeout(java.lang.String methName, + Condition condition, + long millis) + +
+          
+ voidguardedEntryWithTimeout(java.lang.String methName, + CoordinationAction action, + long millis) + +
+          
+ voidguardedEntryWithTimeout(java.lang.String methName, + long millis) + +
+          
+ voidguardedExit(java.lang.String methName) + +
+          
+ voidguardedExit(java.lang.String methName, + CoordinationAction action) + +
+          
+ voidremoveMutex(java.lang.String[] methNames) + +
+          
+ voidremoveSelfex(java.lang.String methName) + +
+          
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Pointcut Detail
+

synchronizationPoint()

  + + + + + + +
+Advice Detail
+

before

before(): synchronizationPoint.. +

 Advises:spacewar.SpaceObject, spacewar.SpaceObject.die, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Display2.paintObjects, spacewar.Display1.paintObjects, spacewar.Robot.run, spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.clockTick, spacewar.Game.handleCollisions
+ +


+ +

after

after(): synchronizationPoint.. +

 Advises:spacewar.SpaceObject, spacewar.SpaceObject.die, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Registry.dummy, spacewar.Display2.paintObjects, spacewar.Display1.paintObjects, spacewar.Robot.run, spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.clockTick, spacewar.Game.handleCollisions
+ +

+ + + + + + + + + +
+Constructor Detail
+ +

+Coordinator

+
+public Coordinator()
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+addSelfex

+
+public void addSelfex(java.lang.String methName)
+
+
+

+

+
+
+
+
+ +

+removeSelfex

+
+public void removeSelfex(java.lang.String methName)
+
+
+

+

+
+
+
+
+ +

+addMutex

+
+public void addMutex(java.lang.String[] methNames)
+
+
+

+

+
+
+
+
+ +

+removeMutex

+
+public void removeMutex(java.lang.String[] methNames)
+
+
+

+

+
+
+
+
+ +

+guardedEntry

+
+public void guardedEntry(java.lang.String methName)
+
+
+

+

+
+
+
+
+ +

+guardedEntry

+
+public void guardedEntry(java.lang.String methName,
+                         Condition condition)
+
+
+

+

+
+
+
+
+ +

+guardedEntry

+
+public void guardedEntry(java.lang.String methName,
+                         CoordinationAction action)
+
+
+

+

+
+
+
+
+ +

+guardedEntry

+
+public void guardedEntry(java.lang.String methName,
+                         Condition condition,
+                         CoordinationAction action)
+
+
+

+

+
+
+
+
+ +

+guardedEntryWithTimeout

+
+public void guardedEntryWithTimeout(java.lang.String methName,
+                                    long millis)
+                             throws TimeoutException
+
+
+

+

+ +
Throws: +
TimeoutException
+
+
+
+ +

+guardedEntryWithTimeout

+
+public void guardedEntryWithTimeout(java.lang.String methName,
+                                    Condition condition,
+                                    long millis)
+                             throws TimeoutException
+
+
+

+

+ +
Throws: +
TimeoutException
+
+
+
+ +

+guardedEntryWithTimeout

+
+public void guardedEntryWithTimeout(java.lang.String methName,
+                                    CoordinationAction action,
+                                    long millis)
+                             throws TimeoutException
+
+
+

+

+ +
Throws: +
TimeoutException
+
+
+
+ +

+guardedEntryWithTimeout

+
+public void guardedEntryWithTimeout(java.lang.String methName,
+                                    Condition condition,
+                                    CoordinationAction action,
+                                    long millis)
+                             throws TimeoutException
+
+
+

+

+ +
Throws: +
TimeoutException
+
+
+
+ +

+guardedExit

+
+public void guardedExit(java.lang.String methName)
+
+
+

+

+
+
+
+
+ +

+guardedExit

+
+public void guardedExit(java.lang.String methName,
+                        CoordinationAction action)
+
+
+

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/Exclusion.html b/ajdoc/testdata/spacewar/doc/coordination/Exclusion.html new file mode 100644 index 000000000..c3b360ff0 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/Exclusion.html @@ -0,0 +1,282 @@ + + + + + + +Exclusion + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +coordination +
+Interface Exclusion

+
+
All Known Implementing Classes:
Mutex, Selfex
+
+
+
+
interface Exclusion
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidenterExclusion(java.lang.String methodName) + +
+          
+ voidexitExclusion(java.lang.String methodName) + +
+          
+ voidprintNames() + +
+          
+ booleantestExclusion(java.lang.String methodName) + +
+          
+  +

+ + + + + + + + + + + + + + +
+Method Detail
+ +

+testExclusion

+
+public boolean testExclusion(java.lang.String methodName)
+
+
+

+

+
+
+
+
+ +

+enterExclusion

+
+public void enterExclusion(java.lang.String methodName)
+
+
+

+

+
+
+
+
+ +

+exitExclusion

+
+public void exitExclusion(java.lang.String methodName)
+
+
+

+

+
+
+
+
+ +

+printNames

+
+public void printNames()
+
+
+

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/Method.html b/ajdoc/testdata/spacewar/doc/coordination/Method.html new file mode 100644 index 000000000..caeba39a7 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/Method.html @@ -0,0 +1,334 @@ + + + + + + +Method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +coordination +
+Class Method

+
+java.lang.Object
+  extended bycoordination.Method
+
+
+
+
class Method
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + +
+Field Summary
+(package private)  java.util.Vectorexes + +
+          
+(package private)  java.lang.Stringname + +
+          
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Method(java.lang.String n) + +
+          
+  + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  voidaddExclusion(Exclusion ex) + +
+          
+(package private)  voidremoveExclusion(Exclusion ex) + +
+          
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+name

+
+java.lang.String name
+
+
+

+

+
+
+
+ +

+exes

+
+java.util.Vector exes
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Method

+
+Method(java.lang.String n)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+addExclusion

+
+void addExclusion(Exclusion ex)
+
+
+

+

+
+
+
+
+ +

+removeExclusion

+
+void removeExclusion(Exclusion ex)
+
+
+

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/MethodState.html b/ajdoc/testdata/spacewar/doc/coordination/MethodState.html new file mode 100644 index 000000000..052af0ce0 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/MethodState.html @@ -0,0 +1,333 @@ + + + + + + +MethodState + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +coordination +
+Class MethodState

+
+java.lang.Object
+  extended bycoordination.MethodState
+
+
+
+
class MethodState
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + +
+Field Summary
+(package private)  java.util.Vectorthreads + +
+          
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)MethodState() + +
+           
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  voidenterInThread(java.lang.Thread t) + +
+          
+(package private)  voidexitInThread(java.lang.Thread t) + +
+          
+(package private)  booleanhasOtherThreadThan(java.lang.Thread t) + +
+          
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+threads

+
+java.util.Vector threads
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+MethodState

+
+MethodState()
+
+
+ + + + + + + + +
+Method Detail
+ +

+enterInThread

+
+void enterInThread(java.lang.Thread t)
+
+
+

+

+
+
+
+
+ +

+exitInThread

+
+void exitInThread(java.lang.Thread t)
+
+
+

+

+
+
+
+
+ +

+hasOtherThreadThan

+
+boolean hasOtherThreadThan(java.lang.Thread t)
+
+
+

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/Mutex.html b/ajdoc/testdata/spacewar/doc/coordination/Mutex.html new file mode 100644 index 000000000..ac127de96 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/Mutex.html @@ -0,0 +1,411 @@ + + + + + + +Mutex + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +coordination +
+Class Mutex

+
+java.lang.Object
+  extended bycoordination.Mutex
+
+
+
All Implemented Interfaces:
Exclusion
+
+
+
+
class Mutex
extends java.lang.Object
implements Exclusion
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+(package private)  java.lang.String[]methodNames + +
+          
+(package private)  MethodState[]methodStates + +
+          
+(package private)  java.lang.StringprettyName + +
+          
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Mutex(java.lang.String[] _methodNames) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidenterExclusion(java.lang.String _methodName) + +
+          
+ voidexitExclusion(java.lang.String _methodName) + +
+          
+ voidprintNames() + +
+          
+ booleantestExclusion(java.lang.String _methodName) + +
+          
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+methodNames

+
+java.lang.String[] methodNames
+
+
+

+

+
+
+
+ +

+methodStates

+
+MethodState[] methodStates
+
+
+

+

+
+
+
+ +

+prettyName

+
+java.lang.String prettyName
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Mutex

+
+Mutex(java.lang.String[] _methodNames)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+testExclusion

+
+public boolean testExclusion(java.lang.String _methodName)
+
+
+

+

+
Specified by:
testExclusion in interface Exclusion
+
+
+
+
+
+
+ +

+enterExclusion

+
+public void enterExclusion(java.lang.String _methodName)
+
+
+

+

+
Specified by:
enterExclusion in interface Exclusion
+
+
+
+
+
+
+ +

+exitExclusion

+
+public void exitExclusion(java.lang.String _methodName)
+
+
+

+

+
Specified by:
exitExclusion in interface Exclusion
+
+
+
+
+
+
+ +

+printNames

+
+public void printNames()
+
+
+

+

+
Specified by:
printNames in interface Exclusion
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/Selfex.html b/ajdoc/testdata/spacewar/doc/coordination/Selfex.html new file mode 100644 index 000000000..6554054d6 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/Selfex.html @@ -0,0 +1,411 @@ + + + + + + +Selfex + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +coordination +
+Class Selfex

+
+java.lang.Object
+  extended bycoordination.Selfex
+
+
+
All Implemented Interfaces:
Exclusion
+
+
+
+
class Selfex
extends java.lang.Object
implements Exclusion
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+(package private)  intcount + +
+          
+(package private)  java.lang.StringmethodName + +
+          
+(package private)  java.lang.Threadthread + +
+          
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Selfex(java.lang.String _methodName) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidenterExclusion(java.lang.String _methodName) + +
+          
+ voidexitExclusion(java.lang.String _methodName) + +
+          
+ voidprintNames() + +
+          
+ booleantestExclusion(java.lang.String _methodName) + +
+          
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+methodName

+
+java.lang.String methodName
+
+
+

+

+
+
+
+ +

+thread

+
+java.lang.Thread thread
+
+
+

+

+
+
+
+ +

+count

+
+int count
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Selfex

+
+Selfex(java.lang.String _methodName)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+testExclusion

+
+public boolean testExclusion(java.lang.String _methodName)
+
+
+

+

+
Specified by:
testExclusion in interface Exclusion
+
+
+
+
+
+
+ +

+enterExclusion

+
+public void enterExclusion(java.lang.String _methodName)
+
+
+

+

+
Specified by:
enterExclusion in interface Exclusion
+
+
+
+
+
+
+ +

+exitExclusion

+
+public void exitExclusion(java.lang.String _methodName)
+
+
+

+

+
Specified by:
exitExclusion in interface Exclusion
+
+
+
+
+
+
+ +

+printNames

+
+public void printNames()
+
+
+

+

+
Specified by:
printNames in interface Exclusion
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/TimeoutException.html b/ajdoc/testdata/spacewar/doc/coordination/TimeoutException.html new file mode 100644 index 000000000..a81452dc8 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/TimeoutException.html @@ -0,0 +1,284 @@ + + + + + + +TimeoutException + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +coordination +
+Class TimeoutException

+
+java.lang.Object
+  extended byjava.lang.Throwable
+      extended byjava.lang.Exception
+          extended bycoordination.TimeoutException
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
+
public class TimeoutException
extends java.lang.Exception
+ +

+ +

+ +

+

+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + +
+Field Summary
+(package private)  longtime + +
+          
+ + + + + + + +
Fields inherited from class java.lang.Exception
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)TimeoutException(long _time) + +
+          
+  + + + + + + + + + + +
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+time

+
+long time
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+TimeoutException

+
+TimeoutException(long _time)
+
+
+

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/package-frame.html b/ajdoc/testdata/spacewar/doc/coordination/package-frame.html new file mode 100644 index 000000000..d62ecc91c --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/package-frame.html @@ -0,0 +1,66 @@ + + + + + + +coordination + + + + + + + + + + + +coordination + + + + +
+Interfaces  + +
+Condition +
+CoordinationAction +
+Exclusion
+ + + + + + +
+Classes  + +
+Coordinator +
+Method +
+MethodState +
+Mutex +
+Selfex
+ + + + + + +
+Exceptions  + +
+TimeoutException
+ + + + diff --git a/ajdoc/testdata/spacewar/doc/coordination/package-summary.html b/ajdoc/testdata/spacewar/doc/coordination/package-summary.html new file mode 100644 index 000000000..07cc1bba7 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/package-summary.html @@ -0,0 +1 @@ +coordination

Package coordination

Interface Summary
Condition
CoordinationAction
Exclusion
 

Class Summary
Coordinator
Method
MethodState
Mutex
Selfex
 

Exception Summary
TimeoutException
 



\ No newline at end of file diff --git a/ajdoc/testdata/spacewar/doc/coordination/package-tree.html b/ajdoc/testdata/spacewar/doc/coordination/package-tree.html new file mode 100644 index 000000000..fa5c60405 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/coordination/package-tree.html @@ -0,0 +1,155 @@ + + + + + + +coordination Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package coordination +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/deprecated-list.html b/ajdoc/testdata/spacewar/doc/deprecated-list.html new file mode 100644 index 000000000..07efa805a --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/deprecated-list.html @@ -0,0 +1,132 @@ + + + + + + +Deprecated List + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Deprecated API

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/help-doc.html b/ajdoc/testdata/spacewar/doc/help-doc.html new file mode 100644 index 000000000..e9b04ab6d --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/help-doc.html @@ -0,0 +1,187 @@ + + + + + + +API Help + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Overview

+
+ +

+The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

+

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    +
  • Interfaces (italic)
  • Classes
  • Exceptions
  • Errors
+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description +

    +

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary +

    +

  • Field Detail
  • Constructor Detail
  • Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    +
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/index-all.html b/ajdoc/testdata/spacewar/doc/index-all.html new file mode 100644 index 000000000..84b6e2301 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/index-all.html @@ -0,0 +1 @@ +Index
A B C D E F G H I K L M N O P Q R S T U W

A

accelerate(double, double) - Method in class spacewar.SpaceObject
actionPerformed(ActionEvent) - Method in class spacewar.SWFrame
addExclusion(Exclusion) - Method in class coordination.Method
addMutex(String[]) - Method in class coordination.Coordinator
addRobot() - Method in class spacewar.Game
addSelfex(String) - Method in class coordination.Coordinator

B

BULLET_SPEED - Static variable in class spacewar.Ship
Bullet - class spacewar.Bullet.
Bullet(Game, double, double, double, double) - Constructor for class spacewar.Bullet
bounce(Ship, Ship) - Static method in class spacewar.Ship

C

CLOCKWISE - Static variable in class spacewar.Ship
COUNTERCLOCKWISE - Static variable in class spacewar.Ship
Condition - interface coordination.Condition.
CoordinationAction - interface coordination.CoordinationAction.
__AJDECLID:300:__
Coordinator - class coordination.Coordinator.
__AJDECLID:302:__
Coordinator() - Constructor for class coordination.Coordinator
checkit() - Method in interface coordination.Condition
clear() - Method in class spacewar.InfoWin
clockTick() - Method in class spacewar.Bullet
clockTick() - Method in class spacewar.Game
clockTick() - Method in class spacewar.Registry
clockTick() - Method in class spacewar.Ship
clockTick() - Method in class spacewar.SpaceObject
coordination - package coordination
 
count - Variable in class coordination.Selfex

D

DEFAULT_ACCELERATION - Static variable in class spacewar.Ship
DEFAULT_ANGULAR_VELOCITY - Static variable in class spacewar.Ship
Debug - class spacewar.Debug.
Debug() - Constructor for class spacewar.Debug
 
Display - class spacewar.Display.
Display(Game) - Constructor for class spacewar.Display
Display.DisplayAspect - class spacewar.Display.DisplayAspect.
Display.DisplayAspect() - Constructor for class spacewar.Display.DisplayAspect
 
Display1 - class spacewar.Display1.
Display1(Game) - Constructor for class spacewar.Display1
Display1.SpaceObjectPainting - class spacewar.Display1.SpaceObjectPainting.
Display1.SpaceObjectPainting() - Constructor for class spacewar.Display1.SpaceObjectPainting
 
Display2 - class spacewar.Display2.
Display2(Game) - Constructor for class spacewar.Display2
Display2.SpaceObjectPainting - class spacewar.Display2.SpaceObjectPainting.
Display2.SpaceObjectPainting() - Constructor for class spacewar.Display2.SpaceObjectPainting
 
destroy() - Method in class spacewar.Robot
die() - Method in class spacewar.SpaceObject
doit() - Method in interface coordination.CoordinationAction
dummy() - Method in class spacewar.Registry

E

EnergyPacket - class spacewar.EnergyPacket.
EnergyPacket(Game, double, double, double, double, double) - Constructor for class spacewar.EnergyPacket
EnergyPacketProducer - class spacewar.EnergyPacketProducer.
EnergyPacketProducer(Game) - Constructor for class spacewar.EnergyPacketProducer
EnsureShipIsAlive - class spacewar.EnsureShipIsAlive.
EnsureShipIsAlive() - Constructor for class spacewar.EnsureShipIsAlive
 
Exclusion - interface coordination.Exclusion.
enterExclusion(String) - Method in interface coordination.Exclusion
enterExclusion(String) - Method in class coordination.Mutex
enterExclusion(String) - Method in class coordination.Selfex
enterInThread(Thread) - Method in class coordination.MethodState
error(Object) - Method in class spacewar.Game
exes - Variable in class coordination.Method
exitExclusion(String) - Method in interface coordination.Exclusion
exitExclusion(String) - Method in class coordination.Mutex
exitExclusion(String) - Method in class coordination.Selfex
exitInThread(Thread) - Method in class coordination.MethodState
expendEnergy(double) - Method in class spacewar.Ship

F

fire - Variable in class spacewar.KeyMapping
fire() - Method in class spacewar.Ship
frame - Variable in class spacewar.Display

G

Game - class spacewar.Game.
Game(String) - Constructor for class spacewar.Game
GameSynchronization - class spacewar.GameSynchronization.
GameSynchronization() - Constructor for class spacewar.GameSynchronization
game - Variable in class spacewar.Display
getDamage() - Method in class spacewar.Ship
getDamageLevel() - Method in class spacewar.Ship
getDisplay() - Method in class spacewar.SWFrame
getEnergy() - Method in class spacewar.EnergyPacket
getEnergy() - Method in class spacewar.Ship
getEnergyLevel() - Method in class spacewar.Ship
getGame() - Method in class spacewar.Display
getGame() - Method in class spacewar.EnergyPacketProducer
getGame() - Method in class spacewar.Pilot
getGame() - Method in class spacewar.Registry
getGame() - Method in class spacewar.SWFrame
getGame() - Method in class spacewar.SpaceObject
getGame() - Method in class spacewar.Timer
getHeight() - Method in class spacewar.Game
getMenu() - Method in class spacewar.SWFrame
getNumber() - Method in class spacewar.Pilot
getObjects() - Method in class spacewar.Registry
getOldXPos() - Method in class spacewar.SpaceObject
getOldYPos() - Method in class spacewar.SpaceObject
getOrientation() - Method in class spacewar.Ship
getPilot() - Method in class spacewar.Ship
getPilot1() - Static method in class spacewar.Display
getPilot1() - Method in class spacewar.Game
getPilot2() - Static method in class spacewar.Display
getPilot2() - Method in class spacewar.Game
getRAcc() - Method in class spacewar.Ship
getRegistry() - Method in class spacewar.Game
getShip() - Method in class spacewar.Pilot
getShips() - Method in class spacewar.Registry
getSize() - Method in class spacewar.Bullet
getSize() - Method in class spacewar.EnergyPacket
getSize() - Method in class spacewar.Ship
getSize() - Method in class spacewar.SpaceObject
getTable() - Method in class spacewar.Registry
getWidth() - Method in class spacewar.Game
getXPos() - Method in class spacewar.SpaceObject
getXVel() - Method in class spacewar.SpaceObject
getYPos() - Method in class spacewar.SpaceObject
getYVel() - Method in class spacewar.SpaceObject
guardedEntry(String) - Method in class coordination.Coordinator
guardedEntry(String, Condition) - Method in class coordination.Coordinator
guardedEntry(String, CoordinationAction) - Method in class coordination.Coordinator
guardedEntry(String, Condition, CoordinationAction) - Method in class coordination.Coordinator
guardedEntryWithTimeout(String, long) - Method in class coordination.Coordinator
guardedEntryWithTimeout(String, Condition, long) - Method in class coordination.Coordinator
guardedEntryWithTimeout(String, CoordinationAction, long) - Method in class coordination.Coordinator
guardedEntryWithTimeout(String, Condition, CoordinationAction, long) - Method in class coordination.Coordinator
guardedExit(String) - Method in class coordination.Coordinator
guardedExit(String, CoordinationAction) - Method in class coordination.Coordinator

H

handleCollision(SpaceObject) - Method in class spacewar.Bullet
handleCollision(SpaceObject) - Method in class spacewar.EnergyPacket
handleCollision(SpaceObject) - Method in class spacewar.Ship
handleCollision(SpaceObject) - Method in class spacewar.SpaceObject
handleCollisions() - Method in class spacewar.Game
hasOtherThreadThan(Thread) - Method in class coordination.MethodState

I

InfoWin - class spacewar.InfoWin.
InfoWin() - Constructor for class spacewar.InfoWin
inflictDamage(double) - Method in class spacewar.Ship
isAlive() - Method in class spacewar.SpaceObject
isCollision(SpaceObject, SpaceObject) - Static method in class spacewar.Game

K

KeyMapping - class spacewar.KeyMapping.
KeyMapping(int, int, int, int) - Constructor for class spacewar.KeyMapping
keyMapping1 - Static variable in class spacewar.KeyMapping
keyMapping2 - Static variable in class spacewar.KeyMapping
keyPressed(KeyEvent) - Method in class spacewar.Player
keyReleased(KeyEvent) - Method in class spacewar.Player
keyTyped(KeyEvent) - Method in class spacewar.Player

L

left - Variable in class spacewar.KeyMapping

M

MAX_DAMAGE - Static variable in class spacewar.Ship
Method - class coordination.Method.
Method(String) - Constructor for class coordination.Method
MethodState - class coordination.MethodState.
MethodState() - Constructor for class coordination.MethodState
 
Mutex - class coordination.Mutex.
Mutex(String[]) - Constructor for class coordination.Mutex
main(String[]) - Static method in class spacewar.Game
methodName - Variable in class coordination.Selfex
methodNames - Variable in class coordination.Mutex
methodStates - Variable in class coordination.Mutex

N

name - Variable in class coordination.Method
newPlayer(int) - Method in class spacewar.Game
newRobot(int) - Method in class spacewar.Game
newShip(Pilot) - Method in class spacewar.Game
noticeSizeChange() - Method in class spacewar.Display
noticeSizeChange() - Method in class spacewar.Display1
noticeSizeChange() - Method in class spacewar.Display2

O

offGraphics - Variable in class spacewar.Display
offImage - Variable in class spacewar.Display

P

Pilot - class spacewar.Pilot.
Pilot(Game, int) - Constructor for class spacewar.Pilot
Player - class spacewar.Player.
Player(Game, int) - Constructor for class spacewar.Player
paint(Graphics) - Method in class spacewar.Display
paintLevels(Graphics, Ship, int, int) - Static method in class spacewar.Display1
paintLevels(Graphics, Ship, int, int) - Method in class spacewar.Display2
paintObjects(Graphics) - Method in class spacewar.Display
paintObjects(Graphics) - Method in class spacewar.Display1
paintObjects(Graphics) - Method in class spacewar.Display2
paintStatus(Graphics) - Method in class spacewar.Display
paintStatus(Graphics) - Method in class spacewar.Display1
paintStatus(Graphics) - Method in class spacewar.Display2
prettyName - Variable in class coordination.Mutex
print(String) - Method in class spacewar.InfoWin
printNames() - Method in interface coordination.Exclusion
printNames() - Method in class coordination.Mutex
printNames() - Method in class coordination.Selfex
println(String) - Method in class spacewar.InfoWin
produceAPacket() - Method in class spacewar.EnergyPacketProducer

Q

quit() - Method in class spacewar.Game

R

Registry - class spacewar.Registry.
Registry(Game) - Constructor for class spacewar.Registry
Registry.RegistrationProtection - class spacewar.Registry.RegistrationProtection.
Registry.RegistrationProtection() - Constructor for class spacewar.Registry.RegistrationProtection
 
RegistrySynchronization - class spacewar.RegistrySynchronization.
RegistrySynchronization() - Constructor for class spacewar.RegistrySynchronization
Robot - class spacewar.Robot.
Robot(Game, int) - Constructor for class spacewar.Robot
register(SpaceObject) - Method in class spacewar.Registry
removeExclusion(Exclusion) - Method in class coordination.Method
removeMutex(String[]) - Method in class coordination.Coordinator
removeSelfex(String) - Method in class coordination.Coordinator
repairDamage(double) - Method in class spacewar.Ship
resetShips() - Method in class spacewar.Game
right - Variable in class spacewar.KeyMapping
rotate(int) - Method in class spacewar.Ship
run() - Method in class spacewar.EnergyPacketProducer
run() - Method in class spacewar.Game
run() - Method in class spacewar.Robot
run() - Method in class spacewar.Timer

S

STOP - Static variable in class spacewar.Ship
SWFrame - class spacewar.SWFrame.
SWFrame(Game, Display) - Constructor for class spacewar.SWFrame
Selfex - class coordination.Selfex.
Selfex(String) - Constructor for class coordination.Selfex
Ship - class spacewar.Ship.
Ship(Game, double, double, double) - Constructor for class spacewar.Ship
SpaceObject - class spacewar.SpaceObject.
SpaceObject(Game, double, double, double, double) - Constructor for class spacewar.SpaceObject
setAcceleration(double) - Method in class spacewar.Ship
setAngularVelocity(double) - Method in class spacewar.Ship
setIsAlive(boolean) - Method in class spacewar.SpaceObject
setPilot(Pilot) - Method in class spacewar.Ship
setShip(Ship) - Method in class spacewar.Pilot
setXVel(double) - Method in class spacewar.SpaceObject
setYVel(double) - Method in class spacewar.SpaceObject
ship - Variable in class spacewar.Pilot
sleepForABit(int) - Method in class spacewar.Robot
spacewar - package spacewar
 
start() - Method in class spacewar.Robot

T

TimeoutException - exception coordination.TimeoutException.
TimeoutException(long) - Constructor for class coordination.TimeoutException
Timer - class spacewar.Timer.
Timer(Game) - Constructor for class spacewar.Timer
testExclusion(String) - Method in interface coordination.Exclusion
testExclusion(String) - Method in class coordination.Mutex
testExclusion(String) - Method in class coordination.Selfex
thread - Variable in class coordination.Selfex
threads - Variable in class coordination.MethodState
thrust - Variable in class spacewar.KeyMapping
thrust(boolean) - Method in class spacewar.Ship
time - Variable in class coordination.TimeoutException

U

unregister(SpaceObject) - Method in class spacewar.Registry
update(Graphics) - Method in class spacewar.Display

W

waitForABit() - Method in class spacewar.EnergyPacketProducer

A B C D E F G H I K L M N O P Q R S T U W

\ No newline at end of file diff --git a/ajdoc/testdata/spacewar/doc/index.html b/ajdoc/testdata/spacewar/doc/index.html new file mode 100644 index 000000000..ad1f45031 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/index.html @@ -0,0 +1,26 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="overview-summary.html">Non-frame version.</A> + + + diff --git a/ajdoc/testdata/spacewar/doc/overview-frame.html b/ajdoc/testdata/spacewar/doc/overview-frame.html new file mode 100644 index 000000000..e24892b93 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/overview-frame.html @@ -0,0 +1,44 @@ + + + + + + +Overview + + + + + + + + + + + + + + + +
+
+ + + + + +
All Classes +

+ +Packages +
+coordination +
+spacewar +
+

+ +

+  + + diff --git a/ajdoc/testdata/spacewar/doc/overview-summary.html b/ajdoc/testdata/spacewar/doc/overview-summary.html new file mode 100644 index 000000000..fbb24efda --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/overview-summary.html @@ -0,0 +1,146 @@ + + + + + + +Overview + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +


+ + + + + + + + + + + + + +
+Packages
coordination 
spacewar 
+ +


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/overview-tree.html b/ajdoc/testdata/spacewar/doc/overview-tree.html new file mode 100644 index 000000000..7032de900 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/overview-tree.html @@ -0,0 +1,182 @@ + + + + + + +Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For All Packages

+
+
+
Package Hierarchies:
coordination, spacewar
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/package-list b/ajdoc/testdata/spacewar/doc/package-list new file mode 100644 index 000000000..1a30b7044 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/package-list @@ -0,0 +1,2 @@ +coordination +spacewar diff --git a/ajdoc/testdata/spacewar/doc/packages.html b/ajdoc/testdata/spacewar/doc/packages.html new file mode 100644 index 000000000..c857dbd0c --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/packages.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+The front page has been relocated.Please see: +
+          Frame version +
+          Non-frame version.
+ + + diff --git a/ajdoc/testdata/spacewar/doc/resources/inherit.gif b/ajdoc/testdata/spacewar/doc/resources/inherit.gif new file mode 100644 index 000000000..c814867a1 Binary files /dev/null and b/ajdoc/testdata/spacewar/doc/resources/inherit.gif differ diff --git a/ajdoc/testdata/spacewar/doc/serialized-form.html b/ajdoc/testdata/spacewar/doc/serialized-form.html new file mode 100644 index 000000000..721c488c7 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/serialized-form.html @@ -0,0 +1 @@ +Serialized Form

Serialized Form


Package coordination

Class coordination.TimeoutException extends java.lang.Exception implements Serializable

Serialized Fields

time

long time



\ No newline at end of file diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Bullet.html b/ajdoc/testdata/spacewar/doc/spacewar/Bullet.html new file mode 100644 index 000000000..d80c6ec63 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Bullet.html @@ -0,0 +1,627 @@ + + + + + + +Bullet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class Bullet

+
+java.lang.Object
+  extended byspacewar.SpaceObject
+      extended byspacewar.Bullet
+
+
+
+
class Bullet
extends SpaceObject
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + +
+Constructor Summary
+(package private)Bullet(Game theGame, + double xP, + double yP, + double xV, + double yV) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  voidaccelerate(double dXVel, + double dYVel) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidclockTick() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voiddie() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetOldXPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetOldYPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  intgetSize() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetXPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetXVel() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetYPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetYVel() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidhandleCollision(SpaceObject obj) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  booleanisAlive() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetIsAlive(boolean n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetXVel(double n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetYVel(double n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+Bullet

+
+Bullet(Game theGame,
+       double xP,
+       double yP,
+       double xV,
+       double yV)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+getSize

+
+int getSize()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
getSize in class SpaceObject
+
+
+
+
+
+
+ +

+handleCollision

+
+void handleCollision(SpaceObject obj)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
handleCollision in class SpaceObject
+
+
+
+
+
+
+ +

+clockTick

+
+void clockTick()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Overrides:
clockTick in class SpaceObject
+
+
+
+
+
+
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getXPos

+
+double getXPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getYPos

+
+double getYPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getOldXPos

+
+double getOldXPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getOldYPos

+
+double getOldYPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getXVel

+
+double getXVel()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getYVel

+
+double getYVel()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setXVel

+
+void setXVel(double n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setYVel

+
+void setYVel(double n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+isAlive

+
+boolean isAlive()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setIsAlive

+
+void setIsAlive(boolean n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+accelerate

+
+void accelerate(double dXVel,
+                double dYVel)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+die

+
+void die()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Debug.html b/ajdoc/testdata/spacewar/doc/spacewar/Debug.html new file mode 100644 index 000000000..74a9f6d3c --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Debug.html @@ -0,0 +1,356 @@ + + + + + + +Debug + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Aspect Debug

+
+java.lang.Object
+  extended byspacewar.Debug
+
+
+
+
public class Debug
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + +
Pointcut Summary
(package private)allConstructorsCut()
 
(package private)allInitializationsCut()
 
(package private)allMethodsCut()
 

  + + + + + + + + + + + + + + + +
Advice Summary
afterReturning(SWFrame):
 
 Advises:spacewar.Display
+
+
before(): allConstructorsCut..
 
 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning, spacewar.Ship.fire, spacewar.EnergyPacketProducer.produceAPacket, spacewar.Display, spacewar.KeyMapping, spacewar.KeyMapping, spacewar.Game.main, spacewar.Game.main, spacewar.Game, spacewar.Game, spacewar.Game, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.newShip
+
+
afterReturning(): allConstructorsCut..
 
 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning, spacewar.Ship.fire, spacewar.EnergyPacketProducer.produceAPacket, spacewar.Display, spacewar.KeyMapping, spacewar.KeyMapping, spacewar.Game.main, spacewar.Game.main, spacewar.Game, spacewar.Game, spacewar.Game, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.newShip
+
+
before(): allInitializationsCut..
 
 Advises:spacewar.RegistrySynchronization, spacewar.GameSynchronization, spacewar.EnsureShipIsAlive, spacewar.Ship, spacewar.SpaceObject, spacewar.SWFrame, spacewar.EnergyPacketProducer, spacewar.Registry, spacewar.Display, spacewar.Display2, spacewar.Player, spacewar.Display1, spacewar.KeyMapping, spacewar.EnergyPacket, spacewar.Robot, spacewar.Game, spacewar.Pilot, spacewar.Bullet, spacewar.Timer
+
+
afterReturning(): allInitializationsCut..
 
 Advises:spacewar.RegistrySynchronization, spacewar.GameSynchronization, spacewar.EnsureShipIsAlive, spacewar.Ship, spacewar.SpaceObject, spacewar.SWFrame, spacewar.EnergyPacketProducer, spacewar.Registry, spacewar.Display, spacewar.Display2, spacewar.Player, spacewar.Display1, spacewar.KeyMapping, spacewar.EnergyPacket, spacewar.Robot, spacewar.Game, spacewar.Pilot, spacewar.Bullet, spacewar.Timer
+
+
before(): allMethodsCut..
 
 Advises:spacewar.Ship, spacewar.Bullet, spacewar.EnergyPacket, spacewar.Ship, spacewar.Bullet, spacewar.EnergyPacket, spacewar.Ship.getSize, spacewar.Ship.getEnergy, spacewar.Ship.getDamage, spacewar.Ship.getOrientation, spacewar.Ship.getRAcc, spacewar.Ship.getPilot, spacewar.Ship.setPilot, spacewar.Ship.getEnergyLevel, spacewar.Ship.getDamageLevel, spacewar.Ship.expendEnergy, spacewar.Ship.inflictDamage, spacewar.Ship.repairDamage, spacewar.Ship.clockTick, spacewar.Ship.setAcceleration, spacewar.Ship.setAngularVelocity, spacewar.Ship.rotate, spacewar.Ship.thrust, spacewar.Ship.fire, spacewar.Ship.handleCollision, spacewar.Ship.bounce, spacewar.SpaceObject.getGame, spacewar.SpaceObject.getXPos, spacewar.SpaceObject.getYPos, spacewar.SpaceObject.getOldXPos, spacewar.SpaceObject.getOldYPos, spacewar.SpaceObject.getXVel, spacewar.SpaceObject.getYVel, spacewar.SpaceObject.setXVel, spacewar.SpaceObject.setYVel, spacewar.SpaceObject.isAlive, spacewar.SpaceObject.setIsAlive, spacewar.SpaceObject.clockTick, spacewar.SpaceObject.accelerate, spacewar.SpaceObject.die, spacewar.SWFrame.getGame, spacewar.SWFrame.getDisplay, spacewar.SWFrame.getMenu, spacewar.SWFrame.actionPerformed, spacewar.EnergyPacketProducer.getGame, spacewar.EnergyPacketProducer.run, spacewar.EnergyPacketProducer.waitForABit, spacewar.EnergyPacketProducer.produceAPacket, spacewar.Registry.getGame, spacewar.Registry.register, spacewar.Registry.unregister, spacewar.Registry.dummy, spacewar.Registry.getObjects, spacewar.Registry.getShips, spacewar.Registry.getTable, spacewar.Registry.clockTick, spacewar.Display.getGame, spacewar.Display.getPilot1, spacewar.Display.getPilot2, spacewar.Display.noticeSizeChange, spacewar.Display.initializeOffImage, spacewar.Display.paint, spacewar.Display.update, spacewar.Display.paintObjects, spacewar.Display.paintStatus, spacewar.Display, spacewar.Display, spacewar.Display, spacewar.Display2.noticeSizeChange, spacewar.Display2.paintObjects, spacewar.Display2.paintStatus, spacewar.Display2.paintLevels, spacewar.Player.keyPressed, spacewar.Player.keyReleased, spacewar.Player.keyTyped, spacewar.Display1.noticeSizeChange, spacewar.Display1.paintObjects, spacewar.Display1.paintStatus, spacewar.Display1.paintLevels, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.EnergyPacket.getSize, spacewar.EnergyPacket.getEnergy, spacewar.EnergyPacket.handleCollision, spacewar.Robot.start, spacewar.Robot.destroy, spacewar.Robot.run, spacewar.Robot.sleepForABit, spacewar.Game.main, spacewar.Game.getRegistry, spacewar.Game.getPilot1, spacewar.Game.getPilot2, spacewar.Game.getWidth, spacewar.Game.getHeight, spacewar.Game.run, spacewar.Game.addRobot, spacewar.Game.resetShips, spacewar.Game.quit, spacewar.Game.error, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.newShip, spacewar.Game.clockTick, spacewar.Game.handleCollisions, spacewar.Game.isCollision, spacewar.Pilot.getGame, spacewar.Pilot.getNumber, spacewar.Pilot.getShip, spacewar.Pilot.setShip, spacewar.Bullet.getSize, spacewar.Bullet.handleCollision, spacewar.Bullet.clockTick, spacewar.Timer.getGame, spacewar.Timer.run
+
+
afterReturning(): allMethodsCut..
 
 Advises:spacewar.Ship, spacewar.Bullet, spacewar.EnergyPacket, spacewar.Ship, spacewar.Bullet, spacewar.EnergyPacket, spacewar.Ship.getSize, spacewar.Ship.getEnergy, spacewar.Ship.getDamage, spacewar.Ship.getOrientation, spacewar.Ship.getRAcc, spacewar.Ship.getPilot, spacewar.Ship.setPilot, spacewar.Ship.getEnergyLevel, spacewar.Ship.getDamageLevel, spacewar.Ship.expendEnergy, spacewar.Ship.inflictDamage, spacewar.Ship.repairDamage, spacewar.Ship.clockTick, spacewar.Ship.setAcceleration, spacewar.Ship.setAngularVelocity, spacewar.Ship.rotate, spacewar.Ship.thrust, spacewar.Ship.fire, spacewar.Ship.handleCollision, spacewar.Ship.bounce, spacewar.SpaceObject.getGame, spacewar.SpaceObject.getXPos, spacewar.SpaceObject.getYPos, spacewar.SpaceObject.getOldXPos, spacewar.SpaceObject.getOldYPos, spacewar.SpaceObject.getXVel, spacewar.SpaceObject.getYVel, spacewar.SpaceObject.setXVel, spacewar.SpaceObject.setYVel, spacewar.SpaceObject.isAlive, spacewar.SpaceObject.setIsAlive, spacewar.SpaceObject.clockTick, spacewar.SpaceObject.accelerate, spacewar.SpaceObject.die, spacewar.SWFrame.getGame, spacewar.SWFrame.getDisplay, spacewar.SWFrame.getMenu, spacewar.SWFrame.actionPerformed, spacewar.EnergyPacketProducer.getGame, spacewar.EnergyPacketProducer.run, spacewar.EnergyPacketProducer.waitForABit, spacewar.EnergyPacketProducer.produceAPacket, spacewar.Registry.getGame, spacewar.Registry.register, spacewar.Registry.unregister, spacewar.Registry.dummy, spacewar.Registry.getObjects, spacewar.Registry.getShips, spacewar.Registry.getTable, spacewar.Registry.clockTick, spacewar.Display.getGame, spacewar.Display.getPilot1, spacewar.Display.getPilot2, spacewar.Display.noticeSizeChange, spacewar.Display.initializeOffImage, spacewar.Display.paint, spacewar.Display.update, spacewar.Display.paintObjects, spacewar.Display.paintStatus, spacewar.Display, spacewar.Display, spacewar.Display, spacewar.Display2.noticeSizeChange, spacewar.Display2.paintObjects, spacewar.Display2.paintStatus, spacewar.Display2.paintLevels, spacewar.Player.keyPressed, spacewar.Player.keyReleased, spacewar.Player.keyTyped, spacewar.Display1.noticeSizeChange, spacewar.Display1.paintObjects, spacewar.Display1.paintStatus, spacewar.Display1.paintLevels, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.EnergyPacket.getSize, spacewar.EnergyPacket.getEnergy, spacewar.EnergyPacket.handleCollision, spacewar.Robot.start, spacewar.Robot.destroy, spacewar.Robot.run, spacewar.Robot.sleepForABit, spacewar.Game.main, spacewar.Game.getRegistry, spacewar.Game.getPilot1, spacewar.Game.getPilot2, spacewar.Game.getWidth, spacewar.Game.getHeight, spacewar.Game.run, spacewar.Game.addRobot, spacewar.Game.resetShips, spacewar.Game.quit, spacewar.Game.error, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.newShip, spacewar.Game.clockTick, spacewar.Game.handleCollisions, spacewar.Game.isCollision, spacewar.Pilot.getGame, spacewar.Pilot.getNumber, spacewar.Pilot.getShip, spacewar.Pilot.setShip, spacewar.Bullet.getSize, spacewar.Bullet.handleCollision, spacewar.Bullet.clockTick, spacewar.Timer.getGame, spacewar.Timer.run
+
+
afterReturning(Object): ..
 
 Advises:spacewar.Ship.bounce, spacewar.Ship.bounce, spacewar.Registry.clockTick, spacewar.Game.clockTick, spacewar.Timer.run
+
+
afterReturning(Registry): ..
 
 Advises:spacewar.SpaceObject, spacewar.SpaceObject.die, spacewar.Registry.dummy, spacewar.Registry.dummy
+
+
afterReturning():
 
 Advises:spacewar.Player.keyPressed, spacewar.Robot.run
+
+
afterReturning(Ship, SpaceObject): ..
 null
+
afterReturning(Ship, Ship): ..
 
 Advises:spacewar.Ship.bounce
+
+
before(Ship, double): ..
 
 Advises:spacewar.Ship.handleCollision, spacewar.Ship.bounce, spacewar.Ship.bounce
+
+

  + + + + + + + + + + + + + +
+Constructor Summary
Debug() + +
+           
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Pointcut Detail
+

allConstructorsCut()


+ +

allInitializationsCut()


+ +

allMethodsCut()

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(SWFrame): +

 Advises:spacewar.Display
+ +


+ +

before

before(): allConstructorsCut.. +

 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning, spacewar.Ship.fire, spacewar.EnergyPacketProducer.produceAPacket, spacewar.Display, spacewar.KeyMapping, spacewar.KeyMapping, spacewar.Game.main, spacewar.Game.main, spacewar.Game, spacewar.Game, spacewar.Game, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.newShip
+ +


+ +

afterReturning

afterReturning(): allConstructorsCut.. +

 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning, spacewar.Ship.fire, spacewar.EnergyPacketProducer.produceAPacket, spacewar.Display, spacewar.KeyMapping, spacewar.KeyMapping, spacewar.Game.main, spacewar.Game.main, spacewar.Game, spacewar.Game, spacewar.Game, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.newShip
+ +


+ +

before

before(): allInitializationsCut.. +

 Advises:spacewar.RegistrySynchronization, spacewar.GameSynchronization, spacewar.EnsureShipIsAlive, spacewar.Ship, spacewar.SpaceObject, spacewar.SWFrame, spacewar.EnergyPacketProducer, spacewar.Registry, spacewar.Display, spacewar.Display2, spacewar.Player, spacewar.Display1, spacewar.KeyMapping, spacewar.EnergyPacket, spacewar.Robot, spacewar.Game, spacewar.Pilot, spacewar.Bullet, spacewar.Timer
+ +


+ +

afterReturning

afterReturning(): allInitializationsCut.. +

 Advises:spacewar.RegistrySynchronization, spacewar.GameSynchronization, spacewar.EnsureShipIsAlive, spacewar.Ship, spacewar.SpaceObject, spacewar.SWFrame, spacewar.EnergyPacketProducer, spacewar.Registry, spacewar.Display, spacewar.Display2, spacewar.Player, spacewar.Display1, spacewar.KeyMapping, spacewar.EnergyPacket, spacewar.Robot, spacewar.Game, spacewar.Pilot, spacewar.Bullet, spacewar.Timer
+ +


+ +

before

before(): allMethodsCut.. +

 Advises:spacewar.Ship, spacewar.Bullet, spacewar.EnergyPacket, spacewar.Ship, spacewar.Bullet, spacewar.EnergyPacket, spacewar.Ship.getSize, spacewar.Ship.getEnergy, spacewar.Ship.getDamage, spacewar.Ship.getOrientation, spacewar.Ship.getRAcc, spacewar.Ship.getPilot, spacewar.Ship.setPilot, spacewar.Ship.getEnergyLevel, spacewar.Ship.getDamageLevel, spacewar.Ship.expendEnergy, spacewar.Ship.inflictDamage, spacewar.Ship.repairDamage, spacewar.Ship.clockTick, spacewar.Ship.setAcceleration, spacewar.Ship.setAngularVelocity, spacewar.Ship.rotate, spacewar.Ship.thrust, spacewar.Ship.fire, spacewar.Ship.handleCollision, spacewar.Ship.bounce, spacewar.SpaceObject.getGame, spacewar.SpaceObject.getXPos, spacewar.SpaceObject.getYPos, spacewar.SpaceObject.getOldXPos, spacewar.SpaceObject.getOldYPos, spacewar.SpaceObject.getXVel, spacewar.SpaceObject.getYVel, spacewar.SpaceObject.setXVel, spacewar.SpaceObject.setYVel, spacewar.SpaceObject.isAlive, spacewar.SpaceObject.setIsAlive, spacewar.SpaceObject.clockTick, spacewar.SpaceObject.accelerate, spacewar.SpaceObject.die, spacewar.SWFrame.getGame, spacewar.SWFrame.getDisplay, spacewar.SWFrame.getMenu, spacewar.SWFrame.actionPerformed, spacewar.EnergyPacketProducer.getGame, spacewar.EnergyPacketProducer.run, spacewar.EnergyPacketProducer.waitForABit, spacewar.EnergyPacketProducer.produceAPacket, spacewar.Registry.getGame, spacewar.Registry.register, spacewar.Registry.unregister, spacewar.Registry.dummy, spacewar.Registry.getObjects, spacewar.Registry.getShips, spacewar.Registry.getTable, spacewar.Registry.clockTick, spacewar.Display.getGame, spacewar.Display.getPilot1, spacewar.Display.getPilot2, spacewar.Display.noticeSizeChange, spacewar.Display.initializeOffImage, spacewar.Display.paint, spacewar.Display.update, spacewar.Display.paintObjects, spacewar.Display.paintStatus, spacewar.Display, spacewar.Display, spacewar.Display, spacewar.Display2.noticeSizeChange, spacewar.Display2.paintObjects, spacewar.Display2.paintStatus, spacewar.Display2.paintLevels, spacewar.Player.keyPressed, spacewar.Player.keyReleased, spacewar.Player.keyTyped, spacewar.Display1.noticeSizeChange, spacewar.Display1.paintObjects, spacewar.Display1.paintStatus, spacewar.Display1.paintLevels, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.EnergyPacket.getSize, spacewar.EnergyPacket.getEnergy, spacewar.EnergyPacket.handleCollision, spacewar.Robot.start, spacewar.Robot.destroy, spacewar.Robot.run, spacewar.Robot.sleepForABit, spacewar.Game.main, spacewar.Game.getRegistry, spacewar.Game.getPilot1, spacewar.Game.getPilot2, spacewar.Game.getWidth, spacewar.Game.getHeight, spacewar.Game.run, spacewar.Game.addRobot, spacewar.Game.resetShips, spacewar.Game.quit, spacewar.Game.error, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.newShip, spacewar.Game.clockTick, spacewar.Game.handleCollisions, spacewar.Game.isCollision, spacewar.Pilot.getGame, spacewar.Pilot.getNumber, spacewar.Pilot.getShip, spacewar.Pilot.setShip, spacewar.Bullet.getSize, spacewar.Bullet.handleCollision, spacewar.Bullet.clockTick, spacewar.Timer.getGame, spacewar.Timer.run
+ +


+ +

afterReturning

afterReturning(): allMethodsCut.. +

 Advises:spacewar.Ship, spacewar.Bullet, spacewar.EnergyPacket, spacewar.Ship, spacewar.Bullet, spacewar.EnergyPacket, spacewar.Ship.getSize, spacewar.Ship.getEnergy, spacewar.Ship.getDamage, spacewar.Ship.getOrientation, spacewar.Ship.getRAcc, spacewar.Ship.getPilot, spacewar.Ship.setPilot, spacewar.Ship.getEnergyLevel, spacewar.Ship.getDamageLevel, spacewar.Ship.expendEnergy, spacewar.Ship.inflictDamage, spacewar.Ship.repairDamage, spacewar.Ship.clockTick, spacewar.Ship.setAcceleration, spacewar.Ship.setAngularVelocity, spacewar.Ship.rotate, spacewar.Ship.thrust, spacewar.Ship.fire, spacewar.Ship.handleCollision, spacewar.Ship.bounce, spacewar.SpaceObject.getGame, spacewar.SpaceObject.getXPos, spacewar.SpaceObject.getYPos, spacewar.SpaceObject.getOldXPos, spacewar.SpaceObject.getOldYPos, spacewar.SpaceObject.getXVel, spacewar.SpaceObject.getYVel, spacewar.SpaceObject.setXVel, spacewar.SpaceObject.setYVel, spacewar.SpaceObject.isAlive, spacewar.SpaceObject.setIsAlive, spacewar.SpaceObject.clockTick, spacewar.SpaceObject.accelerate, spacewar.SpaceObject.die, spacewar.SWFrame.getGame, spacewar.SWFrame.getDisplay, spacewar.SWFrame.getMenu, spacewar.SWFrame.actionPerformed, spacewar.EnergyPacketProducer.getGame, spacewar.EnergyPacketProducer.run, spacewar.EnergyPacketProducer.waitForABit, spacewar.EnergyPacketProducer.produceAPacket, spacewar.Registry.getGame, spacewar.Registry.register, spacewar.Registry.unregister, spacewar.Registry.dummy, spacewar.Registry.getObjects, spacewar.Registry.getShips, spacewar.Registry.getTable, spacewar.Registry.clockTick, spacewar.Display.getGame, spacewar.Display.getPilot1, spacewar.Display.getPilot2, spacewar.Display.noticeSizeChange, spacewar.Display.initializeOffImage, spacewar.Display.paint, spacewar.Display.update, spacewar.Display.paintObjects, spacewar.Display.paintStatus, spacewar.Display, spacewar.Display, spacewar.Display, spacewar.Display2.noticeSizeChange, spacewar.Display2.paintObjects, spacewar.Display2.paintStatus, spacewar.Display2.paintLevels, spacewar.Player.keyPressed, spacewar.Player.keyReleased, spacewar.Player.keyTyped, spacewar.Display1.noticeSizeChange, spacewar.Display1.paintObjects, spacewar.Display1.paintStatus, spacewar.Display1.paintLevels, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.Display1, spacewar.EnergyPacket.getSize, spacewar.EnergyPacket.getEnergy, spacewar.EnergyPacket.handleCollision, spacewar.Robot.start, spacewar.Robot.destroy, spacewar.Robot.run, spacewar.Robot.sleepForABit, spacewar.Game.main, spacewar.Game.getRegistry, spacewar.Game.getPilot1, spacewar.Game.getPilot2, spacewar.Game.getWidth, spacewar.Game.getHeight, spacewar.Game.run, spacewar.Game.addRobot, spacewar.Game.resetShips, spacewar.Game.quit, spacewar.Game.error, spacewar.Game.newPlayer, spacewar.Game.newRobot, spacewar.Game.newShip, spacewar.Game.clockTick, spacewar.Game.handleCollisions, spacewar.Game.isCollision, spacewar.Pilot.getGame, spacewar.Pilot.getNumber, spacewar.Pilot.getShip, spacewar.Pilot.setShip, spacewar.Bullet.getSize, spacewar.Bullet.handleCollision, spacewar.Bullet.clockTick, spacewar.Timer.getGame, spacewar.Timer.run
+ +


+ +

afterReturning

afterReturning(Object): .. +

 Advises:spacewar.Ship.bounce, spacewar.Ship.bounce, spacewar.Registry.clockTick, spacewar.Game.clockTick, spacewar.Timer.run
+ +


+ +

afterReturning

afterReturning(Registry): .. +

 Advises:spacewar.SpaceObject, spacewar.SpaceObject.die, spacewar.Registry.dummy, spacewar.Registry.dummy
+ +


+ +

afterReturning

afterReturning(): +

 Advises:spacewar.Player.keyPressed, spacewar.Robot.run
+ +


+ +

afterReturning

afterReturning(Ship, SpaceObject): .. +

null


+ +

afterReturning

afterReturning(Ship, Ship): .. +

 Advises:spacewar.Ship.bounce
+ +


+ +

before

before(Ship, double): .. +

 Advises:spacewar.Ship.handleCollision, spacewar.Ship.bounce, spacewar.Ship.bounce
+ +

+ + + + + + + + + +
+Constructor Detail
+ +

+Debug

+
+public Debug()
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Display.DisplayAspect.html b/ajdoc/testdata/spacewar/doc/spacewar/Display.DisplayAspect.html new file mode 100644 index 000000000..596c3c5a2 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Display.DisplayAspect.html @@ -0,0 +1,276 @@ + + + + + + +Display.DisplayAspect + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Aspect Display.DisplayAspect

+
+java.lang.Object
+  extended byspacewar.Display.DisplayAspect
+
+
+
Enclosing class:
Display
+
+
+
+
public static class Display.DisplayAspect
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + +
Advice Summary
afterReturning(String, Game): ..
 
 Advises:spacewar.Game.main, spacewar.Game.main
+
+
afterReturning(Player):
 
 Advises:spacewar.Game.newPlayer
+
+
afterReturning(Display):
 
 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning
+
+
afterReturning(Display): ..
 
 Advises:spacewar.SWFrame
+
+
afterReturning():
 
 Advises:spacewar.Timer.run
+
+

  + + + + + + + + + + + + + +
+Constructor Summary
Display.DisplayAspect() + +
+           
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(String, Game): .. +

 Advises:spacewar.Game.main, spacewar.Game.main
+ +


+ +

afterReturning

afterReturning(Player): +

 Advises:spacewar.Game.newPlayer
+ +


+ +

afterReturning

afterReturning(Display): +

 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning
+ +


+ +

afterReturning

afterReturning(Display): .. +

 Advises:spacewar.SWFrame
+ +


+ +

afterReturning

afterReturning(): +

 Advises:spacewar.Timer.run
+ +

+ + + + + + + + + +
+Constructor Detail
+ +

+Display.DisplayAspect

+
+public Display.DisplayAspect()
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Display.html b/ajdoc/testdata/spacewar/doc/spacewar/Display.html new file mode 100644 index 000000000..a6ecc1b19 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Display.html @@ -0,0 +1,646 @@ + + + + + + +Display + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Aspect Display

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Canvas
+          extended byspacewar.Display
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
+
+
+
Direct Known Subclasses:
Display1, Display2
+
+
+
+
class Display
extends java.awt.Canvas
+ +

+ +

+ +

+

+
+
+ +

+ + + + + + + + + + + +
+Nested Class Summary
+static classDisplay.DisplayAspect + +
+          
+ + + + + + + +
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
+ + + + + + + +
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
+  + + + + + + + + +
Advice Summary
afterReturning(String, Game): ..
 
 Advises:spacewar.Game.main, spacewar.Game.main
+
+
afterReturning(Player):
 
 Advises:spacewar.Game.newPlayer
+
+
afterReturning(Display):
 
 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning
+
+
afterReturning(Display): ..
 
 Advises:spacewar.SWFrame
+
+
afterReturning():
 
 Advises:spacewar.Timer.run
+
+

  + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+(package private)  SWFrameframe + +
+          
+(package private)  Gamegame + +
+          
+(package private)  java.awt.GraphicsoffGraphics + +
+          
+(package private)  java.awt.ImageoffImage + +
+          
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Display(Game g) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) static PilotgetPilot1() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) static PilotgetPilot2() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidnoticeSizeChange() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidpaint(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidpaintObjects(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidpaintStatus(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidupdate(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ +

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(String, Game): .. +

 Advises:spacewar.Game.main, spacewar.Game.main
+ +


+ +

afterReturning

afterReturning(Player): +

 Advises:spacewar.Game.newPlayer
+ +


+ +

afterReturning

afterReturning(Display): +

 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning
+ +


+ +

afterReturning

afterReturning(Display): .. +

 Advises:spacewar.SWFrame
+ +


+ +

afterReturning

afterReturning(): +

 Advises:spacewar.Timer.run
+ +

+ + + + + + +
+Field Detail
+ +

+game

+
+Game game
+
+
+

+

+
+
+
+ +

+frame

+
+SWFrame frame
+
+
+

+

+
+
+
+ +

+offImage

+
+java.awt.Image offImage
+
+
+

+

+
+
+
+ +

+offGraphics

+
+java.awt.Graphics offGraphics
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Display

+
+Display(Game g)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getPilot1

+
+static Pilot getPilot1()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getPilot2

+
+static Pilot getPilot2()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+noticeSizeChange

+
+void noticeSizeChange()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+paint

+
+public void paint(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+update

+
+public void update(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+paintObjects

+
+void paintObjects(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+paintStatus

+
+void paintStatus(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Display1.SpaceObjectPainting.html b/ajdoc/testdata/spacewar/doc/spacewar/Display1.SpaceObjectPainting.html new file mode 100644 index 000000000..676a504f1 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Display1.SpaceObjectPainting.html @@ -0,0 +1,244 @@ + + + + + + +Display1.SpaceObjectPainting + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Aspect Display1.SpaceObjectPainting

+
+java.lang.Object
+  extended byspacewar.Display1.SpaceObjectPainting
+
+
+
Enclosing class:
Display1
+
+
+
+
public static class Display1.SpaceObjectPainting
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + +
Advice Summary
afterReturning(Pilot, Ship): ..
 
 Advises:spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot
+
+

  + + + + + + + + + + + + + +
+Constructor Summary
Display1.SpaceObjectPainting() + +
+           
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(Pilot, Ship): .. +

 Advises:spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot
+ +

+ + + + + + + + + +
+Constructor Detail
+ +

+Display1.SpaceObjectPainting

+
+public Display1.SpaceObjectPainting()
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Display1.html b/ajdoc/testdata/spacewar/doc/spacewar/Display1.html new file mode 100644 index 000000000..b5e6d5305 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Display1.html @@ -0,0 +1,709 @@ + + + + + + +Display1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Aspect Display1

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Canvas
+          extended byspacewar.Display
+              extended byspacewar.Display1
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
+
+
+
+
class Display1
extends Display
+ +

+ +

+ +

+

+
+
+ +

+ + + + + + + + + + + + + + + +
+Nested Class Summary
+static classDisplay.DisplayAspect + +
+          
+static classDisplay1.SpaceObjectPainting + +
+          
+ + + + + + + +
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
+ + + + + + + +
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
+  + + + + + + + + +
Advice Summary
afterReturning(String, Game): ..
 
 Advises:spacewar.Game.main, spacewar.Game.main
+
+
afterReturning(Player):
 
 Advises:spacewar.Game.newPlayer
+
+
afterReturning(Display):
 
 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning
+
+
afterReturning(Display): ..
 
 Advises:spacewar.SWFrame
+
+
afterReturning():
 
 Advises:spacewar.Timer.run
+
+

  + + + + +
Advice Summary
afterReturning(Pilot, Ship): ..
 
 Advises:spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot
+
+

  + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+(package private)  SWFrameframe + +
+          
+(package private)  Gamegame + +
+          
+(package private)  java.awt.GraphicsoffGraphics + +
+          
+(package private)  java.awt.ImageoffImage + +
+          
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Display1(Game game) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) static PilotgetPilot1() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) static PilotgetPilot2() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidnoticeSizeChange() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidpaint(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) static voidpaintLevels(java.awt.Graphics g, + Ship ship, + int top, + int left) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidpaintObjects(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidpaintStatus(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidupdate(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ +

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(String, Game): .. +

 Advises:spacewar.Game.main, spacewar.Game.main
+ +


+ +

afterReturning

afterReturning(Player): +

 Advises:spacewar.Game.newPlayer
+ +


+ +

afterReturning

afterReturning(Display): +

 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning
+ +


+ +

afterReturning

afterReturning(Display): .. +

 Advises:spacewar.SWFrame
+ +


+ +

afterReturning

afterReturning(): +

 Advises:spacewar.Timer.run
+ +

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(Pilot, Ship): .. +

 Advises:spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot
+ +

+ + + + + + +
+Field Detail
+ +

+game

+
+Game game
+
+
+

+

+
+
+
+ +

+frame

+
+SWFrame frame
+
+
+

+

+
+
+
+ +

+offImage

+
+java.awt.Image offImage
+
+
+

+

+
+
+
+ +

+offGraphics

+
+java.awt.Graphics offGraphics
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Display1

+
+Display1(Game game)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+noticeSizeChange

+
+void noticeSizeChange()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Overrides:
noticeSizeChange in class Display
+
+
+
+
+
+
+ +

+paintObjects

+
+void paintObjects(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Overrides:
paintObjects in class Display
+
+
+
+
+
+
+ +

+paintStatus

+
+void paintStatus(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Overrides:
paintStatus in class Display
+
+
+
+
+
+
+ +

+paintLevels

+
+static void paintLevels(java.awt.Graphics g,
+                        Ship ship,
+                        int top,
+                        int left)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getPilot1

+
+static Pilot getPilot1()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getPilot2

+
+static Pilot getPilot2()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+paint

+
+public void paint(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+update

+
+public void update(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Display2.SpaceObjectPainting.html b/ajdoc/testdata/spacewar/doc/spacewar/Display2.SpaceObjectPainting.html new file mode 100644 index 000000000..c7e15f1f4 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Display2.SpaceObjectPainting.html @@ -0,0 +1,244 @@ + + + + + + +Display2.SpaceObjectPainting + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Aspect Display2.SpaceObjectPainting

+
+java.lang.Object
+  extended byspacewar.Display2.SpaceObjectPainting
+
+
+
Enclosing class:
Display2
+
+
+
+
public static class Display2.SpaceObjectPainting
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + +
Advice Summary
afterReturning(Pilot, Ship): ..
 
 Advises:spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot
+
+

  + + + + + + + + + + + + + +
+Constructor Summary
Display2.SpaceObjectPainting() + +
+           
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(Pilot, Ship): .. +

 Advises:spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot
+ +

+ + + + + + + + + +
+Constructor Detail
+ +

+Display2.SpaceObjectPainting

+
+public Display2.SpaceObjectPainting()
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Display2.html b/ajdoc/testdata/spacewar/doc/spacewar/Display2.html new file mode 100644 index 000000000..b3c3f1d2a --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Display2.html @@ -0,0 +1,709 @@ + + + + + + +Display2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Aspect Display2

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Canvas
+          extended byspacewar.Display
+              extended byspacewar.Display2
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
+
+
+
+
class Display2
extends Display
+ +

+ +

+ +

+

+
+
+ +

+ + + + + + + + + + + + + + + +
+Nested Class Summary
+static classDisplay.DisplayAspect + +
+          
+static classDisplay2.SpaceObjectPainting + +
+          
+ + + + + + + +
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
+ + + + + + + +
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
+  + + + + + + + + +
Advice Summary
afterReturning(String, Game): ..
 
 Advises:spacewar.Game.main, spacewar.Game.main
+
+
afterReturning(Player):
 
 Advises:spacewar.Game.newPlayer
+
+
afterReturning(Display):
 
 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning
+
+
afterReturning(Display): ..
 
 Advises:spacewar.SWFrame
+
+
afterReturning():
 
 Advises:spacewar.Timer.run
+
+

  + + + + +
Advice Summary
afterReturning(Pilot, Ship): ..
 
 Advises:spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot
+
+

  + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+(package private)  SWFrameframe + +
+          
+(package private)  Gamegame + +
+          
+(package private)  java.awt.GraphicsoffGraphics + +
+          
+(package private)  java.awt.ImageoffImage + +
+          
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Display2(Game game) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) static PilotgetPilot1() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) static PilotgetPilot2() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidnoticeSizeChange() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidpaint(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidpaintLevels(java.awt.Graphics g, + Ship ship, + int top, + int left) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidpaintObjects(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidpaintStatus(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidupdate(java.awt.Graphics g) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ +

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(String, Game): .. +

 Advises:spacewar.Game.main, spacewar.Game.main
+ +


+ +

afterReturning

afterReturning(Player): +

 Advises:spacewar.Game.newPlayer
+ +


+ +

afterReturning

afterReturning(Display): +

 Advises:spacewar.DisplayAspect.afterReturning, spacewar.DisplayAspect.afterReturning
+ +


+ +

afterReturning

afterReturning(Display): .. +

 Advises:spacewar.SWFrame
+ +


+ +

afterReturning

afterReturning(): +

 Advises:spacewar.Timer.run
+ +

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(Pilot, Ship): .. +

 Advises:spacewar.Robot.run, spacewar.Game.resetShips, spacewar.Game.newPlayer, spacewar.Game.newRobot
+ +

+ + + + + + +
+Field Detail
+ +

+game

+
+Game game
+
+
+

+

+
+
+
+ +

+frame

+
+SWFrame frame
+
+
+

+

+
+
+
+ +

+offImage

+
+java.awt.Image offImage
+
+
+

+

+
+
+
+ +

+offGraphics

+
+java.awt.Graphics offGraphics
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Display2

+
+Display2(Game game)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+noticeSizeChange

+
+void noticeSizeChange()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Overrides:
noticeSizeChange in class Display
+
+
+
+
+
+
+ +

+paintObjects

+
+void paintObjects(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Overrides:
paintObjects in class Display
+
+
+
+
+
+
+ +

+paintStatus

+
+void paintStatus(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Overrides:
paintStatus in class Display
+
+
+
+
+
+
+ +

+paintLevels

+
+void paintLevels(java.awt.Graphics g,
+                 Ship ship,
+                 int top,
+                 int left)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getPilot1

+
+static Pilot getPilot1()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getPilot2

+
+static Pilot getPilot2()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+paint

+
+public void paint(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+update

+
+public void update(java.awt.Graphics g)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/EnergyPacket.html b/ajdoc/testdata/spacewar/doc/spacewar/EnergyPacket.html new file mode 100644 index 000000000..8bc5338ef --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/EnergyPacket.html @@ -0,0 +1,649 @@ + + + + + + +EnergyPacket + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class EnergyPacket

+
+java.lang.Object
+  extended byspacewar.SpaceObject
+      extended byspacewar.EnergyPacket
+
+
+
+
class EnergyPacket
extends SpaceObject
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + +
+Constructor Summary
+(package private)EnergyPacket(Game theGame, + double xP, + double yP, + double xV, + double yV, + double e) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  voidaccelerate(double dXVel, + double dYVel) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidclockTick() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voiddie() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetEnergy() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetOldXPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetOldYPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  intgetSize() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetXPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetXVel() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetYPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetYVel() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidhandleCollision(SpaceObject obj) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  booleanisAlive() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetIsAlive(boolean n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetXVel(double n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetYVel(double n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+EnergyPacket

+
+EnergyPacket(Game theGame,
+             double xP,
+             double yP,
+             double xV,
+             double yV,
+             double e)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+getSize

+
+int getSize()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
getSize in class SpaceObject
+
+
+
+
+
+
+ +

+getEnergy

+
+double getEnergy()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+handleCollision

+
+void handleCollision(SpaceObject obj)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
handleCollision in class SpaceObject
+
+
+
+
+
+
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getXPos

+
+double getXPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getYPos

+
+double getYPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getOldXPos

+
+double getOldXPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getOldYPos

+
+double getOldYPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getXVel

+
+double getXVel()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getYVel

+
+double getYVel()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setXVel

+
+void setXVel(double n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setYVel

+
+void setYVel(double n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+isAlive

+
+boolean isAlive()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setIsAlive

+
+void setIsAlive(boolean n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+clockTick

+
+void clockTick()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+accelerate

+
+void accelerate(double dXVel,
+                double dYVel)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+die

+
+void die()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/EnergyPacketProducer.html b/ajdoc/testdata/spacewar/doc/spacewar/EnergyPacketProducer.html new file mode 100644 index 000000000..3603dac31 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/EnergyPacketProducer.html @@ -0,0 +1,360 @@ + + + + + + +EnergyPacketProducer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class EnergyPacketProducer

+
+java.lang.Object
+  extended byjava.lang.Thread
+      extended byspacewar.EnergyPacketProducer
+
+
+
All Implemented Interfaces:
java.lang.Runnable
+
+
+
+
class EnergyPacketProducer
extends java.lang.Thread
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)EnergyPacketProducer(Game theGame) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidproduceAPacket() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidrun() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidwaitForABit() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+EnergyPacketProducer

+
+EnergyPacketProducer(Game theGame)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+run

+
+public void run()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+waitForABit

+
+void waitForABit()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+produceAPacket

+
+void produceAPacket()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/EnsureShipIsAlive.html b/ajdoc/testdata/spacewar/doc/spacewar/EnsureShipIsAlive.html new file mode 100644 index 000000000..2a297b361 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/EnsureShipIsAlive.html @@ -0,0 +1,241 @@ + + + + + + +EnsureShipIsAlive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Aspect EnsureShipIsAlive

+
+java.lang.Object
+  extended byspacewar.EnsureShipIsAlive
+
+
+
+
public class EnsureShipIsAlive
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + +
Advice Summary
around(Ship): helmCommandsCut..
 
 Advises:spacewar.Player.keyPressed, spacewar.Player.keyPressed, spacewar.Player.keyPressed, spacewar.Player.keyPressed, spacewar.Player.keyReleased, spacewar.Player.keyReleased, spacewar.Robot.run, spacewar.Robot.run, spacewar.Robot.run, spacewar.Robot.run, spacewar.Robot.run, spacewar.Robot.run
+
+

  + + + + + + + + + + + + + +
+Constructor Summary
EnsureShipIsAlive() + +
+           
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Advice Detail
+

around

around(Ship): helmCommandsCut.. +

 Advises:spacewar.Player.keyPressed, spacewar.Player.keyPressed, spacewar.Player.keyPressed, spacewar.Player.keyPressed, spacewar.Player.keyReleased, spacewar.Player.keyReleased, spacewar.Robot.run, spacewar.Robot.run, spacewar.Robot.run, spacewar.Robot.run, spacewar.Robot.run, spacewar.Robot.run
+ +

+ + + + + + + + + +
+Constructor Detail
+ +

+EnsureShipIsAlive

+
+public EnsureShipIsAlive()
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Game.html b/ajdoc/testdata/spacewar/doc/spacewar/Game.html new file mode 100644 index 000000000..e79e8a434 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Game.html @@ -0,0 +1,659 @@ + + + + + + +Game + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class Game

+
+java.lang.Object
+  extended byjava.lang.Thread
+      extended byspacewar.Game
+
+
+
All Implemented Interfaces:
java.lang.Runnable
+
+
+
+
public class Game
extends java.lang.Thread
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
+  + + + + + + + + + + +
+Constructor Summary
Game(java.lang.String mode) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  voidaddRobot() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidclockTick() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voiderror(java.lang.Object o) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  intgetHeight() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  PilotgetPilot1() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  PilotgetPilot2() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  RegistrygetRegistry() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  intgetWidth() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidhandleCollisions() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) static booleanisCollision(SpaceObject a, + SpaceObject b) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+static voidmain(java.lang.String[] args) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  PlayernewPlayer(int number) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  RobotnewRobot(int number) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  ShipnewShip(Pilot pilot) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidquit() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidresetShips() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidrun() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+Game

+
+public Game(java.lang.String mode)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+main

+
+public static void main(java.lang.String[] args)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getRegistry

+
+Registry getRegistry()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getPilot1

+
+Pilot getPilot1()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getPilot2

+
+Pilot getPilot2()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getWidth

+
+int getWidth()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getHeight

+
+int getHeight()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+run

+
+public void run()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+addRobot

+
+void addRobot()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+resetShips

+
+void resetShips()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+quit

+
+void quit()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+error

+
+void error(java.lang.Object o)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+newPlayer

+
+Player newPlayer(int number)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+newRobot

+
+Robot newRobot(int number)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+newShip

+
+Ship newShip(Pilot pilot)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+clockTick

+
+void clockTick()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+handleCollisions

+
+void handleCollisions()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+isCollision

+
+static boolean isCollision(SpaceObject a,
+                           SpaceObject b)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/GameSynchronization.html b/ajdoc/testdata/spacewar/doc/spacewar/GameSynchronization.html new file mode 100644 index 000000000..75a0bc59e --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/GameSynchronization.html @@ -0,0 +1,249 @@ + + + + + + +GameSynchronization + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class GameSynchronization

+
+java.lang.Object
+  extended bycoordination.Coordinator
+      extended byspacewar.GameSynchronization
+
+
+
+
public class GameSynchronization
extends Coordinator
+ +

+ +

+ +

+


+ +

+ + + + + + + + +
Pointcut Summary
protectedsynchronizationPoint()
 

  + + + + + + + + + + + + + +
+Constructor Summary
GameSynchronization() + +
+          
+  + + + + + + + + + + +
Methods inherited from class coordination.Coordinator
addMutex, addSelfex, guardedEntry, guardedEntry, guardedEntry, guardedEntry, guardedEntryWithTimeout, guardedEntryWithTimeout, guardedEntryWithTimeout, guardedEntryWithTimeout, guardedExit, guardedExit, removeMutex, removeSelfex
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Pointcut Detail
+

synchronizationPoint()

+ + + + + + + + + +
+Constructor Detail
+ +

+GameSynchronization

+
+public GameSynchronization()
+
+
+

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/InfoWin.html b/ajdoc/testdata/spacewar/doc/spacewar/InfoWin.html new file mode 100644 index 000000000..d008df7ff --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/InfoWin.html @@ -0,0 +1,302 @@ + + + + + + +InfoWin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class InfoWin

+
+java.lang.Object
+  extended byspacewar.InfoWin
+
+
+
+
class InfoWin
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + +
+Constructor Summary
+(package private)InfoWin() + +
+          
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  voidclear() + +
+          
+(package private)  voidprint(java.lang.String line) + +
+          
+(package private)  voidprintln(java.lang.String line) + +
+          
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+InfoWin

+
+InfoWin()
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+clear

+
+void clear()
+
+
+

+

+
+
+
+
+ +

+println

+
+void println(java.lang.String line)
+
+
+

+

+
+
+
+
+ +

+print

+
+void print(java.lang.String line)
+
+
+

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/KeyMapping.html b/ajdoc/testdata/spacewar/doc/spacewar/KeyMapping.html new file mode 100644 index 000000000..3fa35c364 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/KeyMapping.html @@ -0,0 +1,365 @@ + + + + + + +KeyMapping + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class KeyMapping

+
+java.lang.Object
+  extended byspacewar.KeyMapping
+
+
+
+
class KeyMapping
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+(package private)  intfire + +
+          
+(package private) static KeyMappingkeyMapping1 + +
+          
+(package private) static KeyMappingkeyMapping2 + +
+          
+(package private)  intleft + +
+          
+(package private)  intright + +
+          
+(package private)  intthrust + +
+          
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)KeyMapping(int k_left, + int k_right, + int k_thrust, + int k_fire) + +
+          
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+keyMapping1

+
+static final KeyMapping keyMapping1
+
+
+

+

+
+
+
+ +

+keyMapping2

+
+static final KeyMapping keyMapping2
+
+
+

+

+
+
+
+ +

+left

+
+int left
+
+
+

+

+
+
+
+ +

+right

+
+int right
+
+
+

+

+
+
+
+ +

+thrust

+
+int thrust
+
+
+

+

+
+
+
+ +

+fire

+
+int fire
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+KeyMapping

+
+KeyMapping(int k_left,
+           int k_right,
+           int k_thrust,
+           int k_fire)
+
+
+

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Pilot.html b/ajdoc/testdata/spacewar/doc/spacewar/Pilot.html new file mode 100644 index 000000000..16f8da41c --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Pilot.html @@ -0,0 +1,369 @@ + + + + + + +Pilot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class Pilot

+
+java.lang.Object
+  extended byspacewar.Pilot
+
+
+
Direct Known Subclasses:
Player, Robot
+
+
+
+
abstract class Pilot
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + +
+Field Summary
+protected  Shipship + +
+          
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Pilot(Game g, + int n) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  intgetNumber() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  ShipgetShip() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetShip(Ship s) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+ship

+
+protected Ship ship
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Pilot

+
+Pilot(Game g,
+      int n)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getNumber

+
+int getNumber()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getShip

+
+Ship getShip()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setShip

+
+void setShip(Ship s)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Player.html b/ajdoc/testdata/spacewar/doc/spacewar/Player.html new file mode 100644 index 000000000..e2cc44c49 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Player.html @@ -0,0 +1,448 @@ + + + + + + +Player + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class Player

+
+java.lang.Object
+  extended byspacewar.Pilot
+      extended byspacewar.Player
+
+
+
All Implemented Interfaces:
java.util.EventListener, java.awt.event.KeyListener
+
+
+
+
class Player
extends Pilot
implements java.awt.event.KeyListener
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + +
+Field Summary
+protected  Shipship + +
+          
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Player(Game theGame, + int number) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  intgetNumber() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  ShipgetShip() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidkeyPressed(java.awt.event.KeyEvent e) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidkeyReleased(java.awt.event.KeyEvent e) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidkeyTyped(java.awt.event.KeyEvent e) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetShip(Ship s) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+ship

+
+protected Ship ship
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Player

+
+Player(Game theGame,
+       int number)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+keyPressed

+
+public void keyPressed(java.awt.event.KeyEvent e)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
keyPressed in interface java.awt.event.KeyListener
+
+
+
+
+
+
+ +

+keyReleased

+
+public void keyReleased(java.awt.event.KeyEvent e)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
keyReleased in interface java.awt.event.KeyListener
+
+
+
+
+
+
+ +

+keyTyped

+
+public void keyTyped(java.awt.event.KeyEvent e)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
keyTyped in interface java.awt.event.KeyListener
+
+
+
+
+
+
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getNumber

+
+int getNumber()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getShip

+
+Ship getShip()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setShip

+
+void setShip(Ship s)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Registry.RegistrationProtection.html b/ajdoc/testdata/spacewar/doc/spacewar/Registry.RegistrationProtection.html new file mode 100644 index 000000000..5d199a46c --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Registry.RegistrationProtection.html @@ -0,0 +1,244 @@ + + + + + + +Registry.RegistrationProtection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Aspect Registry.RegistrationProtection

+
+java.lang.Object
+  extended byspacewar.Registry.RegistrationProtection
+
+
+
Enclosing class:
Registry
+
+
+
+
public static class Registry.RegistrationProtection
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + +
Advice Summary
afterReturning(): ..
 
 Advises:spacewar.Registry.dummy, spacewar.Registry.dummy
+
+

  + + + + + + + + + + + + + +
+Constructor Summary
Registry.RegistrationProtection() + +
+           
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(): .. +

 Advises:spacewar.Registry.dummy, spacewar.Registry.dummy
+ +

+ + + + + + + + + +
+Constructor Detail
+ +

+Registry.RegistrationProtection

+
+public Registry.RegistrationProtection()
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Registry.html b/ajdoc/testdata/spacewar/doc/spacewar/Registry.html new file mode 100644 index 000000000..8e543d861 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Registry.html @@ -0,0 +1,457 @@ + + + + + + +Registry + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Aspect Registry

+
+java.lang.Object
+  extended byspacewar.Registry
+
+
+
+
class Registry
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + +
+Nested Class Summary
+static classRegistry.RegistrationProtection + +
+          
+  + + + + +
Advice Summary
afterReturning(): ..
 
 Advises:spacewar.Registry.dummy, spacewar.Registry.dummy
+
+

  + + + + + + + + + + + + + + +
+Constructor Summary
+(package private)Registry(Game theGame) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  voidclockTick() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voiddummy() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  SpaceObject[]getObjects() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  Ship[]getShips() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  java.util.HashtablegetTable() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidregister(SpaceObject object) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidunregister(SpaceObject object) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Advice Detail
+

afterReturning

afterReturning(): .. +

 Advises:spacewar.Registry.dummy, spacewar.Registry.dummy
+ +

+ + + + + + + + + +
+Constructor Detail
+ +

+Registry

+
+Registry(Game theGame)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+register

+
+void register(SpaceObject object)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+unregister

+
+void unregister(SpaceObject object)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+dummy

+
+void dummy()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getObjects

+
+SpaceObject[] getObjects()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getShips

+
+Ship[] getShips()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getTable

+
+java.util.Hashtable getTable()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+clockTick

+
+void clockTick()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/RegistrySynchronization.html b/ajdoc/testdata/spacewar/doc/spacewar/RegistrySynchronization.html new file mode 100644 index 000000000..d0a50ddb1 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/RegistrySynchronization.html @@ -0,0 +1,249 @@ + + + + + + +RegistrySynchronization + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class RegistrySynchronization

+
+java.lang.Object
+  extended bycoordination.Coordinator
+      extended byspacewar.RegistrySynchronization
+
+
+
+
public class RegistrySynchronization
extends Coordinator
+ +

+ +

+ +

+


+ +

+ + + + + + + + +
Pointcut Summary
protectedsynchronizationPoint()
 

  + + + + + + + + + + + + + +
+Constructor Summary
RegistrySynchronization() + +
+          
+  + + + + + + + + + + +
Methods inherited from class coordination.Coordinator
addMutex, addSelfex, guardedEntry, guardedEntry, guardedEntry, guardedEntry, guardedEntryWithTimeout, guardedEntryWithTimeout, guardedEntryWithTimeout, guardedEntryWithTimeout, guardedExit, guardedExit, removeMutex, removeSelfex
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Pointcut Detail
+

synchronizationPoint()

+ + + + + + + + + +
+Constructor Detail
+ +

+RegistrySynchronization

+
+public RegistrySynchronization()
+
+
+

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Robot.html b/ajdoc/testdata/spacewar/doc/spacewar/Robot.html new file mode 100644 index 000000000..f53806ca3 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Robot.html @@ -0,0 +1,474 @@ + + + + + + +Robot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class Robot

+
+java.lang.Object
+  extended byspacewar.Pilot
+      extended byspacewar.Robot
+
+
+
All Implemented Interfaces:
java.lang.Runnable
+
+
+
+
class Robot
extends Pilot
implements java.lang.Runnable
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + +
+Field Summary
+protected  Shipship + +
+          
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Robot(Game theGame, + int number) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  voiddestroy() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  intgetNumber() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  ShipgetShip() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidrun() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetShip(Ship s) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsleepForABit(int time) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidstart() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+ship

+
+protected Ship ship
+
+
+

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Robot

+
+Robot(Game theGame,
+      int number)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+start

+
+void start()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+
+
+
+ +

+destroy

+
+void destroy()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+
+
+
+ +

+run

+
+public void run()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
run in interface java.lang.Runnable
+
+
+
+
+
+
+ +

+sleepForABit

+
+void sleepForABit(int time)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+
+
+
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getNumber

+
+int getNumber()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getShip

+
+Ship getShip()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setShip

+
+void setShip(Ship s)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/SWFrame.html b/ajdoc/testdata/spacewar/doc/spacewar/SWFrame.html new file mode 100644 index 000000000..36e6450a2 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/SWFrame.html @@ -0,0 +1,494 @@ + + + + + + +SWFrame + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class SWFrame

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Container
+          extended byjava.awt.Window
+              extended byjava.awt.Frame
+                  extended byspacewar.SWFrame
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
+
+
+
+
class SWFrame
extends java.awt.Frame
implements java.awt.event.ActionListener
+ +

+ +

+ +

+

+
+
+ +

+ + + + + + + +
+Nested Class Summary
+ + + + + + + +
Nested classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
+ + + + + + + +
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
+ + + + + + + +
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
+ + + + + + + +
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
+  + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
+ + + + + + + +
Fields inherited from class java.awt.Window
+ + + + + + + +
Fields inherited from class java.awt.Container
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)SWFrame(Game theGame, + Display d) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidactionPerformed(java.awt.event.ActionEvent e) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  DisplaygetDisplay() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  java.awt.MenugetMenu() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.awt.Frame
addNotify, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
+ + + + + + + +
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
+ + + + + + + +
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+ + + + + + + +
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+SWFrame

+
+SWFrame(Game theGame,
+        Display d)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+
+
+
+ +

+getDisplay

+
+Display getDisplay()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+
+
+
+ +

+getMenu

+
+java.awt.Menu getMenu()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+
+
+
+ +

+actionPerformed

+
+public void actionPerformed(java.awt.event.ActionEvent e)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
actionPerformed in interface java.awt.event.ActionListener
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Ship.html b/ajdoc/testdata/spacewar/doc/spacewar/Ship.html new file mode 100644 index 000000000..dd4db8b82 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Ship.html @@ -0,0 +1,1186 @@ + + + + + + +Ship + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class Ship

+
+java.lang.Object
+  extended byspacewar.SpaceObject
+      extended byspacewar.Ship
+
+
+
+
class Ship
extends SpaceObject
+ +

+ +

+ +

+


+ +

+ + + + + + + + +
Pointcut Summary
(package private)helmCommandsCut(Ship)
 

  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+(package private) static intBULLET_SPEED + +
+          
+(package private) static intCLOCKWISE + +
+          
+(package private) static intCOUNTERCLOCKWISE + +
+          
+(package private) static doubleDEFAULT_ACCELERATION + +
+          
+(package private) static doubleDEFAULT_ANGULAR_VELOCITY + +
+          
+(package private) static intMAX_DAMAGE + +
+          
+(package private) static intSTOP + +
+          
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Ship(Game theGame, + double xPos, + double yPos, + double orientation) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  voidaccelerate(double dXVel, + double dYVel) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) static voidbounce(Ship shipA, + Ship shipB) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning, spacewar.Debug.afterReturning
+
+ voidclockTick() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voiddie() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  booleanexpendEnergy(double amount) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidfire() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetDamage() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  floatgetDamageLevel() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetEnergy() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  floatgetEnergyLevel() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetOldXPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetOldYPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetOrientation() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  PilotgetPilot() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetRAcc() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  intgetSize() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetXPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetXVel() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetYPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetYVel() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidhandleCollision(SpaceObject obj) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidinflictDamage(double amount) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  booleanisAlive() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidrepairDamage(double amount) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidrotate(int direction) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetAcceleration(double acc) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetAngularVelocity(double omega) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetIsAlive(boolean n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetPilot(Pilot p) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetXVel(double n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetYVel(double n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidthrust(boolean onOff) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ +

  + + + + + + +
+Pointcut Detail
+

helmCommandsCut(Ship)

+ + + + + + +
+Field Detail
+ +

+MAX_DAMAGE

+
+static final int MAX_DAMAGE
+
+
+

+

+
See Also:
Constant Field Values
+
+
+ +

+BULLET_SPEED

+
+static final int BULLET_SPEED
+
+
+

+

+
See Also:
Constant Field Values
+
+
+ +

+CLOCKWISE

+
+static final int CLOCKWISE
+
+
+

+

+
See Also:
Constant Field Values
+
+
+ +

+STOP

+
+static final int STOP
+
+
+

+

+
See Also:
Constant Field Values
+
+
+ +

+COUNTERCLOCKWISE

+
+static final int COUNTERCLOCKWISE
+
+
+

+

+
See Also:
Constant Field Values
+
+
+ +

+DEFAULT_ANGULAR_VELOCITY

+
+static final double DEFAULT_ANGULAR_VELOCITY
+
+
+

+

+
See Also:
Constant Field Values
+
+
+ +

+DEFAULT_ACCELERATION

+
+static final double DEFAULT_ACCELERATION
+
+
+

+

+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+Ship

+
+Ship(Game theGame,
+     double xPos,
+     double yPos,
+     double orientation)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+getSize

+
+int getSize()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
getSize in class SpaceObject
+
+
+
+
+
+
+ +

+getEnergy

+
+double getEnergy()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getDamage

+
+double getDamage()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getOrientation

+
+double getOrientation()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getRAcc

+
+double getRAcc()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getPilot

+
+Pilot getPilot()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setPilot

+
+void setPilot(Pilot p)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getEnergyLevel

+
+float getEnergyLevel()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getDamageLevel

+
+float getDamageLevel()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+expendEnergy

+
+boolean expendEnergy(double amount)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+inflictDamage

+
+void inflictDamage(double amount)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+repairDamage

+
+void repairDamage(double amount)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+clockTick

+
+public void clockTick()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Overrides:
clockTick in class SpaceObject
+
+
+
+
+
+
+ +

+setAcceleration

+
+void setAcceleration(double acc)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setAngularVelocity

+
+void setAngularVelocity(double omega)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+rotate

+
+void rotate(int direction)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+thrust

+
+void thrust(boolean onOff)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+fire

+
+void fire()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+handleCollision

+
+void handleCollision(SpaceObject obj)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
Specified by:
handleCollision in class SpaceObject
+
+
+
+
+
+
+ +

+bounce

+
+static void bounce(Ship shipA,
+                   Ship shipB)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getXPos

+
+double getXPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getYPos

+
+double getYPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getOldXPos

+
+double getOldXPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getOldYPos

+
+double getOldYPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getXVel

+
+double getXVel()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getYVel

+
+double getYVel()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setXVel

+
+void setXVel(double n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setYVel

+
+void setYVel(double n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+isAlive

+
+boolean isAlive()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setIsAlive

+
+void setIsAlive(boolean n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+accelerate

+
+void accelerate(double dXVel,
+                double dYVel)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+die

+
+void die()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/SpaceObject.html b/ajdoc/testdata/spacewar/doc/spacewar/SpaceObject.html new file mode 100644 index 000000000..dd990d82c --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/SpaceObject.html @@ -0,0 +1,616 @@ + + + + + + +SpaceObject + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class SpaceObject

+
+java.lang.Object
+  extended byspacewar.SpaceObject
+
+
+
Direct Known Subclasses:
Bullet, EnergyPacket, Ship
+
+
+
+
abstract class SpaceObject
extends java.lang.Object
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + +
+Constructor Summary
+(package private)SpaceObject(Game theGame, + double xP, + double yP, + double xV, + double yV) + +
+          
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  voidaccelerate(double dXVel, + double dYVel) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidclockTick() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voiddie() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetOldXPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetOldYPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) abstract  intgetSize() + +
+          
+(package private)  doublegetXPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetXVel() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetYPos() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  doublegetYVel() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private) abstract  voidhandleCollision(SpaceObject obj) + +
+          
+(package private)  booleanisAlive() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetIsAlive(boolean n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetXVel(double n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+(package private)  voidsetYVel(double n) + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+SpaceObject

+
+SpaceObject(Game theGame,
+            double xP,
+            double yP,
+            double xV,
+            double yV)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getXPos

+
+double getXPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getYPos

+
+double getYPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getOldXPos

+
+double getOldXPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getOldYPos

+
+double getOldYPos()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getXVel

+
+double getXVel()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getYVel

+
+double getYVel()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setXVel

+
+void setXVel(double n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setYVel

+
+void setYVel(double n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+isAlive

+
+boolean isAlive()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+setIsAlive

+
+void setIsAlive(boolean n)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+clockTick

+
+void clockTick()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+accelerate

+
+void accelerate(double dXVel,
+                double dYVel)
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+die

+
+void die()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+getSize

+
+abstract int getSize()
+
+
+

+

+
+
+
+
+ +

+handleCollision

+
+abstract void handleCollision(SpaceObject obj)
+
+
+

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/Timer.html b/ajdoc/testdata/spacewar/doc/spacewar/Timer.html new file mode 100644 index 000000000..b2c4ebbdf --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/Timer.html @@ -0,0 +1,314 @@ + + + + + + +Timer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +spacewar +
+Class Timer

+
+java.lang.Object
+  extended byjava.lang.Thread
+      extended byspacewar.Timer
+
+
+
All Implemented Interfaces:
java.lang.Runnable
+
+
+
+
class Timer
extends java.lang.Thread
+ +

+ +

+ +

+


+ +

+ + + + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
+  + + + + + + + + + + + +
+Constructor Summary
+(package private)Timer(Game theGame) + +
+          
+  + + + + + + + + + + + + + + + +
+Method Summary
+(package private)  GamegetGame() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ voidrun() + +
+          
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+
+ + + + + + + +
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+Timer

+
+Timer(Game theGame)
+
+
+

+

+ + + + + + + + +
+Method Detail
+ +

+getGame

+
+Game getGame()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+
+ +

+run

+
+public void run()
+
+
 Advised by:spacewar.Debug.before, spacewar.Debug.afterReturning
+ +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/package-frame.html b/ajdoc/testdata/spacewar/doc/spacewar/package-frame.html new file mode 100644 index 000000000..41bc6ebad --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/package-frame.html @@ -0,0 +1,80 @@ + + + + + + +spacewar + + + + + + + + + + + +spacewar + + + + +
+Classes  + +
+Bullet +
+Debug +
+Display +
+Display.DisplayAspect +
+Display1 +
+Display1.SpaceObjectPainting +
+Display2 +
+Display2.SpaceObjectPainting +
+EnergyPacket +
+EnergyPacketProducer +
+EnsureShipIsAlive +
+Game +
+GameSynchronization +
+InfoWin +
+KeyMapping +
+Pilot +
+Player +
+Registry +
+Registry.RegistrationProtection +
+RegistrySynchronization +
+Robot +
+Ship +
+SpaceObject +
+SWFrame +
+Timer
+ + + + diff --git a/ajdoc/testdata/spacewar/doc/spacewar/package-summary.html b/ajdoc/testdata/spacewar/doc/spacewar/package-summary.html new file mode 100644 index 000000000..2bf9b787c --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/package-summary.html @@ -0,0 +1 @@ +spacewar

Package spacewar

Class Summary
Bullet
Debug
Display
Display.DisplayAspect
Display1
Display1.SpaceObjectPainting
Display2
Display2.SpaceObjectPainting
EnergyPacket
EnergyPacketProducer
EnsureShipIsAlive
Game
GameSynchronization
InfoWin
KeyMapping
Pilot
Player
Registry
Registry.RegistrationProtection
RegistrySynchronization
Robot
Ship
SpaceObject
SWFrame
Timer
 



\ No newline at end of file diff --git a/ajdoc/testdata/spacewar/doc/spacewar/package-tree.html b/ajdoc/testdata/spacewar/doc/spacewar/package-tree.html new file mode 100644 index 000000000..06be46d5a --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/spacewar/package-tree.html @@ -0,0 +1,171 @@ + + + + + + +spacewar Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package spacewar +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/ajdoc/testdata/spacewar/doc/stylesheet.css b/ajdoc/testdata/spacewar/doc/stylesheet.css new file mode 100644 index 000000000..14c3737e8 --- /dev/null +++ b/ajdoc/testdata/spacewar/doc/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + diff --git a/ajdoc/testdata/spacewar/spacewar/.cvsignore b/ajdoc/testdata/spacewar/spacewar/.cvsignore new file mode 100644 index 000000000..17637b455 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/.cvsignore @@ -0,0 +1 @@ +*.ajsym diff --git a/ajdoc/testdata/spacewar/spacewar/Bullet.java b/ajdoc/testdata/spacewar/spacewar/Bullet.java new file mode 100644 index 000000000..6581dbbf7 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Bullet.java @@ -0,0 +1,48 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +Bullet.java +Part of the Spacewar game. + +*/ + +package spacewar; + +class Bullet extends SpaceObject { + + static private final int SIZE = 3; //Can't be changed for now!!! + static private int LIFETIME = 50; + + private int lifeLeft; + + Bullet (Game theGame, double xP, double yP, double xV, double yV) { + super(theGame, xP, yP, xV, yV); + lifeLeft = LIFETIME; + } + + int getSize() { return SIZE; } + + void handleCollision(SpaceObject obj) { + die(); + } + + void clockTick() { + if (--lifeLeft == 0) + die(); + super.clockTick(); + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/Debug.java b/ajdoc/testdata/spacewar/spacewar/Debug.java new file mode 100644 index 000000000..a5d991661 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Debug.java @@ -0,0 +1,219 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +Debug.java +Part of the Spacewar system. + +*/ + +package spacewar; + +import java.awt.Menu; +import java.awt.CheckboxMenuItem; +import java.awt.Frame; +import java.awt.TextArea; +import java.awt.Dimension; + +/** + * This aspect specifies debugging information to be output to the + * information window. + * + * When the debug aspect is compiled in the Frame menu has several checkbox + * items that can be used to control the amount of tracing information + * displayed. (By default the first three are off, because they generate + * so much information.) + * + * There are two reasons to gather all this debugging code into an aspect + * like this: + * + * (1) It makes it easier to understand when it is all in one place. + * + * (2) It means that we can "plug and debug". We can enable/disable + * the debugging code simply by weaving or not weaving this + * aspect in. + * + * All in all, this is a lot better than the usual practice of writing + * complex debugging code and then deleting it when the bug is found, + * only to regret it a month later when a related bug surfaces. (Or even + * the same bug!) + * + * This file also defines a class InfoWin, which it uses to display all the + * debugging information. + */ +aspect Debug { + + private static InfoWin infoWin = new InfoWin(); + + private static Menu menu = new Menu("Debug"); + + private static CheckboxMenuItem traceConstructors = + new CheckboxMenuItem("trace constructors", false); + private static CheckboxMenuItem traceInitializations = + new CheckboxMenuItem("trace initializations", false); + private static CheckboxMenuItem traceMethods = + new CheckboxMenuItem("trace methods", false); + private static CheckboxMenuItem traceClockTick = + new CheckboxMenuItem("trace clock tick", false); + private static CheckboxMenuItem traceRegistry = + new CheckboxMenuItem("trace registry", true); + private static CheckboxMenuItem traceFireCollideDamage = + new CheckboxMenuItem("trace fire, collide, damage", true); + + after() returning (SWFrame frame): call(SWFrame+.new(..)) { + menu.add(traceConstructors); + menu.add(traceInitializations); + menu.add(traceMethods); + menu.add(traceClockTick); + menu.add(traceRegistry); + menu.add(traceFireCollideDamage); + frame.getMenuBar().add(menu); + } + + /* + * all constructors + */ + pointcut allConstructorsCut(): + call((spacewar.* && !(Debug+ || InfoWin+)).new(..)); + + before(): allConstructorsCut() { + if (traceConstructors.getState()) { + infoWin.println("begin constructing " + thisJoinPoint.getSignature()); + } + } + + after() returning: allConstructorsCut() { + if (traceConstructors.getState()) { + infoWin.println("done constructing " + thisJoinPoint.getSignature()); + } + } + + /* + * All dynamic initializations + */ + pointcut allInitializationsCut(): + initialization((spacewar.* && !(Debug+ || InfoWin+)).new(..)); + + before(): allInitializationsCut() { + if (traceConstructors.getState()) { + infoWin.println("begin initializing " + thisJoinPoint.getSignature()); + } + } + after() returning : allInitializationsCut() { + if (traceConstructors.getState()) { + infoWin.println("done initializing " + thisJoinPoint.getSignature()); + } + } + + /* + * all methods + */ + pointcut allMethodsCut(): + execution(* (spacewar.* && !(Debug+ || InfoWin+)).*(..)); + + before(): allMethodsCut() { + if (traceMethods.getState()) { + infoWin.println("entering " + thisJoinPoint.getSignature()); + } + } + after() returning : allMethodsCut() { + if (traceMethods.getState()) { + infoWin.println("exiting " + thisJoinPoint.getSignature()); + } + } + + /* + * clock ticks + */ + after(Object obj) returning : + (target(obj) && (target(Game) || + target(Registry) || + target(SpaceObject))) + && call(void clockTick()) { + if (traceClockTick.getState()) + infoWin.println("ticking " + obj); + } + + /* + * registry contents + */ + after(Registry registry) returning : + target(registry) && (call(void register(..)) || + call(void unregister(..))) { + if (traceRegistry.getState()) + infoWin.println(registry.getTable().size() + + " space objects in the registry."); + } + + /* + * fire, collide, damage + */ + after() returning : call(void Ship.fire()) { + if (traceFireCollideDamage.getState()) + infoWin.println("firing"); + } + + after(Ship ship, SpaceObject obj) returning : + call(void Ship.handleCollision(SpaceObject)) && target(ship) && args(obj) { + if (traceFireCollideDamage.getState()) + infoWin.println(ship + " collides with " + obj); + } + + after(Ship shipA, Ship shipB) returning : + execution(void Ship.bounce(Ship, Ship)) && args(shipA, shipB) { + if (traceFireCollideDamage.getState()) + infoWin.println(shipA + " bounces with " + shipB); + } + + before(Ship ship, double amount): + call(void Ship.inflictDamage(double)) && target(ship) && args(amount) { + if (traceFireCollideDamage.getState()) + if (amount > 0) + infoWin.println(ship + "gets " + + amount + " damage (" + + ship.getDamage() + ")"); + } + +} + +class InfoWin { + private Frame frame; + private TextArea info; + + InfoWin() { + frame = new Frame("debugging info for spacewar game"); + info = new TextArea(); + info.setEditable(false); + + Dimension screenSize = frame.getToolkit().getScreenSize(); + frame.setSize(250, 600); + frame.setLocation(screenSize.width - 250, 0); + frame.add(info); + frame.show(); + frame.toFront(); + } + + void clear() { + info.setText(""); + } + + void println(String line) { + info.append(line + "\n"); + } + + void print(String line) { + info.append(line); + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/Display.java b/ajdoc/testdata/spacewar/spacewar/Display.java new file mode 100644 index 000000000..757cdd6e7 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Display.java @@ -0,0 +1,166 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +Display.java +Part of the Spacewar system. +*/ + +package spacewar; + +import java.util.Vector; +import java.util.Enumeration; +import java.awt.Graphics; +import java.awt.Canvas; +import java.awt.Image; +import java.awt.event.KeyListener; + +/** + * The display aspects capture the look and feel of the Game in modular + * pluggable units. + * + * The model is that constructing a concrete subclass of Display attaches that + * kind of display to the game. It will Display the game as it goes along. + * A game can have any number of displays. Any of the displays will accept + * keyboard input. + * + */ + +class Display extends Canvas { + + private static Vector DISPLAYS = new Vector(2); + private static Vector PLAYERS = new Vector(2); + private static Pilot pilot1, pilot2; + + Game game; + SWFrame frame; + Image offImage; + Graphics offGraphics; + + Game getGame() { return game; } + static Pilot getPilot1() { return pilot1; } + static Pilot getPilot2() { return pilot2; } + + Display(Game g) { + super(); + game = g; + + frame = new SWFrame(game, this); + DISPLAYS.addElement(this); + } + + + void noticeSizeChange() { + initializeOffImage(); + } + + private void initializeOffImage () { + int w = getSize().width; + int h = getSize().height; + if ( w > 0 & h > 0) { + offImage = createImage(w, h); + offGraphics = offImage.getGraphics(); + } + } + + /* + * In our double buffering scheme, painting just means copying the buffer + * to the screen. The Display aspect draws into the buffer. + */ + public void paint(Graphics g) { + if (offImage != null) + g.drawImage(offImage, 0, 0, null); + } + + public void update(Graphics g) { + /* + * There are 4 steps to this: + * - clear the double buffer + * - paint the objects into the double buffer + * - paint the status into the double buffer + * - paint the doublebuffer into the buffer + */ + offGraphics.setColor(getBackground()); + offGraphics.fillRect(0, 0, getBounds().width, getBounds().height); + paintObjects(offGraphics); + paintStatus(offGraphics); + g.drawImage(offImage, 0, 0, null); + } + + void paintObjects(Graphics g) { } + void paintStatus(Graphics g) {} + + static aspect DisplayAspect { + + after (String mode) returning (Game game): call(Game+.new(String)) && args(mode) { + new Display1(game); + new Display2(game); + + if ( mode.equals("1") ) { + pilot1 = game.newPlayer(1); + } + else if ( mode.equals("2") ) { + pilot1 = game.newPlayer(1); + pilot2 = game.newPlayer(2); + } + else if (mode. equals("demo")) { + pilot1 = game.newRobot(1); + pilot2 = game.newRobot(2); + } else { + game.error("Invalid mode: " + mode); + game.quit(); + } + } + + + /* + * I'm not really sure this belongs here. + * + * Being here what it does is makes the Display aspect + * responsible for having the Players couple up to it. That's + * kind of nice, but its a bit incomplete, since Player is + * really part of the GUI, not part of the core Game. + * + * In a future re-factoring this will get worked out better. + * What will happen is that GUI will be an aspect that has the + * core GUI. Each of the different kinds of displays will be + * aspects that tie themselves in. + */ + after () returning (Player player): call(Player+.new(..)) { + Enumeration elements = DISPLAYS.elements(); + while ( elements.hasMoreElements() ) { + Display display = (Display)elements.nextElement(); + display.addKeyListener(player); + } + } + + after() returning (Display display): call(Display+.new(..)) { + display.noticeSizeChange(); + } + + after(Display display) returning (): call(void setSize(..)) && target(display) { + display.noticeSizeChange(); + } + + after() returning : call(void Game.clockTick()) { + Enumeration elements = DISPLAYS.elements(); + while ( elements.hasMoreElements() ) { + Display display = (Display)elements.nextElement(); + display.repaint(); + } + } + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/Display1.java b/ajdoc/testdata/spacewar/spacewar/Display1.java new file mode 100644 index 000000000..484a2342a --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Display1.java @@ -0,0 +1,203 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +Display1.java +Part of the Spacewar system. +*/ + +package spacewar; + + +import java.util.Vector; +import java.util.Enumeration; +import java.awt.Graphics; +import java.awt.Color; +import java.util.Random; + +/** + * This is the standard display aspect. + */ +class Display1 extends Display { + /* + * Here's the color scheme for the game. No other places in this file + * should say Color.xxx. Instead, that color should be given a symbolic + * name here. + */ + private static Color backgroundColor = Color.black; + private static Color player1ShipColor = Color.white; + private static Color player2ShipColor = Color.gray; + private static Color robotShipColor = new Color(0xa00000); + private static Color flameColor = Color.red; + private static Color shipExplosionColor = Color.red; + private static Color bulletColor = Color.green; + private static Color energyPacketOuterColor = Color.blue; + private static Color energyPacketInnerColor = new Color(0x7070FF); + private static Color statusLabelsColor = Color.white; + private static Color statusMeterBorderColor = Color.white; + private static Color energyStatusMeterColor = Color.blue; + private static Color damageStatusMeterColor = Color.red; + + + Display1(Game game) { + super(game); + frame.setLocation(20, 20); + } + + void noticeSizeChange() { + super.noticeSizeChange(); + setBackground(backgroundColor); + } + + void paintObjects(Graphics g) { + SpaceObject[] objects = game.getRegistry().getObjects(); + final int len = objects.length; + for (int i = 0; i < len; i++) { + objects[i].paint(g); + } + } + + static aspect SpaceObjectPainting { + + abstract private void SpaceObject.paint(Graphics g); + + /* + * Ships are by far and away the most complex of the space Objects + * to paint. First off, we need to set the color when the ship + * is made. + */ + private Color Ship.color; + + after(Pilot pilot) returning (Ship ship): call(Ship Game.newShip(Pilot)) && args(pilot) { + if (pilot.getNumber() == 1) + ship.color = player1ShipColor; + else if (pilot.getNumber() == 2) + ship.color = player2ShipColor; + else + ship.color = robotShipColor; + } + + private void Ship.paint(Graphics g) { + final double PI = Math.PI; + int[] radius = {15, 12, -4, 12, -9, -15, -9}; + double[] angle = {0, PI * 3/4, 0, -PI * 3/4, PI/8, 0, -PI/8}; + int[] x; + int[] y; + + Random random = new Random(); + + if (this.getDamage() >= this.MAX_DAMAGE) { + int lines = 20; + x = new int[lines]; + y = new int[lines]; + g.setColor(shipExplosionColor); + for (int i = 0; i < lines; i++) { + x[i] = (int)(this.getXPos()) + random.nextInt() % 20; + y[i] = (int)(this.getYPos()) + random.nextInt() % 20; + } + for (int i = 0; i < lines; i++) + g.drawLine(x[i], y[i], x[(i + 1) % lines], y[(i + 1) % lines]); + } else { + x = new int[7]; + y = new int[7]; + + g.setColor(this.color); + + radius[5] += random.nextInt() % 3; + // convert coordinates from polar to cartesian + for (int i = 0; i < 7; i++) { + x[i] = (int) + (this.getXPos() + + Math.cos(this.getOrientation() + angle[i]) * radius[i]); + y[i] = (int) + (this.getYPos() + + Math.sin(this.getOrientation() + angle[i]) * radius[i]); + } + + // draw the body as a polygon + g.drawPolygon(x, y, 4); + + // if the ship is accelerating, draw in a flame + if (this.getRAcc() != 0) { + g.setColor(flameColor); + g.drawLine(x[4], y[4], x[5], y[5]); + g.drawLine(x[5], y[5], x[6], y[6]); + } + } + } + + /* + * Bullets + */ + private void Bullet.paint(Graphics g) { + g.setColor(bulletColor); + g.fillOval((int)this.getXPos() - 1, + (int)this.getYPos() - 1, + 3, + 3); + } + + /* + * energy packets + */ + private void EnergyPacket.paint(Graphics g) { + g.setColor(energyPacketOuterColor); + g.fillOval((int)this.getXPos() - 5, + (int)this.getYPos() - 5, + 10, 10); + g.setColor(energyPacketInnerColor); + g.fillOval((int)this.getXPos() - 2, + (int)this.getYPos() - 2, + 3, 3); + } + } + + + void paintStatus(Graphics g) { + int left1 = 60; + int top1 = 0; + + int left2 = 200; + int top2 = 0; + + g.setColor(statusLabelsColor); + g.drawString("energy:", 5, top1 + 15); + g.drawString("damage:", 5, top1 + 30); + + if (getPilot1() != null) + paintLevels(g, getPilot1().getShip(), top1, left1); + if (getPilot2() != null) + paintLevels(g, getPilot2().getShip(), top2, left2); + } + + static void paintLevels(Graphics g, Ship ship, int top, int left) { + if (ship == null) + return; + else if (ship.isAlive()) { + g.setColor(statusMeterBorderColor); + g.drawRect(left, top + 6, 101, 10); + g.drawRect(left, top + 21, 101, 10); + g.setColor(energyStatusMeterColor); + g.fillRect(left + 1, top + 7, (int)(ship.getEnergyLevel()*100), 9); + g.setColor(damageStatusMeterColor); + g.fillRect(left + 1, top + 22, (int)(ship.getDamageLevel()*100), 9); + } + else { + g.setColor(damageStatusMeterColor); + g.drawString("Ship is destroyed", left+1, top+15); + } + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/Display2.java b/ajdoc/testdata/spacewar/spacewar/Display2.java new file mode 100644 index 000000000..d2dbeb40e --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Display2.java @@ -0,0 +1,138 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +Display2.java +Part of the Spacewar system. +*/ + +package spacewar; + + +import java.util.Vector; +import java.util.Enumeration; +import java.awt.Graphics; +import java.awt.Color; + + +/** + * This is the cheap Display aspect. + */ +class Display2 extends Display { + + Display2(Game game) { + super(game); + frame.setLocation(540, 20); + } + + void noticeSizeChange() { + super.noticeSizeChange(); + setBackground(Color.darkGray); + } + + void paintObjects(Graphics g) { + SpaceObject[] objects = game.getRegistry().getObjects(); + final int len = objects.length; + for (int i = 0; i < len; i++) { + objects[i].paint(g); + } + } + + static aspect SpaceObjectPainting { + + abstract private void SpaceObject.paint(Graphics g); + + /* + * Ships are by far and away the most complex of the space Objects + * to paint. + */ + private Color Ship.color; + + after(Pilot pilot) returning (Ship ship): call(Ship Game.newShip(Pilot)) && args(pilot) { + if (pilot.getNumber() == 1) + ship.color = Color.white; + else if (pilot.getNumber() == 2) + ship.color = Color.gray; + else + ship.color = new Color(0xa00000); + } + + private void Ship.paint(Graphics g) { + if (this.getDamage() < this.MAX_DAMAGE) { + double x = this.getXPos(); + double y = this.getYPos(); + double sinTheta = Math.sin(this.getOrientation()); + double cosTheta = Math.cos(this.getOrientation()); + + g.setColor(color); + g.drawLine((int)(x + 8*cosTheta), (int)(y + 8*sinTheta), + (int)(x - 8*cosTheta), (int)(y - 8*sinTheta)); + + // if the ship is accelerating, draw thruster + if (this.getRAcc() != 0) { + g.setColor(Color.red); + g.fillOval((int)(x - 8*cosTheta), (int)(y - 8*sinTheta), 6, 6); + } + } + } + + private void Bullet.paint(Graphics g) { + g.setColor(Color.green); + g.fillOval((int)this.getXPos() - 1, + (int)this.getYPos() - 1, + 3, + 3); + } + + private void EnergyPacket.paint(Graphics g) { + g.setColor(Color.white); + g.fillOval((int)this.getXPos() - 5, + (int)this.getYPos() - 5, + 10, + 10); + } + } + + void paintStatus(Graphics g) { + int left1 = 60; + int top1 = 0; + + int left2 = 200; + int top2 = 0; + + g.setColor(Color.white); + g.drawString("energy:", 5, top1 + 15); + g.drawString("damage:", 5, top1 + 30); + + if (getPilot1() != null) + paintLevels(g, getPilot1().getShip(), top1, left1); + if (getPilot2() != null) + paintLevels(g, getPilot2().getShip(), top2, left2); + } + + void paintLevels(Graphics g, Ship ship, int top, int left) { + if (ship == null) + return; + else if (ship.isAlive()) { + g.drawString(Float.toString(ship.getEnergyLevel()*100), left+1, top+15); + g.drawString(Float.toString(ship.getDamageLevel()*100), left+1, top+30); + } + else { + g.setColor(Color.red); + g.drawString("Ship is destroyed", left+1, top+15); + } + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/EnergyPacket.java b/ajdoc/testdata/spacewar/spacewar/EnergyPacket.java new file mode 100644 index 000000000..d7bc4f9ec --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/EnergyPacket.java @@ -0,0 +1,44 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +EnergyPacket.java +Part of the Spacewar system. + +*/ + +package spacewar; + + +class EnergyPacket extends SpaceObject { + + static private final int SIZE = 5; //Can't be changed for now!!! + int getSize() { return SIZE; } + + private double energy; + + double getEnergy() { return energy; } + + EnergyPacket(Game theGame, + double xP, double yP, double xV, double yV, double e) { + super(theGame, xP, yP, xV, yV); + energy = e; + } + + void handleCollision(SpaceObject obj) { + die(); + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/EnergyPacketProducer.java b/ajdoc/testdata/spacewar/spacewar/EnergyPacketProducer.java new file mode 100644 index 000000000..efd276042 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/EnergyPacketProducer.java @@ -0,0 +1,63 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +EnergyPacketProducer.java +Part of the Spacewar system. + + This implementation creates booby-trapped packets 20% of the time. + +*/ + +package spacewar; + + +class EnergyPacketProducer extends Thread { + private final static int MIN = -20; + private final static int MAX = 80; + private final static int EXPECTEDINTERVAL = 15; + + private Game game; + + Game getGame() { return game; } + + EnergyPacketProducer(Game theGame) { + super("EnergyPacketProducer"); + game = theGame; + } + + public void run() { + while(true) { + produceAPacket(); + waitForABit(); + } + } + + void waitForABit() { + try { Thread.sleep((int)(Math.random() * EXPECTEDINTERVAL * 2000)); } + catch (InterruptedException e) {} + } + + void produceAPacket() { + EnergyPacket pkt = + new EnergyPacket(game, + Math.random() * getGame().getWidth(), + Math.random() * getGame().getHeight(), + Math.random() * 2 - 1, + Math.random() * 2 - 1, + Math.random() * (MAX - MIN) + MIN); + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/EnsureShipIsAlive.java b/ajdoc/testdata/spacewar/spacewar/EnsureShipIsAlive.java new file mode 100644 index 000000000..f7b949a92 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/EnsureShipIsAlive.java @@ -0,0 +1,35 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +Ship.java +Part of the Spacewar system. + +*/ + +package spacewar; + +/** + * This aspect makes sure that the ship is alive before performing any console + * commands. + * + */ +aspect EnsureShipIsAlive { + void around (Ship ship): Ship.helmCommandsCut(ship) { + if ( ship.isAlive() ) { + proceed(ship); + } + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/Game.java b/ajdoc/testdata/spacewar/spacewar/Game.java new file mode 100644 index 000000000..da67d7bc3 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Game.java @@ -0,0 +1,215 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +Game.java +Part of the Spacewar system. + +*/ + +package spacewar; + +import java.awt.Dimension; + +/** + * The Game class is the root of the spacewar game. To start a spacewar + * game, you can either call the main method, or instantiate this class + * directly. + * + * Synchronization is done by the GameSynchronization aspect. + */ +public class Game extends Thread { + + /** + * To run the game from top level, simply say Java Game, as usual. Passing + * an argument makes the game run in demo mode. Without an argument it runs + * in the normal player mode. + */ + public static void main(String[] args) { + if ( args.length == 0 ) + new Game("1").run(); + new Game(args[0]).run(); + } + + + private Timer timer; + private EnergyPacketProducer ePP; + + private Registry registry; + private Pilot pilot1, pilot2; + + private Dimension screenSize = new Dimension(500, 500); + + Registry getRegistry() { return registry; } + Pilot getPilot1() { return pilot1; } + Pilot getPilot2() { return pilot2; } + + /** returns the width of the screen, delegating to screenSize */ + int getWidth() { return screenSize.width; } + + /** returns the height of the screen, delegating to screenSize */ + int getHeight() { return screenSize.height; } + + /** + * To run the game, simply instantiate this class. It runs in its own + * thread. You can instantiate multiple games at once. For the time being + * the only way to end the game is to exit from the Java VM. + * + * @param isDemo Controls whether the game runs in demo mode or not. True + * means it is a demo, false means it runs in normal 2 player mode. + */ + public Game(String mode) { + timer = new Timer(this); + ePP = new EnergyPacketProducer(this); + registry = new Registry(this); + } + + public void run() { + timer.start(); + ePP.start(); + + while(true) { + try { + newRobot(3); + Thread.sleep(15000); + } + catch (InterruptedException e) {} + } + } + + + /** + * add a robot to the game. This is a menu command. + */ + void addRobot() { + newRobot(3); + } + + /** + * resurrect the ships in the game. This is a menu command. + */ + void resetShips() { + Ship[] ships = registry.getShips(); + + for (int i = 0; i < ships.length; i++) { + Ship ship = ships[i]; + Pilot pilot = ship.getPilot(); + newShip(pilot); + } + } + + /** + * leave the game. This is a menu command. + */ + void quit() { + System.exit(0); + } + + void error(Object o) { + System.err.println(o); + } + + + /** + * returns a new player. With {@link #newRobot} and {@link + * #newShip}, the only ways to make a Player, a Robot, or a Ship. + * The structural invariant is that there should be no calls to + * new of one of these three classes outside these three methods. + */ + Player newPlayer(int number) { + Player player = new Player(this, number); + newShip(player); + return player; + } + + /** + * returns a new robot. With {@link #newPlayer} and {@link + * #newShip}, the only ways to make a Player, a Robot, or a Ship. + * The structural invariant is that there should be no calls to + * new of one of these three classes outside these three methods. + */ + Robot newRobot(int number) { + Robot robot = new Robot(this, number); + newShip(robot); + robot.start(); + return robot; + } + + /** + * returns a new ship. With {@link #newRobot} and {@link + * #newPlayer}, the only ways to make a Player, a Robot, or a + * Ship. The structural invariant is that there should be no + * calls to new of one of these three classes outside these three + * methods. + */ + Ship newShip(Pilot pilot) { + // + // If there is an old ship (we're doing a reset), then remove it from + // the registry. + // + Ship oldShip = pilot.getShip(); + if (! (oldShip == null)) + oldShip.die(); + + Ship newShip = new Ship(this, + Math.random() * getWidth(), + Math.random() * getHeight(), + Math.random() * Math.PI * 2); + pilot.setShip(newShip); + newShip.setPilot(pilot); + + return newShip; + } + + void clockTick() { + registry.clockTick(); + handleCollisions(); + } + + // collision detection + + void handleCollisions() { + SpaceObject[] objects = registry.getObjects(); + + SpaceObject objI, objJ; + for (int i = 0; i < objects.length; i++) { + objI = objects[i]; + for (int j = i + 1; j < objects.length; j++) { + objJ = objects[j]; + if (objI instanceof Bullet && objJ instanceof Bullet) + continue; + if (isCollision(objI, objJ)) { + if (objI instanceof Ship && objJ instanceof Ship) + Ship.bounce((Ship)(objI), (Ship)(objJ)); + else { + objI.handleCollision(objJ); + objJ.handleCollision(objI); + } + } + } + } + } + + /* + * Is the distance between the two centers less than the sum of the two + * radii. This is a cheap and dirty (i.e. wrong) implementation of this. + */ + static boolean isCollision(SpaceObject a, SpaceObject b) { + return (Math.abs(a.getXPos() - b.getXPos()) + + Math.abs(a.getYPos() - b.getYPos())) < + (a.getSize()/2 + b.getSize()/2); + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/GameSynchronization.java b/ajdoc/testdata/spacewar/spacewar/GameSynchronization.java new file mode 100644 index 000000000..dcf42e904 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/GameSynchronization.java @@ -0,0 +1,54 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +RegistrySynchronization.java +Part of the Spacewar system. + +*/ + +package spacewar; + +import coordination.Coordinator; + +/** + * This aspect ensures synchronized access to methods of the Game in the + * presence of several threads. + * + * It uses the Coordinator class, from the AspectJ coordination library. + * (This case is right on the borderline of being too simple to use the + * coordination library, but we use it anyways to keep the similarity + * with the RegistrySynchronizer.) + * + * It uses a per-Game coordination scheme, so there is one instance of + * this class for each instance of the Game class. When this class is + * constructed, it registers appropriate mutexes and selfexes using + * the behavior inherited from Coordinator. + * + * The coordination constraints for the Game are simple. We just need to + * make sure that newShip and handleCollisions are mutually exclusive. That + * ensures that they we can't destroy a ship that has just been replaced. + */ +aspect GameSynchronization extends Coordinator perthis(this(Game)) { + + protected pointcut synchronizationPoint(): + call(void Game.handleCollisions(..)) || call(Ship Game.newShip(..)); + + public GameSynchronization() { + addMutex(new String[] {"handleCollisions", "newShip"}); + } + +} diff --git a/ajdoc/testdata/spacewar/spacewar/Pilot.java b/ajdoc/testdata/spacewar/spacewar/Pilot.java new file mode 100644 index 000000000..330d860bf --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Pilot.java @@ -0,0 +1,44 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +*/ + +package spacewar; + + +/** + * Pilot is the abstract superclass of Player and Robot. + * + */ + +abstract class Pilot { + private Game game; + private int number; + protected Ship ship = null; + + Game getGame() { return game; } + int getNumber() { return number; } + Ship getShip() { return ship; } + + void setShip(Ship s) { ship = s; } + + Pilot (Game g, int n) { + super(); + game = g; + number = n; + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/Player.java b/ajdoc/testdata/spacewar/spacewar/Player.java new file mode 100644 index 000000000..ebde6d5c4 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Player.java @@ -0,0 +1,122 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +*/ + +package spacewar; + +import java.util.Enumeration; +import java.awt.event.KeyListener; +import java.awt.event.KeyEvent; + +class Player extends Pilot implements KeyListener { + + private KeyMapping keyMapping; + + /** current rotation key */ + private int rotation_direction = Ship.STOP; // current rotation key + + /** current thrust */ + private boolean thrust_on = false; + + Player(Game theGame, int number) { + super(theGame,number); + + if (getNumber() == 1) + keyMapping = KeyMapping.keyMapping1; + else if (getNumber() == 2) + keyMapping = KeyMapping.keyMapping2; + + } + + public void keyPressed(KeyEvent e) { + int keyCode = e.getKeyCode(); + boolean consumed = true; + + if (keyCode == keyMapping.fire) { + ship.fire(); + } + else if (keyCode == keyMapping.thrust && !thrust_on) { + ship.thrust(true); + thrust_on = true; + } + else if (keyCode == keyMapping.right && + rotation_direction != Ship.COUNTERCLOCKWISE) { + //start rotating clockwise unless already rotating in the + //opposite direction + rotation_direction = Ship.CLOCKWISE; + ship.rotate(Ship.CLOCKWISE); + } + else if (keyCode == keyMapping.left && + rotation_direction != Ship.CLOCKWISE) { + //start rotating counterclockwise unless already rotating in the + //opposite direction + rotation_direction = Ship.COUNTERCLOCKWISE; + ship.rotate(Ship.COUNTERCLOCKWISE); + } + else { + consumed = false; + } + + if (consumed) e.consume(); + } + + public void keyReleased(KeyEvent e) { + int keyCode = e.getKeyCode(); + + if (keyCode == keyMapping.thrust) { + ship.thrust(false); //engine off + thrust_on = false; + } + else if (keyCode == keyMapping.right && + rotation_direction == Ship.CLOCKWISE + || + keyCode == keyMapping.left && + rotation_direction == Ship.COUNTERCLOCKWISE) { + ship.rotate(Ship.STOP); //stop rotation + rotation_direction = Ship.STOP; + } + } + + public void keyTyped(KeyEvent e) { + // have to implement this because it's in KeyListener + } +} + +class KeyMapping { + + static final KeyMapping keyMapping1 = + new KeyMapping(KeyEvent.VK_LEFT, + KeyEvent.VK_RIGHT, + KeyEvent.VK_UP, + KeyEvent.VK_SPACE); + + static final KeyMapping keyMapping2 = + new KeyMapping(KeyEvent.VK_X, + KeyEvent.VK_V, + KeyEvent.VK_D, + KeyEvent.VK_ALT); + + int left, right, thrust, fire; + + KeyMapping(int k_left, int k_right, int k_thrust, int k_fire) { + left = k_left; + right = k_right; + thrust = k_thrust; + fire = k_fire; + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/Registry.java b/ajdoc/testdata/spacewar/spacewar/Registry.java new file mode 100644 index 000000000..a9cec0418 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Registry.java @@ -0,0 +1,126 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +Registry.java +Part of the Spacewar system. + +*/ + +package spacewar; + +import java.util.Vector; +import java.util.Hashtable; +import java.util.Enumeration; + +/** + * The Registry keeps track of all the space objects that are floating around. + * It basically supports register, unregister and contents type operations. + * + * The synchronization is done by the RegistrySynchronization aspect. + */ + +class Registry { + + private Hashtable table; + private Game game; + + Game getGame() { return game; } + + Registry (Game theGame) { + game = theGame; + table = new Hashtable(); + } + + + void register(SpaceObject object) { + table.put(object, object); + } + + void unregister(SpaceObject object) { + table.remove(object); + } + + /* + * It is an invariant of the design that only two points in SpaceObject + * should call register and unregister. This aspect enforces that. + * + * Unfortunately, in the current compiler, we get a static warning when + * there are no illegal calls that this advice has no targets. That will + * be fixed in a future release. For the time being the dummy method + * just below this fixes that. + */ + static aspect RegistrationProtection { + after() returning(): + (call(void Registry.register(SpaceObject)) || + call(void Registry.unregister(SpaceObject))) && + !(within(SpaceObject) && (withincode(new(..)) || + withincode(void die()))) { + throw new IllegalAccessError( + "This is an illegal call to " + thisJoinPoint + "\n" + + "Only the constructor and the die() on SpaceObject\n" + + "should call the primitive registry operations."); + } + } + + void dummy() { // see comment above + register(getObjects()[0]); + unregister(getObjects()[0]); + } + + + SpaceObject[] getObjects() { + SpaceObject[] allObjects = new SpaceObject[table.size()]; + Enumeration elements = table.elements(); + for(int i = 0; elements.hasMoreElements(); i++) { + allObjects[i] = (SpaceObject)(elements.nextElement()); + } + return allObjects; + } + + Ship[] getShips() { + // + // First we have to put just the Ships into a vector, then we can put + // them into an array of exactly the right length. + // + Ship[] arrayOfShips; + Vector vectorOfShips = new Vector(); + Enumeration elements = table.elements(); + while (elements.hasMoreElements()) { + Object object = elements.nextElement(); + if (object instanceof Ship) { + vectorOfShips.addElement(object); + } + } + + arrayOfShips = new Ship[(vectorOfShips.size())]; + vectorOfShips.copyInto(arrayOfShips); + return arrayOfShips; + } + + Hashtable getTable() { return table; } + + // + // The protocol for clockTick is that it automatically cascades. + // + void clockTick() { + Enumeration elements = table.elements(); + while (elements.hasMoreElements()) { + ((SpaceObject)elements.nextElement()).clockTick(); + } + } +} + diff --git a/ajdoc/testdata/spacewar/spacewar/RegistrySynchronization.java b/ajdoc/testdata/spacewar/spacewar/RegistrySynchronization.java new file mode 100644 index 000000000..986e4bd30 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/RegistrySynchronization.java @@ -0,0 +1,58 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +RegistrySynchronization.java +Part of the Spacewar system. + +*/ + +package spacewar; + +import coordination.Coordinator; + + +/** + * This aspect ensures synchronized access to methods of the Registry in + * the presence of several threads. + * + * It uses the Coordinator class, from the AspectJ coordination library. + * + * It uses a per-Registry coordination scheme, so there is one instance of + * this class for each instance of the Registry class. When this class is + * constructed, it registers appropriate mutexes and selfexes using the + * behavior inherited from Coordinator. + * + * The mutating methods (register and unregister) should be self-exclusive. + * Each reader method should be mutually exclusive with the mutating + * methods. But the readers can run concurrently. */ +aspect RegistrySynchronization extends Coordinator perthis(this(Registry)) { + + protected pointcut synchronizationPoint(): + call(void Registry.register(..)) || + call(void Registry.unregister(..)) || + call(SpaceObject[] Registry.getObjects(..)) || + call(Ship[] Registry.getShips(..)); + + public RegistrySynchronization() { + addSelfex("register"); + addSelfex("unregister"); + + addMutex(new String[] {"register", "unregister", "getObjects"}); + addMutex(new String[] {"register", "unregister", "getShips"}); + } + +} diff --git a/ajdoc/testdata/spacewar/spacewar/Robot.java b/ajdoc/testdata/spacewar/spacewar/Robot.java new file mode 100644 index 000000000..05f276108 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Robot.java @@ -0,0 +1,201 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +Robot.java +Part of the Spacewar system. + +*/ + +package spacewar; + +import java.util.Random; + +/** + * Robot is an automatic pilot that now has quite a bit of intelligence. + * So, beware ! + */ +class Robot extends Pilot implements Runnable { + + private static final int FIRE_INTERVAL = 60; + private static final int REBIRTH_DELAY = 900; + + private final Random random = new Random(); + + private Thread runner; + private boolean runnable = true; + + Robot(Game theGame, int number) { + super(theGame, number); + } + + void start() { + if (runner == null) { + runner = new Thread(this); + runner.start(); + } + } + + void destroy() { + if (runner != null) { + runnable = false; + runner = null; + } + } + + + // A Robot tracks User-controlled ships and fires at them + public void run() { + Ship target = null; + + while(runnable) { + // find target ship + do { + Ship[] potentials = getGame().getRegistry().getShips(); + if(potentials.length != 0) + target = potentials[Math.abs(random.nextInt() % potentials.length)]; + sleepForABit(25); + } while (target == ship); + // main loop + int currentRotation = Ship.STOP; + int time; + boolean currentlyAccelerating = false; + double dx, dy, angleA, angleB, theta, dtheta, d, + targetVel, a, b, c, targetXVel, targetYVel; + + while(true) { + sleepForABit(FIRE_INTERVAL); + + // if my ship is destroyed, give me a new one + if (!ship.isAlive()) { + sleepForABit(REBIRTH_DELAY); + getGame().newShip(this); + } + + // find direction and distance from target to me + dx = ship.getXPos() - target.getXPos(); + if (dx < - getGame().getWidth() / 2) + dx += getGame().getWidth(); + if (dx > getGame().getWidth() / 2) + dx -= getGame().getWidth(); + dy = ship.getYPos() - target.getYPos(); + if (dy < - getGame().getHeight() / 2) + dy += getGame().getHeight(); + if (dy > getGame().getHeight() / 2) + dy -= getGame().getHeight(); + d = Math.sqrt(dx * dx + dy * dy); + angleA = Math.atan(dy / dx); + if (dx < 0) + angleA += Math.PI; + + // find relative velocity and trajectory of target + targetXVel = target.getXVel() - ship.getXVel(); + targetYVel = target.getYVel() - ship.getYVel(); + targetVel = Math.sqrt(targetXVel * targetXVel + + targetYVel * targetYVel); + angleB = Math.atan(targetYVel / targetXVel); + if (targetXVel < 0) + angleB+=Math.PI; + + // find angle between line to target and taget's direction of travel + theta = (angleA - angleB) % (2 * Math.PI); + if (theta < -Math.PI) + theta += 2 * Math.PI; + if (theta > Math.PI) + theta -= 2 * Math.PI; + + // calculate time to bullet impact using law of cosines + a = targetVel * targetVel + Ship.BULLET_SPEED * Ship.BULLET_SPEED; + b = d * targetVel * Math.cos(theta); + c = - d * d; + time = (int)((-b + Math.sqrt(b * b - 4 * a * c)) / 2 / a); + + // calculate angle and distance to bullet impact location + dx = targetXVel * time - dx; + dy = targetYVel * time - dy; + theta = Math.atan(dy / dx); + if(dx < 0) + theta += Math.PI; + + // find desired change in rotation + dtheta = (theta - ship.getOrientation()) % (2 * Math.PI); + // find the shortest path to the desired orientation; + if(dtheta < - Math.PI) + dtheta += 2 * Math.PI; + if(dtheta > Math.PI) + dtheta -= 2 * Math.PI; + + // turn if nessecary + if (dtheta > Ship.DEFAULT_ANGULAR_VELOCITY / 2) { + if (currentRotation != Ship.CLOCKWISE) + ship.rotate(currentRotation = Ship.CLOCKWISE); + } + else if (dtheta < -Ship.DEFAULT_ANGULAR_VELOCITY / 2) { + if (currentRotation != Ship.COUNTERCLOCKWISE) + ship.rotate(currentRotation = Ship.COUNTERCLOCKWISE); + } // otherwise, fire, maybe even a burst + else { + if(currentRotation != Ship.STOP) + ship.rotate(currentRotation = Ship.STOP); + if (random.nextInt() % 40 == 0) { + ship.fire(); + } + } + + // randomly accelerate + if (currentlyAccelerating && random.nextInt() % 2 == 0) + ship.thrust(currentlyAccelerating = false); + else { + if (ship.getXVel() == 0) + angleA = 0; + else + angleA = Math.atan(ship.getYVel() / ship.getXVel()); + + if (ship.getXVel() < 0) + angleA+=Math.PI; + angleB = (angleA - ship.getOrientation()) % (2 * Math.PI); + if (angleB < -Math.PI) + angleB += 2 * Math.PI; + if (angleB > Math.PI) + angleB -= 2 * Math.PI; + angleB = Math.abs(angleB); + + // angleB now represents the angle between the ship's + // orientation and velocity vector. This will be used to + // determine the probably that the ship will thrust to + // prevent ships from accelerating too much in one direction + if (random.nextInt() % (int)(12 * (Math.PI - angleB) + 1) == 0) + ship.thrust(currentlyAccelerating = true); + } + + // switch targets if current one has been destroyed + if (target.getDamage() == 100) + break; + + // randomly switch targets + if (random.nextInt() % 4000 == 0) + break; + } + } + } + + void sleepForABit (int time) { + try { + runner.sleep(time); + } + catch (InterruptedException e) {} + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/SWFrame.java b/ajdoc/testdata/spacewar/spacewar/SWFrame.java new file mode 100644 index 000000000..6dfb9f6f6 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/SWFrame.java @@ -0,0 +1,92 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +SWFrame.java +Part of the Spacewar system. + +*/ + +package spacewar; + +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.MenuShortcut; +import java.awt.Dimension; +import java.awt.Insets; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +class SWFrame extends Frame implements ActionListener { + private Game game; + private Display display; + private Menu menu; + + Game getGame() { return game; } + Display getDisplay() { return display; } + Menu getMenu() { return menu; } + + SWFrame(Game theGame, Display d) { + super("Space War!"); + + game = theGame; + + display = d; + add(display); + + // create menu + menu = new Menu("Game"); + MenuItem item1 = new MenuItem("Add Robot", new MenuShortcut('a')); + MenuItem item2 = new MenuItem("Reset Ships", new MenuShortcut('r')); + MenuItem item3 = new MenuItem("Quit", new MenuShortcut('q')); + item1.setActionCommand("Add Robot"); + item2.setActionCommand("Reset Ships"); + item3.setActionCommand("Quit"); + menu.add(item1); + menu.add(item2); + menu.add(item3); + menu.addActionListener(this); + + setMenuBar(new MenuBar()); + getMenuBar().add(menu); + + Dimension screenSize = new Dimension(500, 500); + setSize(screenSize); + setVisible(true); + toFront(); + + Insets inset = getInsets(); + int displayWidth = screenSize.width - inset.left - inset.right; + int displayHeight = screenSize.height - inset.top - inset.bottom; + display.setSize(displayWidth, displayHeight); + } + + public void actionPerformed(ActionEvent e) { + String s = e.getActionCommand(); + if (s.equals("Add Robot")) { + getGame().addRobot(); + } + else if (s.equals("Reset Ships")) { + getGame().resetShips(); + } + else if (s.equals("Quit")) { + getGame().quit(); + } + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/Ship.java b/ajdoc/testdata/spacewar/spacewar/Ship.java new file mode 100644 index 000000000..9978fe694 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Ship.java @@ -0,0 +1,296 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + +Ship.java +Part of the Spacewar system. + +*/ + +package spacewar; + +class Ship extends SpaceObject { + + pointcut helmCommandsCut(Ship ship): + target(ship) && ( call(void rotate(int)) || + call(void thrust(boolean)) || + call(void fire()) ); + + + /** + * Energy and Damage are key values in the state of a ship. Energy is + * basically about fuel, and damage is about how bad a shape we are in. + * + * The energy related values are: + * + * The damage related values are: + * + * Finally, REPAIR_RATE is the rate at which energy is consumed to fix + * damage. + * + */ + private static final int MAX_ENERGY = 100; + private static final int BULLET_ENERGY= 2; + private static final double ACCELERATION_COST_FACTOR = 0.05; + + //XXX was private + static final int MAX_DAMAGE = 100; + private static final int BULLET_DAMAGE = 15; + private static final double COLLISION_DAMAGE_FACTOR = 0.1; + + private static final double REPAIR_RATE = 0.08; + + + private static final int EXPLOSION_LENGTH = 10; + + static final int BULLET_SPEED = 10; + + static final int CLOCKWISE = 1; + static final int STOP = 0; + static final int COUNTERCLOCKWISE = (-1); + + static final double DEFAULT_ANGULAR_VELOCITY = 0.2; + static final double DEFAULT_ACCELERATION = .4; + + static private final int SIZE = 30; //Can't be changed for now!!! + + private double energy; // range: 0 to MAX_ENERGY + private double damage; // range: 0 to MAX_DAMAGE + private double orientation; // in degrees + private double angularVel; // in ??? + private double xAcc, yAcc, rAcc; // + private int countdown; // remaining explosion time + + private Pilot pilot; + + Ship(Game theGame, double xPos, double yPos, double orientation) { + super(theGame, xPos, yPos, 0, 0); + xAcc = 0; + yAcc = 0; + this.orientation = orientation; + angularVel = 0; + + energy = MAX_ENERGY; + damage = 0; + countdown = EXPLOSION_LENGTH; + } + + + int getSize() { return SIZE; } + + double getEnergy() { return energy; } + double getDamage() { return damage; } + double getOrientation() { return orientation; } + double getRAcc() { return rAcc; } + + Pilot getPilot() { return pilot; } + void setPilot (Pilot p) { pilot = p; } + + float getEnergyLevel() { + return (float)energy / (float)MAX_ENERGY; + } + float getDamageLevel() { + return (float)damage / (float)MAX_DAMAGE; + } + + /** returns false if energy is out, otherwise decrements energy by amount + * and returns true + */ + boolean expendEnergy(double amount) { + if (amount <= energy) { + energy -= amount; + return true; + } + else + return false; + } + + /** increments damage by amount and handles the destruction of a ship if + * damage reaches MAX_DAMAGE. + */ + void inflictDamage(double amount) { + if (amount < 0) // shouldn't happen + return; + damage = Math.min(MAX_DAMAGE, damage + amount); + if (damage == MAX_DAMAGE) + setIsAlive(false); + } + + /** repairs some damage + */ + void repairDamage(double amount) { + if (amount < 0) // shouldn't happen + return; + if (damage == 0) + return; + damage = Math.max(0, damage - amount); + } + + public void clockTick() { + if (! isAlive()) { + // + // If we aren't alive, but we are still in the registry, it means + // we are exploding. countdown counts the length of the explosion. + // + if (--countdown == 0) + die(); + } + else { + if (angularVel != 0) { + orientation += angularVel; + xAcc = rAcc * Math.cos(orientation); + yAcc = rAcc * Math.sin(orientation); + } + setXVel(getXVel() + xAcc); + setYVel(getYVel() + yAcc); + + //expend energy + if (!expendEnergy(rAcc * ACCELERATION_COST_FACTOR)) + rAcc = xAcc = yAcc = 0; + + // fix damage + if (energy > 10 && damage > REPAIR_RATE) { + expendEnergy(REPAIR_RATE); + repairDamage(REPAIR_RATE); + } + } + super.clockTick(); + } + + /** + * First check to make sure we have enough energy to accelerate. If + * we do, then go ahead and do so. Acceleration is in the direction + * we are already facing (i.e. orientation). + */ + void setAcceleration(double acc) { + if (acc * ACCELERATION_COST_FACTOR <= energy) { + rAcc = acc; + xAcc = rAcc * Math.cos(orientation); + yAcc = rAcc * Math.sin(orientation); + } + } + + /** + * First check to make sure we have enough energy to rotate. If + * we do, then go ahead and do so. + */ + void setAngularVelocity(double omega) { + // changing direction of rotation takes energy + if (!expendEnergy(Math.abs(omega - angularVel) / 2)) + return; + //sets amount of degree rotation per clock tick, in radians; + //clockwise is positive + angularVel = omega; + } + + /** affect rotation thrusters. Direction can be one of {@link + * #CLOCKWISE}, {@link #COUNTERCLOCKWISE}, or zero for turning off + * the thrusters. + */ + void rotate(int direction) { + setAngularVelocity( + direction == CLOCKWISE ? DEFAULT_ANGULAR_VELOCITY : + direction == COUNTERCLOCKWISE ? -DEFAULT_ANGULAR_VELOCITY : + 0); + } + + /** turn on acceleration */ + void thrust(boolean onOff) { + setAcceleration(onOff ? DEFAULT_ACCELERATION : 0); + } + + /** create a bullet and fire it */ + void fire() { + // firing a shot takes energy + if (!expendEnergy(BULLET_ENERGY)) + return; + + //create a bullet object so it doesn't hit the ship that's firing it + double xV = getXVel() + BULLET_SPEED * (Math.cos(orientation)); + double yV = getYVel() + BULLET_SPEED * (Math.sin(orientation)); + + // create the actual bullet + new Bullet( + getGame(), + (getXPos() + ((getSize()/2 + 2) * (Math.cos(orientation))) + xV), + (getYPos() + ((getSize()/2 + 2) * (Math.sin(orientation))) + yV), + xV, + yV); + } + + + void handleCollision(SpaceObject obj) { + if (obj instanceof Ship) { + // should never be called. ship - ship collisions are handled in + // Ship.bounce(Ship shipA, Ship shipB) + } + else if (obj instanceof Bullet) { + inflictDamage(BULLET_DAMAGE); + } + else if (obj instanceof EnergyPacket) { + double packetEnergy = ((EnergyPacket)obj).getEnergy(); + energy = Math.max(0, Math.min(energy + packetEnergy, MAX_ENERGY)); + } + else { + System.err.println("collision with UFO!"); + } + } + + static void bounce(Ship shipA, Ship shipB) { + double dx, dy, denominator, + xAccA, yAccA, xAccB, yAccB, damage, + xComp, yComp, dvx, dvy; + + dx = Math.abs(shipA.getXPos() - shipB.getXPos()); + dy = Math.abs(shipA.getYPos() - shipB.getYPos()); + denominator = Math.sqrt(dx * dx + dy * dy); + xComp = dx / denominator; + yComp = dy / denominator; + xAccA = shipB.getXVel() * xComp + shipA.getXVel() * (1 - xComp) - + shipA.getXVel(); + yAccA = shipB.getYVel() * yComp + shipA.getYVel() * (1 - yComp) - + shipA.getYVel(); + xAccB = shipA.getXVel() * xComp + shipB.getXVel() * (1 - xComp) - + shipB.getXVel(); + yAccB = shipA.getYVel() * yComp + shipB.getYVel() * (1 - yComp) - + shipB.getYVel(); + shipA.accelerate(xAccA, yAccA); + shipB.accelerate(xAccB, yAccB); + dvx = shipA.getXVel() - shipB.getXVel(); + dvy = shipA.getYVel() - shipA.getYVel(); + damage = COLLISION_DAMAGE_FACTOR * (dvx * dvx + dvy * dvy); + shipA.inflictDamage(damage); + shipB.inflictDamage(damage); + + // !!! + // !!! poopers! this does a local time warp. this has to be a + // !!! violation of the clockTick protocol + // !!! + while (Game.isCollision(shipA, shipB)) { + shipA.clockTick(); + shipB.clockTick(); + } + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/SpaceObject.java b/ajdoc/testdata/spacewar/spacewar/SpaceObject.java new file mode 100644 index 000000000..ee3afabcc --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/SpaceObject.java @@ -0,0 +1,106 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +SpaceObject.java +Part of the Spacewar system. + +*/ + +package spacewar; + + +/** + * SpaceObjects are objects that float around in space. They support the + * minimal SpaceObject protocol, having to do with position, velocity, + * size and liveness. They are constructed with game, position, velocity + * and size. When constructed, a spaceobject adds itself to the registry. + * + * When it dies, a spaceobject removes itself from the registry. But note + * that it doesn't decide when to die, subclasses do that. + * + * The display aspects actually draw the space object on the screen and say + * how much space it takes up there. + */ +abstract class SpaceObject { + + private Game game; + private double xPos, yPos, oldXPos, oldYPos, xVel, yVel; + private boolean alive; + + SpaceObject (Game theGame, double xP, double yP, double xV, double yV) { + game = theGame; + xPos = xP; + yPos = yP; + oldXPos = xP; + oldYPos = yP; + xVel = xV; + yVel = yV; + + alive = true; + getGame().getRegistry().register(this); + } + + Game getGame() { return game; } + + double getXPos() { return xPos; } + double getYPos() { return yPos; } + + double getOldXPos() { return oldXPos; } + double getOldYPos() { return oldYPos; } + + double getXVel() { return xVel; } + double getYVel() { return yVel; } + + void setXVel (double n) { xVel = n; } + void setYVel (double n) { yVel = n; } + + boolean isAlive() { return alive; } + void setIsAlive(boolean n) { alive = n; } + + + /** + * Move 1 unit of time's worth of distance. I.e. increment xPos by xVel + * and yPos by yVel. If we move off an edge of the screen move us back + * in the opposite edge. + */ + void clockTick() { + oldXPos = xPos; + oldYPos = yPos; + xPos = (xPos + xVel) % getGame().getWidth(); + if(xPos < 0) + xPos += getGame().getWidth(); + yPos = (yPos + yVel) % getGame().getHeight(); + if(yPos < 0) + yPos += getGame().getHeight(); + } + + void accelerate(double dXVel, double dYVel) { + xVel += dXVel; + yVel += dYVel; + } + + void die() { + getGame().getRegistry().unregister(this); + } + + abstract int getSize(); + + /** resolve the effects of colliding with a space object. + * @param obj the space object that this object is colliding with. + */ + abstract void handleCollision(SpaceObject obj); +} diff --git a/ajdoc/testdata/spacewar/spacewar/Timer.java b/ajdoc/testdata/spacewar/spacewar/Timer.java new file mode 100644 index 000000000..1f4a992a7 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/Timer.java @@ -0,0 +1,53 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| +|<--- this code is formatted to fit into 80 columns --->| + + +Timer.java +Part of the Spacewar system. + +*/ + +package spacewar; + + +class Timer extends Thread { + + private final static int TICK_PERIOD = 40; // time between ticks in millis + + private Game game; + + Game getGame() { return game; } + + Timer (Game theGame) { + super("Timer"); + game = theGame; + } + + public void run() { + long t1, tdiff; + while (true) { + t1 = System.currentTimeMillis(); + getGame().clockTick(); + tdiff = System.currentTimeMillis() - t1; + if (tdiff < TICK_PERIOD) { + try { + sleep (Math.max(0 , TICK_PERIOD - tdiff)); + } + catch (InterruptedException e) { } + } + } + } +} diff --git a/ajdoc/testdata/spacewar/spacewar/debug.lst b/ajdoc/testdata/spacewar/spacewar/debug.lst new file mode 100644 index 000000000..4c16b856d --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/debug.lst @@ -0,0 +1,2 @@ +@demo.lst +Debug.java diff --git a/ajdoc/testdata/spacewar/spacewar/demo.lst b/ajdoc/testdata/spacewar/spacewar/demo.lst new file mode 100644 index 000000000..02af131d6 --- /dev/null +++ b/ajdoc/testdata/spacewar/spacewar/demo.lst @@ -0,0 +1,19 @@ +@../coordination/lib.lst +Bullet.java +EnergyPacket.java +EnergyPacketProducer.java +Game.java +GameSynchronization.java +Pilot.java +Registry.java +RegistrySynchronization.java +Robot.java +Ship.java +EnsureShipIsAlive.java +SpaceObject.java +Timer.java +SWFrame.java +Display.java +Display1.java +Display2.java +Player.java diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/MainTestCase.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/MainTestCase.java index 0863a04b0..ff31aa435 100644 --- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/MainTestCase.java +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/MainTestCase.java @@ -24,10 +24,16 @@ public class MainTestCase extends TestCase { // System.err.println(new File("testdata/figures-demo").exists()); File file1 = new File("testdata/simple/foo/ClassA.java"); + File aspect1 = new File("testdata/simple/foo/AspectA.java"); File file2 = new File("testdata/simple/foo/InterfaceI.java"); File outdir = new File("testdata/simple/doc"); - String[] args = { "-d", outdir.getAbsolutePath(), file1.getAbsolutePath(), file2.getAbsolutePath() }; + String[] args = { "-d", + outdir.getAbsolutePath(), + aspect1.getAbsolutePath(), + file1.getAbsolutePath(), + file2.getAbsolutePath() }; + org.aspectj.tools.ajdoc.Main.main(args); assertTrue(true); diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/SpacewarTestCase.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/SpacewarTestCase.java new file mode 100644 index 000000000..03c7c643c --- /dev/null +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/SpacewarTestCase.java @@ -0,0 +1,48 @@ +/* ******************************************************************* + * Copyright (c) 2003 Contributors. + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Common Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * Mik Kersten initial implementation + * ******************************************************************/ + package org.aspectj.tools.ajdoc; + +import java.io.File; + +import junit.framework.TestCase; + +/** + * @author Mik Kersten + */ +public class SpacewarTestCase extends TestCase { + + public void testSimpleExample() { + +// System.err.println(new File("testdata/figures-demo").exists()); + File outdir = new File("testdata/spacewar/doc"); + File sourcepath = new File("testdata/spacewar"); + + String[] args = { "-d", + outdir.getAbsolutePath(), + "-sourcepath", + sourcepath.getAbsolutePath(), + "spacewar", + "coordination" }; + + org.aspectj.tools.ajdoc.Main.main(args); + + assertTrue(true); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } +} -- cgit v1.2.3