本文整理汇总了Java中net.sf.jasperreports.engine.JRPrintHyperlink类的典型用法代码示例。如果您正苦于以下问题:Java JRPrintHyperlink类的具体用法?Java JRPrintHyperlink怎么用?Java JRPrintHyperlink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JRPrintHyperlink类属于net.sf.jasperreports.engine包,在下文中一共展示了JRPrintHyperlink类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEntityHyperlink
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
@Override
public JRPrintHyperlink getEntityHyperlink(ChartEntity entity)
{
JRPrintHyperlink printHyperlink = null;
if (hasHyperlinks() && entity instanceof XYItemEntity)
{
XYItemEntity itemEntity = (XYItemEntity) entity;
XYDataset dataset = itemEntity.getDataset();
Comparable<?> serie = dataset.getSeriesKey(itemEntity.getSeriesIndex());
Map<Pair, JRPrintHyperlink> serieHyperlinks = itemHyperlinks.get(serie);
if (serieHyperlinks != null)
{
Number x = dataset.getX(itemEntity.getSeriesIndex(), itemEntity.getItem());
Number y = dataset.getY(itemEntity.getSeriesIndex(), itemEntity.getItem());
Pair<Number,Number> xyKey = new Pair<Number,Number>(x, y);
printHyperlink = serieHyperlinks.get(xyKey);
}
}
return printHyperlink;
}
示例2: getEntityHyperlink
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
@Override
public JRPrintHyperlink getEntityHyperlink(ChartEntity entity)
{
JRPrintHyperlink printHyperlink = null;
if (hasHyperlinks() && entity instanceof XYItemEntity)
{
XYItemEntity itemEntity = (XYItemEntity) entity;
TimeSeriesCollection dataset = (TimeSeriesCollection) itemEntity.getDataset();
TimeSeries series = dataset.getSeries(itemEntity.getSeriesIndex());
Map<RegularTimePeriod, JRPrintHyperlink> serieHyperlinks = itemHyperlinks.get(series.getKey());
if (serieHyperlinks != null)
{
RegularTimePeriod timePeriod = series.getTimePeriod(itemEntity.getItem());
printHyperlink = serieHyperlinks.get(timePeriod);
}
}
return printHyperlink;
}
示例3: getEntityHyperlink
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
@Override
public JRPrintHyperlink getEntityHyperlink(ChartEntity entity)
{
JRPrintHyperlink printHyperlink = null;
if (hasHyperlinks() && entity instanceof XYItemEntity)
{
XYItemEntity itemEntity = (XYItemEntity) entity;
TimePeriodValuesCollection dataset = (TimePeriodValuesCollection) itemEntity.getDataset();
TimePeriodValues series = dataset.getSeries(itemEntity.getSeriesIndex());
Map<TimePeriod, JRPrintHyperlink> serieHyperlinks = itemHyperlinks.get(series.getKey());
if (serieHyperlinks != null)
{
TimePeriod timePeriod = series.getTimePeriod(itemEntity.getItem());
printHyperlink = serieHyperlinks.get(timePeriod);
}
}
return printHyperlink;
}
示例4: getEntityHyperlink
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
@Override
public JRPrintHyperlink getEntityHyperlink(ChartEntity entity)
{
JRPrintHyperlink printHyperlink = null;
if (hasHyperlinks() && entity instanceof CategoryItemEntity)
{
CategoryItemEntity itemEntity = (CategoryItemEntity) entity;
Comparable<?> serie = itemEntity.getRowKey();
Map<Comparable<?>,JRPrintHyperlink> serieHyperlinks = itemHyperlinks.get(serie);
if (serieHyperlinks != null)
{
Comparable<?> category = itemEntity.getColumnKey();
printHyperlink = serieHyperlinks.get(category);
}
}
return printHyperlink;
}
示例5: startHyperlink
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
/**
*
*/
protected boolean startHyperlink(JRPrintHyperlink link, boolean isText, boolean isOnePagePerSheet)
{
String href = null;
String ignLnkPropName = getIgnoreHyperlinkProperty();
Boolean ignoreHyperlink = HyperlinkUtil.getIgnoreHyperlink(ignLnkPropName, link);
if (ignoreHyperlink == null)
{
ignoreHyperlink = JRPropertiesUtil.getInstance(getJasperReportsContext()).getBooleanProperty(jasperPrint, ignLnkPropName, false);
}
if (!ignoreHyperlink)
{
href = documentBuilder.getHyperlinkURL(link, isOnePagePerSheet);
}
if (href != null)
{
writeHyperlink(link, href, isText);
}
return href != null;
}
示例6: getHyperlinkTarget
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
/**
*
*/
protected String getHyperlinkTarget(JRPrintHyperlink link)
{
String target = null;
switch(link.getHyperlinkTargetValue())
{
case SELF :
{
target = "_self";
break;
}
case BLANK :
default :
{
target = "_blank";
break;
}
}
return target;
}
示例7: getHyperlinkTarget
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
protected String getHyperlinkTarget(JRPrintHyperlink link)
{
String target = null;
switch(link.getHyperlinkTargetValue())
{
case SELF :
{
target = "_self";
break;
}
case BLANK :
default :
{
target = "_blank";
break;
}
}
return target;
}
示例8: evaluateHyperlink
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
/**
* Evaluate a hyperlink specification.
*
* @param hyperlink the hyperlink specification
* @param expressionEvaluator the expression evaluator to use for evaluation the hyperlink expressions
* @param evaluationType the evaluation type, as in {@link JRFillExpressionEvaluator#evaluate(JRExpression, byte) JRFillExpressionEvaluator.evaluate(JRExpression, byte)}
* @return a {@link JRPrintHyperlink print hyperlink} resulted from the expression evaluations.
* @throws JRException
*/
public static JRPrintHyperlink evaluateHyperlink(JRHyperlink hyperlink,
JRFillExpressionEvaluator expressionEvaluator,
byte evaluationType) throws JRException
{
if (hyperlink == null)
{
return null;
}
Boolean hyperlinkWhen = (Boolean) expressionEvaluator.evaluate(hyperlink.getHyperlinkWhenExpression(), evaluationType);
if (hyperlink.getHyperlinkWhenExpression() != null && Boolean.TRUE.equals(hyperlinkWhen))
{
return null;
}
JRBasePrintHyperlink printHyperlink = new JRBasePrintHyperlink();
printHyperlink.setLinkType(hyperlink.getLinkType());
printHyperlink.setLinkTarget(hyperlink.getLinkTarget());
printHyperlink.setHyperlinkReference((String) expressionEvaluator.evaluate(hyperlink.getHyperlinkReferenceExpression(), evaluationType));
printHyperlink.setHyperlinkAnchor((String) expressionEvaluator.evaluate(hyperlink.getHyperlinkAnchorExpression(), evaluationType));
printHyperlink.setHyperlinkPage((Integer) expressionEvaluator.evaluate(hyperlink.getHyperlinkPageExpression(), evaluationType));
printHyperlink.setHyperlinkTooltip((String) expressionEvaluator.evaluate(hyperlink.getHyperlinkTooltipExpression(), evaluationType));
printHyperlink.setHyperlinkParameters(evaluateHyperlinkParameters(hyperlink, expressionEvaluator, evaluationType));
return printHyperlink;
}
示例9: hyperlinkClicked
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
protected void hyperlinkClicked(JRPrintHyperlink hyperlink)
{
try
{
JRHyperlinkListener listener = null;
for(int i = 0; i < hyperlinkListeners.size(); i++)
{
listener = hyperlinkListeners.get(i);
listener.gotoHyperlink(hyperlink);
}
}
catch(JRException e)
{
if (log.isErrorEnabled())
{
log.error("Hyperlink click error.", e);
}
JOptionPane.showMessageDialog(this, viewerContext.getBundleString("error.hyperlink"));
}
}
示例10: getHyperlinkAt
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
private JRPrintHyperlink getHyperlinkAt(int x, int y) {
Rectangle b = reportImage.getBounds();
Rectangle ca = getClientArea();
int oX = b.width <= ca.width ? (ca.width - b.width) / 2 : -getHorizontalBar().getSelection() + MARGIN;
int oY = b.height <= ca.height ? (ca.height - b.height) / 2 : -getVerticalBar().getSelection() + MARGIN;
Point point = new Point((int) ((x - oX - ca.x) / zoom), (int) ((y - oY - ca.y) / zoom));
for (ListIterator<IHyperlinkContainer> it = links.listIterator(links.size()); it.hasPrevious();) {
JRPrintHyperlink hyperlink = it.previous().getHyperlink(point);
if (hyperlink != null)
return hyperlink;
}
return null;
}
示例11: initHypelinks
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
private void initHypelinks() {
links.clear();
if (page == null)
return;
List<JRPrintElement> elements = page.getElements();
if (elements == null)
return;
for (JRPrintElement element : elements) {
if (element instanceof JRPrintImage) {
Renderable r = ((JRPrintImage) element).getRenderable();
if (r instanceof ImageMapRenderable) {
try {
List<JRPrintImageAreaHyperlink> hyperlinks = ((ImageMapRenderable) r).getImageAreaHyperlinks(new java.awt.Rectangle(0, 0, element.getWidth(), element.getHeight()));
if (hyperlinks != null)
links.add(new ImageAreaHyperlink(element.getX(), element.getY(), hyperlinks));
} catch (JRException e) {
throw new RuntimeException(e);
}
}
} else if (element instanceof JRPrintHyperlink && !((JRPrintHyperlink) element).getHyperlinkTypeValue().equals(HyperlinkTypeEnum.NONE))
links.add(new PrintHyperlink(0, 0, element));
}
}
示例12: getLinkToolTip
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
private String getLinkToolTip(JRPrintHyperlink link) {
String tTip = link.getHyperlinkTooltip();
if (tTip == null) {
HyperlinkTypeEnum hType = link.getHyperlinkTypeValue();
if (hType.equals(HyperlinkTypeEnum.REFERENCE))
tTip = link.getHyperlinkReference();
else if (hType.equals(HyperlinkTypeEnum.LOCAL_ANCHOR)) {
if (link.getHyperlinkAnchor() != null)
tTip = "#" + link.getHyperlinkAnchor(); //$NON-NLS-1$
} else if (hType.equals(HyperlinkTypeEnum.LOCAL_PAGE)) {
if (link.getHyperlinkPage() != null)
tTip = "#page " + link.getHyperlinkPage(); //$NON-NLS-1$
} else if (hType.equals(HyperlinkTypeEnum.REMOTE_ANCHOR)) {
if (link.getHyperlinkReference() != null)
tTip = link.getHyperlinkReference();
if (currentLink.getHyperlinkAnchor() != null)
tTip = "#" + currentLink.getHyperlinkAnchor(); //$NON-NLS-1$
} else if (hType.equals(HyperlinkTypeEnum.REMOTE_PAGE)) {
if (link.getHyperlinkReference() != null)
tTip = link.getHyperlinkReference();
if (link.getHyperlinkPage() != null)
tTip = "#page " + link.getHyperlinkPage(); //$NON-NLS-1$
}
}
return tTip;
}
示例13: hyperlinkClicked
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
protected void hyperlinkClicked(JRPrintHyperlink hyperlink)
{
try
{
JRHyperlinkListener listener = null;
for(int i = 0; i < hyperlinkListeners.size(); i++)
{
listener = hyperlinkListeners.get(i);
listener.gotoHyperlink(hyperlink);
}
}
catch(JRException e)
{
if (log.isErrorEnabled())
{
log.error("Hyperlink click error.", e);
}
JOptionPane.showMessageDialog(this, getBundleString("error.hyperlink"));
}
}
示例14: hyperlinkClicked
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
/**
*/
void hyperlinkClicked(MouseEvent evt)
{
JPanel link = (JPanel)evt.getSource();
JRPrintHyperlink element = (JRPrintHyperlink)linksMap.get(link);
hyperlinkClicked(element);
}
示例15: getHyperlinkTooltip
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入依赖的package包/类
protected String getHyperlinkTooltip(JRPrintHyperlink hyperlink)
{
String toolTip;
toolTip = hyperlink.getHyperlinkTooltip();
if (toolTip == null)
{
toolTip = getFallbackTooltip(hyperlink);
}
return toolTip;
}