/[svn]/jsampler/trunk/src/org/jsampler/view/classic/InstrumentsDbFrame.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/classic/InstrumentsDbFrame.java

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

revision 1785 by iliev, Mon Aug 11 22:51:24 2008 UTC revision 1786 by iliev, Wed Oct 8 22:38:15 2008 UTC
# Line 25  package org.jsampler.view.classic; Line 25  package org.jsampler.view.classic;
25  import java.awt.BorderLayout;  import java.awt.BorderLayout;
26  import java.awt.Dimension;  import java.awt.Dimension;
27    
28    import java.awt.Rectangle;
29  import java.awt.event.ActionEvent;  import java.awt.event.ActionEvent;
30  import java.awt.event.ActionListener;  import java.awt.event.ActionListener;
 import java.awt.event.ItemEvent;  
 import java.awt.event.ItemListener;  
31  import java.awt.event.KeyEvent;  import java.awt.event.KeyEvent;
32  import java.awt.event.WindowAdapter;  import java.awt.event.WindowAdapter;
33  import java.awt.event.WindowEvent;  import java.awt.event.WindowEvent;
34    
 import java.util.logging.Level;  
   
35  import javax.swing.AbstractAction;  import javax.swing.AbstractAction;
36  import javax.swing.Action;  import javax.swing.Action;
 import javax.swing.BorderFactory;  
 import javax.swing.BoxLayout;  
 import javax.swing.Icon;  
 import javax.swing.JCheckBox;  
37  import javax.swing.JComponent;  import javax.swing.JComponent;
38  import javax.swing.JFrame;  import javax.swing.JFrame;
39  import javax.swing.JMenu;  import javax.swing.JMenu;
# Line 49  import javax.swing.JMenuItem; Line 42  import javax.swing.JMenuItem;
42  import javax.swing.JPanel;  import javax.swing.JPanel;
43  import javax.swing.JScrollPane;  import javax.swing.JScrollPane;
44  import javax.swing.JSplitPane;  import javax.swing.JSplitPane;
 import javax.swing.JTextField;  
45  import javax.swing.JToggleButton;  import javax.swing.JToggleButton;
46  import javax.swing.JToolBar;  import javax.swing.JToolBar;
47  import javax.swing.KeyStroke;  import javax.swing.KeyStroke;
# Line 57  import javax.swing.KeyStroke; Line 49  import javax.swing.KeyStroke;
49  import javax.swing.event.ListSelectionEvent;  import javax.swing.event.ListSelectionEvent;
50  import javax.swing.event.ListSelectionListener;  import javax.swing.event.ListSelectionListener;
51    
 import javax.swing.plaf.ToolBarUI;  
   
 import net.sf.juife.InformationDialog;  
52  import net.sf.juife.NavigationPage;  import net.sf.juife.NavigationPage;
53  import net.sf.juife.NavigationPane;  import net.sf.juife.NavigationPane;
54    
 import net.sf.juife.Task;  
   
 import net.sf.juife.event.TaskEvent;  
 import net.sf.juife.event.TaskListener;  
   
55  import org.jsampler.CC;  import org.jsampler.CC;
56  import org.jsampler.HF;  import org.jsampler.HF;
 import org.jsampler.JSI18n;  
57    
58  import org.jsampler.task.InstrumentsDb;  import org.jsampler.task.InstrumentsDb;
59    
60  import org.jsampler.view.DbDirectoryTreeNode;  import org.jsampler.view.DbDirectoryTreeNode;
 import org.jsampler.view.InstrumentsDbTableModel;  
 import org.jsampler.view.InstrumentsDbTableView;  
61    
62  import org.jsampler.view.std.JSInstrumentsDbColumnPreferencesDlg;  import org.jsampler.view.std.JSInstrumentsDbColumnPreferencesDlg;
63  import org.jsampler.view.std.JSInstrumentsDbTable;  import org.jsampler.view.std.JSInstrumentsDbTable;
64  import org.jsampler.view.std.JSInstrumentsDbTree;  import org.jsampler.view.std.JSInstrumentsDbTree;
65  import org.jsampler.view.std.JSLostFilesDlg;  import org.jsampler.view.std.JSLostFilesDlg;
66    import org.jsampler.view.std.StdUtils;
67    
68  import org.linuxsampler.lscp.DbDirectoryInfo;  import org.linuxsampler.lscp.DbDirectoryInfo;
69  import org.linuxsampler.lscp.DbInstrumentInfo;  import org.linuxsampler.lscp.DbInstrumentInfo;
 import org.linuxsampler.lscp.DbSearchQuery;  
