| /*
An applet that uses VisualSim SDF simulator.
Copyright (c) 2002 Mirabilis Design Inc.
All rights reserved.
This source file, its machine readable form, and any representation
of the material contained herein are owned by Mirabilis Design.
These materials are proprietary and confidential and may not be
re-
produced in any form without the prior written permission of Mirabilis
Design.
MIRABILIS_COPYRIGHT_VERSION_1
COPYRIGHTENDKEY
@ProposedRating Red (sa@mirabilisdesign.com)
@AcceptedRating Red (tr@mirabilisdesign.com)
*/
package
demo.image_processing.HTVQ;
import
java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.event.*;
import java.util.Enumeration;
import java.lang.Math;
import java.net.URL;
import javax.swing.JPanel;
import javax.swing.JLabel;
import
VisualSim.kernel.*;
import VisualSim.kernel.util.*;
import VisualSim.data.*;
import VisualSim.data.expr.*;
import VisualSim.actor.*;
import VisualSim.actor.gui.*;
import VisualSim.actor.lib.*;
import VisualSim.actor.lib.gui.Display;
/**import demo.image_processing.*;*/
import VisualSim.simulators.sdf.kernel.*;
import VisualSim.simulators.sdf.lib.*;
import VisualSim.simulators.sdf.lib.vq.*;
import VisualSim.plot.*;
//////////////////////////////////////////////////////////////////////////
//// HTVQApplet
/**
An applet that uses VisualSim SDF simulator.
@author
Shankar Aiyar
@version $Id: HTVQApplet.java,v 1.25 2002/02/21 18:29:11 tr Exp
$
@since VisualSim 0.3
*/
public class HTVQApplet extends MoMLApplet {
///////////////////////////////////////////////////////////////////
//// public methods ////
/** Place the placeable objects in a customized panel.
*/
public void _createView() {
super._createView();
JPanel displayPanel = new JPanel();
getContentPane().add(displayPanel, BorderLayout.SOUTH);
// So that the background color comes through...
displayPanel.setBackground(null);
JPanel originalPanel = new JPanel();
displayPanel.add(originalPanel, BorderLayout.WEST);
JPanel compressedPanel = new JPanel();
displayPanel.add(compressedPanel, BorderLayout.CENTER);
JPanel prnPanel = new JPanel();
// So the background shows through.
prnPanel.setBackground(null);
prnPanel.setLayout(new BorderLayout());
prnPanel.add(new JLabel("SNR (dB)"), BorderLayout.NORTH);
displayPanel.add(prnPanel, BorderLayout.EAST);
CompositeEntity toplevel = (CompositeEntity)_toplevel;
ImageDisplay consumer = (ImageDisplay)toplevel.getEntity("Compressed");
consumer.place(compressedPanel);
consumer.setBackground(null);
ImageDisplay original = (ImageDisplay)toplevel.getEntity("Original");
original.place(originalPanel);
original.setBackground(null);
// Display actor puts the text at the right of the
// applet window. Text Area size is set to be 7*10 (row* column)
// in order to fit well with the image size.
Display prn = (Display)toplevel.getEntity("Display");
// To control the position, we put this in its own panel.
JPanel textPanel = new JPanel();
prnPanel.add(textPanel, BorderLayout.SOUTH);
prn.place(textPanel);
textPanel.setBackground(null);
}
}
|