Methods Summary |
---|
public void | createModuleWrap(com.sun.media.BasicModule m, int row, int column, int h)
//System.err.println(m + " " + row + " " + column);
Object plugin = m;
if (m instanceof BasicSourceModule)
plugin = ((BasicSourceModule)m).getDemultiplexer();
else if (m instanceof BasicFilterModule)
plugin = ((BasicFilterModule)m).getCodec();
else if (m instanceof BasicRendererModule)
plugin = ((BasicRendererModule)m).getRenderer();
else if (m instanceof BasicMuxModule)
plugin = ((BasicMuxModule)m).getMultiplexer();
String name = ((PlugIn)plugin).getName();
//name = name.substring(name.lastIndexOf(".") + 1);
Button b = new ModButton(name, m, (PlugIn)plugin);
b.setName("M" + m.hashCode());
modList.addElement(b);
b.setBackground(new Color(192, 192, 128));
b.setForeground(Color.black);
center.add(b);
b.setBounds(offX + column * wrapWidth + fill,
offY + row * wrapHeight + fill,
wrapWidth - fill * 2, h * wrapHeight - fill * 2);
b.setVisible(true);
center.invalidate();
|
public synchronized void | dispose()
if (frame != null) {
frame.dispose();
frame = null;
}
|
public void | drawGraph(com.sun.media.BasicModule source)
Module m;
OutputConnector oc;
InputConnector ic;
String names[];
names = source.getOutputConnectorNames();
int height = names.length;
if (height == 0)
height = 1;
createModuleWrap(source, ro, col, height);
if (roMax < names.length)
roMax = names.length;
for (int i = 0; i < names.length; i++) {
oc = source.getOutputConnector(names[i]);
if ((ic = oc.getInputConnector()) == null) {
if (col == 0)
ro++;
continue;
}
if ((m = ic.getModule()) == null) {
if (col == 0)
ro++;
continue;
}
col++;
if (col > colMax)
colMax = col;
drawGraph((BasicModule)m);
col--;
if (col == 0)
ro++;
}
|
public com.sun.media.BasicJMD$Con | findConnector(com.sun.media.BasicModule bm, int index, int inOut)
String name = "C" + bm.hashCode() + index + inOut;
Enumeration e = conList.elements();
while (e.hasMoreElements()) {
Con c = (Con) e.nextElement();
if (c.getName().equals(name))
return c;
}
Component m = findModule(bm);
if (m == null)
return null;
Point p = m.getLocation();
Con c = new Con();
center.add(c);
c.setBounds(p.x - fill + (wrapWidth - fill) * inOut,
p.y + (wrapHeight-2*fill-cSize) / 2 + wrapHeight * index,
cSize, cSize);
c.setName(name);
conList.addElement(c);
return c;
|
public java.awt.Component | findModule(com.sun.media.BasicModule bm)
String name = "M" + bm.hashCode();
Enumeration e = modList.elements();
while (e.hasMoreElements()) {
Component c = (Component) e.nextElement();
if (c.getName().equals(name))
return c;
}
return null;
|
public java.awt.Component | getControlComponent()
if (button == null) {
button = new Button("PlugIn Viewer") {
public void removeNotify() {
super.removeNotify();
dispose();
}
};
button.setName("PlugIns");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
BasicJMD.this.setVisible( true );
}
} );
}
return button;
|
public void | initGraph(com.sun.media.BasicModule source)
center.removeAll();
modList = new Vector();
conList = new Vector();
drawGraph(source);
ro = 0;
col = 0;
preferredSize = new Dimension((colMax + 1) * wrapWidth + offX * 2,
(roMax) * wrapHeight + offY * 2);
//pack();
|
public void | moduleIn(com.sun.media.BasicModule bm, int index, javax.media.Buffer d, boolean here)
updateConnector(bm, index, d, here, 0);
|
public void | moduleOut(com.sun.media.BasicModule bm, int index, javax.media.Buffer d, boolean here)
updateConnector(bm, index, d, here, 1);
|
public synchronized void | setVisible(boolean visible)
if (getParent() == null) {
if (visible) {
if (frame == null) {
frame = new Frame("PlugIn Viewer");
frame.setLayout( new BorderLayout() );
frame.add("Center", this);
frame.addWindowListener(this);
frame.pack();
frame.setVisible(true);
}
}
} else if (getParent() == frame) {
frame.setVisible(visible);
} else
super.setVisible(visible);
|
public void | updateConnector(com.sun.media.BasicModule bm, int index, javax.media.Buffer d, boolean here, int inOut)
if (!activated)
return;
Con c = findConnector(bm, index, inOut);
if (c == null)
return;
c.setData(d);
// System.out.println("upd " + c.getName());
if (true) {
if (here) {
if (d.isEOM())
c.flash(Color.red);
else if (d.isDiscard())
c.flash(Color.yellow);
else
c.flash(Color.green);
} else
c.flash(Color.gray);
// c.repaint();
}
|
public void | windowActivated(java.awt.event.WindowEvent we)
activated = true;
|
public void | windowClosed(java.awt.event.WindowEvent we)
|
public void | windowClosing(java.awt.event.WindowEvent we)
setVisible(false);
|
public void | windowDeactivated(java.awt.event.WindowEvent we)
activated = false;
|
public void | windowDeiconified(java.awt.event.WindowEvent we)
|
public void | windowIconified(java.awt.event.WindowEvent we)
|
public void | windowOpened(java.awt.event.WindowEvent we)
|