Browse Source

untabified

tags/V1_1_1
ehilsdal 21 years ago
parent
commit
910f2658b1
30 changed files with 289 additions and 289 deletions
  1. 10
    10
      docs/teaching/exercises/answers/Answer1a.java
  2. 8
    8
      docs/teaching/exercises/answers/Answer1b.java
  3. 8
    8
      docs/teaching/exercises/answers/Answer1c.java
  4. 9
    9
      docs/teaching/exercises/answers/Answer1d.java
  5. 8
    8
      docs/teaching/exercises/answers/Answer2a.java
  6. 9
    9
      docs/teaching/exercises/answers/Answer2b.java
  7. 10
    10
      docs/teaching/exercises/answers/Answer2c.java
  8. 12
    12
      docs/teaching/exercises/answers/Answer2d.java
  9. 8
    8
      docs/teaching/exercises/answers/Answer2e.java
  10. 8
    8
      docs/teaching/exercises/answers/Answer2f.java
  11. 8
    8
      docs/teaching/exercises/answers/Answer2g.java
  12. 8
    8
      docs/teaching/exercises/answers/Answer2h.java
  13. 8
    8
      docs/teaching/exercises/answers/Answer3a.java
  14. 9
    9
      docs/teaching/exercises/answers/Answer3b.java
  15. 12
    12
      docs/teaching/exercises/answers/Answer3c.java
  16. 9
    9
      docs/teaching/exercises/answers/Answer4a.java
  17. 12
    12
      docs/teaching/exercises/answers/Answer4b.java
  18. 13
    13
      docs/teaching/exercises/answers/Answer4c.java
  19. 17
    17
      docs/teaching/exercises/answers/Answer4d.java
  20. 19
    19
      docs/teaching/exercises/answers/Answer4e.java
  21. 8
    8
      docs/teaching/exercises/figures/Box.java
  22. 8
    8
      docs/teaching/exercises/figures/FigureElement.java
  23. 8
    8
      docs/teaching/exercises/figures/Group.java
  24. 9
    9
      docs/teaching/exercises/figures/Line.java
  25. 9
    9
      docs/teaching/exercises/figures/Point.java
  26. 8
    8
      docs/teaching/exercises/figures/ShapeFigureElement.java
  27. 10
    10
      docs/teaching/exercises/figures/SlothfulPoint.java
  28. 8
    8
      docs/teaching/exercises/figures/gui/FigurePanel.java
  29. 8
    8
      docs/teaching/exercises/figures/gui/LogAdapter.java
  30. 8
    8
      docs/teaching/exercises/figures/gui/Main.java

+ 10
- 10
docs/teaching/exercises/answers/Answer1a.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -16,7 +16,7 @@ import figures.*;

aspect Answer1a {
declare error
: get(java.io.PrintStream System.out)
: get(java.io.PrintStream System.out)
&& within(figures..*)
: "illegal access to System.out";
: "illegal access to System.out";
}

+ 8
- 8
docs/teaching/exercises/answers/Answer1b.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;

+ 8
- 8
docs/teaching/exercises/answers/Answer1c.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;

+ 9
- 9
docs/teaching/exercises/answers/Answer1d.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -18,6 +18,6 @@ aspect Answer1c {
&& !(withincode(* set*(..))
|| withincode(new(..))
|| withincode(void figures.Point.move(int, int)))
&& within(figures.*)
&& within(figures.*)
: "bad field set";
}

+ 8
- 8
docs/teaching/exercises/answers/Answer2a.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;

