/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package clips.shedule.template;
import TimeTable.spans.SpanException;
import TimeTable.spans.TimeSpanAlphBtn;
import clips.delegate.directory.complex.DirectoryWorkTypeItem;
import cli_fmw.main.ClipsException;
import clips.delegate.shedule.individual.SheduleIndividualData;
/**
*
* @author axe
*/
class TimeSpanWork extends TimeSpanAlphBtn {
private SheduleIndividualData work;
public TimeSpanWork(SheduleIndividualData work) throws ClipsException {
super(work.getBegin(), work.getWorkDuration());
DirectoryWorkTypeItem type = work.getType();
setColorDarken(type.getColorShadow());
setColorLighten(type.getColorHightlight());
setText(type.getTitle() + " (" + work.getCabinet().toString() + ") ");
this.work = work;
}
public SheduleIndividualData getWork() {
return work;
}
/**
*
* @throws cli_fmw.delegate.ClipsException
*/
public void updateSpan() throws SpanException, ClipsException {
set(work.getBegin(), work.getWorkDuration());
DirectoryWorkTypeItem workType = work.getType();
setColorDarken(workType.getColorShadow());
setColorLighten(workType.getColorHightlight());
setText(workType.getTitle() + " (" + work.getCabinet().toString() + ") ");
fireEvent();
}
}