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


Java XYAnnotationEntity类代码示例

本文整理汇总了Java中org.jfree.chart.entity.XYAnnotationEntity的典型用法代码示例。如果您正苦于以下问题:Java XYAnnotationEntity类的具体用法?Java XYAnnotationEntity怎么用?Java XYAnnotationEntity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: mouseClickedInChart

import org.jfree.chart.entity.XYAnnotationEntity; //导入依赖的package包/类
/**
 * Handles mouse clicks in the chart panel.
 *
 * @param event the chart mouse event
 */
private void mouseClickedInChart(ChartMouseEvent event) {

    ArrayList<ChartEntity> entities = getEntitiesForPoint(event.getTrigger().getPoint().x, event.getTrigger().getPoint().y);

    if (entities.isEmpty()) {
        return;
    }

    boolean dataPointFound = false;
    String dataPointTooltip = "";

    for (ChartEntity tempEntity : entities) {
        if (tempEntity instanceof XYAnnotationEntity) {
            if (((XYAnnotationEntity) tempEntity).getToolTipText() != null) {
                dataPointFound = true;
                dataPointTooltip = ((XYAnnotationEntity) tempEntity).getToolTipText();
            }
        }
    }

    if (dataPointFound) {
        String dataset = tooltipToDatasetMap.get(dataPointTooltip);
        JOptionPane.showMessageDialog(this, dataPointTooltip + ":\n" + vennDiagramResults.get(dataset), "Selected Values", JOptionPane.INFORMATION_MESSAGE);
    }
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:31,代码来源:VennDiagramPanel.java

示例2: mouseMovedInChart

import org.jfree.chart.entity.XYAnnotationEntity; //导入依赖的package包/类
/**
 * Handles mouse movements in the chart panel.
 *
 * @param event the chart mouse event
 */
private void mouseMovedInChart(ChartMouseEvent event) {

    ArrayList<ChartEntity> entities = getEntitiesForPoint(event.getTrigger().getPoint().x, event.getTrigger().getPoint().y);

    boolean dataPointFound = false;

    for (ChartEntity tempEntity : entities) {
        if (tempEntity instanceof XYAnnotationEntity) {
            if (((XYAnnotationEntity) tempEntity).getToolTipText() != null) {
                dataPointFound = true;
            }
        }
    }

    if (dataPointFound) {
        chartPanel.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
    } else {
        chartPanel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    }
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:26,代码来源:VennDiagramPanel.java

示例3: addEntity

import org.jfree.chart.entity.XYAnnotationEntity; //导入依赖的package包/类
/**
 * A utility method for adding an {@link XYAnnotationEntity} to 
 * a {@link PlotRenderingInfo} instance.
 * 
 * @param info  the plot rendering info (<code>null</code> permitted).
 * @param hotspot  the hotspot area.
 * @param rendererIndex  the renderer index.
 * @param toolTipText  the tool tip text.
 * @param urlText  the URL text.
 */
protected void addEntity(PlotRenderingInfo info, 
                         Shape hotspot, int rendererIndex, 
                         String toolTipText, String urlText) {
    if (info == null) {
        return;  
    }
    EntityCollection entities = info.getOwner().getEntityCollection();
    if (entities == null) {
        return;
    }
    XYAnnotationEntity entity = new XYAnnotationEntity(hotspot, 
            rendererIndex, toolTipText, urlText);
    entities.add(entity);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:AbstractXYAnnotation.java

示例4: addEntity

import org.jfree.chart.entity.XYAnnotationEntity; //导入依赖的package包/类
/**
 * A utility method for adding an {@link XYAnnotationEntity} to
 * a {@link PlotRenderingInfo} instance.
 *
 * @param info  the plot rendering info (<code>null</code> permitted).
 * @param hotspot  the hotspot area.
 * @param rendererIndex  the renderer index.
 * @param toolTipText  the tool tip text.
 * @param urlText  the URL text.
 */
protected void addEntity(PlotRenderingInfo info,
                         Shape hotspot, int rendererIndex,
                         String toolTipText, String urlText) {
    if (info == null) {
        return;
    }
    EntityCollection entities = info.getOwner().getEntityCollection();
    if (entities == null) {
        return;
    }
    XYAnnotationEntity entity = new XYAnnotationEntity(hotspot,
            rendererIndex, toolTipText, urlText);
    entities.add(entity);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:25,代码来源:AbstractXYAnnotation.java

示例5: addEntity

import org.jfree.chart.entity.XYAnnotationEntity; //导入依赖的package包/类
/**
 * A utility method for adding an {@link XYAnnotationEntity} to
 * a {@link PlotRenderingInfo} instance.
 *
 * @param info  the plot rendering info ({@code null} permitted).
 * @param hotspot  the hotspot area.
 * @param rendererIndex  the renderer index.
 * @param toolTipText  the tool tip text.
 * @param urlText  the URL text.
 */
protected void addEntity(PlotRenderingInfo info,
                         Shape hotspot, int rendererIndex,
                         String toolTipText, String urlText) {
    if (info == null) {
        return;
    }
    EntityCollection entities = info.getOwner().getEntityCollection();
    if (entities == null) {
        return;
    }
    XYAnnotationEntity entity = new XYAnnotationEntity(hotspot,
            rendererIndex, toolTipText, urlText);
    entities.add(entity);
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:25,代码来源:AbstractXYAnnotation.java

示例6: getGestureEntity

import org.jfree.chart.entity.XYAnnotationEntity; //导入依赖的package包/类
/**
 * The gesture entity type
 * 
 * @param entity
 * @return
 */
public static Entity getGestureEntity(ChartEntity entity) {
  if (entity == null)
    return NONE;
  if (entity instanceof PlotEntity)
    return PLOT;
  if (entity instanceof AxisEntity) {
    AxisEntity e = (AxisEntity) entity;
    if (e.getAxis().getPlot() instanceof XYPlot) {
      XYPlot plot = ((XYPlot) e.getAxis().getPlot());
      for (int i = 0; i < plot.getDomainAxisCount(); i++)
        if (plot.getDomainAxis(i).equals(e.getAxis()))
          return DOMAIN_AXIS;
      for (int i = 0; i < plot.getRangeAxisCount(); i++)
        if (plot.getRangeAxis(i).equals(e.getAxis()))
          return RANGE_AXIS;
    }
    // else return basic axis
    return AXIS;
  }
  if (entity instanceof LegendItemEntity)
    return LEGEND_ITEM;
  if (entity instanceof XYItemEntity)
    return XY_ITEM;
  if (entity instanceof XYAnnotationEntity)
    return XY_ANNOTATION;
  if (entity instanceof TitleEntity) {
    if (((TitleEntity) entity).getTitle() instanceof TextTitle)
      return TEXT_TITLE;
    else
      return NON_TEXT_TITLE;
  }
  if (entity instanceof JFreeChartEntity)
    return JFREECHART;
  if (entity instanceof CategoryItemEntity)
    return CATEGORY_ITEM;
  return GENERAL;
}
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:44,代码来源:ChartGesture.java


注:本文中的org.jfree.chart.entity.XYAnnotationEntity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。