/*
 * $Id: JGridDemo.java,v 1.12 2003/09/16 19:05:41 dwd Exp $
 *
 * This software is provided by NOAA for full, free and open release.  It is
 * understood by the recipient/user that NOAA assumes no liability for any
 * errors contained in the code.  Although this software is released without
 * conditions or restrictions in its use, it is expected that appropriate
 * credit be given to its author and to the National Oceanic and Atmospheric
 * Administration should the software be included by the recipient as an
 * element in other product development.
 */
package sgtplot;



import java.awt.*;
import javax.swing.*;

import sgtplot.dm.SGTData;
import sgtplot.swing.JPlotLayout;
import sgtplot.util.Dimension2D;
import sgtplot.util.Range2D;
import sgtplot.util.Rectangle2D;
/**
 * 
 * Build a panel for DataMelt 
 * @author  Sergei Chekanov 
 */
public class SgtContour extends JPanel  {
  /**
	 * 
	 */
  private static final long serialVersionUID = 1L;
  private JPlotLayout rpl;
  private GridAttribute gridAttr;
  private SGTData newData;
  private int width;
  private int hight;
  private String name1;
  private String name2;  

  public  SgtContour(int width, int hight) {

    this.width=width;
    this.hight=hight;
    setLayout(new BorderLayout());
    rpl = new JPlotLayout(true, false, false, "JGridDemo", null, false);
    rpl.setEditClasses(true);
    name1=null;
    name2=null;
  }

  public  void buildVectors() {

     rpl = new JPlotLayout(JPlotLayout.VECTOR,
                     false, false, "test layout", null, false);

  }

   public  void setName1(String name1) {
    this.name1=name1;
   }

   public  void setName2(String name2) {
    this.name2=name2;
   }

 
  public  void buildPlot(boolean showBar) {

    rpl.setBatch(true);


    if (showBar == true) {
       rpl.setSize(new Dimension(width,hight));
       add(rpl, BorderLayout.CENTER);
    }


    if (showBar == false) {
    rpl.setSize(new Dimension(width,hight));
    add(rpl, BorderLayout.CENTER);
    }

    if (name1 != null && name2 != null) { 
    rpl.setTitles(name1,
                  name2,
                  "");
    } else if (name1 != null && name2 == null) {
     rpl.setTitles(name1,
                  "",
                  "");
    }


    rpl.setBatch(false);
   }



  public  JPlotLayout getPlot() {
   return rpl;
   }

} 

 

Ads help maintain this website.