python-awips/dynamicserialize/adapters/PointAdapter.py

29 lines
610 B
Python
Raw Permalink Normal View History

2018-09-05 15:52:38 -06:00
#
# Adapter for java.awt.Point
#
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 08/31/10 njensen Initial Creation.
#
from dynamicserialize.dstypes.java.awt import Point
ClassAdapter = 'java.awt.Point'
2018-10-14 17:37:08 -06:00
2018-09-05 15:52:38 -06:00
def serialize(context, point):
context.writeI32(point.getX())
context.writeI32(point.getY())
2018-10-14 17:37:08 -06:00
2018-09-05 15:52:38 -06:00
def deserialize(context):
x = context.readI32()
y = context.readI32()
point = Point()
point.setX(x)
point.setY(y)
return point