www.pudn.com > 算法源码集合.rar > TextFrame.java


/* TextFrame.java */

import java.awt.*;
import java.net.*;

/**
 * This TextFrame class brings up a frame containing the text
 * panel. The class constructor is normally called during the initialization of
 * of a AlgAnimFrame instance.
 * 
 * @see TextPanel
 */
public class TextFrame extends Frame {
    private Scrollbar vScrollbar;
	private TransformPanel tp[];
	static final int n_tf = 6;
	IOPoint io;

    /**
     * Construct a text frame and initialize the text panel to be added to
     * the text frame. By default, this frame is going to be displayed
     * with its top-left corner at position (600,0). This can be changed
     * in the constructor according to preference.
     * @param sourceURL The URL of the algorithm source code to be display
     * on the text panel.
     */
  public TextFrame( URL sourceURL ) {
		int j, k, m;
		GridBagLayout lay = new GridBagLayout ();
		this.setLayout( lay );
		GridBagConstraints constraints = new GridBagConstraints();

		System.out.println( "TextFrame( URL ) constructor" );

		constraints.weightx = constraints.weighty = 1;
		constraints.gridx = constraints.gridy = 0;
		constraints.gridwidth = 1; constraints.gridheight = 1;
		constraints.fill = GridBagConstraints.HORIZONTAL;
		move(600, 0);
		setTitle("Transformations");
		m = 0;
		tp = new TransformPanel[n_tf*3];
		for(k=0;k