Me n My Programming

If Only I Have TIme

Marama Code 123 ~ Set Custom Properties for Marama Shape

Did you know that you can set the custom properties for each shape in marama, instead using the default properties. The advantages of using this method is you can load a pre-properties attribute rather than having empty space or pre-specified text.

To do this, you need to set a custom method in the event handler to load as soon as the method is invoke. Here is the code that need to be include in the event handler:

@Override
    public void setDiagram(final MaramaDiagram diagram) {
        super.setDiagram(diagram);

        for (final MaramaShapeType st : diagram.getViewType().getShapeTypes()) {
            st.setCustomProperties(new NewCustomProperties());
        }
    }

You need to create a custom properties class, for instance in this example, the NewCustomProperties class.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Information

This entry was posted on November 15, 2011 by in Uncategorized.
%d bloggers like this: