本文整理汇总了Java中org.tltv.gantt.client.shared.Step.setEndDate方法的典型用法代码示例。如果您正苦于以下问题:Java Step.setEndDate方法的具体用法?Java Step.setEndDate怎么用?Java Step.setEndDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tltv.gantt.client.shared.Step
的用法示例。
在下文中一共展示了Step.setEndDate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buttonClick
import org.tltv.gantt.client.shared.Step; //导入方法依赖的package包/类
@Override
public void buttonClick(ClickEvent event) {
Step newStep = new Step();
Date now = new Date();
newStep.setStartDate(now.getTime());
newStep.setEndDate(now.getTime() + (7 * 24 * 3600000));
openStepEditor(newStep);
}
示例2: ajustDatesBySubStep
import org.tltv.gantt.client.shared.Step; //导入方法依赖的package包/类
protected Step ajustDatesBySubStep(AbstractStep step) {
// adjust parent step start/end date:
SubStep subStep = ((SubStep) step);
Step owner = subStep.getOwner();
// Cut owner step's start/end date to fit sub-steps in.
if (owner.isStartDateUndefined() || subStep.getStartDate() < owner.getStartDate()) {
owner.setStartDate(subStep.getStartDate());
}
if (owner.isEndDateUndefined() || subStep.getEndDate() > owner.getEndDate()) {
owner.setEndDate(subStep.getEndDate());
}
return owner;
}
示例3: addStepWithDatesAndGetByUid_addAndGetSuccessfully
import org.tltv.gantt.client.shared.Step; //导入方法依赖的package包/类
@Test
public void addStepWithDatesAndGetByUid_addAndGetSuccessfully() {
Gantt gantt = new Gantt();
gantt.setResolution(Resolution.Day);
DateTime start = new DateTime(2014, 1, 1, 10, 30, 30, 123);
DateTime end = new DateTime(2014, 9, 1, 10, 30, 30, 123);
gantt.setStartDate(start.toDate());
gantt.setEndDate(end.toDate());
List<Step> steps = new ArrayList<Step>();
DateTime expectedStart = new DateTime(2014, 1, 1, 10, 30, 30, 123);
DateTime expectedEnd = new DateTime(2014, 1, 8, 10, 30, 30, 123);
DateTime stepStart = new DateTime(2014, 1, 1, 10, 30, 30, 123);
DateTime stepEnd = new DateTime(2014, 1, 8, 10, 30, 30, 123);
Step step = new Step();
step.setStartDate(stepStart.toDate());
step.setEndDate(stepEnd.toDate());
gantt.addStep(step);
steps.add(step);
Assert.assertNotNull(step.getUid());
Step foundStep = (Step) gantt.getStep(step.getUid());
Assert.assertNotNull(foundStep);
Assert.assertEquals(step, foundStep);
Assert.assertEquals(step.getUid(), foundStep.getUid());
Assert.assertTrue(steps.contains(foundStep));
Assert.assertEquals(expectedStart.toDate().getTime(),
foundStep.getStartDate());
Assert.assertEquals(expectedEnd.toDate().getTime(),
foundStep.getEndDate());
}
示例4: buildGantt
import org.tltv.gantt.client.shared.Step; //导入方法依赖的package包/类
protected Gantt buildGantt(IRecordStorageModule<?> storage, IRecordStoreInfo recordInfo)
{
double[] timeRange = storage.getRecordsTimeRange(recordInfo.getName());
timeRange[0] -= 3600;
timeRange[1] += 3600;
Gantt gantt = new Gantt();
gantt.setWidth(100, Unit.PERCENTAGE);
gantt.setHeight(130, Unit.PIXELS);
gantt.setResizableSteps(false);
gantt.setMovableSteps(false);
gantt.setStartDate(new Date((long)(timeRange[0]*1000)));
gantt.setEndDate(new Date((long)(timeRange[1]*1000)));
gantt.setYearsVisible(false);
gantt.setTimelineMonthFormat("MMMM yyyy");
gantt.setResolution(Resolution.Hour);
Step dataTimeRange = new Step(getPrettyName(recordInfo.getRecordDescription()));
dataTimeRange.setBackgroundColor("FFFFFF");
dataTimeRange.setStartDate((long)(timeRange[0]*1000));
dataTimeRange.setEndDate((long)(timeRange[1]*1000));
// add periods when data is actually available
Iterator<double[]> clusterTimes = storage.getRecordsTimeClusters(recordInfo.getName());
while (clusterTimes.hasNext())
{
timeRange = clusterTimes.next();
SubStep clusterPeriod = new SubStep();
clusterPeriod.setStartDate((long)(timeRange[0]*1000));
clusterPeriod.setEndDate((long)(timeRange[1]*1000));
dataTimeRange.addSubStep(clusterPeriod);
clusterPeriod.setDescription(
new DateTimeFormat().formatIso(timeRange[0], 0) + " / " +
new DateTimeFormat().formatIso(timeRange[1], 0)
);
}
gantt.addStep(dataTimeRange);
gantt.addClickListener(new Gantt.ClickListener() {
private static final long serialVersionUID = 1L;
public void onGanttClick(org.tltv.gantt.Gantt.ClickEvent event) {
System.out.println("click");
}
});
return gantt;
}