working on mode class loading and fixing warnings

This commit is contained in:
benfry
2012-09-10 15:47:13 +00:00
parent 6230142d06
commit ec467ee3d7
18 changed files with 303 additions and 287 deletions

View File

@@ -698,7 +698,7 @@ public class Compiler {
System.err.println("This code needs to be updated " +
"for this version of Processing, " +
"please read the Changes page on the Wiki.");
JavaEditor.showChanges();
Editor.showChanges();
}

View File

@@ -122,7 +122,7 @@ public class PdeKeyListener {
}
}
if ((event.getModifiers() & KeyEvent.META_MASK) != 0) {
if ((event.getModifiers() & InputEvent.META_MASK) != 0) {
//event.consume(); // does nothing
return false;
}
@@ -136,7 +136,7 @@ public class PdeKeyListener {
// }
if ((code == KeyEvent.VK_UP) &&
((event.getModifiers() & KeyEvent.CTRL_MASK) != 0)) {
((event.getModifiers() & InputEvent.CTRL_MASK) != 0)) {
// back up to the last empty line
char contents[] = textarea.getText().toCharArray();
//int origIndex = textarea.getCaretPosition() - 1;
@@ -163,7 +163,7 @@ public class PdeKeyListener {
// if the first char, index will be -2
if (index < 0) index = 0;
if ((event.getModifiers() & KeyEvent.SHIFT_MASK) != 0) {
if ((event.getModifiers() & InputEvent.SHIFT_MASK) != 0) {
textarea.setSelectionStart(caretIndex);
textarea.setSelectionEnd(index);
} else {
@@ -173,7 +173,7 @@ public class PdeKeyListener {
return true;
} else if ((code == KeyEvent.VK_DOWN) &&
((event.getModifiers() & KeyEvent.CTRL_MASK) != 0)) {
((event.getModifiers() & InputEvent.CTRL_MASK) != 0)) {
char contents[] = textarea.getText().toCharArray();
int caretIndex = textarea.getCaretPosition();
@@ -199,7 +199,7 @@ public class PdeKeyListener {
//textarea.setSelectionStart(index);
//textarea.setSelectionEnd(index);
if ((event.getModifiers() & KeyEvent.SHIFT_MASK) != 0) {
if ((event.getModifiers() & InputEvent.SHIFT_MASK) != 0) {
textarea.setSelectionStart(caretIndex);
textarea.setSelectionEnd(index);
} else {
@@ -213,7 +213,7 @@ public class PdeKeyListener {
switch (c) {
case 9: // TAB
if ((event.getModifiers() & KeyEvent.SHIFT_MASK) != 0) {
if ((event.getModifiers() & InputEvent.SHIFT_MASK) != 0) {
// if shift is down, the user always expects an outdent
// http://code.google.com/p/processing/issues/detail?id=458
editor.handleOutdent();
@@ -417,7 +417,7 @@ public class PdeKeyListener {
public boolean keyTyped(KeyEvent event) {
char c = event.getKeyChar();
if ((event.getModifiers() & KeyEvent.CTRL_MASK) != 0) {
if ((event.getModifiers() & InputEvent.CTRL_MASK) != 0) {
// on linux, ctrl-comma (prefs) being passed through to the editor
if (c == KeyEvent.VK_COMMA) {
event.consume();

View File

@@ -622,7 +622,7 @@ public class PdePreprocessor {
//((CommonAST)parserAST).setVerboseStringConversion(
// true, parser.getTokenNames());
// (made to use the static version because of jikes 1.22 warning)
CommonAST.setVerboseStringConversion(true, parser.getTokenNames());
BaseAST.setVerboseStringConversion(true, parser.getTokenNames());
final String className;
if (mode == Mode.JAVA) {
@@ -675,29 +675,29 @@ public class PdePreprocessor {
// hide and which to copy to the hidden text
//
filter = new TokenStreamCopyingHiddenTokenFilter(lexer);
filter.hide(PdeRecognizer.SL_COMMENT);
filter.hide(PdeRecognizer.ML_COMMENT);
filter.hide(PdeRecognizer.WS);
filter.copy(PdeRecognizer.SEMI);
filter.copy(PdeRecognizer.LPAREN);
filter.copy(PdeRecognizer.RPAREN);
filter.copy(PdeRecognizer.LCURLY);
filter.copy(PdeRecognizer.RCURLY);
filter.copy(PdeRecognizer.COMMA);
filter.copy(PdeRecognizer.RBRACK);
filter.copy(PdeRecognizer.LBRACK);
filter.copy(PdeRecognizer.COLON);
filter.copy(PdeRecognizer.TRIPLE_DOT);
filter.hide(PdePartialTokenTypes.SL_COMMENT);
filter.hide(PdePartialTokenTypes.ML_COMMENT);
filter.hide(PdePartialTokenTypes.WS);
filter.copy(PdePartialTokenTypes.SEMI);
filter.copy(PdePartialTokenTypes.LPAREN);
filter.copy(PdePartialTokenTypes.RPAREN);
filter.copy(PdePartialTokenTypes.LCURLY);
filter.copy(PdePartialTokenTypes.RCURLY);
filter.copy(PdePartialTokenTypes.COMMA);
filter.copy(PdePartialTokenTypes.RBRACK);
filter.copy(PdePartialTokenTypes.LBRACK);
filter.copy(PdePartialTokenTypes.COLON);
filter.copy(PdePartialTokenTypes.TRIPLE_DOT);
// Because the meanings of < and > are overloaded to support
// type arguments and type parameters, we have to treat them
// as copyable to hidden text (or else the following syntax,
// such as (); and what not gets lost under certain circumstances)
// -- jdf
filter.copy(PdeRecognizer.LT);
filter.copy(PdeRecognizer.GT);
filter.copy(PdeRecognizer.SR);
filter.copy(PdeRecognizer.BSR);
filter.copy(PdePartialTokenTypes.LT);
filter.copy(PdePartialTokenTypes.GT);
filter.copy(PdePartialTokenTypes.SR);
filter.copy(PdePartialTokenTypes.BSR);
// create a parser and set what sort of AST should be generated
//