70    
71  import static org.jsampler.view.classic.ClassicI18n.i18n;  import static org.jsampler.view.classic.ClassicI18n.i18n;
72  import static org.jsampler.view.classic.ClassicPrefs.preferences;  import static org.jsampler.view.classic.ClassicPrefs.preferences;
 import static org.jsampler.view.fantasia.FantasiaPrefs.INSTRUMENTS_DB_FRAME_SORT_ORDER;  
73    
74  /**  /**
75   *   *
# Line 325  public class InstrumentsDbFrame extends Line 305  public class InstrumentsDbFrame extends
305                  ClassicPrefs.setWindowMaximized("InstrumentsDbFrame", b);                  ClassicPrefs.setWindowMaximized("InstrumentsDbFrame", b);
306                  if(b) return;                  if(b) return;
307                                    
308                  java.awt.Point p = getLocation();                  StdUtils.saveWindowBounds("InstrumentsDbFrame", getBounds());
                 Dimension d = getSize();  
                 StringBuffer sb = new StringBuffer();  
                 sb.append(p.x).append(',').append(p.y).append(',');  
                 sb.append(d.width).append(',').append(d.height);  
                 ClassicPrefs.setWindowSizeAndLocation("InstrumentsDbFrame", sb.toString());  
309                  int i = splitPane.getDividerLocation();                  int i = splitPane.getDividerLocation();
310                  preferences().setIntProperty("InstrumentsDbFrame.dividerLocation", i);                  preferences().setIntProperty("InstrumentsDbFrame.dividerLocation", i);
311                                    
# Line 338  public class InstrumentsDbFrame extends Line 313  public class InstrumentsDbFrame extends
313                  mainPane.getInstrumentsTable().saveColumnWidths();                  mainPane.getInstrumentsTable().saveColumnWidths();
314          }          }
315                    
316            @Override
317            public void
318            setVisible(boolean b) {
319                    if(b == isVisible()) return;
320                    
321                    super.setVisible(b);
322                    
323                    if(ClassicPrefs.getWindowMaximized("InstrumentsDbFrame")) {
324                            setExtendedState(getExtendedState() | MAXIMIZED_BOTH);
325                    }
326            }
327            
328          private void          private void
329          setDefaultSize() {          setDefaultSize() {
330                  Dimension dimension = java.awt.Toolkit.getDefaultToolkit().getScreenSize();                  Dimension dimension = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
# Line 348  public class InstrumentsDbFrame extends Line 335  public class InstrumentsDbFrame extends
335                    
336          private void          private void
337          setSavedSize() {          setSavedSize() {
338                  String s = ClassicPrefs.getWindowSizeAndLocation("InstrumentsDbFrame");                  Rectangle r = StdUtils.getWindowBounds("InstrumentsDbFrame");
339                  if(s == null) {                  if(r == null) {
340                          setDefaultSize();                          setDefaultSize();
341                          return;                          return;
342                  }                  }
343                                    
344                  try {                  setBounds(r);
                         int i = s.indexOf(',');  
                         int x = Integer.parseInt(s.substring(0, i));  
                           
                         s = s.substring(i + 1);  
                         i = s.indexOf(',');  
                         int y = Integer.parseInt(s.substring(0, i));  
                           
                         s = s.substring(i + 1);  
                         i = s.indexOf(',');  
                         int width = Integer.parseInt(s.substring(0, i));  
                           
                         s = s.substring(i + 1);  
                         int height = Integer.parseInt(s);  
                           
                         setBounds(x, y, width, height);  
                           
                         i = preferences().getIntProperty("InstrumentsDbFrame.dividerLocation");  
                         if(i != 0) splitPane.setDividerLocation(i);  
                           
                 } catch(Exception x) {  
                         String msg = "Parsing of window size and location string failed";  
                         CC.getLogger().log(Level.INFO, msg, x);  
                         setDefaultSize();  
                 }  
345                                    
346                  if(ClassicPrefs.getWindowMaximized("InstrumentsDbFrame"))                  if(ClassicPrefs.getWindowMaximized("InstrumentsDbFrame"))
347                          setExtendedState(getExtendedState() | MAXIMIZED_BOTH);                          setExtendedState(getExtendedState() | MAXIMIZED_BOTH);

Legend:
Removed from v.1785  
changed lines
  Added in v.1786

  ViewVC Help
Powered by ViewVC