Me n My Programming

If Only I Have TIme

Marama Code 125 ~ Detect shape updated info

Did you know that you capture or be aware of the changes made in the diagram? For instance when user change a shape name or delete a shape? Yes you can. You just need this codes:

EventPropertyUpdateInfo info = this.propertyUpdated(notification); // get the update info

if (info == null) { return; } // ignore if no update

then,

MaramaDiagram diagram = info.getMaramaDiagram(); // get the diagram

if (diagram == null) { return; } // ignore if diagram doesn’t exist

or

MaramaShape shape = info.getMaramaShape(); // get the shape

if (shape == null) { return; } // ignore if shape doesn’t exist

Once you have captured the diagram/shape, you retrieve the new value that would like to minitor:

String testCategories = mu.getShapeString(sh, “testCategories”); // get the shape value

or, you can filter the shape to make sure you obtain the right shape

if (!sh.getShapeType().equals(“TestInfoShape”)) { return; } // ignore if not info shape

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 23, 2011 by in Java, Life on Marama.
%d bloggers like this: