/[svn]/jsampler/trunk/src/org/jsampler/view/std/JSOrchestraPane.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/std/JSOrchestraPane.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1540 by iliev, Mon Dec 3 23:22:02 2007 UTC revision 1746 by iliev, Mon Jun 2 03:33:11 2008 UTC
# Line 1  Line 1 
1  /*  /*
2   *   JSampler - a java front-end for LinuxSampler   *   JSampler - a java front-end for LinuxSampler
3   *   *
4   *   Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com>   *   Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com>
5   *   *
6   *   This file is part of JSampler.   *   This file is part of JSampler.
7   *   *
# Line 29  import java.awt.Window; Line 29  import java.awt.Window;
29    
30  import java.awt.event.ActionEvent;  import java.awt.event.ActionEvent;
31  import java.awt.event.ActionListener;  import java.awt.event.ActionListener;
32    import java.awt.event.KeyEvent;
33  import java.awt.event.MouseAdapter;  import java.awt.event.MouseAdapter;
34  import java.awt.event.MouseEvent;  import java.awt.event.MouseEvent;
35    
36  import javax.swing.AbstractAction;  import javax.swing.AbstractAction;
37  import javax.swing.Action;  import javax.swing.Action;
38    import javax.swing.JComponent;
39  import javax.swing.JMenu;  import javax.swing.JMenu;
40  import javax.swing.JMenuItem;  import javax.swing.JMenuItem;
41  import javax.swing.JPanel;  import javax.swing.JPanel;
42  import javax.swing.JPopupMenu;  import javax.swing.JPopupMenu;
43  import javax.swing.JScrollPane;  import javax.swing.JScrollPane;
44    import javax.swing.KeyStroke;
45    
46  import javax.swing.event.ListSelectionEvent;  import javax.swing.event.ListSelectionEvent;
47  import javax.swing.event.ListSelectionListener;  import javax.swing.event.ListSelectionListener;
# Line 90  public class JSOrchestraPane extends JPa Line 93  public class JSOrchestraPane extends JPa
93          public          public
94          JSOrchestraPane(OrchestraModel orchestra) {          JSOrchestraPane(OrchestraModel orchestra) {
95                  instrumentTable = new InstrumentTable();                  instrumentTable = new InstrumentTable();
96                    instrumentTable.setFillsViewportHeight(true);
97                  setOrchestra(orchestra);                  setOrchestra(orchestra);
98                                    
99                  setLayout(new BorderLayout());                  setLayout(new BorderLayout());
# Line 127  public class JSOrchestraPane extends JPa Line 131  public class JSOrchestraPane extends JPa
131                                    
132                  ContextMenu contextMenu = new ContextMenu();                  ContextMenu contextMenu = new ContextMenu();
133                  instrumentTable.addMouseListener(contextMenu);                  instrumentTable.addMouseListener(contextMenu);
134                    
135                    KeyStroke k = KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0);
136                    instrumentTable.getInputMap(JComponent.WHEN_FOCUSED).put(k, "deleteInstrument");
137                    instrumentTable.getActionMap().put("deleteInstrument", actionDeleteInstrument);
138          }          }
139                    
140          public void          public void
# Line 284  public class JSOrchestraPane extends JPa Line 292  public class JSOrchestraPane extends JPa
292                                    
293                  LoadInstrumentAction(SamplerChannelModel model) {                  LoadInstrumentAction(SamplerChannelModel model) {
294                          String s = "instrumentsdb.actions.loadInstrument.onChannel";                          String s = "instrumentsdb.actions.loadInstrument.onChannel";
295                          putValue(Action.NAME, i18n.getMenuLabel(s, model.getChannelId()));                          int i = CC.getSamplerModel().getChannelIndex(model) + 1;
296                            putValue(Action.NAME, i18n.getMenuLabel(s, i));
297                          channelModel = model;                          channelModel = model;
298                  }                  }
299                                    
# Line 425  public class JSOrchestraPane extends JPa Line 434  public class JSOrchestraPane extends JPa
434                                    
435                  public void                  public void
436                  channelAdded(SamplerChannelListEvent e) {                  channelAdded(SamplerChannelListEvent e) {
437                            if(CC.getSamplerModel().getChannelListIsAdjusting()) return;
438                          updateLoadInstrumentMenu(mLoadInstrument);                          updateLoadInstrumentMenu(mLoadInstrument);
439                  }                  }
440                                    

Legend:
Removed from v.1540  
changed lines
  Added in v.1746

  ViewVC Help
Powered by ViewVC