/test/subjects/JHD176target/src/CH/ifa/draw/contrib/html/ContentProducer.java

https://bitbucket.org/gustavoasoares/saferefactor · Java · 78 lines · 15 code · 14 blank · 49 comment · 0 complexity · 4b9c1e8576430f04e6bee8aeb3f95bb8 MD5 · raw file

  1. /*
  2. * @(#)TextAreaFigure.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 CH.ifa.draw.contrib.html;
  12. import CH.ifa.draw.util.Storable;
  13. /**
  14. * ContentProducer defines the interface for objects capable of producing
  15. * contents on behalf of a client context.<br>
  16. * Primarely based on the Strategy pattern, the purpose of ContentProducers
  17. * is twofold:<br>
  18. * <li> Detach the logic for producing generic content from interested parties so
  19. * as to maximize reuse, of special interest for complex content</li>
  20. * <li> Standardize contents by allowing for the automatic decentralization of
  21. * contents source and production logic. Used together with the
  22. * ContentProducerRegistry it is possible to globally modify the behaviour
  23. * required for producing a specific type of contents. For example,
  24. * a FieldContentProducer could be declined to get its contents from variables in
  25. * an in-memory object, a setting from a configuration file, or even a field in
  26. * a database record.</li>
  27. *
  28. * @author Eduardo Francos - InContext
  29. * @created 30 avril 2002
  30. * @version 1.0
  31. * @todo should entity names be merged with the attribute names defined
  32. * in FigureAttributeConstant?
  33. */
  34. public interface ContentProducer extends Storable {
  35. /** Entity name for the figure's current x position in pixels */
  36. public final static String ENTITY_FIGURE_POSX = "FigurePosX";
  37. /** Entity name for the figure's current y position in pixels */
  38. public final static String ENTITY_FIGURE_POSY = "FigurePosY";
  39. /** Entity name for the figure's current width in pixels */
  40. public final static String ENTITY_FIGURE_WIDTH = "FigureWidth";
  41. /** Entity name for the figure's current height in pixels */
  42. public final static String ENTITY_FIGURE_HEIGHT = "FigureHeight";
  43. /** Entity name for the figure's current text color */
  44. public final static String ENTITY_FRAME_COLOR = "FrameColor";
  45. /** Entity name for the figure's current fill color */
  46. public final static String ENTITY_FILL_COLOR = "FillColor";
  47. /** Entity name for the figure's current arrow mode */
  48. public final static String ENTITY_ARROW_MODE = "ArrowMode";
  49. /** Entity name for the figure's current font name */
  50. public final static String ENTITY_FONT_NAME = "FontName";
  51. /** Entity name for the figure's current font size */
  52. public final static String ENTITY_FONT_SIZE = "FontSize";
  53. /** Entity name for the figure's current font style */
  54. public final static String ENTITY_FONT_STYLE = "FontStyle";
  55. /**
  56. * Produces the contents
  57. *
  58. * @param context the calling client context
  59. * @param ctxAttrName the attribute name
  60. * @param ctxAttrValue the attribute value that led to the call to this
  61. * @return The content value
  62. */
  63. public Object getContent(ContentProducerContext context, String ctxAttrName, Object ctxAttrValue);
  64. }