/[svn]/jsampler/trunk/src/org/jsampler/view/fantasia/MidiDevicesPane.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/fantasia/MidiDevicesPane.java

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

revision 1777 by iliev, Mon Aug 11 22:51:24 2008 UTC revision 1778 by iliev, Sun Sep 28 20:38:36 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 23  Line 23 
23  package org.jsampler.view.fantasia;  package org.jsampler.view.fantasia;
24    
25  import java.awt.BorderLayout;  import java.awt.BorderLayout;
26    import java.awt.Color;
27  import java.awt.Container;  import java.awt.Container;
28  import java.awt.Cursor;  import java.awt.Cursor;
29  import java.awt.Dimension;  import java.awt.Dimension;
30    import java.awt.Graphics;
31    import java.awt.Graphics2D;
32  import java.awt.Insets;  import java.awt.Insets;
33  import java.awt.Rectangle;  import java.awt.Rectangle;
34    
# Line 45  import javax.swing.JScrollPane; Line 48  import javax.swing.JScrollPane;
48  import javax.swing.ListSelectionModel;  import javax.swing.ListSelectionModel;
49    
50  import net.sf.juife.ComponentList;  import net.sf.juife.ComponentList;
 import net.sf.juife.ComponentListModel;  
51  import net.sf.juife.DefaultComponentListModel;  import net.sf.juife.DefaultComponentListModel;
52    
53  import net.sf.juife.event.TaskEvent;  import net.sf.juife.event.TaskEvent;
# Line 65  import org.jsampler.view.std.JSNewMidiDe Line 67  import org.jsampler.view.std.JSNewMidiDe
67    
68  import org.linuxsampler.lscp.MidiInputDriver;  import org.linuxsampler.lscp.MidiInputDriver;
69    
 import static org.jsampler.view.fantasia.A4n.a4n;  
70  import static org.jsampler.view.fantasia.FantasiaI18n.i18n;  import static org.jsampler.view.fantasia.FantasiaI18n.i18n;
71  import static org.jsampler.view.fantasia.FantasiaPrefs.*;  import static org.jsampler.view.fantasia.FantasiaPrefs.*;
72    
# Line 130  public class MidiDevicesPane extends JPa Line 131  public class MidiDevicesPane extends JPa
131          class DeviceListPane extends ComponentList {          class DeviceListPane extends ComponentList {
132                  private Dimension maxSize = new Dimension();                  private Dimension maxSize = new Dimension();
133                                    
134                    @Override
135                  public Dimension                  public Dimension
136                  getMaximumSize() {                  getMaximumSize() {
137                          maxSize.width = Short.MAX_VALUE;                          maxSize.width = Short.MAX_VALUE;
# Line 139  public class MidiDevicesPane extends JPa Line 141  public class MidiDevicesPane extends JPa
141          }          }
142                    
143                    
144          class NewDevicePane extends JPanel {          class NewDevicePane extends FantasiaPanel {
145                  private final PixmapButton btnNew = new PixmapButton(Res.gfxPowerOff18);                  private final PixmapButton btnNew = new PixmapButton(Res.gfxPowerOff18);
146                  private JXCollapsiblePane createDevicePane = null;                  private JXCollapsiblePane createDevicePane = null;
147                  private boolean createDevice = false;                  private boolean createDevice = false;
# Line 192  public class MidiDevicesPane extends JPa Line 194  public class MidiDevicesPane extends JPa
194                          setAlignmentX(LEFT_ALIGNMENT);                          setAlignmentX(LEFT_ALIGNMENT);
195                  }                  }
196                                    
197                    /*private Color c1 = new Color(0x888888);
198                    private Color c2 = new Color(0x707070);
199                    
200                    @Override
201                    protected void
202                    paintComponent(Graphics g) {
203                            super.paintComponent(g);
204                            
205                            double h = getSize().getHeight();
206                            double w = getSize().getWidth();
207                            
208                            FantasiaPainter.paintGradient((Graphics2D)g, 0, 0, w - 1, h - 1, c1, c2);
209                            
210                            FantasiaPainter.RoundCorners rc =
211                                    new FantasiaPainter.RoundCorners(true);
212                            
213                            FantasiaPainter.paintOuterBorder((Graphics2D)g, 0, 0, w - 1, h - 1, rc);
214                    }*/
215                    
216                  private JPanel                  private JPanel
217                  createVSeparator() {                  createVSeparator() {
218                          PixmapPane p = new PixmapPane(Res.gfxVLine);                          PixmapPane p = new PixmapPane(Res.gfxVLine);
# Line 332  public class MidiDevicesPane extends JPa Line 353  public class MidiDevicesPane extends JPa
353          getHandler() { return eventHandler; }          getHandler() { return eventHandler; }
354                    
355          private class EventHandler implements MidiDeviceListListener {          private class EventHandler implements MidiDeviceListListener {
356                    @Override
357                  public void                  public void
358                  deviceAdded(MidiDeviceListEvent e) {                  deviceAdded(MidiDeviceListEvent e) {
359                          addDevice(e.getMidiDeviceModel());                          addDevice(e.getMidiDeviceModel());
360                  }                  }
361                                    
362                    @Override
363                  public void                  public void
364                  deviceRemoved(MidiDeviceListEvent e) {                  deviceRemoved(MidiDeviceListEvent e) {
365                          removeDevice(e.getMidiDeviceModel());                          removeDevice(e.getMidiDeviceModel());

Legend:
Removed from v.1777  
changed lines
  Added in v.1778

  ViewVC Help
Powered by ViewVC