/fstcomp/examples/Modification/AJHotDraw/srcBase/aspects/org/jhotdraw/contrib/html/ContentProducer.java

https://github.com/RoDaniel/featurehouse · Java · 81 lines · 14 code · 14 blank · 53 comment · 0 complexity · dc7c385334a833db3da63a44f7648013 MD5 · raw file

  1. /*
  2. * @(#)ContentProducer.java
  3. *
  4. * Project: JHotdraw - a GUI framework for technical drawings
  5. * http://www.jhotdraw.org
  6. * http://jhotdraw.sourceforge.net
  7. * Copyright: � by the original author(s) and all contributors
  8. * License: Lesser GNU Public License (LGPL)
  9. * http://www.opensource.org/licenses/lgpl-license.html
  10. */
  11. package org.jhotdraw.contrib.html;
  12. /**
  13. * ContentProducer defines the interface for objects capable of producing
  14. * contents on behalf of a client context.<br>
  15. * Primarely based on the Strategy pattern, the purpose of ContentProducers
  16. * is twofold:<br>
  17. * <li> Detach the logic for producing generic content from interested parties so
  18. * as to maximize reuse, of special interest for complex content</li>
  19. * <li> Standardize contents by allowing for the automatic decentralization of
  20. * contents source and production logic. Used together with the
  21. * ContentProducerRegistry it is possible to globally modify the behaviour
  22. * required for producing a specific type of contents. For example,
  23. * a FieldContentProducer could be declined to get its contents from variables in
  24. * an in-memory object, a setting from a configuration file, or even a field in
  25. * a database record.</li>
  26. *
  27. * @author Eduardo Francos - InContext
  28. * @created 30 avril 2002
  29. * @version <$CURRENT_VERSION$>
  30. * @todo should entity names be merged with the attribute names defined
  31. * in FigureAttributeConstant?
  32. */
  33. /*
  34. * AJHD: refactored persistence - the interface extends Storable
  35. * through introductions/declare parents from the PersistentContentProviders aspect.
  36. */
  37. public interface ContentProducer /*extends Storable*/ {
  38. /** Entity name for the figure's current x position in pixels */
  39. public final static String ENTITY_FIGURE_POSX = "FigurePosX";
  40. /** Entity name for the figure's current y position in pixels */
  41. public final static String ENTITY_FIGURE_POSY = "FigurePosY";
  42. /** Entity name for the figure's current width in pixels */
  43. public final static String ENTITY_FIGURE_WIDTH = "FigureWidth";
  44. /** Entity name for the figure's current height in pixels */
  45. public final static String ENTITY_FIGURE_HEIGHT = "FigureHeight";
  46. /** Entity name for the figure's current text color */
  47. public final static String ENTITY_FRAME_COLOR = "FrameColor";
  48. /** Entity name for the figure's current fill color */
  49. public final static String ENTITY_FILL_COLOR = "FillColor";
  50. /** Entity name for the figure's current arrow mode */
  51. public final static String ENTITY_ARROW_MODE = "ArrowMode";
  52. /** Entity name for the figure's current font name */
  53. public final static String ENTITY_FONT_NAME = "FontName";
  54. /** Entity name for the figure's current font size */
  55. public final static String ENTITY_FONT_SIZE = "FontSize";
  56. /** Entity name for the figure's current font style */
  57. public final static String ENTITY_FONT_STYLE = "FontStyle";
  58. /**
  59. * Produces the contents
  60. *
  61. * @param context the calling client context
  62. * @param ctxAttrName the attribute name
  63. * @param ctxAttrValue the attribute value that led to the call to this
  64. * @return The content value
  65. */
  66. public Object getContent(ContentProducerContext context, String ctxAttrName, Object ctxAttrValue);
  67. }