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