Esempio n. 1
0
ValueTree DrawableRectangle::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const
{
    ValueTree tree (valueTreeType);
    ValueTreeWrapper v (tree);

    v.setID (getComponentID());
    writeTo (v, imageProvider, nullptr);
    v.setRectangle (bounds, nullptr);
    v.setCornerSize (cornerSize, nullptr);

    return tree;
}
Esempio n. 2
0
ValueTree DrawableText::createValueTree (ComponentBuilder::ImageProvider*) const
{
    ValueTree tree (valueTreeType);
    ValueTreeWrapper v (tree);

    v.setID (getComponentID());
    v.setText (text, nullptr);
    v.setFont (font, nullptr);
    v.setJustification (justification, nullptr);
    v.setColour (colour, nullptr);
    v.setBoundingBox (bounds, nullptr);
    v.setFontSizeControlPoint (fontSizeControlPoint, nullptr);

    return tree;
}
Esempio n. 3
0
ValueTree DrawablePath::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const
{
    ValueTree tree (valueTreeType);
    ValueTreeWrapper v (tree);

    v.setID (getComponentID());
    writeTo (v, imageProvider, nullptr);

    if (relativePath != nullptr)
        v.readFrom (*relativePath, nullptr);
    else
        v.readFrom (RelativePointPath (path), nullptr);

    return tree;
}
Esempio n. 4
0
const ValueTree DrawableImage::createValueTree (ImageProvider* imageProvider) const
{
    ValueTree tree (valueTreeType);
    ValueTreeWrapper v (tree);

    v.setID (getName(), 0);
    v.setOpacity (opacity, 0);
    v.setOverlayColour (overlayColour, 0);
    v.setBoundingBox (bounds, 0);

    if (image.isValid())
    {
        jassert (imageProvider != 0); // if you're using images, you need to provide something that can load and save them!

        if (imageProvider != 0)
            v.setImageIdentifier (imageProvider->getIdentifierForImage (image), 0);
    }

    return tree;
}
ValueTree DrawableComposite::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const
{
    ValueTree tree (valueTreeType);
    ValueTreeWrapper v (tree);

    v.setID (getComponentID());
    v.setBoundingBox (bounds, nullptr);

    ValueTree childList (v.getChildListCreating (nullptr));

    for (int i = 0; i < getNumChildComponents(); ++i)
    {
        const Drawable* const d = dynamic_cast <const Drawable*> (getChildComponent(i));
        jassert (d != nullptr); // You can't save a mix of Drawables and normal components!

        childList.addChild (d->createValueTree (imageProvider), -1, nullptr);
    }

    v.getMarkerListCreating (true, nullptr).readFrom (markersX, nullptr);
    v.getMarkerListCreating (false, nullptr).readFrom (markersY, nullptr);

    return tree;
}