Skip to content

Commit

Permalink
Added support for setting a boolean property
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Luc Paour committed May 8, 2003
1 parent 7df62c2 commit 4e62ab1
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions com/gallery/GalleryRemote/GalleryProperties.java
Expand Up @@ -72,7 +72,7 @@ public GalleryProperties( ) {}
*@return The currentDirectory value
*/
public File getCurrentDirectory() {
String currentDirectory = (String) getProperty( "filedialogPath" );
String currentDirectory = getProperty( "filedialogPath" );
if ( currentDirectory != null ) {
return new File( currentDirectory );
} else {
Expand Down Expand Up @@ -305,6 +305,10 @@ public boolean getBooleanProperty( String name ) {
}
}

public void setBooleanProperty( String name, boolean value ) {
setProperty( name, value?"true":"false" );
}


/**
* Gets the intProperty attribute of the PropertiesFile object
Expand All @@ -329,7 +333,7 @@ public int getIntProperty( String name ) {
*@param value The new intProperty value
*/
public void setIntProperty( String name, int value ) {
setProperty( name, String.valueOf( (int) value ) );
setProperty( name, String.valueOf( value ) );
}


Expand Down Expand Up @@ -410,7 +414,7 @@ public void logProperties(int level, String module) {
ArrayList names = new ArrayList(100);
Enumeration e = propertyNames();
while (e.hasMoreElements()) {
names.add( (String) e.nextElement() );
names.add( e.nextElement() );
}

Object[] namesArray = names.toArray();
Expand All @@ -421,5 +425,11 @@ public void logProperties(int level, String module) {
Log.log(level, module, name + "= |" + getProperty(name) + "|");
}
}

public void uncache() {
thumbnailSize = null;
mainBounds = null;
previewBounds = null;
}
}

0 comments on commit 4e62ab1

Please sign in to comment.