You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Answer3c.java 955B

12345678910111213141516171819202122232425262728293031323334
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Common Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/cpl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package answers;
  13. import support.Log;
  14. import figures.Point;
  15. import figures.Group;
  16. import figures.FigureElement;
  17. aspect Answer3c {
  18. private Group Point.enclosingGroup = null;
  19. before(Point p, Group g):
  20. execution(void add(FigureElement)) && args(p) && target(g) {
  21. p.enclosingGroup = g;
  22. }
  23. before(Point p):
  24. call(void move(int, int)) && target(p) {
  25. Log.log("moving as a part of " + p.enclosingGroup);
  26. }
  27. }