public JRPrintHyperlink getEntityHyperlink(ChartEntity entity) { JRPrintHyperlink printHyperlink = null; if (hasHyperlinks() && entity instanceof CategoryItemEntity) { CategoryItemEntity itemEntity = (CategoryItemEntity) entity; Comparable serie = itemEntity.getRowKey(); Map serieHyperlinks = (Map) itemHyperlinks.get(serie); if (serieHyperlinks != null) { Object category = itemEntity.getColumnKey(); printHyperlink = (JRPrintHyperlink) serieHyperlinks.get(category); } } return printHyperlink; }
public void mouseReleased(MouseEvent e) { if(e.isPopupTrigger()) { ChartEntity ce = chartPanel.getEntityForPoint(e.getX(), e.getY()); List messages = null; if(ce instanceof CategoryItemEntity) { CategoryItemEntity entity = (CategoryItemEntity)ce; GroupedCategoryDataset dataset = (GroupedCategoryDataset)entity.getDataset(); messages = dataset.getList(entity.getRowKey(), entity.getColumnKey()); } if(ce instanceof PieSectionEntity) { PieSectionEntity entity = (PieSectionEntity)ce; messages = dataset_total.getList(entity.getSectionKey(), entity.getPieIndex()); } if(messages != null) { MessageFilterMenu mpopup = new MessageFilterMenu(tooltab.getPlugin(), (Message[])messages.toArray(new Message[messages.size()])); mpopup.show(e.getComponent(), e.getX(), e.getY()); } } } }
/** * decode CategoryItemEntity into key-value pair of Area's componentScope. * @param area the Area where the final attribute is set * @param info the CategoryItemEntity to be decoded. */ private void decodeCategoryInfo(Area area, CategoryItemEntity info) { if (info == null) { return; } CategoryDataset dataset = info.getDataset(); Comparable category = info.getColumnKey(); Comparable series = info.getRowKey(); area.setAttribute("series", series); area.setAttribute("category", category); if (dataset instanceof GanttCategoryDataset) { final GanttCategoryDataset gd = (GanttCategoryDataset) dataset; area.setAttribute("start", gd.getStartValue(series, category)); area.setAttribute("end", gd.getEndValue(series, category)); area.setAttribute("percent", gd.getPercentComplete(series, category)); } else { area.setAttribute("value", dataset.getValue(series, category)); } }