Implement serialize in and out functions in rulerGraphics