jped-cvs Mailing List for JPEd
Status: Abandoned
Brought to you by:
tchize
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(18) |
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 14:09:18
|
Update of /cvsroot/jped/CVSROOT In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25360 Modified Files: loginfo Log Message: updated commit script to make cumulative message to mailing list (and not 1 per file) Index: loginfo =================================================================== RCS file: /cvsroot/jped/CVSROOT/loginfo,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** loginfo 17 Aug 2006 07:40:01 -0000 1.2 --- loginfo 17 Aug 2006 14:09:14 -0000 1.3 *************** *** 26,28 **** # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ! DEFAULT /cvsroot/sitedocs/CVSROOT/cvstools/syncmail %{sVv} jpe...@li... --- 26,29 ---- # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ! DEFAULT $CVSROOT/CVSROOT/log_accum -S -m jpe...@li... %{Vvts} ! CVSROOT $CVSROOT/CVSROOT/syncmail %{sVv} de...@om... |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:53:27
|
Update of /cvsroot/jped/Plugins/shark-form/src/org/jped/plugins/form/shark In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19425/shark-form/src/org/jped/plugins/form/shark Modified Files: Tag: PluginsAndFlexibleUI FormManager.java FormPlugin.java FormEditor.java Log Message: Updated to fit JPEd change to PDFPlugin interface Index: FormPlugin.java =================================================================== RCS file: /cvsroot/jped/Plugins/shark-form/src/org/jped/plugins/form/shark/Attic/FormPlugin.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** FormPlugin.java 11 Aug 2006 12:24:59 -0000 1.1.2.1 --- FormPlugin.java 17 Aug 2006 13:53:23 -0000 1.1.2.2 *************** *** 32,38 **** --- 32,42 ---- import org.jped.plugins.PluggedComponent; import org.jped.plugins.TooltipGeneratorPlugin; + import org.jped.plugins.chains.PDFDocumentChain; + import org.jped.plugins.chains.PDFElementChain; + import org.jped.plugins.chains.PDFSectionChain; import com.lowagie.text.BadElementException; import com.lowagie.text.Document; + import com.lowagie.text.DocumentException; import com.lowagie.text.Element; import com.lowagie.text.Image; *************** *** 50,54 **** return "Forms editor plugin"; case INFO_VERSION: ! return "1.0"; case INFO_DESCRIPTION: return "Plugin providing components used to edit forms"; --- 54,58 ---- return "Forms editor plugin"; case INFO_VERSION: ! return "0.1"; case INFO_DESCRIPTION: return "Plugin providing components used to edit forms"; *************** *** 138,165 **** return this; } - - public void beginProcessDocument(Document document, PdfWriter writer, XMLElement element, Graph graph) { - } - - public void beginSection(Section section, XMLElement element) { - } - - public void endProcessDocument(Document document, XMLElement element) { - - } - - public void endSection(Section section, XMLElement element) { - if (element instanceof Activity){ - PdfPTable activityForm = createActivityForm((Activity)element); - section.add(activityForm); - } else if (element instanceof DataField){ - Image i = getIconImage(new FormManager().getFieldIcon((DataField)element)); - i.scalePercent(75.0f); - Paragraph p = new Paragraph(); - p.setAlignment(Element.ALIGN_CENTER); - p.add(i); - section.add(p); - } - } private HashMap iconImages = new HashMap(); private static final int MIN_WIDTH=150; --- 142,145 ---- *************** *** 209,212 **** --- 189,216 ---- } + public Document processDocument(PDFDocumentChain chain) throws DocumentException { + return chain.next(); + } + + public Element processElement(PDFElementChain chain) throws DocumentException { + return chain.next(); + } + + public Section processSection(PDFSectionChain chain) throws DocumentException { + Section section = chain.next(); + XMLElement element = chain.getElement(); + if (element instanceof Activity){ + PdfPTable activityForm = createActivityForm((Activity)element); + section.add(activityForm); + } else if (element instanceof DataField){ + Image i = getIconImage(new FormManager().getFieldIcon((DataField)element)); + i.scalePercent(75.0f); + Paragraph p = new Paragraph(); + p.setAlignment(Element.ALIGN_CENTER); + p.add(i); + section.add(p); + } + return section; + } } Index: FormManager.java =================================================================== RCS file: /cvsroot/jped/Plugins/shark-form/src/org/jped/plugins/form/shark/Attic/FormManager.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** FormManager.java 11 Aug 2006 12:24:59 -0000 1.1.2.1 --- FormManager.java 17 Aug 2006 13:53:23 -0000 1.1.2.2 *************** *** 123,127 **** formItems.add(field); // descriptions.put(field,new I18NText(field.getDescription())); ! descriptions.put(field,field.getDescription()); return formItems.size()-1; } --- 123,128 ---- formItems.add(field); // descriptions.put(field,new I18NText(field.getDescription())); ! // descriptions.put(field,field.getDescription()); ! descriptions.put(field,JaWEManager.getInstance().getJaWEController().getFilteredProperty(field,"Description")); return formItems.size()-1; } Index: FormEditor.java =================================================================== RCS file: /cvsroot/jped/Plugins/shark-form/src/org/jped/plugins/form/shark/Attic/FormEditor.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** FormEditor.java 11 Aug 2006 12:25:00 -0000 1.1.2.1 --- FormEditor.java 17 Aug 2006 13:53:23 -0000 1.1.2.2 *************** *** 421,425 **** switch (columnIndex){ case 0: ! return (field.getName()==null || field.getName().length()<1)?field.getId():field.getName(); case 1: return descriptions.get(field); --- 421,426 ---- switch (columnIndex){ case 0: ! String name = JaWEManager.getInstance().getJaWEController().getFilteredProperty(field,"Name"); ! return (name==null || name.length()<1)?field.getId():name; case 1: return descriptions.get(field); *************** *** 466,470 **** formItems.add(field); // descriptions.put(field,new I18NText(field.getDescription())); ! descriptions.put(field,field.getDescription()); updateColumnWidth(); fireTableRowsInserted(formItems.size()-1,formItems.size()); --- 467,472 ---- formItems.add(field); // descriptions.put(field,new I18NText(field.getDescription())); ! // descriptions.put(field,field.getDescription()); ! descriptions.put(field,JaWEManager.getInstance().getJaWEController().getFilteredProperty(field,"Description")); updateColumnWidth(); fireTableRowsInserted(formItems.size()-1,formItems.size()); |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:27:52
|
Update of /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8874/modules/PluginManagement/src/org/jped/plugins Modified Files: Tag: PluginsAndFlexibleUI CorePlugin.java PluggableTooltipGenerator.java Plugin.java CorePDFPlugin.java AbstractPlugin.java PluginsManager.java PluggedComponent.java PDFPluginNotifier.java PDFPlugin.java BasicPluggedComponent.java Log Message: Added value filtering plugin (used for presenting xpdl datas to user when they can be rather complexe or need to be translated) Changed PDF plugins interface to work as a chain, added pluggability for the data elements in addition to existing section and document elements Index: PluggableTooltipGenerator.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/Attic/PluggableTooltipGenerator.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** PluggableTooltipGenerator.java 10 Aug 2006 14:45:09 -0000 1.1.2.1 --- PluggableTooltipGenerator.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 1,6 **** package org.jped.plugins; - import java.util.ArrayList; - import org.enhydra.jawe.JaWEManager; import org.enhydra.jawe.base.tooltip.StandardTooltipGenerator; --- 1,4 ---- Index: Plugin.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/Attic/Plugin.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Plugin.java 10 Aug 2006 14:45:09 -0000 1.1.2.1 --- Plugin.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 3,6 **** --- 3,7 ---- import org.enhydra.jawe.JaWEManager; import org.jped.base.editor.Wizard; + import org.jped.filter.ValueFilter; *************** *** 41,43 **** --- 42,55 ---- */ public TooltipGeneratorPlugin getTooltipGenerator(); + /** + * Provide the ValueFilter of this plugin, if any. + * Value filters are used when, in visual rendering, a 'toValue()' + * has to be called on an XMLElement. This let the plugin define + * a custom value visual value for the XMLElement. Note that most + * of the jawe core don't use it and it's not going to be fixed, as + * we need to keep backward compatibility. + * @return The ValueFilter of plugin or null if plugin does not provide + * a ValueFilter + */ + public ValueFilter getValueFilter(); } Index: PDFPlugin.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/Attic/PDFPlugin.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** PDFPlugin.java 10 Aug 2006 14:45:09 -0000 1.1.2.1 --- PDFPlugin.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 1,40 **** package org.jped.plugins; ! import org.enhydra.jawe.components.graph.Graph; ! import org.enhydra.shark.xpdl.XMLElement; import com.lowagie.text.Document; import com.lowagie.text.Section; - import com.lowagie.text.pdf.PdfWriter; public interface PDFPlugin { ! ! /** Called on each plugin before starting to generate a pdf document. At the moment of calling, document is empty and ! * a pdfwriter has been associated with it ! * @param document The document that will be generated ! * @param writer The pdf writer associated with document ! * @param graph The graph associated with the process ! * @param process The workflow process we are dumping to pdf ! */ ! public void beginProcessDocument(Document document, PdfWriter writer, XMLElement element, Graph graph); ! /** ! * Called just before closing the document ! * @param document The document we are going to close ! * @param element The process that go dumped in pdf ! */ ! public void endProcessDocument(Document document, XMLElement element); ! /** ! * Called before creating the content of the given Section for the given Element. Behaviour of ! * this function may vary depending on the kind of xpdl element processed ! * @param section The section we are building ! * @param element The XPDL element that is going to be dumped ! */ ! public void beginSection(Section section, XMLElement element); ! /** ! * Called after creating the content of the given Section for the given Element. Behaviour of ! * this function may vary depending on the kind of xpdl element processed ! * @param section The section we are building ! * @param element The XPDL element that was just dumped ! */ ! public void endSection(Section section, XMLElement element); } --- 1,16 ---- package org.jped.plugins; ! import org.jped.plugins.chains.PDFDocumentChain; ! import org.jped.plugins.chains.PDFElementChain; ! import org.jped.plugins.chains.PDFSectionChain; import com.lowagie.text.Document; + import com.lowagie.text.DocumentException; + import com.lowagie.text.Element; import com.lowagie.text.Section; public interface PDFPlugin { ! public Document processDocument(PDFDocumentChain chain) throws DocumentException; ! public Section processSection(PDFSectionChain chain) throws DocumentException; ! public Element processElement(PDFElementChain chain) throws DocumentException; } Index: CorePlugin.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/Attic/CorePlugin.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** CorePlugin.java 10 Aug 2006 14:45:09 -0000 1.1.2.1 --- CorePlugin.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 1,4 **** --- 1,6 ---- package org.jped.plugins; + import java.util.logging.Logger; + import org.enhydra.jawe.JaWEManager; import org.jped.base.editor.Wizard; *************** *** 12,16 **** */ public class CorePlugin extends AbstractPlugin { ! PDFPlugin pdfInterface; public String getInfo(int infoType) { --- 14,19 ---- */ public class CorePlugin extends AbstractPlugin { ! private static Logger log = Logger.getLogger(CorePDFPlugin.class.getName()); ! PDFPlugin pdfInterface; public String getInfo(int infoType) { *************** *** 28,32 **** public boolean init(JaWEManager manager) { ! System.out.println("Initialized..."); return true; } --- 31,35 ---- public boolean init(JaWEManager manager) { ! log.fine("CorePlugin Initialized..."); return true; } Index: PluggedComponent.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/Attic/PluggedComponent.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** PluggedComponent.java 10 Aug 2006 14:45:09 -0000 1.1.2.1 --- PluggedComponent.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 1,6 **** package org.jped.plugins; - import javax.swing.JComponent; - import org.enhydra.jawe.base.panel.panels.XMLPanel; --- 1,4 ---- Index: PDFPluginNotifier.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/Attic/PDFPluginNotifier.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** PDFPluginNotifier.java 10 Aug 2006 14:45:09 -0000 1.1.2.1 --- PDFPluginNotifier.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 1,10 **** package org.jped.plugins; import org.enhydra.jawe.components.graph.Graph; import org.enhydra.shark.xpdl.XMLElement; import com.lowagie.text.Document; import com.lowagie.text.Section; - import com.lowagie.text.pdf.PdfWriter; /** --- 1,18 ---- package org.jped.plugins; + import java.io.OutputStream; + import java.util.logging.Level; + import java.util.logging.Logger; + import org.enhydra.jawe.components.graph.Graph; import org.enhydra.shark.xpdl.XMLElement; + import org.jped.plugins.chains.impl.SimplePDFDocumentChain; + import org.jped.plugins.chains.impl.SimplePDFElementChain; + import org.jped.plugins.chains.impl.SimplePDFSectionChain; import com.lowagie.text.Document; + import com.lowagie.text.DocumentException; + import com.lowagie.text.Element; import com.lowagie.text.Section; /** *************** *** 14,40 **** * */ ! public class PDFPluginNotifier implements PDFPlugin { ! private PDFPlugin[] pluginInterfaces; public PDFPluginNotifier(PluginsManager manager){ pluginInterfaces = manager.getPdfPluginInterfaces(); } ! public void beginProcessDocument(Document document, PdfWriter writer, XMLElement element, Graph graph) { ! for (int i=0;i<pluginInterfaces.length;i++) ! pluginInterfaces[i].beginProcessDocument(document,writer,element, graph); } ! public void beginSection(Section section, XMLElement element) { ! for (int i=0;i<pluginInterfaces.length;i++) ! pluginInterfaces[i].beginSection(section,element); } ! public void endProcessDocument(Document document, XMLElement element) { ! for (int i=0;i<pluginInterfaces.length;i++) ! pluginInterfaces[i].endProcessDocument(document,element); } ! public void endSection(Section section, XMLElement element) { ! for (int i=0;i<pluginInterfaces.length;i++) ! pluginInterfaces[i].endSection(section,element); } } --- 22,83 ---- * */ ! public class PDFPluginNotifier { ! private Logger log = Logger.getLogger(PDFPluginNotifier.class.getName()); ! private PDFPlugin[] pluginInterfaces; + private Section enclosingSection; public PDFPluginNotifier(PluginsManager manager){ pluginInterfaces = manager.getPdfPluginInterfaces(); + if (log.isLoggable(Level.FINE)){ + log.fine("there are "+pluginInterfaces.length+" pdf plugins"); + for (int i = 0;i<pluginInterfaces.length;i++) + log.fine("plugins["+i+"]="+pluginInterfaces[i]); + } } ! ! public Document processDocument(XMLElement element, Graph graph, OutputStream output) throws DocumentException{ ! SimplePDFDocumentChain chain = null; ! for (int i=pluginInterfaces.length-1;i>=0;i--) ! chain=new SimplePDFDocumentChain( ! element, ! graph, ! output, ! pluginInterfaces[i], ! this, ! chain); ! return chain.processPlugin(); ! } ! ! public Section processSection(XMLElement element) throws DocumentException{ ! SimplePDFSectionChain chain = null; ! for (int i=pluginInterfaces.length-1;i>=0;i--) ! chain=new SimplePDFSectionChain( ! element, ! pluginInterfaces[i], ! this, ! chain); ! return chain.processPlugin(); } ! ! public Element processElement(XMLElement element) throws DocumentException{ ! SimplePDFElementChain chain = null; ! for (int i=pluginInterfaces.length-1;i>=0;i--) ! chain=new SimplePDFElementChain( ! element, ! pluginInterfaces[i], ! this, ! chain); ! return chain.processPlugin(); } ! ! public Section getEnclosingSection() { ! return enclosingSection; ! } ! ! public void setEnclosingSection(Section enclosingSection) { ! this.enclosingSection = enclosingSection; } } Index: CorePDFPlugin.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/Attic/CorePDFPlugin.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** CorePDFPlugin.java 10 Aug 2006 14:45:09 -0000 1.1.2.1 --- CorePDFPlugin.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 3,7 **** import java.awt.BasicStroke; import java.awt.Color; - import java.awt.Component; import java.awt.Dimension; import java.awt.Graphics; --- 3,6 ---- *************** *** 9,38 **** import java.awt.RenderingHints; import java.awt.geom.AffineTransform; - import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.enhydra.jawe.JaWEManager; - import org.enhydra.jawe.JaWEMng; import org.enhydra.jawe.base.controller.JaWEType; - import org.enhydra.jawe.components.graph.DefaultGraphActivityView; import org.enhydra.jawe.components.graph.Graph; - import org.enhydra.jawe.components.graph.GraphActivityInterface; import org.enhydra.shark.xpdl.XMLElement; import org.enhydra.shark.xpdl.elements.Activity; import org.enhydra.shark.xpdl.elements.DataField; import org.enhydra.shark.xpdl.elements.Transition; import org.enhydra.shark.xpdl.elements.Transitions; import org.enhydra.shark.xpdl.elements.WorkflowProcess; ! import org.jgraph.graph.CellViewRenderer; ! ! //import be.rmi.jawe.FormManager; ! //import be.rmi.jawe.I18NText; import com.lowagie.text.BadElementException; import com.lowagie.text.Document; import com.lowagie.text.DocumentException; --- 8,41 ---- import java.awt.RenderingHints; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.io.IOException; + import java.util.Collections; + import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; + import java.util.logging.Logger; import org.enhydra.jawe.JaWEManager; import org.enhydra.jawe.base.controller.JaWEType; import org.enhydra.jawe.components.graph.Graph; import org.enhydra.shark.xpdl.XMLElement; + import org.enhydra.shark.xpdl.elements.Activities; import org.enhydra.shark.xpdl.elements.Activity; import org.enhydra.shark.xpdl.elements.DataField; + import org.enhydra.shark.xpdl.elements.DataFields; import org.enhydra.shark.xpdl.elements.Transition; import org.enhydra.shark.xpdl.elements.Transitions; import org.enhydra.shark.xpdl.elements.WorkflowProcess; ! import org.jped.plugins.chains.PDFChain; ! import org.jped.plugins.chains.PDFDocumentChain; ! import org.jped.plugins.chains.PDFElementChain; ! import org.jped.plugins.chains.PDFSectionChain; import com.lowagie.text.BadElementException; + import com.lowagie.text.Chapter; + import com.lowagie.text.ChapterAutoNumber; + import com.lowagie.text.Chunk; import com.lowagie.text.Document; import com.lowagie.text.DocumentException; *************** *** 41,44 **** --- 44,48 ---- import com.lowagie.text.FontFactory; import com.lowagie.text.Image; + import com.lowagie.text.PageSize; import com.lowagie.text.Paragraph; import com.lowagie.text.Phrase; *************** *** 50,54 **** public class CorePDFPlugin implements PDFPlugin { ! private static Font CHAPTER_FONT = FontFactory.getFont(FontFactory.HELVETICA,24,Font.BOLD,Color.BLACK); --- 54,58 ---- public class CorePDFPlugin implements PDFPlugin { ! private static Logger log = Logger.getLogger(CorePDFPlugin.class.getName()); private static Font CHAPTER_FONT = FontFactory.getFont(FontFactory.HELVETICA,24,Font.BOLD,Color.BLACK); *************** *** 87,97 **** } ! public void beginProcessDocument(Document document, PdfWriter writer, XMLElement element, Graph graph) { ! this.graph=graph; ! WorkflowProcess process; ! if (element instanceof WorkflowProcess) ! process = (WorkflowProcess) element; ! else ! return; com.lowagie.text.Rectangle originalSize = document.getPageSize(); try{ --- 91,95 ---- } ! private void insertGraphImage(Document document, WorkflowProcess process) { com.lowagie.text.Rectangle originalSize = document.getPageSize(); try{ *************** *** 127,220 **** } } - - public void endProcessDocument(Document document, XMLElement element) { - this.graph=null; - } - - public void beginSection(Section section, XMLElement element) { - if (element instanceof Activity){ - Activity activity = (Activity)element; - PdfPTable table = makeActivityTable(activity); - section.add(table); - } else if (element instanceof DataField){ - DataField field = (DataField)element; - section.add(makeDataFieldReport(field)); - } - } - - public void endSection(Section section, XMLElement element) { - // TODO Auto-generated method stub ! } ! ! private void addParameterRow(PdfPTable table, XMLElement elt){ table.addCell(makeBorderLessCell(new Phrase(JaWEManager.getInstance().getLabelGenerator().getLabel(elt),PARAMETER_FONT))); ! table.addCell(makeBorderLessCell(new Phrase(elt.toValue(),NORMAL_FONT))); } ! private PdfPTable makeDataFieldReport(DataField field){ PdfPTable table = new PdfPTable(2); ! addParameterRow(table,field.get("Id")); ! addParameterRow(table,field.get("Name")); ! addParameterRow(table,field.get("InitialValue")); ! table.addCell(makeBorderLessCell(new Phrase(JaWEManager.getInstance().getLabelGenerator().getLabel(field.get("DataType")),PARAMETER_FONT))); ! //TODO move this to a plugin and provide simple default behaviour ! // table.addCell(makeBorderLessCell(new Phrase(FormManager.getChoosenType(field),NORMAL_FONT))); ! // I18NText description = new I18NText(field.getDescription()); ! // String[] languages = JaWEMng.getProperties().getProperty("AllowedLanguages").split(","); ! // PdfPCell cell = makeBorderLessCell(new Phrase(JaWEManager.getInstance().getLabelGenerator().getLabel(field.get("Description")),PARAMETER_FONT)); ! // cell.setColspan(2); ! // table.addCell(cell); ! // table.setWidthPercentage(100); ! // for (int i =-1; i < languages.length;i++){ ! // String lang = i>=0?languages[i]:"default"; ! // String descriptionText = description.getText(lang); ! // if ((descriptionText!=null) && (descriptionText.length()>0)){ ! // String name = JaWEMng.getInstance().getJaWEController().getSettings().getLanguageDependentString("LabelLanguage"+lang); ! // cell=makeBorderLessCell(new Phrase(name+": ",PARAMETER_FONT)); ! // cell.setHorizontalAlignment(Element.ALIGN_RIGHT); ! // table.addCell(cell); ! // table.addCell(makeBorderLessCell(new Phrase(description.getText(lang),NORMAL_FONT))); ! // } ! // } return table; } ! private PdfPCell makeBorderLessCell(Phrase p){ ! PdfPCell cell = new PdfPCell(p); ! cell.setBorderWidth(0.0f); ! return cell; ! } ! private PdfPCell makeBorderLessCell(PdfPTable t){ ! PdfPCell cell = new PdfPCell(t); ! cell.setBorderWidth(0.0f); ! return cell; ! } ! private PdfPCell makeBorderLessCell(String s){ ! return makeBorderLessCell(new Phrase(s)); ! } ! private PdfPCell makeBorderLessCell(Image i){ ! PdfPCell cell = new PdfPCell(i); cell.setBorderWidth(0.0f); return cell; } - private Image getActivityPicture(Activity activity, Graph g) throws Exception{ - GraphActivityInterface gai = g.getGraphManager().getGraphActivity(activity); - DefaultGraphActivityView view = new DefaultGraphActivityView(gai); - view.update(); - CellViewRenderer renderer = view.getRenderer(); - Component c = renderer.getRendererComponent(g,view,false,false,false); - Rectangle2D r = view.getBounds(); - Dimension d = new Dimension((int)r.getWidth(),(int)r.getHeight()); - d = new Dimension(50,50); - c.setSize(d); - BufferedImage bimg = new BufferedImage(d.width,d.height,BufferedImage.TYPE_INT_RGB); - Graphics2D graphics = bimg.createGraphics(); - graphics.setColor(g.getBackground()); - graphics.fillRect(0,0,d.width,d.height); - c.paint(graphics); - Image image = Image.getInstance(bimg,null); - return image; - } private Map transitionPictures = new HashMap(); private Image getTransitionPicture(JaWEType type, boolean incoming, String condition) throws Exception{ --- 125,158 ---- } } ! private void addParameterRow(PdfPTable table, XMLElement elt, PDFChain chain) throws DocumentException{ table.addCell(makeBorderLessCell(new Phrase(JaWEManager.getInstance().getLabelGenerator().getLabel(elt),PARAMETER_FONT))); ! table.addCell(makeBorderLessCell(chain.startProcessElement(elt))); } ! private PdfPTable makeDataFieldReport(DataField field, PDFChain chain) throws DocumentException{ PdfPTable table = new PdfPTable(2); ! addParameterRow(table,field.get("Id"), chain); ! addParameterRow(table,field.get("Name"), chain); ! addParameterRow(table,field.get("InitialValue"), chain); ! addParameterRow(table,field.get("InitialValue"), chain); return table; } ! private PdfPCell makeBorderLessCell(Element elt){ ! PdfPCell cell; ! if (elt instanceof Phrase) ! cell = new PdfPCell((Phrase)elt); ! else if (elt instanceof PdfPTable) ! cell = new PdfPCell((PdfPTable)elt); ! else if (elt instanceof Image) ! cell = new PdfPCell((Image)elt); ! else{ ! cell = new PdfPCell(); ! cell.addElement(elt); ! } cell.setBorderWidth(0.0f); return cell; } private Map transitionPictures = new HashMap(); private Image getTransitionPicture(JaWEType type, boolean incoming, String condition) throws Exception{ *************** *** 273,277 **** } ! private PdfPTable makeActivityTable(Activity activity) { PdfPTable table = new PdfPTable(2); table.setWidthPercentage(100); --- 211,215 ---- } ! private PdfPTable makeActivityTable(Activity activity, PDFSectionChain chain) throws DocumentException { PdfPTable table = new PdfPTable(2); table.setWidthPercentage(100); *************** *** 279,308 **** Rectangle border = new Rectangle(0.0f,0.0f); border.setBorderWidth(0.0f); - // TODO provide default behaviour and do this in a plugin - // I18NText description = new I18NText(activity.getDescription()); - // String[] languages = JaWEMng.getProperties().getProperty("AllowedLanguages").split(","); PdfPTable detailsTable = new PdfPTable(new float[]{0.3f,0.7f}); ! addParameterRow(detailsTable,activity.get("Id")); ! addParameterRow(detailsTable,activity.get("Name")); ! addParameterRow(detailsTable,activity.get("Performer")); ! addParameterRow(detailsTable,activity.get("Deadlines")); ! PdfPCell cell = makeBorderLessCell(new Phrase("Description",PARAMETER_FONT)); ! cell.setColspan(2); ! detailsTable.addCell(cell); ! detailsTable.setWidthPercentage(100); ! // for (int i =-1; i < languages.length;i++){ ! // String lang = i>=0?languages[i]:"default"; ! // String descriptionText = description.getText(lang); ! // if ((descriptionText!=null) && (descriptionText.length()>0)){ ! // String name = JaWEMng.getInstance().getJaWEController().getSettings().getLanguageDependentString("LabelLanguage"+lang); ! // cell=makeBorderLessCell(new Phrase(name+": ",PARAMETER_FONT)); ! // cell.setHorizontalAlignment(Element.ALIGN_RIGHT); ! // detailsTable.addCell(cell); ! // detailsTable.addCell(makeBorderLessCell(new Phrase(description.getText(lang),NORMAL_FONT))); ! // } ! // } ! cell = makeBorderLessCell(detailsTable); ! /*cell.addElement(Chunk.NEWLINE); ! cell.addElement(new Phrase("test"));*/ table.addCell(cell); List transitions; --- 217,227 ---- Rectangle border = new Rectangle(0.0f,0.0f); border.setBorderWidth(0.0f); PdfPTable detailsTable = new PdfPTable(new float[]{0.3f,0.7f}); ! addParameterRow(detailsTable,activity.get("Id"),chain); ! addParameterRow(detailsTable,activity.get("Name"),chain); ! addParameterRow(detailsTable,activity.get("Performer"),chain); ! addParameterRow(detailsTable,activity.get("Deadlines"),chain); ! addParameterRow(detailsTable,activity.get("Description"),chain); ! PdfPCell cell = makeBorderLessCell(detailsTable); table.addCell(cell); List transitions; *************** *** 348,350 **** --- 267,368 ---- } + + public Document processDocument(PDFDocumentChain chain) throws DocumentException{ + this.graph=chain.getGraph(); + Document document = new Document(PageSize.A4); + PdfWriter.getInstance(document,chain.getOutputStream()); + document.open(); + if (chain.getElement() instanceof WorkflowProcess){ + WorkflowProcess process = (WorkflowProcess)chain.getElement(); + insertGraphImage(document,process); + document.add(chain.startProcessSection(process.getDataFields())); + document.add(chain.startProcessSection(process.getActivities())); + } + this.graph=null; + return document; + } + + public Element processElement(PDFElementChain chain) throws DocumentException{ + return new Paragraph(chain.getElement().toValue(),NORMAL_FONT); + } + public Section processSection(PDFSectionChain chain) throws DocumentException{ + if (chain.getElement() instanceof DataFields){ + Chunk chapterTitle; + Paragraph chapterTitleParagraph; + Chapter chapter; + chapterTitle = new Chunk("Variables",CHAPTER_FONT); + chapterTitleParagraph = new Paragraph("",CHAPTER_FONT); + chapterTitleParagraph.add(chapterTitle); + chapter = new ChapterAutoNumber(chapterTitleParagraph); + List dataFields = ((DataFields)chain.getElement()).toElements(); + Collections.sort(dataFields,new Comparator() { + + public int compare(Object o1, Object o2) { + DataField left = (DataField) o1; + DataField right = (DataField) o2; + return left.getId().compareTo(right.getId()); + } + + }); + Section enclosing = chain.getEnclosingSection(); + chain.setEnclosingSection(chapter); + for (Iterator i = dataFields.iterator();i.hasNext();){ + DataField field = (DataField)i.next(); + chain.startProcessSection(field); + } + chain.setEnclosingSection(enclosing); + return chapter; + } + else if (chain.getElement() instanceof DataField){ + DataField field = (DataField)chain.getElement(); + String name = field.getId(); + Paragraph sectionTitle=new Paragraph(name,SECTION_FONT); + Section section = chain.getEnclosingSection().addSection(sectionTitle); + section.add(Chunk.NEWLINE); + section.add(makeDataFieldReport(field,chain)); + return section; + } + else if (chain.getElement() instanceof Activities){ + Chunk chapterTitle; + Paragraph chapterTitleParagraph; + Chapter chapter; + chapterTitle = new Chunk("Activities",CHAPTER_FONT); + chapterTitleParagraph = new Paragraph("",CHAPTER_FONT); + chapterTitleParagraph.add(chapterTitle); + chapter = new ChapterAutoNumber(chapterTitleParagraph); + List activities = ((Activities)chain.getElement()).toElements(); + Collections.sort(activities,new Comparator() { + + public int compare(Object o1, Object o2) { + Activity left = (Activity) o1; + Activity right = (Activity) o2; + return left.getId().compareTo(right.getId()); + } + + }); + Section enclosing = chain.getEnclosingSection(); + chain.setEnclosingSection(chapter); + for (Iterator i = activities.iterator();i.hasNext();){ + Activity activity = (Activity)i.next(); + chain.startProcessSection(activity); + } + chain.setEnclosingSection(enclosing); + return chapter; + } + else if (chain.getElement() instanceof Activity) { + Activity activity = (Activity) chain.getElement(); + String name = activity.getName(); + if ((name==null)|| (name.length()==0)) + name = activity.getId(); + Paragraph sectionTitle=new Paragraph(name,SECTION_FONT); + Section section = chain.getEnclosingSection().addSection(sectionTitle); + section.add(Chunk.NEWLINE); + PdfPTable table = makeActivityTable(activity, chain); + section.add(table); + return section; + } + log.warning("Could not handle section for "+chain.getElement()+" in code pdf plugin"); + return null; + } + } Index: PluginsManager.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/Attic/PluginsManager.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** PluginsManager.java 10 Aug 2006 14:45:09 -0000 1.1.2.1 --- PluginsManager.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 3,7 **** import java.util.ArrayList; import java.util.Arrays; - import java.util.Collections; import java.util.Enumeration; import java.util.Iterator; --- 3,6 ---- *************** *** 14,17 **** --- 13,17 ---- import org.enhydra.jawe.JaWEManager; import org.jped.base.editor.Wizard; + import org.jped.filter.ValueFilter; public class PluginsManager { *************** *** 22,25 **** --- 22,26 ---- private PanelGeneratorPlugin[] panelGeneratorPlugins; private TooltipGeneratorPlugin[] tooltipGeneratorPlugins; + private ValueFilter[] valueFilters; public PluginsManager(JaWEManager manager, Properties config){ *************** *** 29,72 **** private void initPlugins(Properties config){ - // Enumeration enumeration = config.propertyNames(); - // List pluginEntries = new ArrayList(); - // List pluginClasses = new ArrayList(); List pluginInstances = new ArrayList(); - /* get entries in config */ - // while (enumeration.hasMoreElements()){ - // String pluginEntry = (String)enumeration.nextElement(); - // if (pluginEntry.startsWith("PluginClass")) - // pluginEntries.add(pluginEntry); - // } - // Collections.sort(pluginEntries); - /* resolve classname if possible */ - // for (Iterator i = pluginEntries.iterator();i.hasNext();){ - // String pluginEntry = (String)i.next(); - // String className = config.getProperty(pluginEntry); - // try { - // pluginClasses.add(getClass().getClassLoader().loadClass(className)); - // } catch (ClassNotFoundException e) { - // System.out.println("could not load plugin class "+className+" for "+pluginEntry); - // } - // } - /* instanciate and init plugins */ - // for (Iterator i = pluginClasses.iterator();i.hasNext();){ - // Class c = (Class)i.next(); - // if (!Plugin.class.isAssignableFrom(c)){ - // System.out.println("Warning class "+c.getName()+" is not an instance of "+Plugin.class.getName()); - // continue; - // } - // try { - // Plugin instance = (Plugin)c.newInstance(); - // if (!instance.init(manager)){ - // System.out.println("Plugin not initialized "+c.getName()); - // continue; - // } - // pluginInstances.add(instance); - // } catch (Throwable t) { - // System.out.println("Error occured trying to initialize plugin "+c.getName()+": "+t.getLocalizedMessage()); - // t.printStackTrace(); - // } - // } Enumeration providers = Service.providers(PluginsProvider.class); while (providers.hasMoreElements()){ --- 30,34 ---- *************** *** 144,146 **** --- 106,128 ---- return tooltipGeneratorPlugins; } + + + + + + private ValueFilter[] buildValueFilters(){ + ArrayList list = new ArrayList(); + for (Iterator i = pluginList.iterator();i.hasNext();){ + Plugin plugin = (Plugin) i.next(); + ValueFilter filter = plugin.getValueFilter(); + if (filter!=null) + list.add(filter); + } + return (ValueFilter[]) list.toArray(new ValueFilter[0]); + } + public ValueFilter[] getValueFilters(){ + if (valueFilters==null) + valueFilters=buildValueFilters(); + return valueFilters; + } } Index: AbstractPlugin.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/Attic/AbstractPlugin.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** AbstractPlugin.java 10 Aug 2006 14:45:09 -0000 1.1.2.1 --- AbstractPlugin.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 1,6 **** package org.jped.plugins; - import org.enhydra.jawe.JaWEManager; import org.jped.base.editor.Wizard; /** --- 1,6 ---- package org.jped.plugins; import org.jped.base.editor.Wizard; + import org.jped.filter.ValueFilter; /** *************** *** 30,33 **** --- 30,36 ---- return null; } + public ValueFilter getValueFilter(){ + return null; + } } Index: BasicPluggedComponent.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/Attic/BasicPluggedComponent.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** BasicPluggedComponent.java 10 Aug 2006 14:45:09 -0000 1.1.2.1 --- BasicPluggedComponent.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 1,6 **** package org.jped.plugins; - import javax.swing.JComponent; - import org.enhydra.jawe.base.panel.panels.XMLPanel; --- 1,4 ---- |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:27:51
|
Update of /cvsroot/jped/JPEd/modules/Kernel/src/org/enhydra/jawe In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8874/modules/Kernel/src/org/enhydra/jawe Modified Files: Tag: PluginsAndFlexibleUI buildinfo.properties Log Message: Added value filtering plugin (used for presenting xpdl datas to user when they can be rather complexe or need to be translated) Changed PDF plugins interface to work as a chain, added pluggability for the data elements in addition to existing section and document elements Index: buildinfo.properties =================================================================== RCS file: /cvsroot/jped/JPEd/modules/Kernel/src/org/enhydra/jawe/buildinfo.properties,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -C2 -d -r1.5.2.2 -r1.5.2.3 *** buildinfo.properties 11 Aug 2006 12:20:24 -0000 1.5.2.2 --- buildinfo.properties 17 Aug 2006 13:27:44 -0000 1.5.2.3 *************** *** 1,9 **** #build informations.\nField in this file are automatically updated by build process\nChange you make may not be permanent\nComments you make will be removed\nContent order may change ! #Fri Aug 11 13:51:08 CEST 2006 release=2(4?) - buildno=06/08/11 13\:51\:08 CEST - jpedCVSTag=JPED_1_0_1 version=2.0 jresuff= - jpedAbout=Visit <a href\="http\://wfmopen.sourceforge.net">WfMOpen Homepage</a> for more <br>information about the product.<br><br>For support please contact\: <a href\="mailto\:wf...@da...">Wf...@da...</a><br><br>\u00A9 <a href\="http\://www.danet.com">Danet GmbH</a></p> jpedVersion=1.0.1 (Plugins and flexible UI development branch) --- 1,9 ---- #build informations.\nField in this file are automatically updated by build process\nChange you make may not be permanent\nComments you make will be removed\nContent order may change ! #Thu Aug 17 15:14:36 CEST 2006 release=2(4?) version=2.0 + jpedCVSTag=JPED_1_0_1 + buildno=06/08/17 15\:14\:36 CEST jresuff= jpedVersion=1.0.1 (Plugins and flexible UI development branch) + jpedAbout=Visit <a href\="http\://wfmopen.sourceforge.net">WfMOpen Homepage</a> for more <br>information about the product.<br><br>For support please contact\: <a href\="mailto\:wf...@da...">Wf...@da...</a><br><br>\u00A9 <a href\="http\://www.danet.com">Danet GmbH</a></p> |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:27:50
|
Update of /cvsroot/jped/JPEd In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8874 Modified Files: Tag: PluginsAndFlexibleUI .classpath build.xml Log Message: Added value filtering plugin (used for presenting xpdl datas to user when they can be rather complexe or need to be translated) Changed PDF plugins interface to work as a chain, added pluggability for the data elements in addition to existing section and document elements Index: .classpath =================================================================== RCS file: /cvsroot/jped/JPEd/.classpath,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** .classpath 11 Aug 2006 12:20:18 -0000 1.1.2.2 --- .classpath 17 Aug 2006 13:27:44 -0000 1.1.2.3 *************** *** 2,5 **** --- 2,6 ---- <classpath> <classpathentry kind="src" path="modules/ComponentManager/src"/> + <classpathentry kind="src" path="modules/PropertiesFilter/src"/> <classpathentry kind="src" path="modules/PluginManagement/src"/> <classpathentry kind="src" path="modules/XPDLFilter/src"/> Index: build.xml =================================================================== RCS file: /cvsroot/jped/JPEd/build.xml,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** build.xml 10 Aug 2006 14:45:10 -0000 1.6.2.1 --- build.xml 17 Aug 2006 13:27:44 -0000 1.6.2.2 *************** *** 22,25 **** --- 22,29 ---- - - $Log$ + - Revision 1.6.2.2 2006/08/17 13:27:44 tchize + - Added value filtering plugin (used for presenting xpdl datas to user when they can be rather complexe or need to be translated) + - Changed PDF plugins interface to work as a chain, added pluggability for the data elements in addition to existing section and document elements + - - Revision 1.6.2.1 2006/08/10 14:45:10 tchize - Initial import of flexibility and plugins interfaces. *************** *** 107,110 **** --- 111,115 ---- <src path="modules/XPDLFilter/src"/> <src path="modules/PluginManagement/src"/> + <src path="modules/PropertiesFilter/src"/> <classpath> <fileset dir="lib" includes="*.jar"/> |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:27:48
|
Update of /cvsroot/jped/JPEd/modules/Graph/src/org/jped/components/graph/export In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8874/modules/Graph/src/org/jped/components/graph/export Modified Files: Tag: PluginsAndFlexibleUI PDFWorkflowExport.java Log Message: Added value filtering plugin (used for presenting xpdl datas to user when they can be rather complexe or need to be translated) Changed PDF plugins interface to work as a chain, added pluggability for the data elements in addition to existing section and document elements Index: PDFWorkflowExport.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/Graph/src/org/jped/components/graph/export/Attic/PDFWorkflowExport.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** PDFWorkflowExport.java 10 Aug 2006 14:45:11 -0000 1.1.2.1 --- PDFWorkflowExport.java 17 Aug 2006 13:27:44 -0000 1.1.2.2 *************** *** 97,152 **** } public boolean exportToFile(FileOutputStream output) throws Exception{ ! Chunk chapterTitle; ! Paragraph chapterTitleParagraph; ! Chapter chapter; ! Document document = new Document(PageSize.A4); ! PdfWriter writer = PdfWriter.getInstance(document,output); ! document.open(); notifier = new PDFPluginNotifier(jaWEManager.getJaWEController().getPluginsManager()); ! notifier.beginProcessDocument(document,writer,process, graph); ! chapterTitle = new Chunk("Variables",CHAPTER_FONT); ! chapterTitleParagraph = new Paragraph("",CHAPTER_FONT); ! chapterTitleParagraph.add(chapterTitle); ! chapter = new ChapterAutoNumber(chapterTitleParagraph); ! notifier.beginSection(chapter,process.getDataFields()); ! List dataFields = getDataFields(); ! for (Iterator i = dataFields.iterator();i.hasNext();){ ! DataField field = (DataField)i.next(); ! String name = field.getId(); ! Paragraph sectionTitle=new Paragraph(name,SECTION_FONT); ! Section section = chapter.addSection(sectionTitle); ! section.add(Chunk.NEWLINE); ! notifier.beginSection(section,field); ! notifier.endSection(section,field); ! } ! ! notifier.endSection(chapter,process.getActivities()); ! document.add(chapter); ! chapterTitle = new Chunk("Activities",CHAPTER_FONT); ! chapterTitleParagraph = new Paragraph("",CHAPTER_FONT); ! chapterTitleParagraph.add(chapterTitle); ! chapter = new ChapterAutoNumber(chapterTitleParagraph); ! notifier.beginSection(chapter,process.getActivities()); ! List activities = getActivities(); ! for (Iterator i = activities.iterator();i.hasNext();){ ! Activity activity = (Activity)i.next(); ! String name = activity.getName(); ! if ((name==null)|| (name.length()==0)) ! name = activity.getId(); ! Paragraph sectionTitle=new Paragraph(name,SECTION_FONT); ! Section section = chapter.addSection(sectionTitle); ! section.add(Chunk.NEWLINE); ! notifier.beginSection(section,activity); ! notifier.endSection(section,activity); ! /*try{ ! Image im = getActivityPicture(activity,graph); ! section.add(im); ! } catch (Exception e){ ! e.printStackTrace(); ! }*/ ! } ! notifier.endSection(chapter,process.getActivities()); ! document.add(chapter); document.close(); return true; --- 97,153 ---- } public boolean exportToFile(FileOutputStream output) throws Exception{ ! // Chunk chapterTitle; ! // Paragraph chapterTitleParagraph; ! // Chapter chapter; ! // Document document = new Document(PageSize.A4); ! // PdfWriter writer = PdfWriter.getInstance(document,output); ! // document.open(); notifier = new PDFPluginNotifier(jaWEManager.getJaWEController().getPluginsManager()); ! // notifier.beginProcessDocument(document,writer,process, graph); ! Document document = notifier.processDocument(process, graph, output); ! // chapterTitle = new Chunk("Variables",CHAPTER_FONT); ! // chapterTitleParagraph = new Paragraph("",CHAPTER_FONT); ! // chapterTitleParagraph.add(chapterTitle); ! // chapter = new ChapterAutoNumber(chapterTitleParagraph); ! // notifier.beginSection(chapter,process.getDataFields()); ! // List dataFields = getDataFields(); ! // for (Iterator i = dataFields.iterator();i.hasNext();){ ! // DataField field = (DataField)i.next(); ! // String name = field.getId(); ! // Paragraph sectionTitle=new Paragraph(name,SECTION_FONT); ! // Section section = chapter.addSection(sectionTitle); ! // section.add(Chunk.NEWLINE); ! // notifier.beginSection(section,field); ! // notifier.endSection(section,field); ! // } ! // ! // notifier.endSection(chapter,process.getActivities()); ! // document.add(chapter); ! // chapterTitle = new Chunk("Activities",CHAPTER_FONT); ! // chapterTitleParagraph = new Paragraph("",CHAPTER_FONT); ! // chapterTitleParagraph.add(chapterTitle); ! // chapter = new ChapterAutoNumber(chapterTitleParagraph); ! // notifier.beginSection(chapter,process.getActivities()); ! // List activities = getActivities(); ! // for (Iterator i = activities.iterator();i.hasNext();){ ! // Activity activity = (Activity)i.next(); ! // String name = activity.getName(); ! // if ((name==null)|| (name.length()==0)) ! // name = activity.getId(); ! // Paragraph sectionTitle=new Paragraph(name,SECTION_FONT); ! // Section section = chapter.addSection(sectionTitle); ! // section.add(Chunk.NEWLINE); ! // notifier.beginSection(section,activity); ! // notifier.endSection(section,activity); ! // /*try{ ! // Image im = getActivityPicture(activity,graph); ! // section.add(im); ! // } catch (Exception e){ ! // e.printStackTrace(); ! // }*/ ! // } ! // notifier.endSection(chapter,process.getActivities()); ! // document.add(chapter); document.close(); return true; |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:27:48
|
Update of /cvsroot/jped/JPEd/modules/JaWEController/src/org/enhydra/jawe/base/controller In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8874/modules/JaWEController/src/org/enhydra/jawe/base/controller Modified Files: Tag: PluginsAndFlexibleUI JaWEController.java Log Message: Added value filtering plugin (used for presenting xpdl datas to user when they can be rather complexe or need to be translated) Changed PDF plugins interface to work as a chain, added pluggability for the data elements in addition to existing section and document elements Index: JaWEController.java =================================================================== RCS file: /cvsroot/jped/JPEd/modules/JaWEController/src/org/enhydra/jawe/base/controller/JaWEController.java,v retrieving revision 1.1.1.3.2.1 retrieving revision 1.1.1.3.2.2 diff -C2 -d -r1.1.1.3.2.1 -r1.1.1.3.2.2 *** JaWEController.java 10 Aug 2006 14:45:11 -0000 1.1.1.3.2.1 --- JaWEController.java 17 Aug 2006 13:27:44 -0000 1.1.1.3.2.2 *************** *** 45,48 **** --- 45,50 ---- import org.enhydra.jawe.XPDLListenerAndObservable; import org.jped.base.xpdlhandler.DefaultXPDLHandlerSettings; + import org.jped.filter.PluggableValueFilter; + import org.jped.filter.ValueFilter; import org.jped.plugins.PluginsManager; import org.enhydra.jawe.base.xpdlhandler.XPDLHandler; *************** *** 2141,2146 **** --- 2143,2180 ---- } + /* + * Begin of JPEd added methods to controller + */ + ValueFilter valueFilter = new PluggableValueFilter(); + /** + * Return the plugin manager. All operations on plugins + * are done thru this manager. + * @since JPEd-plugins + */ public PluginsManager getPluginsManager(){ return pluginsManager; } + /** + * Acquire the global value filter. It may dispatch to plugins + * depending on interface implementation. Always use a ValueFilter + * instead of calling XMLElement.toValue() directly + * @return The ValueFilter + * @since JPEd-plugins + */ + public ValueFilter getValueFilter(){ + return valueFilter; + } + /** + * shortcut to getValueFilter().getValue(element.get(property)) + * @param element the XMLComplexElement which property is to be filtered + * @param property the property to filter + * @return the filtered property or null of property does not exist + */ + public String getFilteredProperty(XMLComplexElement element, String property){ + if (element==null){ + return null; + } + XMLElement elt = element.get(property); + return elt==null?null:getValueFilter().getValue(elt); + } } |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:27:48
|
Update of /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/chains In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8874/modules/PluginManagement/src/org/jped/plugins/chains Added Files: Tag: PluginsAndFlexibleUI PDFSectionChain.java PDFDocumentChain.java PDFChain.java PDFElementChain.java Log Message: Added value filtering plugin (used for presenting xpdl datas to user when they can be rather complexe or need to be translated) Changed PDF plugins interface to work as a chain, added pluggability for the data elements in addition to existing section and document elements --- NEW FILE: PDFSectionChain.java --- package org.jped.plugins.chains; import com.lowagie.text.DocumentException; import com.lowagie.text.Section; /** * Chain used to handle creation of pdf section using xpdl * elements * @author delbd * */ public interface PDFSectionChain extends PDFChain { /** * Process to next element in chain an retrieve result * @return The element build by chain */ public Section next() throws DocumentException; } --- NEW FILE: PDFElementChain.java --- package org.jped.plugins.chains; import com.lowagie.text.DocumentException; import com.lowagie.text.Element; /** * Chain used to process simple PDF Element creation * @author delbd * */ public interface PDFElementChain extends PDFChain { /** * Process to next element in chain an retrieve result * @return The element build by chain */ public Element next() throws DocumentException; } --- NEW FILE: PDFDocumentChain.java --- package org.jped.plugins.chains; import java.io.OutputStream; import org.enhydra.jawe.components.graph.Graph; import com.lowagie.text.Document; import com.lowagie.text.DocumentException; /** * This is the chain used to process PDF Document rendering. * @author delbd * */ public interface PDFDocumentChain extends PDFChain { /** * Process to next element in chain an retrieve result * @return The element build by chain */ public Document next() throws DocumentException; public Graph getGraph(); public OutputStream getOutputStream(); } --- NEW FILE: PDFChain.java --- package org.jped.plugins.chains; import java.io.OutputStream; import org.enhydra.jawe.components.graph.Graph; import org.enhydra.shark.xpdl.XMLElement; import com.lowagie.text.Document; import com.lowagie.text.DocumentException; import com.lowagie.text.Element; import com.lowagie.text.Section; /** * This is the generic interface of a chain. It allows any plugin * during process to require processing of an intermediate element, * retreive result and include it. Each kind of processing (Document, * Section and Element) will have it's specialized chain which also * allows forwaring of request to next part of chain. * * @author delbd */ public interface PDFChain { /** * Get the xpdl element currently processed by chain * @return element processed by chain */ public XMLElement getElement(); /** * Process a new Section element and retrieve result. * A new chain is created to process the Section. * Implementation should ensure there is no endless recursive call. * @param element the Section element to process * @return the Section build by the plugins chain * @throws DocumentException */ public Section startProcessSection(XMLElement element) throws DocumentException; /** * Process a new Document element and retrieve result. * A new chain is created to process the Document. * Implementation should ensure there is no endless recursive call. * @param element the Document element to process * @return the Document build by the plugins chain * @throws DocumentException */ public Document startProcessDocument(XMLElement element, Graph graph, OutputStream output) throws DocumentException; /** * Process a new simple element and retrieve result. * A new chain is created to process the element. * Implementation should ensure there is no endless recursive call. * @param element the element to process * @return the itext Element build by the plugins chain * @throws DocumentException */ public Element startProcessElement(XMLElement element) throws DocumentException; public void setEnclosingSection(Section section); public Section getEnclosingSection(); } |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:27:47
|
Update of /cvsroot/jped/JPEd/modules/PropertiesFilter/src/org/jped/filter In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8874/modules/PropertiesFilter/src/org/jped/filter Added Files: Tag: PluginsAndFlexibleUI ValueFilter.java PluggableValueFilter.java DefaultValueFilter.java Log Message: Added value filtering plugin (used for presenting xpdl datas to user when they can be rather complexe or need to be translated) Changed PDF plugins interface to work as a chain, added pluggability for the data elements in addition to existing section and document elements --- NEW FILE: DefaultValueFilter.java --- package org.jped.filter; import org.enhydra.shark.xpdl.XMLElement; public class DefaultValueFilter implements ValueFilter { public String getValue(XMLElement element) { return element.toValue(); } public boolean handles(XMLElement element) { return true; } } --- NEW FILE: ValueFilter.java --- package org.jped.filter; import org.enhydra.shark.xpdl.XMLElement; public interface ValueFilter { public boolean handles (XMLElement element); public String getValue(XMLElement element); } --- NEW FILE: PluggableValueFilter.java --- package org.jped.filter; import org.enhydra.jawe.JaWE; import org.enhydra.jawe.JaWEManager; import org.enhydra.shark.xpdl.XMLElement; import org.jped.plugins.PluginsManager; public class PluggableValueFilter extends DefaultValueFilter { public String getValue(XMLElement element) { ValueFilter[] filters = JaWEManager. getInstance(). getJaWEController(). getPluginsManager(). getValueFilters(); for (int i=0;i<filters.length;i++) if (filters[i].handles(element)) return filters[i].getValue(element); return super.getValue(element); } public boolean handles(XMLElement element) { return true; } } |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:27:47
|
Update of /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/chains/impl In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8874/modules/PluginManagement/src/org/jped/plugins/chains/impl Added Files: Tag: PluginsAndFlexibleUI SimplePDFDocumentChain.java AbstractPDFChain.java SimplePDFSectionChain.java SimplePDFElementChain.java Log Message: Added value filtering plugin (used for presenting xpdl datas to user when they can be rather complexe or need to be translated) Changed PDF plugins interface to work as a chain, added pluggability for the data elements in addition to existing section and document elements --- NEW FILE: SimplePDFSectionChain.java --- package org.jped.plugins.chains.impl; import java.util.logging.Level; import java.util.logging.Logger; import org.enhydra.shark.xpdl.XMLElement; import org.jped.plugins.PDFPlugin; import org.jped.plugins.PDFPluginNotifier; import org.jped.plugins.chains.PDFSectionChain; import com.lowagie.text.DocumentException; import com.lowagie.text.Section; public class SimplePDFSectionChain extends AbstractPDFChain implements PDFSectionChain { private static Logger log = Logger.getLogger(SimplePDFSectionChain.class.getName()); private PDFPlugin plugin; private SimplePDFSectionChain next; public SimplePDFSectionChain(XMLElement element, PDFPlugin plugin, PDFPluginNotifier notifier, SimplePDFSectionChain next){ super(element,notifier); this.plugin=plugin; this.next=next; } public Section processPlugin() throws DocumentException{ if (log.isLoggable(Level.FINEST)) log.finest("processing Section on plugin "+plugin); return plugin.processSection(this); } public Section next() throws DocumentException{ if (next!=null) return next.processPlugin(); return null; } } --- NEW FILE: SimplePDFElementChain.java --- package org.jped.plugins.chains.impl; import java.util.logging.Level; import java.util.logging.Logger; import org.enhydra.shark.xpdl.XMLElement; import org.jped.plugins.PDFPlugin; import org.jped.plugins.PDFPluginNotifier; import org.jped.plugins.chains.PDFElementChain; import com.lowagie.text.DocumentException; import com.lowagie.text.Element; public class SimplePDFElementChain extends AbstractPDFChain implements PDFElementChain { private static Logger log = Logger.getLogger(SimplePDFElementChain.class.getName()); private PDFPlugin plugin; private SimplePDFElementChain next; public SimplePDFElementChain(XMLElement element, PDFPlugin plugin, PDFPluginNotifier notifier, SimplePDFElementChain next){ super(element,notifier); this.plugin=plugin; this.next=next; } public Element processPlugin() throws DocumentException{ if (log.isLoggable(Level.FINEST)) log.finest("processing Element on plugin "+plugin); return plugin.processElement(this); } public Element next() throws DocumentException { if (next!=null) return next.processPlugin(); return null; } } --- NEW FILE: AbstractPDFChain.java --- package org.jped.plugins.chains.impl; import java.io.OutputStream; import org.enhydra.jawe.components.graph.Graph; import org.enhydra.shark.xpdl.XMLElement; import org.jped.plugins.PDFPluginNotifier; import org.jped.plugins.chains.PDFChain; import com.lowagie.text.Document; import com.lowagie.text.DocumentException; import com.lowagie.text.Element; import com.lowagie.text.Section; public abstract class AbstractPDFChain implements PDFChain { private XMLElement element; private Section enclosing; private PDFPluginNotifier notifier; public AbstractPDFChain(XMLElement element, PDFPluginNotifier notifier){ this.element=element; this.notifier=notifier; } public XMLElement getElement() { return element; } public Document startProcessDocument(XMLElement element, Graph graph, OutputStream output) throws DocumentException { return notifier.processDocument(element, graph, output); } public Element startProcessElement(XMLElement element) throws DocumentException { return notifier.processElement(element); } public Section startProcessSection(XMLElement element) throws DocumentException { return notifier.processSection(element); } public Section getEnclosingSection() { return notifier.getEnclosingSection(); } public void setEnclosingSection(Section enclosingSection) { notifier.setEnclosingSection(enclosingSection); } } --- NEW FILE: SimplePDFDocumentChain.java --- package org.jped.plugins.chains.impl; import java.io.OutputStream; import java.util.logging.Level; import java.util.logging.Logger; import org.enhydra.jawe.components.graph.Graph; import org.enhydra.shark.xpdl.XMLElement; import org.jped.plugins.PDFPlugin; import org.jped.plugins.PDFPluginNotifier; import org.jped.plugins.chains.PDFDocumentChain; import com.lowagie.text.Document; import com.lowagie.text.DocumentException; public class SimplePDFDocumentChain extends AbstractPDFChain implements PDFDocumentChain { private static Logger log = Logger.getLogger(SimplePDFDocumentChain.class.getName()); private PDFPlugin plugin; private SimplePDFDocumentChain next; private Graph graph; private OutputStream output; public SimplePDFDocumentChain(XMLElement element, Graph graph, OutputStream output, PDFPlugin plugin, PDFPluginNotifier notifier, SimplePDFDocumentChain next){ super(element,notifier); this.graph=graph; this.output=output; this.plugin=plugin; this.next=next; } public Document processPlugin() throws DocumentException{ if (log.isLoggable(Level.FINEST)) log.finest("processing Document on plugin "+plugin); return plugin.processDocument(this); } public Document next() throws DocumentException { if (next!=null) return next.processPlugin(); return null; } public Graph getGraph() { return graph; } public OutputStream getOutputStream(){ return output; } } |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:23:42
|
Update of /cvsroot/jped/JPEd/modules/PropertiesFilter In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7120/modules/PropertiesFilter Log Message: Directory /cvsroot/jped/JPEd/modules/PropertiesFilter added to the repository --> Using per-directory sticky tag `PluginsAndFlexibleUI' |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:23:42
|
Update of /cvsroot/jped/JPEd/modules/PropertiesFilter/src/org In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7120/modules/PropertiesFilter/src/org Log Message: Directory /cvsroot/jped/JPEd/modules/PropertiesFilter/src/org added to the repository |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:23:42
|
Update of /cvsroot/jped/JPEd/modules/PropertiesFilter/src/org/jped/filter In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7120/modules/PropertiesFilter/src/org/jped/filter Log Message: Directory /cvsroot/jped/JPEd/modules/PropertiesFilter/src/org/jped/filter added to the repository |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:23:42
|
Update of /cvsroot/jped/JPEd/modules/PropertiesFilter/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7120/modules/PropertiesFilter/src Log Message: Directory /cvsroot/jped/JPEd/modules/PropertiesFilter/src added to the repository |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:23:42
|
Update of /cvsroot/jped/JPEd/modules/PropertiesFilter/src/org/jped In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7120/modules/PropertiesFilter/src/org/jped Log Message: Directory /cvsroot/jped/JPEd/modules/PropertiesFilter/src/org/jped added to the repository |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:23:09
|
Update of /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/chains/impl In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6802/modules/PluginManagement/src/org/jped/plugins/chains/impl Log Message: Directory /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/chains/impl added to the repository |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 13:23:09
|
Update of /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/chains In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6802/modules/PluginManagement/src/org/jped/plugins/chains Log Message: Directory /cvsroot/jped/JPEd/modules/PluginManagement/src/org/jped/plugins/chains added to the repository --> Using per-directory sticky tag `PluginsAndFlexibleUI' |
From: jped c. m. l. \(do n. post\) <jpe...@li...> - 2006-08-17 07:41:44
|
Update of /cvsroot/jped/JPEd In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31091 Modified Files: build.properties Log Message: Testing cvs commit email notifications Index: build.properties =================================================================== RCS file: /cvsroot/jped/JPEd/build.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build.properties 10 Aug 2006 10:28:38 -0000 1.2 --- build.properties 17 Aug 2006 07:41:38 -0000 1.3 *************** *** 1,10 **** ! debug=on ! sourceVersion=1.3 ! targetJVM=1.3 cvs-user=tchize ! ! cvs-root=\:ext\:${cvs-user}@jped.cvs.sourceforge.net\:/cvsroot/jped ! cvs-module=JPEd ! ! jpedCVSTag=JPED_1_0_1 ! jpedVersion=1.0.1 --- 1,11 ---- ! debug=on ! sourceVersion=1.3 ! targetJVM=1.3 cvs-user=tchize ! ! cvs-root=\:ext\:${cvs-user}@jped.cvs.sourceforge.net\:/cvsroot/jped ! cvs-module=JPEd ! ! jpedCVSTag=JPED_1_0_1 ! jpedVersion=1.0.1 ! |