1 /* 2 * $HeadURL: $ 3 * $Date: $ 4 * $Revision: $ 5 * $Author: $ 6 * 7 * Copyright (c) 2005 MindTree Consulting Ltd. 8 * 9 * This file is part of Insight. 10 * 11 * Insight is free software: you can redistribute it and/or modify it under the 12 * terms of the GNU General Public License as published by the Free Software 13 * Foundation, either version 3 of the License, or (at your option) any later 14 * version. 15 * 16 * Insight is distributed in the hope that it will be useful, but 17 * WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 19 * Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License along with 22 * Insight. If not, see <http://www.gnu.org/licenses/>. 23 */ 24 package com.mindtree.techworks.insight.gui; 25 26 import javax.swing.JComponent; 27 28 import com.mindtree.techworks.insight.pagination.IPage; 29 import com.mindtree.techworks.insight.spi.LogEvent; 30 31 /** 32 * The <code>Presentation</code> interface defines the behavior common to all 33 * GUI component blocks that exist in the log viewer. The methods defined in 34 * this interface are typically call back methods invoked by the Controller at 35 * appropriate instance of time. 36 * Implementations of this interface neednot necessarily be GUI components themselves 37 * and can actually be wrappers if need be. 38 * 39 * @author Regunath B 40 * @version 1.0, 04/10/25 41 * @see com.mindtree.techworks.insight.Controller 42 */ 43 44 45 public interface Presentation { 46 47 /** 48 * Gets the UID for this Presentation. May be the fully qualified class name 49 * of the implementation class. 50 * @return the UID that identifies this Presentation among other instances of the same type 51 * 52 */ 53 public String getUID(); 54 55 /** 56 * Notifies this Presentation that a widget has changed in the specified Presentation 57 * for which this Presentation had registered for widget change updates. 58 * @param presentation the Presentation containing the widget 59 * @param identifier unique identifier of the widget in the Presentation 60 * @param data null or the information returned by the source Presentation containing data in the context of the widget change 61 */ 62 public void notifyWidgetStateChange(Presentation presentation, int identifier, Object data); 63 64 /** 65 * Gets the component that represents the GUI of this Presentation 66 * @return the JComponent instance that denotes the view of this Presentation 67 * 68 */ 69 public JComponent getViewComponent(); 70 71 72 /** 73 * Determines if this Presentation updates its GUI representation when 74 * new events occur. Primarily of use to implementations that can update their 75 * display when new events occur 76 * @return true if this Presentation supports real time updates, false otherwise 77 */ 78 public boolean doesProcessRealTimeUpdates(); 79 80 /** 81 * Informs this Presentation that a new real time event has occurred. 82 * This method is called only when <code>#doesProcessRealTimeUpdates()</code> 83 * returns true. 84 * @param event the real time event that was received 85 */ 86 public void processRealTimeUpdate(LogEvent event); 87 88 /** 89 * Informs this Presentation to reset all display widgets 90 */ 91 public void resetWidgets(); 92 93 /** 94 * Informs this Presentation ot display the specified page and highlight the 95 * LogEvent with the specified sequence number. 96 * @param page the IPage to display 97 * @param eventSequenceNumber -1 or the valid sequence number of the LogEvent to be highlighted 98 */ 99 public void displayPage(IPage page, long eventSequenceNumber); 100 101 /** 102 * Sets the status of the scroll lock for this Presentation. 103 * @param lock boolean true for scroll lock, false otherwise 104 */ 105 public void setScrollLock(boolean status); 106 107 }