JDialog oDialog = new PasteDialog(core.PatchEdit.getInstance(), mPatchCopy, getPatch(), mPart, mOperatorWidgets);
JDialog oDialog = new PasteDialog(core.PatchEdit.getInstance(), mPatchCopy, (Patch) getPatch(), mPart, mOperatorWidgets);
	private Container buildCommonWindow() {		Patch patch = (Patch)getPatch();		Box oCommonOthersPane = Box.createVerticalBox();		//JPanel oCommonOthersPane = new JPanel(new GridLayout(10, 1));		JButton oHelp = new JButton("Help");		oHelp.addActionListener(new ActionListener() {			public void actionPerformed (ActionEvent e) {				JSLFrame oHelpWin = new HelpWindow();				JSLDesktop.add(oHelpWin);				oHelpWin.setVisible(true);			}}		);		JPanel oMenu = new JPanel(new FlowLayout(FlowLayout.LEFT, HGAP, 0));		oMenu.add(oHelp);		oMenu.add(new JLabel("Performance part "+mPart+" - bank number "+mBankNumber));		oCommonOthersPane.add(oMenu);		// fonctions de copie d'operateurs		JPanel oCopyPane = new JPanel(new FlowLayout(FlowLayout.LEFT, HGAP, 0));		JButton oCopyAll = new JButton("Copy patch");		oCopyAll.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent e) {				// make a copy of entire patch				mPatchCopy = (IPatch)p.clone();			}		});		oCopyPane.add(oCopyAll);		JButton oPaste = new JButton("Paste...");		oPaste.addActionListener(new ActionListener() 		{			public void actionPerformed (ActionEvent e) 			{				if (mPatchCopy != null)				{					JDialog oDialog = new PasteDialog(core.PatchEdit.getInstance(), mPatchCopy, getPatch(), mPart, mOperatorWidgets);				}			}		});		oCopyPane.add(oPaste);		oCopyPane.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "Copy & Paste", TitledBorder.LEFT, TitledBorder.CENTER));		oMenu.add(oCopyPane);				// Common Pane (common-others)		JPanel oCommonPane = new JPanel(new FlowLayout(FlowLayout.LEFT, HGAP, 0));		oCommonPane.add(new PatchNameWidget(" Name  ", patch, ((Driver) patch.getDriver()).getPatchNameSize()));		oCommonPane.add(new ComboBoxWidget("Category", patch, new FS1RModel(patch, 0x0E), new FS1RSender(0x0E), mCategories));		oCommonPane.add(new KnobWidget("Algorithm", patch, 0, 87, 1, new FS1RModel(patch, 0x2C), new FS1RSender(0x2C), mAlgoImages));		oCommonPane.add(new SpinnerWidget("Feedback", patch, 0, 7, 0, new FS1RModel(patch, 0x3D), new FS1RSender(0x3D)));		oCommonPane.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "Common", TitledBorder.LEFT, TitledBorder.CENTER));		oCommonOthersPane.add(oCommonPane);		// common LFO1		JPanel oLFO1Pane = new JPanel(new FlowLayout(FlowLayout.LEFT, HGAP, VGAP));		oLFO1Pane.add(new ComboBoxWidget("Wave", patch, new FS1RModel(patch, 0x10), new FS1RSender(0x10), new String []{"Triangle", "Saw dawn", "Saw up","Square","Sine","Sample & hold"}));		oLFO1Pane.add(new KnobWidget("Speed", patch, 0, 99, 0, new FS1RModel(patch, 0x11), new FS1RSender(0x11)));		oLFO1Pane.add(new KnobWidget("Delay", patch, 0, 99, 0, new FS1RModel(patch, 0x12), new FS1RSender(0x12)));		oLFO1Pane.add(new CheckBoxWidget("Key sync",patch,new FS1RModel(patch,0x13), new FS1RSender(0x13)));		oLFO1Pane.add(new KnobWidget("Pitch Mod", patch, 0, 99, 0, new FS1RModel(patch, 0x15), new FS1RSender(0x15)));		oLFO1Pane.add(new KnobWidget("Amp Mod", patch, 0, 99, 0, new FS1RModel(patch, 0x16), new FS1RSender(0x16)));		oLFO1Pane.add(new KnobWidget("Freq Mod", patch, 0, 99, 0, new FS1RModel(patch, 0x17), new FS1RSender(0x17)));		oLFO1Pane.add(new KnobWidget("Filter Mod", patch, 0, 99, 0, new FS1RModel(patch, 0x59), new FS1RSender(0x59)));		oLFO1Pane.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "LFO1",TitledBorder.LEFT,TitledBorder.CENTER));		oCommonOthersPane.add(oLFO1Pane);		// common LFO2		JPanel oLFO2Pane = new JPanel(new FlowLayout(FlowLayout.LEFT, HGAP, VGAP));		oLFO2Pane.add(new ComboBoxWidget("Wave", patch, new FS1RModel(patch, 0x18), new FS1RSender(0x18), new String []{"Triangle", "Saw dawn", "Saw up","Square","Sine","Sample & hold"}));		oLFO2Pane.add(new KnobWidget("Speed", patch, 0, 99, 0, new FS1RModel(patch, 0x19), new FS1RSender(0x19)));		oLFO2Pane.add(new CheckBoxWidget("Key sync",patch,new FS1RModel(patch,0x1D), new FS1RSender(0x1D)));		oLFO2Pane.add(new ComboBoxWidget("Phase", patch, new FS1RModel(patch, 0x1C), new FS1RSender(0x1C), new String []{"0", "90", "180", "270"}));		oLFO2Pane.add(new KnobWidget("Filter Mod", patch, 0, 99, 0, new FS1RModel(patch, 0x5A), new FS1RSender(0x5A)));		oLFO2Pane.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "LFO2",TitledBorder.LEFT,TitledBorder.CENTER));		oCommonOthersPane.add(oLFO2Pane);		// tableau des switch Fseq		Component oTable1Check[][] = new Component[8][3];		for (int i = 0; i < 8; i++) {			if (i < 7) {				oTable1Check[i][0] = new CheckBoxWidget("", patch, new BitModel(patch, 0x29, 0, 1 << i, i), new BitSender(patch, 0x29));				oTable1Check[i][1] = new CheckBoxWidget("", patch, new BitModel(patch, 0x2B, 0, 1 << i, i), new BitSender(patch, 0x2B));			}			else {	// 7				oTable1Check[i][0] = new CheckBoxWidget("", patch, new BitModel(patch, 0x28, 0, 1, 0), new FS1RSender(0x28));				oTable1Check[i][1] = new CheckBoxWidget("", patch, new BitModel(patch, 0x2A, 0, 1, 0), new FS1RSender(0x2A));			}			// Fseq track number			SpinnerWidget oFseqTrack = new SpinnerWidget("", p, 0, 7, 1, new BitModel((Patch)p, 0x05, i+1, 7, 0), new BitSender((Patch)p, 0x05, i+1));			oFseqTrack.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));			oTable1Check[i][2] = oFseqTrack;		}		JTable oTable = new JTable(new SwitchTableModel(oTable1Check));		JScrollPane oSwitchPanel=new JScrollPane(oTable);		oSwitchPanel.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "Fseq switches",TitledBorder.LEFT,TitledBorder.CENTER));		for (int i = 1; i < 9; i++) {			TableColumn column = oTable.getColumnModel().getColumn(i);			column.setPreferredWidth(30);			CheckBoxCellRenderer checkBoxCellRenderer = new CheckBoxCellRenderer(patch, oTable1Check);			column.setCellRenderer (checkBoxCellRenderer);			CheckBoxCellEditor checkBoxCellEditor = new CheckBoxCellEditor(oTable1Check);			column.setCellEditor(checkBoxCellEditor);		}		oTable.setIntercellSpacing(new Dimension(0,0));		oTable.setRowHeight(oTable.getRowHeight()+10);		oTable.setShowGrid(false);		oTable.setRowMargin(0);		//oTable.setAlignmentX(Component.LEFT_ALIGNMENT);		TableColumn column = oTable.getColumnModel().getColumn(0);		column.setPreferredWidth(80);		oSwitchPanel.setPreferredSize(new Dimension(500, 110));		oCommonOthersPane.add(oSwitchPanel);		return oCommonOthersPane;	}