当前位置: 首页>>代码示例>>Java>>正文


Java Step.setEndDate方法代码示例

本文整理汇总了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);
}
 
开发者ID:tltv,项目名称:gantt,代码行数:9,代码来源:DemoUI.java

示例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;
}
 
开发者ID:tltv,项目名称:gantt,代码行数:14,代码来源:Gantt.java

示例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());
}
 
开发者ID:tltv,项目名称:gantt,代码行数:40,代码来源:GanttTest.java

示例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;
}
 
开发者ID:sensiasoft,项目名称:sensorhub,代码行数:50,代码来源:StorageAdminPanel.java


注:本文中的org.tltv.gantt.client.shared.Step.setEndDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。