APISonar


processing.app.Messages.log

> processing > app > Messages > log
processing APIs app APIs Messages APIs log APIs

Example 1
private void log(String msg, Object... args) {
    if (args != null && args.length != 0) {
      Messages.logf(getClass().getName() + " " + msg, args);
    } else {
      Messages.log(getClass().getName() + " " + msg);
    }
  }
Example 2
public void saveLanguage(String language) {
    String[] cmdarray = new String[]{
      "defaults", "write",
      System.getProperty("user.home") + "/Library/Preferences/org.processing.app",
      "AppleLanguages", "-array", language
    };
    try {
      Runtime.getRuntime().exec(cmdarray);
    } catch (IOException e) {
      Messages.log("Error saving platform language: " + e.getMessage());
    }
  }
Example 3
File findCandidate(File folder) {
    File[] folders = listCandidates(folder);

    if (folders.length == 0) {
      return null;

    } else if (folders.length > 1) {
      Messages.log("More than one " + toString() + " found inside " + folder.getAbsolutePath());
    }
    return folders[0];
  }
Example 4
public String getSearchPath() {
    if (sdk == null) {
        checkSDK(null);
    }

    if (sdk == null) {
      Messages.log(AndroidMode.getTextString("android_mode.info.cannot_open_sdk_path"));
      return "";
    }
    
    String coreJarPath = new File(getFolder(), "processing-core.zip").getAbsolutePath();
    return sdk.getAndroidJarPath().getAbsolutePath() + File.pathSeparatorChar + coreJarPath;
  }
Example 5
public ModeContribution(Base base, File folder,
                           String className) throws Exception {
    super(folder);
    className = initLoader(base, className);
    if (className != null) {
      Class<?> modeClass = loader.loadClass(className);
      Messages.log("Got mode class " + modeClass);
      Constructor con = modeClass.getConstructor(Base.class, File.class);
      mode = (Mode) con.newInstance(base, folder);
      mode.setClassLoader(loader);
      if (base != null) {
        mode.setupGUI();
      }
    }
  }
Example 6
private void prepareSuggestions(final KeyEvent evt) {
    // Provide completions only if it's enabled
    if (JavaMode.codeCompletionsEnabled &&
        (JavaMode.ccTriggerEnabled ||
        (suggestion != null && suggestion.isVisible()))) {
      Messages.log("[KeyEvent]" + evt.getKeyChar() + "  |Prediction started");
      fetchPhrase();
    }
  }
Example 7
private void processControlSpace(final KeyEvent event) {
    if (event.getKeyCode() == KeyEvent.VK_SPACE && event.isControlDown()) {
      // Provide completions only if it's enabled
      if (JavaMode.codeCompletionsEnabled) {
        Messages.log("[KeyEvent]" + KeyEvent.getKeyText(event.getKeyCode()) + "  |Prediction started");
        fetchPhrase();
      }
    }
  }
Example 8
public Rectangle getTextLocation(TextHitInfo offset) {
    if (Base.DEBUG) {
      Messages.log("#Called getTextLocation:" + offset);
    }
    int line = textArea.getCaretLine();
    int offsetX = textArea.getCaretPosition() - textArea.getLineStartOffset(line);
    // '+1' mean textArea.lineToY(line) + textArea.getPainter().getFontMetrics().getHeight().
    // TextLayout#draw method need at least one height of font.
    Rectangle rectangle = new Rectangle(textArea.offsetToX(line, offsetX), textArea.lineToY(line + 1), 0, 0);

    Point location = textArea.getPainter().getLocationOnScreen();
    rectangle.translate(location.x, location.y);

    return rectangle;
  }
Example 9
public LineBreakpoint(LineID line, Debugger dbg) {
    this.line = line;
    line.startTracking(dbg.getEditor().getTab(line.fileName()).getDocument());
    this.dbg = dbg;
    this.className = className();
    set(); // activate the breakpoint (show highlight, attach if debugger is running)
    Messages.log("LBP Created " + toString() + " class: " + this.className);
  }