jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
557 * height before redrawing from scratch. Reasonable maxV values may improve painting performance. |
557 * height before redrawing from scratch. Reasonable maxV values may improve painting performance. |
558 * If set too high, then you may get poor looking graphics at higher zoom levels. Must be >= 1. |
558 * If set too high, then you may get poor looking graphics at higher zoom levels. Must be >= 1. |
559 */ |
559 */ |
560 public PaintContext(Insets insets, Dimension canvasSize, boolean inverted, |
560 public PaintContext(Insets insets, Dimension canvasSize, boolean inverted, |
561 CacheMode cacheMode, double maxH, double maxV) { |
561 CacheMode cacheMode, double maxH, double maxV) { |
562 if (maxH < 1 || maxH < 1) { |
562 if (maxH < 1 || maxV < 1) { |
563 throw new IllegalArgumentException("Both maxH and maxV must be >= 1"); |
563 throw new IllegalArgumentException("Both maxH and maxV must be >= 1"); |
564 } |
564 } |
565 |
565 |
566 this.stretchingInsets = insets == null ? EMPTY_INSETS : insets; |
566 this.stretchingInsets = insets == null ? EMPTY_INSETS : insets; |
567 this.canvasSize = canvasSize; |
567 this.canvasSize = canvasSize; |