本文整理汇总了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);
}
}
示例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));
}
示例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);
}
示例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;
}