ChartApplet1.java
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:58k
源码类别:

OA系统

开发平台:

Java

  1. // Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov  Date: 2002-12-03 18:41:49
  2. // Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
  3. // Decompiler options: packimports(3) 
  4. // Source File Name:   ChartApplet.java
  5. package cn.com.fcsoft.chart;
  6. import java.applet.Applet;
  7. import java.applet.AppletContext;
  8. import java.awt.*;
  9. import java.awt.event.*;
  10. import java.io.PrintStream;
  11. import java.net.MalformedURLException;
  12. import java.net.URL;
  13. import java.util.*;
  14. // Referenced classes of package com.objectplanet.chart:
  15. //            Chart, ChartSample, LineChartApplet, BarChartApplet, 
  16. //            PieChartApplet, NonFlickerPanel
  17. public abstract class ChartApplet extends Applet
  18.     implements Runnable, ItemListener, MouseMotionListener
  19. {
  20.     public void stop()
  21.     {
  22.         if(refreshThread != null)
  23.         {
  24.             refreshThread.stop();
  25.             refreshThread = null;
  26.         }
  27.     }
  28.     protected Color[] getColorValues(String s)
  29.     {
  30.         Color acolor[] = null;
  31.         if(s != null)
  32.         {
  33.             StringTokenizer stringtokenizer = new StringTokenizer(s, ",");
  34.             acolor = new Color[stringtokenizer.countTokens()];
  35.             for(int i = 0; i < acolor.length; i++)
  36.                 if(stringtokenizer.hasMoreTokens())
  37.                     acolor[i] = createColor(stringtokenizer.nextToken().trim());
  38.         }
  39.         return acolor;
  40.     }
  41.     private URL getSampleURL(int i, int j, int k)
  42.     {
  43.         String s = createURLParam("url", j, k);
  44.         URL url = (URL)urlList.get(s);
  45.         if(url == null)
  46.         {
  47.             String s1;
  48.             if(i > 1)
  49.                 s1 = createURLParam("url", j, -1);
  50.             else
  51.                 s1 = createURLParam("url", -1, k);
  52.             url = (URL)urlList.get(s1);
  53.         }
  54.         if(url == null)
  55.             url = (URL)urlList.get(createURLParam("url", -1, -1));
  56.         return url;
  57.     }
  58.     public void reset()
  59.     {
  60.         urlList = new Hashtable();
  61.         urlTargetList = new Hashtable();
  62.         HAND_CURSOR = new Cursor(12);
  63.         POINT_CURSOR = new Cursor(0);
  64.         lastSelectedSample = -1;
  65.         lastSelectedSeries = -1;
  66.         theChart.reset();
  67.     }
  68.     public void mouseDragged(MouseEvent mouseevent)
  69.     {
  70.     }
  71.     public ChartApplet()
  72.     {
  73.         labelDelimiter = ",";
  74.         automaticRefreshTime = 2500;
  75.         rangeStep = new double[2];
  76.         theChart = createChart(null);
  77.         overlayChartApplets = new Vector();
  78.         prefix = "";
  79.         setLayout(new BorderLayout());
  80.         theChart.addItemListener(this);
  81.         theChart.addMouseMotionListener(this);
  82.     }
  83.     public void itemStateChanged(ItemEvent itemevent)
  84.     {
  85.         ChartSample chartsample = (ChartSample)itemevent.getItem();
  86.         Chart chart = (Chart)itemevent.getSource();
  87.         if(itemevent.getStateChange() == 1 && chartsample != null && chart != null)
  88.         {
  89.             int i = chart.getSeriesCount();
  90.             int j = chartsample.getIndex();
  91.             int k = chartsample.getSeries();
  92.             long l = System.currentTimeMillis();
  93.             boolean flag = j == lastSelectedSample && k == lastSelectedSeries;
  94.             if(flag && l - lastSelectedTime < 350L)
  95.             {
  96.                 URL url = getSampleURL(i, k, j);
  97.                 if(url != null)
  98.                 {
  99.                     String s = createURLParam("urltarget", k, j);
  100.                     String s2 = (String)urlTargetList.get(s);
  101.                     if(s2 == null)
  102.                     {
  103.                         String s1;
  104.                         if(i > 1)
  105.                             s1 = createURLParam("urltarget", k, -1);
  106.                         else
  107.                             s1 = createURLParam("urltarget", -1, j);
  108.                         s2 = (String)urlTargetList.get(s1);
  109.                     }
  110.                     if(s2 == null)
  111.                         s2 = (String)urlTargetList.get("urltarget");
  112.                     AppletContext appletcontext = getAppletContext();
  113.                     if(appletcontext != null)
  114.                         appletcontext.showDocument(url, s2);
  115.                 }
  116.             }
  117.             lastSelectedSample = j;
  118.             lastSelectedSeries = k;
  119.             lastSelectedTime = l;
  120.         }
  121.     }
  122.     public void mouseMoved(MouseEvent mouseevent)
  123.     {
  124.         if(urlList.size() == 0)
  125.             return;
  126.         Chart chart = (Chart)mouseevent.getSource();
  127.         ChartSample chartsample = chart.checkSelection(new Point(mouseevent.getX(), mouseevent.getY()));
  128.         int i = chart.getSeriesCount();
  129.         Cursor cursor = POINT_CURSOR;
  130.         if(chartsample != null)
  131.         {
  132.             URL url = getSampleURL(i, chartsample.getSeries(), chartsample.getIndex());
  133.             if(url != null)
  134.                 cursor = HAND_CURSOR;
  135.         }
  136.         setCursor(cursor);
  137.     }
  138.     private boolean shouldSet(String s, boolean flag)
  139.     {
  140.         String s1 = getParameter(s);
  141.         return s1 != null && s1.trim().length() > 0 || flag;
  142.     }
  143.     static String convertLineBreaks(String s)
  144.     {
  145.         if(s == null)
  146.             return null;
  147.         char ac[] = s.toCharArray();
  148.         char ac1[] = new char[ac.length];
  149.         int i = 0;
  150.         for(int j = 0; j < ac.length; j++)
  151.             if(j < ac.length - 1 && ac[j] == '\' && ac[j + 1] == 'n')
  152.             {
  153.                 ac1[i++] = 'n';
  154.                 j++;
  155.             } else
  156.             {
  157.                 ac1[i++] = ac[j];
  158.             }
  159.         return new String(ac1, 0, i);
  160.     }
  161.     private static int getFontType(String s)
  162.     {
  163.         s = s.toLowerCase().trim();
  164.         if(s.equals("bold"))
  165.             return 1;
  166.         if(s.equals("italic"))
  167.             return 2;
  168.         return !s.equals("bolditalic") && !s.equals("italicbold") ? 0 : 3;
  169.     }
  170.     public void setParentApplet(Applet applet)
  171.     {
  172.         if(applet == this)
  173.             applet = null;
  174.         parentApplet = applet;
  175.     }
  176.     protected static Color createColor(String s)
  177.     {
  178.         if(s == null || s.length() == 0)
  179.             return null;
  180.         if(s.indexOf(",") >= 0)
  181.         {
  182.             StringTokenizer stringtokenizer = new StringTokenizer(s, ", ");
  183.             try
  184.             {
  185.                 return new Color(Integer.parseInt(stringtokenizer.nextToken()), Integer.parseInt(stringtokenizer.nextToken()), Integer.parseInt(stringtokenizer.nextToken()));
  186.             }
  187.             catch(Exception _ex)
  188.             {
  189.                 System.out.println("Invalid RGB color: " + s);
  190.             }
  191.         } else
  192.         if(s.startsWith("#"))
  193.         {
  194.             try
  195.             {
  196.                 return new Color(Integer.parseInt(s.substring(1, 3), 16), Integer.parseInt(s.substring(3, 5), 16), Integer.parseInt(s.substring(5, 7), 16));
  197.             }
  198.             catch(Exception _ex)
  199.             {
  200.                 System.out.println("Invalid hex color: " + s);
  201.             }
  202.         } else
  203.         {
  204.             s = s.toLowerCase();
  205.             if(s.equals("black"))
  206.                 return Color.black;
  207.             if(s.equals("blue"))
  208.                 return Color.blue;
  209.             if(s.equals("cyan"))
  210.                 return Color.cyan;
  211.             if(s.equals("darkgray"))
  212.                 return Color.darkGray;
  213.             if(s.equals("gray"))
  214.                 return Color.gray;
  215.             if(s.equals("green"))
  216.                 return Color.green;
  217.             if(s.equals("lightgray"))
  218.                 return Color.lightGray;
  219.             if(s.equals("magenta"))
  220.                 return Color.magenta;
  221.             if(s.equals("orange"))
  222.                 return Color.orange;
  223.             if(s.equals("pink"))
  224.                 return Color.pink;
  225.             if(s.equals("red"))
  226.                 return Color.red;
  227.             if(s.equals("white"))
  228.                 return Color.white;
  229.             if(s.equals("yellow"))
  230.                 return Color.yellow;
  231.             System.out.println("Invalid color name: " + s);
  232.         }
  233.         return null;
  234.     }
  235.     protected void setRangeParameters(boolean flag)
  236.     {
  237.         if(shouldSet(prefix + "rangeStep", flag))
  238.             setParameter("rangeStep", getParameter(prefix + "rangeStep"));
  239.         if(shouldSet(prefix + "range", flag))
  240.             setParameter("range", getParameter(prefix + "range"));
  241.         if(shouldSet(prefix + "lowerRange", flag))
  242.             setParameter("lowerRange", getParameter(prefix + "lowerRange"));
  243.         setParameter("rangeOn_2", getParameter(prefix + "rangeOn_2"));
  244.         if(shouldSet(prefix + "rangeStep_2", flag))
  245.             setParameter("rangeStep_2", getParameter(prefix + "rangeStep_2"));
  246.         if(shouldSet(prefix + "range_2", flag))
  247.             setParameter("range_2", getParameter(prefix + "range_2"));
  248.         if(shouldSet(prefix + "lowerRange_2", flag))
  249.             setParameter("lowerRange_2", getParameter(prefix + "lowerRange_2"));
  250.         initParameter("rangeAdjusterOn", getParameter(prefix + "rangeAdjusterOn"));
  251.         initParameter("rangeAdjusterOn_2", getParameter(prefix + "rangeAdjusterOn_2"));
  252.     }
  253.     public void setParameterPrefix(String s)
  254.     {
  255.         prefix = s == null ? "" : s;
  256.     }
  257.     public String getParameterPrefix()
  258.     {
  259.         return prefix;
  260.     }
  261.     protected abstract Chart createChart(String s);
  262.     public void start()
  263.     {
  264.         if(automaticRefreshTime > 0)
  265.         {
  266.             refreshThread = new Thread(this);
  267.             refreshThread.start();
  268.         }
  269.     }
  270.     private void initParameter(String s, String s1)
  271.     {
  272.         if(s1 != null)
  273.             setParameter(s, s1);
  274.     }
  275.     protected static Double[] getDoubleValues(String s)
  276.     {
  277.         Double adouble[] = null;
  278.         if(s != null && !s.equals(""))
  279.         {
  280.             boolean flag = s.trim().startsWith(",");
  281.             StringTokenizer stringtokenizer = new StringTokenizer(s, ",");
  282.             adouble = new Double[stringtokenizer.countTokens() + (flag ? 1 : 0)];
  283.             for(int i = flag ? 1 : 0; i < adouble.length; i++)
  284.                 try
  285.                 {
  286.                     adouble[i] = new Double(stringtokenizer.nextToken());
  287.                 }
  288.                 catch(NumberFormatException _ex) { }
  289.         }
  290.         return adouble;
  291.     }
  292.     protected String[] getStringValues(String s)
  293.     {
  294.         String as[] = null;
  295.         if(s != null)
  296.         {
  297.             boolean flag = s.trim().startsWith(labelDelimiter);
  298.             StringTokenizer stringtokenizer = new StringTokenizer(s, labelDelimiter);
  299.             as = new String[stringtokenizer.countTokens() + (flag ? 1 : 0)];
  300.             for(int i = flag ? 1 : 0; i < as.length; i++)
  301.                 as[i] = stringtokenizer.nextToken();
  302.         }
  303.         return as;
  304.     }
  305.     public void setParameter(String s, String s1)
  306.     {
  307.         if(s == null || theChart == null)
  308.             return;
  309.         s = s.toLowerCase();
  310.         if(s.startsWith("series") && s.endsWith("_values"))
  311.             try
  312.             {
  313.                 int i = Integer.parseInt(s.substring(6, s.indexOf("_values")));
  314.                 s = "sampleValues_" + i;
  315.             }
  316.             catch(NumberFormatException _ex) { }
  317.         if(s.equals("width"))
  318.         {
  319.             if(s1 != null && s1.trim().length() > 0)
  320.                 try
  321.                 {
  322.                     int j = Integer.parseInt(s1.trim());
  323.                     setSize(j, theChart.getSize().height);
  324.                     theChart.setSize(j, theChart.getSize().height);
  325.                 }
  326.                 catch(NumberFormatException _ex)
  327.                 {
  328.                     System.out.println("Invalid width: " + s1);
  329.                 }
  330.         } else
  331.         if(s.equals("height"))
  332.         {
  333.             if(s1 != null && s1.trim().length() > 0)
  334.                 try
  335.                 {
  336.                     int k = Integer.parseInt(s1.trim());
  337.                     setSize(theChart.getSize().width, k);
  338.                     theChart.setSize(theChart.getSize().width, k);
  339.                 }
  340.                 catch(NumberFormatException _ex)
  341.                 {
  342.                     System.out.println("Invalid height: " + s1);
  343.                 }
  344.         } else
  345.         if(s.equals("samplevalues"))
  346.         {
  347.             Double adouble[] = getDoubleValues(s1);
  348.             if(adouble != null && s1.trim().length() > 0)
  349.             {
  350.                 int i5 = theChart.getSampleCount();
  351.                 for(int k6 = 0; k6 < i5; k6++)
  352.                     if(k6 < adouble.length && adouble[k6] != null)
  353.                     {
  354.                         theChart.setSampleValue(0, k6, adouble[k6].doubleValue());
  355.                     } else
  356.                     {
  357.                         ChartSample chartsample = theChart.getSample(0, k6);
  358.                         if(chartsample != null)
  359.                             chartsample.clearValue();
  360.                     }
  361.             }
  362.         } else
  363.         if(s.equals("samplecount"))
  364.         {
  365.             if(s1 != null && s1.trim().length() > 0)
  366.                 try
  367.                 {
  368.                     theChart.setSampleCount(Math.max(0, Integer.parseInt(s1.trim())));
  369.                 }
  370.                 catch(NumberFormatException _ex)
  371.                 {
  372.                     System.out.println("Invalid sampleCount: " + s1);
  373.                 }
  374.         } else
  375.         if(s.equals("samplecolors"))
  376.         {
  377.             if(s1 != null && s1.trim().length() > 0)
  378.             {
  379.                 Color acolor[] = getColorValues(s1);
  380.                 theChart.setSampleColors(acolor);
  381.             } else
  382.             {
  383.                 theChart.setSampleColors(null);
  384.             }
  385.         } elsen 
  386.         if(s.equals("legendcolors"))
  387.         {
  388.             if(s1 != null && s1.trim().length() > 0)
  389.             {
  390.                 Color acolor1[] = getColorValues(s1);
  391.                 theChart.setLegendColors(acolor1);
  392.             } else
  393.             {
  394.                 theChart.setLegendColors(null);
  395.             }
  396.         } else
  397.         if(s.equals("seriescount"))
  398.         {
  399.             if(s1 != null && s1.trim().length() > 0)
  400.                 try
  401.                 {
  402.                     theChart.setSeriesCount(Math.max(1, Integer.parseInt(s1.trim())));
  403.                 }
  404.                 catch(NumberFormatException _ex)
  405.                 {
  406.                     System.out.println("Invalid seriesCount: " + s1);
  407.                 }
  408.             else
  409.                 theChart.setSeriesCount(1);
  410.         } else
  411.         if(s.startsWith("samplevalues_"))
  412.             try
  413.             {
  414.                 int l = Integer.parseInt(s.substring(13));
  415.                 if(l >= 0 && l < theChart.getSeriesCount())
  416.                 {
  417.                     Double adouble3[] = getDoubleValues(s1);
  418.                     int l6 = theChart.getSampleCount();
  419.                     for(int i8 = 0; i8 < l6; i8++)
  420.                         if(adouble3 != null && i8 < adouble3.length && adouble3[i8] != null)
  421.                         {
  422.                             theChart.setSampleValue(l, i8, adouble3[i8].doubleValue());
  423.                         } else
  424.                         {
  425.                             ChartSample chartsample1 = theChart.getSample(l, i8);
  426.                             if(chartsample1 != null)
  427.                                 chartsample1.clearValue();
  428.                         }
  429.                 }
  430.             }
  431.             catch(NumberFormatException _ex)
  432.             {
  433.                 System.out.println("Invalid series index: " + s1);
  434.             }
  435.         else
  436.         if(s.startsWith("seriesrange_"))
  437.             try
  438.             {
  439.                 int i1 = Integer.parseInt(s.substring(12));
  440.                 if(i1 >= 0 && i1 < theChart.getSeriesCount())
  441.                     if(s1 != null && s1.length() > 0)
  442.                         try
  443.                         {
  444.                             int j5 = Integer.parseInt(s1.trim());
  445.                             j5 = j5 != 2 ? 0 : 1;
  446.                             theChart.setSeriesRange(i1, j5);
  447.                         }
  448.                         catch(NumberFormatException _ex)
  449.                         {
  450.                             System.out.println("Invalid range index: " + s + " " + s1);
  451.                         }
  452.                     else
  453.                         theChart.setSeriesRange(i1, 0);
  454.             }
  455.             catch(NumberFormatException _ex)
  456.             {
  457.                 System.out.println("Invalid series index: " + s + " " + s1);
  458.             }
  459.         else
  460.         if(s.startsWith("rangestep"))
  461.         {
  462.             int j1 = s.equals("rangestep_2") ? 1 : 0;
  463.             try
  464.             {
  465.                 if(s1 != null && s1.trim().length() > 0)
  466.                 {
  467.                     rangeStep[j1] = (new Double(s1.trim())).doubleValue();
  468.                     rangeStep[j1] = Math.abs(rangeStep[j1]);
  469.                     theChart.setRelativeRange(j1, 1.0D, rangeStep[j1]);
  470.                     theChart.setLowerRelativeRange(j1, 1.0D, rangeStep[j1]);
  471.                 } else
  472.                 {
  473.                     rangeStep[j1] = -1D;
  474.                     theChart.setRelativeRangeIndex(j1, 1.0D);
  475.                     theChart.setLowerRelativeRangeIndex(j1, 1.0D);
  476.                 }
  477.             }
  478.             catch(NumberFormatException _ex)
  479.             {
  480.                 System.out.println("Invalid rangeStep: " + s1);
  481.                 rangeStep[j1] = -1D;
  482.                 theChart.setLowerRelativeRange(1.0D);
  483.             }
  484.         } else
  485.         if(s.equals("range") || s.equals("range_2"))
  486.         {
  487.             int k1 = s.equals("range_2") ? 1 : 0;
  488.             try
  489.             {
  490.                 if(s1 != null && s1.trim().length() > 0)
  491.                     theChart.setRange(k1, (new Double(s1.trim())).doubleValue());
  492.                 else
  493.                 if(rangeStep[k1] > -1D)
  494.                     theChart.setRelativeRange(k1, 1.0D, rangeStep[k1]);
  495.                 else
  496.                     theChart.setRelativeRangeIndex(k1, 1.0D);
  497.             }
  498.             catch(NumberFormatException _ex)
  499.             {
  500.                 System.out.println("Invalid range: " + s1);
  501.                 if(rangeStep[k1] != -1D)
  502.                     theChart.setRelativeRange(k1, 1.0D, rangeStep[k1]);
  503.                 else
  504.                     theChart.setRelativeRangeIndex(k1, 1.0D);
  505.             }
  506.         } else
  507.         if(s.equals("lowerrange") || s.equals("lowerrange_2"))
  508.         {
  509.             int l1 = s.equals("lowerrange_2") ? 1 : 0;
  510.             try
  511.             {
  512.                 if(s1 != null && s1.trim().length() > 0)
  513.                     theChart.setLowerRange(l1, (new Double(s1.trim())).doubleValue());
  514.                 else
  515.                 if(rangeStep[l1] != -1D)
  516.                     theChart.setLowerRelativeRange(l1, 1.0D, rangeStep[l1]);
  517.                 else
  518.                     theChart.setLowerRelativeRangeIndex(l1, 1.0D);
  519.             }
  520.             catch(NumberFormatException _ex)
  521.             {
  522.                 System.out.println("Invalid lowerRange: " + s1);
  523.                 if(rangeStep[l1] > -1D)
  524.                     theChart.setLowerRelativeRange(l1, 1.0D, rangeStep[l1]);
  525.                 else
  526.                     theChart.setLowerRelativeRangeIndex(l1, 1.0D);
  527.             }
  528.         } else
  529.         if(s.startsWith("rangeon"))
  530.         {
  531.             int i2 = s.equals("rangeon_2") ? 1 : 0;
  532.             if(s1 != null && s1.trim().length() > 0)
  533.                 theChart.setRangeOn(i2, s1.trim().toLowerCase().equals("true"));
  534.         } else
  535.         if(s.startsWith("rangecolor"))
  536.         {
  537.             int j2 = s.equals("rangecolor_2") ? 1 : 0;
  538.             if(s1 != null && s1.trim().length() > 0)
  539.                 theChart.setRangeColor(j2, createColor(s1));
  540.         } else
  541.         if(s.startsWith("rangeposition"))
  542.         {
  543.             int k2 = s.equals("rangeposition_2") ? 1 : 0;
  544.             if(s1 != null && s1.length() > 0)
  545.             {
  546.                 s1 = s1.trim().toLowerCase();
  547.                 if(s1.equals("right") || s1.equals("top"))
  548.                     theChart.setRangePosition(k2, 1);
  549.                 else
  550.                     theChart.setRangePosition(k2, 0);
  551.             }
  552.         } else
  553.         if(s.startsWith("rangeadjusteron"))
  554.         {
  555.             int l2 = s.equals("rangeadjusteron_2") ? 1 : 0;
  556.             theChart.setRangeAdjusterOn(l2, s1.trim().toLowerCase().equals("true"));
  557.         } else
  558.         if(s.startsWith("rangeadjusterposition"))
  559.         {
  560.             int i3 = s.equals("rangeadjusterposition_2") ? 1 : 0;
  561.             if(s1 != null && s1.length() > 0)
  562.             {
  563.                 s1 = s1.trim().toLowerCase();
  564.                 if(s1.equals("right") || s1.equals("top"))
  565.                     theChart.setRangeAdjusterPosition(i3, 1);
  566.                 else
  567.                     theChart.setRangeAdjusterPosition(i3, 0);
  568.             }
  569.         } else
  570.         if(s.startsWith("rangeadjusted_"))
  571.         {
  572.             int j3 = s.equals("rangeadjusted_2") ? 1 : 0;
  573.             if(s1 != null && s1.length() > 0)
  574.                 if(s1.trim().equals("1"))
  575.                     theChart.setRangeAdjusted(j3, 0);
  576.                 else
  577.                 if(s1.trim().equals("2"))
  578.                     theChart.setRangeAdjusted(j3, 1);
  579.                 else
  580.                     theChart.setRangeAdjusted(j3, 2);
  581.         } else
  582.         if(s.startsWith("rangedecimalcount"))
  583.         {
  584.             int k3 = s.equals("rangedecimalcount_2") ? 1 : 0;
  585.             try
  586.             {
  587.                 if(s1 != null && s1.trim().length() > 0)
  588.                     theChart.setRangeDecimalCount(k3, Integer.parseInt(s1.trim()));
  589.                 else
  590.                     theChart.setRangeDecimalCount(k3, 0);
  591.             }
  592.             catch(NumberFormatException _ex)
  593.             {
  594.                 System.out.println("Invalid " + s + ": " + s1);
  595.                 theChart.setRangeDecimalCount(k3, 0);
  596.             }
  597.         } else
  598.         if(s.equals("labeldelimiter"))
  599.         {
  600.             if(s1 != null && s1.trim().length() > 0)
  601.                 labelDelimiter = s1;
  602.             else
  603.                 labelDelimiter = ",";
  604.         } else
  605.         if(s.equals("serieslabels"))
  606.             theChart.setSeriesLabels(getStringValues(convertLineBreaks(s1)));
  607.         else
  608.         if(s.equals("serieslabelcolors"))
  609.         {
  610.             Color acolor2[] = getColorValues(s1);
  611.             int k5 = theChart.getSeriesCount();
  612.             for(int i7 = 0; i7 < k5; i7++)
  613.                 if(acolor2 != null && i7 < acolor2.length)
  614.                     theChart.setSeriesLabelColor(i7, acolor2[i7]);
  615.                 else
  616.                     theChart.setSeriesLabelColor(i7, null);
  617.         } else
  618.         if(s.equals("samplelabels"))
  619.             theChart.setSampleLabels(getStringValues(convertLineBreaks(s1)));
  620.         else
  621.         if(s.equals("samplelabelcolors"))
  622.         {
  623.             Color acolor3[] = getColorValues(s1);
  624.             int l5 = theChart.getSampleCount();
  625.             for(int j7 = 0; j7 < l5; j7++)
  626.                 if(acolor3 != null && j7 < acolor3.length)
  627.                     theChart.setSampleLabelColor(j7, acolor3[j7]);
  628.                 else
  629.                     theChart.setSampleLabelColor(j7, null);
  630.         } else
  631.         if(s.equals("legendlabels"))
  632.         {
  633.             theChart.setLegendLabels(null);
  634.             if(s1 != null && s1.trim().length() > 0)
  635.             {
  636.                 String as[] = getStringValues(convertLineBreaks(s1));
  637.                 if(as.length > 1)
  638.                     theChart.setLegendLabels(as);
  639.                 else
  640.                 if(as.length == 1 && as[0] != null)
  641.                     if(as[0].trim().toLowerCase().equals("samplelabels"))
  642.                         theChart.setLegendLabels(theChart.getSampleLabels());
  643.                     else
  644.                     if(as[0].trim().toLowerCase().equals("serieslabels"))
  645.                         theChart.setLegendLabels(theChart.getSeriesLabels());
  646.                     else
  647.                         theChart.setLegendLabels(as);
  648.             }
  649.         } else
  650.         if(s.startsWith("valuelabelson"))
  651.         {
  652.             if(s.equals("valuelabelson"))
  653.                 theChart.setValueLabelsOn(-1, s1 != null && s1.trim().toLowerCase().equals("true"));
  654.             else
  655.             if(s.startsWith("valuelabelson_"))
  656.                 try
  657.                 {
  658.                     int l3 = Integer.parseInt(s.substring(14));
  659.                     if(l3 >= 0 && l3 < theChart.getSeriesCount())
  660.                         theChart.setValueLabelsOn(l3, s1 != null && s1.trim().toLowerCase().equals("true"));
  661.                 }
  662.                 catch(NumberFormatException _ex)
  663.                 {
  664.                     System.out.println("Invalid " + s + " " + s1);
  665.                 }
  666.         } else
  667.         if(s.startsWith("valuelabelprefix") || s.startsWith("valuelabelpostfix"))
  668.             theChart.setLabel(s, convertLineBreaks(s1));
  669.         else
  670.         if(s.startsWith("sampledecimalcount"))
  671.             try
  672.             {
  673.                 if(s.equals("sampledecimalcount"))
  674.                 {
  675.                     if(s1 != null && s1.trim().length() > 0)
  676.                         theChart.setSampleDecimalCount(-1, Integer.parseInt(s1.trim()));
  677.                     else
  678.                         theChart.setSampleDecimalCount(-1, 0);
  679.                 } else
  680.                 if(s.startsWith("sampledecimalcount_"))
  681.                 {
  682.                     int i4 = Integer.parseInt(s.substring(19));
  683.                     if(i4 >= 0 && i4 < theChart.getSeriesCount())
  684.                         if(s1 != null && s1.trim().length() > 0)
  685.                             theChart.setSampleDecimalCount(i4, Integer.parseInt(s1.trim()));
  686.                         else
  687.                             theChart.setSampleDecimalCount(i4, 0);
  688.                 }
  689.             }
  690.             catch(NumberFormatException _ex)
  691.             {
  692.                 System.out.println("Invalid " + s + " " + s1);
  693.             }
  694.         else
  695.         if(s.equals("charttitle") || s.equals("title"))
  696.         {
  697.             theChart.setTitle(convertLineBreaks(s1));
  698.             theChart.setTitleOn(s1 != null && s1.length() > 0);
  699.         } else
  700.         if(s.equals("legendon"))
  701.             theChart.setLegendOn(s1 != null && s1.trim().toLowerCase().equals("true"));
  702.         else
  703.         if(s.equals("legendposition"))
  704.         {
  705.             theChart.setLegendPosition(1);
  706.             if(s1 != null && s1.trim().length() > 0)
  707.             {
  708.                 s1 = s1.toLowerCase();
  709.                 if(s1.equals("right"))
  710.                     theChart.setLegendPosition(1);
  711.                 else
  712.                 if(s1.equals("top"))
  713.                     theChart.setLegendPosition(2);
  714.                 else
  715.                 if(s1.equals("bottom"))
  716.                     theChart.setLegendPosition(3);
  717.                 else
  718.                 if(s1.equals("left"))
  719.                     theChart.setLegendPosition(0);
  720.                 else
  721.                     System.out.println("Invalid legendPosition: " + s1);
  722.             }
  723.         } else
  724.         if(s.equals("automaticrefreshtime"))
  725.             try
  726.             {
  727.                 if(s1 != null && s1.trim().length() > 0)
  728.                     automaticRefreshTime = Math.max(100, Integer.parseInt(s1));
  729.                 else
  730.                     automaticRefreshTime = 0x36ee80;
  731.             }
  732.             catch(NumberFormatException _ex)
  733.             {
  734.                 System.out.println("Invalid automaticRefreshTime: " + s1);
  735.                 automaticRefreshTime = 0x36ee80;
  736.             }
  737.         else
  738.         if(s.equals("3dmodeon"))
  739.             theChart.set3DModeOn(s1 != null && s1.toLowerCase().equals("true"));
  740.         else
  741.         if(s.equals("3ddepth"))
  742.         {
  743.             theChart.set3DDepth(-1);
  744.             if(s1 != null && s1.trim().length() > 0)
  745.                 try
  746.                 {
  747.                     int j4 = Integer.parseInt(s1.trim());
  748.                     theChart.set3DDepth(j4);
  749.                 }
  750.                 catch(NumberFormatException _ex)
  751.                 {
  752.                     System.out.println("Invalid 3DDepth: " + s1);
  753.                 }
  754.         } else
  755.         if(s.equals("foreground"))
  756.         {
  757.             if(s1 != null && s1.trim().length() > 0)
  758.             {
  759.                 Color color = createColor(s1);
  760.                 if(color != null)
  761.                     theChart.setForeground(color);
  762.                 else
  763.                     theChart.setForeground(Color.black);
  764.             } else
  765.             {
  766.                 theChart.setForeground(Color.black);
  767.             }
  768.         } else
  769.         if(s.equals("background"))
  770.         {
  771.             if(s1 != null && s1.trim().length() > 0)
  772.             {
  773.                 Color color1 = createColor(s1);
  774.                 if(color1 != null)
  775.                     theChart.setBackground(color1);
  776.                 else
  777.                     theChart.setBackground(new Color(231, 221, 231));
  778.             } else
  779.             {
  780.                 theChart.setBackground(new Color(231, 221, 231));
  781.             }
  782.         } else
  783.         if(s.equals("chartforeground"))
  784.         {
  785.             if(s1 != null && s1.trim().length() > 0)
  786.             {
  787.                 Color color2 = createColor(s1);
  788.                 if(color2 != null)
  789.                     theChart.setChartForeground(color2);
  790.                 else
  791.                     theChart.setChartForeground(Color.black);
  792.             } else
  793.             {
  794.                 theChart.setChartForeground(Color.black);
  795.             }
  796.         } else
  797.         if(s.equals("chartbackground"))
  798.         {
  799.             if(s1 != null && s1.trim().length() > 0)
  800.             {
  801.                 Color color3 = createColor(s1);
  802.                 if(color3 != null)
  803.                     theChart.setChartBackground(color3);
  804.                 else
  805.                     theChart.setChartBackground(Color.white);
  806.             } else
  807.             {
  808.                 theChart.setChartBackground(Color.white);
  809.             }
  810.         } else
  811.         if(s.equals("titlefont"))
  812.         {
  813.             if(s1 != null && s1.trim().length() > 0)
  814.                 theChart.setFont("titleFont", createFont(s1, "Dialog", 1, 14));
  815.             else
  816.                 theChart.setFont("titleFont", new Font("Dialog", 1, 14));
  817.         } else
  818.         if(s.equals("font"))
  819.         {
  820.             if(s1 != null && s1.trim().length() > 0)
  821.                 theChart.setFont(createFont(s1, "Arial", 0, 11));
  822.             else
  823.                 theChart.setFont(new Font("Arial", 0, 11));
  824.         } else
  825.         if(s.endsWith("font"))
  826.         {
  827.             if(s1 != null && s1.trim().length() > 0)
  828.                 theChart.setFont(s, createFont(s1, "Arial", 0, 11));
  829.             else
  830.                 theChart.setFont(s, null);
  831.         } else
  832.         if(s.equals("graphinsets"))
  833.         {
  834.             if(s1 != null && s1.trim().length() > 0)
  835.             {
  836.                 StringTokenizer stringtokenizer = new StringTokenizer(s1.trim(), ",");
  837.                 int i6 = -1;
  838.                 int k7 = -1;
  839.                 int j8 = -1;
  840.                 int k8 = -1;
  841.                 try
  842.                 {
  843.                     if(stringtokenizer.hasMoreTokens())
  844.                         i6 = Integer.parseInt(((String)stringtokenizer.nextElement()).trim());
  845.                     if(stringtokenizer.hasMoreTokens())
  846.                         k7 = Integer.parseInt(((String)stringtokenizer.nextElement()).trim());
  847.                     if(stringtokenizer.hasMoreTokens())
  848.                         j8 = Integer.parseInt(((String)stringtokenizer.nextElement()).trim());
  849.                     if(stringtokenizer.hasMoreTokens())
  850.                         k8 = Integer.parseInt(((String)stringtokenizer.nextElement()).trim());
  851.                     theChart.setGraphInsets(i6, k7, j8, k8);
  852.                 }
  853.                 catch(NumberFormatException _ex)
  854.                 {
  855.                     System.out.println("Invalid graphinsets: " + s1);
  856.                 }
  857.             } else
  858.             {
  859.                 theChart.setGraphInsets(-1, -1, -1, -1);
  860.             }
  861.         } else
  862.         if(s.startsWith("urltarget"))
  863.         {
  864.             if(s1 != null && s1.trim().length() > 0)
  865.                 urlTargetList.put(s, s1);
  866.             else
  867.             if(s.equals("urltarget"))
  868.                 urlTargetList.put(s, "_self");
  869.             else
  870.                 urlTargetList.remove(s);
  871.         } else
  872.         if(s.startsWith("url"))
  873.         {
  874.             if(s1 != null && s1.trim().length() > 0)
  875.             {
  876.                 URL url = createURL(s1);
  877.                 if(url != null)
  878.                     urlList.put(s, url);
  879.                 else
  880.                     urlList.remove(s);
  881.             } else
  882.             {
  883.                 urlList.remove(s);
  884.             }
  885.         } else
  886.         if(s.equals("sample_urltarget"))
  887.         {
  888.             System.out.println(s + " is deprecated, use urltarget");
  889.             setParameter("urltarget", s1);
  890.         } else
  891.         if(s.startsWith("sample") && s.endsWith("_urltarget"))
  892.         {
  893.             System.out.println(s + " is deprecated, use urltarget_N_M");
  894.             String s2 = s.substring(6, s.indexOf("_urltarget"));
  895.             setParameter("urltarget_" + s2, s1);
  896.         } else
  897.         if(s.startsWith("sample") && s.endsWith("_url"))
  898.         {
  899.             System.out.println(s + " is deprecated, use url_N_M");
  900.             String s3 = s.substring(6, s.indexOf("_url"));
  901.             setParameter("url_" + s3, s1);
  902.         } else
  903.         if(s.equals("valuelineson"))
  904.             theChart.setValueLinesOn(s1 != null && s1.trim().toLowerCase().equals("true"));
  905.         else
  906.         if(s.equals("maxvaluelinecount"))
  907.         {
  908.             if(s1 != null && s1.trim().length() > 0)
  909.                 try
  910.                 {
  911.                     theChart.setMaxValueLineCount(Integer.parseInt(s1.trim()));
  912.                 }
  913.                 catch(NumberFormatException _ex)
  914.                 {
  915.                     System.out.println("Invalid maxValueLineCount: " + s1);
  916.                     theChart.setMaxValueLineCount(-1);
  917.                 }
  918.             else
  919.                 theChart.setMaxValueLineCount(-1);
  920.         } else
  921.         if(s.equals("defaultgridlineson"))
  922.         {
  923.             if(s1 != null)
  924.             {
  925.                 String as1[] = getStringValues(s1);
  926.                 if(as1.length < 3)
  927.                     theChart.setDefaultGridLinesOn(as1[0].trim().toLowerCase().equals("true"));
  928.                 else
  929.                 if(as1.length >= 3)
  930.                 {
  931.                     double d = Double.valueOf(as1[1]).doubleValue();
  932.                     double d2 = Double.valueOf(as1[2]).doubleValue();
  933.                     theChart.setDefaultGridLinesOn(as1[0].trim().toLowerCase().equals("true"), d, d2);
  934.                 }
  935.             }
  936.         } else
  937.         if(s.equals("defaultgridlinescolor"))
  938.         {
  939.             theChart.setDefaultGridLinesColor(null);
  940.             if(s1 != null && s1.trim().length() > 0)
  941.             {
  942.                 Color acolor4[] = getColorValues(s1);
  943.                 if(acolor4 != null && acolor4.length > 0 && acolor4[0] != null)
  944.                     theChart.setDefaultGridLinesColor(acolor4[0]);
  945.             }
  946.         } else
  947.         if(s.equals("gridlines"))
  948.         {
  949.             theChart.setGridLines(null);
  950.             if(s1 != null)
  951.             {
  952.                 Double adouble1[] = getDoubleValues(s1);
  953.                 if(adouble1 != null)
  954.                 {
  955.                     double ad[] = new double[adouble1.length];
  956.                     for(int l7 = 0; l7 < adouble1.length; l7++)
  957.                         if(adouble1[l7] != null)
  958.                             ad[l7] = adouble1[l7].doubleValue();
  959.                     theChart.setGridLines(ad);
  960.                 }
  961.             }
  962.         } else
  963.         if(s.equals("gridlinescolor"))
  964.         {
  965.             theChart.setGridLinesColor(null);
  966.             if(s1 != null && s1.trim().length() > 0)
  967.             {
  968.                 Color acolor5[] = getColorValues(s1);
  969.                 if(acolor5 != null && acolor5.length > 0 && acolor5[0] != null)
  970.                     theChart.setGridLinesColor(acolor5[0]);
  971.             }
  972.         } else
  973.         if(s.equals("gridlinecolors"))
  974.         {
  975.             if(s1 != null && s1.trim().length() > 0)
  976.                 theChart.setGridLineColors(getColorValues(s1));
  977.             else
  978.                 theChart.setGridLineColors(null);
  979.         } else
  980.         if(s.equals("valuelinescolor"))
  981.         {
  982.             if(s1 != null && s1.trim().length() > 0)
  983.             {
  984.                 Color color4 = createColor(s1);
  985.                 if(color4 != null)
  986.                     theChart.setValueLinesColor(color4);
  987.                 else
  988.                     theChart.setValueLinesColor(Color.lightGray);
  989.             } else
  990.             {
  991.                 theChart.setValueLinesColor(Color.lightGray);
  992.             }
  993.         } else
  994.         if(s.equals("sampleaxisrange"))
  995.         {
  996.             theChart.setSampleAxisRange(0.0D, 100D);
  997.             if(s1 != null && s1.trim().length() > 0)
  998.             {
  999.                 Double adouble2[] = getDoubleValues(s1);
  1000.                 if(adouble2.length >= 2)
  1001.                     theChart.setSampleAxisRange(adouble2[0] == null ? 0.0D : adouble2[0].doubleValue(), adouble2[1] == null ? 100D : adouble2[1].doubleValue());
  1002.             }
  1003.         } else
  1004.         if(s.equals("rangelabelsoff"))
  1005.             theChart.setRangeLabelsOn(s1 == null || !s1.trim().toLowerCase().equals("true"));
  1006.         else
  1007.         if(s.equals("sampleaxislabel") || s.equals("rangeaxislabel") || s.equals("rangeaxislabel_2"))
  1008.             theChart.setLabel(s, convertLineBreaks(s1));
  1009.         else
  1010.         if(s.equals("rangelabelprefix") || s.equals("rangelabelpostfix"))
  1011.             theChart.setLabel(s, convertLineBreaks(s1));
  1012.         else
  1013.         if(s.endsWith("angle") || s.equals("rangeaxislabelangle_2"))
  1014.             try
  1015.             {
  1016.                 if(s1 != null && s1.trim().length() > 0)
  1017.                     theChart.setLabelAngle(s, Integer.parseInt(s1));
  1018.                 else
  1019.                     theChart.setLabelAngle(s, 0);
  1020.             }
  1021.             catch(NumberFormatException _ex)
  1022.             {
  1023.                 System.out.println("Invalid " + s + ": " + s1);
  1024.             }
  1025.         else
  1026.         if(s.startsWith("targetvalueline"))
  1027.         {
  1028.             if(targets.containsKey(s))
  1029.             {
  1030.                 String s4 = (String)targets.remove(s);
  1031.                 theChart.setTargetValueLine(s4, 0.0D, null, 0);
  1032.             }
  1033.             if(s1 != null && s1.length() > 0)
  1034.             {
  1035.                 StringTokenizer stringtokenizer1 = new StringTokenizer(s1, labelDelimiter);
  1036.                 String s5 = null;
  1037.                 if(stringtokenizer1.hasMoreElements())
  1038.                     s5 = (String)stringtokenizer1.nextElement();
  1039.                 double d1 = 0.0D;
  1040.                 if(stringtokenizer1.hasMoreElements())
  1041.                     try
  1042.                     {
  1043.                         String s6 = (String)stringtokenizer1.nextElement();
  1044.                         d1 = (new Double(s6.trim())).doubleValue();
  1045.                     }
  1046.                     catch(NumberFormatException _ex)
  1047.                     {
  1048.                         System.out.println("Invalid targetValueLine value: " + s1);
  1049.                     }
  1050.                 Color color5 = theChart.getValueLinesColor();
  1051.                 if(stringtokenizer1.hasMoreElements())
  1052.                 {
  1053.                     String s7 = (String)stringtokenizer1.nextElement();
  1054.                     color5 = createColor(s7.trim());
  1055.                     if(color5 == null)
  1056.                         color5 = theChart.getValueLinesColor();
  1057.                 }
  1058.                 byte byte0 = 3;
  1059.                 if(stringtokenizer1.hasMoreElements())
  1060.                 {
  1061.                     String s8 = ((String)stringtokenizer1.nextElement()).trim();
  1062.                     if(s8.equals("label"))
  1063.                         byte0 = 1;
  1064.                     else
  1065.                     if(s8.equals("value"))
  1066.                         byte0 = 2;
  1067.                     else
  1068.                         byte0 = 3;
  1069.                 }
  1070.                 if(s5 != null)
  1071.                 {
  1072.                     targets.put(s, s5);
  1073.                     theChart.setTargetValueLine(s5, d1, color5, byte0);
  1074.                 }
  1075.             }
  1076.         } else
  1077.         if(s.equals("samplescrolleron"))
  1078.             theChart.setSampleScrollerOn(s1 != null && s1.trim().toLowerCase().equals("true"));
  1079.         else
  1080.         if(s.equals("visiblesamples"))
  1081.         {
  1082.             if(s1 != null && s1.length() > 0)
  1083.             {
  1084.                 int k4 = 0;
  1085.                 int j6 = -1;
  1086.                 StringTokenizer stringtokenizer2 = new StringTokenizer(s1, ",");
  1087.                 try
  1088.                 {
  1089.                     if(stringtokenizer2.hasMoreTokens())
  1090.                         k4 = Integer.parseInt(((String)stringtokenizer2.nextElement()).trim());
  1091.                     if(stringtokenizer2.hasMoreTokens())
  1092.                         j6 = Integer.parseInt(((String)stringtokenizer2.nextElement()).trim());
  1093.                 }
  1094.                 catch(NumberFormatException _ex)
  1095.                 {
  1096.                     System.out.println("Invalid visibleSamples: " + s1);
  1097.                 }
  1098.                 theChart.setVisibleSamples(k4, j6);
  1099.             } else
  1100.             {
  1101.                 theChart.setVisibleSamples(0, -1);
  1102.             }
  1103.         } else
  1104.         if(!s.equals("chart"))
  1105.             if(s.startsWith("overlay"))
  1106.             {
  1107.                 if(s1 != null && s1.trim().length() > 0)
  1108.                 {
  1109.                     s1 = s1.trim().toLowerCase();
  1110.                     Object obj = null;
  1111.                     if(s1.equals("line"))
  1112.                         obj = new LineChartApplet();
  1113.                     else
  1114.                     if(s1.equals("bar"))
  1115.                         obj = new BarChartApplet();
  1116.                     else
  1117.                     if(s1.equals("pie"))
  1118.                         obj = new PieChartApplet();
  1119.                     else
  1120.                         System.out.println("invalid " + s + " " + s1);
  1121.                     if(obj != null)
  1122.                     {
  1123.                         ((ChartApplet) (obj)).setParentApplet(this);
  1124.                         ((ChartApplet) (obj)).setParameterPrefix(s + "_");
  1125.                         ((ChartApplet) (obj)).init();
  1126.                         overlayChartApplets.addElement(obj);
  1127.                         theChart.addOverlayChart(((ChartApplet) (obj)).theChart);
  1128.                     }
  1129.                 }
  1130.             } else
  1131.             if(s.startsWith("legendimage_"))
  1132.                 try
  1133.                 {
  1134.                     int l4 = Integer.parseInt(s.substring(s.indexOf("_") + 1));
  1135.                     theChart.setLegendImage(l4, null);
  1136.                     if(s1 != null && s1.trim().length() > 0)
  1137.                     {
  1138.                         java.awt.Image image = getImage(getDocumentBase(), s1);
  1139.                         if(image != null)
  1140.                         {
  1141.                             theChart.addImage(s, image);
  1142.                             theChart.setLegendImage(l4, s);
  1143.                         }
  1144.                     }
  1145.                 }
  1146.                 catch(NumberFormatException _ex)
  1147.                 {
  1148.                     System.out.println("Invalid legend index: " + s);
  1149.                 }
  1150.                 catch(SecurityException _ex)
  1151.                 {
  1152.                     System.out.println("Security exception, could not load image: " + s1);
  1153.                 }
  1154.                 finally { }
  1155.             else
  1156.             if(s.startsWith("printasbitmap"))
  1157.                 theChart.setPrintAsBitmap(s1 != null && s1.trim().toLowerCase().equals("true"));
  1158.             else
  1159.             if(s.equals("floatingonlegendoff"))
  1160.                 theChart.setFloatingOnLegendOn(s1 == null || !s1.trim().equalsIgnoreCase("true"));
  1161.             else
  1162.                 System.out.println("Invalid parameter name: " + s);
  1163.     }
  1164.     public String getParameter(String s)
  1165.     {
  1166.         String s1 = null;
  1167.         if(parentApplet != null)
  1168.             s1 = parentApplet.getParameter(s);
  1169.         else
  1170.             try
  1171.             {
  1172.                 s1 = super.getParameter(s);
  1173.             }
  1174.             catch(NullPointerException _ex) { }
  1175.         return s1;
  1176.     }
  1177.     private URL createURL(String s)
  1178.     {
  1179.         URL url = null;
  1180.         try
  1181.         {
  1182.             url = new URL(s);
  1183.         }
  1184.         catch(MalformedURLException _ex)
  1185.         {
  1186.             URL url1 = getDocumentBase();
  1187.             if(url1 == null)
  1188.                 return null;
  1189.             String s1 = url1.toExternalForm();
  1190.             int i = s1.lastIndexOf("?");
  1191.             if(i > -1)
  1192.                 s1 = s1.substring(0, i);
  1193.             if(!s1.endsWith("/"))
  1194.                 s1 = s1.substring(0, s1.lastIndexOf("/") + 1);
  1195.             if(s1.startsWith("file:/\"))
  1196.                 s1 = "file://" + s1.substring(8);
  1197.             try
  1198.             {
  1199.                 url = new URL(s1 + s);
  1200.             }
  1201.             catch(MalformedURLException _ex2)
  1202.             {
  1203.                 System.out.println("Invalid URL: " + s1);
  1204.             }
  1205.         }
  1206.         return url;
  1207.     }
  1208.     protected void refresh()
  1209.     {
  1210.     }
  1211.     public void run()
  1212.     {
  1213.         try
  1214.         {
  1215.             Thread.sleep((int)Math.random() * 1000);
  1216.             do
  1217.             {
  1218.                 Thread.sleep(automaticRefreshTime);
  1219.                 refresh();
  1220.             } while(true);
  1221.         }
  1222.         catch(InterruptedException _ex)
  1223.         {
  1224.             return;
  1225.         }
  1226.     }
  1227.     public void init()
  1228.     {
  1229.         String s = getParameter(prefix + "chartClass");
  1230.         if(s != null)
  1231.             theChart = createChart(s);
  1232.         reset();
  1233.         if(theChart == null)
  1234.             return;
  1235.         String s1 = getParameter(prefix + "doubleBufferingOff");
  1236.         if(s1 != null && s1.equals("true"))
  1237.         {
  1238.             add("Center", theChart);
  1239.         } else
  1240.         {
  1241.             NonFlickerPanel nonflickerpanel = new NonFlickerPanel(new BorderLayout());
  1242.             nonflickerpanel.add("Center", theChart);
  1243.             add("Center", nonflickerpanel);
  1244.         }
  1245.         theChart.setAutomaticRepaintOn(false);
  1246.         int i = 1;
  1247.         int j = 0;
  1248.         Double adouble[] = getDoubleValues(getParameter(prefix + "sampleValues"));
  1249.         if(adouble != null)
  1250.         {
  1251.             j = adouble.length;
  1252.             String s2 = getParameter(prefix + "sampleCount");
  1253.             if(s2 != null)
  1254.                 try
  1255.                 {
  1256.                     j = Integer.parseInt(s2);
  1257.                 }
  1258.                 catch(NumberFormatException _ex)
  1259.                 {
  1260.                     System.out.println("Invalid sampleCount: " + s2);
  1261.                 }
  1262.             theChart.setSeriesCount(i);
  1263.             theChart.setSampleCount(j);
  1264.             initParameter("sampleValues", getParameter(prefix + "sampleValues"));
  1265.         }
  1266.         if(adouble == null)
  1267.         {
  1268.             String s3 = getParameter(prefix + "seriesCount");
  1269.             if(s3 != null)
  1270.                 try
  1271.                 {
  1272.                     i = Math.max(1, Integer.parseInt(s3));
  1273.                 }
  1274.                 catch(NumberFormatException _ex)
  1275.                 {
  1276.                     System.out.println("Invalid seriesCount: " + s3);
  1277.                 }
  1278.             s3 = getParameter(prefix + "sampleCount");
  1279.             if(s3 != null)
  1280.             {
  1281.                 try
  1282.                 {
  1283.                     j = Integer.parseInt(s3);
  1284.                 }
  1285.                 catch(NumberFormatException _ex)
  1286.                 {
  1287.                     System.out.println("Invalid sampleCount: " + s3);
  1288.                 }
  1289.             } else
  1290.             {
  1291.                 for(int k = 0; k < i; k++)
  1292.                 {
  1293.                     Double adouble1[] = getDoubleValues(getParameter(prefix + "sampleValues_" + k));
  1294.                     if(adouble1 == null)
  1295.                         adouble1 = getDoubleValues(getParameter(prefix + "series" + k + "_values"));
  1296.                     if(adouble1 != null)
  1297.                         j = Math.max(j, adouble1.length);
  1298.                 }
  1299.             }
  1300.             theChart.setSeriesCount(i);
  1301.             theChart.setSampleCount(j);
  1302.             for(int l = 0; l < i; l++)
  1303.             {
  1304.                 String s5 = getParameter(prefix + "sampleValues_" + l);
  1305.                 if(s5 == null)
  1306.                     s5 = getParameter(prefix + "series" + l + "_values");
  1307.                 initParameter("sampleValues_" + l, s5);
  1308.             }
  1309.         }
  1310.         String s4 = getParameter(prefix + "chartTitle");
  1311.         if(s4 != null && s4.trim().length() > 0)
  1312.             initParameter("chartTitle", s4);
  1313.         else
  1314.             initParameter("chartTitle", getParameter(prefix + "title"));
  1315.         initParameter("sampleColors", getParameter(prefix + "sampleColors"));
  1316.         initParameter("legendColors", getParameter(prefix + "legendColors"));
  1317.         initParameter("valueLabelsOn", getParameter(prefix + "valueLabelsOn"));
  1318.         initParameter("legendOn", getParameter(prefix + "legendOn"));
  1319.         initParameter("labelDelimiter", getParameter(prefix + "labelDelimiter"));
  1320.         initParameter("sampleLabels", getParameter(prefix + "sampleLabels"));
  1321.         initParameter("seriesLabels", getParameter(prefix + "seriesLabels"));
  1322.         initParameter("sampleLabelColors", getParameter(prefix + "sampleLabelColors"));
  1323.         initParameter("seriesLabelColors", getParameter(prefix + "seriesLabelColors"));
  1324.         initParameter("legendPosition", getParameter(prefix + "legendPosition"));
  1325.         initParameter("automaticRefreshTime", getParameter(prefix + "automaticRefreshTime"));
  1326.         initParameter("background", getParameter(prefix + "background"));
  1327.         initParameter("foreground", getParameter(prefix + "foreground"));
  1328.         initParameter("chartBackground", getParameter(prefix + "chartBackground"));
  1329.         initParameter("chartForeground", getParameter(prefix + "chartForeground"));
  1330.         initParameter("titleFont", getParameter(prefix + "titleFont"));
  1331.         initParameter("font", getParameter(prefix + "font"));
  1332.         initParameter("legendFont", getParameter(prefix + "legendFont"));
  1333.         initParameter("3DModeOn", getParameter(prefix + "3DModeOn"));
  1334.         initParameter("3DDepth", getParameter(prefix + "3DDepth"));
  1335.         initParameter("legendLabels", getParameter(prefix + "legendLabels"));
  1336.         initParameter("graphInsets", getParameter(prefix + "graphInsets"));
  1337.         initParameter("rangeDecimalCount", getParameter(prefix + "rangeDecimalCount"));
  1338.         initParameter("rangeDecimalCount_2", getParameter(prefix + "rangeDecimalCount_2"));
  1339.         initParameter("valueLinesOn", getParameter(prefix + "valueLinesOn"));
  1340.         initParameter("maxValueLineCount", getParameter(prefix + "maxValueLineCount"));
  1341.         initParameter("sampleAxisRange", getParameter(prefix + "sampleAxisRange"));
  1342.         initParameter("defaultGridLinesOn", getParameter(prefix + "defaultGridLinesOn"));
  1343.         initParameter("gridLines", getParameter(prefix + "gridLines"));
  1344.         initParameter("gridLinesColor", getParameter(prefix + "gridLinesColor"));
  1345.         initParameter("defaultGridLinesColor", getParameter(prefix + "defaultGridLinesColor"));
  1346.         initParameter("gridLineColors", getParameter(prefix + "gridLineColors"));
  1347.         initParameter("valueLinesColor", getParameter(prefix + "valueLinesColor"));
  1348.         initParameter("rangeLabelsOff", getParameter(prefix + "rangeLabelsOff"));
  1349.         initParameter("rangeLabelFont", getParameter(prefix + "rangeLabelFont"));
  1350.         initParameter("rangeLabelPrefix", getParameter(prefix + "rangeLabelPrefix"));
  1351.         initParameter("rangeLabelPostfix", getParameter(prefix + "rangeLabelPostfix"));
  1352.         initParameter("sampleAxisLabel", getParameter(prefix + "sampleAxisLabel"));
  1353.         initParameter("rangeAxisLabel", getParameter(prefix + "rangeAxisLabel"));
  1354.         initParameter("rangeAxisLabel_2", getParameter(prefix + "rangeAxisLabel_2"));
  1355.         initParameter("sampleAxisLabelFont", getParameter(prefix + "sampleAxisLabelFont"));
  1356.         initParameter("rangeAxisLabelFont", getParameter(prefix + "rangeAxisLabelFont"));
  1357.         initParameter("visibleSamples", getParameter(prefix + "visibleSamples"));
  1358.         initParameter("rangeAxisLabelAngle", getParameter(prefix + "rangeAxisLabelAngle"));
  1359.         initParameter("rangeAxisLabelAngle_2", getParameter(prefix + "rangeAxisLabelAngle_2"));
  1360.         initParameter("sampleAxisLabelAngle", getParameter(prefix + "sampleAxisLabelAngle"));
  1361.         initParameter("valueLabelAngle", getParameter(prefix + "valueLabelAngle"));
  1362.         initParameter("barLabelAngle", getParameter(prefix + "barLabelAngle"));
  1363.         initParameter("sampleLabelAngle", getParameter(prefix + "sampleLabelAngle"));
  1364.         initParameter("rangePosition", getParameter(prefix + "rangePosition"));
  1365.         initParameter("rangePosition_2", getParameter(prefix + "rangePosition_2"));
  1366.         initParameter("rangeAdjusterPosition", getParameter(prefix + "rangeAdjusterPosition"));
  1367.         initParameter("rangeAdjusterPosition_2", getParameter(prefix + "rangeAdjusterPosition_2"));
  1368.         initParameter("rangeColor", getParameter(prefix + "rangeColor"));
  1369.         initParameter("rangeColor_2", getParameter(prefix + "rangeColor_2"));
  1370.         initParameter("rangeAdjusted_1", getParameter(prefix + "rangeAdjusted_1"));
  1371.         initParameter("rangeAdjusted_2", getParameter(prefix + "rangeAdjusted_2"));
  1372.         initParameter("sampleDecimalCount", getParameter(prefix + "sampleDecimalCount"));
  1373.         initParameter("valueLabelPrefix", getParameter(prefix + "valueLabelPrefix"));
  1374.         initParameter("valueLabelPostfix", getParameter(prefix + "valueLabelPostfix"));
  1375.         initParameter("printAsBitmap", getParameter(prefix + "printAsBitmap"));
  1376.         initParameter("floatingLabelFont", getParameter(prefix + "floatingLabelFont"));
  1377.         initParameter("floatingOnLegendOff", getParameter(prefix + "floatingOnLegendOff"));
  1378.         for(int i1 = 0; i1 < i; i1++)
  1379.         {
  1380.             initParameter("valueLabelPrefix_" + i1, getParameter(prefix + "valueLabelPrefix_" + i1));
  1381.             initParameter("valueLabelPostfix_" + i1, getParameter(prefix + "valueLabelPostfix_" + i1));
  1382.             initParameter("seriesRange_" + i1, getParameter(prefix + "seriesRange_" + i1));
  1383.             initParameter("valueLabelsOn_" + i1, getParameter(prefix + "valueLabelsOn_" + i1));
  1384.             initParameter("sampleDecimalCount_" + i1, getParameter(prefix + "sampleDecimalCount_" + i1));
  1385.         }
  1386.         initParameter("urltarget", getParameter(prefix + "sample_urltarget"));
  1387.         for(int j1 = 0; j1 < j; j1++)
  1388.         {
  1389.             initParameter("url_" + j1, getParameter(prefix + "sample" + j1 + "_url"));
  1390.             initParameter("urltarget_" + j1, getParameter(prefix + "sample" + j1 + "_urltarget"));
  1391.         }
  1392.         initParameter("url", getParameter(prefix + "url"));
  1393.         setParameter("urltarget", "_self");
  1394.         initParameter("urltarget", getParameter(prefix + "urltarget"));
  1395.         int k1 = Math.max(i, j);
  1396.         for(int l1 = 0; l1 < k1; l1++)
  1397.         {
  1398.             initParameter("url_" + l1, getParameter(prefix + "url_" + l1));
  1399.             initParameter("urltarget_" + l1, getParameter(prefix + "urltarget_" + l1));
  1400.         }
  1401.         for(int i2 = 0; i2 < i; i2++)
  1402.         {
  1403.             for(int j2 = 0; j2 < j; j2++)
  1404.             {
  1405.                 String s7 = "url_" + i2 + "_" + j2;
  1406.                 initParameter(s7, getParameter(prefix + s7));
  1407.                 s7 = "urltarget_" + i2 + "_" + j2;
  1408.                 initParameter(s7, getParameter(prefix + s7));
  1409.             }
  1410.         }
  1411.         k1 = 0;
  1412.         targets = new Hashtable();
  1413.         for(String s6 = getParameter(prefix + "targetValueLine_0"); s6 != null && s6.length() > 0; s6 = getParameter(prefix + "targetValueLine_" + k1))
  1414.         {
  1415.             initParameter("targetValueLine_" + k1, s6);
  1416.             k1++;
  1417.         }
  1418.         String as[] = theChart.getLegendLabels();
  1419.         if(as != null)
  1420.         {
  1421.             for(int k2 = 0; k2 < as.length; k2++)
  1422.             {
  1423.                 String s8 = getParameter(prefix + "legendImage_" + k2);
  1424.                 initParameter("legendImage_" + k2, s8);
  1425.             }
  1426.         }
  1427.         theChart.setAutomaticRepaintOn(true);
  1428.     }
  1429.     protected Font createFont(String s, String s1, int i, int j)
  1430.     {
  1431.         StringTokenizer stringtokenizer = new StringTokenizer(s, ",");
  1432.         String s2 = s1;
  1433.         int k = Math.max(0, j);
  1434.         int l = i;
  1435.         if(stringtokenizer.hasMoreTokens())
  1436.             s2 = stringtokenizer.nextToken();
  1437.         if(stringtokenizer.hasMoreTokens())
  1438.             l = getFontType(stringtokenizer.nextToken());
  1439.         if(stringtokenizer.hasMoreTokens())
  1440.             try
  1441.             {
  1442.                 k = Integer.parseInt(stringtokenizer.nextToken().trim());
  1443.             }
  1444.             catch(NumberFormatException _ex)
  1445.             {
  1446.                 k = 12;
  1447.             }
  1448.         return new Font(s2, l, k);
  1449.     }
  1450.     public void print(Graphics g)
  1451.     {
  1452.         theChart.print(g);
  1453.     }
  1454.     private String createURLParam(String s, int i, int j)
  1455.     {
  1456.         String s1 = s;
  1457.         if(i >= 0)
  1458.             s1 += "_" + i;
  1459.         if(j >= 0)
  1460.             s1 += "_" + j;
  1461.         return s1;
  1462.     }
  1463.     /**
  1464.      * @deprecated Method init is deprecated
  1465.      */
  1466.     protected void init(Chart chart)
  1467.     {
  1468.         theChart = chart;
  1469.         init();
  1470.     }
  1471.     /**
  1472.      * @deprecated Method setParameter is deprecated
  1473.      */
  1474.     protected void setParameter(Chart chart, String s, String s1)
  1475.     {
  1476.         theChart = chart;
  1477.         setParameter(s, s1);
  1478.     }
  1479.     public Chart theChart;
  1480.     protected Vector overlayChartApplets;
  1481.     private String prefix;
  1482.     private double rangeStep[];
  1483.     private int automaticRefreshTime;
  1484.     private Thread refreshThread;
  1485.     protected String labelDelimiter;
  1486.     private Hashtable targets;
  1487.     private Hashtable urlList;
  1488.     private Hashtable urlTargetList;
  1489.     private static Cursor HAND_CURSOR;
  1490.     private static Cursor POINT_CURSOR;
  1491.     private int lastSelectedSample;
  1492.     private int lastSelectedSeries;
  1493.     private long lastSelectedTime;
  1494.     private static final int DOUBLE_CLICK_TIME = 350;
  1495.     private Applet parentApplet;
  1496. }