当前位置: 首页>>代码示例>>Java>>正文


Java ChartPanel.setEnforceFileExtensions方法代码示例

本文整理汇总了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);
}
 
开发者ID:mathhobbit,项目名称:EditCalculateAndChart,代码行数:66,代码来源:piePlt.java

示例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.
}
 
开发者ID:mathhobbit,项目名称:EditCalculateAndChart,代码行数:62,代码来源:vfPlt.java

示例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);
}
 
开发者ID:mathhobbit,项目名称:EditCalculateAndChart,代码行数:63,代码来源:xyLinePlt.java

示例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);
}
 
开发者ID:mathhobbit,项目名称:EditCalculateAndChart,代码行数:63,代码来源:xyPlt.java


注:本文中的org.jfree.chart.ChartPanel.setEnforceFileExtensions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。