+ 9
- 9
docs/teaching/exercises/answers/Answer2b.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -19,7 +19,7 @@ public aspect Answer2b {
before(FigureElement newValue):
call(void Group.add(FigureElement))
&& args(newValue) {
if (newValue == null) {
if (newValue == null) {
throw new IllegalArgumentException("null not allowed");
}
}

+ 10
- 10
docs/teaching/exercises/answers/Answer2c.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -20,10 +20,10 @@ public aspect Answer2c {
call(void Group.add(FigureElement))
&& args(newValue)
&& target(g) {
if (newValue == null) {
if (newValue == null) {
throw new IllegalArgumentException("null not allowed");
}
if (newValue == g) {
if (newValue == g) {
throw new IllegalArgumentException("self not allowed");
}


+ 12
- 12
docs/teaching/exercises/answers/Answer2d.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -16,9 +16,9 @@ import figures.SlothfulPoint;

aspect Answer2d {
after(int newValue, SlothfulPoint p) returning:
call(void setX(int)) && args(newValue) && target(p) {
if (newValue != p.getX()) {
throw new RuntimeException("setter didn't set");
}
call(void setX(int)) && args(newValue) && target(p) {
if (newValue != p.getX()) {
throw new RuntimeException("setter didn't set");
}
}
}

+ 8
- 8
docs/teaching/exercises/answers/Answer2e.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;

+ 8
- 8
docs/teaching/exercises/answers/Answer2f.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;

+ 8
- 8
docs/teaching/exercises/answers/Answer2g.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;

+ 8
- 8
docs/teaching/exercises/answers/Answer2h.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;

+ 8
- 8
docs/teaching/exercises/answers/Answer3a.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;

+ 9
- 9
docs/teaching/exercises/answers/Answer3b.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -20,7 +20,7 @@ import figures.FigureElement;

aspect Answer3b {
before():
execution(void Group.add(FigureElement)) && args(Point) {
execution(void Group.add(FigureElement)) && args(Point) {
Log.log("adding Point");
}
}

+ 12
- 12
docs/teaching/exercises/answers/Answer3c.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -22,13 +22,13 @@ aspect Answer3c {
private Group Point.enclosingGroup = null;

before(Point p, Group g):
execution(void add(FigureElement)) && args(p) && target(g) {
p.enclosingGroup = g;
execution(void add(FigureElement)) && args(p) && target(g) {
p.enclosingGroup = g;
}

before(Point p):
call(void move(int, int)) && target(p) {
Log.log("moving as a part of " + p.enclosingGroup);
call(void move(int, int)) && target(p) {
Log.log("moving as a part of " + p.enclosingGroup);
}

}

+ 9
- 9
docs/teaching/exercises/answers/Answer4a.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -23,6 +23,6 @@ aspect Answer4a {
FigureElement.MAX_VALUE - FigureElement.MIN_VALUE);

Rectangle around(): execution(Rectangle Group.getBounds()) {
return wholeCanvas;
return wholeCanvas;
}
}

+ 12
- 12
docs/teaching/exercises/answers/Answer4b.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -21,9 +21,9 @@ aspect Answer4b {

Rectangle around(Group g):
execution(Rectangle Group.getBounds()) && this(g) {
if (g.cache == null) {
g.cache = proceed(g);
}
return g.cache;
if (g.cache == null) {
g.cache = proceed(g);
}
return g.cache;
}
}

+ 13
- 13
docs/teaching/exercises/answers/Answer4c.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -21,13 +21,13 @@ aspect Answer4c {

Rectangle around(Group g):
execution(Rectangle Group.getBounds()) && this(g) {
if (g.cache == null) {
g.cache = proceed(g);
}
return g.cache;
if (g.cache == null) {
g.cache = proceed(g);
}
return g.cache;
}

before(Group g): call(void move(int, int)) && target(g) {
g.cache = null;
g.cache = null;
}
}

+ 17
- 17
docs/teaching/exercises/answers/Answer4d.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -22,21 +22,21 @@ aspect Answer4d {
private Group Point.enclosingGroup = null;

before(Point p, Group g):
execution(void add(FigureElement)) && args(p) && target(g) {
p.enclosingGroup = g;
execution(void add(FigureElement)) && args(p) && target(g) {
p.enclosingGroup = g;
}

Rectangle around(Group g):
execution(Rectangle Group.getBounds()) && this(g) {
if (g.cache == null) {
g.cache = proceed(g);
}
return g.cache;
if (g.cache == null) {
g.cache = proceed(g);
}
return g.cache;
}

before(Point p): set(* Point.*) && target(p) {
if (p.enclosingGroup != null) {
p.enclosingGroup.cache = null;
}
if (p.enclosingGroup != null) {
p.enclosingGroup.cache = null;
}
}
}

+ 19
- 19
docs/teaching/exercises/answers/Answer4e.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/

package answers;
@@ -22,23 +22,23 @@ aspect Answer4e {
private Group FigureElement.enclosingGroup = null;

before(FigureElement p, Group g):
execution(void add(FigureElement)) && args(p) && target(g) {
p.enclosingGroup = g;
execution(void add(FigureElement)) && args(p) && target(g) {
p.enclosingGroup = g;
}

Rectangle around(Group g):
execution(Rectangle Group.getBounds()) && this(g) {
if (g.cache == null) {
g.cache = proceed(g);
}
return g.cache;
if (g.cache == null) {
g.cache = proceed(g);
}
return g.cache;
}

before(Point p): set(* Point.*) && target(p) {
FigureElement fe = p;
while (fe.enclosingGroup != null) {
fe.enclosingGroup.cache = null;
fe = fe.enclosingGroup;
}
FigureElement fe = p;
while (fe.enclosingGroup != null) {
fe.enclosingGroup.cache = null;
fe = fe.enclosingGroup;
}
}
}

+ 8
- 8
docs/teaching/exercises/figures/Box.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/



+ 8
- 8
docs/teaching/exercises/figures/FigureElement.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/



+ 8
- 8
docs/teaching/exercises/figures/Group.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/



+ 9
- 9
docs/teaching/exercises/figures/Line.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/


@@ -51,7 +51,7 @@ public class Line extends ShapeFigureElement {
}

private Line2D getLine2D() {
return new Line2D.Float((float)getP1().getX(),
return new Line2D.Float((float)getP1().getX(),
(float)getP1().getY(),
(float)getP2().getX(),
(float)getP2().getY());

+ 9
- 9
docs/teaching/exercises/figures/Point.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/


@@ -49,7 +49,7 @@ public class Point extends ShapeFigureElement {
private final static int WIDTH = Point.HEIGHT;

public Shape getShape() {
return new Ellipse2D.Float((float)getX()-Point.WIDTH/2,
return new Ellipse2D.Float((float)getX()-Point.WIDTH/2,
(float)getY()-Point.HEIGHT/2,
(float)Point.HEIGHT,
(float)Point.WIDTH);

+ 8
- 8
docs/teaching/exercises/figures/ShapeFigureElement.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/



+ 10
- 10
docs/teaching/exercises/figures/SlothfulPoint.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/


@@ -35,7 +35,7 @@ public class SlothfulPoint extends ShapeFigureElement {
public void setY(int y) { }

public void move(int dx, int dy) {
System.out.println("Slothful moving");
System.out.println("Slothful moving");
}

public String toString() {
@@ -43,7 +43,7 @@ public class SlothfulPoint extends ShapeFigureElement {
}

public Shape getShape() {
return new Ellipse2D.Float((float)_x,
return new Ellipse2D.Float((float)_x,
(float)_y, 1.0f, 1.0f);
}
}

+ 8
- 8
docs/teaching/exercises/figures/gui/FigurePanel.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/



+ 8
- 8
docs/teaching/exercises/figures/gui/LogAdapter.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/



+ 8
- 8
docs/teaching/exercises/figures/gui/Main.java View File

@@ -1,13 +1,13 @@
/* *******************************************************************
* Copyright (c) 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:
* PARC initial implementation
* 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:
* PARC initial implementation
* ******************************************************************/



Loading…
Cancel
Save