[Libreoffice] additional symbols or alternatively stencils in Draw templates

Ulrich Moser ulrich.moser at zpk-moser.de
Thu Sep 15 03:48:56 PDT 2011


Hello KAMI,

as I already mentioned in my reply to Caolán, the point with galleries 
is, that the elements do not have user editable attributes. Consider you 
want to draw a network diagram with servers, routers, network trunks, 
switches, VLANs ...

In a network diagram you would like to have all the attributes of those 
elements associated with them and you probably would like to have a 
standard set of atrtributes for each type of element. Ok, you can place 
them all into the drawing and group them with the element. But often you 
have more attributes than those that are or should be shown in the 
drawing. Visio accomplishes this with an attribute set linked to the 
element. The user can choose which attributes to show and which to hide. 
Besides that you can export all attributes to a file and then for 
instance load them into a database like a CMDB.

This is a feature used very often and it is one of the arguments not to 
move to OpenOffice/LibreOffice.

I looked around a little bit more inside the content.xml generated for 
different drawing elements and in the ODF spec 1.1.

Galleries the kind I am thinking of are more like custom shape sets you 
find in the Drawing Icon Bar (squares, triangles, polygones, ..).

These additional attributes could be created similar the definition in  
"9.2.15 Common Drawing Shape Attributes" of the ODF spec 1.1 for the 
common drawing shapes.

In LibreOffice Draw this is reflected this way:

    <draw:custom-shape draw:style-name="gr1" draw:text-style-name="P1"
    draw:layer="layout" svg:width="7cm" svg:height="6cm" svg:x="5cm"
    svg:y="5.5cm">
    *<svg:title>Hexagon</svg:title>
    <svg:desc>This is a description.</svg:desc>*
    <text:p text:style-name="P1">hexagon</text:p>
    <draw:enhanced-geometry svg:viewBox="0 0 21600 21600"
    draw:glue-points="10800 0 0 10800 10800 21600 21600 10800"
    draw:text-areas="?f3 ?f3 ?f4 ?f4" draw:type="hexagon"
    draw:modifiers="5400" draw:enhanced-path="M ?f0 0 L ?f1 0 21600
    10800 ?f1 21600 ?f0 21600 0 10800 Z N">
    <draw:equation draw:name="f0" draw:formula="$0 "/>
    <draw:equation draw:name="f1" draw:formula="21600-$0 "/>
    <draw:equation draw:name="f2" draw:formula="$0 *100/234"/>
    <draw:equation draw:name="f3" draw:formula="?f2 +1700"/>
    <draw:equation draw:name="f4" draw:formula="21600-?f3 "/>
    <draw:handle draw:handle-position="$0 top"
    draw:handle-range-x-minimum="0" draw:handle-range-x-maximum="10800"/>
    </draw:enhanced-geometry>
    </draw:custom-shape>

The important tags are those starting with <svg:... The gallery or 
whatever collection of scalable elements are used should define the set 
of attributes in that form preferrably using SVG format for the shapes. 
When opening the context menu and selecting Description a dialg could 
show up with all of the predefined attributes.

Hope this is more precise. The question is whether it is possible to 
integrate this way  of attributing to gallery elements.

Kind regards

Ulrich

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZPK Moser UG (haftungsbeschränkt) i.G.
Ulrich Moser - Geschäftsführer
Schlossstraße 7 - 78244 Gottmadingen
+49 (0)7734 395 494 - +49 (0)179 915 54 18
www.zpk-moser.de - ulrich.moser at zpk-moser.de
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Am 15.09.2011 11:21, schrieb KAMI911 KAMI911:
> Hello Folks,
>
> Of course I am interested to and new, useful gallery elements to the
> suite and create a new extension.
>
> You can create the gallery as usual way. I prefer vector based
> elements over pictures. In your case it has several advantage.
>
> In this case AVOID_BURN_IN_FOR_GALLERY_THEME enviroment variable may
> be useful for you. You should create gallery after this enviromental
> variable is exported/set.
>
> I can help to create oxt extension file.
>
> Adding gallery to LibreOffice in integrated way is harder, but if we
> decide to do this I can also help here -- I added several gallery to
> LO that is not enabled by default.
>
> Moreover I have/created several gallery in various theme, for example
> I created and remastered plenty of electronical parts.
>
> What is BPMN?
>
> Users can add their draws to gallery just use the ctrl key before the
> drag and drop operation. Or use Caolán's smart gallery extension.
>
> For examination you might download and unzip one of my extension:
> http://extensions.services.openoffice.org/project/oxygenoffice-gallery
>
> I am open to enrich this gallery and add more (vector) elements from
> this gallery to the main LO builds.
>
> Creating 3D gallery with Draw also an interesting opportunity... I
> started that a year ago.
>
> Back to the environment variables:
>
> Using GALLERY_ENABLE_ID_DIALOG, GALLERY_SHOW_PRIVATE_TITLE   are
> useful for localization. I will help here.
>
> Maybe GALLERY_SHOW_HIDDEN_THEMES is the key to crate individual
> toolbar for newly created elements. This requres more things to do...
>
> So that is all for first. I hope it helped.
>
> If you want to check my gallery files, here are the repository:
> http://ooop.svn.sf.net/viewvc/ooop/trunk/extras/source/gallery/
>
> Here is a small sample code to create extension:
> http://ooop.svn.sf.net/viewvc/ooop/trunk/utils/gallery/
>
> Use the create_gallery.sh file
> It is not designed to use other galleries, but changing variables is
> enogh to create your own gallery.
>
> If you have a question, do not hesitate to ask.
>
>
> KAMI
>
>
> 2011/9/13 Caolán McNamara<caolanm at redhat.com>:
>> On Mon, 2011-09-12 at 23:58 +0200, Ulrich Moser wrote:
>>> A first step in that direction would be offering more drawing symbols
>>> like a symbol set for BPMN. If someone could give some assistance on how
>>> such an additional symbol set could be integrated I would be willing to
>>> provide it. The further step would be implementing stencils in Draw
>>> templates.
>> So, the existing galleries are in "extras/source/gallery". Perhaps Kami
>> can give an overview of "how to add a new gallery" to extras for the
>> "integrated into LibreOffice" case ?
>>
>>> Is there anybody else interested in such an extension and able to aid
>>> with the programming part?
>> Galleries can be deployed as extensions as well as integrated right into
>> the installed product, there should be some preexisting examples
>> available, googling on "Gallery Extensions".
>>
>> FWIW I have an extension at
>> http://svn.fedorahosted.org/svn/openoffice.org-diafilter/ which is a
>> gallery extension (as well as a import filter for the dia format)
>>
>> http://svn.fedorahosted.org/svn/openoffice.org-diafilter/gallery/gallerygen.odg contains a macro to make a gallery from a dir IIRC
>>
>> C.
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110915/108f51d4/attachment-0001.htm>


More information about the LibreOffice mailing list