Archive

Archive for October, 2011

Cross Compiling ~ Compile java code written in Mac in Windows

October 11, 2011 Leave a comment

I have a problem of compiling student assignment where a few of them have written it in Mac OS. Obviously, I’m using Windows.

The solution, delete the hidden file that come along with the programme, .classFile.java. If you can’t see it, just toggle the folder option to show hidden file.

Here is the link to my question.

Categories: Java

Marama Code 122 ~ How to create entity and its attributes in Marama tool model automatically

October 3, 2011 Leave a comment

Marama tool model is the diagram used to define tool project tool meta-model. To help user define the test tool (to be used with Marama model project), user need to specify the test tool shape properties. From there, a number of test entity (based on level of test) will be create automatically.

Due to the fact that when Marama tool model there is no underlying model created for it, the normal code to create shape cannot be applied to Marama tool model, shape definer and view definer. Here is the code to create and set the entity shape for Marama tool model:

MaramaShape testShape = this.createNewShape(MaramaConstants.ENTITY_METAMODEL_SHAPE, x, y, shapeWidth, shapeHeight); // create the entity shape
testShape.setPropertyValue(“name”, “TestSuite”); // set the attribute

MaramaShape testAttribute = this.createNewShape(MaramaConstants.ATTRIBUTE_SHAPE, x + 5, y + 5, shapeWidth, shapeHeight); // create the entity attribute shape
testAttribute.setPropertyValue(“iskey”, “key”); // set the attribute
testAttribute.setPropertyValue(“name”, “tid”);
testAttribute.setPropertyValue(“type”, “String”);

        processSubshapeAdded(testAttribute);

Hope you will understand it. Cheers.

p/s: credit to Jun for showing it to me

Categories: Java, Life on Marama

Marama Code 121 ~ How to get or set shape size

October 3, 2011 Leave a comment

Today I’ll explain how to get or set shape’s size. This can be done using this code:

Dimension maramaShape_size = maramaShape.getSize();

It will return the shape’s size in Dimension. You can set the shape’s size with this code:

Dimension newSize = new Dimension(int width, int height);

maramaShape.setSize(newSize);

Categories: Java, Life on Marama
Follow

Get every new post delivered to your Inbox.