⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clientui.1

📁 一个实现网络会议的软件.包含三个包.其中一个包需JMF的支持.
💻 1
📖 第 1 页 / 共 5 页
字号:
				
	        	}
      	  		else 
			{
            			noButton.setBorder(new javax.swing.border.CompoundBorder());
				noButton.setToolTipText("Say No");
				sayNoMenuItem.setText("Say No");
      			}
			client.sayNo();
			//refresh self's userList
			Hashtable userConfigTable = client.getUsersConfig();
    			handleSayNo(userConfigTable);
    			//refresh self's userList
		}
		else 
		{			
			if (noButton.isSelected()) 
			{
				noButton.setSelected(false);
				noButton.setBorder(new javax.swing.border.CompoundBorder());
			}
			else 
			{
				noButton.setSelected(true);
				noButton.setBorder(new javax.swing.border.CompoundBorder(null, new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.LOWERED))); 
			}
		}
	}
//--------------------------------------------------------------------------------------------
	/**
	 *  RaiseHandAction takes action when user click on RaiseHand button
	 */
	private void RaiseHandAction()
	{
		if(!stepInButton.isSelected())
		{
	    		if (handButton.isSelected()) {
    				handButton.setBorder(new javax.swing.border.CompoundBorder(null, new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.LOWERED))); 
				raiseHandMenuItem.setText("Lower Hand");
				client.raiseHand();
			}
			else {
				handButton.setBorder(new javax.swing.border.CompoundBorder());
				raiseHandMenuItem.setText("Raise Hand");
				client.lowerHand();
			}
			
			//refresh self's userList
			handleRaiseHand(client.getUsersConfig());
  			//refresh self's userList
		}
		else {
			if (handButton.isSelected()) {
				handButton.setSelected(false);
				handButton.setBorder(new javax.swing.border.CompoundBorder());
			}
			else {
				handButton.setSelected(true);
				handButton.setBorder(new javax.swing.border.CompoundBorder(null, new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.LOWERED))); 
			}
		}
	}
//-------------------------------------------------------------------------------------------
	/**
	 *  StepOutAction takes action when user click on stepOut button
	 */
	private void StepOutAction()
	{
		disableEveryComponent(stepInButton.isSelected());//true stepout
		if (stepInButton.isSelected()) {
			stepInButton.setBorder(new javax.swing.border.CompoundBorder(null, new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.LOWERED))); 
			stepOutMenuItem.setText("Step In");
		}
		else {
			stepInButton.setBorder(new javax.swing.border.CompoundBorder());
			stepOutMenuItem.setText("Step Out");
    		} 
    		client.stepInOut();
    		//refresh self's userList
		Hashtable userConfigTable = client.getUsersConfig();
  		handleStepInOut(userConfigTable);
  		//refresh self's userList
	}
//------------------------------------------------------------------------------------------
	/**
	 *  logoutAction takes action when user click on logOut button
	 */
	private void LogoutAction()
	{
		client.logoutUser(myName);

		String speaker = client.getMicLocker();
		setSpeaker(speaker);

		System.exit(0);
	}
//-----------------------------------------------------------------------------------------------
	/**
	 *  ExitAction takes action when user click on Exit button
	 */
	private void ExitAction()
	{
		client.logoutUser(myName);
		System.exit(0);
	}
//-----------------------------------------------------------------------------------------------
	/**
	 *  TextChatAction takes action when user click on TextChat button
	 */
	private void TextChatAction()
	{
		showTextChat();
	}
//------------------------------------------------------------------------------------------------
	/**
	 *  SendFeedbackAction takes action when user click on RaiseHand button
	 */
	private void SendFeedbackAction()
	{
		if(!stepInButton.isSelected())
		{
				
  			feedbackButtonActionPerformed();
		}
	}
//------------------------------------------------------------------------------------------------
	/**
	 *  ReceiveFeedbackAction takes action when user click on receiveFeedback button
	 */
	private void ReceiveFeedbackAction() 
	{
		if(!stepInButton.isSelected())
		{
			feedbackButtonActionPerformed();
		}
	}
