CSSable.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package de.tu_darmstadt.informatik.tk.scopviz.ui.css;
  2. import java.util.HashSet;
  3. /**
  4. * An Interface which offers functions to store, remove and toggle CSS classes
  5. * and update a stored CSS String.
  6. *
  7. * @author Matthias Wilhelm
  8. */
  9. public interface CSSable {
  10. /**
  11. * Adds a CSS class to the object. classes already added are ignored
  12. * silently. multiple classes can be separated by a '.' or ' '.
  13. *
  14. * @param c
  15. * the classes to add
  16. */
  17. public void addCSSClass(String c);
  18. /**
  19. * Removes a CSS class from the object. classes not part of the object are
  20. * ignored silently. multiple classes can be separated by a '.' or ' '.
  21. *
  22. * @param c
  23. * the classes to remove
  24. */
  25. public void removeCSSClass(String c);
  26. /**
  27. * Toggles a CSS class from the object. multiple classes can be separated by
  28. * a '.' or ' '.
  29. *
  30. * @param c
  31. * the classes to remove
  32. */
  33. public void toggleCSSClass(String c);
  34. /**
  35. * Checks whether the given classes are part of the object. multiple classes
  36. * can be separated by a '.' or ' '.
  37. *
  38. * @param c
  39. * the classes to check
  40. * @return return true if all classes are matched
  41. */
  42. public boolean hasCSSClass(String c);
  43. /**
  44. *
  45. * @return a Set of Strings containing all the previously added CSS classes
  46. */
  47. public HashSet<String> getClasses();
  48. /**
  49. *
  50. * @return the Type of the CSS Object
  51. */
  52. public String getType();
  53. /**
  54. * Updates the stored CSS String
  55. */
  56. public void updateCSS();
  57. /**
  58. *
  59. * @return the stored CSS String
  60. */
  61. public String getCSS();
  62. }