早教吧作业答案频道 -->其他-->
java中Rectangle类的setRect和setBounds有什么区别么?试了一下效果一样那不是多此一举setRect底层多了这些看不懂intnewx,newy,neww,newh;if(x>2.0*Integer.MAXVALUE){//ToofarinpositiveXdirectiontoreprese
题目详情
java 中 Rectangle 类 的setRect 和setBounds 有什么区别么?
试了一下效果一样 那不是多此一举 setRect底层多了这些看不懂
int newx,newy,neww,newh;
if (x > 2.0 * Integer.MAX_VALUE) {
// Too far in positive X direction to represent...
// We cannot even reach the left side of the specified
// rectangle even with both x & width set to MAX_VALUE.
// The intersection with the "maximal integer rectangle"
// is non-existant so we should use a width < 0.
// REMIND:Should we try to determine a more "meaningful"
// adjusted value for neww than just "-1"?
newx = Integer.MAX_VALUE;
neww = -1;
} else {
newx = clip(x,false);
if (width >= 0) width += x-newx;
neww = clip(width,width >= 0);
}
if (y > 2.0 * Integer.MAX_VALUE) {
// Too far in positive Y direction to represent...
newy = Integer.MAX_VALUE;
newh = -1;
} else {
newy = clip(y,false);
if (height >= 0) height += y-newy;
newh = clip(height,height >= 0);
}
试了一下效果一样 那不是多此一举 setRect底层多了这些看不懂
int newx,newy,neww,newh;
if (x > 2.0 * Integer.MAX_VALUE) {
// Too far in positive X direction to represent...
// We cannot even reach the left side of the specified
// rectangle even with both x & width set to MAX_VALUE.
// The intersection with the "maximal integer rectangle"
// is non-existant so we should use a width < 0.
// REMIND:Should we try to determine a more "meaningful"
// adjusted value for neww than just "-1"?
newx = Integer.MAX_VALUE;
neww = -1;
} else {
newx = clip(x,false);
if (width >= 0) width += x-newx;
neww = clip(width,width >= 0);
}
if (y > 2.0 * Integer.MAX_VALUE) {
// Too far in positive Y direction to represent...
newy = Integer.MAX_VALUE;
newh = -1;
} else {
newy = clip(y,false);
if (height >= 0) height += y-newy;
newh = clip(height,height >= 0);
}
▼优质解答
答案和解析
都可以的,你方便用哪个、就用那个
看了java中Rectangle类...的网友还看了以下:
设{W(t),t>=0}是参数为d的平方的(打不出来那个方差的符号,W(t)-aW(t-h)t>= 2020-05-13 …
功率说在单位时间内,单位时间内是小时还是秒?w其实就是w.只不过写成w.w到底是单位?w/t,w是 2020-05-21 …
A.t[1]=u[1]∧t[12]=w[2]∧t[13]=v[4]B.t[1]=v[l]∧t[2]= 2020-05-26 …
A.t[1]=u[1]∧t[12]=w[2]∧t[13]=v[4]B.t[1]=v[l]∧t[2]= 2020-05-26 …
A.t[1]=U[1]^T[2]=W[2]^T[3]=V[4]B.t[1]=V[1]^T[2]=U[ 2020-05-26 …
A.t[1]=u[1]∧t[2]=w[2]∧t[3]=v[4]B.t[1]=v[1]∧t[2]=u[ 2020-05-26 …
A.t[1]=u[1]∧t[2]=w[2]∧t[3]=v[4]B.t[1]=v[1]∧t[2]=u[ 2020-05-26 …
应用题不懂,不理解.比如说功率的计算公式是:P=W/t可以变形为W=Pt,t=W/P.功的计算公式 2020-08-02 …
关于功率公式P=W/t和P=Fv的说法正确的是()A.由P=W/t知,只要知道W和t就可以求出任意 2020-08-02 …
7、关于功率,下列说法正确的是A、由P=W/t,P与W成反比B、由P=W/t,p与t成正比C、由P= 2020-10-30 …