Skip to content

Commit

Permalink
Fix Netbeans warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfree committed Mar 26, 2020
1 parent 49dc001 commit 95f4574
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions src/main/java/org/jfree/svg/SVGGraphicsConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public class SVGGraphicsConfiguration extends GraphicsConfiguration {

private GraphicsDevice device;

private int width, height;
private final int width;
private final int height;

/**
* Creates a new instance.
Expand All @@ -74,8 +75,7 @@ public SVGGraphicsConfiguration(int width, int height) {
@Override
public GraphicsDevice getDevice() {
if (this.device == null) {
this.device = new SVGGraphicsDevice("JFreeSVG-GraphicsDevice",
this);
this.device = new SVGGraphicsDevice("JFreeSVG-GraphicsDevice", this);
}
return this.device;
}
Expand All @@ -100,12 +100,13 @@ public ColorModel getColorModel() {
*/
@Override
public ColorModel getColorModel(int transparency) {
if (transparency == Transparency.TRANSLUCENT) {
return ColorModel.getRGBdefault();
} else if (transparency == Transparency.OPAQUE) {
return new DirectColorModel(32, 0x00ff0000, 0x0000ff00, 0x000000ff);
} else {
return null;
switch (transparency) {
case Transparency.TRANSLUCENT:
return ColorModel.getRGBdefault();
case Transparency.OPAQUE:
return new DirectColorModel(32, 0x00ff0000, 0x0000ff00, 0x000000ff);
default:
return null;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jfree/svg/SVGGraphicsDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public class SVGGraphicsDevice extends GraphicsDevice {

private String id;
private final String id;

GraphicsConfiguration defaultConfig;

Expand Down

0 comments on commit 95f4574

Please sign in to comment.