Skip to content

Commit 75f4757

Browse files
committed
@j2sIgnore, @j2sNative calls checked for qualified names
1 parent 54dff99 commit 75f4757

32 files changed

+466
-642
lines changed

sources/net.sf.j2s.java.core/src/java/awt/Color.java

Lines changed: 67 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,6 @@ private static void testColorValueRange(int r, int g, int b, int a) {
328328
// * @param g the Green component
329329
// * @param b the Blue component
330330
// *
331-
// * @j2sIgnore
332-
// *
333331
// **/
334332
// private static void testColorValueRange(float r, float g, float b, float a) {
335333
// boolean rangeError = false;
@@ -380,7 +378,7 @@ public Color() {
380378
*
381379
*/
382380
public Color(int r, int g, int b) {
383-
setColor4(r, g, b, 255);
381+
this(r, g, b, 255);
384382
}
385383

386384
/**
@@ -402,10 +400,6 @@ public Color(int r, int g, int b) {
402400
*
403401
*/
404402
public Color(int r, int g, int b, int a) {
405-
setColor4(r, g, b, a);
406-
}
407-
408-
private void setColor4(int r, int g, int b, int a) {
409403
value = ((a & 0xFF) << 24) |
410404
((r & 0xFF) << 16) |
411405
((g & 0xFF) << 8) |
@@ -477,54 +471,44 @@ public Color(int rgba, boolean hasalpha) {
477471
* @see #getBlue
478472
* @see #getRGB
479473
*
480-
* @deprecated
481-
* use Color.getColorF4 instead
482474
*/
483475

484476
public Color(float r, float g, float b) {
485-
setFloat(r, g, b, 1f);
477+
this(r, g, b, 1f);
486478
}
487479

488-
private void setFloat(float r, float g, float b, float f) {
489-
setColor4((int) (r*255+0.5), (int) (g*255+0.5), (int) (b*255+0.5), (int) (f*255+0.5));
490-
frgbvalue = new float[3];
491-
frgbvalue[0] = r;
492-
frgbvalue[1] = g;
493-
frgbvalue[2] = b;
494-
falpha = f;
495-
//fvalue = frgbvalue;
496-
}
497-
498-
/**
499-
* Creates an sRGB color with the specified red, green, blue, and
500-
* alpha values in the range (0.0 - 1.0). The actual color
501-
* used in rendering depends on finding the best match given the
502-
* color space available for a particular output device.
503-
* @throws IllegalArgumentException if <code>r</code>, <code>g</code>
504-
* <code>b</code> or <code>a</code> are outside of the range
505-
* 0.0 to 1.0, inclusive
506-
* @param r the red component
507-
* @param g the green component
508-
* @param b the blue component
509-
* @param a the alpha component
510-
* @see #getRed
511-
* @see #getGreen
512-
* @see #getBlue
513-
* @see #getAlpha
514-
* @see #getRGB
515-
*
516-
* @deprecated
517-
* use getColorF4 instead
518-
*/
519-
public Color(float r, float g, float b, float a) {
520-
setFloat(r, g, b, a);
521-
}
522-
523-
public static Color getColorF4(float r, float g, float b, float a) {
524-
Color c = new Color();
525-
c.setFloat(r, g, b, a);
526-
return c;
527-
}
480+
/**
481+
* Creates an sRGB color with the specified red, green, blue, and alpha
482+
* values in the range (0.0 - 1.0). The actual color used in rendering
483+
* depends on finding the best match given the color space available for a
484+
* particular output device.
485+
*
486+
* @throws IllegalArgumentException
487+
* if <code>r</code>, <code>g</code> <code>b</code> or
488+
* <code>a</code> are outside of the range 0.0 to 1.0, inclusive
489+
* @param r
490+
* the red component
491+
* @param g
492+
* the green component
493+
* @param b
494+
* the blue component
495+
* @param a
496+
* the alpha component
497+
* @see #getRed
498+
* @see #getGreen
499+
* @see #getBlue
500+
* @see #getAlpha
501+
* @see #getRGB
502+
*
503+
*/
504+
public Color(float r, float g, float b, float a) {
505+
this((int) (r * 255 + 0.5), (int) (g * 255 + 0.5), (int) (b * 255 + 0.5), (int) (a * 255 + 0.5));
506+
frgbvalue = new float[3];
507+
frgbvalue[0] = r;
508+
frgbvalue[1] = g;
509+
frgbvalue[2] = b;
510+
falpha = a;
511+
}
528512

529513

530514
// /**
@@ -546,7 +530,6 @@ public static Color getColorF4(float r, float g, float b, float a) {
546530
// * @see #getColorComponents
547531
// *
548532
// *
549-
// * @j2sIgnore
550533
// */
551534
// public Color(ColorSpace cspace, float components[], float alpha) {
552535
// boolean rangeError = false;
@@ -1054,41 +1037,39 @@ public float[] getRGBColorComponents(float[] compArray) {
10541037
return f;
10551038
}
10561039

1057-
// /**
1058-
// * Returns a <code>float</code> array containing the color and alpha
1059-
// * components of the <code>Color</code>, in the
1060-
// * <code>ColorSpace</code> of the <code>Color</code>.
1061-
// * If <code>compArray</code> is <code>null</code>, an array with
1062-
// * length equal to the number of components in the associated
1063-
// * <code>ColorSpace</code> plus one is created for
1064-
// * the return value. Otherwise, <code>compArray</code> must have at
1065-
// * least this length and it is filled in with the components and
1066-
// * returned.
1067-
// * @param compArray an array that this method fills with the color and
1068-
// * alpha components of this <code>Color</code> in its
1069-
// * <code>ColorSpace</code> and returns
1070-
// * @return the color and alpha components in a <code>float</code>
1071-
// * array.
1072-
// *
1073-
// * @j2sIgnore
1074-
// *
1075-
// */
1076-
// public float[] getComponents(float[] compArray) {
1077-
// if (fvalue == null)
1078-
// return getRGBComponents(compArray);
1079-
// float[] f;
1080-
// int n = fvalue.length;
1081-
// if (compArray == null) {
1082-
// f = new float[n + 1];
1083-
// } else {
1084-
// f = compArray;
1085-
// }
1086-
// for (int i = 0; i < n; i++) {
1087-
// f[i] = fvalue[i];
1088-
// }
1089-
// f[n] = falpha;
1090-
// return f;
1091-
// }
1040+
/**
1041+
* Returns a <code>float</code> array containing the color and alpha
1042+
* components of the <code>Color</code>, in the
1043+
* <code>ColorSpace</code> of the <code>Color</code>.
1044+
* If <code>compArray</code> is <code>null</code>, an array with
1045+
* length equal to the number of components in the associated
1046+
* <code>ColorSpace</code> plus one is created for
1047+
* the return value. Otherwise, <code>compArray</code> must have at
1048+
* least this length and it is filled in with the components and
1049+
* returned.
1050+
* @param compArray an array that this method fills with the color and
1051+
* alpha components of this <code>Color</code> in its
1052+
* <code>ColorSpace</code> and returns
1053+
* @return the color and alpha components in a <code>float</code>
1054+
* array.
1055+
*
1056+
*/
1057+
public float[] getComponents(float[] compArray) {
1058+
if (frgbvalue == null)
1059+
return getRGBComponents(compArray);
1060+
float[] f;
1061+
int n = frgbvalue.length;
1062+
if (compArray == null) {
1063+
f = new float[n + 1];
1064+
} else {
1065+
f = compArray;
1066+
}
1067+
for (int i = 0; i < n; i++) {
1068+
f[i] = frgbvalue[i];
1069+
}
1070+
f[n] = falpha;
1071+
return f;
1072+
}
10921073
//
10931074
// /**
10941075
// * Returns a <code>float</code> array containing only the color
@@ -1137,7 +1118,6 @@ public float[] getRGBColorComponents(float[] compArray) {
11371118
// * @return the color and alpha components in a <code>float</code>
11381119
// * array.
11391120
// *
1140-
// * @j2sIgnore
11411121
// */
11421122
// public float[] getComponents(ColorSpace cspace, float[] compArray) {
11431123
// if (cs == null) {
@@ -1184,7 +1164,6 @@ public float[] getRGBColorComponents(float[] compArray) {
11841164
// * @return the color components in a <code>float</code> array.
11851165
// *
11861166
// *
1187-
// * @j2sIgnore
11881167
// */
11891168
// public float[] getColorComponents(ColorSpace cspace, float[] compArray) {
11901169
// if (cs == null) {
@@ -1213,7 +1192,6 @@ public float[] getRGBColorComponents(float[] compArray) {
12131192
// /**
12141193
// * Returns the <code>ColorSpace</code> of this <code>Color</code>.
12151194
// * @return this <code>Color</code> object's <code>ColorSpace</code>.
1216-
// * @j2sIgnore
12171195
// */
12181196
// public ColorSpace getColorSpace() {
12191197
// if (cs == null) {

sources/net.sf.j2s.java.core/src/java/awt/Component.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@
2727
*/
2828
package java.awt;
2929

30-
import java.awt.Canvas;
31-
import java.awt.HeadlessException;
32-
import java.awt.KeyboardFocusManager;
33-
import java.util.EventListener;
34-
import java.util.HashMap;
35-
import java.util.Map;
36-
import java.util.Vector;
37-
3830
import java.awt.dnd.DropTarget;
3931
import java.awt.event.ActionEvent;
4032
import java.awt.event.AdjustmentEvent;
@@ -67,7 +59,12 @@
6759
import java.awt.peer.LightweightPeer;
6860
import java.beans.PropertyChangeListener;
6961
import java.beans.PropertyChangeSupport;
62+
import java.util.EventListener;
63+
import java.util.HashMap;
7064
import java.util.Locale;
65+
import java.util.Map;
66+
import java.util.Vector;
67+
7168
import sun.awt.AppContext;
7269
import sun.awt.SunToolkit;
7370
import swingjs.JSToolkit;

sources/net.sf.j2s.java.core/src/java/awt/Desktop.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public void print(File file) throws IOException {
366366
*/
367367
public void browse(URI uri) throws IOException {
368368

369-
JSToolkit.showWebPage(uri.toURL());
369+
JSToolkit.showWebPage(uri.toURL(), null);
370370
// SecurityException securityException = null;
371371
// try {
372372
// checkAWTPermission();

sources/net.sf.j2s.java.core/src/java/awt/Point.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ public void setLocation(Point p) {
154154
* @see java.awt.Point#move(int, int)
155155
* @since 1.1
156156
*
157-
* @j2sIgnore
158157
*/
159158
public void setLocation(int x, int y) {
160159
move(x, y);

sources/net.sf.j2s.java.core/src/java/awt/Polygon.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,6 @@ public void next() {
647647
* @see PathIterator#SEG_LINETO
648648
* @see PathIterator#SEG_CLOSE
649649
*
650-
* SwingJS: duplicates double[] coords
651-
* @j2sIgnore
652650
*
653651
*/
654652
@Override

sources/net.sf.j2s.java.core/src/java/awt/RenderingHints.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,6 @@ public class RenderingHints
818818
* @param init a map of key/value pairs to initialize the hints
819819
* or null if the object should be empty
820820
*
821-
* @j2sIgnore
822-
*
823821
*/
824822
public RenderingHints(Map<Key,?> init) {
825823
if (init != null) {

sources/net.sf.j2s.java.core/src/java/awt/geom/AffineTransform.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3942,7 +3942,6 @@ public boolean isIdentity() {
39423942

39433943
/**
39443944
*
3945-
* @j2sIgnore
39463945
*
39473946
* Returns a copy of this <code>AffineTransform</code> object.
39483947
* @return an <code>Object</code> that is a copy of this
@@ -3951,13 +3950,12 @@ public boolean isIdentity() {
39513950
*/
39523951
@Override
39533952
public Object clone() {
3954-
return null;
3955-
// try {
3956-
// return super.clone();
3957-
// } catch (CloneNotSupportedException e) {
3958-
// // this shouldn't happen, since we are Cloneable
3959-
// throw new InternalError();
3960-
// }
3953+
try {
3954+
return super.clone();
3955+
} catch (CloneNotSupportedException e) {
3956+
// this shouldn't happen, since we are Cloneable
3957+
throw new InternalError();
3958+
}
39613959
}
39623960

39633961
/**

sources/net.sf.j2s.java.core/src/java/awt/geom/CubicCurve2D.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,6 @@ public PathIterator getPathIterator(AffineTransform at, double flatness) {
17211721
}
17221722

17231723
/**
1724-
* @j2sIgnore
17251724
*
17261725
* Creates a new object of the same class as this object.
17271726
*

sources/net.sf.j2s.java.core/src/java/awt/geom/Dimension2D.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ public void setSize(Dimension2D d) {
9999
}
100100

101101
/**
102-
* @j2sIgnore
103102
*
104103
* Creates a new object of the same class as this object.
105104
*

sources/net.sf.j2s.java.core/src/java/awt/geom/Line2D.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,6 @@ public PathIterator getPathIterator(AffineTransform at, double flatness) {
11441144
return new LineIterator(this, at);
11451145
}
11461146
/**
1147-
* @j2sIgnore
11481147
*
11491148
* Creates a new object of the same class as this object.
11501149
*

0 commit comments

Comments
 (0)