addWidget(cmn2Panel,new PatchNameWidget(" Name  ", patch, ((Driver) patch.getDriver()).getPatchNameSize()),0,0,2,1,0);
addWidget(cmn2Panel,new PatchNameWidget(" Name  ", patch),0,0,2,1,0);
  public KawaiK5000ADDSingleEditor(Patch patch)  {    super ("Kawai K5000 Single Editor",patch);       p=patch;// Common Pane  final JTabbedPane tabPane=new JTabbedPane();  JPanel cmnPanel = new JPanel();  cmnPanel.setLayout(new GridBagLayout());  //modPanel.setLayout(new GridBagLayout());   tabPane.addTab("Common",cmnPanel);gbc.weightx=1; gbc.weightx=5;  JPanel cmn2Panel = new JPanel();  cmn2Panel.setLayout(new GridBagLayout());  addWidget(cmn2Panel,new PatchNameWidget(" Name  ", patch, ((Driver) patch.getDriver()).getPatchNameSize()),0,0,2,1,0);  addWidget(cmn2Panel,new ScrollBarWidget("Volume",patch,0,127,0,new K5kCmnModel(patch,48),new K5kCmnSender(8)),0,1,2,1,1);  final ScrollBarWidget numSources = new ScrollBarWidget("Num Sources",patch,2,6,0,new K5kCmnModel(patch,51),new K5kCmnSender(0x0B));  addWidget(cmn2Panel,numSources,0,2,2,1,2);    numSources.addEventListener(new ChangeListener() {	   public void stateChanged(ChangeEvent e) {                int i=numSources.getValue();                for (int j = i; j<6; j++)                  tabPane.remove(srcPanel[j]);                for (int j = 0; j<i ; j++)                  tabPane.addTab("Source "+(j+1),srcPanel[j]);               }});  addWidget(cmn2Panel,new ComboBoxWidget("Poly Mode",patch,new K5kCmnModel(patch,49),new K5kCmnSender(9),new String []   {"POLY","SOLO1","SOLO2"}),0,3,1,1,3);  addWidget(cmn2Panel,new ComboBoxWidget("AM",patch,new K5kCmnModel(patch,53),new K5kCmnSender(0x0D),new String []   {"None","Source 2","Source 3","Source 4","Source 5","Source 6"}),1,3,1,1,4);  addWidget(cmn2Panel,new ScrollBarWidget("Portamento Speed",patch,0,127,0,new K5kCmnModel(patch,61),new K5kCmnSender(0x15)),0,4,2,1,2);  addWidget(cmn2Panel,new CheckBoxWidget("Portamento On",patch,new K5kCmnModel(patch,60),new K5kCmnSender(0x14)),0,5,2,1,-1);  gbc.gridx=0;gbc.gridy=0;gbc.gridwidth=1;gbc.gridheight=3;gbc.fill=GridBagConstraints.NONE;gbc.anchor=GridBagConstraints.WEST;  cmn2Panel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"General",TitledBorder.CENTER,TitledBorder.CENTER));       cmnPanel.add(cmn2Panel,gbc);  JPanel macro1Panel = new JPanel();  macro1Panel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Macro Controller 1",TitledBorder.CENTER,TitledBorder.CENTER));    macro1Panel.setLayout(new GridBagLayout());  addWidget(macro1Panel,new ComboBoxWidget("Param 1",patch,new K5kCmnModel(patch,62),new K5kCmnSender(0x16),macroList),0,4,1,1,5);  addWidget(macro1Panel,new ScrollBarWidget("Depth",patch,33,95,-64,new K5kCmnModel(patch,70),new K5kCmnSender(0x1E)),1,4,2,1,1);  addWidget(macro1Panel,new ComboBoxWidget("Param 2",patch,new K5kCmnModel(patch,63),new K5kCmnSender(0x17),macroList),0,5,1,1,5);  addWidget(macro1Panel,new ScrollBarWidget("Depth",patch,33,95,-64,new K5kCmnModel(patch,71),new K5kCmnSender(0x1F)),1,5,2,1,1);  gbc.gridx=0;gbc.gridy=4;gbc.gridwidth=4;gbc.gridheight=3;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;  cmnPanel.add(macro1Panel,gbc);    JPanel macro2Panel = new JPanel();  macro2Panel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Macro Controller 2",TitledBorder.CENTER,TitledBorder.CENTER));    macro2Panel.setLayout(new GridBagLayout());  addWidget(macro2Panel,new ComboBoxWidget("Param 1",patch,new K5kCmnModel(patch,64),new K5kCmnSender(0x18),macroList),0,6,1,1,5);  addWidget(macro2Panel,new ScrollBarWidget("Depth",patch,33,95,-64,new K5kCmnModel(patch,72),new K5kCmnSender(0x20)),1,6,2,1,1);  addWidget(macro2Panel,new ComboBoxWidget("Param 2",patch,new K5kCmnModel(patch,65),new K5kCmnSender(0x19),macroList),0,7,1,1,5);  addWidget(macro2Panel,new ScrollBarWidget("Depth",patch,33,95,-64,new K5kCmnModel(patch,73),new K5kCmnSender(0x21)),1,7,2,1,1);   gbc.gridx=0;gbc.gridy=7;gbc.gridwidth=4;gbc.gridheight=3;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;  cmnPanel.add(macro2Panel,gbc);    JPanel macro3Panel = new JPanel();  macro3Panel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Macro Controller 3",TitledBorder.CENTER,TitledBorder.CENTER));    macro3Panel.setLayout(new GridBagLayout());  addWidget(macro3Panel,new ComboBoxWidget("Param 1",patch,new K5kCmnModel(patch,66),new K5kCmnSender(0x1A),macroList),0,8,1,1,5);  addWidget(macro3Panel,new ScrollBarWidget("Depth",patch,33,95,-64,new K5kCmnModel(patch,74),new K5kCmnSender(0x22)),1,8,2,1,1);  addWidget(macro3Panel,new ComboBoxWidget("Param 2",patch,new K5kCmnModel(patch,67),new K5kCmnSender(0x1B),macroList),0,9,1,1,5);  addWidget(macro3Panel,new ScrollBarWidget("Depth",patch,33,95,-64,new K5kCmnModel(patch,75),new K5kCmnSender(0x23)),1,9,2,1,1);  gbc.gridx=0;gbc.gridy=10;gbc.gridwidth=4;gbc.gridheight=3;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;  cmnPanel.add(macro3Panel,gbc);    JPanel macro4Panel = new JPanel();  macro4Panel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Macro Controller 4",TitledBorder.CENTER,TitledBorder.CENTER));    macro4Panel.setLayout(new GridBagLayout());  addWidget(macro4Panel,new ComboBoxWidget("Param 1",patch,new K5kCmnModel(patch,68),new K5kCmnSender(0x1C),macroList),0,10,1,1,5);  addWidget(macro4Panel,new ScrollBarWidget("Depth",patch,33,95,-64,new K5kCmnModel(patch,76),new K5kCmnSender(0x24)),1,10,2,1,1);  addWidget(macro4Panel,new ComboBoxWidget("Param 2",patch,new K5kCmnModel(patch,69),new K5kCmnSender(0x1D),macroList),0,11,1,1,5);  addWidget(macro4Panel,new ScrollBarWidget("Depth",patch,33,95,-64,new K5kCmnModel(patch,77),new K5kCmnSender(0x25)),1,11,2,1,1);  gbc.gridx=0;gbc.gridy=13;gbc.gridwidth=4;gbc.gridheight=3;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.EAST;  cmnPanel.add(macro4Panel,gbc);  JPanel switchPanel = new JPanel();  switchPanel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Switches",TitledBorder.CENTER,TitledBorder.CENTER));    switchPanel.setLayout(new GridBagLayout());  addWidget(switchPanel,new ComboBoxWidget("      Switch 1",patch,new K5kCmnModel(patch,78),new K5kCmnSender(0x26),switchList),0,1,2,1,5);  addWidget(switchPanel,new ComboBoxWidget("      Switch 2",patch,new K5kCmnModel(patch,79),new K5kCmnSender(0x27),switchList),0,2,2,1,5);  addWidget(switchPanel,new ComboBoxWidget("Foot Switch 1",patch,new K5kCmnModel(patch,80),new K5kCmnSender(0x28),switchList),0,3,2,1,5);  addWidget(switchPanel,new ComboBoxWidget("Foot Switch 2",patch,new K5kCmnModel(patch,81),new K5kCmnSender(0x29),switchList),0,4,2,1,5);  gbc.gridx=2;gbc.gridy=0;gbc.gridwidth=2;gbc.gridheight=3;gbc.fill=GridBagConstraints.BOTH;gbc.anchor=GridBagConstraints.WEST;  cmnPanel.add(switchPanel,gbc);     gbc.gridx=0;gbc.gridy=0;gbc.gridwidth=5;gbc.gridheight=3;gbc.fill=GridBagConstraints.BOTH;   gbc.anchor=GridBagConstraints.NORTH;   cmnPanel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED),"Common",TitledBorder.CENTER,TitledBorder.CENTER));     scrollPane.add(tabPane,gbc);   for (int i=0;i<6;i++)     {       srcPanel[i]=createSourcePanel(i);       if (patch.sysex[60]>i) tabPane.addTab("Source "+(i+1),srcPanel[i]);     }   pack();   show(); }