-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
7
-
generic
-
generic
Different (unspecified) IAEs could be thrown from method AbstractRegionPainter.decodeGradient():
java.lang.IllegalArgumentException: Colors and fractions must have equal size
java.lang.IllegalArgumentException: Fraction values must be in the range 0 to 1: ...
java.lang.IllegalArgumentException: Keyframe fractions must be increasing: ...
java.lang.IllegalArgumentException: Start point cannot equalendpoint
They should be specified.
Please see the following code sample which illustrates four exceptions listed above.
------------------------------------------------------------------------------------
import javax.swing.*;
import java.awt.*;
import static java.awt.Color.*;
public class Test {
public static void main(String[] args) {
MyARP arp = new MyARP();
// uncomment any of calls below to see different types of IAEs
// arp.callDecodeGradient(0.1f, 0.4f, 0.2f, 0.8f, new float[]{0.1f, 0.6f}, new Color[]{BLACK, MAGENTA, BLUE});
// arp.callDecodeGradient(0.1f, 0.4f, 0.2f, 0.8f, new float[]{12.1f, 0.6f}, new Color[]{BLACK, BLUE});
// arp.callDecodeGradient(0.1f, 0.4f, 0.2f, 0.8f, new float[]{.3f, 0.2f}, new Color[]{BLACK, BLUE});
// arp.callDecodeGradient(100.f, Float.MAX_VALUE, 100.f, Float.MAX_VALUE, new float[]{.1f, 0.2f}, new Color[]{BLACK, BLUE});
}
static class MyARP extends javax.swing.plaf.nimbus.AbstractRegionPainter {
protected PaintContext getPaintContext() { return null; }
protected void doPaint(Graphics2D g, JComponent c,
int width, int height,
Object[] extendedCacheKeys) { }
void callDecodeGradient(float x1, float y1, float x2, float y2,
float[] midpoints, java.awt.Color[] colors) {
decodeGradient(x1, y1, x2, y2, midpoints, colors);
}
}
}
------------------------------------------------------------------------------------
java.lang.IllegalArgumentException: Colors and fractions must have equal size
java.lang.IllegalArgumentException: Fraction values must be in the range 0 to 1: ...
java.lang.IllegalArgumentException: Keyframe fractions must be increasing: ...
java.lang.IllegalArgumentException: Start point cannot equalendpoint
They should be specified.
Please see the following code sample which illustrates four exceptions listed above.
------------------------------------------------------------------------------------
import javax.swing.*;
import java.awt.*;
import static java.awt.Color.*;
public class Test {
public static void main(String[] args) {
MyARP arp = new MyARP();
// uncomment any of calls below to see different types of IAEs
// arp.callDecodeGradient(0.1f, 0.4f, 0.2f, 0.8f, new float[]{0.1f, 0.6f}, new Color[]{BLACK, MAGENTA, BLUE});
// arp.callDecodeGradient(0.1f, 0.4f, 0.2f, 0.8f, new float[]{12.1f, 0.6f}, new Color[]{BLACK, BLUE});
// arp.callDecodeGradient(0.1f, 0.4f, 0.2f, 0.8f, new float[]{.3f, 0.2f}, new Color[]{BLACK, BLUE});
// arp.callDecodeGradient(100.f, Float.MAX_VALUE, 100.f, Float.MAX_VALUE, new float[]{.1f, 0.2f}, new Color[]{BLACK, BLUE});
}
static class MyARP extends javax.swing.plaf.nimbus.AbstractRegionPainter {
protected PaintContext getPaintContext() { return null; }
protected void doPaint(Graphics2D g, JComponent c,
int width, int height,
Object[] extendedCacheKeys) { }
void callDecodeGradient(float x1, float y1, float x2, float y2,
float[] midpoints, java.awt.Color[] colors) {
decodeGradient(x1, y1, x2, y2, midpoints, colors);
}
}
}
------------------------------------------------------------------------------------
- duplicates
-
JDK-6849331 Nimbus L&F: AbstractRegionPainter's paint context is not initialized
-
- Resolved
-