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.

FrameManager.java 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack, Gregory Holmes
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. */
  22. package com.dmdirc.ui.framemanager;
  23. import java.awt.Color;
  24. import javax.swing.JComponent;
  25. import com.dmdirc.Channel;
  26. import com.dmdirc.FrameContainer;
  27. import com.dmdirc.Query;
  28. import com.dmdirc.Raw;
  29. import com.dmdirc.Server;
  30. /**
  31. * A frame manager is a widget that allows the user to navigate between the
  32. * various frames that will be open at any one time.
  33. * @author chris
  34. */
  35. public interface FrameManager {
  36. /**
  37. * Sets the parent component of this frame manager. The frame manager
  38. * should render itself within the parent.
  39. * @param parent The parent control
  40. */
  41. void setParent(JComponent parent);
  42. /**
  43. * Indicates whether this frame manager can be positioned vertically
  44. * (i.e., at the side of the screen).
  45. * @return True iff the frame manager can be positioned vertically
  46. */
  47. boolean canPositionVertically();
  48. /**
  49. * Indicates whether this frame manager can be positioned horizontally
  50. * (i.e., at the top or bottom of the screen).
  51. * @return True iff the frame manager can be positioned horizontally
  52. */
  53. boolean canPositionHorizontally();
  54. /**
  55. * Indicates that there is a new active frame.
  56. * @param source The object that now has focus
  57. */
  58. void setSelected(FrameContainer source);
  59. /**
  60. * Shows an event notification to the user by colouring the corresponding
  61. * element to the source a specific colour.
  62. * @param source The object requesting notification
  63. * @param colour The colour that should be used to indicate the notification
  64. */
  65. void showNotification(FrameContainer source, Color colour);
  66. /**
  67. * Removes the notification status of the specified object.
  68. * @param source The object whose notification should be cleared
  69. */
  70. void clearNotification(FrameContainer source);
  71. /**
  72. * Adds a new server instance to this frame manager.
  73. * @param server The server to be added
  74. */
  75. void addServer(Server server);
  76. /**
  77. * Removes a server instance from this frame manager.
  78. * @param server The server to be removed
  79. */
  80. void delServer(Server server);
  81. /**
  82. * Adds a new channel instance to this frame manager.
  83. * @param server The server to which the channel belongs
  84. * @param channel The channel to be added
  85. */
  86. void addChannel(Server server, Channel channel);
  87. /**
  88. * Removes a channel instance from this frame manager.
  89. * @param server The server to which the channel belongs
  90. * @param channel The channel to be removed
  91. */
  92. void delChannel(Server server, Channel channel);
  93. /**
  94. * Adds a new query instance to this frame manager.
  95. * @param server The server to which the query belongs
  96. * @param query The query to be added
  97. */
  98. void addQuery(Server server, Query query);
  99. /**
  100. * Removes a query instance from this frame manager.
  101. * @param server The server to which the query belongs
  102. * @param query The query to be removed
  103. */
  104. void delQuery(Server server, Query query);
  105. /**
  106. * Adds a new raw instance to this frame manager.
  107. * @param server The server to which the raw frame belongs
  108. * @param raw The raw instance to be added
  109. */
  110. void addRaw(Server server, Raw raw);
  111. /**
  112. * Removes a raw instance from this frame manager.
  113. * @param server The server to which the raw frame belongs
  114. * @param raw The raw instance to be removed
  115. */
  116. void delRaw(Server server, Raw raw);
  117. }