[kepler-dev] Including PDF in Vergil

Christopher Brooks cxh at eecs.berkeley.edu
Tue Jul 14 07:39:44 PDT 2009


Hi David,
Can the build system be modified to handle copying jar files from
directories other than ptII/lib?
The reason this is important is that as we move towards modules
that have what is needed in them, there will be more and more
directories that have jar files in them.  Right now, ptalon has
a jar file:
ptII/ptolemy/actor/ptalon/antlr/antlr.jar
There are a few other jars in places other than lib.

In the near term, I'll move PDFRenderer.jar back to lib/.
Having two copies of a 2Mb jar file is much worse than having
the file in not quite the right location.

Also, do you have any thoughts on copying resources needed by
actors?
    http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4244

I fixed the AlphabetizeOperation problem.
It turns out that
ptolemy/cg/kernel/generic/program/procedural/java/type/polymorphic/AlphabetizeOperation.java
had the wrong package in it.

I'll check the little nightly build I run to be sure it is
getting the ptII head.

_Christopher

David Welker wrote:
> This issue has been fixed by making a copy of PDFRenderer.jar to 
> ptolemy-lib. This will allow you to have this jar file anywhere in the 
> Ptolemy tree you like.
> 
> However, the head of Ptolemy is still not compiling due to the following 
> issue:
> 
> [compile] Compiling ptolemy...
> [compile] Compiling 3278 source files to 
> /Users/davidwelker/kepler.modules/ptolemy/target/classes
> [compile] 
> /Users/davidwelker/kepler.modules/ptolemy/ptolemy/codegen/java/kernel/type/polymorphic/AlphabetizeOperation.java:49: 
> duplicate class 
> ptolemy.codegen.java.kernel.type.polymorphic.AlphabetizeOperation
> [compile] public class AlphabetizeOperation {
> [compile]        ^
> [compile] Note: Some input files use or override a deprecated API.
> [compile] Note: Recompile with -Xlint:deprecation for details.
> [compile] Note: Some input files use unchecked or unsafe operations.
> [compile] Note: Recompile with -Xlint:unchecked for details.
> [compile] 1 error
> 
> When this problem at the head of Ptolemy is resolved, then Kepler will 
> automatically update to use the head.
> 
> David
> 
>> Hi Chad,
>> Thanks!
>> Right, I had to run
>>  svn update
>>  ant update
>> to get these changes.
>>
>> From within Kepler, searching for the PDFAttribute does not find it.
>>
>> I do get the same error message about sample.pdf missing.
>>
>> The build system needs to handle the resources that are needed by the
>> actors, I'll update 
>> http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4244
>> in a moment.
>>
>>
>> _Christopher
>>
>>
>>
>>
>> Chad Berkley wrote:
>>> Hey Christopher,
>>>
>>> I fixed the compile classpath so the jar file is found now.  A was 
>>> able to add the attribute with the tools/Instantiate Attribute menu.  
>>> Note that the default value (sample.pdf) won't be found in kepler 
>>> because of the way PTII gets set.  I had to copy the sample.pdf file 
>>> to the right place manually.  Maybe should just remove that default 
>>> or put an if statement in there so that it doesn't throw a moml 
>>> exception when the default file isn't found.
>>>
>>> Make sure to update your build-area to get these changes.
>>>
>>> chad
>>>
>>>
>>> Christopher Brooks wrote:
>>>> Hi David,
>>>> Kepler fails to build for me after I moved PDFRenderer.jar from 
>>>> ptII/lib to
>>>> ptII/ptolemy/vergil/pdfrenderer.  To reproduce this:
>>>>
>>>> cd build-area
>>>> ant update
>>>> ant update-ptolemy -Drev=head
>>>> ant run
>>>>
>>>> The error message is:
>>>>
>>>> compile:
>>>>   [compile] Compiling ptolemy...
>>>>   [compile] Compiling 3277 source files to 
>>>> /Users/cxh/src/kepler/ptolemy/target/classes
>>>>   [compile] 
>>>> /Users/cxh/src/kepler/ptolemy/ptolemy/vergil/pdfrenderer/PDFAttribute.java:46: 
>>>> package com.sun.pdfview does not exist
>>>>   [compile] import com.sun.pdfview.PDFFile;
>>>>   [compile]                        ^
>>>>
>>>> I updated (but did not check in) build-area/settings/ptolemy-includes
>>>> to include:
>>>> ptolemy/vergil/pdfrenderer/PDFRenderer.jar
>>>>
>>>> But running "ant run" has no effect.
>>>>
>>>> The jar file is present:
>>>>
>>>> bash-3.2$ ls -l ../ptolemy/ptolemy/vergil/pdfrenderer/PDFRenderer.jar
>>>> -rw-r--r--  1 cxh  staff  2087109 Jul 13 11:31 
>>>> ../ptolemy/ptolemy/vergil/pdfrenderer/PDFRenderer.jar
>>>>
>>>>
>>>> https://kepler-project.org/developers/teams/build/documentation/build-system-instructions#modifying-ptolemy-includes-and 
>>>>
>>>> just says to edit ptolemy-includes, it does not say what, if any, 
>>>> other commands should be run.
>>>>
>>>> What else needs to be done when ptolemy-includes is updated?
>>>> Is there anyway that this file can have comments in it that indicate 
>>>> what commands need to be run
>>>> and also a link to the docs?
>>>>
>>>>
>>>> Also, at this point the PDFAttribute does not appear in Kepler.  I'm 
>>>> not sure how to add it, though
>>>> I have not looked hard at the docs yet.
>>>>
>>>> _Christopher
>>>>
>>>>
>>>> Edward A. Lee wrote:
>>>>>
>>>>> I've added a PDFAttribute to the Utilities->Decorative library in 
>>>>> Vergil
>>>>> that allows you to include PDF in a Vergil diagram.
>>>>>
>>>>> The reason I wanted this was mainly so I could include Latex-formatted
>>>>> equations in Vergil diagrams, and get full print resolution when
>>>>> printing to PDF for use in papers, books, etc.  For example, see
>>>>> attached.
>>>>>
>>>>> Using requires a new external library, PDFRenderer.jar, which I've
>>>>> put in $PTII/lib.  This is a LGPL'd open source product from Sun.
>>>>>
>>>>> To use it, I use LatexIt (see
>>>>> http://www.apple.com/downloads/macosx/math_science/latexit.html
>>>>> for the Mac version... I think there are Windows and Linux versions).
>>>>>  From LatexIt, I can create a PDF file with an equation.
>>>>>
>>>>> Then I drag into my Vergil diagram a PDFAttribute, or select
>>>>> Edit Custom Icon and drag in a PDFIcon. Double click on that to
>>>>> select the PDF file.
>>>>>
>>>>> To use this, you need to do a CVS update and
>>>>> either re-run configure or do
>>>>>
>>>>>   cd $PTII/bin
>>>>>   make
>>>>>
>>>>>
>>>>> This will put the jar file in the path for vergil.
>>>>>
>>>>> Edward
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------ 
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------ 
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Kepler-dev mailing list
>>>>> Kepler-dev at kepler-project.org
>>>>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>>>>
>>
> 

-- 
Christopher Brooks (cxh at eecs berkeley edu) University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841 fax:510.642.2718	      (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480


More information about the Kepler-dev mailing list