;+
;change title location
;+
PRO sesTitle::ChangeXY , eventX , eventY , type
	COMPILE_OPT IDL2
	oSystem = self.oSystem
	imageClass = oSystem.CurrentPro
	imageClass.oView->GetProperty,Dimensions = dim,Location = loc
	newLoc = [loc[0]+dim[0]/2,loc[1]+dim[1]/2]
	ox = eventX-newLoc[0]
	oy = eventY-newLoc[1]
	CASE type OF
		0:BEGIN
			self.Label->SetProperty,Location = [loc[0]+ox, loc[1]+oy]
		END
		1:BEGIN
			self.colorView->SetProperty,Location = [ox, oy]
		END
	ELSE:
	ENDCASE
	oSystem.oWindow -> Draw, oSystem.oScene
END
;+
;add title
;+
PRO sesTitle::Create
	COMPILE_OPT IDL2
	oSystem = self.oSystem
	imageClass = oSystem.CurrentPro
	zoom = imageClass.zoom
	Obj_Destroy,self.titleContainer
	self.titleContainer = Obj_New('IDL_Container')
	self.titleModel = Obj_New('IDLgrModel')
	imageClass.oView->GetProperty, Dimensions = viewDim , $
	                               Location = viewLoc
	Location = FltArr(2,6)
	IF Obj_Class(imageClass) EQ 'SESSINGLEIMAGE' OR $
	   Obj_Class(imageClass) EQ 'SESCHANGEIMAGE' THEN BEGIN
		fileName = imageClass.titleContent

		fileName    = 'Content:         ' + fileName[0] + '!C' + $
		              'Waveleng:      ' + fileName[1] + '!C' + $
		              'HSOS_NO:     ' + fileName[2] + '!C' + $
		              'T_START:       ' + fileName[3] + '!C' +  $
		              'T_END:           ' + fileName[4] + '!C' +  $
					  'TIME_POS:     ' + fileName[5]
		Location = [15,viewDim[1]-12*zoom*6-20]

	ENDIF

	font = Obj_New('IDLgrFont', 'Helvetica', Size=12*zoom)

	Label  = Obj_New('IDLgrText'                            , $
	                   Alignment = 0                        , $
	                   Color           = [255,255,255]	    , $
					   Location        = Location           , $
					   Strings         = fileName           , $
					   /Enable_Formatting                   , $
	                   font = font           )

	self.titleModel->Add,Label
	self.titleContainer->Add,Label

	imageClass.oModel->Add,self.titleModel
	oSystem.oWindow -> Draw, oSystem.oScene
	self.titleContainer->Add,font
	self.titleContainer->Add,self.titleModel

END
;+
;clean up
;+
PRO sesTitle::CleanUp
	COMPILE_OPT IDL2
	Obj_Destroy , self.titleContainer

END
;+
;initialize
;+
FUNCTION sesTitle::Init  , oSystem = oSystem

	COMPILE_OPT IDL2
	self.oSystem = oSystem
	self.mainBase = oSystem.mBase
	self->Create

	Return,1
END
;+
;Title class name
;+
PRO sesTitle__Define
	COMPILE_OPT IDL2
	void = { sesTitle                             , $
	         ;system parameter
	         mainBase           :    0L           , $
			 ;system objct

			 titleContainer     :    Obj_New()    , $
			 Label      		:    Obj_New()    , $
			 titleModel	        :    Obj_New()    , $
	         oSystem            :    Obj_New()      $

	        }
END