COPYRIGHT osid.SidImplementationLicense
ALWAYS_PACKAGE eas

BEGIN
    CLASS DirectorySearch
    EXTENDS mit.swing.xJPanel
    IMPLEMENTS com.apple.eawt.ApplicationListener
        
    DECLARE private static javax.swing.JFrame frame = null
    DECLARE private org.osid.OsidContext context = new org.osid.OsidContext()
    DECLARE private eas.Settings settings = eas.Settings.getInstance()
    DECLARE private eas.ui.GUIServices guiServices = null

    MERGE_FROM directorySearch.merge
    MERGE MergeConstructor:METHOD public DirectorySearch(javax.swing.JFrame frame)
    MERGE MergeMain:METHOD public static void main(String args[])
    MERGE MergeCreateAndShowGUI:METHOD static void createAndShowGUI()
    MERGE MergeQuit:METHOD public void quit()
    MERGE MergeHandleAbout:METHOD public void handleAbout(com.apple.eawt.ApplicationEvent ae)
    METHOD public void handleOpenApplication(com.apple.eawt.ApplicationEvent ae)
    METHOD public void handleOpenFile(com.apple.eawt.ApplicationEvent ae)
    MERGE MergeHandlePreferences:METHOD public void handlePreferences(com.apple.eawt.ApplicationEvent ae)
    METHOD public void handlePrintFile(com.apple.eawt.ApplicationEvent ae)
    MERGE MergeHandleQuit:METHOD public void handleQuit(com.apple.eawt.ApplicationEvent ae)
    METHOD public void handleReOpenApplication(com.apple.eawt.ApplicationEvent ae)

    LISTENS_TO eas.event.Exit
    LISTENS_TO eas.event.Quit
END

BEGIN
    CLASS DirectorySearchPanel
    EXTENDS mit.swing.xJTabbedPane

    DECLARE private eas.Settings settings = eas.Settings.getInstance()
    DECLARE private eas.ui.GUIServices guiServices = eas.ui.GUIServices.getInstance()
    DECLARE private mit.swing.xJPanel panel = new mit.swing.xJPanel()
    DECLARE private org.osid.shared.Type searchType = new org.osid.types.mit.DirectorySearchType()
    DECLARE private mit.swing.xJPanel editorComponent = null 
    DECLARE private eas.ui.SearchButton searchButton = new eas.ui.SearchButton()
    DECLARE private eas.AgentList agentList = new eas.AgentList()
    DECLARE private eas.SearchManager searchManager = new eas.SearchManager()
    DECLARE private eas.AgentPropertiesPanel agentPropertiesPanel = new eas.AgentPropertiesPanel()
    DECLARE private java.util.Vector agentVector = new java.util.Vector()
    DECLARE private org.osid.shared.Type agentPropertiesType = new eas.util.Type("mit.edu","agent_properties","email_person")

    MERGE_FROM DirectorySearchPanel.merge
    MERGE MergeConstructor:METHOD public DirectorySearchPanel()
    LISTENS_TO eas.event.Search
    LISTENS_TO eas.AgentSelection
END

SCROLLABLE_LIST Agent:300

BEGIN
    CLASS AgentPropertiesPanel
    EXTENDS mit.swing.xJPanel
    MERGE_FROM AgentPropertiesPanel.merge
    
    DECLARE private eas.event.NameField nameField = new eas.event.NameField();
    DECLARE private eas.event.EmailField emailField = new eas.event.EmailField();
    DECLARE private eas.event.PhoneField phoneField = new eas.event.PhoneField();
    DECLARE private eas.event.AddressField addressField = new eas.event.AddressField();
    DECLARE private eas.event.DepartmentField departmentField = new eas.event.DepartmentField();
    DECLARE private eas.event.TitleField titleField = new eas.event.TitleField();
    DECLARE private eas.event.UrlField urlField = new eas.event.UrlField();
    
    ADD_NOTIFY_LINE nameField.setEditable(false)
    ADD_NOTIFY_LINE emailField.setEditable(false)
    ADD_NOTIFY_LINE phoneField.setEditable(false)
    ADD_NOTIFY_LINE addressField.setEditable(false)
    ADD_NOTIFY_LINE departmentField.setEditable(false)
    ADD_NOTIFY_LINE titleField.setEditable(false)
    ADD_NOTIFY_LINE urlField.setEditable(false)
    
    ADD nameField
    ADD emailField
    ADD phoneField
    ADD addressField
    ADD departmentField
    ADD titleField
    ADD urlField
    GRIDBAG_LAYOUT
    
    METHOD public void setName(String name):this.nameField.setText(name);
    METHOD public void setEmail(String email):this.emailField.setText(email);
    METHOD public void setPhone(String phone):this.phoneField.setText(phone);
    METHOD public void setAddress(String address):this.addressField.setText(address);
    METHOD public void setDepartment(String department):this.departmentField.setText(department);
    METHOD public void setTitle(String title):this.titleField.setText(title);
    METHOD public void setUrl(String url):this.urlField.setText(url);
