/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cz.karry.dop.nbmodule.dbg.ui;

import cz.karry.dop.core.Bus;
import cz.karry.dop.core.Core;
import cz.karry.dop.core.MInstructionComplete;
import cz.karry.dop.core.MemoryInterface;
import cz.karry.dop.core.Signal;
import cz.karry.dop.core.SignalListener;
import cz.karry.dop.core.alu.Alu;
import cz.karry.dop.core.alu.Flags;
import cz.karry.dop.core.registers.Register;
import cz.karry.dop.nbmodule.Utils;
import java.awt.Color;
import java.awt.event.KeyEvent;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager;
//import org.openide.util.Utilities;

/**
 * Top component which displays something.
 */
public final class DopDbgTopComponent extends TopComponent 
        implements cz.karry.dop.core.registers.RegisterListener,
                SignalListener,
                cz.karry.dop.core.BusListener,
                MInstructionComplete{

    private static DopDbgTopComponent instance;
    /** path to the icon used by the component and its open action */
//    static final String ICON_PATH = "SET/PATH/TO/ICON/HERE";

    static final Color changeColor      = new Color(0xff,0,0);
    static final Color userChangeColor2 = new Color(0x60,0,0);
    static final Color normalColor      = new Color(0,0,0);
    static final Color userChangeColor  = new Color(0,0x80,0);

    private static final String PREFERRED_ID = "DopDbgTopComponent";
    private Core dopCore;
    private ArrayList<JComponent> changetComponent     = new ArrayList<JComponent>();
    private ArrayList<JComponent> lastChangetComponent = new ArrayList<JComponent>();
    private int lastBusValue = -1;
    private int lastACMValue = -1;
    private int lastMAValue = -1;
    private int lastSCValue = -1;
    private int lastANMValue = -1;
    private int lastDBValue = -1;
    private int lastABValue = -1;
    private int lastRBusValue = -1;
    private int lastSBusValue = -1;
    private int lastSumBusValue = -1;
    private boolean lastOverfState;
    

    private DopDbgTopComponent() {
        initComponents();
        setName(NbBundle.getMessage(DopDbgTopComponent.class, "CTL_DopDbgTopComponent"));
        setToolTipText(NbBundle.getMessage(DopDbgTopComponent.class, "HINT_DopDbgTopComponent"));
//        setIcon(Utilities.loadImage(ICON_PATH, true));
    }

    
    public void registerListeners(Core dopCore) {
        this.dopCore = dopCore;

        // registers
        dopCore.getMemoryInterface().getDIL().addChangeListener(this);
        dopCore.getMemoryInterface().getDIH().addChangeListener(this);
        dopCore.getMemoryInterface().getDOL().addChangeListener(this);
        dopCore.getMemoryInterface().getDOH().addChangeListener(this);

        try {
            ArrayList<Register> registers = dopCore.getRegisters();
            for (int i=0; i < registers.size(); i++){
                //dopCore.getRegister(registers.get(i).getName()).addChangeListener(this);
                registers.get(i).addChangeListener(this);
                registerChangePerformed(registers.get(i), registers.get(i).getValue());
            }
        } catch (Exception ex) {
            Logger.getLogger(DopDbgTopComponent.class.getName()).log(Level.SEVERE, null, ex);            
        }
        
        dopCore.getAlu().getWRegister().addChangeListener(this);
        
        // signals
        try {
            Signal clk = dopCore.getSignal(Core.CLK);
            clk.addSignalListener(this);
            
            dopCore.getSignal(Alu.CIN).addSignalListener(this);
            //dopCore.getSignal(Alu.OVERF).addSignalListener(this);
            dopCore.getSignal(Alu.ENW).addSignalListener(this);
            dopCore.getSignal(Alu.CZM).addSignalListener(this);
            
            // flags
            dopCore.getSignal(Flags.A_FLAG).addSignalListener(this);
            dopCore.getSignal(Flags.Z_FLAG).addSignalListener(this);
            dopCore.getSignal(Flags.S_FLAG).addSignalListener(this);
            dopCore.getSignal(Flags.I_FLAG).addSignalListener(this);
            dopCore.getSignal(Flags.OV_FLAG).addSignalListener(this);
            dopCore.getSignal(Flags.C_FLAG).addSignalListener(this);
        } catch (Exception ex) {
            Exceptions.printStackTrace(ex);
        }
        
        // bus
        dopCore.bus.addBusListener(this);
        dopCore.ab_bus.addBusListener(this);
        dopCore.db_bus.addBusListener(this);
        
        dopCore.getAlu().getRBus().addBusListener(this);
        dopCore.getAlu().getSBus().addBusListener(this);
        dopCore.getAlu().getSumBus().addBusListener(this);

        dopCore.addMInstructionCompleteListener(this);
        
        
    }

    
    public void registerChangePerformed(Register register, int value) {
       if (register.getName().equals( Core.IR_REG )){ irRegTextField.setText(Utils.intToHex(value, 2)); changetComponent.add(irRegTextField); }
       if (register.getName().equals( Core.L_REG )) { lRegTextField.setText( Utils.intToHex(value, 2)); changetComponent.add(lRegTextField); }

       if (register.getName().equals( Core.SP_REG )){ spRegTextField.setText(Utils.intToHex(value, 4)); changetComponent.add(spRegTextField); }
       if (register.getName().equals( Core.S_REG )) { sRegTextField.setText( Utils.intToHex(value, 4)); changetComponent.add(sRegTextField); }
       if (register.getName().equals( Core.D_REG )) { dRegTextField.setText( Utils.intToHex(value, 4)); changetComponent.add(dRegTextField); }
       if (register.getName().equals( Core.PC_REG )){ pcRegTextField.setText(Utils.intToHex(value, 4)); changetComponent.add(pcRegTextField); }
       if (register.getName().equals( Core.T_REG )) { tRegTextField.setText( Utils.intToHex(value, 4)); changetComponent.add(tRegTextField); }
       if (register.getName().equals( Core.U_REG )) { uRegTextField.setText( Utils.intToHex(value, 4)); changetComponent.add(uRegTextField); }
       
       if (register.getName().equals( MemoryInterface.DIL )) { dilRegTextField.setText( Utils.intToHex(value, 2)); changetComponent.add(dilRegTextField); }
       if (register.getName().equals( MemoryInterface.DIH )) { dihRegTextField.setText( Utils.intToHex(value, 2)); changetComponent.add(dihRegTextField); }

       if (register.getName().equals( MemoryInterface.DOL ) || register.getName().equals( MemoryInterface.DOH )) {
           doRegTextField.setText( Utils.intToHex( (dopCore.getMemoryInterface().getDOH().getValue() << 8) | dopCore.getMemoryInterface().getDOL().getValue() , 4)); 
           changetComponent.add(doRegTextField); 
       }
       
       if (register.getName().equals( Alu.W_REG )) { wRegTextField.setText( Utils.intToHex(value, 4)); changetComponent.add(wRegTextField); }
    }
    

    public void signalChangePerformed(Signal signal, boolean active) {
        if (signal.getName().equals( Core.CLK )){
            if (!active){

            }else{

            }
        }
        
        if (signal.getName().equals(Flags.A_FLAG)){
            changetComponent.add(afLabel);
            if (active) afLabel.setText("1");
            else afLabel.setText("0");
        }
        if (signal.getName().equals(Flags.Z_FLAG)){
            changetComponent.add(zfLabel);
            if (active) zfLabel.setText("1");
            else zfLabel.setText("0");
        }
        if (signal.getName().equals(Flags.S_FLAG)){
            changetComponent.add(sfLabel);
            if (active) sfLabel.setText("1");
            else sfLabel.setText("0");
        }
        if (signal.getName().equals(Flags.I_FLAG)){
            changetComponent.add(ifLabel);
            if (active) ifLabel.setText("1");
            else ifLabel.setText("0");
        }
        if (signal.getName().equals(Flags.OV_FLAG)){
            changetComponent.add(ovfLabel);
            if (active) ovfLabel.setText("1");
            else ovfLabel.setText("0");
        }
        if (signal.getName().equals(Flags.C_FLAG)){
            changetComponent.add(cfLabel);
            if (active) cfLabel.setText("1");
            else cfLabel.setText("0");
        }
        
        if (signal.getName().equals(Alu.CIN)){
            changetComponent.add(cinSignalLabel);
            if (active) cinSignalLabel.setText("1");
            else cinSignalLabel.setText("0");
        }
        if (signal.getName().equals(Alu.ENW)){
            changetComponent.add(enwSignalLabel);
            if (active) enwSignalLabel.setText("1");
            else enwSignalLabel.setText("0");
        }
        if (signal.getName().equals(Alu.CZM)){
            changetComponent.add(czmSignalLabel);
            if (active) czmSignalLabel.setText("1");
            else czmSignalLabel.setText("0");
        }
        
        
    }

    public void mInstructionComplete() {
        acmTextField.setText( Utils.intToHex( dopCore.getController().getACM(),3 ) );  
        maTextField.setText(  Utils.intToHex( dopCore.getController().getMA() ,3 ) ); changetComponent.add(maTextField); 
        scTextField.setText(  Utils.intToHex( dopCore.getController().getSC() ,2 ) ); changetComponent.add(scTextField); 
        anmTextField.setText( Utils.intToHex( dopCore.getController().getANM(),3 ) ); changetComponent.add(anmTextField); 

        fileLineTextField.setText( String.valueOf( dopCore.getController().getActualInstruction().getSrcLine() )); changetComponent.add(fileLineTextField); 
        //fileLineTextField.setText( String.valueOf( dopCore.getController().getNextInstruction().getSrcLine() ));
        
        if (lastBusValue != dopCore.bus.getValue()){ 
            changetComponent.add(busLabel); 
            lastBusValue = dopCore.bus.getValue();
        }
        if (lastABValue != dopCore.ab_bus.getValue()){ 
            changetComponent.add(abLabel); 
            lastABValue = dopCore.ab_bus.getValue();
        }
        if (lastDBValue != dopCore.db_bus.getValue()){ 
            changetComponent.add(dbLabel); 
            lastDBValue = dopCore.db_bus.getValue();
        }
        if (lastACMValue != dopCore.getController().getACM()){
            changetComponent.add(acmTextField);
            lastACMValue = dopCore.getController().getACM();
        }
        if (lastMAValue != dopCore.getController().getMA()){
            changetComponent.add(maTextField);
            lastMAValue = dopCore.getController().getMA();
        }
        if (lastSCValue != dopCore.getController().getSC()){
            changetComponent.add(scTextField);
            lastSCValue = dopCore.getController().getSC();
        }
        if (lastANMValue != dopCore.getController().getANM()){
            changetComponent.add(anmTextField);
            lastANMValue = dopCore.getController().getANM();
        }

        
        if (lastRBusValue != dopCore.getAlu().getRBus().getValue() ){
            changetComponent.add(rBusTextField);
            lastRBusValue = dopCore.getAlu().getRBus().getValue();
        }
        if (lastSBusValue != dopCore.getAlu().getSBus().getValue() ){
            changetComponent.add(sBusTextField);
            lastSBusValue = dopCore.getAlu().getSBus().getValue();
        }
        if (lastSumBusValue != dopCore.getAlu().getSumBus().getValue() ){
            changetComponent.add(sumBusTextField);
            lastSumBusValue = dopCore.getAlu().getSumBus().getValue();
        }
        if (lastOverfState != dopCore.getAlu().getOverf().isActive()  ){
            changetComponent.add(overfSignalLabel);
            lastOverfState = dopCore.getAlu().getOverf().isActive();
            if (lastOverfState) overfSignalLabel.setText("1");
            else overfSignalLabel.setText("0");
        }
        
        
        
        for (int i=0; i< lastChangetComponent.size(); i++){
            lastChangetComponent.get(i).setForeground(normalColor);
        }
        for (int i=0; i< changetComponent.size(); i++){
            changetComponent.get(i).setForeground(changeColor);
        }
        lastChangetComponent = (ArrayList<JComponent>) changetComponent.clone();
        changetComponent.clear();
    }    
    
    public void busChangePerformed(Bus bus, int value) {
        if (bus.getName().equals(Core.BUS) )   { busLabel.setText( "0x"+Utils.intToHex(bus.getValue(),4) );  }
        if (bus.getName().equals(Core.AB_BUS) ){ abLabel.setText(  "0x"+Utils.intToHex(bus.getValue(), 4) ); }
        if (bus.getName().equals(Core.DB_BUS) ){ dbLabel.setText(  "0x"+Utils.intToHex(bus.getValue(), 2) ); }
        
        if (bus.getName().equals(Alu.R_BUS) )  { rBusTextField.setText(   Utils.intToHex(bus.getValue(), 4) ); }
        if (bus.getName().equals(Alu.S_BUS) )  { sBusTextField.setText(   Utils.intToHex(bus.getValue(), 4) ); }
        if (bus.getName().equals(Alu.SUM_BUS) ){ sumBusTextField.setText( Utils.intToHex(bus.getValue(), 4) ); }
        
    }    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel5 = new javax.swing.JPanel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        ovfLabel = new javax.swing.JLabel();
        zfLabel = new javax.swing.JLabel();
        sfLabel = new javax.swing.JLabel();
        cfLabel = new javax.swing.JLabel();
        ifLabel = new javax.swing.JLabel();
        afLabel = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        pcRegTextField = new javax.swing.JTextField();
        spRegTextField = new javax.swing.JTextField();
        sRegTextField = new javax.swing.JTextField();
        dRegTextField = new javax.swing.JTextField();
        uRegTextField = new javax.swing.JTextField();
        tRegTextField = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        lRegTextField = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        doRegTextField = new javax.swing.JTextField();
        dilRegTextField = new javax.swing.JTextField();
        dihRegTextField = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        busLabel = new javax.swing.JLabel();
        dbLabel = new javax.swing.JLabel();
        abLabel = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        irRegTextField = new javax.swing.JTextField();
        acmTextField = new javax.swing.JTextField();
        maTextField = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        scTextField = new javax.swing.JTextField();
        fileLineTextField = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        anmTextField = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        wRegTextField = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        sBusTextField = new javax.swing.JTextField();
        rBusTextField = new javax.swing.JTextField();
        sumBusTextField = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        overfSignalLabel = new javax.swing.JLabel();
        enwSignalLabel = new javax.swing.JLabel();
        czmSignalLabel = new javax.swing.JLabel();
        cinSignalLabel = new javax.swing.JLabel();

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jPanel5.border.title"))); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel29, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel29.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel30, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel30.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel31, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel31.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel32, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel32.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel33, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel33.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel34, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel34.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(ovfLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.ovfLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(zfLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.zfLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(sfLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.sfLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(cfLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.cfLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(ifLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.ifLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(afLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.afLabel.text")); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel31)
                    .addComponent(jLabel30)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel34)
                            .addComponent(jLabel29)
                            .addComponent(jLabel32)
                            .addComponent(jLabel33))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(cfLabel)
                            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(afLabel)
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ifLabel)
                                    .addComponent(ovfLabel)
                                    .addComponent(sfLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(zfLabel))))))
                .addContainerGap(40, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel29)
                    .addComponent(afLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(zfLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel31)
                    .addComponent(sfLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel32)
                    .addComponent(ifLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel34)
                    .addComponent(ovfLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel33)
                    .addComponent(cfLabel))
                .addContainerGap(26, Short.MAX_VALUE))
        );

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jPanel1.border.title"))); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel1.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel2.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel3.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel4.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel6.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel7, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel7.text")); // NOI18N

        pcRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.pcRegTextField.text")); // NOI18N
        pcRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        pcRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        pcRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        spRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.spRegTextField.text")); // NOI18N
        spRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        spRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        spRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        sRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.sRegTextField.text")); // NOI18N
        sRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        sRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        sRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        dRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.dRegTextField.text")); // NOI18N
        dRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        dRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        dRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        uRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.uRegTextField.text")); // NOI18N
        uRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        uRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        uRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        tRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.tRegTextField.text")); // NOI18N
        tRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        tRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        tRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(jLabel8, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel8.text")); // NOI18N

        lRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.lRegTextField.text")); // NOI18N
        lRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        lRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        lRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(jLabel11, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel11.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel12, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel12.text")); // NOI18N

        doRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.doRegTextField.text")); // NOI18N
        doRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        doRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        doRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        dilRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.dilRegTextField.text")); // NOI18N
        dilRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        dilRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        dilRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        dihRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.dihRegTextField.text")); // NOI18N
        dihRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        dihRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        dihRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(jLabel22, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel22.text")); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(jLabel6)
                    .addComponent(jLabel7))
                .addGap(24, 24, 24)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(sRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(spRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(pcRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel8)
                        .addGap(12, 12, 12)
                        .addComponent(lRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(dRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel22))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(uRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel11))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(tRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel12)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(dihRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(dilRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(doRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(pcRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8)
                    .addComponent(lRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(spRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(sRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(dRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22)
                    .addComponent(doRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(uRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11)
                    .addComponent(dilRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(tRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel12)
                        .addComponent(dihRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel7))
                .addContainerGap(89, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jPanel2.border.title"))); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel18, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel18.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel19, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel19.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel20, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel20.text")); // NOI18N

        busLabel.setForeground(new java.awt.Color(0, 0, 0));
        org.openide.awt.Mnemonics.setLocalizedText(busLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.busLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(dbLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.dbLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(abLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.abLabel.text")); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(busLabel))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel19)
                        .addGap(18, 18, 18)
                        .addComponent(dbLabel))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel20)
                        .addGap(18, 18, 18)
                        .addComponent(abLabel)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(busLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(dbLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(abLabel)))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Controller"));

        org.openide.awt.Mnemonics.setLocalizedText(jLabel13, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel13.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel14, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel14.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel15, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel15.text")); // NOI18N

        irRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.irRegTextField.text")); // NOI18N
        irRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        irRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        irRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        acmTextField.setEditable(false);
        acmTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.acmTextField.text")); // NOI18N
        acmTextField.setMinimumSize(new java.awt.Dimension(36, 19));

        maTextField.setEditable(false);
        maTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.maTextField.text")); // NOI18N
        maTextField.setMinimumSize(new java.awt.Dimension(36, 19));

        org.openide.awt.Mnemonics.setLocalizedText(jLabel16, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel16.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel17, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel17.text")); // NOI18N

        scTextField.setEditable(false);
        scTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.scTextField.text")); // NOI18N
        scTextField.setMinimumSize(new java.awt.Dimension(36, 19));

        fileLineTextField.setEditable(false);
        fileLineTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.fileLineTextField.text")); // NOI18N
        fileLineTextField.setMinimumSize(new java.awt.Dimension(36, 19));

        org.openide.awt.Mnemonics.setLocalizedText(jLabel21, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel21.text")); // NOI18N

        anmTextField.setEditable(false);
        anmTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.anmTextField.text")); // NOI18N
        anmTextField.setMinimumSize(new java.awt.Dimension(36, 19));

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel17)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(irRegTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(fileLineTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(acmTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14)
                    .addComponent(jLabel16)
                    .addComponent(jLabel21))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(anmTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(scTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(maTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(21, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(irRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)
                    .addComponent(maTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel17)
                        .addComponent(fileLineTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel16)
                            .addComponent(scTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(acmTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21)
                    .addComponent(anmTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(26, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jPanel4.border.title"))); // NOI18N

        wRegTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.wRegTextField.text")); // NOI18N
        wRegTextField.setMinimumSize(new java.awt.Dimension(36, 19));
        wRegTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userChangeRegisterActionPerformed(evt);
            }
        });
        wRegTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                userTypeRegisterValue(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel5.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel10, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel10.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel23, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel23.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel24, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel24.text")); // NOI18N

        sBusTextField.setEditable(false);
        sBusTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.sBusTextField.text")); // NOI18N
        sBusTextField.setMinimumSize(new java.awt.Dimension(36, 19));

        rBusTextField.setEditable(false);
        rBusTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.rBusTextField.text")); // NOI18N
        rBusTextField.setMinimumSize(new java.awt.Dimension(36, 19));

        sumBusTextField.setEditable(false);
        sumBusTextField.setText(org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.sumBusTextField.text")); // NOI18N
        sumBusTextField.setMinimumSize(new java.awt.Dimension(36, 19));

        org.openide.awt.Mnemonics.setLocalizedText(jLabel25, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel25.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel26, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel26.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel27, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel27.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel28, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.jLabel28.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(overfSignalLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.overfSignalLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(enwSignalLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.enwSignalLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(czmSignalLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.czmSignalLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(cinSignalLabel, org.openide.util.NbBundle.getMessage(DopDbgTopComponent.class, "DopDbgTopComponent.cinSignalLabel.text")); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel24)
                    .addComponent(jLabel5)
                    .addComponent(jLabel23)
                    .addComponent(jLabel10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(sumBusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel28))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(rBusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel27))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(sBusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel26))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(wRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel25)))
                .addGap(12, 12, 12)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(enwSignalLabel)
                    .addComponent(czmSignalLabel)
                    .addComponent(cinSignalLabel)
                    .addComponent(overfSignalLabel))
                .addContainerGap(52, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(wRegTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25)
                    .addComponent(enwSignalLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(sBusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel26)
                    .addComponent(czmSignalLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rBusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel27)
                    .addComponent(cinSignalLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(sumBusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28)
                    .addComponent(overfSignalLabel))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

private void userChangeRegisterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userChangeRegisterActionPerformed
    int value = 0;
    try {
        value = Utils.hexToInt(((javax.swing.JTextField) evt.getSource()).getText());
    } catch (Exception ex) {
        JOptionPane.showMessageDialog(this, ex.getMessage(),"Error",JOptionPane.ERROR_MESSAGE);   
        return;
    }
    
    if ((evt.getSource() == irRegTextField) || 
            (evt.getSource() == lRegTextField) || 
            (evt.getSource() == dilRegTextField) || 
            (evt.getSource() == dihRegTextField)  ){
        if (value > 0xff){
            JOptionPane.showMessageDialog(this, "Value is greater than 0xFF!","Error",JOptionPane.ERROR_MESSAGE);   
        }
    }else{
        if (value > 0xffff){
            JOptionPane.showMessageDialog(this, "Value is greater than 0xFFFF!","Error",JOptionPane.ERROR_MESSAGE);   
        }        
    }

    if (evt.getSource() == wRegTextField){
        dopCore.getAlu().getWRegister().setValue(value);
    }
    if (evt.getSource() == doRegTextField){
        int dol = value & 0xff;
        int doh = value >> 8;
        dopCore.getMemoryInterface().getDOH().setValue(doh);
        dopCore.getMemoryInterface().getDOL().setValue(dol);
    }
    if (evt.getSource() == dilRegTextField){
        dopCore.getMemoryInterface().getDIL().setValue(value);
    }
    if (evt.getSource() == dihRegTextField){
        dopCore.getMemoryInterface().getDIH().setValue(value);
    }

            
    try {
       if (evt.getSource() == pcRegTextField){
           dopCore.getRegister(Core.PC_REG).setValue(value); 
       }
       if (evt.getSource() == spRegTextField){
           dopCore.getRegister(Core.SP_REG).setValue(value); 
       }
       if (evt.getSource() == dRegTextField){
           dopCore.getRegister(Core.D_REG).setValue(value); 
       }
       if (evt.getSource() == uRegTextField){
           dopCore.getRegister(Core.U_REG).setValue(value); 
       }
       if (evt.getSource() == tRegTextField){
           dopCore.getRegister(Core.T_REG).setValue(value); 
       }
       if (evt.getSource() == lRegTextField){
           dopCore.getRegister(Core.L_REG).setValue(value); 
       }
       if (evt.getSource() == irRegTextField){
           dopCore.getRegister(Core.IR_REG).setValue(value); 
       }
    } catch (Exception ex) {
        Exceptions.printStackTrace(ex);
    }
    
    ((javax.swing.JTextField)evt.getSource()).setForeground( userChangeColor2 );
    
    //System.out.println( evt.getSource().getClass().getName()+" set foreground to green");
    
}//GEN-LAST:event_userChangeRegisterActionPerformed

private void userTypeRegisterValue(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_userTypeRegisterValue
    //System.out.println( "key kode = "+evt.toString() );
    
    if ( evt.getKeyChar() != KeyEvent.VK_ENTER ){
        ((javax.swing.JTextField)evt.getSource()).setForeground(userChangeColor);
        
        lastChangetComponent.remove(evt.getSource());        
    }
}//GEN-LAST:event_userTypeRegisterValue


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel abLabel;
    private javax.swing.JTextField acmTextField;
    private javax.swing.JLabel afLabel;
    private javax.swing.JTextField anmTextField;
    private javax.swing.JLabel busLabel;
    private javax.swing.JLabel cfLabel;
    private javax.swing.JLabel cinSignalLabel;
    private javax.swing.JLabel czmSignalLabel;
    private javax.swing.JTextField dRegTextField;
    private javax.swing.JLabel dbLabel;
    private javax.swing.JTextField dihRegTextField;
    private javax.swing.JTextField dilRegTextField;
    private javax.swing.JTextField doRegTextField;
    private javax.swing.JLabel enwSignalLabel;
    private javax.swing.JTextField fileLineTextField;
    private javax.swing.JLabel ifLabel;
    private javax.swing.JTextField irRegTextField;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JTextField lRegTextField;
    private javax.swing.JTextField maTextField;
    private javax.swing.JLabel overfSignalLabel;
    private javax.swing.JLabel ovfLabel;
    private javax.swing.JTextField pcRegTextField;
    private javax.swing.JTextField rBusTextField;
    private javax.swing.JTextField sBusTextField;
    private javax.swing.JTextField sRegTextField;
    private javax.swing.JTextField scTextField;
    private javax.swing.JLabel sfLabel;
    private javax.swing.JTextField spRegTextField;
    private javax.swing.JTextField sumBusTextField;
    private javax.swing.JTextField tRegTextField;
    private javax.swing.JTextField uRegTextField;
    private javax.swing.JTextField wRegTextField;
    private javax.swing.JLabel zfLabel;
    // End of variables declaration//GEN-END:variables
    /**        at cz.karry.dop.nbmodule.dbg.ui.DopDbgTopComponent.findInstance(DopDbgTopComponent.java:83)
     * Gets default instance. Do not use directly: reserved for *.settings files only,
     * i.e. deserialization routines; otherwise you could get a non-deserialized instance.
     * To obtain the singleton instance, use {@link findInstance}.
     */
    public static synchronized DopDbgTopComponent getDefault() {
        if (instance == null) {
            instance = new DopDbgTopComponent();
        }
        return instance;
    }

    /**
     * Obtain the DopDbgTopComponent instance. Never call {@link #getDefault} directly!
     */
    public static synchronized DopDbgTopComponent findInstance() {
        TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
        if (win == null) {
            Logger.getLogger(DopDbgTopComponent.class.getName()).warning(
                    "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
            return getDefault();
        }
        if (win instanceof DopDbgTopComponent) {
            return (DopDbgTopComponent) win;
        }
        Logger.getLogger(DopDbgTopComponent.class.getName()).warning(
                "There seem to be multiple components with the '" + PREFERRED_ID +
                "' ID. That is a potential source of errors and unexpected behavior.");
        return getDefault();
    }

    @Override
    public int getPersistenceType() {
        return TopComponent.PERSISTENCE_ALWAYS;
    }

    @Override
    public void componentOpened() {
        // TODO add custom code on component opening
    }

    @Override
    public void componentClosed() {
        // TODO add custom code on component closing
    }

    /** replaces this in object stream */
    @Override
    public Object writeReplace() {
        return new ResolvableHelper();
    }

    @Override
    protected String preferredID() {
        return PREFERRED_ID;
    }

    final static class ResolvableHelper implements Serializable {

        private static final long serialVersionUID = 1L;

        public Object readResolve() {
            return DopDbgTopComponent.getDefault();
        }
    }

}
