if (startPoint != null) {
if (!(e.getSource() instanceof JGraph))
throw new IllegalArgumentException(
"MarqueeHandler cannot handle event from unknown source: "
+ e);
JGraph graph = (JGraph) e.getSource();
Graphics g = graph.getGraphics();
// Xor the current display
Color bg = graph.getBackground();
Color fg = graph.getMarqueeColor();
if (graph.isXorEnabled()) {
g.setColor(fg);
g.setXORMode(bg);
overlay(graph, g, true);
}
Rectangle2D dirty = (Rectangle2D) marqueeBounds.clone();
processMouseDraggedEvent(e);
// Repaint
if (graph.isXorEnabled()) {
g.setColor(bg);
g.setXORMode(fg);
overlay(graph, g, false);
} else {
dirty.add(marqueeBounds);
graph.repaint((int) dirty.getX()-1, (int) dirty.getY()-1,
(int) dirty.getWidth()+2, (int) dirty.getHeight()+2);
}
}
}