@Test public void testGetWidth() { final Node n = mock(Node.class); final HasBounds hasBounds = mock(HasBounds.class); final Bounds bounds = mock(Bounds.class); final double width = 17; final int expected = (int) width; when(bounds.getWidth()).thenReturn(width); when(hasBounds.getBounds()).thenReturn(bounds); when(n.getContent()).thenReturn(hasBounds); int actual = layoutService.getWidth(n); assertEquals(expected, actual); }
int getWidth(final Node n) { return (int) ((HasBounds) n.getContent()).getBounds().getWidth(); }
SugiyamaLayoutService extends AbstractLayoutService { int getWidth(final Node n) { return (int) ((HasBounds) n.getContent()).getBounds().getWidth(); } }
SugiyamaLayoutService extends AbstractLayoutService { int getWidth(final Node n) { return (int) ((HasBounds) n.getContent()).getBounds().getWidth(); } @Inject  SugiyamaLayoutService(final CycleBreaker cycleBreaker,
                                 final VertexLayerer vertexLayerer,
                                 final VertexOrdering vertexOrdering,
                                 final VertexPositioning vertexPositioning,
                                 final GraphProcessor graphProcessor); }
SugiyamaLayoutService extends AbstractLayoutService { int getWidth(final Node n) { return (int) ((HasBounds) n.getContent()).getBounds().getWidth(); } @Inject  SugiyamaLayoutService(final CycleBreaker cycleBreaker,
                                 final VertexLayerer vertexLayerer,
                                 final VertexOrdering vertexOrdering,
                                 final VertexPositioning vertexPositioning,
                                 final GraphProcessor graphProcessor); @Override Layout createLayout(final Graph<?, ?> graph); }
SugiyamaLayoutService extends AbstractLayoutService { int getWidth(final Node n) { return (int) ((HasBounds) n.getContent()).getBounds().getWidth(); } @Inject  SugiyamaLayoutService(final CycleBreaker cycleBreaker,
                                 final VertexLayerer vertexLayerer,
                                 final VertexOrdering vertexOrdering,
                                 final VertexPositioning vertexPositioning,
                                 final GraphProcessor graphProcessor); @Override Layout createLayout(final Graph<?, ?> graph);  }