@Test public void updatesBoundsIfMouseLargerThanPlace() { Point2D mouse = new Point2D.Double(300, 300); temporaryArcView.setEnd(mouse); Rectangle expected = new Rectangle(0, 0, (int) mouse.getX(), (int) mouse.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();  }