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


Java Step.addSubStep方法代码示例

本文整理汇总了Java中org.tltv.gantt.client.shared.Step.addSubStep方法的典型用法代码示例。如果您正苦于以下问题:Java Step.addSubStep方法的具体用法?Java Step.addSubStep怎么用?Java Step.addSubStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.tltv.gantt.client.shared.Step的用法示例。


在下文中一共展示了Step.addSubStep方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addViewGenericRoleMemberToStep

import org.tltv.gantt.client.shared.Step; //导入方法依赖的package包/类
/**
 * Adds the view generic role member to step.
 *
 * @param stepName
 *            the step name
 * @param step
 *            the step
 * @param assignments
 *            the assignments
 * @param stepMapping
 *            the step mapping
 */
private void addViewGenericRoleMemberToStep(final String stepName, final Step step, final List<T> assignments,
		final StepMapping<T> stepMapping) {

	for (final T assignmentData : assignments) {

		String subStepName = "";

		if (stepMapping.getRoleCode(assignmentData) != null) {
			subStepName = new StringBuilder().append(stepMapping.getFirstName(assignmentData))
					.append(CONTENT_SEPARATOR).append(stepMapping.getLastName(assignmentData))
					.append(PARTY_START_TAG).append(stepMapping.getParty(assignmentData)).append(PARTY_END_TAG)
					.toString();
		}

		final SubStep sameRoleSubStep = new SubStep(stepName + '.' + subStepName,CaptionMode.HTML);
		sameRoleSubStep.setDescription(stepName + '.' + subStepName);			
		sameRoleSubStep.setBackgroundColor(stepMapping.getBackgroundColor(assignmentData));

		sameRoleSubStep.setStartDate(stepMapping.getFromDate(assignmentData).getTime());
		sameRoleSubStep.setEndDate(stripDatesAfterCurrentDate(stepMapping.getToDate(assignmentData)).getTime());

		step.addSubStep(sameRoleSubStep);
	}
}
 
开发者ID:Hack23,项目名称:cia,代码行数:37,代码来源:AbstractGhantChartManagerImpl.java

示例2: removeSteps_withTwoStepsOneHasSubStep_sizeIsZeroAndComponetHierarchyCleaned

import org.tltv.gantt.client.shared.Step; //导入方法依赖的package包/类
@Test
public void removeSteps_withTwoStepsOneHasSubStep_sizeIsZeroAndComponetHierarchyCleaned() {
    Gantt gantt = new Gantt();

    SubStep subStep = new SubStep();
    Step stepWithSubStep = new Step();
    stepWithSubStep.addSubStep(subStep);
    gantt.addStep(stepWithSubStep);
    gantt.addStep(new Step());

    AbstractStepComponent stepWithSubStepComponent = gantt
            .getStepComponent(stepWithSubStep);
    AbstractStepComponent subStepComponent = gantt
            .getStepComponent(subStep);
    Assert.assertNotNull(stepWithSubStepComponent.getParent());
    Assert.assertNotNull(subStepComponent.getParent());

    gantt.removeSteps();
    Assert.assertEquals(0, gantt.getSteps().size());
    Assert.assertNull(stepWithSubStepComponent.getParent());
    Assert.assertNull(subStepComponent.getParent());
    Assert.assertNull(gantt.getStepComponent(stepWithSubStep));
    Assert.assertNull(gantt.getStepComponent(subStep));
}
 
开发者ID:tltv,项目名称:gantt,代码行数:25,代码来源:GanttTest.java

示例3: moveSubStep

import org.tltv.gantt.client.shared.Step; //导入方法依赖的package包/类
/**
 * Moves sub-step to other step. Does nothing, if either is null, or
 * sub-step's owner is null or owner is same as target step.
 */
public void moveSubStep(SubStep subStep, Step toStep) {
    if (subStep == null || toStep == null || subStep.getOwner() == null || subStep.getOwner().equals(toStep)) {
        return;
    }
    subStep.getOwner().removeSubStep(subStep);
    toStep.addSubStep(subStep);
}
 
开发者ID:tltv,项目名称:gantt,代码行数:12,代码来源:Gantt.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.addSubStep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。