Exemplo n.º 1
0
 public void chartMouseMoved(ChartMouseEvent chartmouseevent) {
   int i = chartmouseevent.getTrigger().getX();
   int j = chartmouseevent.getTrigger().getY();
   ChartEntity chartentity = chartmouseevent.getEntity();
   if (chartentity != null)
     System.out.println("Mouse moved: " + i + ", " + j + ": " + chartentity.toString());
   else System.out.println("Mouse moved: " + i + ", " + j + ": null entity.");
 }
Exemplo n.º 2
0
 /**
  * Receives chart mouse moved events.
  *
  * @param event the event.
  */
 public void chartMouseMoved(ChartMouseEvent event) {
   int x = event.getTrigger().getX();
   int y = event.getTrigger().getY();
   ChartEntity entity = event.getEntity();
   if (entity != null) {
     System.out.println("Mouse moved: " + x + ", " + y + ": " + entity.toString());
   } else {
     System.out.println("Mouse moved: " + x + ", " + y + ": null entity.");
   }
 }
    @Override
    public void chartMouseClicked(ChartMouseEvent event) {
      ChartEntity entity = event.getEntity();
      if (entity instanceof CategoryItemEntity) {
        CategoryItemEntity en = (CategoryItemEntity) entity;
        //                System.out.println(en);
        // todo
        JPopupMenu menu = new JPopupMenu();
        menu.add(new JLabel("Value: " + en.getRowKey().toString()));

        menu.show(ZoomableChartPanel.this, event.getTrigger().getX(), event.getTrigger().getY());
      }
    }
Exemplo n.º 4
0
 /**
  * Receives chart mouse click events.
  *
  * @param event the event.
  */
 public void chartMouseClicked(ChartMouseEvent event) {
   ChartEntity entity = event.getEntity();
   if (entity != null) {
     System.out.println("Mouse clicked: " + entity.toString());
   } else {
     System.out.println("Mouse clicked: null entity.");
   }
 }
Exemplo n.º 5
0
    /* (non-Javadoc)
     * @see org.jfree.chart.ChartMouseListener#chartMouseMoved(org.jfree.chart.ChartMouseEvent)
     */
    @Override
    public void chartMouseMoved(ChartMouseEvent ev) {
      currEntity = null;
      ChartEntity ce = ev.getEntity();
      if (ce instanceof CategoryItemEntity) {
        CategoryItemEntity cie = (CategoryItemEntity) ce;
        currEntity = cie;

        Shape shape = ce.getArea();
        rect = shape.getBounds();
        repaint();
      }

      if (currEntityIndex != null && currEntity != null) {
        boundings[currEntityIndex] =
            adjustRect((Rectangle) currEntity.getArea().getBounds().clone());
        // System.out.println("mouseMoved" + boundings[currEntityIndex]);
        repaint();
      }
    }
Exemplo n.º 6
0
 public void chartMouseClicked(ChartMouseEvent chartmouseevent) {
   ChartEntity chartentity = chartmouseevent.getEntity();
   if (chartentity != null) System.out.println("Mouse clicked: " + chartentity.toString());
   else System.out.println("Mouse clicked: null entity.");
 }