本文整理汇总了Java中org.jfree.chart.ChartPanel.setEnforceFileExtensions方法的典型用法代码示例。如果您正苦于以下问题:Java ChartPanel.setEnforceFileExtensions方法的具体用法?Java ChartPanel.setEnforceFileExtensions怎么用?Java ChartPanel.setEnforceFileExtensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.ChartPanel
的用法示例。
在下文中一共展示了ChartPanel.setEnforceFileExtensions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAndShow
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
/**
*
* @throws Exception
*/
@Override
public void createAndShow() throws Exception{
piePlt frameToShow;
//toShow = toShow.replace(" ","");
if(!toShow.startsWith("piePlt")||toShow.length()<7)
return;
String tt = jc.getInside(toShow.substring(7),'(',')');
String title=null,exploded=null,bf="";
if(tt.indexOf('{')==-1)
throw new Exception("piePlot is not defined correctly!");
String txt=tt.substring(0,tt.indexOf('{'));
for(int i = 0;i<txt.length();i++){
if(txt.charAt(i) == ','){
if(bf.contentEquals(""))
throw new Exception("piePlot is not defined correctly!");
if(bf.indexOf('=')!= -1){
switch (bf.substring(0,bf.indexOf('=')).toLowerCase().trim()) {
case "title":
if(title != null)
throw new Exception("piePlot is not defined correctly!");
title=bf.substring(bf.indexOf('=')+1);
bf="";
break;
default:
if(exploded != null)
throw new Exception("piePlot is not defined correctly!");
exploded=bf;
bf="";
break;
}
}
else{
if(title == null){
title=bf;
bf="";
}else
throw new Exception("piePlot is not defined correctly!");
}
}
else
bf=bf+txt.charAt(i);
}
if(tt.endsWith("{"))
throw new Exception("barPlot is not defined correctly!");
txt = tt.substring(tt.indexOf('{')+1);
frameToShow = new piePlt(title,jc.getInside(txt,'{','}'));
ChartPanel chartP = new ChartPanel(frameToShow.getChart());
chartP.setPreferredSize(new java.awt.Dimension(500, 500));
chartP.setEnforceFileExtensions(false);
if(exploded != null){
PiePlot plot = (PiePlot) frameToShow.getChart().getPlot();
plot.setExplodePercent(exploded.substring(0,exploded.indexOf('=')),
new Double(jc.eval("2dbl("+jc.eval(exploded.substring(exploded.indexOf('=')+1))+")")) );
}
frameToShow.setContentPane(chartP);
frameToShow.setJMenuBar(barPlt.getMenu(frameToShow.getChart(),frameToShow));
frameToShow.pack();
RefineryUtilities.centerFrameOnScreen(frameToShow);
frameToShow.setVisible(true);
}
示例2: createAndShow
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
@Override
public void createAndShow() throws Exception {
ArrayList<String> XYdata = new ArrayList<>();
ArrayList<String> titles=new ArrayList<>();
vfPlt frameToShow;
//toShow = toShow.replace(" ","");
if(!toShow.startsWith("vfPlt")||toShow.length()<6)
return;
String txt = jc.getInside(toShow.substring(6),'(',')');
String data="",bf="";
boolean addToData=false;
if(txt.indexOf('{')==-1)
throw new Exception("vfPlt is not defined correctly!");
for(int i = 0;i<txt.length();i++){
switch(txt.charAt(i)){
case '{':
addToData=true;
break;
case '}':
if(!addToData)
throw new Exception("vfPlt is not defined correctly!");
data=data+","+bf;
XYdata.add(data);
data="";
bf="";
addToData=false;
break;
case ',':
if(addToData)
if(data.contentEquals(""))
data=data+bf;
else
data=data+","+bf;
else
if(!bf.contentEquals(""))
titles.add(bf);
bf="";
break;
default:
bf=bf+txt.charAt(i);
break;
}
}
if(txt.endsWith("{"))
throw new Exception("vfPlt is not defined correctly!");
frameToShow = new vfPlt(titles,XYdata);
ChartPanel chartP = new ChartPanel(frameToShow.getChart());
chartP.setPreferredSize(new java.awt.Dimension(500, 500));
chartP.setEnforceFileExtensions(false);
frameToShow.setContentPane(chartP);
frameToShow.setJMenuBar(barPlt.getMenu(frameToShow.getChart(),frameToShow));
frameToShow.pack();
RefineryUtilities.centerFrameOnScreen(frameToShow);
frameToShow.setVisible(true);
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
示例3: createAndShow
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
/**
*
* @throws Exception
*/
@Override
public void createAndShow() throws Exception{
ArrayList<String> XYdata = new ArrayList<>();
ArrayList<String> titles=new ArrayList<>();
xyLinePlt frameToShow;
//toShow = toShow.replace(" ","");
if(!toShow.startsWith("xyLinePlt")||toShow.length()<10)
return;
String txt = jc.getInside(toShow.substring(10),'(',')');
String data="",bf="";
boolean addToData=false;
if(txt.indexOf('{')==-1)
throw new Exception("xyLinePlt is not defined correctly!");
for(int i = 0;i<txt.length();i++){
switch(txt.charAt(i)){
case '{':
addToData=true;
break;
case '}':
if(!addToData)
throw new Exception("xyLinePlt is not defined correctly!");
data=data+","+bf;
XYdata.add(data);
data="";
bf="";
addToData=false;
break;
case ',':
if(addToData)
if(data.contentEquals(""))
data=data+bf;
else
data=data+","+bf;
else
if(!bf.contentEquals(""))
titles.add(bf);
bf="";
break;
default:
bf=bf+txt.charAt(i);
break;
}
}
if(txt.endsWith("{"))
throw new Exception("xyLinePlt is not defined correctly!");
frameToShow = new xyLinePlt(titles,XYdata);
ChartPanel chartP = new ChartPanel(frameToShow.getChart());
chartP.setPreferredSize(new java.awt.Dimension(500, 500));
chartP.setEnforceFileExtensions(false);
frameToShow.setContentPane(chartP);
frameToShow.setJMenuBar(barPlt.getMenu(frameToShow.getChart(),frameToShow));
frameToShow.pack();
RefineryUtilities.centerFrameOnScreen(frameToShow);
frameToShow.setVisible(true);
}
示例4: createAndShow
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
/**
*
* @throws Exception
*/
@Override
public void createAndShow() throws Exception{
ArrayList<String> XYdata = new ArrayList<>();
ArrayList<String> titles=new ArrayList<>();
xyPlt frameToShow;
//toShow = toShow.replace(" ","");
if(!toShow.startsWith("xyPlt")||toShow.length()<6)
return;
String txt = jc.getInside(toShow.substring(6),'(',')');
String data="",bf="";
boolean addToData=false;
if(txt.indexOf('{')==-1)
throw new Exception("xyPlt is not defined correctly!");
for(int i = 0;i<txt.length();i++){
switch(txt.charAt(i)){
case '{':
addToData=true;
break;
case '}':
if(!addToData)
throw new Exception("xyPlt is not defined correctly!");
data=data+","+bf;
XYdata.add(data);
data="";
bf="";
addToData=false;
break;
case ',':
if(addToData)
if(data.contentEquals(""))
data=data+bf;
else
data=data+","+bf;
else
if(!bf.contentEquals(""))
titles.add(bf);
bf="";
break;
default:
bf=bf+txt.charAt(i);
break;
}
}
if(txt.endsWith("{"))
throw new Exception("xyPlt is not defined correctly!");
frameToShow = new xyPlt(titles,XYdata);
ChartPanel chartP = new ChartPanel(frameToShow.getChart());
chartP.setPreferredSize(new java.awt.Dimension(500, 500));
chartP.setEnforceFileExtensions(false);
frameToShow.setContentPane(chartP);
frameToShow.setJMenuBar(xyPlt.getMenu(frameToShow.getChart(),frameToShow));
frameToShow.pack();
RefineryUtilities.centerFrameOnScreen(frameToShow);
frameToShow.setVisible(true);
}