excercise 2 done
This commit is contained in:
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObject.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObject.class
Normal file
Binary file not shown.
15
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObject.java
Normal file
15
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObject.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/GraphicalObject.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// GraphicalShape object extends Shape
|
||||
public interface GraphicalObject extends GraphicalObjectOperations, GraphicsApp.Shape, org.omg.CORBA.portable.IDLEntity
|
||||
{
|
||||
} // interface GraphicalObject
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObjectHelper.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObjectHelper.class
Normal file
Binary file not shown.
@@ -0,0 +1,87 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/GraphicalObjectHelper.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// GraphicalShape object extends Shape
|
||||
abstract public class GraphicalObjectHelper
|
||||
{
|
||||
private static String _id = "IDL:GraphicsApp/GraphicalObject:1.0";
|
||||
|
||||
public static void insert (org.omg.CORBA.Any a, GraphicsApp.GraphicalObject that)
|
||||
{
|
||||
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
|
||||
a.type (type ());
|
||||
write (out, that);
|
||||
a.read_value (out.create_input_stream (), type ());
|
||||
}
|
||||
|
||||
public static GraphicsApp.GraphicalObject extract (org.omg.CORBA.Any a)
|
||||
{
|
||||
return read (a.create_input_stream ());
|
||||
}
|
||||
|
||||
private static org.omg.CORBA.TypeCode __typeCode = null;
|
||||
synchronized public static org.omg.CORBA.TypeCode type ()
|
||||
{
|
||||
if (__typeCode == null)
|
||||
{
|
||||
__typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (GraphicsApp.GraphicalObjectHelper.id (), "GraphicalObject");
|
||||
}
|
||||
return __typeCode;
|
||||
}
|
||||
|
||||
public static String id ()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
public static GraphicsApp.GraphicalObject read (org.omg.CORBA.portable.InputStream istream)
|
||||
{
|
||||
return narrow (istream.read_Object (_GraphicalObjectStub.class));
|
||||
}
|
||||
|
||||
public static void write (org.omg.CORBA.portable.OutputStream ostream, GraphicsApp.GraphicalObject value)
|
||||
{
|
||||
ostream.write_Object ((org.omg.CORBA.Object) value);
|
||||
}
|
||||
|
||||
public static GraphicsApp.GraphicalObject narrow (org.omg.CORBA.Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
else if (obj instanceof GraphicsApp.GraphicalObject)
|
||||
return (GraphicsApp.GraphicalObject)obj;
|
||||
else if (!obj._is_a (id ()))
|
||||
throw new org.omg.CORBA.BAD_PARAM ();
|
||||
else
|
||||
{
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
|
||||
GraphicsApp._GraphicalObjectStub stub = new GraphicsApp._GraphicalObjectStub ();
|
||||
stub._set_delegate(delegate);
|
||||
return stub;
|
||||
}
|
||||
}
|
||||
|
||||
public static GraphicsApp.GraphicalObject unchecked_narrow (org.omg.CORBA.Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
else if (obj instanceof GraphicsApp.GraphicalObject)
|
||||
return (GraphicsApp.GraphicalObject)obj;
|
||||
else
|
||||
{
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
|
||||
GraphicsApp._GraphicalObjectStub stub = new GraphicsApp._GraphicalObjectStub ();
|
||||
stub._set_delegate(delegate);
|
||||
return stub;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObjectHolder.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObjectHolder.class
Normal file
Binary file not shown.
@@ -0,0 +1,40 @@
|
||||
package GraphicsApp;
|
||||
|
||||
/**
|
||||
* GraphicsApp/GraphicalObjectHolder.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// GraphicalShape object extends Shape
|
||||
public final class GraphicalObjectHolder implements org.omg.CORBA.portable.Streamable
|
||||
{
|
||||
public GraphicsApp.GraphicalObject value = null;
|
||||
|
||||
public GraphicalObjectHolder ()
|
||||
{
|
||||
}
|
||||
|
||||
public GraphicalObjectHolder (GraphicsApp.GraphicalObject initialValue)
|
||||
{
|
||||
value = initialValue;
|
||||
}
|
||||
|
||||
public void _read (org.omg.CORBA.portable.InputStream i)
|
||||
{
|
||||
value = GraphicsApp.GraphicalObjectHelper.read (i);
|
||||
}
|
||||
|
||||
public void _write (org.omg.CORBA.portable.OutputStream o)
|
||||
{
|
||||
GraphicsApp.GraphicalObjectHelper.write (o, value);
|
||||
}
|
||||
|
||||
public org.omg.CORBA.TypeCode _type ()
|
||||
{
|
||||
return GraphicsApp.GraphicalObjectHelper.type ();
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/GraphicalObjectOperations.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// GraphicalShape object extends Shape
|
||||
public interface GraphicalObjectOperations extends GraphicsApp.ShapeOperations
|
||||
{
|
||||
|
||||
// unqualified member
|
||||
boolean is_filled ();
|
||||
|
||||
// unqualified member
|
||||
void is_filled (boolean newIs_filled);
|
||||
|
||||
// only time a shape can change is if it's in the matrix or if Dr.Strange is in town.
|
||||
String name ();
|
||||
} // interface GraphicalObjectOperations
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObjectPOA.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObjectPOA.class
Normal file
Binary file not shown.
120
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObjectPOA.java
Normal file
120
week1_TinsaeGhilay/Task2/GraphicsApp/GraphicalObjectPOA.java
Normal file
@@ -0,0 +1,120 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/GraphicalObjectPOA.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// GraphicalShape object extends Shape
|
||||
public abstract class GraphicalObjectPOA extends org.omg.PortableServer.Servant
|
||||
implements GraphicsApp.GraphicalObjectOperations, org.omg.CORBA.portable.InvokeHandler
|
||||
{
|
||||
|
||||
// Constructors
|
||||
|
||||
private static java.util.Hashtable _methods = new java.util.Hashtable ();
|
||||
static
|
||||
{
|
||||
_methods.put ("_get_is_filled", new java.lang.Integer (0));
|
||||
_methods.put ("_set_is_filled", new java.lang.Integer (1));
|
||||
_methods.put ("_get_name", new java.lang.Integer (2));
|
||||
_methods.put ("draw", new java.lang.Integer (3));
|
||||
_methods.put ("showInfo", new java.lang.Integer (4));
|
||||
}
|
||||
|
||||
public org.omg.CORBA.portable.OutputStream _invoke (String $method,
|
||||
org.omg.CORBA.portable.InputStream in,
|
||||
org.omg.CORBA.portable.ResponseHandler $rh)
|
||||
{
|
||||
org.omg.CORBA.portable.OutputStream out = null;
|
||||
java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
|
||||
if (__method == null)
|
||||
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
|
||||
|
||||
switch (__method.intValue ())
|
||||
{
|
||||
|
||||
// unqualified member
|
||||
case 0: // GraphicsApp/GraphicalObject/_get_is_filled
|
||||
{
|
||||
boolean $result = false;
|
||||
$result = this.is_filled ();
|
||||
out = $rh.createReply();
|
||||
out.write_boolean ($result);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// unqualified member
|
||||
case 1: // GraphicsApp/GraphicalObject/_set_is_filled
|
||||
{
|
||||
boolean newIs_filled = in.read_boolean ();
|
||||
this.is_filled (newIs_filled);
|
||||
out = $rh.createReply();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// only time a shape can change is if it's in the matrix or if Dr.Strange is in town.
|
||||
case 2: // GraphicsApp/GraphicalObject/_get_name
|
||||
{
|
||||
String $result = null;
|
||||
$result = this.name ();
|
||||
out = $rh.createReply();
|
||||
out.write_string ($result);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// draw to be overriden in java
|
||||
case 3: // GraphicsApp/Shape/draw
|
||||
{
|
||||
this.draw ();
|
||||
out = $rh.createReply();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// and info
|
||||
case 4: // GraphicsApp/Shape/showInfo
|
||||
{
|
||||
this.showInfo ();
|
||||
out = $rh.createReply();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
|
||||
}
|
||||
|
||||
return out;
|
||||
} // _invoke
|
||||
|
||||
// Type-specific CORBA::Object operations
|
||||
private static String[] __ids = {
|
||||
"IDL:GraphicsApp/GraphicalObject:1.0",
|
||||
"IDL:GraphicsApp/Shape:1.0"};
|
||||
|
||||
public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
|
||||
{
|
||||
return (String[])__ids.clone ();
|
||||
}
|
||||
|
||||
public GraphicalObject _this()
|
||||
{
|
||||
return GraphicalObjectHelper.narrow(
|
||||
super._this_object());
|
||||
}
|
||||
|
||||
public GraphicalObject _this(org.omg.CORBA.ORB orb)
|
||||
{
|
||||
return GraphicalObjectHelper.narrow(
|
||||
super._this_object(orb));
|
||||
}
|
||||
|
||||
|
||||
} // class GraphicalObjectPOA
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ObjectSequenceHelper.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ObjectSequenceHelper.class
Normal file
Binary file not shown.
@@ -0,0 +1,62 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/ObjectSequenceHelper.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
abstract public class ObjectSequenceHelper
|
||||
{
|
||||
private static String _id = "IDL:GraphicsApp/ObjectSequence:1.0";
|
||||
|
||||
public static void insert (org.omg.CORBA.Any a, GraphicsApp.GraphicalObject[] that)
|
||||
{
|
||||
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
|
||||
a.type (type ());
|
||||
write (out, that);
|
||||
a.read_value (out.create_input_stream (), type ());
|
||||
}
|
||||
|
||||
public static GraphicsApp.GraphicalObject[] extract (org.omg.CORBA.Any a)
|
||||
{
|
||||
return read (a.create_input_stream ());
|
||||
}
|
||||
|
||||
private static org.omg.CORBA.TypeCode __typeCode = null;
|
||||
synchronized public static org.omg.CORBA.TypeCode type ()
|
||||
{
|
||||
if (__typeCode == null)
|
||||
{
|
||||
__typeCode = GraphicsApp.GraphicalObjectHelper.type ();
|
||||
__typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode);
|
||||
__typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (GraphicsApp.ObjectSequenceHelper.id (), "ObjectSequence", __typeCode);
|
||||
}
|
||||
return __typeCode;
|
||||
}
|
||||
|
||||
public static String id ()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
public static GraphicsApp.GraphicalObject[] read (org.omg.CORBA.portable.InputStream istream)
|
||||
{
|
||||
GraphicsApp.GraphicalObject value[] = null;
|
||||
int _len0 = istream.read_long ();
|
||||
value = new GraphicsApp.GraphicalObject[_len0];
|
||||
for (int _o1 = 0;_o1 < value.length; ++_o1)
|
||||
value[_o1] = GraphicsApp.GraphicalObjectHelper.read (istream);
|
||||
return value;
|
||||
}
|
||||
|
||||
public static void write (org.omg.CORBA.portable.OutputStream ostream, GraphicsApp.GraphicalObject[] value)
|
||||
{
|
||||
ostream.write_long (value.length);
|
||||
for (int _i0 = 0;_i0 < value.length; ++_i0)
|
||||
GraphicsApp.GraphicalObjectHelper.write (ostream, value[_i0]);
|
||||
}
|
||||
|
||||
}
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ObjectSequenceHolder.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ObjectSequenceHolder.class
Normal file
Binary file not shown.
@@ -0,0 +1,39 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/ObjectSequenceHolder.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
public final class ObjectSequenceHolder implements org.omg.CORBA.portable.Streamable
|
||||
{
|
||||
public GraphicsApp.GraphicalObject value[] = null;
|
||||
|
||||
public ObjectSequenceHolder ()
|
||||
{
|
||||
}
|
||||
|
||||
public ObjectSequenceHolder (GraphicsApp.GraphicalObject[] initialValue)
|
||||
{
|
||||
value = initialValue;
|
||||
}
|
||||
|
||||
public void _read (org.omg.CORBA.portable.InputStream i)
|
||||
{
|
||||
value = GraphicsApp.ObjectSequenceHelper.read (i);
|
||||
}
|
||||
|
||||
public void _write (org.omg.CORBA.portable.OutputStream o)
|
||||
{
|
||||
GraphicsApp.ObjectSequenceHelper.write (o, value);
|
||||
}
|
||||
|
||||
public org.omg.CORBA.TypeCode _type ()
|
||||
{
|
||||
return GraphicsApp.ObjectSequenceHelper.type ();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/Rectangle.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/Rectangle.class
Normal file
Binary file not shown.
15
week1_TinsaeGhilay/Task2/GraphicsApp/Rectangle.java
Normal file
15
week1_TinsaeGhilay/Task2/GraphicsApp/Rectangle.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/Rectangle.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// rectangle contains shapes which GraphicalObjects a
|
||||
public interface Rectangle extends RectangleOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity
|
||||
{
|
||||
} // interface Rectangle
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/RectangleHelper.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/RectangleHelper.class
Normal file
Binary file not shown.
87
week1_TinsaeGhilay/Task2/GraphicsApp/RectangleHelper.java
Normal file
87
week1_TinsaeGhilay/Task2/GraphicsApp/RectangleHelper.java
Normal file
@@ -0,0 +1,87 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/RectangleHelper.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// rectangle contains shapes which GraphicalObjects a
|
||||
abstract public class RectangleHelper
|
||||
{
|
||||
private static String _id = "IDL:GraphicsApp/Rectangle:1.0";
|
||||
|
||||
public static void insert (org.omg.CORBA.Any a, GraphicsApp.Rectangle that)
|
||||
{
|
||||
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
|
||||
a.type (type ());
|
||||
write (out, that);
|
||||
a.read_value (out.create_input_stream (), type ());
|
||||
}
|
||||
|
||||
public static GraphicsApp.Rectangle extract (org.omg.CORBA.Any a)
|
||||
{
|
||||
return read (a.create_input_stream ());
|
||||
}
|
||||
|
||||
private static org.omg.CORBA.TypeCode __typeCode = null;
|
||||
synchronized public static org.omg.CORBA.TypeCode type ()
|
||||
{
|
||||
if (__typeCode == null)
|
||||
{
|
||||
__typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (GraphicsApp.RectangleHelper.id (), "Rectangle");
|
||||
}
|
||||
return __typeCode;
|
||||
}
|
||||
|
||||
public static String id ()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
public static GraphicsApp.Rectangle read (org.omg.CORBA.portable.InputStream istream)
|
||||
{
|
||||
return narrow (istream.read_Object (_RectangleStub.class));
|
||||
}
|
||||
|
||||
public static void write (org.omg.CORBA.portable.OutputStream ostream, GraphicsApp.Rectangle value)
|
||||
{
|
||||
ostream.write_Object ((org.omg.CORBA.Object) value);
|
||||
}
|
||||
|
||||
public static GraphicsApp.Rectangle narrow (org.omg.CORBA.Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
else if (obj instanceof GraphicsApp.Rectangle)
|
||||
return (GraphicsApp.Rectangle)obj;
|
||||
else if (!obj._is_a (id ()))
|
||||
throw new org.omg.CORBA.BAD_PARAM ();
|
||||
else
|
||||
{
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
|
||||
GraphicsApp._RectangleStub stub = new GraphicsApp._RectangleStub ();
|
||||
stub._set_delegate(delegate);
|
||||
return stub;
|
||||
}
|
||||
}
|
||||
|
||||
public static GraphicsApp.Rectangle unchecked_narrow (org.omg.CORBA.Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
else if (obj instanceof GraphicsApp.Rectangle)
|
||||
return (GraphicsApp.Rectangle)obj;
|
||||
else
|
||||
{
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
|
||||
GraphicsApp._RectangleStub stub = new GraphicsApp._RectangleStub ();
|
||||
stub._set_delegate(delegate);
|
||||
return stub;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/RectangleHolder.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/RectangleHolder.class
Normal file
Binary file not shown.
40
week1_TinsaeGhilay/Task2/GraphicsApp/RectangleHolder.java
Normal file
40
week1_TinsaeGhilay/Task2/GraphicsApp/RectangleHolder.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package GraphicsApp;
|
||||
|
||||
/**
|
||||
* GraphicsApp/RectangleHolder.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// rectangle contains shapes which GraphicalObjects a
|
||||
public final class RectangleHolder implements org.omg.CORBA.portable.Streamable
|
||||
{
|
||||
public GraphicsApp.Rectangle value = null;
|
||||
|
||||
public RectangleHolder ()
|
||||
{
|
||||
}
|
||||
|
||||
public RectangleHolder (GraphicsApp.Rectangle initialValue)
|
||||
{
|
||||
value = initialValue;
|
||||
}
|
||||
|
||||
public void _read (org.omg.CORBA.portable.InputStream i)
|
||||
{
|
||||
value = GraphicsApp.RectangleHelper.read (i);
|
||||
}
|
||||
|
||||
public void _write (org.omg.CORBA.portable.OutputStream o)
|
||||
{
|
||||
GraphicsApp.RectangleHelper.write (o, value);
|
||||
}
|
||||
|
||||
public org.omg.CORBA.TypeCode _type ()
|
||||
{
|
||||
return GraphicsApp.RectangleHelper.type ();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/RectangleOperations.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/RectangleOperations.class
Normal file
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/RectangleOperations.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// rectangle contains shapes which GraphicalObjects a
|
||||
public interface RectangleOperations
|
||||
{
|
||||
|
||||
// hopping this will be an array of shapes.
|
||||
GraphicsApp.GraphicalObject[] objects ();
|
||||
|
||||
// hopping this will be an array of shapes.
|
||||
void objects (GraphicsApp.GraphicalObject[] newObjects);
|
||||
|
||||
// function to add shape
|
||||
void addObject (GraphicsApp.GraphicalObject newShape);
|
||||
|
||||
// and may be remove a shape from a position?
|
||||
void removeObjectAtPosition (int index) throws GraphicsApp.RectanglePackage.IndexOutOfBounds;
|
||||
} // interface RectangleOperations
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/RectanglePOA.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/RectanglePOA.class
Normal file
Binary file not shown.
114
week1_TinsaeGhilay/Task2/GraphicsApp/RectanglePOA.java
Normal file
114
week1_TinsaeGhilay/Task2/GraphicsApp/RectanglePOA.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/RectanglePOA.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// rectangle contains shapes which GraphicalObjects a
|
||||
public abstract class RectanglePOA extends org.omg.PortableServer.Servant
|
||||
implements GraphicsApp.RectangleOperations, org.omg.CORBA.portable.InvokeHandler
|
||||
{
|
||||
|
||||
// Constructors
|
||||
|
||||
private static java.util.Hashtable _methods = new java.util.Hashtable ();
|
||||
static
|
||||
{
|
||||
_methods.put ("_get_objects", new java.lang.Integer (0));
|
||||
_methods.put ("_set_objects", new java.lang.Integer (1));
|
||||
_methods.put ("addObject", new java.lang.Integer (2));
|
||||
_methods.put ("removeObjectAtPosition", new java.lang.Integer (3));
|
||||
}
|
||||
|
||||
public org.omg.CORBA.portable.OutputStream _invoke (String $method,
|
||||
org.omg.CORBA.portable.InputStream in,
|
||||
org.omg.CORBA.portable.ResponseHandler $rh)
|
||||
{
|
||||
org.omg.CORBA.portable.OutputStream out = null;
|
||||
java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
|
||||
if (__method == null)
|
||||
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
|
||||
|
||||
switch (__method.intValue ())
|
||||
{
|
||||
|
||||
// hopping this will be an array of shapes.
|
||||
case 0: // GraphicsApp/Rectangle/_get_objects
|
||||
{
|
||||
GraphicsApp.GraphicalObject $result[] = null;
|
||||
$result = this.objects ();
|
||||
out = $rh.createReply();
|
||||
GraphicsApp.ObjectSequenceHelper.write (out, $result);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// hopping this will be an array of shapes.
|
||||
case 1: // GraphicsApp/Rectangle/_set_objects
|
||||
{
|
||||
GraphicsApp.GraphicalObject newObjects[] = GraphicsApp.ObjectSequenceHelper.read (in);
|
||||
this.objects (newObjects);
|
||||
out = $rh.createReply();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// function to add shape
|
||||
case 2: // GraphicsApp/Rectangle/addObject
|
||||
{
|
||||
GraphicsApp.GraphicalObject newShape = GraphicsApp.GraphicalObjectHelper.read (in);
|
||||
this.addObject (newShape);
|
||||
out = $rh.createReply();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// and may be remove a shape from a position?
|
||||
case 3: // GraphicsApp/Rectangle/removeObjectAtPosition
|
||||
{
|
||||
try {
|
||||
int index = in.read_ulong ();
|
||||
this.removeObjectAtPosition (index);
|
||||
out = $rh.createReply();
|
||||
} catch (GraphicsApp.RectanglePackage.IndexOutOfBounds $ex) {
|
||||
out = $rh.createExceptionReply ();
|
||||
GraphicsApp.RectanglePackage.IndexOutOfBoundsHelper.write (out, $ex);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
|
||||
}
|
||||
|
||||
return out;
|
||||
} // _invoke
|
||||
|
||||
// Type-specific CORBA::Object operations
|
||||
private static String[] __ids = {
|
||||
"IDL:GraphicsApp/Rectangle:1.0"};
|
||||
|
||||
public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
|
||||
{
|
||||
return (String[])__ids.clone ();
|
||||
}
|
||||
|
||||
public Rectangle _this()
|
||||
{
|
||||
return RectangleHelper.narrow(
|
||||
super._this_object());
|
||||
}
|
||||
|
||||
public Rectangle _this(org.omg.CORBA.ORB orb)
|
||||
{
|
||||
return RectangleHelper.narrow(
|
||||
super._this_object(orb));
|
||||
}
|
||||
|
||||
|
||||
} // class RectanglePOA
|
||||
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
package GraphicsApp.RectanglePackage;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/RectanglePackage/IndexOutOfBounds.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
public final class IndexOutOfBounds extends org.omg.CORBA.UserException
|
||||
{
|
||||
|
||||
public IndexOutOfBounds ()
|
||||
{
|
||||
super(IndexOutOfBoundsHelper.id());
|
||||
} // ctor
|
||||
|
||||
|
||||
public IndexOutOfBounds (String $reason)
|
||||
{
|
||||
super(IndexOutOfBoundsHelper.id() + " " + $reason);
|
||||
} // ctor
|
||||
|
||||
} // class IndexOutOfBounds
|
||||
Binary file not shown.
@@ -0,0 +1,72 @@
|
||||
package GraphicsApp.RectanglePackage;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/RectanglePackage/IndexOutOfBoundsHelper.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
abstract public class IndexOutOfBoundsHelper
|
||||
{
|
||||
private static String _id = "IDL:GraphicsApp/Rectangle/IndexOutOfBounds:1.0";
|
||||
|
||||
public static void insert (org.omg.CORBA.Any a, GraphicsApp.RectanglePackage.IndexOutOfBounds that)
|
||||
{
|
||||
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
|
||||
a.type (type ());
|
||||
write (out, that);
|
||||
a.read_value (out.create_input_stream (), type ());
|
||||
}
|
||||
|
||||
public static GraphicsApp.RectanglePackage.IndexOutOfBounds extract (org.omg.CORBA.Any a)
|
||||
{
|
||||
return read (a.create_input_stream ());
|
||||
}
|
||||
|
||||
private static org.omg.CORBA.TypeCode __typeCode = null;
|
||||
private static boolean __active = false;
|
||||
synchronized public static org.omg.CORBA.TypeCode type ()
|
||||
{
|
||||
if (__typeCode == null)
|
||||
{
|
||||
synchronized (org.omg.CORBA.TypeCode.class)
|
||||
{
|
||||
if (__typeCode == null)
|
||||
{
|
||||
if (__active)
|
||||
{
|
||||
return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
|
||||
}
|
||||
__active = true;
|
||||
org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0];
|
||||
org.omg.CORBA.TypeCode _tcOf_members0 = null;
|
||||
__typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (GraphicsApp.RectanglePackage.IndexOutOfBoundsHelper.id (), "IndexOutOfBounds", _members0);
|
||||
__active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return __typeCode;
|
||||
}
|
||||
|
||||
public static String id ()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
public static GraphicsApp.RectanglePackage.IndexOutOfBounds read (org.omg.CORBA.portable.InputStream istream)
|
||||
{
|
||||
GraphicsApp.RectanglePackage.IndexOutOfBounds value = new GraphicsApp.RectanglePackage.IndexOutOfBounds ();
|
||||
// read and discard the repository ID
|
||||
istream.read_string ();
|
||||
return value;
|
||||
}
|
||||
|
||||
public static void write (org.omg.CORBA.portable.OutputStream ostream, GraphicsApp.RectanglePackage.IndexOutOfBounds value)
|
||||
{
|
||||
// write the repository ID
|
||||
ostream.write_string (id ());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package GraphicsApp.RectanglePackage;
|
||||
|
||||
/**
|
||||
* GraphicsApp/RectanglePackage/IndexOutOfBoundsHolder.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
public final class IndexOutOfBoundsHolder implements org.omg.CORBA.portable.Streamable
|
||||
{
|
||||
public GraphicsApp.RectanglePackage.IndexOutOfBounds value = null;
|
||||
|
||||
public IndexOutOfBoundsHolder ()
|
||||
{
|
||||
}
|
||||
|
||||
public IndexOutOfBoundsHolder (GraphicsApp.RectanglePackage.IndexOutOfBounds initialValue)
|
||||
{
|
||||
value = initialValue;
|
||||
}
|
||||
|
||||
public void _read (org.omg.CORBA.portable.InputStream i)
|
||||
{
|
||||
value = GraphicsApp.RectanglePackage.IndexOutOfBoundsHelper.read (i);
|
||||
}
|
||||
|
||||
public void _write (org.omg.CORBA.portable.OutputStream o)
|
||||
{
|
||||
GraphicsApp.RectanglePackage.IndexOutOfBoundsHelper.write (o, value);
|
||||
}
|
||||
|
||||
public org.omg.CORBA.TypeCode _type ()
|
||||
{
|
||||
return GraphicsApp.RectanglePackage.IndexOutOfBoundsHelper.type ();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/Shape.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/Shape.class
Normal file
Binary file not shown.
13
week1_TinsaeGhilay/Task2/GraphicsApp/Shape.java
Normal file
13
week1_TinsaeGhilay/Task2/GraphicsApp/Shape.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/Shape.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
public interface Shape extends ShapeOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity
|
||||
{
|
||||
} // interface Shape
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeHelper.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeHelper.class
Normal file
Binary file not shown.
85
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeHelper.java
Normal file
85
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeHelper.java
Normal file
@@ -0,0 +1,85 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/ShapeHelper.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
abstract public class ShapeHelper
|
||||
{
|
||||
private static String _id = "IDL:GraphicsApp/Shape:1.0";
|
||||
|
||||
public static void insert (org.omg.CORBA.Any a, GraphicsApp.Shape that)
|
||||
{
|
||||
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
|
||||
a.type (type ());
|
||||
write (out, that);
|
||||
a.read_value (out.create_input_stream (), type ());
|
||||
}
|
||||
|
||||
public static GraphicsApp.Shape extract (org.omg.CORBA.Any a)
|
||||
{
|
||||
return read (a.create_input_stream ());
|
||||
}
|
||||
|
||||
private static org.omg.CORBA.TypeCode __typeCode = null;
|
||||
synchronized public static org.omg.CORBA.TypeCode type ()
|
||||
{
|
||||
if (__typeCode == null)
|
||||
{
|
||||
__typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (GraphicsApp.ShapeHelper.id (), "Shape");
|
||||
}
|
||||
return __typeCode;
|
||||
}
|
||||
|
||||
public static String id ()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
public static GraphicsApp.Shape read (org.omg.CORBA.portable.InputStream istream)
|
||||
{
|
||||
return narrow (istream.read_Object (_ShapeStub.class));
|
||||
}
|
||||
|
||||
public static void write (org.omg.CORBA.portable.OutputStream ostream, GraphicsApp.Shape value)
|
||||
{
|
||||
ostream.write_Object ((org.omg.CORBA.Object) value);
|
||||
}
|
||||
|
||||
public static GraphicsApp.Shape narrow (org.omg.CORBA.Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
else if (obj instanceof GraphicsApp.Shape)
|
||||
return (GraphicsApp.Shape)obj;
|
||||
else if (!obj._is_a (id ()))
|
||||
throw new org.omg.CORBA.BAD_PARAM ();
|
||||
else
|
||||
{
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
|
||||
GraphicsApp._ShapeStub stub = new GraphicsApp._ShapeStub ();
|
||||
stub._set_delegate(delegate);
|
||||
return stub;
|
||||
}
|
||||
}
|
||||
|
||||
public static GraphicsApp.Shape unchecked_narrow (org.omg.CORBA.Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
else if (obj instanceof GraphicsApp.Shape)
|
||||
return (GraphicsApp.Shape)obj;
|
||||
else
|
||||
{
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
|
||||
GraphicsApp._ShapeStub stub = new GraphicsApp._ShapeStub ();
|
||||
stub._set_delegate(delegate);
|
||||
return stub;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeHolder.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeHolder.class
Normal file
Binary file not shown.
38
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeHolder.java
Normal file
38
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeHolder.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package GraphicsApp;
|
||||
|
||||
/**
|
||||
* GraphicsApp/ShapeHolder.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
public final class ShapeHolder implements org.omg.CORBA.portable.Streamable
|
||||
{
|
||||
public GraphicsApp.Shape value = null;
|
||||
|
||||
public ShapeHolder ()
|
||||
{
|
||||
}
|
||||
|
||||
public ShapeHolder (GraphicsApp.Shape initialValue)
|
||||
{
|
||||
value = initialValue;
|
||||
}
|
||||
|
||||
public void _read (org.omg.CORBA.portable.InputStream i)
|
||||
{
|
||||
value = GraphicsApp.ShapeHelper.read (i);
|
||||
}
|
||||
|
||||
public void _write (org.omg.CORBA.portable.OutputStream o)
|
||||
{
|
||||
GraphicsApp.ShapeHelper.write (o, value);
|
||||
}
|
||||
|
||||
public org.omg.CORBA.TypeCode _type ()
|
||||
{
|
||||
return GraphicsApp.ShapeHelper.type ();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeOperations.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeOperations.class
Normal file
Binary file not shown.
19
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeOperations.java
Normal file
19
week1_TinsaeGhilay/Task2/GraphicsApp/ShapeOperations.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/ShapeOperations.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
public interface ShapeOperations
|
||||
{
|
||||
|
||||
// draw to be overriden in java
|
||||
void draw ();
|
||||
|
||||
// and info
|
||||
void showInfo ();
|
||||
} // interface ShapeOperations
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ShapePOA.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/ShapePOA.class
Normal file
Binary file not shown.
82
week1_TinsaeGhilay/Task2/GraphicsApp/ShapePOA.java
Normal file
82
week1_TinsaeGhilay/Task2/GraphicsApp/ShapePOA.java
Normal file
@@ -0,0 +1,82 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/ShapePOA.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
public abstract class ShapePOA extends org.omg.PortableServer.Servant
|
||||
implements GraphicsApp.ShapeOperations, org.omg.CORBA.portable.InvokeHandler
|
||||
{
|
||||
|
||||
// Constructors
|
||||
|
||||
private static java.util.Hashtable _methods = new java.util.Hashtable ();
|
||||
static
|
||||
{
|
||||
_methods.put ("draw", new java.lang.Integer (0));
|
||||
_methods.put ("showInfo", new java.lang.Integer (1));
|
||||
}
|
||||
|
||||
public org.omg.CORBA.portable.OutputStream _invoke (String $method,
|
||||
org.omg.CORBA.portable.InputStream in,
|
||||
org.omg.CORBA.portable.ResponseHandler $rh)
|
||||
{
|
||||
org.omg.CORBA.portable.OutputStream out = null;
|
||||
java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
|
||||
if (__method == null)
|
||||
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
|
||||
|
||||
switch (__method.intValue ())
|
||||
{
|
||||
|
||||
// draw to be overriden in java
|
||||
case 0: // GraphicsApp/Shape/draw
|
||||
{
|
||||
this.draw ();
|
||||
out = $rh.createReply();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// and info
|
||||
case 1: // GraphicsApp/Shape/showInfo
|
||||
{
|
||||
this.showInfo ();
|
||||
out = $rh.createReply();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
|
||||
}
|
||||
|
||||
return out;
|
||||
} // _invoke
|
||||
|
||||
// Type-specific CORBA::Object operations
|
||||
private static String[] __ids = {
|
||||
"IDL:GraphicsApp/Shape:1.0"};
|
||||
|
||||
public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
|
||||
{
|
||||
return (String[])__ids.clone ();
|
||||
}
|
||||
|
||||
public Shape _this()
|
||||
{
|
||||
return ShapeHelper.narrow(
|
||||
super._this_object());
|
||||
}
|
||||
|
||||
public Shape _this(org.omg.CORBA.ORB orb)
|
||||
{
|
||||
return ShapeHelper.narrow(
|
||||
super._this_object(orb));
|
||||
}
|
||||
|
||||
|
||||
} // class ShapePOA
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/_GraphicalObjectStub.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/_GraphicalObjectStub.class
Normal file
Binary file not shown.
157
week1_TinsaeGhilay/Task2/GraphicsApp/_GraphicalObjectStub.java
Normal file
157
week1_TinsaeGhilay/Task2/GraphicsApp/_GraphicalObjectStub.java
Normal file
@@ -0,0 +1,157 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/_GraphicalObjectStub.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// GraphicalShape object extends Shape
|
||||
public class _GraphicalObjectStub extends org.omg.CORBA.portable.ObjectImpl implements GraphicsApp.GraphicalObject
|
||||
{
|
||||
|
||||
|
||||
// unqualified member
|
||||
public boolean is_filled ()
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("_get_is_filled", true);
|
||||
$in = _invoke ($out);
|
||||
boolean $result = $in.read_boolean ();
|
||||
return $result;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
return is_filled ( );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // is_filled
|
||||
|
||||
|
||||
// unqualified member
|
||||
public void is_filled (boolean newIs_filled)
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("_set_is_filled", true);
|
||||
$out.write_boolean (newIs_filled);
|
||||
$in = _invoke ($out);
|
||||
return;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
is_filled (newIs_filled );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // is_filled
|
||||
|
||||
|
||||
// only time a shape can change is if it's in the matrix or if Dr.Strange is in town.
|
||||
public String name ()
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("_get_name", true);
|
||||
$in = _invoke ($out);
|
||||
String $result = $in.read_string ();
|
||||
return $result;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
return name ( );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // name
|
||||
|
||||
|
||||
// draw to be overriden in java
|
||||
public void draw ()
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("draw", true);
|
||||
$in = _invoke ($out);
|
||||
return;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
draw ( );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // draw
|
||||
|
||||
|
||||
// and info
|
||||
public void showInfo ()
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("showInfo", true);
|
||||
$in = _invoke ($out);
|
||||
return;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
showInfo ( );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // showInfo
|
||||
|
||||
// Type-specific CORBA::Object operations
|
||||
private static String[] __ids = {
|
||||
"IDL:GraphicsApp/GraphicalObject:1.0",
|
||||
"IDL:GraphicsApp/Shape:1.0"};
|
||||
|
||||
public String[] _ids ()
|
||||
{
|
||||
return (String[])__ids.clone ();
|
||||
}
|
||||
|
||||
private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
|
||||
{
|
||||
String str = s.readUTF ();
|
||||
com.sun.corba.se.impl.orbutil.IORCheckImpl.check(str, "GraphicsApp._GraphicalObjectStub");
|
||||
String[] args = null;
|
||||
java.util.Properties props = null;
|
||||
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
|
||||
try {
|
||||
org.omg.CORBA.Object obj = orb.string_to_object (str);
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
|
||||
_set_delegate (delegate);
|
||||
} finally {
|
||||
orb.destroy() ;
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
|
||||
{
|
||||
String[] args = null;
|
||||
java.util.Properties props = null;
|
||||
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
|
||||
try {
|
||||
String str = orb.object_to_string (this);
|
||||
s.writeUTF (str);
|
||||
} finally {
|
||||
orb.destroy() ;
|
||||
}
|
||||
}
|
||||
} // class _GraphicalObjectStub
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/_RectangleStub.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/_RectangleStub.class
Normal file
Binary file not shown.
140
week1_TinsaeGhilay/Task2/GraphicsApp/_RectangleStub.java
Normal file
140
week1_TinsaeGhilay/Task2/GraphicsApp/_RectangleStub.java
Normal file
@@ -0,0 +1,140 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/_RectangleStub.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
|
||||
// rectangle contains shapes which GraphicalObjects a
|
||||
public class _RectangleStub extends org.omg.CORBA.portable.ObjectImpl implements GraphicsApp.Rectangle
|
||||
{
|
||||
|
||||
|
||||
// hopping this will be an array of shapes.
|
||||
public GraphicsApp.GraphicalObject[] objects ()
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("_get_objects", true);
|
||||
$in = _invoke ($out);
|
||||
GraphicsApp.GraphicalObject $result[] = GraphicsApp.ObjectSequenceHelper.read ($in);
|
||||
return $result;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
return objects ( );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // objects
|
||||
|
||||
|
||||
// hopping this will be an array of shapes.
|
||||
public void objects (GraphicsApp.GraphicalObject[] newObjects)
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("_set_objects", true);
|
||||
GraphicsApp.ObjectSequenceHelper.write ($out, newObjects);
|
||||
$in = _invoke ($out);
|
||||
return;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
objects (newObjects );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // objects
|
||||
|
||||
|
||||
// function to add shape
|
||||
public void addObject (GraphicsApp.GraphicalObject newShape)
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("addObject", true);
|
||||
GraphicsApp.GraphicalObjectHelper.write ($out, newShape);
|
||||
$in = _invoke ($out);
|
||||
return;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
addObject (newShape );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // addObject
|
||||
|
||||
|
||||
// and may be remove a shape from a position?
|
||||
public void removeObjectAtPosition (int index) throws GraphicsApp.RectanglePackage.IndexOutOfBounds
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("removeObjectAtPosition", true);
|
||||
$out.write_ulong (index);
|
||||
$in = _invoke ($out);
|
||||
return;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
if (_id.equals ("IDL:GraphicsApp/Rectangle/IndexOutOfBounds:1.0"))
|
||||
throw GraphicsApp.RectanglePackage.IndexOutOfBoundsHelper.read ($in);
|
||||
else
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
removeObjectAtPosition (index );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // removeObjectAtPosition
|
||||
|
||||
// Type-specific CORBA::Object operations
|
||||
private static String[] __ids = {
|
||||
"IDL:GraphicsApp/Rectangle:1.0"};
|
||||
|
||||
public String[] _ids ()
|
||||
{
|
||||
return (String[])__ids.clone ();
|
||||
}
|
||||
|
||||
private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
|
||||
{
|
||||
String str = s.readUTF ();
|
||||
com.sun.corba.se.impl.orbutil.IORCheckImpl.check(str, "GraphicsApp._RectangleStub");
|
||||
String[] args = null;
|
||||
java.util.Properties props = null;
|
||||
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
|
||||
try {
|
||||
org.omg.CORBA.Object obj = orb.string_to_object (str);
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
|
||||
_set_delegate (delegate);
|
||||
} finally {
|
||||
orb.destroy() ;
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
|
||||
{
|
||||
String[] args = null;
|
||||
java.util.Properties props = null;
|
||||
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
|
||||
try {
|
||||
String str = orb.object_to_string (this);
|
||||
s.writeUTF (str);
|
||||
} finally {
|
||||
orb.destroy() ;
|
||||
}
|
||||
}
|
||||
} // class _RectangleStub
|
||||
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/_ShapeStub.class
Normal file
BIN
week1_TinsaeGhilay/Task2/GraphicsApp/_ShapeStub.class
Normal file
Binary file not shown.
91
week1_TinsaeGhilay/Task2/GraphicsApp/_ShapeStub.java
Normal file
91
week1_TinsaeGhilay/Task2/GraphicsApp/_ShapeStub.java
Normal file
@@ -0,0 +1,91 @@
|
||||
package GraphicsApp;
|
||||
|
||||
|
||||
/**
|
||||
* GraphicsApp/_ShapeStub.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Graphics.idl
|
||||
* Tuesday, November 11, 2025 6:46:29 PM CET
|
||||
*/
|
||||
|
||||
public class _ShapeStub extends org.omg.CORBA.portable.ObjectImpl implements GraphicsApp.Shape
|
||||
{
|
||||
|
||||
|
||||
// draw to be overriden in java
|
||||
public void draw ()
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("draw", true);
|
||||
$in = _invoke ($out);
|
||||
return;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
draw ( );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // draw
|
||||
|
||||
|
||||
// and info
|
||||
public void showInfo ()
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("showInfo", true);
|
||||
$in = _invoke ($out);
|
||||
return;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
showInfo ( );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // showInfo
|
||||
|
||||
// Type-specific CORBA::Object operations
|
||||
private static String[] __ids = {
|
||||
"IDL:GraphicsApp/Shape:1.0"};
|
||||
|
||||
public String[] _ids ()
|
||||
{
|
||||
return (String[])__ids.clone ();
|
||||
}
|
||||
|
||||
private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
|
||||
{
|
||||
String str = s.readUTF ();
|
||||
com.sun.corba.se.impl.orbutil.IORCheckImpl.check(str, "GraphicsApp._ShapeStub");
|
||||
String[] args = null;
|
||||
java.util.Properties props = null;
|
||||
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
|
||||
try {
|
||||
org.omg.CORBA.Object obj = orb.string_to_object (str);
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
|
||||
_set_delegate (delegate);
|
||||
} finally {
|
||||
orb.destroy() ;
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
|
||||
{
|
||||
String[] args = null;
|
||||
java.util.Properties props = null;
|
||||
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
|
||||
try {
|
||||
String str = orb.object_to_string (this);
|
||||
s.writeUTF (str);
|
||||
} finally {
|
||||
orb.destroy() ;
|
||||
}
|
||||
}
|
||||
} // class _ShapeStub
|
||||
Reference in New Issue
Block a user