Example usage for org.apache.commons.configuration FileConfiguration getInt

List of usage examples for org.apache.commons.configuration FileConfiguration getInt

Introduction

In this page you can find the example usage for org.apache.commons.configuration FileConfiguration getInt.

Prototype

int getInt(String key, int defaultValue);

Source Link

Document

Get a int associated with the given configuration key.

Usage

From source file:net.sourceforge.jukebox.model.Settings.java

/**
 * Load the contents of the configuration file.
 * @param configuration Configuration file
 *//*w ww .ja va  2 s .co m*/
public final void load(final FileConfiguration configuration) {
    this.contentFolder = configuration.getString(CONTENT_FOLDER);
    this.playerUrl = configuration.getString(PLAYER_URL);
    this.modifiedDays = configuration.getInt(MODIFIED_DAYS, DEFAULT_MODIFIED_DAYS);
}

From source file:org.parosproxy.paros.view.AbstractFrame.java

private void restoreLocationAdnSize() {
    if (frameName == null) {
        return;//from w w  w  .  j a v a 2s.  c  o  m
    }

    FileConfiguration config = loadConfig();
    String configName = "ui." + frameName;
    final int INVALID_VALUE = -10000;
    int left = config.getInt(configName + PROP_LEFT, INVALID_VALUE);
    int top = config.getInt(configName + PROP_TOP, INVALID_VALUE);
    int width = config.getInt(configName + PROP_WIDTH, 800);
    int height = config.getInt(configName + PROP_HEIGHT, 600);
    System.out.println("RESTORE " + frameName + "  " + left + "  " + top + "  " + width + "  " + height);
    setSize(width, height);
    if (left <= INVALID_VALUE || top <= INVALID_VALUE) {
        centerFrame();
    }

}