com.exponto.jstock.io
Class UserPreferences

java.lang.Object
  extended bycom.exponto.jstock.io.UserPreferences

public class UserPreferences
extends java.lang.Object

Takes care of the properties file. It is terrible long and rather boring to update, but not much exiting goes on here. It is just needed to get data in and out of the properties file. Note that this is a singleton object in order to prevent that several instances is used/updated at the same time, use getInstance() to get a the instance

Author:
kaare

Field Summary
static java.lang.String enableURLPropertyName
           
static java.lang.String fileFormatPropertyName
           
static java.lang.String numberOfDaysPropertyName
           
static java.lang.String urlPropertyName
           
 
Method Summary
 int getBMargin()
           
 int getClosePos()
           
 java.lang.String getDateFormat()
           
 int getDatePos()
           
 java.lang.String getDbHost()
           
 java.lang.String getDbName()
           
 java.lang.String getDbPW()
          Security wise this is not a very good idea, but the password is stored in clear text.
 java.lang.String getDbUser()
           
 boolean getDrawMode()
           
 boolean getEnableDB()
           
 boolean getEnablePos()
           
 java.lang.String getExchange()
           
 java.lang.String getExtension()
           
 java.lang.String getFilePath()
           
 int getHighPos()
           
static UserPreferences getInstance()
           
 java.lang.String getJdbcDriver()
           
 int getLMargin()
           
 int getLowPos()
           
 int getMinorLineLevel()
           
 boolean getNotes()
           
 int getOpenPos()
           
 int getPixelPrStick()
           
 java.lang.String getProperty(java.lang.String name)
           
 java.lang.Boolean getPropertyBooleanValue(java.lang.String name)
           
 java.lang.Integer getPropertyIntValue(java.lang.String name)
           
 int getRMargin()
           
 double getScalingFactorChartVolume()
           
 boolean getShowWeekly()
           
 int getTMargin()
           
 java.awt.Dimension getUserDim()
           
 int getVolumePos()
           
 int getXSize()
           
 int getYSize()
           
 void saveAll()
          Saves all properties to the properties file.
 void setClosePos(int i)
           
 void setClosePos(java.lang.String s)
           
 void setDateFormat(java.lang.String string)
           
 void setDatePos(int i)
           
 void setDatePos(java.lang.String s)
           
 void setDbHost(java.lang.String string)
           
 void setDbName(java.lang.String string)
           
 void setDbPW(java.lang.String string)
           
 void setDbUser(java.lang.String string)
           
 void setDrawMode(boolean b)
           
 void setEnableDB(boolean b)
           
 void setEnablePos(boolean b)
           
 void setExchange(java.lang.String string)
          Set the default exchange
 void setExtension(java.lang.String string)
           
 void setFilePath(java.lang.String string)
           
 void setHighPos(int i)
           
 void setHighPos(java.lang.String s)
           
 void setJdbcDriver(java.lang.String string)
           
 void setLowPos(int i)
           
 void setLowPos(java.lang.String s)
           
 void setMinorLineLevel(int i)
           
 void setMinorLineLevel(java.lang.String s)
           
 void setNotes(boolean b)
           
 void setOpenPos(int i)
           
 void setOpenPos(java.lang.String s)
           
 void setPixelPrStick(int i)
           
 void setPixelPrStick(java.lang.String s)
           
 void setProperty(java.lang.String name, java.lang.String value)
           
 void setScalingFactorChartVolume(double d)
           
 void setShowWeekly(boolean b)
           
 void setVolumePos(int i)
           
 void setVolumePos(java.lang.String s)
           
 void setXSize(int i)
           
 void setYSize(int i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

urlPropertyName

public static final java.lang.String urlPropertyName
See Also:
Constant Field Values

numberOfDaysPropertyName

public static final java.lang.String numberOfDaysPropertyName
See Also:
Constant Field Values

enableURLPropertyName

public static final java.lang.String enableURLPropertyName
See Also:
Constant Field Values

fileFormatPropertyName

public static final java.lang.String fileFormatPropertyName
See Also:
Constant Field Values
Method Detail

getInstance

public static UserPreferences getInstance()

getProperty

public java.lang.String getProperty(java.lang.String name)

getPropertyIntValue

public java.lang.Integer getPropertyIntValue(java.lang.String name)

getPropertyBooleanValue

public java.lang.Boolean getPropertyBooleanValue(java.lang.String name)

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)

