Component.java: Indentation cleanup from Classpath.
* java/awt/Component.java: Indentation cleanup from Classpath. 2003-09-20 Dalibor Topic <robilad@kaffe.org> * java/awt/BasicStroke.java (BasicStroke): Fixed illegal argument checking to follow 1.4.2 spec. From-SVN: r71612
This commit is contained in:
parent
21cf98f6e0
commit
a8cc9af35f
3 changed files with 51 additions and 14 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2003-09-20 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* java/awt/Component.java: Indentation cleanup from Classpath.
|
||||||
|
|
||||||
|
2003-09-20 Dalibor Topic <robilad@kaffe.org>
|
||||||
|
|
||||||
|
* java/awt/BasicStroke.java (BasicStroke): Fixed illegal argument
|
||||||
|
checking to follow 1.4.2 spec.
|
||||||
|
|
||||||
2003-08-11 Ingo Proetel <proetel@aicas.com>
|
2003-08-11 Ingo Proetel <proetel@aicas.com>
|
||||||
|
|
||||||
* gnu/java/rmi/server/UnicastRef.java: make constructor public and check if serverobject
|
* gnu/java/rmi/server/UnicastRef.java: make constructor public and check if serverobject
|
||||||
|
|
|
@ -67,7 +67,8 @@ public class BasicStroke implements Stroke
|
||||||
* @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
|
* @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
|
||||||
* @param miterlimit the limit to trim the miter join. The miterlimit must be
|
* @param miterlimit the limit to trim the miter join. The miterlimit must be
|
||||||
* greater than or equal to 1.0f.
|
* greater than or equal to 1.0f.
|
||||||
* @param dash The array representing the dashing pattern.
|
* @param dash The array representing the dashing pattern. There must be at
|
||||||
|
* least one non-zero entry.
|
||||||
* @param dash_phase is negative and dash is not null.
|
* @param dash_phase is negative and dash is not null.
|
||||||
*
|
*
|
||||||
* @exception IllegalArgumentException If one input parameter doesn't meet
|
* @exception IllegalArgumentException If one input parameter doesn't meet
|
||||||
|
@ -76,13 +77,40 @@ public class BasicStroke implements Stroke
|
||||||
public BasicStroke(float width, int cap, int join, float miterlimit,
|
public BasicStroke(float width, int cap, int join, float miterlimit,
|
||||||
float[] dash, float dashPhase)
|
float[] dash, float dashPhase)
|
||||||
{
|
{
|
||||||
if (width < 0 ||
|
if (width < 0.0f )
|
||||||
miterlimit < 1.0f ||
|
throw new IllegalArgumentException("width " + width + " < 0");
|
||||||
cap < CAP_BUTT ||
|
else if (cap < CAP_BUTT || cap > CAP_SQUARE)
|
||||||
cap > CAP_SQUARE ||
|
throw new IllegalArgumentException("cap " + cap + " out of range ["
|
||||||
join < JOIN_MITER ||
|
+ CAP_BUTT + ".." + CAP_SQUARE + "]");
|
||||||
join > JOIN_BEVEL)
|
else if (miterlimit < 1.0f && join == JOIN_MITER)
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException("miterlimit " + miterlimit
|
||||||
|
+ " < 1.0f while join == JOIN_MITER");
|
||||||
|
else if (join < JOIN_MITER || join > JOIN_BEVEL)
|
||||||
|
throw new IllegalArgumentException("join " + join + " out of range ["
|
||||||
|
+ JOIN_MITER + ".." + JOIN_BEVEL
|
||||||
|
+ "]");
|
||||||
|
else if (dashPhase < 0.0f && dash != null)
|
||||||
|
throw new IllegalArgumentException("dashPhase " + dashPhase
|
||||||
|
+ " < 0.0f while dash != null");
|
||||||
|
else if (dash != null)
|
||||||
|
if (dash.length == 0)
|
||||||
|
throw new IllegalArgumentException("dash.length is 0");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
boolean allZero = true;
|
||||||
|
|
||||||
|
for ( int i = 0; i < dash.length; ++i)
|
||||||
|
{
|
||||||
|
if (dash[i] != 0.0f)
|
||||||
|
{
|
||||||
|
allZero = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allZero)
|
||||||
|
throw new IllegalArgumentException("all dashes are 0.0f");
|
||||||
|
}
|
||||||
|
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.cap = cap;
|
this.cap = cap;
|
||||||
|
|
|
@ -1870,12 +1870,12 @@ public abstract class Component
|
||||||
{
|
{
|
||||||
Image returnValue = null;
|
Image returnValue = null;
|
||||||
if (!GraphicsEnvironment.isHeadless ())
|
if (!GraphicsEnvironment.isHeadless ())
|
||||||
{
|
{
|
||||||
if (isLightweight () && parent != null)
|
if (isLightweight () && parent != null)
|
||||||
returnValue = parent.createImage (width, height);
|
returnValue = parent.createImage (width, height);
|
||||||
else if (peer != null)
|
else if (peer != null)
|
||||||
returnValue = peer.createImage (width, height);
|
returnValue = peer.createImage (width, height);
|
||||||
}
|
}
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue