ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: ConTeXt + MetaUML
Date: Fri, 05 May 2006 12:36:18 +0200	[thread overview]
Message-ID: <445B2AA2.2040703@wxs.nl> (raw)
In-Reply-To: <445918DA.2080209@nibua-r.org>

Renaud AUBIN wrote:
>
> Hi Hans,
>
> The example with clearboxes's crash:
this is probably due to the fact that clearboxes hooks into endfig


\setupoutput[pdftex]

\starttext

\startMPinclusions
 input boxes;
\stopMPinclusions

\startuseMPgraphic{my_uml_figure}
input metauml;

Class.A("Point")
       ("+x: int",
        "+y: int") ();

Class.B("Circle")
       ("radius: int")
       ("+getRadius(): int",
        "+setRadius(r: int):void");

topToBottom(45)(A, B);

drawObjects(A, B);

clink(aggregationUni)(A, B);
\stopuseMPgraphic

\placefigure[here]{none}{\useMPgraphic{my_uml_figure}}

\stoptext

this only works when in boxes.mp, we have:

extra_beginfig := extra_beginfig
  & "boxjoin();save pic_,sproc_,pproc_;def clearboxes=enddef;";
extra_endfig := extra_endfig & " clearboxes";

(space added before clearboxes in string)

(maybe i should clean up boxes.mp and preload that in metafun if only i 
know what it's meant for)

i suggest that you contact the author of metauml:

- rename the util_* files into metauml_util_* in order to prevent 
clashes with other util_* files
- load all files into the main file, so that you get rid of the 
redundant file reads (loading  quits when the files are already 
loaded,but best do some testing before they are input)
- provide a metauml_preload.mp file that preloads e.g. boxes.mp so that 
you can do

\startMPinclusions
 input metauml_preload;
\stopMPinclusions

\startuseMPgraphic{my_uml_figure}
input metauml;
\stopuseMPgraphic

- provide "load_metauml" that loads once only, so that you can do

\startMPinclusions
 input metauml_preload;
\stopMPinclusions

\startuseMPgraphic{my_uml_figure}
load_metauml;
\stopuseMPgraphic

\startuseMPgraphic{my_second_uml_figure}
load_metauml;
\stopuseMPgraphic

and get only one load when you collect graphics instead of runtime 
processing

Hans


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

  reply	other threads:[~2006-05-05 10:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-02 14:55 Renaud AUBIN
2006-05-02 22:11 ` nico
2006-05-03 19:52 ` Hans Hagen
2006-05-03 20:55   ` Renaud AUBIN
2006-05-05 10:36     ` Hans Hagen [this message]
2006-05-06 10:33       ` Renaud AUBIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=445B2AA2.2040703@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).