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

📄 networkadaptertablemodel.java

📁 270的linux说明
💻 JAVA
字号:
/*

Copyright (c) 2008, Intel Corporation. 

All rights reserved.

 

Redistribution and use in source and binary forms, with or without modification, 
are permitted provided that the following conditions are met:


    * Redistributions of source code must retain the above copyright notice, 
this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright notice, 
this list of conditions and the following disclaimer in the documentation and/or 
other materials provided with the distribution.

    * Neither the name of Intel Corporation nor the names of its contributors 
may be used to endorse or promote products derived from this software without 
specific prior written permission.

 

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
OF SUCH DAMAGE.

*/import javax.swing.table.AbstractTableModel;import com.intel.mobile.base.IntelMobileException;import com.intel.mobile.network.NetworkAdapterInstance;import com.intel.mobile.network.RadioAdapterClass;import com.intel.mobile.network.RadioAdapterInstance;import com.intel.mobile.network.*;/* * Created on 2004-6-16 * * To change the template for this generated file go to * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments *//** * @ * * To change the template for this generated type comment go to * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments */public class NetworkAdapterTableModel extends AbstractTableModel {	//private NetworkAdapterInstance myInstance = null;    	private final String[] names = { "Attribute", "Value", "Description" };	protected Object[][] data = null;	protected int index;    	/**	 * Constructor	 * @param myInstance	 */	public NetworkAdapterTableModel()	{		super();	}		public NetworkAdapterTableModel(NetworkAdapterInstance myInstance) throws IntelMobileException	{		super();		init(myInstance);	}    	// These methods always need to be implemented.    	public int getColumnCount()	{		return names.length;	}    	public int getRowCount()	{		return data.length;	}    	public Object getValueAt(int row, int col)	{		return data[row][col];	}	// The default implementations of these methods in	// AbstractTableModel would work, but we can refine them.    	public String getColumnName(int column)	{		return names[column];	}    	public Class getColumnClass(int col)	{		return String.class;		//return getValueAt(0, col).getClass();	}    	public boolean isCellEditable(int row, int col)	{		return false;	}    	public void setValueAt(Object aValue, int row, int column)	{		data[row][column] = aValue;	}	// ------------- initialize --------------    	public void init(NetworkAdapterInstance myInstance) throws IntelMobileException	{		data = new Object[22][3];        		int i = 0;        		data[i][0] = "Manufacturer";		if ( !myInstance.Manufacturer.IsNull() )		{			data[i][1] = myInstance.Manufacturer.GetValue();		}		data[i++][2] = "";				data[i][0] = "Index";		if ( !myInstance.Index.IsNull() )		{			data[i][1] = String.valueOf(myInstance.Index.GetValue());		}		data[i++][2] = "";		if(!myInstance.AutoSense.IsNull())		{		data[i][0] = "AutoSense";		if ( !myInstance.AutoSense.IsNull() )		{			data[i][1] = String.valueOf(myInstance.AutoSense.GetValue());		}		data[i++][2] = "";		}		data[i][0] = "Name";		if ( !myInstance.Name.IsNull() )		{			data[i][1] = String.valueOf(myInstance.Name.GetValue());		}		data[i++][2] = "";			data[i][0] = "Description";		if ( !myInstance.Description.IsNull() )		{			data[i][1] = String.valueOf(myInstance.Description.GetValue());		}		data[i++][2] = "";			data[i][0] = "DeviceId";		if ( !myInstance.DeviceId.IsNull() )		{			data[i][1] = String.valueOf(myInstance.DeviceId.GetValue());		}		data[i++][2] = "";		data[i][0] = "ConnectionId";		if ( !myInstance.ConnectionId.IsNull() )		{			data[i][1] = String.valueOf(myInstance.ConnectionId.GetValue());		}		data[i++][2] = "";		data[i][0] = "PnpDeviceId";		if ( !myInstance.PnpDeviceId.IsNull() )		{			data[i][1] = String.valueOf(myInstance.PnpDeviceId.GetValue());		}		data[i++][2] = "";				data[i][0] = "AdapterLink";		if ( !myInstance.AdapterLink.IsNull() )		{ 			data[i][1] = String.valueOf(myInstance.AdapterLink.GetValue());		}		data[i++][2] = "";		data[i][0] = "ConnectionState";		if ( !myInstance.ConnectionState.IsNull() )		{			data[i][1] = myInstance.ConnectionState.GetValue().toString();		}		data[i++][2] = "";		data[i][0] = "Enabled";		if ( !myInstance.Enabled.IsNull() )		{			data[i][1] = String.valueOf(myInstance.Enabled.GetValue());		}		data[i++][2] = "";		data[i][0] = "NdiUpper";		if ( !myInstance.NdiUpper.IsNull() )		{			data[i][1] = String.valueOf(myInstance.NdiUpper.GetValue());		}		data[i++][2] = "";		data[i][0] = "NdiLower";		if ( !myInstance.NdiLower.IsNull() )		{		 	data[i][1] = String.valueOf(myInstance.NdiLower.GetValue());		}		data[i++][2] = "";		if (!myInstance.Protocols.IsNull())		{			for (int j = 0; j < myInstance.Protocols.GetSize(); j++)			{				data[i][0] = "Protocols";			 	data[i][1] = myInstance.Protocols.GetValue(j);				data[i++][2] = "";			}		}		index = i;					}}

⌨️ 快捷键说明

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