dirk_krause.jtools
Class GuiController

java.lang.Object
  extended by dirk_krause.jtools.GuiController

public class GuiController
extends java.lang.Object

Control GUI. The GUI controller controls the look-and-feel of a GUI application.


Field Summary
static java.lang.String allApplications
          Application name for all applications
static java.lang.String guiPrefs
          Start string of preferences name
static java.lang.String[] lafNamesShort
          Key values for choosing the LAF
protected  boolean notYetInitialized
          Flag to indicate whether initialization was not yet done
static java.lang.String[] pk
          Preferences key
static java.lang.String unknownApplication
          The default application name
 
Constructor Summary
GuiController()
          Constructor without application name.
GuiController(java.lang.String applicationName)
          Constructor using application name.
 
Method Summary
 int getBorder()
          Retrieve current space between components.
protected  boolean getDoFontReplace()
          Check whether or not to replace fonts.
 java.lang.String getFontsUsed1()
           
 java.lang.String getFontsUsed2()
           
 boolean getHaveWindowPosition()
          Check whether the current window position is known.
protected  int getLafIndex()
          Get the LAF index.
 int getMinimumFontSize()
          Get the minimum font size.
protected  java.lang.String getReplaceNewName()
          Get new name for font replacement.
protected  java.lang.String getReplaceOldName()
          Get old name for font replacement.
 int getWindowPositionX()
          Get current window x position.
 int getWindowPositionY()
          Get the current window y position.
 void initialize()
           
 void setBorder(int bo)
          Set new component space.
protected  void setDoFontReplace(boolean f)
          Set font replacement flag.
protected  void setLafIndex(int n)
          Set new LAF index.
 void setMinimumFontSize(int nfs)
          Set the minimum font size.
protected  void setReplaceNewName(java.lang.String s)
          Set new name for font replacement.
protected  void setReplaceOldName(java.lang.String s)
          Set old name for font replacement.
 void setWindowPosition(int newx, int newy)
          Set the current window position
 void writeProperties(boolean forAll)
          Write settings back to preferences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unknownApplication

public static final java.lang.String unknownApplication
The default application name

See Also:
Constant Field Values

guiPrefs

public static final java.lang.String guiPrefs
Start string of preferences name

See Also:
Constant Field Values

allApplications

public static final java.lang.String allApplications
Application name for all applications

See Also:
Constant Field Values

lafNamesShort

public static final java.lang.String[] lafNamesShort
Key values for choosing the LAF


pk

public static final java.lang.String[] pk
Preferences key


notYetInitialized

protected boolean notYetInitialized
Flag to indicate whether initialization was not yet done

Constructor Detail

GuiController

public GuiController(java.lang.String applicationName)
Constructor using application name.

Parameters:
applicationName - The application name.

GuiController

public GuiController()
Constructor without application name. The default application name is used.

Method Detail

getLafIndex

protected int getLafIndex()
Get the LAF index.

Returns:
The LAF index.

setLafIndex

protected void setLafIndex(int n)
Set new LAF index.

Parameters:
n - The new LAF index.

writeProperties

public void writeProperties(boolean forAll)
Write settings back to preferences.

Parameters:
forAll - Flag to indicate whether or not to write preferences for all applications.

getHaveWindowPosition

public boolean getHaveWindowPosition()
Check whether the current window position is known.

Returns:
Boolean indicator flag.

getWindowPositionX

public int getWindowPositionX()
Get current window x position.

Returns:
The current x position.

getWindowPositionY

public int getWindowPositionY()
Get the current window y position.

Returns:
The current window y position.

setWindowPosition

public void setWindowPosition(int newx,
                              int newy)
Set the current window position

Parameters:
newx - The current x position.
newy - The current y position.

getBorder

public int getBorder()
Retrieve current space between components.

Returns:
The space to leave between two components.

setBorder

public void setBorder(int bo)
Set new component space.

Parameters:
bo - The new space value.

getMinimumFontSize

public int getMinimumFontSize()
Get the minimum font size.

Returns:
The minimum font size.

setMinimumFontSize

public void setMinimumFontSize(int nfs)
Set the minimum font size.

Parameters:
nfs - The new minimum font size.

getDoFontReplace

protected boolean getDoFontReplace()
Check whether or not to replace fonts.

Returns:
Flag indicating whether or not font replacement must be done.

setDoFontReplace

protected void setDoFontReplace(boolean f)
Set font replacement flag.

Parameters:
f - New value for flag.

getReplaceOldName

protected java.lang.String getReplaceOldName()
Get old name for font replacement.

Returns:
Font name of font to replace.

setReplaceOldName

protected void setReplaceOldName(java.lang.String s)
Set old name for font replacement.

Parameters:
s - Name of font to replace.

getReplaceNewName

protected java.lang.String getReplaceNewName()
Get new name for font replacement.

Returns:
New font name.

setReplaceNewName

protected void setReplaceNewName(java.lang.String s)
Set new name for font replacement.

Parameters:
s - New name of the font.

getFontsUsed1

public java.lang.String getFontsUsed1()

getFontsUsed2

public java.lang.String getFontsUsed2()

initialize

public void initialize()