Package timeflow.format.file

Examples of timeflow.format.file.HtmlFormat


  }
 
 
  void makeList()
  {
    HtmlFormat html=new HtmlFormat();
    html.setModel(getModel());
    StringBuffer page=new StringBuffer();
   
    page.append(html.makeHeader());
   
   
    ActList as=getModel().getActs();
    if (as==null || as.size()==0 && getModel().getDB().size()==0)
    {
      page.append("<tr><td><h1><font color=#003399>Empty Database</font></h1></td></tr>");
      showPageMenu(false);
    }
    else
    {
     
      if (sort==null)
      {
        Field timeField=getModel().getDB().getField(VirtualField.START);
        if (timeField!=null)     
          sort=ActComparator.by(timeField);
      }

      acts=as.copy();
      if (sort!=null)
        Collections.sort(acts, sort);
     
      boolean pages=acts.size()>maxPerPage;
      int last=Math.min(acts.size(), pageStart+maxPerPage);
      if (pages)
      {
        int n=acts.size();
        if (lastSize!=n)
        {
          pageMenu.removeActionListener(pageListener);
          pageMenu.removeAllItems();
          for (int i=0; i*maxPerPage<n;i++)
          {
            pageMenu.addItem("Items "+((i*maxPerPage)+1)+" to "+
                Math.min(n, (i+1)*maxPerPage));
          }
          pageMenu.addActionListener(pageListener);
          lastSize=n;
        }
      }
      showPageMenu(pages);
     
      page.append("<tr><td><h1><font color=#003399>"+(pages? (pageStart+1)+"-"+(last) +" of ": "")+acts.size()+" Events</font></h1>");
      page.append("<br><br></td></tr>");

      for (int i=pageStart; i<last; i++)
      {
        Act a=acts.get(i);
        page.append(html.makeItem(a,i));
      }
    }
    page.append(html.makeFooter());
    listDisplay.setText(page.toString());
    listDisplay.setCaretPosition(0);
    repaint();
  }
View Full Code Here

TOP

Related Classes of timeflow.format.file.HtmlFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.