//------------------------------------------------------------------------------------------------
	/**
	 *  LowerAllHandAction takes action when user click on lowerall button
	 */
	private void LowerAllHandAction()
	{
		if(!stepInButton.isSelected() && isInSession())
		{//not step out
    			client.lowerAllHands();
			//refresh self's userList
  			handleLowerAllHands(client.getUsersConfig());
  			//refresh end of self's userList
    		}
	}
//---------------------------------------------------------------------------------------------
	/**
	 *  ClearYesNoAction takes action when user click on RaiseHand button
	 */
	private void ClearYesNoAction()
	{
		if(!stepInButton.isSelected()&& isInSession())
		{
			client.clearYesNo();
		}
	}
//-------------------------------------------------------------------------------------
	/**
	 *  SessionInAction takes action when user click on SessionIn button
	 */
	private void SessionInAction()
	{
		if(!stepInButton.isSelected())
		{//step in
			if(sessionInButton.isSelected())
			{//start Session
					lowerAllHandMenuItem.setEnabled(true);
    				clearYesNoMenuItem.setEnabled(true);
    				giveMicToNextMenuItem.setEnabled(true);
    				sessionInMenuItem.setText("End Session");
    				mytoolBar.setPresenterButtons(true);
    				client.startSession();
			}
			else
			{//stop Session
				lowerAllHandMenuItem.setEnabled(false);
    			clearYesNoMenuItem.setEnabled(false);
    			giveMicToNextMenuItem.setEnabled(false);
    				
				sessionInMenuItem.setText("Begin Session");
				mytoolBar.setPresenterButtons(false);
				client.stopSession();
			}
		}
		else {
		//step out
			if (sessionInButton.isSelected()) {
				sessionInButton.setSelected(false);
				sessionInButton.setBorder(new javax.swing.border.CompoundBorder());
			}
			else {
				sessionInButton.setSelected(true);
				sessionInButton.setBorder(new javax.swing.border.CompoundBorder(null, new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.LOWERED))); 
			}
		}
	}
//----------------------------------------------------------------------------------------------
	/**
	 *  GiveMicToNextAction takes action when user click on giveMicToNext button
	 */
	private void GiveMicToNextAction()
	{
		if(!stepInButton.isSelected()&& isInSession()) {
			client.giveMicToNext();
		}
	}
//------------------------------------------------------------------------------------------
	/**
	 *  AboutAction takes action when user click on "about" button
	 */
	private void AboutAction()
	{
		JOptionPane.showMessageDialog(this, 
						    "This project is developed by:\n" +
						    "            NaiZheng Bian\n" +
						    "            December,2001.\n",
						    "About Symposium", JOptionPane.INFORMATION_MESSAGE);
	}
//------------------------------------------------------------------------------------------
	/**
	 *  HowToUseAction takes action when user click on "How To Use" button
	 */
	private void HowToUseAction()
	{
		JOptionPane.showMessageDialog(this, 
						    "How to use this application:\n" +
						    "After logon, you can:\n" + 
						    "       Listen to the presenter using a headphone;\n" +
						    "       Directly click the talk button to speak through a microphone when out of session;\n" +
						    "       When in session, click the hand button to ask for mic. After get mic, click the talk button to speak;\n" +
						    "       Use the chat panel to send or receive public and private text messages;\n" +
						    "       Indicate YES or NO by pressing the " + "\\" + "/ or X  button;\n" + 
						    "       Step in or out;\n" + 
						    "       Send feedback of network status to the presenter;\n",        
						    "Enjoy Symposium", JOptionPane.INFORMATION_MESSAGE);
	}




//-------------------------------------------------------showTextChat-----------------------
//*****************************TEXT CHAT DISPLAY*****************************************
/** 
 *	showTextChat shows text chat window
 */
    private void showTextChat() 
	{

   		chatFrame.setVisible(true);

    }
