Fix on FRoundedPanel, and some brief changes to the "rebel" skin to differentiate from "default" (note, still needs a lot of work)

This commit is contained in:
Doublestrike
2011-10-10 02:30:57 +00:00
parent 0a81cc3d72
commit 09f0e0e775
9 changed files with 12 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@@ -28,7 +28,7 @@ public class FRoundedPanel extends JPanel {
private Color borderColor = Color.black; private Color borderColor = Color.black;
private Dimension shadowDistance = new Dimension(5,5); private Dimension shadowDistance = new Dimension(5,5);
private int shadowThickness = 5; private int shadowThickness = 5;
private int cornerRadius = 20; // Note: this number is actually diameter. private int cornerDiameter = 20;
/** /**
* <p>FRoundedPanel.</p> * <p>FRoundedPanel.</p>
@@ -56,8 +56,8 @@ public class FRoundedPanel extends JPanel {
tempS = skin.getSetting("shadowThickness"); tempS = skin.getSetting("shadowThickness");
if(tempS != null) { shadowThickness = Integer.parseInt(tempS); } if(tempS != null) { shadowThickness = Integer.parseInt(tempS); }
tempS = skin.getSetting("cornerRadius"); tempS = skin.getSetting("cornerDiameter");
if(tempS != null) { cornerRadius = Integer.parseInt(tempS); } if(tempS != null) { cornerDiameter = Integer.parseInt(tempS); }
} }
/** /**
@@ -94,7 +94,7 @@ public class FRoundedPanel extends JPanel {
0 + (int)shadowDistance.getHeight() + (shadowThickness/2), 0 + (int)shadowDistance.getHeight() + (shadowThickness/2),
w - (int)shadowDistance.getWidth() - shadowThickness, w - (int)shadowDistance.getWidth() - shadowThickness,
h - (int)shadowDistance.getHeight() - shadowThickness, h - (int)shadowDistance.getHeight() - shadowThickness,
cornerRadius, cornerRadius); cornerDiameter, cornerDiameter);
// Draw content rectangle (on top of shadow) // Draw content rectangle (on top of shadow)
g2d.setColor(this.getBackground()); g2d.setColor(this.getBackground());
@@ -102,16 +102,16 @@ public class FRoundedPanel extends JPanel {
0, 0, 0, 0,
w - shadowThickness, w - shadowThickness,
h - shadowThickness, h - shadowThickness,
cornerRadius, cornerRadius); cornerDiameter, cornerDiameter);
// Stroke border // Stroke border
g2d.setColor(this.borderColor); g2d.setColor(this.borderColor);
g2d.setStroke(new BasicStroke(1)); g2d.setStroke(new BasicStroke(1));
g2d.drawRoundRect( g2d.drawRoundRect(
0,0, 0,0,
w - shadowThickness, w - shadowThickness - 1,
h - shadowThickness, h - shadowThickness - 1,
cornerRadius, cornerRadius); cornerDiameter, cornerDiameter);
} }
/** /**
@@ -166,17 +166,17 @@ public class FRoundedPanel extends JPanel {
} }
/** /**
* <p>setCornerRadius.</p> * <p>setCornerDiameter.</p>
* Sets radius of each corner on rounded panel. * Sets diameter of each corner on rounded panel.
* *
* @param {@link java.lang.Integer} r * @param {@link java.lang.Integer} r
*/ */
public void setCornerRadius(int r) { public void setCornerDiameter(int r) {
if(r < 0) { if(r < 0) {
r = 0; r = 0;
} }
this.cornerRadius = r*2; this.cornerDiameter = r*2;
} }
/** /**