@Override public void mouseClicked(MouseEvent e) { log.debug("mouse click [" + e.getX() + "," + e.getY() + "] ClickCount[" + e.getClickCount() + "]"); if (e.getClickCount() == 2) { for (Entry<String, AbstractGraphRow> row : model.entrySet()) { AbstractGraphRow agr = row.getValue(); if (agr != null) { Rectangle r = agr.getLegendColorBox(); if (r != null) { Rectangle slightlyLargerTarget = r.getBounds(); slightlyLargerTarget.height += 4; slightlyLargerTarget.width += 2; boolean hit = slightlyLargerTarget.contains(e.getPoint()); log.debug("hit [" + hit + "] rectangle [" + slightlyLargerTarget.toString() + "] point [" + e.getPoint() + "]"); if (hit) { row.getValue().setColor(colors.getNextColor()); } } } } updateGui(null); } //repaint(); } }
@Override public void mouseClicked(MouseEvent e) { log.debug("mouse click [" + e.getX() + "," + e.getY() + "] ClickCount[" + e.getClickCount() + "]"); if (e.getClickCount() == 2) { for (Entry<String, AbstractGraphRow> row : model.entrySet()) { AbstractGraphRow agr = row.getValue(); if (agr != null) { Rectangle r = agr.getLegendColorBox(); if (r != null) { Rectangle slightlyLargerTarget = r.getBounds(); slightlyLargerTarget.height += 4; slightlyLargerTarget.width += 2; boolean hit = slightlyLargerTarget.contains(e.getPoint()); log.debug("hit [" + hit + "] rectangle [" + slightlyLargerTarget.toString() + "] point [" + e.getPoint() + "]"); if (hit) { row.getValue().setColor(colors.getNextColor()); } } } } updateGui(null); } //repaint(); } }