@Test public void keepsLargestBoundsIfMouseLessThanLargest() { Point2D mouse = new Point2D.Double(10, 20); temporaryArcView.setEnd(mouse); Point2D centre = place.getCentre(); Rectangle expected = new Rectangle(0, 0, (int) centre.getX(), (int) centre.getY()); Rectangle actual = temporaryArcView.getBounds(); assertEquals(expected, actual); }
public void setEnd(Point2D end) { this.end = end; updateMax(end); updateBounds(); }
TemporaryArcView extends JComponent { public void setEnd(Point2D end) { this.end = end; updateMax(end); updateBounds(); } }
TemporaryArcView extends JComponent { public void setEnd(Point2D end) { this.end = end; updateMax(end); updateBounds(); } TemporaryArcView(T source, ArcHead arcHead); }
TemporaryArcView extends JComponent { public void setEnd(Point2D end) { this.end = end; updateMax(end); updateBounds(); } TemporaryArcView(T source, ArcHead arcHead); void setEnd(Point2D end); void addIntermediatePoint(ArcPoint point); T getSourceConnectable(); @Override void paintComponent(Graphics g); @Override boolean contains(int x, int y); Point2D getLastPoint(); List<ArcPoint> getIntermediatePoints(); }
TemporaryArcView extends JComponent { public void setEnd(Point2D end) { this.end = end; updateMax(end); updateBounds(); } TemporaryArcView(T source, ArcHead arcHead); void setEnd(Point2D end); void addIntermediatePoint(ArcPoint point); T getSourceConnectable(); @Override void paintComponent(Graphics g); @Override boolean contains(int x, int y); Point2D getLastPoint(); List<ArcPoint> getIntermediatePoints();  }