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

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

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

revision 1317 by iliev, Fri Aug 10 19:55:03 2007 UTC revision 1318 by iliev, Sat Sep 1 13:46:04 2007 UTC
# Line 130  public class Channel extends org.jsample Line 130  public class Channel extends org.jsample
130           */           */
131          public          public
132          Channel(SamplerChannelModel model) {          Channel(SamplerChannelModel model) {
133                    this(model, null);
134            }
135            
136            /**
137             * Creates a new instance of <code>Channel</code> using the specified
138             * non-<code>null</code> channel model.
139             * @param model The model to be used by this channel.
140             * @param listener A listener which is notified when the newly created
141             * channel is fully expanded on the screen.
142             * @throws IllegalArgumentException If the model is <code>null</code>.
143             */
144            public
145            Channel(SamplerChannelModel model, final ActionListener listener) {
146                  super(model);                  super(model);
147                                    
148                  setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));                  setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
# Line 238  public class Channel extends org.jsample Line 251  public class Channel extends org.jsample
251                                    
252                  add(mainPane);                  add(mainPane);
253                                    
254                    if(listener != null) {
255                            final String s = JXCollapsiblePane.ANIMATION_STATE_KEY;
256                            mainPane.addPropertyChangeListener(s, new PropertyChangeListener() {
257                                    public void
258                                    propertyChange(PropertyChangeEvent e) {
259                                            if(e.getNewValue() == "expanded") {
260                                                    mainPane.removePropertyChangeListener(s, this);
261                                                    listener.actionPerformed(null);
262                                            }
263                                    }
264                            });
265                    }
266                    
267                  mainPane.setAnimated(false);                  mainPane.setAnimated(false);
268                  mainPane.setCollapsed(true);                  mainPane.setCollapsed(true);
269                  mainPane.setAnimated(preferences().getBoolProperty(ANIMATED));                  mainPane.setAnimated(preferences().getBoolProperty(ANIMATED));
# Line 249  public class Channel extends org.jsample Line 275  public class Channel extends org.jsample
275                                  mainPane.setAnimated(preferences().getBoolProperty(ANIMATED));                                  mainPane.setAnimated(preferences().getBoolProperty(ANIMATED));
276                          }                          }
277                  });                  });
278                    
279                    if(listener != null) {
280                            javax.swing.SwingUtilities.invokeLater(new Runnable() {
281                                    public void
282                                    run() { listener.actionPerformed(null); }
283                            });
284                    }
285          }          }
286                    
287          private JPanel          private JPanel

Legend:
Removed from v.1317  
changed lines
  Added in v.1318

  ViewVC Help
Powered by ViewVC