public GanttChart() { this.style = new GanttChartStyle(); this.settings = new GanttChartSettings(); }
@Override public AbstractSecuredBasePage onSaveOrUpdate() { getSettings().setOpenNodes(form.ganttChartEditTreeTablePanel.getOpenNodes()); getBaseDao().writeGanttObjects(getData(), ganttChartData.getRootObject()); return null; }
if (settings.getFromDate() != null) { fromDate = settings.getFromDate(); if (settings.getToDate() != null) { toDate = settings.getToDate(); g2.appendChild(SVGHelper.createText(doc, 0, 0, "WP")); g2.appendChild(SVGHelper.createText(doc, 0, 20, "Code")); g2.appendChild(SVGHelper.createText(doc, style.getWorkPackageLabelWidth(), 10, settings.getTitle())); } else { g2.appendChild(SVGHelper.createText(doc, 0, 10, settings.getTitle()));
final GanttTask ganttObject = row.getModelObject().getGanttObject(); boolean visible = true; if (form.getSettings().isShowOnlyVisibles() == true) { final GanttTaskImpl root = (GanttTaskImpl) ganttChartData.getRootObject(); GanttTask current = ganttObject;
panel.add(ganttChartEditTreeTablePanel); ganttChartEditTreeTablePanel.init(); ganttChartEditTreeTablePanel.setOpenNodes(getSettings().getOpenNodes()); gridBuilder.getPanel().add(imagePanel = new DivPanel(panel.newChildId()));
@Override public GanttChartDO newInstance() { return new GanttChartDO().setSettings(new GanttChartSettings()).setStyle(new GanttChartStyle()); }
@Override public void afterLoad(final GanttChartDO obj) { final XmlObjectReader reader = new XmlObjectReader(); reader.initialize(GanttChartStyle.class); reader.initialize(GanttChartSettings.class); final String styleAsXml = obj.getStyleAsXml(); final GanttChartStyle style; if (StringUtils.isEmpty(styleAsXml) == true) { style = new GanttChartStyle(); } else { style = (GanttChartStyle) reader.read(styleAsXml); } obj.setStyle(style); final String settingsAsXml = obj.getSettingsAsXml(); final GanttChartSettings settings; if (StringUtils.isEmpty(settingsAsXml) == true) { settings = new GanttChartSettings(); } else { settings = (GanttChartSettings) reader.read(settingsAsXml); } obj.setSettings(settings); }
@Test public void createImage() throws IOException { final GanttTask root = createTestChart(); final GanttChartStyle style = new GanttChartStyle(); final GanttChartSettings settings = new GanttChartSettings(); final GanttChart diagram = new GanttChart(root, style, settings, "test-chart"); writeFile("ganttTest.jpg", BatikImageRenderer.getByteArray(diagram.create(), 800, ImageFormat.JPEG)); writeFile("ganttTest.png", BatikImageRenderer.getByteArray(diagram.create(), 800, ImageFormat.PNG)); writeFile("ganttTest.svg", BatikImageRenderer.getByteArray(diagram.create(), 800, ImageFormat.SVG)); writeFile("ganttTest.pdf", BatikImageRenderer.getByteArray(diagram.create(), 800, ImageFormat.PDF)); }