1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005 Grigor Kirilov Iliev |
* Copyright (C) 2005-2006 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
22 |
|
|
23 |
package org.jsampler.view; |
package org.jsampler.view; |
24 |
|
|
25 |
|
import java.awt.Dialog; |
26 |
import java.awt.Dimension; |
import java.awt.Dimension; |
27 |
|
import java.awt.Frame; |
28 |
|
|
29 |
import java.awt.event.WindowAdapter; |
import java.awt.event.WindowAdapter; |
30 |
import java.awt.event.WindowEvent; |
import java.awt.event.WindowEvent; |
41 |
import org.jsampler.event.SamplerChannelListEvent; |
import org.jsampler.event.SamplerChannelListEvent; |
42 |
import org.jsampler.event.SamplerChannelListListener; |
import org.jsampler.event.SamplerChannelListListener; |
43 |
|
|
44 |
|
|
45 |
/** |
/** |
46 |
* Defines the skeleton of a JSampler's main frame. |
* Defines the skeleton of a JSampler's main frame. |
47 |
* @author Grigor Iliev |
* @author Grigor Iliev |
74 |
} |
} |
75 |
|
|
76 |
/** |
/** |
77 |
|
* Invoked on startup when no JSampler home directory is specified |
78 |
|
* or the specified JSampler home directory doesn't exist. |
79 |
|
* This method should ask the user to specify a JSampler |
80 |
|
* home directory and then set the specified JSampler home directory using |
81 |
|
* {@link org.jsampler.CC#setJSamplerHome} method. |
82 |
|
* @see org.jsampler.CC#getJSamplerHome |
83 |
|
* @see org.jsampler.CC#setJSamplerHome |
84 |
|
*/ |
85 |
|
public abstract void installJSamplerHome(); |
86 |
|
|
87 |
|
/** |
88 |
|
* Shows a detailed error information about the specified exception. |
89 |
|
*/ |
90 |
|
public abstract void showDetailedErrorMessage(Frame owner, String err, String details); |
91 |
|
|
92 |
|
/** |
93 |
|
* Shows a detailed error information about the specified exception. |
94 |
|
*/ |
95 |
|
public abstract void showDetailedErrorMessage(Dialog owner, String err, String details); |
96 |
|
|
97 |
|
/** |
98 |
* Returns a list containing all <code>JSChannelsPane</code>s added to the view. |
* Returns a list containing all <code>JSChannelsPane</code>s added to the view. |
99 |
* @return A list containing all <code>JSChannelsPane</code>s added to the view. |
* @return A list containing all <code>JSChannelsPane</code>s added to the view. |
100 |
* @see #addChannelsPane |
* @see #addChannelsPane |
171 |
*/ |
*/ |
172 |
public void |
public void |
173 |
channelAdded(SamplerChannelListEvent e) { |
channelAdded(SamplerChannelListEvent e) { |
174 |
Integer id = e.getChannelModel().getChannelID(); |
Integer id = e.getChannelModel().getChannelId(); |
175 |
if(findChannel(id) != null) { |
if(findChannel(id) != null) { |
176 |
CC.getLogger().log(Level.WARNING, "JSMainFrame.channelExist!", id); |
CC.getLogger().log(Level.WARNING, "JSMainFrame.channelExist!", id); |
177 |
return; |
return; |
187 |
*/ |
*/ |
188 |
public void |
public void |
189 |
channelRemoved(SamplerChannelListEvent e) { |
channelRemoved(SamplerChannelListEvent e) { |
190 |
removeChannel(e.getChannelModel().getChannelID()); |
removeChannel(e.getChannelModel().getChannelId()); |
191 |
} |
} |
192 |
} |
} |
193 |
|
|
201 |
if(id < 0) return null; |
if(id < 0) return null; |
202 |
|
|
203 |
for(JSChannelsPane cp : getChannelsPaneList()) { |
for(JSChannelsPane cp : getChannelsPaneList()) { |
204 |
for(JSChannel c : cp.getChannels()) if(c.getChannelID() == id) return c; |
for(JSChannel c : cp.getChannels()) if(c.getChannelId() == id) return c; |
205 |
} |
} |
206 |
|
|
207 |
return null; |
return null; |
219 |
|
|
220 |
for(JSChannelsPane cp : getChannelsPaneList()) { |
for(JSChannelsPane cp : getChannelsPaneList()) { |
221 |
for(JSChannel c : cp.getChannels()) { |
for(JSChannel c : cp.getChannels()) { |
222 |
if(c.getChannelID() == id) { |
if(c.getChannelId() == id) { |
223 |
cp.removeChannel(c); |
cp.removeChannel(c); |
224 |
return c; |
return c; |
225 |
} |
} |
228 |
|
|
229 |
return null; |
return null; |
230 |
} |
} |
231 |
|
|
232 |
|
/** |
233 |
|
* Determines whether this view has instruments database support. |
234 |
|
* @return <code>true</code> |
235 |
|
*/ |
236 |
|
public boolean |
237 |
|
getInstrumentsDbSupport() { return false; } |
238 |
} |
} |