Package VASSAL.configure
Class FileConfigurer
java.lang.Object
VASSAL.configure.Configurer
VASSAL.configure.FileConfigurer
- Direct Known Subclasses:
AudioClipConfigurer
,DirectoryConfigurer
,ImageConfigurer
public class FileConfigurer extends Configurer
A Configurer for java.io.File values
-
Field Summary
Fields Modifier and Type Field Description protected ArchiveWriter
archive
protected boolean
editable
protected FileChooser
fc
protected JPanel
p
protected DirectoryConfigurer
startingDirectory
protected JTextField
tf
Fields inherited from class VASSAL.configure.Configurer
changeSupport, frozen, key, name, NAME_PROPERTY, noUpdate, value
-
Constructor Summary
Constructors Constructor Description FileConfigurer(String key, String name)
FileConfigurer(String key, String name, DirectoryConfigurer startingDirectory)
FileConfigurer(String key, String name, ArchiveWriter archive)
If a non-nullArchiveWriter
is used in the constructor, then invokingsetValue(java.lang.Object)
on this FileConfigurer will automatically add the file to the archive -
Method Summary
Modifier and Type Method Description protected void
addToArchive(File f)
void
chooseNewValue()
Component
getControls()
GUI interface for setting the option in an editing windowFile
getFileValue()
String
getValueString()
protected FileChooser
initFileChooser()
boolean
isEditable()
static void
main(String[] args)
void
setEditable(boolean editable)
void
setValue(Object o)
Set the Object valuevoid
setValue(String s)
Set the Object value from a StringMethods inherited from class VASSAL.configure.Configurer
addPropertyChangeListener, fireUpdate, getKey, getName, getValue, isFrozen, removePropertyChangeListener, setFrozen, setName
-
Field Details
-
archive
-
p
-
tf
-
fc
-
editable
protected boolean editable -
startingDirectory
-
-
Constructor Details
-
FileConfigurer
-
FileConfigurer
- Parameters:
key
-name
-startingDirectory
- If non-null, points to a preferences setting that specifies the starting directory for the "Select" button
-
FileConfigurer
If a non-nullArchiveWriter
is used in the constructor, then invokingsetValue(java.lang.Object)
on this FileConfigurer will automatically add the file to the archive
-
-
Method Details
-
initFileChooser
-
getValueString
- Specified by:
getValueString
in classConfigurer
- Returns:
- a String representation of the Object value
-
setValue
Description copied from class:Configurer
Set the Object value- Overrides:
setValue
in classConfigurer
-
addToArchive
-
setValue
Description copied from class:Configurer
Set the Object value from a String- Specified by:
setValue
in classConfigurer
-
getControls
Description copied from class:Configurer
GUI interface for setting the option in an editing window- Specified by:
getControls
in classConfigurer
-
chooseNewValue
public void chooseNewValue() -
getFileValue
-
main
-
isEditable
public boolean isEditable() -
setEditable
public void setEditable(boolean editable)
-