Package org.jfree.chart.entity

Examples of org.jfree.chart.entity.ChartEntity


    * @return The chart entity (possibly <code>null</code>).
    */
   public ChartEntity getEntityForPoint(int viewX, int viewY)
   {

      ChartEntity result = null;
      if (this.info != null)
      {
         Insets insets = getInsets();
         double x = (viewX - insets.left) / this.scaleX;
         double y = (viewY - insets.top) / this.scaleY;
View Full Code Here


      if (listeners.length == 0)
      {
         return;
      }

      ChartEntity entity = null;
      if (this.info != null)
      {
         EntityCollection entities = this.info.getEntityCollection();
         if (entities != null)
         {
View Full Code Here

      }
      Insets insets = getInsets();
      int x = (int) ((e.getX() - insets.left) / this.scaleX);
      int y = (int) ((e.getY() - insets.top) / this.scaleY);

      ChartEntity entity = null;
      if (this.info != null)
      {
         EntityCollection entities = this.info.getEntityCollection();
         if (entities != null)
         {
View Full Code Here

            // make it appear last in the image map (which is important,
            // because browsers process the image map areas in the order that
            // they appear; having the entire chart area listed first would
            // obscure all of the other image map areas).
            EntityCollection entities = new StandardEntityCollection();
            entities.add(new ChartEntity(info.getChartArea(), tooltip, href));
            if (info.getEntityCollection() != null)
                entities.addAll(info.getEntityCollection());
           
            // Next: most of our chart entities will not have URLs. URL values
            // don't inherit in the imagemap, so if we want the entire image
            // to have a single URL, we need to assign that URL to every
            // area in the chart.
            for (Iterator i = entities.iterator(); i.hasNext();) {
                ChartEntity ce = (ChartEntity) i.next();
                // check for no-op chart entity - these won't appear in the
                // image map anyway, so they don't need to be adjusted
                if (ce.getToolTipText() == null && ce.getURLText() == null)
                    continue;
                // for other entities, add a tooltip and a URL as needed.
                if (!StringUtils.hasValue(ce.getToolTipText()))
                    ce.setToolTipText(tooltip);
                if (!StringUtils.hasValue(ce.getURLText()))
                    ce.setURLText(href);
            }
           
            // install our modified version of the entity collection into
            // the chart info object, so it will be used when generating
            // the image map later.
View Full Code Here

  // From ChartMouseListener interface.
  // If the mouse is over a data point, set its tool-tip with JD and
  // magnitude.
  public void chartMouseMoved(ChartMouseEvent event) {
    ChartEntity entity = event.getEntity();
    if (entity instanceof XYItemEntity) {
      XYItemEntity item = (XYItemEntity) entity;
      // Dataset may not be same as primary observation model, e.g.
      // could be model function dataset (continuous model).
      if (item.getDataset() == obsModel) {
View Full Code Here

  // From ChartMouseListener interface.
  // If the mouse is over a data point, set its tool-tip with phase and
  // magnitude.
  public void chartMouseMoved(ChartMouseEvent event) {
    ChartEntity entity = event.getEntity();
    if (entity instanceof XYItemEntity) {
      XYItemEntity item = (XYItemEntity) entity;
      ValidObservation ob = obsModel.getValidObservation(item
          .getSeriesIndex(), item.getItem());
      String xyMsg = String.format(xyMsgFormat, NumericPrecisionPrefs
View Full Code Here

      boolean altAttrbInserted, hasContent;
      StringBuffer sb = new StringBuffer(200);
      while (entities.hasNext()) {
        altAttrbInserted = false;
        hasContent = false;
        ChartEntity ce = (ChartEntity) entities.next();
        sb.append("\n<" + AREA_TAGNAME + " " + SHAPE_ATTRIBUTE + "=\"" + ce.getShapeType() + "\" ");
        sb.append(COORD_ATTRIBUTE + "=\"" + ce.getShapeCoords() + "\" ");
            if (ce instanceof XYItemEntity) {
          dataset = ((XYItemEntity) ce).getDataset();
        }
        if (! (ce instanceof LegendItemEntity)) {
          if (hasToolTips()) {
View Full Code Here

         * 2. Checking the entity if it is an axis or plot
         * 3. If plot, move to mousecontrol mode.
         * 4. If axis, check whether x or y axis and accordingly move to
         *    panx/zoomx or pany/zoomy modes.
         */
        ChartEntity entity = event.getEntity();
       
        if (entity instanceof AxisEntity) {
           
            chartPanel.setMouseZoomable(false, false);
            AxisEntity aEntity = (AxisEntity) entity;
View Full Code Here

     * Convenience hit-testing
     * @param e MouseEvent to be tested
     * @return true if on X-Axis, false otherwise
     */
    protected boolean mouseIsOnXAxis(MouseEvent e) {
        ChartEntity entity = this.chartPanel.getEntityForPoint(
                e.getPoint().x, e.getPoint().y);
        return ((entity instanceof AxisEntity) &&
                (((AxisEntity) entity).getAxis().equals(
                getDomainAxis())));
    }
View Full Code Here

     * Convenience hit-testing
     * @param e MouseEvent to be tested
     * @return true if on Y-Axis, false otherwise
     */
    protected boolean mouseIsOnYAxis(MouseEvent e) {
        ChartEntity entity = this.chartPanel.getEntityForPoint(
                e.getPoint().x, e.getPoint().y);
        return ((entity instanceof AxisEntity) &&
                (((AxisEntity) entity).getAxis().equals(
                getRangeAxis())));
    }
View Full Code Here

TOP

Related Classes of org.jfree.chart.entity.ChartEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.