- Timestamp:
- 2016-06-15T19:14:42+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/TestUtils.java
r10222 r10390 4 4 import static org.junit.Assert.fail; 5 5 6 import java.awt.Canvas;7 import java.awt.Color;8 6 import java.awt.Component; 9 import java.awt.Composite;10 import java.awt.Font;11 import java.awt.FontMetrics;12 import java.awt.Graphics;13 7 import java.awt.Graphics2D; 14 import java.awt.GraphicsConfiguration;15 import java.awt.Image;16 import java.awt.Paint;17 import java.awt.Rectangle;18 import java.awt.RenderingHints;19 import java.awt.RenderingHints.Key;20 import java.awt.Shape;21 import java.awt.Stroke;22 import java.awt.font.FontRenderContext;23 import java.awt.font.GlyphVector;24 import java.awt.geom.AffineTransform;25 import java.awt.image.BufferedImage;26 import java.awt.image.BufferedImageOp;27 import java.awt.image.ImageObserver;28 import java.awt.image.RenderedImage;29 import java.awt.image.renderable.RenderableImage;30 8 import java.io.File; 31 9 import java.io.IOException; 32 10 import java.io.InputStream; 33 import java.text.AttributedCharacterIterator;34 11 import java.util.Arrays; 35 12 import java.util.Comparator; 36 import java.util.Map;37 13 38 14 import org.openstreetmap.josm.data.osm.Node; … … 46 22 import org.openstreetmap.josm.gui.progress.ProgressTaskId; 47 23 import org.openstreetmap.josm.io.Compression; 24 import org.openstreetmap.josm.testutils.FakeGraphics; 48 25 49 26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 232 209 } 233 210 234 // CHECKSTYLE.OFF: AnonInnerLength235 // CHECKSTYLE.OFF: MethodLength236 // CHECKSTYLE.OFF: ParameterNumber237 238 211 /** 239 212 * Returns an instance of {@link Graphics2D}. … … 241 214 */ 242 215 public static Graphics2D newGraphics() { 243 return new Graphics2D() { 244 245 @Override 246 public void setXORMode(Color c1) { 247 } 248 249 @Override 250 public void setPaintMode() { 251 } 252 253 @Override 254 public void setFont(Font font) { 255 } 256 257 @Override 258 public void setColor(Color c) { 259 } 260 261 @Override 262 public void setClip(int x, int y, int width, int height) { 263 } 264 265 @Override 266 public void setClip(Shape clip) { 267 } 268 269 @Override 270 public FontMetrics getFontMetrics(Font f) { 271 return new Canvas().getFontMetrics(getFont()); 272 } 273 274 @Override 275 public Font getFont() { 276 return new Font(null, 0, 0); 277 } 278 279 @Override 280 public Color getColor() { 281 return null; 282 } 283 284 @Override 285 public Rectangle getClipBounds() { 286 return null; 287 } 288 289 @Override 290 public Shape getClip() { 291 return null; 292 } 293 294 @Override 295 public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { 296 } 297 298 @Override 299 public void fillRect(int x, int y, int width, int height) { 300 } 301 302 @Override 303 public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) { 304 } 305 306 @Override 307 public void fillOval(int x, int y, int width, int height) { 308 } 309 310 @Override 311 public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) { 312 } 313 314 @Override 315 public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { 316 } 317 318 @Override 319 public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) { 320 } 321 322 @Override 323 public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) { 324 } 325 326 @Override 327 public void drawOval(int x, int y, int width, int height) { 328 } 329 330 @Override 331 public void drawLine(int x1, int y1, int x2, int y2) { 332 } 333 334 @Override 335 public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, 336 Color bgcolor, ImageObserver observer) { 337 return false; 338 } 339 340 @Override 341 public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, 342 ImageObserver observer) { 343 return false; 344 } 345 346 @Override 347 public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) { 348 return false; 349 } 350 351 @Override 352 public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) { 353 return false; 354 } 355 356 @Override 357 public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) { 358 return false; 359 } 360 361 @Override 362 public boolean drawImage(Image img, int x, int y, ImageObserver observer) { 363 return false; 364 } 365 366 @Override 367 public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) { 368 } 369 370 @Override 371 public void dispose() { 372 } 373 374 @Override 375 public Graphics create() { 376 return this; 377 } 378 379 @Override 380 public void copyArea(int x, int y, int width, int height, int dx, int dy) { 381 } 382 383 @Override 384 public void clipRect(int x, int y, int width, int height) { 385 } 386 387 @Override 388 public void clearRect(int x, int y, int width, int height) { 389 } 390 391 @Override 392 public void translate(double tx, double ty) { 393 } 394 395 @Override 396 public void translate(int x, int y) { 397 } 398 399 @Override 400 public void transform(AffineTransform Tx) { 401 } 402 403 @Override 404 public void shear(double shx, double shy) { 405 } 406 407 @Override 408 public void setTransform(AffineTransform Tx) { 409 } 410 411 @Override 412 public void setStroke(Stroke s) { 413 } 414 415 @Override 416 public void setRenderingHints(Map<?, ?> hints) { 417 } 418 419 @Override 420 public void setRenderingHint(Key hintKey, Object hintValue) { 421 } 422 423 @Override 424 public void setPaint(Paint paint) { 425 } 426 427 @Override 428 public void setComposite(Composite comp) { 429 } 430 431 @Override 432 public void setBackground(Color color) { 433 } 434 435 @Override 436 public void scale(double sx, double sy) { 437 } 438 439 @Override 440 public void rotate(double theta, double x, double y) { 441 } 442 443 @Override 444 public void rotate(double theta) { 445 } 446 447 @Override 448 public boolean hit(Rectangle rect, Shape s, boolean onStroke) { 449 return false; 450 } 451 452 @Override 453 public AffineTransform getTransform() { 454 return null; 455 } 456 457 @Override 458 public Stroke getStroke() { 459 return null; 460 } 461 462 @Override 463 public RenderingHints getRenderingHints() { 464 return null; 465 } 466 467 @Override 468 public Object getRenderingHint(Key hintKey) { 469 return null; 470 } 471 472 @Override 473 public Paint getPaint() { 474 return null; 475 } 476 477 @Override 478 public FontRenderContext getFontRenderContext() { 479 return new FontRenderContext(null, false, false); 480 } 481 482 @Override 483 public GraphicsConfiguration getDeviceConfiguration() { 484 return null; 485 } 486 487 @Override 488 public Composite getComposite() { 489 return null; 490 } 491 492 @Override 493 public Color getBackground() { 494 return null; 495 } 496 497 @Override 498 public void fill(Shape s) { 499 } 500 501 @Override 502 public void drawString(AttributedCharacterIterator iterator, float x, float y) { 503 } 504 505 @Override 506 public void drawString(AttributedCharacterIterator iterator, int x, int y) { 507 } 508 509 @Override 510 public void drawString(String str, float x, float y) { 511 } 512 513 @Override 514 public void drawString(String str, int x, int y) { 515 } 516 517 @Override 518 public void drawRenderedImage(RenderedImage img, AffineTransform xform) { 519 } 520 521 @Override 522 public void drawRenderableImage(RenderableImage img, AffineTransform xform) { 523 } 524 525 @Override 526 public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) { 527 } 528 529 @Override 530 public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) { 531 return false; 532 } 533 534 @Override 535 public void drawGlyphVector(GlyphVector g, float x, float y) { 536 } 537 538 @Override 539 public void draw(Shape s) { 540 } 541 542 @Override 543 public void clip(Shape s) { 544 } 545 546 @Override 547 public void addRenderingHints(Map<?, ?> hints) { 548 } 549 }; 550 } 551 552 // CHECKSTYLE.ON: ParameterNumber 553 // CHECKSTYLE.ON: MethodLength 554 // CHECKSTYLE.ON: AnonInnerLength 216 return new FakeGraphics(); 217 } 555 218 556 219 /**
Note:
See TracChangeset
for help on using the changeset viewer.