FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

using accessors for version number · GoToLoop/processing@22f4b2c · GitHub

Repository navigation

Commit 22f4b2c

Browse files
committed
using accessors for version number
1 parent da553f4 commit 22f4b2c

7 files changed

Lines changed: 29 additions & 32 deletions

File tree

‎app/src/processing/app/About.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ public void paint(Graphics g) {
5252

5353
g.setFont(new Font("SansSerif", Font.PLAIN, 11)); //$NON-NLS-1$
5454
g.setColor(Color.white);
55-
g.drawString(Base.VERSION_NAME, 50, 30);
55+
g.drawString(Base.getVersionName(), 50, 30);
5656
}
5757
}

‎app/src/processing/app/Base.java‎

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@
4444
* files and images, etc) that comes from that.
4545
*/
4646
public class Base {
47-
static public final int REVISION = 218;
47+
// Added accessors for 0218 because the UpdateCheck class was not properly
48+
// updating the values, because javac was inlining the static final values.
49+
static private final int REVISION = 218;
4850
/** This might be replaced by main() if there's a lib/version.txt file. */
49-
static public String VERSION_NAME = "0218"; //$NON-NLS-1$
51+
static private String VERSION_NAME = "0218"; //$NON-NLS-1$
5052
/** Set true if this a proper release rather than a numbered revision. */
51-
static public boolean RELEASE = false;
53+
// static private boolean RELEASE = false;
5254

5355
/** True if heavy debugging error/log messages are enabled */
5456
static public boolean DEBUG = false;
@@ -147,7 +149,7 @@ static private void createAndShowGUI(String[] args) {
147149
String version = PApplet.loadStrings(versionFile)[0];
148150
if (!version.equals(VERSION_NAME)) {
149151
VERSION_NAME = version;
150-
RELEASE = true;
152+
// RELEASE = true;
151153
}
152154
}
153155
} catch (Exception e) {
@@ -1547,33 +1549,25 @@ public void handleShowUpdates() {
15471549
updateManagerFrame.showFrame(activeEditor);
15481550
}
15491551

1552+
15501553
// ...................................................................
15511554

15521555

1556+
static public int getRevision() {
1557+
return REVISION;
1558+
}
1559+
1560+
15531561
/**
1554-
* Get list of platform constants.
1562+
* Return the version name, something like 1.5 or 2.0b8 or 0213 if it's not
1563+
* a release version.
15551564
*/
1556-
// static public int[] getPlatforms() {
1557-
// return platforms;
1558-
// }
1559-
1565+
static public String getVersionName() {
1566+
return VERSION_NAME;
1567+
}
15601568

1561-
// static public int getPlatform() {
1562-
// String osname = System.getProperty("os.name");
1563-
//
1564-
// if (osname.indexOf("Mac") != -1) {
1565-
// return PConstants.MACOSX;
1566-
//
1567-
// } else if (osname.indexOf("Windows") != -1) {
1568-
// return PConstants.WINDOWS;
1569-
//
1570-
// } else if (osname.equals("Linux")) { // true for the ibm vm
1571-
// return PConstants.LINUX;
1572-
//
1573-
// } else {
1574-
// return PConstants.OTHER;
1575-
// }
1576-
// }
1569+
1570+
//...................................................................
15771571

15781572

15791573
static public Platform getPlatform() {

‎app/src/processing/app/Editor.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,7 @@ protected boolean handleOpenInternal(String path) {
22152215
* something like "sketch_070752a - Processing 0126"
22162216
*/
22172217
public void updateTitle() {
2218-
setTitle(sketch.getName() + " | Processing " + Base.VERSION_NAME);
2218+
setTitle(sketch.getName() + " | Processing " + Base.getVersionName());
22192219

22202220
if (!sketch.isUntitled()) {
22212221
// set current file for OS X so that cmd-click in title bar works

‎app/src/processing/app/UpdateCheck.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void updateCheck() throws Exception {
8888
}
8989

9090
String info = PApplet.urlEncode(id + "\t" +
91-
PApplet.nf(Base.REVISION, 4) + "\t" +
91+
PApplet.nf(Base.getRevision(), 4) + "\t" +
9292
System.getProperty("java.version") + "\t" +
9393
System.getProperty("java.vendor") + "\t" +
9494
System.getProperty("os.name") + "\t" +
@@ -111,9 +111,9 @@ public void updateCheck() throws Exception {
111111
if (base.activeEditor != null) {
112112
boolean offerToUpdateContributions = true;
113113

114-
if (latest > Base.REVISION) {
114+
if (latest > Base.getRevision()) {
115115
System.out.println("You are running Processing revision " +
116-
Base.REVISION + ", the latest is " + latest + ".");
116+
Base.getRevision() + ", the latest is " + latest + ".");
117117
// Assume the person is busy downloading the latest version
118118
offerToUpdateContributions = !promptToVisitDownloadPage();
119119
}

‎app/src/processing/mode/java/Commander.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ void complainAndQuit(String lastWords, boolean schoolEmFirst) {
345345

346346
static void printCommandLine(PrintStream out) {
347347
out.println();
348-
out.println("Command line edition for Processing " + Base.VERSION_NAME + " (Java Mode)");
348+
out.println("Command line edition for Processing " + Base.getVersionName() + " (Java Mode)");
349349
out.println();
350350
out.println("--help Show this help text. Congratulations.");
351351
out.println();

‎app/src/processing/mode/java/JavaBuild.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ protected void addManifest(ZipOutputStream zos) throws IOException {
15291529

15301530
String contents =
15311531
"Manifest-Version: 1.0\n" +
1532-
"Created-By: Processing " + Base.VERSION_NAME + "\n" +
1532+
"Created-By: Processing " + Base.getVersionName() + "\n" +
15331533
"Main-Class: " + sketch.getName() + "\n"; // TODO not package friendly
15341534
zos.write(contents.getBytes());
15351535
zos.closeEntry();

‎core/todo.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ A Implement textMode(SHAPE) for 3D
2929
A https://github.com/processing/processing/issues/777
3030
A PImage.loadPixels() shouldn't be calling out to the renderer
3131
A setting image.parent = null for it makes it work again for get().save() case
32+
A Setting smooth(n) affects disables background in setup()
33+
A https://github.com/processing/processing/issues/1452
34+
3235

3336
_ data decision stuff
3437
_ key/valueIterator to get a version that can be removed in a loop

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL