/** * Draws the transient Paintable that will become a Shape annotation when the mouse button is * released */ @SuppressWarnings("unchecked") public void mouseDragged(MouseEvent e) { VisualizationViewer<N, E> vv = (VisualizationViewer<N, E>) e.getSource(); Point2D out = e.getPoint(); if (e.getModifiers() == additionalModifiers) { rectangularShape.setFrameFromDiagonal(down, out); } else if (e.getModifiers() == modifiers) { rectangularShape.setFrameFromDiagonal(down, out); } rectangularShape.setFrameFromDiagonal(down, out); vv.repaint(); }
/** * Draws the transient Paintable that will become * a Shape annotation when the mouse button is * released * */ @SuppressWarnings("unchecked") public void mouseDragged(MouseEvent e) { VisualizationViewer<V,E> vv = (VisualizationViewer<V, E>)e.getSource(); Point2D out = e.getPoint(); if(e.getModifiers() == additionalModifiers) { rectangularShape.setFrameFromDiagonal(down,out); } else if(e.getModifiers() == modifiers) { rectangularShape.setFrameFromDiagonal(down,out); } rectangularShape.setFrameFromDiagonal(down,out); vv.repaint(); }
r.setFrameFromDiagonal(center, p); rectangles.add(r);
s.setFrameFromDiagonal(p[0], p[1]); return s; s.setFrameFromDiagonal(p[0], p[1]); return s; s.setFrameFromDiagonal(p[0], p[1]); return s;
annotationManager.remove(annotation); } else if (e.getModifiers() == modifiers) { rectangularShape.setFrameFromDiagonal(down, down); vv.addPostRenderPaintable(lensPaintable);
/** Completes the process of adding a Shape annotation and removed the transient paintable */ @SuppressWarnings("unchecked") public void mouseReleased(MouseEvent e) { VisualizationViewer<N, E> vv = (VisualizationViewer<N, E>) e.getSource(); if (e.isPopupTrigger()) { String annotationString = JOptionPane.showInputDialog(vv, "Annotation:"); if (annotationString != null && annotationString.length() > 0) { Point2D p = vv.getRenderContext().getMultiLayerTransformer().inverseTransform(down); Annotation<String> annotation = new Annotation<String>(annotationString, layer, annotationColor, fill, p); annotationManager.add(layer, annotation); } } else if (e.getModifiers() == modifiers) { if (down != null) { Point2D out = e.getPoint(); RectangularShape arect = (RectangularShape) rectangularShape.clone(); arect.setFrameFromDiagonal(down, out); Shape s = vv.getRenderContext().getMultiLayerTransformer().inverseTransform(arect); Annotation<Shape> annotation = new Annotation<>(s, layer, annotationColor, fill, out); annotationManager.add(layer, annotation); } } down = null; vv.removePostRenderPaintable(lensPaintable); vv.repaint(); }
annotationManager.remove(annotation); } else if(e.getModifiers() == modifiers) { rectangularShape.setFrameFromDiagonal(down,down); vv.addPostRenderPaintable(lensPaintable);
Point2D out = e.getPoint(); RectangularShape arect = (RectangularShape)rectangularShape.clone(); arect.setFrameFromDiagonal(down,out); Shape s = vv.getRenderContext().getMultiLayerTransformer().inverseTransform(arect); Annotation<Shape> annotation =
for (double d : depths) ellipse.setFrameFromDiagonal(center.getX() - d, center.getY() - d, center.getX() + d, center.getY() + d); Shape shape =