Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Action Renderer for tooltip is not working
Action Renderer for tooltip is not working [message #1141251] Wed, 16 October 2013 23:18
Joe Smith is currently offline Joe SmithFriend
Messages: 6
Registered: October 2013
Junior Member
I am trying to implement a custom tooltip.

I hooked up a custom ActionRenderer.

The issue is that MyActionRenderer.processAction(...) never gets called.

public void paint( Graphics g )
   {
      super.paint( g );
      Graphics2D g2d = (Graphics2D) g;
      idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, g2d );
      idr.setProperty( IDeviceRenderer.UPDATE_NOTIFIER, this );
      Dimension d = getSize( );
      Bounds bo = BoundsImpl.create( 0, 0, d.width, d.height );
      bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution());
      Generator gr = Generator.instance( );

      if ( bNeedsGeneration ) {
         bNeedsGeneration = false;
         try {
            
            gcs = gr.build( idr.getDisplayServer( ),
                  cm,
                  bo,
                  null,
                  null,
                  null );
         } catch ( ChartException ex ) {
            //System.out.println( ex );
         }
      }
      try {
         gcs.getRunTimeContext().setActionRenderer(new MyActionRenderer());
         gr.render( idr, gcs );
      }
      catch ( ChartException ex ) { 
          System.out.println( ex ); 
      }
   }



public class MyActionRenderer extends ActionRendererAdapter {

    public void processAction(Action action, StructureSource source) {
        System.out.println("Hello My Action");
        if (ActionType.SHOW_TOOLTIP_LITERAL.equals(action.getType())) {
            TooltipValue tv = (TooltipValue) action.getValue();

            if (StructureType.SERIES_DATA_POINT.equals(source.getType())) {
                final DataPointHints dph = (DataPointHints) source.getSource();

                tv.setText(ChartUtil.stringValue(dph.getBaseValue() + "--" + dph.getSeriesDisplayValue() + "--" + dph.getOrthogonalDisplayValue()));
            }
        }
    }
}



Any help would be greatly appreciated.

Thanks!
Previous Topic:Broken table borders
Next Topic:reportContext.getHttpServletRequest() not working on BIRT 2.2.1.1
Goto Forum:
  


Current Time: Tue Mar 19 04:20:57 GMT 2024

Powered by FUDForum. Page generated in 0.02328 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top