@Test public void testPaintValue() { BasicStroke stroke = new BasicStroke(); editor.setValue( stroke ); Graphics2D gfx = mock( Graphics2D.class ); Rectangle box = mock( Rectangle.class ); editor.paintValue( gfx, box ); verify( gfx ).setStroke( stroke ); verify( gfx ).drawLine( 0, 0, 0, 0 ); }
public void paintValue( final Graphics gfx, final Rectangle box ) { if ( gfx instanceof Graphics2D ) { final Graphics2D graphics2D = (Graphics2D) gfx; graphics2D.setStroke( value ); graphics2D.drawLine( box.x, box.height / 2 + box.y, box.x + box.width, box.height / 2 + box.y ); } }
BasicStrokeEditor implements PropertyEditor { public void paintValue( final Graphics gfx, final Rectangle box ) { if ( gfx instanceof Graphics2D ) { final Graphics2D graphics2D = (Graphics2D) gfx; graphics2D.setStroke( value ); graphics2D.drawLine( box.x, box.height / 2 + box.y, box.x + box.width, box.height / 2 + box.y ); } } }
BasicStrokeEditor implements PropertyEditor { public void paintValue( final Graphics gfx, final Rectangle box ) { if ( gfx instanceof Graphics2D ) { final Graphics2D graphics2D = (Graphics2D) gfx; graphics2D.setStroke( value ); graphics2D.drawLine( box.x, box.height / 2 + box.y, box.x + box.width, box.height / 2 + box.y ); } } BasicStrokeEditor(); }
BasicStrokeEditor implements PropertyEditor { public void paintValue( final Graphics gfx, final Rectangle box ) { if ( gfx instanceof Graphics2D ) { final Graphics2D graphics2D = (Graphics2D) gfx; graphics2D.setStroke( value ); graphics2D.drawLine( box.x, box.height / 2 + box.y, box.x + box.width, box.height / 2 + box.y ); } } BasicStrokeEditor(); void addPropertyChangeListener( final PropertyChangeListener listener ); void removePropertyChangeListener( final PropertyChangeListener listener ); void setValue( final Object value ); Object getValue(); String getAsText(); void setAsText( final String text ); boolean supportsCustomEditor(); Component getCustomEditor(); boolean isPaintable(); void paintValue( final Graphics gfx, final Rectangle box ); String getJavaInitializationString(); String[] getTags(); }
BasicStrokeEditor implements PropertyEditor { public void paintValue( final Graphics gfx, final Rectangle box ) { if ( gfx instanceof Graphics2D ) { final Graphics2D graphics2D = (Graphics2D) gfx; graphics2D.setStroke( value ); graphics2D.drawLine( box.x, box.height / 2 + box.y, box.x + box.width, box.height / 2 + box.y ); } } BasicStrokeEditor(); void addPropertyChangeListener( final PropertyChangeListener listener ); void removePropertyChangeListener( final PropertyChangeListener listener ); void setValue( final Object value ); Object getValue(); String getAsText(); void setAsText( final String text ); boolean supportsCustomEditor(); Component getCustomEditor(); boolean isPaintable(); void paintValue( final Graphics gfx, final Rectangle box ); String getJavaInitializationString(); String[] getTags();  }