@Override public TimeLinePanel build(DependencyProvider dependencyProvider) { return new TimeLinePanel(dependencyProvider.get(PDPModel.class)); } }
TimelineBar(Display d) { display = d; contents = createNewTransparentImg(display, WIDTH_PX, TL_BAR_HEIGHT_PX); font = new Font(display, "arial", FONT_SIZE, SWT.NORMAL); drawTimeline(); }
.withColorAssociation(Parcel.class, BLUE) .withColorAssociation(Vehicle.class, PURPLE)) .with(TimeLinePanel.builder()) .with(RouteRenderer.builder()) .with(RoutePanel.builder().withPositionLeft())
.withColorAssociation(Parcel.class, BLUE) .withColorAssociation(Vehicle.class, PURPLE)) .with(TimeLinePanel.builder()) .with(RouteRenderer.builder()) .with(RoutePanel.builder().withPositionLeft())
.showGui(View.builder() .with(PlaneRoadModelRenderer.builder()) .with(TimeLinePanel.builder()) .with( RoadUserRenderer.builder()
TimelineBar(Display d) { display = d; contents = createNewTransparentImg(display, WIDTH_PX, TL_BAR_HEIGHT_PX); font = new Font(display, "arial", FONT_SIZE, SWT.NORMAL); drawTimeline(); }
@Override public TimeLinePanel build(DependencyProvider dependencyProvider) { return new TimeLinePanel(dependencyProvider.get(PDPModel.class)); } }
.with(RoadUserRenderer.builder()) .with(PDPModelRenderer.builder()) .with(TimeLinePanel.builder()) .withSpeedUp(200) .withAutoClose()
void update(int width) { if (contents.getBounds().width < width) { contents.dispose(); contents = createNewTransparentImg(display, width + ADDITIONAL_WIDTH, TL_BAR_HEIGHT_PX); drawTimeline(); } }
static StatisticsDTO simulate(Scenario scenario) { final ExperimentResults results = Experiment.builder() .addScenario(scenario) .addConfiguration(Central.solverConfiguration( StochasticSuppliers.constant(TestSolvers.lazyInsertion()))) .withThreads(1) .usePostProcessor(PostProcessors.statisticsPostProcessor(OBJ_FUNC)) .showGui(View.builder() .withAutoPlay() // .withAutoClose() .withSpeedUp(4) // .withFullScreen() .withTitleAppendix("AAMAS 2016 Experiment") .with(RoadUserRenderer.builder() .withToStringLabel()) .with(PDPModelRenderer.builder()) .with(RouteRenderer.builder()) .with(PlaneRoadModelRenderer.builder()) .with(TimeLinePanel.builder()) .withResolution(1280, 1024)) .showGui(false) .perform(); final SimulationResult res = results.getResults().iterator().next(); final StatisticsDTO stats = (StatisticsDTO) res.getResultObject(); return stats; }
void update(int width) { if (contents.getBounds().width < width) { contents.dispose(); contents = createNewTransparentImg(display, width + ADDITIONAL_WIDTH, TL_BAR_HEIGHT_PX); drawTimeline(); } }
void ensureImg() { if (!contents.isPresent()) { contents = Optional.of(createNewTransparentImg(display, WIDTH_PX, START_HEIGHT)); final GC gc = new GC(contents.get()); drawVerticals(gc, WIDTH_PX, START_HEIGHT); gc.dispose(); } else { final boolean wViolation = width > contents.get().getBounds().width; final boolean hViolation = height > contents.get().getBounds().height; if (wViolation || hViolation) { final int newWidth = Math .max(width, contents.get().getBounds().width) + (wViolation ? (int) (HOUR / TIME_PER_PIXEL) : 0); final int newHeight = contents.get().getBounds().height + (hViolation ? ADDITIONAL_HEIGHT_FACTOR * ROW_HEIGHT : 0); final Image newContents = createNewTransparentImg(display, newWidth, newHeight); // copy previous image to new image final GC gc = new GC(newContents); // draw vertical grid lines drawVerticals(gc, newWidth, newHeight); gc.drawImage(contents.get(), 0, 0); gc.dispose(); contents.get().dispose(); contents = Optional.of(newContents); } } }
void ensureImg() { if (!contents.isPresent()) { contents = Optional.of(createNewTransparentImg(display, WIDTH_PX, START_HEIGHT)); final GC gc = new GC(contents.get()); drawVerticals(gc, WIDTH_PX, START_HEIGHT); gc.dispose(); } else { final boolean wViolation = width > contents.get().getBounds().width; final boolean hViolation = height > contents.get().getBounds().height; if (wViolation || hViolation) { final int newWidth = Math .max(width, contents.get().getBounds().width) + (wViolation ? (int) (HOUR / TIME_PER_PIXEL) : 0); final int newHeight = contents.get().getBounds().height + (hViolation ? ADDITIONAL_HEIGHT_FACTOR * ROW_HEIGHT : 0); final Image newContents = createNewTransparentImg(display, newWidth, newHeight); // copy previous image to new image final GC gc = new GC(newContents); // draw vertical grid lines drawVerticals(gc, newWidth, newHeight); gc.drawImage(contents.get(), 0, 0); gc.dispose(); contents.get().dispose(); contents = Optional.of(newContents); } } }