END

BEGIN
    CLASS Settings
    EXTENDS mit.swing.xJPanel    
    MERGE_FROM settings.merge
    
    DECLARE public static final int OSID_VERSION_2_0 = 2

    DECLARE private static Settings settings = new Settings()
    METHOD private Settings()
    METHOD public static Settings getInstance():return settings
    DECLARE private eas.ui.GUIServices guiServices = null
    
    DECLARE private java.util.Properties easProperties = null    
    DECLARE private java.util.Properties userProperties = null    
    DECLARE private java.util.Properties osidImplProperties = null    
    DECLARE private org.osid.id.IdManager idManager = null
    DECLARE private org.osid.agent.AgentManager agentManager = null

    DECLARE private java.util.Vector adjusterVector = new java.util.Vector()
    MERGE MergeLoad:METHOD public void load(String userPropertiesFile, String easPropertiesFile, boolean isConnected)
    
    VECTOR org.osid.shared.Type CriteriaEditorType
    VECTOR String CriteriaEditor
    VECTOR org.osid.shared.Type CriteriaAdjSearchType
    VECTOR String CriteriaAdj

    GETSET org.osid.OsidContext Context
    GETSET String EasHomeDirectory
    GETSET String UserHomeDirectory
    GETSET boolean Mac
    GETSET boolean Windows
    GETSET boolean ResultsOnly
    GETSET boolean DebugMode
    GETSET boolean RunningConnected
    GETSET boolean RunningDisconnected
    GETSET String ApplicationTitle
    GETSET String LogFile
    GETSET String LoggingImplementation
    GETSET org.osid.shared.Type LogFormatType
    GETSET org.osid.shared.Type LogPriorityType

    GETSET String DefaultCriteriaEditor
    GETSET String IdImplementation
    GETSET String AgentImplementation
    GETSET String RootDirectory
    GETSET String DataDirectory
    GETSET String UserResourceDirectory
    GETSET String SystemResourceDirectory
    GETSET String LocalizationDirectory
    GETSET String LocalizationFile
    GETSET String HelpURL
    GETSET String VisitSiteURL
    GETSET String VisitSiteImage
    
    GETSET int WindowWidth
    GETSET int WindowHeight
    GETSET  java.awt.Color DefaultBackground

    GETSET String SplashImage
    GETSET String AboutImage
    GETSET long SplashSleep
    GETSET String IconifyImage
    GETSET String SearchImage
    GETSET String SearchInProgressImage

    GETSET int PrintFooterStartRow
    GETSET int PrintFooterStartColumn
    GETSET java.awt.Font PrintFooterFont
    GETSET java.awt.Color PrintFooterColor
    GETSET String PrintFooterText
    
    GET Preferences Preferences
    
    MERGE MergeGetIdManager:METHOD org.osid.id.IdManager getIdManager()
    MERGE MergeGetAgentManager:METHOD org.osid.agent.AgentManager getAgentManager()
    MERGE MergeGetCriteriaAdjuster:METHOD public eas.searcheditor.CriteriaAdjuster getCriteriaAdjuster(String packageName, org.osid.shared.Id repositoryId)
    MERGE MergeAddCriteriaAdjuster:METHOD public void addCriteriaAdjuster(eas.searcheditor.CriteriaAdjuster adjuster, String packageName, org.osid.shared.Id repositoryId)
END

