54 lines
1.1 KiB
Plaintext
54 lines
1.1 KiB
Plaintext
// 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;
|
|
};
|
|
|
|
|
|
};
|