ChartApplet.java
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:59k
源码类别:
OA系统
开发平台:
Java
- // Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov Date: 2002-12-21 10:58:01
- // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
- // Decompiler options: packimports(3)
- // Source File Name: ChartApplet.java
- package cn.com.fcsoft.chart;
- import java.applet.Applet;
- import java.applet.AppletContext;
- import java.awt.*;
- import java.awt.event.*;
- import java.io.PrintStream;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.*;
- // Referenced classes of package com.objectplanet.chart:
- // ChartSample, Chart, LineChartApplet, BarChartApplet,
- // PieChartApplet, NonFlickerPanel
- public abstract class ChartApplet extends Applet
- implements Runnable, ItemListener, MouseMotionListener
- {
- public void stop()
- {
- if(refreshThread != null)
- {
- refreshThread.stop();
- refreshThread = null;
- }
- }
- protected Color[] getColorValues(String s)
- {
- Color acolor[] = null;
- if(s != null)
- {
- StringTokenizer stringtokenizer = new StringTokenizer(s, ",");
- acolor = new Color[stringtokenizer.countTokens()];
- for(int i = 0; i < acolor.length; i++)
- if(stringtokenizer.hasMoreTokens())
- acolor[i] = createColor(stringtokenizer.nextToken().trim());
- }
- return acolor;
- }
- private URL getSampleURL(int i, int j, int k)
- {
- String s = createURLParam("url", j, k);
- URL url = (URL)urlList.get(s);
- if(url == null)
- {
- String s1;
- if(i > 1)
- s1 = createURLParam("url", j, -1);
- else
- s1 = createURLParam("url", -1, k);
- url = (URL)urlList.get(s1);
- }
- if(url == null)
- url = (URL)urlList.get(createURLParam("url", -1, -1));
- return url;
- }
- public void reset()
- {
- urlList = new Hashtable();
- urlTargetList = new Hashtable();
- HAND_CURSOR = new Cursor(12);
- POINT_CURSOR = new Cursor(0);
- lastSelectedSample = -1;
- lastSelectedSeries = -1;
- theChart.reset();
- }
- public void mouseDragged(MouseEvent mouseevent)
- {
- }
- public ChartApplet()
- {
- labelDelimiter = ",";
- automaticRefreshTime = 2500;
- rangeStep = new double[2];
- theChart = createChart(null);
- overlayChartApplets = new Vector();
- prefix = "";
- setLayout(new BorderLayout());
- theChart.addItemListener(this);
- theChart.addMouseMotionListener(this);
- }
- public void itemStateChanged(ItemEvent itemevent)
- {
- ChartSample chartsample = (ChartSample)itemevent.getItem();
- Chart chart = (Chart)itemevent.getSource();
- if(itemevent.getStateChange() == 1 && chartsample != null && chart != null)
- {
- int i = chart.getSeriesCount();
- int j = chartsample.getIndex();
- int k = chartsample.getSeries();
- long l = System.currentTimeMillis();
- boolean flag = j == lastSelectedSample && k == lastSelectedSeries;
- if(flag && l - lastSelectedTime < 350L)
- {
- URL url = getSampleURL(i, k, j);
- if(url != null)
- {
- String s = createURLParam("urltarget", k, j);
- String s1 = (String)urlTargetList.get(s);
- if(s1 == null)
- {
- String s2;
- if(i > 1)
- s2 = createURLParam("urltarget", k, -1);
- else
- s2 = createURLParam("urltarget", -1, j);
- s1 = (String)urlTargetList.get(s2);
- }
- if(s1 == null)
- s1 = (String)urlTargetList.get("urltarget");
- AppletContext appletcontext = getAppletContext();
- if(appletcontext != null)
- appletcontext.showDocument(url, s1);
- }
- }
- lastSelectedSample = j;
- lastSelectedSeries = k;
- lastSelectedTime = l;
- }
- }
- public void mouseMoved(MouseEvent mouseevent)
- {
- if(urlList.size() == 0)
- return;
- Chart chart = (Chart)mouseevent.getSource();
- ChartSample chartsample = chart.checkSelection(new Point(mouseevent.getX(), mouseevent.getY()));
- int i = chart.getSeriesCount();
- Cursor cursor = POINT_CURSOR;
- if(chartsample != null)
- {
- URL url = getSampleURL(i, chartsample.getSeries(), chartsample.getIndex());
- if(url != null)
- cursor = HAND_CURSOR;
- }
- setCursor(cursor);
- }
- private boolean shouldSet(String s, boolean flag)
- {
- String s1 = getParameter(s);
- return s1 != null && s1.trim().length() > 0 || flag;
- }
- static String convertLineBreaks(String s)
- {
- if(s == null)
- return null;
- char ac[] = s.toCharArray();
- char ac1[] = new char[ac.length];
- int i = 0;
- for(int j = 0; j < ac.length; j++)
- if(j < ac.length - 1 && ac[j] == '\' && ac[j + 1] == 'n')
- {
- ac1[i++] = 'n';
- j++;
- } else
- {
- ac1[i++] = ac[j];
- }
- return new String(ac1, 0, i);
- }
- private static int getFontType(String s)
- {
- s = s.toLowerCase().trim();
- if(s.equals("bold"))
- return 1;
- if(s.equals("italic"))
- return 2;
- else
- return s.equals("bolditalic") || s.equals("italicbold") ? 3 : 0;
- }
- public void setParentApplet(Applet applet)
- {
- if(applet == this)
- applet = null;
- parentApplet = applet;
- }
- protected static Color createColor(String s)
- {
- if(s == null || s.length() == 0)
- return null;
- if(s.indexOf(",") >= 0)
- {
- StringTokenizer stringtokenizer = new StringTokenizer(s, ", ");
- try
- {
- return new Color(Integer.parseInt(stringtokenizer.nextToken()), Integer.parseInt(stringtokenizer.nextToken()), Integer.parseInt(stringtokenizer.nextToken()));
- }
- catch(Exception exception1)
- {
- System.out.println("Invalid RGB color: " + s);
- }
- } else
- if(s.startsWith("#"))
- {
- try
- {
- return new Color(Integer.parseInt(s.substring(1, 3), 16), Integer.parseInt(s.substring(3, 5), 16), Integer.parseInt(s.substring(5, 7), 16));
- }
- catch(Exception exception)
- {
- System.out.println("Invalid hex color: " + s);
- }
- } else
- {
- s = s.toLowerCase();
- if(s.equals("black"))
- return Color.black;
- if(s.equals("blue"))
- return Color.blue;
- if(s.equals("cyan"))
- return Color.cyan;
- if(s.equals("darkgray"))
- return Color.darkGray;
- if(s.equals("gray"))
- return Color.gray;
- if(s.equals("green"))
- return Color.green;
- if(s.equals("lightgray"))
- return Color.lightGray;
- if(s.equals("magenta"))
- return Color.magenta;
- if(s.equals("orange"))
- return Color.orange;
- if(s.equals("pink"))
- return Color.pink;
- if(s.equals("red"))
- return Color.red;
- if(s.equals("white"))
- return Color.white;
- if(s.equals("yellow"))
- return Color.yellow;
- System.out.println("Invalid color name: " + s);
- }
- return null;
- }
- protected void setRangeParameters(boolean flag)
- {
- if(shouldSet(prefix + "rangeStep", flag))
- setParameter("rangeStep", getParameter(prefix + "rangeStep"));
- if(shouldSet(prefix + "range", flag))
- setParameter("range", getParameter(prefix + "range"));
- if(shouldSet(prefix + "lowerRange", flag))
- setParameter("lowerRange", getParameter(prefix + "lowerRange"));
- setParameter("rangeOn_2", getParameter(prefix + "rangeOn_2"));
- if(shouldSet(prefix + "rangeStep_2", flag))
- setParameter("rangeStep_2", getParameter(prefix + "rangeStep_2"));
- if(shouldSet(prefix + "range_2", flag))
- setParameter("range_2", getParameter(prefix + "range_2"));
- if(shouldSet(prefix + "lowerRange_2", flag))
- setParameter("lowerRange_2", getParameter(prefix + "lowerRange_2"));
- initParameter("rangeAdjusterOn", getParameter(prefix + "rangeAdjusterOn"));
- initParameter("rangeAdjusterOn_2", getParameter(prefix + "rangeAdjusterOn_2"));
- }
- public void setParameterPrefix(String s)
- {
- prefix = s != null ? s : "";
- }
- public String getParameterPrefix()
- {
- return prefix;
- }
- protected abstract Chart createChart(String s);
- public void start()
- {
- if(automaticRefreshTime > 0)
- {
- refreshThread = new Thread(this);
- refreshThread.start();
- }
- }
- private void initParameter(String s, String s1)
- {
- if(s1 != null)
- setParameter(s, s1);
- }
- protected static Double[] getDoubleValues(String s)
- {
- Double adouble[] = null;
- if(s != null && !s.equals(""))
- {
- boolean flag = s.trim().startsWith(",");
- StringTokenizer stringtokenizer = new StringTokenizer(s, ",");
- adouble = new Double[stringtokenizer.countTokens() + (flag ? 1 : 0)];
- for(int i = flag ? 1 : 0; i < adouble.length; i++)
- try
- {
- adouble[i] = new Double(stringtokenizer.nextToken());
- }
- catch(NumberFormatException numberformatexception) { }
- }
- return adouble;
- }
- protected String[] getStringValues(String s)
- {
- String as[] = null;
- if(s != null)
- {
- boolean flag = s.trim().startsWith(labelDelimiter);
- StringTokenizer stringtokenizer = new StringTokenizer(s, labelDelimiter);
- as = new String[stringtokenizer.countTokens() + (flag ? 1 : 0)];
- for(int i = flag ? 1 : 0; i < as.length; i++)
- as[i] = stringtokenizer.nextToken();
- }
- return as;
- }
- public void setParameter(String s, String s1)
- {
- if(s == null || theChart == null)
- return;
- s = s.toLowerCase();
- if(s.startsWith("series") && s.endsWith("_values"))
- try
- {
- int i = Integer.parseInt(s.substring(6, s.indexOf("_values")));
- s = "sampleValues_" + i;
- }
- catch(NumberFormatException numberformatexception) { }
- if(s.equals("width"))
- {
- if(s1 != null && s1.trim().length() > 0)
- try
- {
- int j = Integer.parseInt(s1.trim());
- setSize(j, theChart.getSize().height);
- theChart.setSize(j, theChart.getSize().height);
- }
- catch(NumberFormatException numberformatexception1)
- {
- System.out.println("Invalid width: " + s1);
- }
- } else
- if(s.equals("height"))
- {
- if(s1 != null && s1.trim().length() > 0)
- try
- {
- int k = Integer.parseInt(s1.trim());
- setSize(theChart.getSize().width, k);
- theChart.setSize(theChart.getSize().width, k);
- }
- catch(NumberFormatException numberformatexception2)
- {
- System.out.println("Invalid height: " + s1);
- }
- } else
- if(s.equals("samplevalues"))
- {
- Double adouble[] = getDoubleValues(s1);
- if(adouble != null && s1.trim().length() > 0)
- {
- int i5 = theChart.getSampleCount();
- for(int k6 = 0; k6 < i5; k6++)
- if(k6 < adouble.length && adouble[k6] != null)
- {
- theChart.setSampleValue(0, k6, adouble[k6].doubleValue());
- } else
- {
- ChartSample chartsample = theChart.getSample(0, k6);
- if(chartsample != null)
- chartsample.clearValue();
- }
- }
- } else
- if(s.equals("samplecount"))
- {
- if(s1 != null && s1.trim().length() > 0)
- try
- {
- theChart.setSampleCount(Math.max(0, Integer.parseInt(s1.trim())));
- }
- catch(NumberFormatException numberformatexception3)
- {
- System.out.println("Invalid sampleCount: " + s1);
- }
- } else
- if(s.equals("samplecolors"))
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- Color acolor[] = getColorValues(s1);
- theChart.setSampleColors(acolor);
- } else
- {
- theChart.setSampleColors(null);
- }
- } else
- if(s.equals("legendcolors"))
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- Color acolor1[] = getColorValues(s1);
- theChart.setLegendColors(acolor1);
- } else
- {
- theChart.setLegendColors(null);
- }
- } else
- if(s.equals("seriescount"))
- {
- if(s1 != null && s1.trim().length() > 0)
- try
- {
- theChart.setSeriesCount(Math.max(1, Integer.parseInt(s1.trim())));
- }
- catch(NumberFormatException numberformatexception4)
- {
- System.out.println("Invalid seriesCount: " + s1);
- }
- else
- theChart.setSeriesCount(1);
- } else
- if(s.startsWith("samplevalues_"))
- try
- {
- int l = Integer.parseInt(s.substring(13));
- if(l >= 0 && l < theChart.getSeriesCount())
- {
- Double adouble3[] = getDoubleValues(s1);
- int l6 = theChart.getSampleCount();
- for(int i8 = 0; i8 < l6; i8++)
- if(adouble3 != null && i8 < adouble3.length && adouble3[i8] != null)
- {
- theChart.setSampleValue(l, i8, adouble3[i8].doubleValue());
- } else
- {
- ChartSample chartsample1 = theChart.getSample(l, i8);
- if(chartsample1 != null)
- chartsample1.clearValue();
- }
- }
- }
- catch(NumberFormatException numberformatexception5)
- {
- System.out.println("Invalid series index: " + s1);
- }
- else
- if(s.startsWith("seriesrange_"))
- try
- {
- int i1 = Integer.parseInt(s.substring(12));
- if(i1 >= 0 && i1 < theChart.getSeriesCount())
- if(s1 != null && s1.length() > 0)
- try
- {
- int j5 = Integer.parseInt(s1.trim());
- j5 = j5 == 2 ? 1 : 0;
- theChart.setSeriesRange(i1, j5);
- }
- catch(NumberFormatException numberformatexception14)
- {
- System.out.println("Invalid range index: " + s + " " + s1);
- }
- else
- theChart.setSeriesRange(i1, 0);
- }
- catch(NumberFormatException numberformatexception6)
- {
- System.out.println("Invalid series index: " + s + " " + s1);
- }
- else
- if(s.startsWith("rangestep"))
- {
- int j1 = s.equals("rangestep_2") ? 1 : 0;
- try
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- rangeStep[j1] = (new Double(s1.trim())).doubleValue();
- rangeStep[j1] = Math.abs(rangeStep[j1]);
- theChart.setRelativeRange(j1, 1.0D, rangeStep[j1]);
- theChart.setLowerRelativeRange(j1, 1.0D, rangeStep[j1]);
- } else
- {
- rangeStep[j1] = -1D;
- theChart.setRelativeRangeIndex(j1, 1.0D);
- theChart.setLowerRelativeRangeIndex(j1, 1.0D);
- }
- }
- catch(NumberFormatException numberformatexception15)
- {
- System.out.println("Invalid rangeStep: " + s1);
- rangeStep[j1] = -1D;
- theChart.setLowerRelativeRange(1.0D);
- }
- } else
- if(s.equals("range") || s.equals("range_2"))
- {
- int k1 = s.equals("range_2") ? 1 : 0;
- try
- {
- if(s1 != null && s1.trim().length() > 0)
- theChart.setRange(k1, (new Double(s1.trim())).doubleValue());
- else
- if(rangeStep[k1] > -1D)
- theChart.setRelativeRange(k1, 1.0D, rangeStep[k1]);
- else
- theChart.setRelativeRangeIndex(k1, 1.0D);
- }
- catch(NumberFormatException numberformatexception16)
- {
- System.out.println("Invalid range: " + s1);
- if(rangeStep[k1] != -1D)
- theChart.setRelativeRange(k1, 1.0D, rangeStep[k1]);
- else
- theChart.setRelativeRangeIndex(k1, 1.0D);
- }
- } else
- if(s.equals("lowerrange") || s.equals("lowerrange_2"))
- {
- int l1 = s.equals("lowerrange_2") ? 1 : 0;
- try
- {
- if(s1 != null && s1.trim().length() > 0)
- theChart.setLowerRange(l1, (new Double(s1.trim())).doubleValue());
- else
- if(rangeStep[l1] != -1D)
- theChart.setLowerRelativeRange(l1, 1.0D, rangeStep[l1]);
- else
- theChart.setLowerRelativeRangeIndex(l1, 1.0D);
- }
- catch(NumberFormatException numberformatexception17)
- {
- System.out.println("Invalid lowerRange: " + s1);
- if(rangeStep[l1] > -1D)
- theChart.setLowerRelativeRange(l1, 1.0D, rangeStep[l1]);
- else
- theChart.setLowerRelativeRangeIndex(l1, 1.0D);
- }
- } else
- if(s.startsWith("rangeon"))
- {
- int i2 = s.equals("rangeon_2") ? 1 : 0;
- if(s1 != null && s1.trim().length() > 0)
- theChart.setRangeOn(i2, s1.trim().toLowerCase().equals("true"));
- } else
- if(s.startsWith("rangecolor"))
- {
- int j2 = s.equals("rangecolor_2") ? 1 : 0;
- if(s1 != null && s1.trim().length() > 0)
- theChart.setRangeColor(j2, createColor(s1));
- } else
- if(s.startsWith("rangeposition"))
- {
- int k2 = s.equals("rangeposition_2") ? 1 : 0;
- if(s1 != null && s1.length() > 0)
- {
- s1 = s1.trim().toLowerCase();
- if(s1.equals("right") || s1.equals("top"))
- theChart.setRangePosition(k2, 1);
- else
- theChart.setRangePosition(k2, 0);
- }
- } else
- if(s.startsWith("rangeadjusteron"))
- {
- int l2 = s.equals("rangeadjusteron_2") ? 1 : 0;
- theChart.setRangeAdjusterOn(l2, s1.trim().toLowerCase().equals("true"));
- } else
- if(s.startsWith("rangeadjusterposition"))
- {
- int i3 = s.equals("rangeadjusterposition_2") ? 1 : 0;
- if(s1 != null && s1.length() > 0)
- {
- s1 = s1.trim().toLowerCase();
- if(s1.equals("right") || s1.equals("top"))
- theChart.setRangeAdjusterPosition(i3, 1);
- else
- theChart.setRangeAdjusterPosition(i3, 0);
- }
- } else
- if(s.startsWith("rangeadjusted_"))
- {
- int j3 = s.equals("rangeadjusted_2") ? 1 : 0;
- if(s1 != null && s1.length() > 0)
- if(s1.trim().equals("1"))
- theChart.setRangeAdjusted(j3, 0);
- else
- if(s1.trim().equals("2"))
- theChart.setRangeAdjusted(j3, 1);
- else
- theChart.setRangeAdjusted(j3, 2);
- } else
- if(s.startsWith("rangedecimalcount"))
- {
- int k3 = s.equals("rangedecimalcount_2") ? 1 : 0;
- try
- {
- if(s1 != null && s1.trim().length() > 0)
- theChart.setRangeDecimalCount(k3, Integer.parseInt(s1.trim()));
- else
- theChart.setRangeDecimalCount(k3, 0);
- }
- catch(NumberFormatException numberformatexception18)
- {
- System.out.println("Invalid " + s + ": " + s1);
- theChart.setRangeDecimalCount(k3, 0);
- }
- } else
- if(s.equals("labeldelimiter"))
- {
- if(s1 != null && s1.trim().length() > 0)
- labelDelimiter = s1;
- else
- labelDelimiter = ",";
- } else
- if(s.equals("serieslabels"))
- theChart.setSeriesLabels(getStringValues(convertLineBreaks(s1)));
- else
- if(s.equals("serieslabelcolors"))
- {
- Color acolor2[] = getColorValues(s1);
- int k5 = theChart.getSeriesCount();
- for(int i7 = 0; i7 < k5; i7++)
- if(acolor2 != null && i7 < acolor2.length)
- theChart.setSeriesLabelColor(i7, acolor2[i7]);
- else
- theChart.setSeriesLabelColor(i7, null);
- } else
- if(s.equals("samplelabels"))
- theChart.setSampleLabels(getStringValues(convertLineBreaks(s1)));
- else
- if(s.equals("samplelabelcolors"))
- {
- Color acolor3[] = getColorValues(s1);
- int l5 = theChart.getSampleCount();
- for(int j7 = 0; j7 < l5; j7++)
- if(acolor3 != null && j7 < acolor3.length)
- theChart.setSampleLabelColor(j7, acolor3[j7]);
- else
- theChart.setSampleLabelColor(j7, null);
- } else
- if(s.equals("legendlabels"))
- {
- theChart.setLegendLabels(null);
- if(s1 != null && s1.trim().length() > 0)
- {
- String as[] = getStringValues(convertLineBreaks(s1));
- if(as.length > 1)
- theChart.setLegendLabels(as);
- else
- if(as.length == 1 && as[0] != null)
- if(as[0].trim().toLowerCase().equals("samplelabels"))
- theChart.setLegendLabels(theChart.getSampleLabels());
- else
- if(as[0].trim().toLowerCase().equals("serieslabels"))
- theChart.setLegendLabels(theChart.getSeriesLabels());
- else
- theChart.setLegendLabels(as);
- }
- } else
- if(s.startsWith("valuelabelson"))
- {
- if(s.equals("valuelabelson"))
- theChart.setValueLabelsOn(-1, s1 != null && s1.trim().toLowerCase().equals("true"));
- else
- if(s.startsWith("valuelabelson_"))
- try
- {
- int l3 = Integer.parseInt(s.substring(14));
- if(l3 >= 0 && l3 < theChart.getSeriesCount())
- theChart.setValueLabelsOn(l3, s1 != null && s1.trim().toLowerCase().equals("true"));
- }
- catch(NumberFormatException numberformatexception7)
- {
- System.out.println("Invalid " + s + " " + s1);
- }
- } else
- if(s.startsWith("valuelabelprefix") || s.startsWith("valuelabelpostfix"))
- theChart.setLabel(s, convertLineBreaks(s1));
- else
- if(s.startsWith("sampledecimalcount"))
- try
- {
- if(s.equals("sampledecimalcount"))
- {
- if(s1 != null && s1.trim().length() > 0)
- theChart.setSampleDecimalCount(-1, Integer.parseInt(s1.trim()));
- else
- theChart.setSampleDecimalCount(-1, 0);
- } else
- if(s.startsWith("sampledecimalcount_"))
- {
- int i4 = Integer.parseInt(s.substring(19));
- if(i4 >= 0 && i4 < theChart.getSeriesCount())
- if(s1 != null && s1.trim().length() > 0)
- theChart.setSampleDecimalCount(i4, Integer.parseInt(s1.trim()));
- else
- theChart.setSampleDecimalCount(i4, 0);
- }
- }
- catch(NumberFormatException numberformatexception8)
- {
- System.out.println("Invalid " + s + " " + s1);
- }
- else
- if(s.equals("charttitle") || s.equals("title"))
- {
- theChart.setTitle(convertLineBreaks(s1));
- theChart.setTitleOn(s1 != null && s1.length() > 0);
- } else
- if(s.equals("legendon"))
- theChart.setLegendOn(s1 != null && s1.trim().toLowerCase().equals("true"));
- else
- if(s.equals("legendposition"))
- {
- theChart.setLegendPosition(1);
- if(s1 != null && s1.trim().length() > 0)
- {
- s1 = s1.toLowerCase();
- if(s1.equals("right"))
- theChart.setLegendPosition(1);
- else
- if(s1.equals("top"))
- theChart.setLegendPosition(2);
- else
- if(s1.equals("bottom"))
- theChart.setLegendPosition(3);
- else
- if(s1.equals("left"))
- theChart.setLegendPosition(0);
- else
- System.out.println("Invalid legendPosition: " + s1);
- }
- } else
- if(s.equals("automaticrefreshtime"))
- try
- {
- if(s1 != null && s1.trim().length() > 0)
- automaticRefreshTime = Math.max(100, Integer.parseInt(s1));
- else
- automaticRefreshTime = 0x36ee80;
- }
- catch(NumberFormatException numberformatexception9)
- {
- System.out.println("Invalid automaticRefreshTime: " + s1);
- automaticRefreshTime = 0x36ee80;
- }
- else
- if(s.equals("3dmodeon"))
- theChart.set3DModeOn(s1 != null && s1.toLowerCase().equals("true"));
- else
- if(s.equals("3ddepth"))
- {
- theChart.set3DDepth(-1);
- if(s1 != null && s1.trim().length() > 0)
- try
- {
- int j4 = Integer.parseInt(s1.trim());
- theChart.set3DDepth(j4);
- }
- catch(NumberFormatException numberformatexception10)
- {
- System.out.println("Invalid 3DDepth: " + s1);
- }
- } else
- if(s.equals("foreground"))
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- Color color = createColor(s1);
- if(color != null)
- theChart.setForeground(color);
- else
- theChart.setForeground(Color.black);
- } else
- {
- theChart.setForeground(Color.black);
- }
- } else
- if(s.equals("background"))
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- Color color1 = createColor(s1);
- if(color1 != null)
- theChart.setBackground(color1);
- else
- theChart.setBackground(new Color(231, 221, 231));
- } else
- {
- theChart.setBackground(new Color(231, 221, 231));
- }
- } else
- if(s.equals("chartforeground"))
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- Color color2 = createColor(s1);
- if(color2 != null)
- theChart.setChartForeground(color2);
- else
- theChart.setChartForeground(Color.black);
- } else
- {
- theChart.setChartForeground(Color.black);
- }
- } else
- if(s.equals("chartbackground"))
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- Color color3 = createColor(s1);
- if(color3 != null)
- theChart.setChartBackground(color3);
- else
- theChart.setChartBackground(Color.white);
- } else
- {
- theChart.setChartBackground(Color.white);
- }
- } else
- if(s.equals("titlefont"))
- {
- if(s1 != null && s1.trim().length() > 0)
- theChart.setFont("titleFont", createFont(s1, "Dialog", 1, 14));
- else
- theChart.setFont("titleFont", new Font("Dialog", 1, 14));
- } else
- if(s.equals("font"))
- {
- if(s1 != null && s1.trim().length() > 0)
- theChart.setFont(createFont(s1, "Arial", 0, 11));
- else
- theChart.setFont(new Font("Arial", 0, 11));
- } else
- if(s.endsWith("font"))
- {
- if(s1 != null && s1.trim().length() > 0)
- theChart.setFont(s, createFont(s1, "Arial", 0, 11));
- else
- theChart.setFont(s, null);
- } else
- if(s.equals("graphinsets"))
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- StringTokenizer stringtokenizer = new StringTokenizer(s1.trim(), ",");
- int i6 = -1;
- int k7 = -1;
- int j8 = -1;
- int k8 = -1;
- try
- {
- if(stringtokenizer.hasMoreTokens())
- i6 = Integer.parseInt(((String)stringtokenizer.nextElement()).trim());
- if(stringtokenizer.hasMoreTokens())
- k7 = Integer.parseInt(((String)stringtokenizer.nextElement()).trim());
- if(stringtokenizer.hasMoreTokens())
- j8 = Integer.parseInt(((String)stringtokenizer.nextElement()).trim());
- if(stringtokenizer.hasMoreTokens())
- k8 = Integer.parseInt(((String)stringtokenizer.nextElement()).trim());
- theChart.setGraphInsets(i6, k7, j8, k8);
- }
- catch(NumberFormatException numberformatexception21)
- {
- System.out.println("Invalid graphinsets: " + s1);
- }
- } else
- {
- theChart.setGraphInsets(-1, -1, -1, -1);
- }
- } else
- if(s.startsWith("urltarget"))
- {
- if(s1 != null && s1.trim().length() > 0)
- urlTargetList.put(s, s1);
- else
- if(s.equals("urltarget"))
- urlTargetList.put(s, "_self");
- else
- urlTargetList.remove(s);
- } else
- if(s.startsWith("url"))
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- URL url = createURL(s1);
- if(url != null)
- urlList.put(s, url);
- else
- urlList.remove(s);
- } else
- {
- urlList.remove(s);
- }
- } else
- if(s.equals("sample_urltarget"))
- {
- System.out.println(s + " is deprecated, use urltarget");
- setParameter("urltarget", s1);
- } else
- if(s.startsWith("sample") && s.endsWith("_urltarget"))
- {
- System.out.println(s + " is deprecated, use urltarget_N_M");
- String s2 = s.substring(6, s.indexOf("_urltarget"));
- setParameter("urltarget_" + s2, s1);
- } else
- if(s.startsWith("sample") && s.endsWith("_url"))
- {
- System.out.println(s + " is deprecated, use url_N_M");
- String s3 = s.substring(6, s.indexOf("_url"));
- setParameter("url_" + s3, s1);
- } else
- if(s.equals("valuelineson"))
- theChart.setValueLinesOn(s1 != null && s1.trim().toLowerCase().equals("true"));
- else
- if(s.equals("maxvaluelinecount"))
- {
- if(s1 != null && s1.trim().length() > 0)
- try
- {
- theChart.setMaxValueLineCount(Integer.parseInt(s1.trim()));
- }
- catch(NumberFormatException numberformatexception11)
- {
- System.out.println("Invalid maxValueLineCount: " + s1);
- theChart.setMaxValueLineCount(-1);
- }
- else
- theChart.setMaxValueLineCount(-1);
- } else
- if(s.equals("defaultgridlineson"))
- {
- if(s1 != null)
- {
- String as1[] = getStringValues(s1);
- if(as1.length < 3)
- theChart.setDefaultGridLinesOn(as1[0].trim().toLowerCase().equals("true"));
- else
- if(as1.length >= 3)
- {
- double d = Double.valueOf(as1[1]).doubleValue();
- double d2 = Double.valueOf(as1[2]).doubleValue();
- theChart.setDefaultGridLinesOn(as1[0].trim().toLowerCase().equals("true"), d, d2);
- }
- }
- } else
- if(s.equals("defaultgridlinescolor"))
- {
- theChart.setDefaultGridLinesColor(null);
- if(s1 != null && s1.trim().length() > 0)
- {
- Color acolor4[] = getColorValues(s1);
- if(acolor4 != null && acolor4.length > 0 && acolor4[0] != null)
- theChart.setDefaultGridLinesColor(acolor4[0]);
- }
- } else
- if(s.equals("gridlines"))
- {
- theChart.setGridLines(null);
- if(s1 != null)
- {
- Double adouble1[] = getDoubleValues(s1);
- if(adouble1 != null)
- {
- double ad[] = new double[adouble1.length];
- for(int l7 = 0; l7 < adouble1.length; l7++)
- if(adouble1[l7] != null)
- ad[l7] = adouble1[l7].doubleValue();
- theChart.setGridLines(ad);
- }
- }
- } else
- if(s.equals("gridlinescolor"))
- {
- theChart.setGridLinesColor(null);
- if(s1 != null && s1.trim().length() > 0)
- {
- Color acolor5[] = getColorValues(s1);
- if(acolor5 != null && acolor5.length > 0 && acolor5[0] != null)
- theChart.setGridLinesColor(acolor5[0]);
- }
- } else
- if(s.equals("gridlinecolors"))
- {
- if(s1 != null && s1.trim().length() > 0)
- theChart.setGridLineColors(getColorValues(s1));
- else
- theChart.setGridLineColors(null);
- } else
- if(s.equals("valuelinescolor"))
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- Color color4 = createColor(s1);
- if(color4 != null)
- theChart.setValueLinesColor(color4);
- else
- theChart.setValueLinesColor(Color.lightGray);
- } else
- {
- theChart.setValueLinesColor(Color.lightGray);
- }
- } else
- if(s.equals("sampleaxisrange"))
- {
- theChart.setSampleAxisRange(0.0D, 100D);
- if(s1 != null && s1.trim().length() > 0)
- {
- Double adouble2[] = getDoubleValues(s1);
- if(adouble2.length >= 2)
- theChart.setSampleAxisRange(adouble2[0] != null ? adouble2[0].doubleValue() : 0.0D, adouble2[1] != null ? adouble2[1].doubleValue() : 100D);
- }
- } else
- if(s.equals("rangelabelsoff"))
- theChart.setRangeLabelsOn(s1 == null || !s1.trim().toLowerCase().equals("true"));
- else
- if(s.equals("sampleaxislabel") || s.equals("rangeaxislabel") || s.equals("rangeaxislabel_2"))
- theChart.setLabel(s, convertLineBreaks(s1));
- else
- if(s.equals("rangelabelprefix") || s.equals("rangelabelpostfix"))
- theChart.setLabel(s, convertLineBreaks(s1));
- else
- if(s.endsWith("angle") || s.equals("rangeaxislabelangle_2"))
- try
- {
- if(s1 != null && s1.trim().length() > 0)
- theChart.setLabelAngle(s, Integer.parseInt(s1));
- else
- theChart.setLabelAngle(s, 0);
- }
- catch(NumberFormatException numberformatexception12)
- {
- System.out.println("Invalid " + s + ": " + s1);
- }
- else
- if(s.startsWith("targetvalueline"))
- {
- if(targets.containsKey(s))
- {
- String s4 = (String)targets.remove(s);
- theChart.setTargetValueLine(s4, 0.0D, null, 0);
- }
- if(s1 != null && s1.length() > 0)
- {
- StringTokenizer stringtokenizer1 = new StringTokenizer(s1, labelDelimiter);
- String s5 = null;
- if(stringtokenizer1.hasMoreElements())
- s5 = (String)stringtokenizer1.nextElement();
- double d1 = 0.0D;
- if(stringtokenizer1.hasMoreElements())
- try
- {
- String s6 = (String)stringtokenizer1.nextElement();
- d1 = (new Double(s6.trim())).doubleValue();
- }
- catch(NumberFormatException numberformatexception20)
- {
- System.out.println("Invalid targetValueLine value: " + s1);
- }
- Color color5 = theChart.getValueLinesColor();
- if(stringtokenizer1.hasMoreElements())
- {
- String s7 = (String)stringtokenizer1.nextElement();
- color5 = createColor(s7.trim());
- if(color5 == null)
- color5 = theChart.getValueLinesColor();
- }
- byte byte0 = 3;
- if(stringtokenizer1.hasMoreElements())
- {
- String s8 = ((String)stringtokenizer1.nextElement()).trim();
- if(s8.equals("label"))
- byte0 = 1;
- else
- if(s8.equals("value"))
- byte0 = 2;
- else
- byte0 = 3;
- }
- if(s5 != null)
- {
- targets.put(s, s5);
- theChart.setTargetValueLine(s5, d1, color5, byte0);
- }
- }
- } else
- if(s.equals("samplescrolleron"))
- theChart.setSampleScrollerOn(s1 != null && s1.trim().toLowerCase().equals("true"));
- else
- if(s.equals("visiblesamples"))
- {
- if(s1 != null && s1.length() > 0)
- {
- int k4 = 0;
- int j6 = -1;
- StringTokenizer stringtokenizer2 = new StringTokenizer(s1, ",");
- try
- {
- if(stringtokenizer2.hasMoreTokens())
- k4 = Integer.parseInt(((String)stringtokenizer2.nextElement()).trim());
- if(stringtokenizer2.hasMoreTokens())
- j6 = Integer.parseInt(((String)stringtokenizer2.nextElement()).trim());
- }
- catch(NumberFormatException numberformatexception19)
- {
- System.out.println("Invalid visibleSamples: " + s1);
- }
- theChart.setVisibleSamples(k4, j6);
- } else
- {
- theChart.setVisibleSamples(0, -1);
- }
- } else
- if(!s.equals("chart"))
- if(s.startsWith("overlay"))
- {
- if(s1 != null && s1.trim().length() > 0)
- {
- s1 = s1.trim().toLowerCase();
- Object obj = null;
- if(s1.equals("line"))
- obj = new LineChartApplet();
- else
- if(s1.equals("bar"))
- obj = new BarChartApplet();
- else
- if(s1.equals("pie"))
- obj = new PieChartApplet();
- else
- System.out.println("invalid " + s + " " + s1);
- if(obj != null)
- {
- ((ChartApplet)obj).setParentApplet(this);
- ((ChartApplet)obj).setParameterPrefix(s + "_");
- ((ChartApplet)obj).init();
- overlayChartApplets.addElement(obj);
- theChart.addOverlayChart(((ChartApplet)obj).theChart);
- }
- }
- } else
- if(s.startsWith("legendimage_"))
- try
- {
- int l4 = Integer.parseInt(s.substring(s.indexOf("_") + 1));
- theChart.setLegendImage(l4, null);
- if(s1 != null && s1.trim().length() > 0)
- {
- java.awt.Image image = getImage(getDocumentBase(), s1);
- if(image != null)
- {
- theChart.addImage(s, image);
- theChart.setLegendImage(l4, s);
- }
- }
- }
- catch(NumberFormatException numberformatexception13)
- {
- System.out.println("Invalid legend index: " + s);
- }
- catch(SecurityException securityexception)
- {
- System.out.println("Security exception, could not load image: " + s1);
- }
- finally { }
- else
- if(s.startsWith("printasbitmap"))
- theChart.setPrintAsBitmap(s1 != null && s1.trim().toLowerCase().equals("true"));
- else
- if(s.equals("floatingonlegendoff"))
- theChart.setFloatingOnLegendOn(s1 == null || !s1.trim().equalsIgnoreCase("true"));
- else
- System.out.println("Invalid parameter name: " + s);
- }
- public String getParameter(String s)
- {
- String s1 = null;
- if(parentApplet != null)
- s1 = parentApplet.getParameter(s);
- else
- try
- {
- s1 = super.getParameter(s);
- }
- catch(NullPointerException nullpointerexception) { }
- return s1;
- }
- private URL createURL(String s)
- {
- URL url = null;
- try
- {
- url = new URL(s);
- }
- catch(MalformedURLException malformedurlexception)
- {
- URL url1 = getDocumentBase();
- if(url1 == null)
- return null;
- String s1 = url1.toExternalForm();
- int i = s1.lastIndexOf("?");
- if(i > -1)
- s1 = s1.substring(0, i);
- if(!s1.endsWith("/"))
- s1 = s1.substring(0, s1.lastIndexOf("/") + 1);
- if(s1.startsWith("file:/\"))
- s1 = "file://" + s1.substring(8);
- try
- {
- url = new URL(s1 + s);
- }
- catch(MalformedURLException malformedurlexception1)
- {
- System.out.println("Invalid URL: " + s1);
- }
- }
- return url;
- }
- protected void refresh()
- {
- }
- public void run()
- {
- try
- {
- Thread.sleep((int)Math.random() * 1000);
- do
- {
- Thread.sleep(automaticRefreshTime);
- refresh();
- } while(true);
- }
- catch(InterruptedException interruptedexception)
- {
- return;
- }
- }
- public void init()
- {
- String s = getParameter(prefix + "chartClass");
- if(s != null)
- theChart = createChart(s);
- reset();
- if(theChart == null)
- return;
- String s1 = getParameter(prefix + "doubleBufferingOff");
- if(s1 != null && s1.equals("true"))
- {
- add("Center", theChart);
- } else
- {
- NonFlickerPanel nonflickerpanel = new NonFlickerPanel(new BorderLayout());
- nonflickerpanel.add("Center", theChart);
- add("Center", nonflickerpanel);
- }
- theChart.setAutomaticRepaintOn(false);
- int i = 1;
- int j = 0;
- Double adouble[] = getDoubleValues(getParameter(prefix + "sampleValues"));
- if(adouble != null)
- {
- j = adouble.length;
- String s2 = getParameter(prefix + "sampleCount");
- if(s2 != null)
- try
- {
- j = Integer.parseInt(s2);
- }
- catch(NumberFormatException numberformatexception)
- {
- System.out.println("Invalid sampleCount: " + s2);
- }
- theChart.setSeriesCount(i);
- theChart.setSampleCount(j);
- initParameter("sampleValues", getParameter(prefix + "sampleValues"));
- }
- if(adouble == null)
- {
- String s3 = getParameter(prefix + "seriesCount");
- if(s3 != null)
- try
- {
- i = Math.max(1, Integer.parseInt(s3));
- }
- catch(NumberFormatException numberformatexception1)
- {
- System.out.println("Invalid seriesCount: " + s3);
- }
- s3 = getParameter(prefix + "sampleCount");
- if(s3 != null)
- {
- try
- {
- j = Integer.parseInt(s3);
- }
- catch(NumberFormatException numberformatexception2)
- {
- System.out.println("Invalid sampleCount: " + s3);
- }
- } else
- {
- for(int k = 0; k < i; k++)
- {
- Double adouble1[] = getDoubleValues(getParameter(prefix + "sampleValues_" + k));
- if(adouble1 == null)
- adouble1 = getDoubleValues(getParameter(prefix + "series" + k + "_values"));
- if(adouble1 != null)
- j = Math.max(j, adouble1.length);
- }
- }
- theChart.setSeriesCount(i);
- theChart.setSampleCount(j);
- for(int l = 0; l < i; l++)
- {
- String s5 = getParameter(prefix + "sampleValues_" + l);
- if(s5 == null)
- s5 = getParameter(prefix + "series" + l + "_values");
- initParameter("sampleValues_" + l, s5);
- }
- }
- String s4 = getParameter(prefix + "chartTitle");
- if(s4 != null && s4.trim().length() > 0)
- initParameter("chartTitle", s4);
- else
- initParameter("chartTitle", getParameter(prefix + "title"));
- initParameter("sampleColors", getParameter(prefix + "sampleColors"));
- initParameter("legendColors", getParameter(prefix + "legendColors"));
- initParameter("valueLabelsOn", getParameter(prefix + "valueLabelsOn"));
- initParameter("legendOn", getParameter(prefix + "legendOn"));
- initParameter("labelDelimiter", getParameter(prefix + "labelDelimiter"));
- initParameter("sampleLabels", getParameter(prefix + "sampleLabels"));
- initParameter("seriesLabels", getParameter(prefix + "seriesLabels"));
- initParameter("sampleLabelColors", getParameter(prefix + "sampleLabelColors"));
- initParameter("seriesLabelColors", getParameter(prefix + "seriesLabelColors"));
- initParameter("legendPosition", getParameter(prefix + "legendPosition"));
- initParameter("automaticRefreshTime", getParameter(prefix + "automaticRefreshTime"));
- initParameter("background", getParameter(prefix + "background"));
- initParameter("foreground", getParameter(prefix + "foreground"));
- initParameter("chartBackground", getParameter(prefix + "chartBackground"));
- initParameter("chartForeground", getParameter(prefix + "chartForeground"));
- initParameter("titleFont", getParameter(prefix + "titleFont"));
- initParameter("font", getParameter(prefix + "font"));
- initParameter("legendFont", getParameter(prefix + "legendFont"));
- initParameter("3DModeOn", getParameter(prefix + "3DModeOn"));
- initParameter("3DDepth", getParameter(prefix + "3DDepth"));
- initParameter("legendLabels", getParameter(prefix + "legendLabels"));
- initParameter("graphInsets", getParameter(prefix + "graphInsets"));
- initParameter("rangeDecimalCount", getParameter(prefix + "rangeDecimalCount"));
- initParameter("rangeDecimalCount_2", getParameter(prefix + "rangeDecimalCount_2"));
- initParameter("valueLinesOn", getParameter(prefix + "valueLinesOn"));
- initParameter("maxValueLineCount", getParameter(prefix + "maxValueLineCount"));
- initParameter("sampleAxisRange", getParameter(prefix + "sampleAxisRange"));
- initParameter("defaultGridLinesOn", getParameter(prefix + "defaultGridLinesOn"));
- initParameter("gridLines", getParameter(prefix + "gridLines"));
- initParameter("gridLinesColor", getParameter(prefix + "gridLinesColor"));
- initParameter("defaultGridLinesColor", getParameter(prefix + "defaultGridLinesColor"));
- initParameter("gridLineColors", getParameter(prefix + "gridLineColors"));
- initParameter("valueLinesColor", getParameter(prefix + "valueLinesColor"));
- initParameter("rangeLabelsOff", getParameter(prefix + "rangeLabelsOff"));
- initParameter("rangeLabelFont", getParameter(prefix + "rangeLabelFont"));
- initParameter("rangeLabelPrefix", getParameter(prefix + "rangeLabelPrefix"));
- initParameter("rangeLabelPostfix", getParameter(prefix + "rangeLabelPostfix"));
- initParameter("sampleAxisLabel", getParameter(prefix + "sampleAxisLabel"));
- initParameter("rangeAxisLabel", getParameter(prefix + "rangeAxisLabel"));
- initParameter("rangeAxisLabel_2", getParameter(prefix + "rangeAxisLabel_2"));
- initParameter("sampleAxisLabelFont", getParameter(prefix + "sampleAxisLabelFont"));
- initParameter("rangeAxisLabelFont", getParameter(prefix + "rangeAxisLabelFont"));
- initParameter("visibleSamples", getParameter(prefix + "visibleSamples"));
- initParameter("rangeAxisLabelAngle", getParameter(prefix + "rangeAxisLabelAngle"));
- initParameter("rangeAxisLabelAngle_2", getParameter(prefix + "rangeAxisLabelAngle_2"));
- initParameter("sampleAxisLabelAngle", getParameter(prefix + "sampleAxisLabelAngle"));
- initParameter("valueLabelAngle", getParameter(prefix + "valueLabelAngle"));
- initParameter("barLabelAngle", getParameter(prefix + "barLabelAngle"));
- initParameter("sampleLabelAngle", getParameter(prefix + "sampleLabelAngle"));
- initParameter("rangePosition", getParameter(prefix + "rangePosition"));
- initParameter("rangePosition_2", getParameter(prefix + "rangePosition_2"));
- initParameter("rangeAdjusterPosition", getParameter(prefix + "rangeAdjusterPosition"));
- initParameter("rangeAdjusterPosition_2", getParameter(prefix + "rangeAdjusterPosition_2"));
- initParameter("rangeColor", getParameter(prefix + "rangeColor"));
- initParameter("rangeColor_2", getParameter(prefix + "rangeColor_2"));
- initParameter("rangeAdjusted_1", getParameter(prefix + "rangeAdjusted_1"));
- initParameter("rangeAdjusted_2", getParameter(prefix + "rangeAdjusted_2"));
- initParameter("sampleDecimalCount", getParameter(prefix + "sampleDecimalCount"));
- initParameter("valueLabelPrefix", getParameter(prefix + "valueLabelPrefix"));
- initParameter("valueLabelPostfix", getParameter(prefix + "valueLabelPostfix"));
- initParameter("printAsBitmap", getParameter(prefix + "printAsBitmap"));
- initParameter("floatingLabelFont", getParameter(prefix + "floatingLabelFont"));
- initParameter("floatingOnLegendOff", getParameter(prefix + "floatingOnLegendOff"));
- for(int i1 = 0; i1 < i; i1++)
- {
- initParameter("valueLabelPrefix_" + i1, getParameter(prefix + "valueLabelPrefix_" + i1));
- initParameter("valueLabelPostfix_" + i1, getParameter(prefix + "valueLabelPostfix_" + i1));
- initParameter("seriesRange_" + i1, getParameter(prefix + "seriesRange_" + i1));
- initParameter("valueLabelsOn_" + i1, getParameter(prefix + "valueLabelsOn_" + i1));
- initParameter("sampleDecimalCount_" + i1, getParameter(prefix + "sampleDecimalCount_" + i1));
- }
- initParameter("urltarget", getParameter(prefix + "sample_urltarget"));
- for(int j1 = 0; j1 < j; j1++)
- {
- initParameter("url_" + j1, getParameter(prefix + "sample" + j1 + "_url"));
- initParameter("urltarget_" + j1, getParameter(prefix + "sample" + j1 + "_urltarget"));
- }
- initParameter("url", getParameter(prefix + "url"));
- setParameter("urltarget", "_self");
- initParameter("urltarget", getParameter(prefix + "urltarget"));
- int k1 = Math.max(i, j);
- for(int l1 = 0; l1 < k1; l1++)
- {
- initParameter("url_" + l1, getParameter(prefix + "url_" + l1));
- initParameter("urltarget_" + l1, getParameter(prefix + "urltarget_" + l1));
- }
- for(int i2 = 0; i2 < i; i2++)
- {
- for(int j2 = 0; j2 < j; j2++)
- {
- String s7 = "url_" + i2 + "_" + j2;
- initParameter(s7, getParameter(prefix + s7));
- s7 = "urltarget_" + i2 + "_" + j2;
- initParameter(s7, getParameter(prefix + s7));
- }
- }
- k1 = 0;
- targets = new Hashtable();
- for(String s6 = getParameter(prefix + "targetValueLine_0"); s6 != null && s6.length() > 0; s6 = getParameter(prefix + "targetValueLine_" + k1))
- {
- initParameter("targetValueLine_" + k1, s6);
- k1++;
- }
- String as[] = theChart.getLegendLabels();
- if(as != null)
- {
- for(int k2 = 0; k2 < as.length; k2++)
- {
- String s8 = getParameter(prefix + "legendImage_" + k2);
- initParameter("legendImage_" + k2, s8);
- }
- }
- theChart.setAutomaticRepaintOn(true);
- }
- protected Font createFont(String s, String s1, int i, int j)
- {
- StringTokenizer stringtokenizer = new StringTokenizer(s, ",");
- String s2 = s1;
- int k = Math.max(0, j);
- int l = i;
- if(stringtokenizer.hasMoreTokens())
- s2 = stringtokenizer.nextToken();
- if(stringtokenizer.hasMoreTokens())
- l = getFontType(stringtokenizer.nextToken());
- if(stringtokenizer.hasMoreTokens())
- try
- {
- k = Integer.parseInt(stringtokenizer.nextToken().trim());
- }
- catch(NumberFormatException numberformatexception)
- {
- k = 12;
- }
- return new Font(s2, l, k);
- }
- public void print(Graphics g)
- {
- theChart.print(g);
- }
- private String createURLParam(String s, int i, int j)
- {
- String s1 = s;
- if(i >= 0)
- s1 = s1 + "_" + i;
- if(j >= 0)
- s1 = s1 + "_" + j;
- return s1;
- }
- /**
- * @deprecated Method init is deprecated
- */
- protected void init(Chart chart)
- {
- theChart = chart;
- init();
- }
- /**
- * @deprecated Method setParameter is deprecated
- */
- protected void setParameter(Chart chart, String s, String s1)
- {
- theChart = chart;
- setParameter(s, s1);
- }
- public Chart theChart;
- protected Vector overlayChartApplets;
- private String prefix;
- private double rangeStep[];
- private int automaticRefreshTime;
- private Thread refreshThread;
- protected String labelDelimiter;
- private Hashtable targets;
- private Hashtable urlList;
- private Hashtable urlTargetList;
- private static Cursor HAND_CURSOR;
- private static Cursor POINT_CURSOR;
- private int lastSelectedSample;
- private int lastSelectedSeries;
- private long lastSelectedTime;
- private static final int DOUBLE_CLICK_TIME = 350;
- private Applet parentApplet;
- }