excercise 2 done
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user