package diagapplet.plotter;
//******************************************************************************
// plotter.java: Applet
//
//******************************************************************************
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import java.util.*;
import diagapplet.utils.StandAloneApplet;
import diagapplet.utils.URLLoadInfoPanel;
import diagapplet.utils.CountList;
//==============================================================================
// Main Class for applet plotter
//
//==============================================================================
public class dplotter extends StandAloneApplet implements Runnable, Cloneable, MouseListener, AdjustmentListener, ActionListener, ItemListener
{
private String last_url_loaded = null;
static public boolean start_applet_after_creating_new_window = true;
static Vector dplotter_vector = new Vector();
private double last_user_set_x_scale = 100.0;
private static int max_points_per_plot = -1; // -1 = no limit
boolean just_zoomed_to_max = false;
Checkbox labelPointsCheckbox = null;
Checkbox keyCheckbox = null;
Button fitToGraphButton = null;
public boolean update_scale_needed = false;
boolean max_x_is_newest = false;
boolean min_x_is_newest = false;
boolean max_y_is_newest = false;
boolean min_y_is_newest = false;
static public final int MINIMUM_WIDTH = 540;
static public final int MINIMUM_HEIGHT = 240;
static public boolean load_params_on_init = true;
static public boolean load_params_on_start = true;
boolean even_zooms = false;
boolean load_url_needed = false;
public static int max_dplotter_num = 0;
public int dplotter_num;
String save_directory = null;
static public boolean debug_on = false;
GridBagLayout textPanelLayout = null;
TextField urlTextField = null;
Button loadButton = null;
Button browseButton = null;
Button saveButton = null;
public boolean need_resize = true;
String current_plot_name = null;
boolean TextAreaWasModified = true;
boolean TextIsUpToDate = false;
PlotData current_pd = null;
static Enumeration colors_enum = null;
static Color current_line_color = null;
static Color current_point_color = Color.cyan;
Button optPlotDeleteButton = null;
Checkbox optPlotShowCheckbox = null;
Button optPlotClearButton = null;
String current_panel_name = "Graph";
Panel textPanel = null;
TextArea textArea = null;
public boolean repaint_needed = true;
Button zoom_in_button = null;
Button zoom_out_button = null;
URLLoadInfoPanel load_info_panel = null;
public Hashtable options_hash_table = null;
static Hashtable colorsHashtable = null;
Hashtable reverseColorsHashtable = null;
Scrollbar vert_scroll_bar = null;
Scrollbar horz_scroll_bar = null;
public PlotGraph plot_graph = null;
FlowLayout main_layout = null;
Panel innerPanel = null;
GridBagLayout innerLayout = null;
Label title_label = null;
Choice optKeyGraphChoice = null;
Panel choicePanel = null;
CardLayout choicePanelLayout = null;
Panel graphPanel = null;
FlowLayout graphPanelLayout = null;
Panel graphInnerPanel = null;
GridBagLayout graphInnerLayout = null;
Panel optionsPanel = null;
Panel optionsInnerPanel = null;
FlowLayout optionsLayout = null;
GridBagLayout optionsInnerLayout = null;
Choice optChoice = null;
TextField optTextField = null;
Button optModifyButton = null;
boolean options_modified = true;
CountList optPlotsList = null;
int optPlotsListCount = 0;
static Color back_color = null;
static Color grid_color = null;
static Color zero_rad_color = null;
static Color axis_color= null;
static public boolean continous_update = false;
Button newWindowButton = null;
double radius_minimum = +1E9;
double radius_maximum = -1E9;
static public double user_specified_radius_offset = 0.0;
static public boolean use_user_specified_radius_offset=false;
// THREAD SUPPORT:
// m_plotter is the Thread object for the applet
//--------------------------------------------------------------------------
Thread m_plotter = null;
// PARAMETER SUPPORT:
// Parameters allow an HTML author to pass information to the applet;
// the HTML author specifies them using the tag within the