📄 chartapplet.java
字号:
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);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -