Home > Java, Life on Marama > Marama Code 125 ~ Detect shape updated info

Marama Code 125 ~ Detect shape updated info

November 23, 2011 Leave a comment Go to comments

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

Advertisement
Categories: Java, Life on Marama
  1. No comments yet.
  1. No trackbacks yet.

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.