當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityCollection.getEntity方法代碼示例

本文整理匯總了Java中org.jfree.chart.entity.EntityCollection.getEntity方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityCollection.getEntity方法的具體用法?Java EntityCollection.getEntity怎麽用?Java EntityCollection.getEntity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.entity.EntityCollection的用法示例。


在下文中一共展示了EntityCollection.getEntity方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getToolTipText

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns a string for the tooltip.
 * 
 * @param e
 *            the mouse event.
 * 
 * @return A tool tip or <code>null</code> if no tooltip is available.
 */

@Override
public String getToolTipText(MouseEvent e) {

	String result = null;
	if (this.info != null) {
		EntityCollection entities = this.info.getEntityCollection();
		if (entities != null) {
			Insets insets = getInsets();
			ChartEntity entity = entities.getEntity((int) ((e.getX() - insets.left) / this.scaleX),
					(int) ((e.getY() - insets.top) / this.scaleY));
			if (entity != null) {
				result = entity.getToolTipText();
			}
		}
	}
	return result;

}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:28,代碼來源:AbstractChartPanel.java

示例2: getEntityForPoint

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns the chart entity at a given point.
 * <P>
 * This method will return null if there is (a) no entity at the given point, or (b) no entity
 * collection has been generated.
 * 
 * @param viewX
 *            the x-coordinate.
 * @param viewY
 *            the y-coordinate.
 * 
 * @return The chart entity (possibly <code>null</code>).
 */

@Override
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;
		EntityCollection entities = this.info.getEntityCollection();
		result = entities != null ? entities.getEntity(x, y) : null;
	}
	return result;

}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:29,代碼來源:AbstractChartPanel.java

示例3: getTooltipText

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns the tooltip text.
 * 
 * @param canvas  the canvas that is displaying the chart.
 * @param x  the x-coordinate of the mouse pointer.
 * @param y  the y-coordinate of the mouse pointer.
 * 
 * @return String The tooltip text (possibly {@code null}).
  */
private String getTooltipText(ChartCanvas canvas, double x, double y) {
    ChartRenderingInfo info = canvas.getRenderingInfo();
    if (info == null) {
        return null;
    }
    EntityCollection entities = info.getEntityCollection();
    if (entities == null) {
        return null;
    }
    ChartEntity entity = entities.getEntity(x, y);
    if (entity == null) {
        return null;
    }
    return entity.getToolTipText();
}
 
開發者ID:jfree,項目名稱:jfreechart-fx,代碼行數:25,代碼來源:TooltipHandlerFX.java

示例4: getToolTipText

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns a string for the tooltip.
 *
 * @param e  the mouse event.
 *
 * @return a tool tip or <code>null</code> if no tooltip is available.
 */