//---------------------------------------------------------SAVEChat-----------------------
/** saveChat saves a text chat messages
  */
	public void saveChat()
	{
		String strFile = getLocalFile("Enter the fileName to store chat in", FileDialog.SAVE);
		if (strFile != null)
		{
			chatDisplay.saveChat(strFile);
		}

	}
//-----------------------------------------------------getLocalFile----------------------------------
	/**
	 * getLocalFile gets the local file to the server
	 * 
	 * @param myMessage The message in the dialog box
	 * @param myOption The option to load or save
	 * 
	 * @return The filename to be loaded or saved
	 */

	private String getLocalFile(String myMessage, int myOption)
	{
		FileDialog newFile = null;
		if (myMessage == "" || myMessage == null )
		{
			newFile = new FileDialog(this);
		}
		else
		{
			newFile = new FileDialog(this, myMessage);
		}
		if (myOption == FileDialog.LOAD || myOption == FileDialog.SAVE)
		{
			newFile.setMode(myOption);
		}
		newFile.show();
		String ReturnString = null;
		try
		{
		    String fileURL = newFile.getDirectory();
		    if (fileURL == null) return null;
		    fileURL += newFile.getFile();
			if(fileURL != null && fileURL != "")
			{
				ReturnString = fileURL;
			}
			else
			{
				showMessage("Invalid File Selection");
				return null;
			}
		}
		catch (Exception e)
		{
			showMessage(e.getMessage());
			return null;
		}

		return ReturnString;
	}
//***************************TEXT CHAT DISPLAY*******************************************
//--------------------------------------------------propertyChange----------------------------
    /**
      * propertyChange fire property changes to clientUI 
      *
      * @param e property change event
      */
	public void propertyChange (PropertyChangeEvent e) 
	{
		String pName = e.getPropertyName();
		if (pName.equals("broadcastMessage")) 
		{
        		handleBroadcastMessage((Vector) e.getNewValue());
       		} 
		else if (pName.equals("clearYesNo")) {
        		handleClearYesNo(client.getUsersConfig());
        	} 
		else if (pName.equals("startSession")) {
        		handleStartSession();
        	} 
		else if (pName.equals("sayNo")) {
        		handleSayNo(client.getUsersConfig());
        	} 
		else if (pName.equals("addUser")) 
		{
			handleAddUser((UserConfig) e.getNewValue());
		} 
		else if (pName.equals("removeUser")) {
        		handleRemoveUser((String) e.getOldValue());
       		} 
		else if (pName.equals("sayYes")) {
        		handleSayYes(client.getUsersConfig());
        	} 
		else if (pName.equals("lowerHand")) {
        		handleLowerHand(client.getUsersConfig());
        	}
        	else if (pName.equals("lowerAllHands")) {
        		handleLowerAllHands(client.getUsersConfig());
        	}
		else if (pName.equals("stepInOut")) {
        		handleStepInOut(client.getUsersConfig());
        	} 
		else if (pName.equals("raiseHand")) {
        		handleRaiseHand(client.getUsersConfig());
        	} 
		else if (pName.equals("stopSession")) {
        		handleStopSession();
        	} 
		else if (pName.equals("receiveLockMic")) {
			handleReceiveLockMic(client.getUsersConfig());
        	}
       	 	else if (pName.equals("receiveUnLockMic")) {
			handleReceiveUnLockMic(client.getUsersConfig());
        	}
		else if (pName.equals("getFeedback")) {
        		if (((Integer) e.getOldValue()).intValue() != -1) {
        			client.sendFeedback(((Integer) e.getOldValue()).intValue(), ((Integer)e.getNewValue()).intValue());
        		}
        		feedbackFrame.setVisible(false);
      		}
		else if (pName.equals("selectionChanged")) {
			String newURL = (String) e.getNewValue();
			contentDisplay.showFile(newURL);
			if (myCategory == Constants.PRESENTER)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -