Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/scripts/generate-quality-report.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@ def main() -> None:
"EQ_COMPARETO_USE_OBJECT_EQUALS",
"MS_EXPOSE_REP",
"NM_CONFUSING",
"NM_FIELD_NAMING_CONVENTION",
"NM_METHOD_NAMING_CONVENTION",
"NO_NOTIFY_NOT_NOTIFYALL",
"NP_LOAD_OF_KNOWN_NULL_VALUE",
"NP_BOOLEAN_RETURN_NULL",
Expand Down
6 changes: 3 additions & 3 deletions CodenameOne/src/com/codename1/analytics/AnalyticsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static void visit(String page, String referer) {
*/
public static void sendCrashReport(Throwable t, String message, boolean fatal) {
// https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#exception
ConnectionRequest req = GetGARequest();
ConnectionRequest req = getGaRequest();
req.addArgument("t", "exception");
System.out.println(message);
req.addArgument("exd", message.substring(0, Math.min(message.length(), 150) - 1));
Expand All @@ -180,7 +180,7 @@ public static void sendCrashReport(Throwable t, String message, boolean fatal) {
NetworkManager.getInstance().addToQueue(req);
}

private static ConnectionRequest GetGARequest() {
private static ConnectionRequest getGaRequest() {
ConnectionRequest req = new ConnectionRequest();
req.setUrl("https://www.google-analytics.com/collect");
req.setPost(true);
Expand Down Expand Up @@ -246,7 +246,7 @@ public void actionPerformed(ActionEvent evt) {
}
if (appsMode) {
// https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#apptracking
final ConnectionRequest req = GetGARequest();
final ConnectionRequest req = getGaRequest();
req.addArgument("t", "appview");
req.addArgument("an", Display.getInstance().getProperty("AppName", "Codename One App"));
String version = Display.getInstance().getProperty("AppVersion", "1.0");
Expand Down
6 changes: 3 additions & 3 deletions CodenameOne/src/com/codename1/charts/util/ColorUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public IColor(int argb) {
this.green = (argb >>> 8) & 0xff;
this.blue = (argb & 0xff);

this.argb = ToARGB(this);
this.argb = toArgb(this);
}


Expand All @@ -144,10 +144,10 @@ public IColor(int a, int r, int g, int b) {
this.green = (g & 0xff);
this.blue = (b & 0xff);

this.argb = ToARGB(this);
this.argb = toArgb(this);
}

private static int ToARGB(IColor c) { // PMD Fix: UnnecessaryModifier removed redundant final
private static int toArgb(IColor c) { // PMD Fix: UnnecessaryModifier removed redundant final
return ((c.alpha << 24) |
(c.red << 16) |
(c.green << 8) |
Expand Down
64 changes: 32 additions & 32 deletions CodenameOne/src/com/codename1/ui/geom/GeneralPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -2984,19 +2984,19 @@ public static boolean isInsideEvenOdd(int cross) {
public static class QuadCurve {

double ax, ay, bx, by;
double Ax, Ay, Bx, By;
double axCoeff, ayCoeff, bxCoeff, byCoeff;

public QuadCurve(double x1, double y1, double cx, double cy, double x2, double y2) {
ax = x2 - x1;
ay = y2 - y1;
bx = cx - x1;
by = cy - y1;

Bx = bx + bx; // Bx = 2.0 * bx
Ax = ax - Bx; // Ax = ax - 2.0 * bx
bxCoeff = bx + bx; // Bx = 2.0 * bx
axCoeff = ax - bxCoeff; // Ax = ax - 2.0 * bx

By = by + by; // By = 2.0 * by
Ay = ay - By; // Ay = ay - 2.0 * by
byCoeff = by + by; // By = 2.0 * by
ayCoeff = ay - byCoeff; // Ay = ay - 2.0 * by
}

int cross(double[] res, int rc, double py1, double py2) {
Expand Down Expand Up @@ -3024,10 +3024,10 @@ int cross(double[] res, int rc, double py1, double py2) {
continue;
}
// CURVE-INSIDE
double ry = t * (t * Ay + By);
double ry = t * (t * ayCoeff + byCoeff);
// ry = t * t * Ay + t * By
if (ry > py2) {
double rxt = t * Ax + bx;
double rxt = t * axCoeff + bx;
// rxt = 2.0 * t * Ax + Bx = 2.0 * t * Ax + 2.0 * bx
if (rxt > -DELTA && rxt < DELTA) {
continue;
Expand All @@ -3040,17 +3040,17 @@ int cross(double[] res, int rc, double py1, double py2) {
}

int solvePoint(double[] res, double px) {
double[] eqn = {-px, Bx, Ax};
double[] eqn = {-px, bxCoeff, axCoeff};
return solveQuad(eqn, res);
}

int solveExtrem(double[] res) {
int rc = 0;
if (!isZero(Ax)) {
res[rc++] = -Bx / (Ax + Ax);
if (!isZero(axCoeff)) {
res[rc++] = -bxCoeff / (axCoeff + axCoeff);
}
if (!isZero(Ay)) {
res[rc++] = -By / (Ay + Ay);
if (!isZero(ayCoeff)) {
res[rc++] = -byCoeff / (ayCoeff + ayCoeff);
}
return rc;
}
Expand All @@ -3059,11 +3059,11 @@ int addBound(double[] bound, int bc, double[] res, int rc, double minX, double m
for (int i = 0; i < rc; i++) {
double t = res[i];
if (t > -DELTA && t < 1 + DELTA) {
double rx = t * (t * Ax + Bx);
double rx = t * (t * axCoeff + bxCoeff);
if (minX <= rx && rx <= maxX) {
bound[bc++] = t;
bound[bc++] = rx;
bound[bc++] = t * (t * Ay + By);
bound[bc++] = t * (t * ayCoeff + byCoeff);
bound[bc++] = id;
if (changeId) {
id++;
Expand All @@ -3082,8 +3082,8 @@ int addBound(double[] bound, int bc, double[] res, int rc, double minX, double m
public static class CubicCurve {

double ax, ay, bx, by, cx, cy;
double Ax, Ay, Bx, By, Cx, Cy;
double Ax3, Bx2;
double axCoeff, ayCoeff, bxCoeff, byCoeff, cxCoeff, cyCoeff;
double axCoeff3, bxCoeff2;

public CubicCurve(double x1, double y1, double cx1, double cy1, double cx2, double cy2, double x2, double y2) {
ax = x2 - x1;
Expand All @@ -3093,16 +3093,16 @@ public CubicCurve(double x1, double y1, double cx1, double cy1, double cx2, doub
cx = cx2 - x1;
cy = cy2 - y1;

Cx = bx + bx + bx; // Cx = 3.0 * bx
Bx = cx + cx + cx - Cx - Cx; // Bx = 3.0 * cx - 6.0 * bx
Ax = ax - Bx - Cx; // Ax = ax - 3.0 * cx + 3.0 * bx
cxCoeff = bx + bx + bx; // Cx = 3.0 * bx
bxCoeff = cx + cx + cx - cxCoeff - cxCoeff; // Bx = 3.0 * cx - 6.0 * bx
axCoeff = ax - bxCoeff - cxCoeff; // Ax = ax - 3.0 * cx + 3.0 * bx

Cy = by + by + by; // Cy = 3.0 * by
By = cy + cy + cy - Cy - Cy; // By = 3.0 * cy - 6.0 * by
Ay = ay - By - Cy; // Ay = ay - 3.0 * cy + 3.0 * by
cyCoeff = by + by + by; // Cy = 3.0 * by
byCoeff = cy + cy + cy - cyCoeff - cyCoeff; // By = 3.0 * cy - 6.0 * by
ayCoeff = ay - byCoeff - cyCoeff; // Ay = ay - 3.0 * cy + 3.0 * by

Ax3 = Ax + Ax + Ax;
Bx2 = Bx + Bx;
axCoeff3 = axCoeff + axCoeff + axCoeff;
bxCoeff2 = bxCoeff + bxCoeff;
}

int cross(double[] res, int rc, double py1, double py2) {
Expand All @@ -3129,13 +3129,13 @@ int cross(double[] res, int rc, double py1, double py2) {
continue;
}
// CURVE-INSIDE
double ry = t * (t * (t * Ay + By) + Cy);
double ry = t * (t * (t * ayCoeff + byCoeff) + cyCoeff);
// ry = t * t * t * Ay + t * t * By + t * Cy
if (ry > py2) {
double rxt = t * (t * Ax3 + Bx2) + Cx;
double rxt = t * (t * axCoeff3 + bxCoeff2) + cxCoeff;
// rxt = 3.0 * t * t * Ax + 2.0 * t * Bx + Cx
if (rxt > -DELTA && rxt < DELTA) {
rxt = t * (Ax3 + Ax3) + Bx2;
rxt = t * (axCoeff3 + axCoeff3) + bxCoeff2;
// rxt = 6.0 * t * Ax + 2.0 * Bx
if (rxt < -DELTA || rxt > DELTA) {
// Inflection point
Expand All @@ -3151,29 +3151,29 @@ int cross(double[] res, int rc, double py1, double py2) {
}

int solvePoint(double[] res, double px) {
double[] eqn = {-px, Cx, Bx, Ax};
double[] eqn = {-px, cxCoeff, bxCoeff, axCoeff};
return solveCubic(eqn, res);
}

int solveExtremX(double[] res) {
double[] eqn = {Cx, Bx2, Ax3};
double[] eqn = {cxCoeff, bxCoeff2, axCoeff3};
return solveQuad(eqn, res);
}

int solveExtremY(double[] res) {
double[] eqn = {Cy, By + By, Ay + Ay + Ay};
double[] eqn = {cyCoeff, byCoeff + byCoeff, ayCoeff + ayCoeff + ayCoeff};
return solveQuad(eqn, res);
}

int addBound(double[] bound, int bc, double[] res, int rc, double minX, double maxX, boolean changeId, int id) {
for (int i = 0; i < rc; i++) {
double t = res[i];
if (t > -DELTA && t < 1 + DELTA) {
double rx = t * (t * (t * Ax + Bx) + Cx);
double rx = t * (t * (t * axCoeff + bxCoeff) + cxCoeff);
if (minX <= rx && rx <= maxX) {
bound[bc++] = t;
bound[bc++] = rx;
bound[bc++] = t * (t * (t * Ay + By) + Cy);
bound[bc++] = t * (t * (t * ayCoeff + byCoeff) + cyCoeff);
bound[bc++] = id;
if (changeId) {
id++;
Expand Down
12 changes: 2 additions & 10 deletions CodenameOne/src/com/codename1/ui/layouts/GridBagLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ protected GridBagLayoutInfo GetLayoutInfo(Container parent, int sizeflag) {
}
}*/

protected void ArrangeGrid(Container parent) {
protected void arrangeGrid(Container parent) {
ParentInfo info = lastParentInfo = getParentInfo(parent);
if (getComponentsNumber(parent) == 0) {
return;
Expand All @@ -253,14 +253,6 @@ protected GridBagConstraints lookupConstraints(Component comp) {
return cons;
}

protected void adjustForGravity(GridBagConstraints constraints, Rectangle r) {
AdjustForGravity(constraints, r);
}

protected void arrangeGrid(Container parent) {
ArrangeGrid(parent);
}

/*protected GridBagLayoutInfo getLayoutInfo(Container parent, int sizeflag) {
return GetLayoutInfo(parent, sizeflag);
}
Expand All @@ -274,7 +266,7 @@ protected Dimension getMinSize(Container parent, GridBagLayoutInfo info) {
}
}*/

protected void AdjustForGravity(GridBagConstraints constraints, Rectangle r) {
protected void adjustForGravity(GridBagConstraints constraints, Rectangle r) {
/*try {
// ((GridBagConstraints) constraints).verify();
} catch (IllegalArgumentException e) {
Expand Down
Loading