getUserDim

public java.awt.Dimension getUserDim()

getFilePath

public java.lang.String getFilePath()

getExtension

public java.lang.String getExtension()

getLMargin

public int getLMargin()

getRMargin

public int getRMargin()

getTMargin

public int getTMargin()

getBMargin

public int getBMargin()

getMinorLineLevel

public int getMinorLineLevel()

setMinorLineLevel

public void setMinorLineLevel(int i)

setMinorLineLevel

public void setMinorLineLevel(java.lang.String s)

getDrawMode

public boolean getDrawMode()

setDrawMode

public void setDrawMode(boolean b)

getShowWeekly

public boolean getShowWeekly()

setShowWeekly

public void setShowWeekly(boolean b)

getNotes

public boolean getNotes()

setNotes

public void setNotes(boolean b)

getPixelPrStick

public int getPixelPrStick()

setPixelPrStick

public void setPixelPrStick(int i)

setPixelPrStick

public void setPixelPrStick(java.lang.String s)

getYSize

public int getYSize()

setYSize

public void setYSize(int i)

getXSize

public int getXSize()

setXSize

public void setXSize(int i)

getScalingFactorChartVolume

public double getScalingFactorChartVolume()

setScalingFactorChartVolume

public void setScalingFactorChartVolume(double d)

getEnablePos

public boolean getEnablePos()

setEnablePos

public void setEnablePos(boolean b)

getDatePos

public int getDatePos()

setDatePos

public void setDatePos(int i)

setDatePos

public void setDatePos(java.lang.String s)

getDateFormat

public java.lang.String getDateFormat()

setDateFormat

public void setDateFormat(java.lang.String string)
Parameters:
string - Format of the dates

getOpenPos

public int getOpenPos()

setOpenPos

public void setOpenPos(int i)

setOpenPos

public void setOpenPos(java.lang.String s)

getHighPos

public int getHighPos()

setHighPos

public void setHighPos(int i)

setHighPos

public void setHighPos(java.lang.String s)

getLowPos

public int getLowPos()

setLowPos

public void setLowPos(int i)

setLowPos

public void setLowPos(java.lang.String s)

getClosePos

public int getClosePos()

setClosePos

public void setClosePos(int i)

setClosePos

public void setClosePos(java.lang.String s)

getVolumePos

public int getVolumePos()

setVolumePos

public void setVolumePos(int i)

setVolumePos

public void setVolumePos(java.lang.String s)

saveAll

public void saveAll()
Saves all properties to the properties file.


getExchange

public java.lang.String getExchange()
Returns:
the default exchange name

setExchange

public void setExchange(java.lang.String string)
Set the default exchange

Parameters:
string - default exchange

getEnableDB

public boolean getEnableDB()

setEnableDB

public void setEnableDB(boolean b)

getJdbcDriver

public java.lang.String getJdbcDriver()
Returns:
the jdbc driver to use

setJdbcDriver

public void setJdbcDriver(java.lang.String string)
Parameters:
string - the jdbc driver to set

getDbHost

public java.lang.String getDbHost()
Returns:
the db host

getDbName

public java.lang.String getDbName()
Returns:
the db name

getDbPW

public java.lang.String getDbPW()
Security wise this is not a very good idea, but the password is stored in clear text.

Returns:
the db password

getDbUser

public java.lang.String getDbUser()
Returns:
the db user.

setDbHost

public void setDbHost(java.lang.String string)
Parameters:
string - the db host

setDbName

public void setDbName(java.lang.String string)
Parameters:
string - the db name

setDbPW

public void setDbPW(java.lang.String string)
Parameters:
string - the db password

setDbUser

public void setDbUser(java.lang.String string)
Parameters:
string - the db user

setExtension

public void setExtension(java.lang.String string)
Parameters:
string - the file extension

setFilePath

public void setFilePath(java.lang.String string)
Parameters:
string - the filepath


Copyright © 2004 Kaare Ranum