excercise 2 done
This commit is contained in:
53
week1_TinsaeGhilay/Task2/Graphics.idl
Normal file
53
week1_TinsaeGhilay/Task2/Graphics.idl
Normal file
@@ -0,0 +1,53 @@
|
||||
// task 2.
|
||||
|
||||
|
||||
|
||||
// module
|
||||
module GraphicsApp
|
||||
{
|
||||
// forward declaration of shape.
|
||||
// because we use it in rectangle
|
||||
interface GraphicalObject;
|
||||
|
||||
typedef sequence<GraphicalObject> ObjectSequence;
|
||||
|
||||
// rectangle contains shapes which GraphicalObjects a
|
||||
interface Rectangle
|
||||
{
|
||||
|
||||
// exception to be thrown if index out of range
|
||||
exception IndexOutOfBounds {};
|
||||
|
||||
// hopping this will be an array of Graphical-objects.
|
||||
attribute ObjectSequence objects;
|
||||
|
||||
// function to add object
|
||||
void addObject(in GraphicalObject newShape);
|
||||
|
||||
// and may be remove an object from a position?
|
||||
void removeObjectAtPosition(in unsigned long index)
|
||||
raises (IndexOutOfBounds);
|
||||
};
|
||||
|
||||
interface Shape
|
||||
{
|
||||
// draw to be overriden in java
|
||||
void draw();
|
||||
|
||||
// and info
|
||||
void showInfo();
|
||||
};
|
||||
|
||||
// GraphicalShape object extends Shape
|
||||
interface GraphicalObject : Shape
|
||||
{
|
||||
// unqualified member
|
||||
attribute boolean is_filled;
|
||||
|
||||
// we cannot set this, so only getter will be implemented.
|
||||
// only time a shape can change is if it's in the matrix or if Dr.Strange is in town.
|
||||
readonly attribute string name;
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user