Date of registration: Feb 9th 2009
Location: Mladenovac, Serbia
Occupation: Programming
Hobbies: Programming
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
public static class Float extends Rectangle2D
implements Serializable
{
public float x;
public float y;
public float width;
public float height;
private static final long serialVersionUID = 3798716824173675777L;
public Float()
{
}
public Float(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4)
{
setRect(paramFloat1, paramFloat2, paramFloat3, paramFloat4);
}
public double getX()
{
return this.x;
}
public double getY()
{
return this.y;
}
public double getWidth()
{
return this.width;
}
public double getHeight()
{
return this.height;
}
public boolean isEmpty()
{
return ((this.width <= 0.0F) || (this.height <= 0.0F));
}
public void setRect(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4)
{
this.x = paramFloat1;
this.y = paramFloat2;
this.width = paramFloat3;
this.height = paramFloat4;
}
public void setRect(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
{
this.x = (float)paramDouble1;
this.y = (float)paramDouble2;
this.width = (float)paramDouble3;
this.height = (float)paramDouble4;
}
public void setRect(Rectangle2D paramRectangle2D)
{
this.x = (float)paramRectangle2D.getX();
this.y = (float)paramRectangle2D.getY();
this.width = (float)paramRectangle2D.getWidth();
this.height = (float)paramRectangle2D.getHeight();
}
public int outcode(double paramDouble1, double paramDouble2)
{
int i = 0;
if (this.width <= 0.0F)
i |= 5;
else if (paramDouble1 < this.x)
i |= 1;
else if (paramDouble1 > this.x + this.width) {
i |= 4;
}
if (this.height <= 0.0F)
i |= 10;
else if (paramDouble2 < this.y)
i |= 2;
else if (paramDouble2 > this.y + this.height) {
i |= 8;
}
return i;
}
public Rectangle2D getBounds2D()
{
return new Float(this.x, this.y, this.width, this.height);
}
public Rectangle2D createIntersection(Rectangle2D paramRectangle2D)
{
Object localObject;
if (paramRectangle2D instanceof Float)
localObject = new Float();
else {
localObject = new Rectangle2D.Double();
}
Rectangle2D.intersect(this, paramRectangle2D, (Rectangle2D)localObject);
return ((Rectangle2D)localObject);
}
public Rectangle2D createUnion(Rectangle2D paramRectangle2D)
{
Object localObject;
if (paramRectangle2D instanceof Float)
localObject = new Float();
else {
localObject = new Rectangle2D.Double();
}
Rectangle2D.union(this, paramRectangle2D, (Rectangle2D)localObject);
return ((Rectangle2D)localObject);
}
public String toString()
{
return super.getClass().getName() + "[x=" + this.x + ",y=" + this.y + ",w=" + this.width + ",h=" + this.height + "]";
}
}
|
Date of registration: Feb 9th 2009
Location: Mladenovac, Serbia
Occupation: Programming
Hobbies: Programming
Date of registration: Jul 16th 2008
Location: Erlangen, Germany
Occupation: Software Developer
Hobbies: Jabaco, game theory, text-mining
Sample for inner-classes:
Quoted
Installed Jabaco is 1.4.2, but there is no float or double instance of any geometrics figure.
|
|
Jabaco Source |
1 |
Dim test As New java#awt#geom#Rectangle2D$Float |
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
public class AClass {
AClass() {
B b = new B();
int i = B;
b = new AClass.B();
i = this.B;
}
public class B extends AClass {
}
public int B; // allowed name clash between variable B and nested class B
}
|
Date of registration: Jul 16th 2008
Location: Erlangen, Germany
Occupation: Software Developer
Hobbies: Jabaco, game theory, text-mining
Ok - matter of habit. It's faster for the compiler to use another char to separate the namespace and it's difficult to change - but I'll think about your request...
Quoted
1.) I always seem to get it wrong selecting the proper separator.
2.) All other programing languages familiar to me are using "."
3.) "#" and "$" are typically used for other purposes
4.) I can't see any advantage for the developer to have different separators.
Beginner
Date of registration: Aug 4th 2011
Location: The Netherlands
Occupation: Old Fasion Programmer
Hobbies: Play Music with my Bass
Maybe some settings in Jabaco can help here and your choice which separator you like to use.Ok - matter of habit. It's faster for the compiler to use another char to separate the namespace and it's difficult to change - but I'll think about your request...
Quoted
1.) I always seem to get it wrong selecting the proper separator.
2.) All other programing languages familiar to me are using "."
3.) "#" and "$" are typically used for other purposes
4.) I can't see any advantage for the developer to have different separators.
This post has been edited 1 times, last edit by "swissmade" (Aug 16th 2011, 8:14am)