BEGIN
    CLASS CriteriaManager
    EXTENDS mit.swing.xJPanel
    
    DECLARE private eas.Settings settings = eas.Settings.getInstance()
    DECLARE private eas.ui.GUIServices guiServices = eas.ui.GUIServices.getInstance()
    DECLARE private eas.searcheditor.SearchTypeComboBox comboBox = null
    DECLARE private mit.swing.xJPanel editorComponent = null 
    DECLARE private org.osid.shared.Type searchType = null
    DECLARE private java.io.Serializable searchCriteria = null
    DECLARE private eas.SearchManager searchManager = null
    DECLARE private String currentName = ""
    DECLARE private eas.ui.SearchButton searchButton = new eas.ui.SearchButton()
    
    MERGE_FROM CriteriaManager.merge
    MERGE MergeConstructor:METHOD public CriteriaManager(eas.SearchManager searchManager)

    LAYOUT new java.awt.BorderLayout()
    ADD this.comboBox,java.awt.BorderLayout.NORTH
    ADD searchButton,java.awt.BorderLayout.SOUTH
    ADD editorComponent,java.awt.BorderLayout.WEST
    ADD_NOTIFY_LINE setBackground(settings.getDefaultBackground())
    METHOD public org.osid.shared.Type[] getSearchTypes():return comboBox.getSearchTypes()
    METHOD public org.osid.shared.Type getSearchType():return comboBox.getSearchType()
    
    LISTENS_TO eas.event.SearchTypeSelection
    LISTENS_TO eas.event.Search
END

BEGIN
    CLASS SearchManager
    EXTENDS mit.swing.xJPanel
    
    DECLARE private eas.Settings settings = eas.Settings.getInstance()
    DECLARE private eas.ui.GUIServices guiServices = eas.ui.GUIServices.getInstance()
    DECLARE private java.io.Serializable searchCriteria = null
    DECLARE private org.osid.shared.Type searchType = null
    DECLARE private org.osid.shared.Properties searchProperties = null
    DECLARE private java.util.Vector searchVector = new java.util.Vector()
    DECLARE private int completed = 0
    DECLARE private int numToComplete = 0
    DECLARE private int totalAgentsFound = 0
    
    MERGE_FROM SearchManager.merge
    MERGE MergeConstructor:METHOD public SearchManager()
    MERGE MergeSetSearchCriteria:METHOD protected void setSearchCriteria(java.io.Serializable searchCriteria)
    MERGE MergeSetSearchType:METHOD protected void setSearchType(org.osid.shared.Type searchType)
    MERGE MergeBeginSearches:METHOD public void beginSearches()
    MERGE MergeGetAgentsFound:METHOD public int getAgentsFound()
    MERGE MergeGetAgents:METHOD public java.util.Vector getAgents()
    MERGE MergeGetAgentsFoundByIndex:METHOD public int getAgentsFound(int index)
    MERGE MergeGetAgentsByIndex:METHOD public java.util.Vector getAgentsByIndex(int index)
    MERGE MergeCancelSearch:METHOD public void cancelSearch(int index)
    
    LISTENS_TO eas.event.SearchCompleted
    
    ADD_NOTIFY_LINE initUI()    
    MERGE MergeInitUI:METHOD private void initUI()
END

BEGIN
    CLASS SearchThread
    IMPLEMENTS Runnable
    
    DECLARE private eas.Settings settings = eas.Settings.getInstance()
    DECLARE private eas.ui.GUIServices guiServices = eas.ui.GUIServices.getInstance()
    DECLARE private java.io.Serializable searchCriteria = null
    DECLARE private org.osid.shared.Type searchType = null
    DECLARE private String manager = null
    DECLARE private int index = -1
    DECLARE private java.util.Vector agentVector = new java.util.Vector()
    
    MERGE_FROM SearchThread.merge
    MERGE MergeConstructor:METHOD public SearchThread(int index, java.io.Serializable searchCriteria, org.osid.shared.Type searchType)
    
    MERGE MergeGetAgentsFound:METHOD public int getAgentsFound()
    MERGE MergeGetAgents:METHOD public java.util.Vector getAgents()
    MERGE MergeRun:METHOD public void run()
END

BEGIN
    CLASS Preferences
    IMPLEMENTS java.io.Serializable
    
    DECLARE private eas.Settings settings = eas.Settings.getInstance()
    DECLARE private eas.ui.GUIServices guiServices = eas.ui.GUIServices.getInstance()

    GETSET String LocalizationFile
END
