gt: 			else if (src == m_rbIEX)
context: package bpdtool.gui;
  
  
  import bpdtool.Util;
  import bpdtool.data.Packet;
  import bpdtool.data.PacketStage;
  import bpdtool.data.Protocol;
  
  import javax.swing.*;
  import javax.swing.event.ChangeEvent;
  import javax.swing.event.TableModelEvent;
  import javax.swing.event.TableModelListener;
  import javax.swing.table.TableCellEditor;
  import javax.swing.table.TableCellRenderer;
  import javax.swing.table.TableModel;
  import java.awt.*;
  import java.awt.event.*;
  
  
  class CheckBoxRenderer extends JCheckBox
  	implements TableCellRenderer
  {
  	@Override
  	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
  	{
  		setEnabled(table.isEnabled());
  		setSelected(((JCheckBox)value).isSelected());
  		//setFont(table.getFont());
  		setBackground(table.getBackground());
  		setForeground(table.getForeground());
  		setText(((JCheckBox)value).getText());
  		return this;
  	}
  }
  
  class CheckBoxCellEditor extends AbstractCellEditor implements TableCellEditor
  {
  	@Override
  	public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
  	{
  		return (JCheckBox) value;
  	}
  
  	@Override
  	public Object getCellEditorValue()
  	{
  		return null;
  	}
  }
  
  public class PacketDlg extends JDialog
  	implements TableModel, TableModelListener
  {
  	private JPanel contentPane;
  	private JTextArea m_taDescript;
  	private JTextField m_tfComment;
  	private JTextField m_tfName;
  	private JRadioButton m_rbC2S;
  	private JRadioButton m_rbIEX;
  	private JRadioButton m_rbS2C;
  	private JCheckBox m_chkDirectCast;
  	private JCheckBox m_chkGenBuilder;
  	private JRadioButton m_rbStageAll;
  	private JRadioButton m_rbStageSpecific;
  	private JTable m_tblStages;
  	private JButton m_btnOK;
  	private JButton m_btnEditStages;
  	private JButton m_btnCancel;
  
  	private Packet m_data;
  	private boolean m_dialogResult;
  	private boolean m_isDescriptionChanged;
  	private int m_nStagesCount = 0;
  	private PacketStage[] m_stages;
  	private JCheckBox[] m_chkStages;
  
  	public PacketDlg(Packet pkt)
  	{
  		super(MainFrame.getInstance(), "Packet Property");
  		m_data = pkt;
  
  		setContentPane(contentPane);
  		setLocationRelativeTo(MainFrame.getInstance());
  		setModal(true);
  
  		m_tblStages.setModel(this);
  		m_tblStages.setTableHeader(null);
  		m_tblStages.setDefaultRenderer(JCheckBox.class, new CheckBoxRenderer());
  		m_tblStages.getColumnModel().getColumn(0).setCellEditor(new CheckBoxCellEditor());
  
  		ActionListener lsnrRbDir = new ActionListener()
  		{
  			@Override
  			public void actionPerformed(ActionEvent evt)
  			{
  				onPacketFlowChanged(evt.getSource());
  			}
  		};
  
  		m_rbC2S.addActionListener(lsnrRbDir);
  		m_rbS2C.addActionListener(lsnrRbDir);
  		m_rbIEX.addActionListener(lsnrRbDir);
  
  		ActionListener lsnrRbStage = new ActionListener()
  		{
  			@Override
  			public void actionPerformed(ActionEvent evt)
  			{
  				onStageChanged(evt.getSource());
  			}
  		};
  
  		m_rbStageAll.addActionListener(lsnrRbStage);
  		m_rbStageSpecific.addActionListener(lsnrRbStage);
  
  		m_btnOK.addActionListener(new ActionListener()
  		{
  			@Override
  			public void actionPerformed(ActionEvent actionEvent)
  			{
  				onOK();
  			}
  		});
  
  		getRootPane().setDefaultButton(m_btnOK);
  
  		m_btnEditStages.addActionListener(new ActionListener()
  		{
  			@Override
  			public void actionPerformed(ActionEvent actionEvent)
  			{
  				onEditStages();
  			}
  		});
  
  		m_btnCancel.addActionListener(new ActionListener()
  		{
  			@Override
  			public void actionPerformed(ActionEvent actionEvent)
  			{
  				dispose();
  			}
  		});
  
  		setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
  		addWindowListener(new WindowAdapter()
  		{
  			public void windowClosing(WindowEvent e)
  			{
  				dispose();
  			}
  		});
  
  		contentPane.registerKeyboardAction(new ActionListener()
  		{
  			public void actionPerformed(ActionEvent e)
  			{
  				dispose();
  			}
  		}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
  
  		m_tfName.addFocusListener(new FocusAdapter()
  		{
  			@Override
  			public void focusGained(FocusEvent focusEvent)
  			{
  				super.focusGained(focusEvent);
  				m_tfName.selectAll();
  			}
  		});
  
  
  		// init dialog values
  		JRadioButton rb;
  		if(pkt.isAllStage())
  			rb = m_rbStageAll;
  		else
  			rb = m_rbStageSpecific;
  
  		rb.setSelected(true);
  		onStageChanged(rb);
  
  		switch (m_data.getFlow())
  		{
  		case Packet.FLOW_C2S:
  			rb = m_rbC2S;
  			break;
  		case Packet.FLOW_S2C:
  			rb = m_rbS2C;
  			break;
  		case Packet.FLOW_INTER:
  			rb = m_rbIEX;
  			break;
  		}
  
  		rb.setSelected(true);
  		onPacketFlowChanged(rb);
  
  		m_chkDirectCast.setSelected(m_data.isDirectCasting());
  		m_chkGenBuilder.setSelected(m_data.isGenerateBuilder());
  		//m_ckFiberCall.setSelected(pkt.EnableFiber);
  
  		m_tfName.setText(m_data.getName());
  		m_tfComment.setText(m_data.getComment());
  		m_taDescript.setText(m_data.getDescription());
  
  		resetStageList();
  	}
  
  	private void resetStageList()
  	{
  		Protocol doc = MainFrame.getInstance().getDocument();
  
  		m_nStagesCount = doc.getPacketStages().size();
  		m_stages = new PacketStage[m_nStagesCount];
  		m_chkStages = new JCheckBox[m_nStagesCount];
  		for(int i=0; i<m_nStagesCount; i++)
  		{
  			m_stages[i] = doc.getPacketStages().get(i);
  			m_chkStages[i] = new JCheckBox(m_stages[i].getAbbr(), m_data.getStages().indexOf(m_stages[i]) >= 0);
  		}
  	}
  
  	private void onPacketFlowChanged(Object src)
  	{
  		boolean bEnablePDS;
  
  		if (src == m_rbS2C)
  		{
  			m_tfName.setForeground(PacketView.NameColorS2C);
  			bEnablePDS = false;
  		}
  		else
  		{
  			if (src == m_rbC2S)
  			{
  				m_tfName.setForeground(PacketView.NameColorC2S);
  			}
  