net.sf.jomic.common
Class Settings

java.lang.Object
  extended by java.util.Dictionary
      extended by java.util.Hashtable
          extended by java.util.Properties
              extended by net.sf.jomic.tools.BasicSettings
                  extended by net.sf.jomic.tools.ImageRenderSettings
                      extended by net.sf.jomic.common.ComicSheetRenderSettings
                          extended by net.sf.jomic.common.Settings
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, java.util.Map

public final class Settings
extends ComicSheetRenderSettings
implements java.beans.PropertyChangeListener

Settings for Jomic. These are collected as Properties, and can be read from or written to a settings file.

Author:
Thomas Aglassinger
See Also:
read(File), write(File), Serialized Form

Field Summary
static int MAX_BLUR_RADIUS
           
static int MAX_BLUR_THRESHOLD
           
static int MIN_BLUR_RADIUS
           
static int MIN_BLUR_THRESHOLD
           
 
Fields inherited from class net.sf.jomic.common.ComicSheetRenderSettings
ROTATE_ONLY_SINGLE_PORTRAIT_IMAGES, SHOW_TWO_PAGES, SWAP_LEFT_AND_RIGHT_IMAGE
 
Fields inherited from class net.sf.jomic.tools.ImageRenderSettings
DEFAULT_FILL_COLOR, DEFAULT_ROTATION, DEFAULT_SCALE_MODE, FILL_COLOR, MAX_ROTATION, MIN_ROTATION, ROTATION, SCALE_MODE, SELECTION_COLOR
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
Settings(java.util.Properties defaults)
           
 
Method Summary
 void addRecentFile(java.io.File file, int page)
           
 void applyComicWindow(java.awt.Component component)
           
 void clearRecentFiles()
           
 boolean getAdjustArchiveSuffix()
           
 java.io.File getArchiveCache()
           
 int getArchiveCacheSizeInMb()
          Get tile cache size (in mega byte).
 java.lang.String getBlurMode()
           
 int getBlurRadius()
           
 int getBlurThreshold()
           
 java.io.File getCacheDir()
          Get the base cache directory, where all the caches are stored.
 java.io.File getCacheDir(java.lang.String name)
          Get the cache directory name in the base cache directory.
 int getFew()
           
 java.io.File getImageIOCache()
           
 java.io.File getLastCreateComicSourceDir()
           
 java.io.File getLastCreateComicTargetDir()
           
 java.io.File getLastExportAllImagesDir()
           
 java.io.File getLastExportedImageDir()
           
 java.lang.String getLocale()
           
 java.io.File getMostRecentFile()
          Get the most recently opened file, or null no recent file has ever been opened (typically when using Jomic the first time after installation).
 int getMostRecentPage()
          Get the most recently opened file, or null no recent file has ever been opened (typically when using Jomic the first time after installation).
 boolean getOpenInFullScreen()
           
 boolean getOpenNewComic()
           
 int getRecentCount()
           
 java.util.List getRecentFiles()
           
 int getScrollCount()
           
 java.io.File getSettingsFile()
          Gets the file where the settings are stored.
 boolean getShowInfo()
           
 boolean getShowThumbs()
           
 boolean getShowToolbar()
           
 java.lang.String getSortMode()
           
 int getTileCacheSizeInMb()
          Get tile cache size (in mega byte).
static Settings instance()
           
 void propertyChange(java.beans.PropertyChangeEvent event)
           
 void read(java.io.File file)
           
 void resetComicFrame()
           
 void setAdjustArchiveSuffix(boolean newAdjustArchiveSuffix)
           
 void setBlurMode(java.lang.String newBlurMode)
           
 void setBlurRadius(int newBlurRadius)
           
 void setBlurThreshold(int newBlurThreshold)
           
 void setComicWindow(java.awt.Component component)
           
 void setLastCreateComicSourceDir(java.io.File newSourceDir)
           
 void setLastCreateComicTargetDir(java.io.File newTargetDir)
           
 void setLastExportAllImagesDir(java.io.File newDir)
           
 void setLastExportedImageDir(java.io.File newImageDir)
           
 void setLocale(java.lang.String newLocale)
           
 void setMostRecentPage(int newMostRecentPage)
          Get the most recently opened file, or null no recent file has ever been opened (typically when using Jomic the first time after installation).
 void setOpenInFullScreen(boolean newOpenInFullScreen)
           
 void setOpenNewComic(boolean newOpenNewComic)
           
 void setShowInfo(boolean newShowInfo)
           
 void setShowThumbs(boolean newShowThumbs)
           
 void setShowToolbar(boolean newShowToolbar)
           
 void setUseBlur(boolean newUseBlur)
           
 boolean useBlur()
           
 void write(java.io.File settingsFile)
           
 
Methods inherited from class net.sf.jomic.common.ComicSheetRenderSettings
getRotateOnlySinglePortraitImages, getSwapLeftAndRightImage, getTwoPageMode, setRotateOnlySinglePortraitImages, setSwapLeftAndRightImage, setTwoPageMode
 
Methods inherited from class net.sf.jomic.tools.ImageRenderSettings
getFillColor, getRotation, getScaleMode, getSelectionColor, rotateLeft, rotateRight, setFillColor, setRotation, setScaleMode, setSelectionColor
 