public String getToolTipText(MouseEvent e) {

    String result = null;

    if (this.info != null) {
        EntityCollection entities = this.info.getEntityCollection();
        if (entities != null) {
            Insets insets = getInsets();
            ChartEntity entity = entities.getEntity(
                (int) ((e.getX() - insets.left) / this.scaleX),
                (int) ((e.getY() - insets.top) / this.scaleY)
            );
            if (entity != null) {
                result = entity.getToolTipText();
            }
        }
    }

    return result;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:29,代碼來源:ChartPanel.java

示例5: getToolTipText

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns a string for the tooltip.
 *
 * @param e  the mouse event.
 *
 * @return A tool tip or <code>null</code> if no tooltip is available.
 */
public String getToolTipText(org.eclipse.swt.events.MouseEvent e) {
    String result = null;
    if (this.info != null) {
        EntityCollection entities = this.info.getEntityCollection();
        if (entities != null) {
            Rectangle insets = getBounds();
            ChartEntity entity = entities.getEntity(
                    (int) ((e.x - insets.x) / this.scaleX),
                    (int) ((e.y - insets.y) / this.scaleY));
            if (entity != null) {
                result = entity.getToolTipText();
            }
        }
    }
    return result;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:25,代碼來源:ChartComposite.java

示例6: getToolTipText

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns a string for the tooltip.
 *
 * @param e  the mouse event.
 *
 * @return A tool tip or <code>null</code> if no tooltip is available.
 */
public String getToolTipText(MouseEvent e) {

    String result = null;
    if (this.info != null) {
        EntityCollection entities = this.info.getEntityCollection();
        if (entities != null) {
            Insets insets = getInsets();
            ChartEntity entity = entities.getEntity(
                    (int) ((e.getX() - insets.left) / this.scaleX),
                    (int) ((e.getY() - insets.top) / this.scaleY));
            if (entity != null) {
                result = entity.getToolTipText();
            }
        }
    }
    return result;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:26,代碼來源:ChartPanel.java

示例7: getToolTipText

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns a string for the tooltip.
 *
 * @param e  the mouse event.
 *
 * @return A tool tip or <code>null</code> if no tooltip is available.
 */
public String getToolTipText(org.eclipse.swt.events.MouseEvent e) {
    String result = null;
    if (this.info != null) {
        EntityCollection entities = this.info.getEntityCollection();
        if (entities != null) {
            Rectangle insets = getClientArea();
            ChartEntity entity = entities.getEntity(
                    (int) ((e.x - insets.x) / this.scaleX),
                    (int) ((e.y - insets.y) / this.scaleY));
            if (entity != null) {
                result = entity.getToolTipText();
            }
        }
    }
    return result;

}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:25,代碼來源:ChartComposite.java

示例8: getTooltipText

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns the tooltip text.
 * 
 * @param canvas  the canvas that is displaying the chart.
 * @param x  the x-coordinate of the mouse pointer.
 * @param y  the y-coordinate of the mouse pointer.
 * 
 * @return String The tooltip text (possibly <code>null</code>).
  */
private String getTooltipText(ChartCanvas canvas, double x, double y) {
    ChartRenderingInfo info = canvas.getRenderingInfo();
    if (info == null) {
        return null;
    }
    EntityCollection entities = info.getEntityCollection();
    if (entities == null) {
        return null;
    }
    ChartEntity entity = entities.getEntity(x, y);
    if (entity == null) {
        return null;
    }
    return entity.getToolTipText();
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:25,代碼來源:TooltipHandlerFX.java

示例9: getToolTipText

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns a string for the tooltip.
 *
 * @param e  the mouse event.
 *
 * @return A tool tip or <code>null</code> if no tooltip is available.
 */
@Override
public String getToolTipText(MouseEvent e) {
    String result = null;
    if (this.info != null) {
        EntityCollection entities = this.info.getEntityCollection();
        if (entities != null) {
            Insets insets = getInsets();
            ChartEntity entity = entities.getEntity(
                    (int) ((e.getX() - insets.left) / this.scaleX),
                    (int) ((e.getY() - insets.top) / this.scaleY));
            if (entity != null) {
                result = entity.getToolTipText();
            }
        }
    }
    return result;
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:25,代碼來源:ChartPanel.java

示例10: getToolTipText

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns a string for the tooltip.
 *
 * @param e  the mouse event.
 *
 * @return A tool tip or {@code null} if no tooltip is available.
 */
@Override
public String getToolTipText(MouseEvent e) {
    String result = null;
    if (this.info != null) {
        EntityCollection entities = this.info.getEntityCollection();
        if (entities != null) {
            Insets insets = getInsets();
            ChartEntity entity = entities.getEntity(
                    (int) ((e.getX() - insets.left) / this.scaleX),
                    (int) ((e.getY() - insets.top) / this.scaleY));
            if (entity != null) {
                result = entity.getToolTipText();
            }
        }
    }
    return result;
}
 
開發者ID:jfree,項目名稱:jfreechart,代碼行數:25,代碼來源:ChartPanel.java

示例11: getEntitiesForPoint

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns a list of the entities at the given x, y view location.
 *
 * @param viewX the x location
 * @param viewY the y location
 * @return a list of the entities
 */
public ArrayList<ChartEntity> getEntitiesForPoint(int viewX, int viewY) {

    ArrayList<ChartEntity> entitiesForPoint = new ArrayList<ChartEntity>();
    ChartRenderingInfo info = chartPanel.getChartRenderingInfo();

    if (info != null) {
        Insets insets = chartPanel.getInsets();
        double x = (viewX - insets.left) / chartPanel.getScaleX();
        double y = (viewY - insets.top) / chartPanel.getScaleY();
        EntityCollection allEntities = info.getEntityCollection();
        int numEntities = allEntities.getEntityCount();

        for (int i = 0; i < numEntities; i++) {
            ChartEntity entity = allEntities.getEntity(i);
            if (entity.getArea().contains(x, y)) {
                entitiesForPoint.add(entity);
            }
        }
    }

    return entitiesForPoint;
}
 
開發者ID:compomics,項目名稱:compomics-utilities,代碼行數:30,代碼來源:VennDiagramPanel.java

示例12: mouseClicked

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Receives notification of mouse clicks on the panel. These are translated and passed on to any
 * registered {@link ChartMouseListener}s.
 * 
 * @param event
 *            Information about the mouse event.
 */

@Override
public void mouseClicked(MouseEvent event) {

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

	this.anchor = new Point2D.Double(x, y);
	if (this.chart == null) {
		return;
	}
	this.chart.setNotify(true); // force a redraw
	// new entity code...
	Object[] listeners = this.chartMouseListeners.getListeners(ChartMouseListener.class);
	if (listeners.length == 0) {
		return;
	}

	ChartEntity entity = null;
	if (this.info != null) {
		EntityCollection entities = this.info.getEntityCollection();
		if (entities != null) {
			entity = entities.getEntity(x, y);
		}
	}
	ChartMouseEvent chartEvent = new ChartMouseEvent(getChart(), event, entity);
	for (int i = listeners.length - 1; i >= 0; i -= 1) {
		((ChartMouseListener) listeners[i]).chartMouseClicked(chartEvent);
	}

}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:40,代碼來源:AbstractChartPanel.java

示例13: mouseMoved

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Implementation of the MouseMotionListener's method.
 * 
 * @param e
 *            the event.
 */

@Override
public void mouseMoved(MouseEvent e) {
	Graphics2D g2 = (Graphics2D) getGraphics();
	if (this.horizontalAxisTrace) {
		drawHorizontalAxisTrace(g2, e.getX());
	}
	if (this.verticalAxisTrace) {
		drawVerticalAxisTrace(g2, e.getY());
	}
	g2.dispose();

	Object[] listeners = this.chartMouseListeners.getListeners(ChartMouseListener.class);
	if (listeners.length == 0) {
		return;
	}
	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) {
			entity = entities.getEntity(x, y);
		}
	}

	// we can only generate events if the panel's chart is not null
	// (see bug report 1556951)
	if (this.chart != null) {
		ChartMouseEvent event = new ChartMouseEvent(getChart(), e, entity);
		for (int i = listeners.length - 1; i >= 0; i -= 1) {
			((ChartMouseListener) listeners[i]).chartMouseMoved(event);
		}
	}

}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:45,代碼來源:AbstractChartPanel.java

示例14: getEntityForPoint

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns the chart entity at a given point.
 * <P>
 * This method will return null if there is (a) no entity at the given point, or
 * (b) no entity collection has been generated.
 *
 * @param viewX  the x-coordinate.
 * @param viewY  the y-coordinate.
 *
 * @return the chart entity (possibly null).
 */
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;
        EntityCollection entities = this.info.getEntityCollection();
        result = entities != null ? entities.getEntity(x, y) : null; 
    }
    return result;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:25,代碼來源:ChartPanel.java

示例15: mouseClicked

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Receives notification of mouse clicks on the panel. These are
 * translated and passed on to any registered chart mouse click listeners.
 *
 * @param event  Information about the mouse event.
 */
public void mouseClicked(MouseEvent event) {

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

    // old 'handle click' code...
    //chart.handleClick(x, y, this.info);
    this.anchor = new Point2D.Double(x, y);
    this.chart.setTitle(this.chart.getTitle());  // force a redraw 
    // new entity code...
    if (this.chartMouseListeners.isEmpty()) {
        return;
    }

    ChartEntity entity = null;
    if (this.info != null) {
        EntityCollection entities = this.info.getEntityCollection();
        if (entities != null) {
            entity = entities.getEntity(x, y);
        }
    }
    ChartMouseEvent chartEvent = new ChartMouseEvent(getChart(), event, entity);

    Iterator iterator = this.chartMouseListeners.iterator();
    while (iterator.hasNext()) {
        ChartMouseListener listener = (ChartMouseListener) iterator.next();
        listener.chartMouseClicked(chartEvent);
    }

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:38,代碼來源:ChartPanel.java


注:本文中的org.jfree.chart.entity.EntityCollection.getEntity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。