addWidget(cmnPane,new PatchNameWidget(" Name  ", patch, ((Driver) patch.getDriver()).getPatchNameSize()),0,0,4,1,0);
addWidget(cmnPane,new PatchNameWidget(" Name  ", patch),0,0,4,1,0);
  public EmuProteusMPSSingleEditor(Patch patch)  {    super ("Emu ProteusMPS Single Editor",patch);  JTabbedPane tabPane=new JTabbedPane();  JPanel wavePane = new JPanel();  JPanel modPane = new JPanel();  wavePane.setLayout(new GridBagLayout());  modPane.setLayout(new GridBagLayout());  tabPane.addTab("Main Parameters",wavePane);gbc.weightx=0;  tabPane.addTab("Modulation & Effects",modPane);gbc.weightx=0;   JPanel leftPane=new JPanel();   leftPane.setLayout(new GridBagLayout());  // Common Pane  gbc.weightx=5;  JPanel cmnPane=new JPanel();  cmnPane.setLayout(new GridBagLayout());	 gbc.weightx=0;   addWidget(cmnPane,new PatchNameWidget(" Name  ", patch, ((Driver) patch.getDriver()).getPatchNameSize()),0,0,4,1,0);// gbc.weightx=1;   addWidget(cmnPane,new ScrollBarLookupWidget("Pitch Bend Range",patch,0,13,new MPSModel(patch,0x7B),new MPSSender(123),new String[]{      "None","+/-1","+/-2","+/-3","+/-4","+/-5","+/-6","+/-7","+/-8","+/-9","+/-10","+/-11","+/-12","Global"}),0,1,5,1,1);   addWidget(cmnPane,new ScrollBarWidget("Pressure Amount",patch,-128,127,0,new MPSModel(patch,0x7A),new MPSSender(122)),0,2,5,1,2);   addWidget(cmnPane,new ScrollBarLookupWidget("Keyboard Center",patch,0,127,new MPSModel(patch,0x7D),new MPSSender(125),noteName),0,3,5,1,3);   addWidget(cmnPane,new ComboBoxWidget("Vel Curve",patch,new MPSModel(patch,0x7C),new MPSSender(124),new String[]{                        "Off","1","2","3","4","5","6","7","8","Global"}),0,4,2,1,4);   addWidget(cmnPane,new ComboBoxWidget("Tuning",patch,new MPSModel(patch,0x7F),new MPSSender(127),new String []{		                 "Equal","Just C","Vallotti","19 Tone","Gamelon","User 1","User 2","User 3","User 4"}),2,4,2,1,5);   gbc.gridx=0;gbc.gridy=0;gbc.gridwidth=5;gbc.gridheight=2;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;   cmnPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Common",TitledBorder.CENTER,TitledBorder.CENTER));   leftPane.add(cmnPane,gbc); gbc.weightx=5;// CrossFade Pane														*  gbc.weightx=5;  JPanel crxPane=new JPanel();  crxPane.setLayout(new GridBagLayout());	 gbc.weightx=0;   addWidget(crxPane,new ComboBoxWidget("XFade Mode",patch,new MPSModel(patch,0x3B),new MPSSender(59),new String []{							                 "Off","XFade","XSwitch"}),0,1,2,1,6);   addWidget(crxPane,new ComboBoxWidget("Key Switch Point",patch,new MPSModel(patch,0x3F),new MPSSender(63),noteName),2,1,2,1,7);   addWidget(crxPane,new ComboBoxWidget("Direction",patch,new MPSModel(patch,0x3C),new MPSSender(60),new String []{							                 "Primary->Secondary","Secondary->Primary"}),0,2,5,1,8);   addWidget(crxPane,new ScrollBarWidget("Balance",patch,0,127,0,new MPSModel(patch,0x3D),new MPSSender(61)),0,3,5,1,9);   addWidget(crxPane,new ScrollBarWidget("Amount",patch,0,255,0,new MPSModel(patch,0X3E),new MPSSender(62)),0,4,5,1,10);   gbc.gridx=0;gbc.gridy=2;gbc.gridwidth=5;gbc.gridheight=2;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;   crxPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Cross Fade",TitledBorder.CENTER,TitledBorder.CENTER));   leftPane.add(crxPane,gbc); gbc.weightx=5;// LFO1													*  gbc.weightx=5;  JPanel lfo1Pane=new JPanel();   lfo1Pane.setLayout(new GridBagLayout());	 gbc.weightx=0;   addWidget(lfo1Pane,new ComboBoxWidget("Waveform",patch,new MPSModel(patch,0x40),new MPSSender(64),new String []{						                 "Random","Triangle","Sine","Saw","Square"}),0,0,1,1,11);   addWidget(lfo1Pane,new ScrollBarWidget("LFO Frequency",patch,0,127,0,new MPSModel(patch,0x41),new MPSSender(65)),0,1,5,1,12);   addWidget(lfo1Pane,new ScrollBarWidget("Delay",patch,0,127,0,new MPSModel(patch,0x42),new MPSSender(66)),0,2,5,1,13);   addWidget(lfo1Pane,new ScrollBarWidget("Variation",patch,0,127,0,new MPSModel(patch,0x43),new MPSSender(67)),0,3,5,1,14);   addWidget(lfo1Pane,new ScrollBarWidget("Amount",patch,-128,127,0,new MPSModel(patch,0x44),new MPSSender(68)),0,4,5,1,15);   gbc.gridx=0;gbc.gridy=5;gbc.gridwidth=5;gbc.gridheight=3;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;   lfo1Pane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"LFO1",TitledBorder.CENTER,TitledBorder.CENTER));   leftPane.add(lfo1Pane,gbc); gbc.weightx=5;// LFO2											*  gbc.weightx=5;  JPanel lfo2Pane=new JPanel();   lfo2Pane.setLayout(new GridBagLayout());	 gbc.weightx=0;   addWidget(lfo2Pane,new ComboBoxWidget("Waveform",patch,new MPSModel(patch,0x45),new MPSSender(69),new String []{						                 "Random","Triangle","Sine","Saw","Square"}),0,0,1,1,17);   addWidget(lfo2Pane,new ScrollBarWidget("LFO Frequency",patch,0,127,0,new MPSModel(patch,0x46),new MPSSender(70)),0,1,5,1,18);   addWidget(lfo2Pane,new ScrollBarWidget("Delay",patch,0,127,0,new MPSModel(patch,0x47),new MPSSender(71)),0,2,5,1,19);   addWidget(lfo2Pane,new ScrollBarWidget("Variation",patch,0,127,0,new MPSModel(patch,0x48),new MPSSender(72)),0,3,5,1,20);   addWidget(lfo2Pane,new ScrollBarWidget("Amount",patch,-128,127,0,new MPSModel(patch,0x49),new MPSSender(73)),0,4,5,1,21);   gbc.gridx=0;gbc.gridy=8;gbc.gridwidth=5;gbc.gridheight=3;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;   lfo2Pane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"LFO2",TitledBorder.CENTER,TitledBorder.CENTER));   leftPane.add(lfo2Pane,gbc); gbc.weightx=5;   gbc.gridx=0;gbc.gridy=0;gbc.gridwidth=5;gbc.gridheight=15;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.NORTH;   wavePane.add(leftPane,gbc);//Source Pane															*   JTabbedPane oscPane=new JTabbedPane();   for (int i=0;i<2;i++)   {     JPanel panel = new JPanel();     panel.setLayout(new GridBagLayout());     if (i==0)oscPane.addTab("Primary Source",panel);     else oscPane.addTab("Secondary Source",panel);     gbc.weightx=0;   addWidget(panel,new EnvelopeWidget("Alternate Envelope",patch,new EnvelopeWidget.Node [] {        new EnvelopeWidget.Node(0,0,null,0,0,null,0,false,null,null,null,null),	new EnvelopeWidget.Node(0,99,new MPSModel(patch,0x1D+i*18),0,0,null,0,false,new MPSSender(29+i*18),null,"Dly",null),	new EnvelopeWidget.Node(0,99,new MPSModel(patch,0x20+i*18),100,100,null,25,false,new MPSSender(32+i*18),null,"A",null),	new EnvelopeWidget.Node(0,99,new MPSModel(patch,0x21+i*18),5000,5000,null,0,false,new MPSSender(33+i*18),null,"Hld",null),	new EnvelopeWidget.Node(0,99,new MPSModel(patch,0x22+i*18),0,99,new MPSModel(patch,0x23+i*18),25,false,new MPSSender(34+i*18),new MPSSender(35+i*18),"D","S"),        new EnvelopeWidget.Node(100,100,null,5000,5000,null,0,false,null,null,null,null),	new EnvelopeWidget.Node(0,100,new MPSModel(patch,0x24+i*18),0,0,null,0,false,new MPSSender(36+i*18),null,"R",null),      }     ),0,0,3,5,33);     addWidget(panel,new CheckBoxWidget("Alternate Envelope Enable",patch,new MPSModel(patch,0x25+i*18),new MPSSender(37+i*18)),0,5,2,1,-33);     addWidget(panel,new ComboBoxWidget("Instrument",patch,new InstModel(patch,0x17+i*18),new InstSender(23+i*18),waveName),0,6,2,1,39);     addWidget(panel,new ScrollBarWidget("Volume",patch,0,127,0,new MPSModel(patch,0x1B+i*18),new MPSSender(27+i*18)),0,7,3,1,40);     addWidget(panel,new ScrollBarWidget("Detune",patch,0,15,0,new MPSModel(patch,0x27+i*18),new MPSSender(39+i*18)),0,8,3,1,41);     addWidget(panel,new ScrollBarWidget("Sample Start",patch,0,127,0,new MPSModel(patch,0x18+i*18),new MPSSender(24+i*18)),0,9,3,1,42);     addWidget(panel,new ScrollBarWidget("Course Tune",patch,-36,36,0,new MPSModel(patch,0x19+i*18),new MPSSender(25+i*18)),0,10,3,1,43);     addWidget(panel,new ScrollBarWidget("Fine Tune",patch,-64,64,0,new MPSModel(patch,0x1A+i*18),new MPSSender(26+i*18)),0,11,3,1,44);     addWidget(panel,new ScrollBarWidget("Pan",patch,-7,7,0,new MPSModel(patch,0x1C+i*18),new MPSSender(28+i*18)),0,12,3,1,45);     addWidget(panel,new ComboBoxWidget("Low Key",patch,new MPSModel(patch,0x1E+i*18),new MPSSender(30+i*18),noteName),0,13,1,1,46);     addWidget(panel,new ComboBoxWidget("High Key",patch,new MPSModel(patch,0x1F+i*18),new MPSSender(31+i*18),noteName),1,13,1,1,47);     addWidget(panel,new CheckBoxWidget("Solo Mode",patch,new MPSModel(patch,0x26+i*18),new MPSSender(38+i*18)),0,14,1,1,-34);     addWidget(panel,new CheckBoxWidget("Reverse Sound",patch,new MPSModel(patch,0x28+i*18),new MPSSender(40+i*18)),1,14,1,1,-35);   } gbc.gridx=5;gbc.gridy=0;gbc.gridwidth=5;gbc.gridheight=9; wavePane.add(oscPane,gbc); // Auxillary Envelope										*  gbc.weightx=5;  JPanel auxPane=new JPanel();   auxPane.setLayout(new GridBagLayout());	 gbc.weightx=0;   addWidget(auxPane,new EnvelopeWidget("Auxilery Envelope                             ",patch,new EnvelopeWidget.Node [] {        new EnvelopeWidget.Node(0,0,null,0,0,null,0,false,null,null,null,null),	new EnvelopeWidget.Node(0,99,new MPSModel(patch,0x4A),0,0,null,0,false,new MPSSender(74),null,"Dly",null),	new EnvelopeWidget.Node(0,99,new MPSModel(patch,0x4B),100,100,null,25,false,new MPSSender(75),null,"A",null),	new EnvelopeWidget.Node(0,99,new MPSModel(patch,0x4C),5000,5000,null,0,false,new MPSSender(76),null,"Hld",null),	new EnvelopeWidget.Node(0,99,new MPSModel(patch,0x4D),0,99,new MPSModel(patch,0x4E),25,false,new MPSSender(77),new MPSSender(78),"D","S"),        new EnvelopeWidget.Node(100,100,null,5000,5000,null,0,false,null,null,null,null),	new EnvelopeWidget.Node(0,100,new MPSModel(patch,0x4F),0,0,null,0,false,new MPSSender(79),null,"R",null),      }     ),0,0,3,5,49);     addWidget(auxPane,new ScrollBarWidget("Amount",patch,-128,127,0,new MPSModel(patch,0x50),new MPSSender(80)),0,7,3,1,55);   gbc.gridx=10;gbc.gridy=0;gbc.gridwidth=5;gbc.gridheight=3;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;   auxPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Auxilery",TitledBorder.CENTER,TitledBorder.CENTER));   wavePane.add(auxPane,gbc); //Controller Amounts  gbc.weightx=5;  JPanel cntPane=new JPanel();   cntPane.setLayout(new GridBagLayout());	 gbc.weightx=0;     addWidget(cntPane,new ScrollBarWidget("Controller A",patch,-128,127,0,new MPSModel(patch,0x76),new MPSSender(118)),0,1,3,1,56);     addWidget(cntPane,new ScrollBarWidget("Controller B",patch,-128,127,0,new MPSModel(patch,0x77),new MPSSender(119)),0,2,3,1,57);     addWidget(cntPane,new ScrollBarWidget("Controller C",patch,-128,127,0,new MPSModel(patch,0x78),new MPSSender(120)),0,3,3,1,58);     addWidget(cntPane,new ScrollBarWidget("Controller D",patch,-128,127,0,new MPSModel(patch,0x79),new MPSSender(121)),0,4,3,1,59);   gbc.gridx=10;gbc.gridy=3;gbc.gridwidth=5;gbc.gridheight=3;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;   cntPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Controller Amounts",TitledBorder.CENTER,TitledBorder.CENTER));   wavePane.add(cntPane,gbc);//Footswitch Destinations  gbc.weightx=5;  JPanel fswPane=new JPanel();   fswPane.setLayout(new GridBagLayout());	 gbc.weightx=0;   addWidget(fswPane,new ComboBoxWidget("FSW 1",patch,new MPSModel(patch,0x73),new MPSSender(115),new String []{      "Off","Sustain","Sustain Pri","Sustain Sec","Alt Env", "Alt Env Pri", "Alt Env Sec","Alt Rel",      "Alt Rel Pri", "Alt Rel Sec","XSwitch"}),0,0,1,1,60);   addWidget(fswPane,new ComboBoxWidget("FSW 2",patch,new MPSModel(patch,0x74),new MPSSender(116),new String []{      "Off","Sustain","Sustain Pri","Sustain Sec","Alt Env", "Alt Env Pri", "Alt Env Sec","Alt Rel",      "Alt Rel Pri", "Alt Rel Sec","XSwitch"}),0,1,1,1,61);   addWidget(fswPane,new ComboBoxWidget("FSW 3",patch,new MPSModel(patch,0x75),new MPSSender(117),new String []{      "Off","Sustain","Sustain Pri","Sustain Sec","Alt Env", "Alt Env Pri", "Alt Env Sec","Alt Rel",      "Alt Rel Pri", "Alt Rel Sec","XSwitch"}),2,1,1,1,62);   gbc.gridx=10;gbc.gridy=6;gbc.gridwidth=4;gbc.gridheight=1;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;   fswPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Footswitch Destinations",TitledBorder.CENTER,TitledBorder.CENTER));   wavePane.add(fswPane,gbc);   //Links  gbc.weightx=5;  JPanel lnkPane=new JPanel();   lnkPane.setLayout(new GridBagLayout());	 gbc.weightx=0;     gbc.gridx=0;gbc.gridy=0;gbc.anchor=GridBagConstraints.NORTH;lnkPane.add(new JLabel("This Patch"),gbc);     addWidget(lnkPane,new ComboBoxWidget("Low Key",patch,new MPSModel(patch,0x0F),new MPSSender(15),noteName),2,0,1,2,65);     addWidget(lnkPane,new ComboBoxWidget("High Key",patch,new MPSModel(patch,0x13),new MPSSender(19),noteName),3,0,1,2,66);     addWidget(lnkPane,new ScrollBarWidget("Patch Num.",patch,-1,499,0,new MPSModel(patch,0x0C),new MPSSender(12)),0,2,1,1,67);     addWidget(lnkPane,new ComboBoxWidget("Low Key",patch,new MPSModel(patch,0x10),new MPSSender(16),noteName),2,2,1,1,68);     addWidget(lnkPane,new ComboBoxWidget("High Key",patch,new MPSModel(patch,0x14),new MPSSender(20),noteName),3,2,1,1,69);     addWidget(lnkPane,new ScrollBarWidget("Patch Num.",patch,-1,499,0,new MPSModel(patch,0x0D),new MPSSender(13)),0,3,1,1,70);     addWidget(lnkPane,new ComboBoxWidget("Low Key",patch,new MPSModel(patch,0x11),new MPSSender(17),noteName),2,3,1,1,71);     addWidget(lnkPane,new ComboBoxWidget("High Key",patch,new MPSModel(patch,0x15),new MPSSender(21),noteName),3,3,1,1,72);     addWidget(lnkPane,new ScrollBarWidget("Patch Num.",patch,-1,499,0,new MPSModel(patch,0x0E),new MPSSender(14)),0,4,1,1,73);     addWidget(lnkPane,new ComboBoxWidget("Low Key",patch,new MPSModel(patch,0x12),new MPSSender(18),noteName),2,4,1,1,74);     addWidget(lnkPane,new ComboBoxWidget("High Key",patch,new MPSModel(patch,0x16),new MPSSender(22),noteName),3,4,1,1,75);     gbc.gridx=5;gbc.gridy=7;gbc.gridwidth=10;gbc.gridheight=5;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;   lnkPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"                                        Interpatch Linking",TitledBorder.CENTER,TitledBorder.CENTER));   wavePane.add(lnkPane,gbc);//Modulations and Effects Tab											**   JPanel modsPane=new JPanel();   modsPane.setLayout(new GridBagLayout());	 gbc.weightx=0;// RealTime Modulations     JPanel realPane=new JPanel();     realPane.setLayout(new GridBagLayout());	 gbc.weightx=0;     for (int i=0;i<8;i++)     {	     addWidget(realPane,new ComboBoxWidget("",patch,new MPSModel(patch,0x63+i),new MPSSender(99+i),realtimeModSource),0,i,1,1,1+i*2);	     addWidget(realPane,new ComboBoxWidget(" to ",patch,new MPSModel(patch,0x6B+i),new MPSSender(107+i),realtimeModDest),1,i,1,1,2+i*2);     }     realPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Realtime Controller Modulations",TitledBorder.CENTER,TitledBorder.CENTER));     gbc.gridx=0;gbc.gridy=0;gbc.gridwidth=5;gbc.gridheight=5;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;     modsPane.add(realPane,gbc);// Key & Velocity Modulations     JPanel keyPane=new JPanel();     keyPane.setLayout(new GridBagLayout());	 gbc.weightx=0;     for (int i=0;i<6;i++)     {	     addWidget(keyPane,new ComboBoxWidget("",patch,new MPSModel(patch,0x51+i),new MPSSender(81+i),new String[] {"Key Number","Velocity"}),0,i,1,1,17+i*3);	     addWidget(keyPane,new ComboBoxWidget(" to ",patch,new MPSModel(patch,0x57+i),new MPSSender(87+i),keyModDest),1,i,1,1,18+i*3);             addWidget(keyPane,new ScrollBarWidget("Amount.",patch,-128,127,0,new MPSModel(patch,0x5D+i),new MPSSender(93+i)),2,i,1,1,19+i*3);     }     keyPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Keyboard & Velocity Modulations",TitledBorder.CENTER,TitledBorder.CENTER));     gbc.gridx=5;gbc.gridy=0;gbc.gridwidth=5;gbc.gridheight=5;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;     modsPane.add(keyPane,gbc);   modsPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Modulation Patching",TitledBorder.CENTER,TitledBorder.CENTER));   gbc.gridx=0;gbc.gridy=0;gbc.gridwidth=10;gbc.gridheight=5;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;   modPane.add(modsPane,gbc);   JPanel fxPane=new JPanel();   fxPane.setLayout(new GridBagLayout());	 gbc.weightx=0;//Panel A     JPanel aPane=new JPanel();     aPane.setLayout(new GridBagLayout());	 gbc.weightx=0;     aPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Effect Bus A",TitledBorder.CENTER,TitledBorder.CENTER));     final ComboBoxWidget fxTypeBox=new ComboBoxWidget("Effect Type",patch,new MPSModel(patch,0x82),new MPSSender(130),new String []{	"No Effect","Room","Warm Room","Plate 1","Plate 2","Chamber 1","Chamber 2","Hall 1","Hall 2",        "Delay","Cross Delay","Phaser","Stereo Flange","Stereo Chorus","Echo","Stereo EQ","Small Room 1",        "Small Room 2","Hall 3","Early Reflections 1","Early Reflections 2","Early Reflections 3",        "Early Reflections 4","Rain"});	addWidget(aPane,fxTypeBox,0,0,1,1,49);      final ScrollBarWidget effectASliders []=new ScrollBarWidget[10];        fxTypeBox.addEventListener(new ActionListener() {	    public void actionPerformed(ActionEvent e) {              for (int i=0;i<6;i++)              {    	        try {			int fxa=fxTypeBox.getValue();			effectASliders[i].setLabel(effectAParams[fxa][i]);            ScrollBarWidget r = effectASliders[i];	 	        r.setMin(effectARanges[fxa][i][0]);                r.setMax(effectARanges[fxa][i][1]);		    }		catch (Exception e1){effectASliders[i].setLabel("Unused");}              }                }});     addWidget(aPane,new ScrollBarWidget("Effect Amount (%)",patch,0,100,0,new MPSModel(patch,0x83),new MPSSender(131)),0,1,1,1,50);     int effectA=(new MPSModel(patch,0x82)).get();     for (int i=0;i<6;i++)       {          effectASliders[i]=new ScrollBarWidget("Unused",patch,0,100,0,new MPSModel(patch,0x84+i),new MPSSender(132+i));	  addWidget(aPane,effectASliders[i],0,i+2,1,1,51+i);	  try {            ScrollBarWidget r = effectASliders[i];            r.setMin(effectARanges[effectA][i][0]);            r.setMax(effectARanges[effectA][i][1]);	    effectASliders[i].setLabel(effectAParams[effectA][i]);}	   catch (Exception e){effectASliders[i].setLabel("Unused");}       }     gbc.gridx=0;gbc.gridy=0;gbc.gridwidth=10;gbc.gridheight=5;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;     fxPane.add(aPane,gbc);//Panel B     JPanel bPane=new JPanel();     bPane.setLayout(new GridBagLayout());	 gbc.weightx=0;     bPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Effect Bus B",TitledBorder.CENTER,TitledBorder.CENTER));   final ComboBoxWidget fxbTypeBox=new ComboBoxWidget("Effect Type",patch,new MPSModel(patch,0x8E),new MPSSender(142),new String []{    "Off","Stereo Flange","Stereo Chorus","Phaser","Fuzz 1","Ring Modulator","Delay","Cross Delay","Stereo EQ","Fuzz Lite"});	addWidget(bPane,fxbTypeBox,0,0,1,1,57);      final ScrollBarWidget effectBSliders []=new ScrollBarWidget[10];        fxbTypeBox.addEventListener(new ActionListener() {	    public void actionPerformed(ActionEvent e) {              for (int i=0;i<6;i++)              {    	        try {			int fxb=fxbTypeBox.getValue();			effectBSliders[i].setLabel(effectBParams[fxb][i]);            ScrollBarWidget r = effectBSliders[i];	 	        r.setMin(effectBRanges[fxb][i][0]);                r.setMax(effectBRanges[fxb][i][1]);		    }		catch (Exception e1){effectBSliders[i].setLabel("Unused");}              }                }});     addWidget(bPane,new ScrollBarWidget("Effect Amount (%)",patch,0,100,0,new MPSModel(patch,0x8B),new MPSSender(143)),0,1,1,1,58);     int effectB=(new MPSModel(patch,0x8E)).get();     for (int i=0;i<6;i++)       {          effectBSliders[i]=new ScrollBarWidget("Unused",patch,0,100,0,new MPSModel(patch,0x90+i),new MPSSender(144+i));	  addWidget(bPane,effectBSliders[i],0,i+2,1,1,59+i);	  try {            effectBSliders[i].setLabel(effectBParams[effectB][i]);            ScrollBarWidget r = effectBSliders[i]; 	    r.setMin(effectBRanges[effectA][i][0]);        r.setMax(effectBRanges[effectA][i][1]); } 	 catch (Exception e){effectBSliders[i].setLabel("Unused");}       }     gbc.gridx=10;gbc.gridy=0;gbc.gridwidth=10;gbc.gridheight=5;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;     fxPane.add(bPane,gbc);//Panel C     JPanel cPane=new JPanel();     cPane.setLayout(new GridBagLayout());	 gbc.weightx=0;     cPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Effects Common",TitledBorder.CENTER,TitledBorder.CENTER));     addWidget(cPane,new ComboBoxWidget("Primary Source Effects Bus",patch,new MPSModel(patch,0x80),new MPSSender(128),new String [] {             "A","B","Dry","Sub"}),0,0,1,1,35);     addWidget(cPane,new ComboBoxWidget("Secondary Source Effects Bus",patch,new MPSModel(patch,0x81),new MPSSender(129),new String [] {             "A","B","Dry","Sub"}),0,1,1,1,36);     addWidget(cPane,new ScrollBarWidget("B to A",patch,0,100,0,new MPSModel(patch,0x9A),new MPSSender(154)),0,2,1,1,37);     gbc.gridx=20;gbc.gridy=0;gbc.gridwidth=10;gbc.gridheight=5;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;     fxPane.add(cPane,gbc);   fxPane.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Effects Processing",TitledBorder.CENTER,TitledBorder.CENTER));   gbc.gridx=0;gbc.gridy=5;gbc.gridwidth=10;gbc.gridheight=5;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.NORTH;   modPane.add(fxPane,gbc);   gbc.weightx=5;   scrollPane.add(tabPane,gbc);   pack();   show();  }