Methods inherited from class net.sf.jomic.tools.BasicSettings
addPropertyChangeListener, addPropertyChangeListener, applyComponentAreaProperty, clear, firePropertyChangeEvent, getBooleanProperty, getChoiceProperty, getColorProperty, getFileProperty, getIntProperty, getLimitedIntProperty, getProperty, getProperty, getSystemPropertyName, isValidPropertyName, remove, removePropertyChangeListener, removePropertyChangeListener, setBooleanProperty, setChoiceProperty, setColorProperty, setComponentAreaProperty, setDefault, setDefault, setDefault, setFileProperty, setIntProperty, setLimitedIntProperty, setProperty, setSystemPropertyPrefix
 
Methods inherited from class java.util.Properties
list, list, load, load, loadFromXML, propertyNames, save, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_BLUR_RADIUS

public static final int MAX_BLUR_RADIUS
See Also:
Constant Field Values

MAX_BLUR_THRESHOLD

public static final int MAX_BLUR_THRESHOLD
See Also:
Constant Field Values

MIN_BLUR_RADIUS

public static final int MIN_BLUR_RADIUS
See Also:
Constant Field Values

MIN_BLUR_THRESHOLD

public static final int MIN_BLUR_THRESHOLD
See Also:
Constant Field Values
Constructor Detail

Settings

public Settings(java.util.Properties defaults)
Method Detail

setAdjustArchiveSuffix

public void setAdjustArchiveSuffix(boolean newAdjustArchiveSuffix)

setBlurMode

public void setBlurMode(java.lang.String newBlurMode)

setBlurRadius

public void setBlurRadius(int newBlurRadius)

setBlurThreshold

public void setBlurThreshold(int newBlurThreshold)

setComicWindow

public void setComicWindow(java.awt.Component component)

setLastCreateComicSourceDir

public void setLastCreateComicSourceDir(java.io.File newSourceDir)

setLastCreateComicTargetDir

public void setLastCreateComicTargetDir(java.io.File newTargetDir)

setLastExportAllImagesDir

public void setLastExportAllImagesDir(java.io.File newDir)

setLastExportedImageDir

public void setLastExportedImageDir(java.io.File newImageDir)

setLocale

public void setLocale(java.lang.String newLocale)

setMostRecentPage

public void setMostRecentPage(int newMostRecentPage)
Get the most recently opened file, or null no recent file has ever been opened (typically when using Jomic the first time after installation).


setOpenInFullScreen

public void setOpenInFullScreen(boolean newOpenInFullScreen)

setOpenNewComic

public void setOpenNewComic(boolean newOpenNewComic)

setShowInfo

public void setShowInfo(boolean newShowInfo)

setShowThumbs

public void setShowThumbs(boolean newShowThumbs)

setShowToolbar

public void setShowToolbar(boolean newShowToolbar)

setUseBlur

public void setUseBlur(boolean newUseBlur)

getAdjustArchiveSuffix

public boolean getAdjustArchiveSuffix()

getArchiveCache

public java.io.File getArchiveCache()
                             throws java.io.IOException
Throws:
java.io.IOException

getArchiveCacheSizeInMb

public int getArchiveCacheSizeInMb()
Get tile cache size (in mega byte).


getBlurMode

public java.lang.String getBlurMode()

getBlurRadius

public int getBlurRadius()

getBlurThreshold

public int getBlurThreshold()

getCacheDir

public java.io.File getCacheDir(java.lang.String name)
                         throws java.io.FileNotFoundException
Get the cache directory name in the base cache directory. If the directory does not exist yet, create it.

Throws:
java.io.FileNotFoundException

getCacheDir

public java.io.File getCacheDir()
                         throws java.io.FileNotFoundException
Get the base cache directory, where all the caches are stored.

Throws:
java.io.FileNotFoundException

getFew

public int getFew()

getImageIOCache

public java.io.File getImageIOCache()
                             throws java.io.IOException
Throws:
java.io.IOException

getLastCreateComicSourceDir

public java.io.File getLastCreateComicSourceDir()

getLastCreateComicTargetDir

public java.io.File getLastCreateComicTargetDir()

getLastExportAllImagesDir

public java.io.File getLastExportAllImagesDir()

getLastExportedImageDir

public java.io.File getLastExportedImageDir()

getLocale

public java.lang.String getLocale()

getMostRecentFile

public java.io.File getMostRecentFile()
Get the most recently opened file, or null no recent file has ever been opened (typically when using Jomic the first time after installation).


getMostRecentPage

public int getMostRecentPage()
Get the most recently opened file, or null no recent file has ever been opened (typically when using Jomic the first time after installation).


getOpenInFullScreen

public boolean getOpenInFullScreen()

getOpenNewComic

public boolean getOpenNewComic()

getRecentCount

public int getRecentCount()

getRecentFiles

public java.util.List getRecentFiles()

getScrollCount

public int getScrollCount()

getSettingsFile

public java.io.File getSettingsFile()
Gets the file where the settings are stored.


getShowInfo

public boolean getShowInfo()

getShowThumbs

public boolean getShowThumbs()

getShowToolbar

public boolean getShowToolbar()

getSortMode

public java.lang.String getSortMode()

getTileCacheSizeInMb

public int getTileCacheSizeInMb()
Get tile cache size (in mega byte).


instance

public static Settings instance()

addRecentFile

public void addRecentFile(java.io.File file,
                          int page)

applyComicWindow

public void applyComicWindow(java.awt.Component component)

clearRecentFiles

public void clearRecentFiles()

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

read

public void read(java.io.File file)
          throws java.io.IOException
Throws:
java.io.IOException

resetComicFrame

public void resetComicFrame()

useBlur

public boolean useBlur()

write

public void write(java.io.File settingsFile)
           throws java.io.IOException
Throws:
java.io.IOException