org.opensubsystems.core.application.swt
Class ResourceManager

java.lang.Object
  extended by org.opensubsystems.core.application.swt.ResourceManager

public class ResourceManager
extends java.lang.Object

Class, which manages SWT resources so they can be properly released.

Version:
$Id: ResourceManager.java,v 1.2 2007/01/07 06:14:22 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Field Summary
static int BIG_BUTTON_FONT_HEIGHT
          Height of font used for big size buttons.
static int BIG_COMBO_FONT_HEIGHT
          Height of font used for big size combo boxes.
static int BIG_LIST_FONT_HEIGHT
          Height of font used for big size list boxes.
static int BIG_TAB_FOLDER_FONT_HEIGHT
          Height of font used for big size list boxes.
static int BIG_TABLE_FONT_HEIGHT
          Height of font used for big size tables.
static int BIG_TEXT_FONT_HEIGHT
          Height of font used for big size texts.
protected  org.eclipse.swt.graphics.Font m_bigButtonFont
          Font used for big size buttons.
protected  org.eclipse.swt.graphics.Font m_bigComboFont
          Font used for big size combos.
protected  org.eclipse.swt.graphics.Font m_bigLabelFont
          Font used for big size labels.
protected  org.eclipse.swt.graphics.Font m_bigListFont
          Font used for big size lists.
protected  org.eclipse.swt.graphics.Font m_bigTabFolderFont
          Font used for big size tabs in tab folder.
protected  org.eclipse.swt.graphics.Font m_bigTableFont
          Font used for big size tables.
protected  org.eclipse.swt.graphics.Font m_bigTextFont
          Font used for big size texts.
protected  org.eclipse.swt.graphics.Image m_blankImage
          Image to user for "hidden" cursor.
protected  org.eclipse.swt.graphics.Cursor m_defaultCursor
          Cursor displayed by default.
protected  org.eclipse.swt.graphics.Font m_middleButtonFont
          Font used for middle size buttons.
protected  org.eclipse.swt.graphics.Font m_middleLabelFont
          Font used for middle size labels.
protected  org.eclipse.swt.graphics.Cursor m_waitCursor
          Cursor displayed when user waits.
static int MIDDLE_BUTTON_FONT_HEIGHT
          Height of font used for middle size buttons.
static int MIDDLE_TEXT_FONT_HEIGHT
          Height of font used for middle size texts.
 
Constructor Summary
ResourceManager()
           
 
Method Summary
static ResourceManager getInstance()
          Get the default instance.
 void releaseResources()
          Release all allocated resources.
 void setBigButtonFont(org.eclipse.swt.widgets.Button bigButton)
          Set big font for specified button.
 void setBigComboTextFont(org.eclipse.swt.widgets.Combo bigCombo)
          Set big font for specified combo.
 void setBigLabelFont(org.eclipse.swt.widgets.Label bigLabel)
          Set big font for specified label.
 void setBigListTextFont(org.eclipse.swt.widgets.List bigList)
          Set big font for specified list.
 void setBigTabFolderFont(org.eclipse.swt.widgets.TabFolder bigTabFolder)
          Set big font for specified tab folder
 void setBigTableFont(org.eclipse.swt.widgets.Table bigTable)
          Set big font for specified table.
 void setBigTextFont(org.eclipse.swt.widgets.Text bigText)
          Set big font for specified text.
 void setDefaultCursor(org.eclipse.swt.widgets.Control ctlControl)
          Set the default cursor for given control
 void setDefaultCursor(org.eclipse.swt.widgets.Shell window)
          Set the default cursor for given shell
 void setHiddenDefaultCursor(org.eclipse.swt.widgets.Display defaultDisplay)
          Set the default cursor to be hidden to make it easier for people on two touchscreen system to do not find for the cursor.
static void setInstance(ResourceManager defaultInstance)
          Set default instance.
 void setMiddleButtonFont(org.eclipse.swt.widgets.Button middleButton)
          Set middle font for specified button.
 void setMiddleLabelFont(org.eclipse.swt.widgets.Label middleLabel)
          Set middle font for specified label.
 void setTableTextFont(org.eclipse.swt.widgets.Text bigText)
          Set table like font for specified text.
 void setWaitCursor(org.eclipse.swt.widgets.Control ctlControl)
          Set the wait cursor for given control
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIDDLE_BUTTON_FONT_HEIGHT

public static final int MIDDLE_BUTTON_FONT_HEIGHT
Height of font used for middle size buttons.

See Also:
Constant Field Values

BIG_BUTTON_FONT_HEIGHT

public static final int BIG_BUTTON_FONT_HEIGHT
Height of font used for big size buttons.

See Also:
Constant Field Values

MIDDLE_TEXT_FONT_HEIGHT

public static final int MIDDLE_TEXT_FONT_HEIGHT
Height of font used for middle size texts.

See Also:
Constant Field Values

BIG_TEXT_FONT_HEIGHT

public static final int BIG_TEXT_FONT_HEIGHT
Height of font used for big size texts.

See Also:
Constant Field Values

BIG_TABLE_FONT_HEIGHT

public static final int BIG_TABLE_FONT_HEIGHT
Height of font used for big size tables.

See Also:
Constant Field Values

BIG_COMBO_FONT_HEIGHT

public static final int BIG_COMBO_FONT_HEIGHT
Height of font used for big size combo boxes.

See Also:
Constant Field Values

BIG_LIST_FONT_HEIGHT

public static final int BIG_LIST_FONT_HEIGHT
Height of font used for big size list boxes.

See Also:
Constant Field Values

BIG_TAB_FOLDER_FONT_HEIGHT

public static final int BIG_TAB_FOLDER_FONT_HEIGHT
Height of font used for big size list boxes.

See Also:
Constant Field Values

m_middleButtonFont

protected org.eclipse.swt.graphics.Font m_middleButtonFont
Font used for middle size buttons.


m_bigButtonFont

protected org.eclipse.swt.graphics.Font m_bigButtonFont
Font used for big size buttons.


m_bigTextFont

protected org.eclipse.swt.graphics.Font m_bigTextFont
Font used for big size texts.


m_bigTableFont

protected org.eclipse.swt.graphics.Font m_bigTableFont
Font used for big size tables.


m_bigComboFont

protected org.eclipse.swt.graphics.Font m_bigComboFont
Font used for big size combos.


m_bigListFont

protected org.eclipse.swt.graphics.Font m_bigListFont
Font used for big size lists.


m_middleLabelFont

protected org.eclipse.swt.graphics.Font m_middleLabelFont
Font used for middle size labels.


m_bigLabelFont

protected org.eclipse.swt.graphics.Font m_bigLabelFont
Font used for big size labels.


m_bigTabFolderFont

protected org.eclipse.swt.graphics.Font m_bigTabFolderFont
Font used for big size tabs in tab folder.


m_waitCursor

protected org.eclipse.swt.graphics.Cursor m_waitCursor
Cursor displayed when user waits.


m_defaultCursor

protected org.eclipse.swt.graphics.Cursor m_defaultCursor
Cursor displayed by default.


m_blankImage

protected org.eclipse.swt.graphics.Image m_blankImage
Image to user for "hidden" cursor.

Constructor Detail

ResourceManager

public ResourceManager()
Method Detail

getInstance

public static ResourceManager getInstance()
Get the default instance.

Returns:
ResourceManager

setInstance

public static void setInstance(ResourceManager defaultInstance)
Set default instance. This instance will be returned by getInstance method until it is changed.

Parameters:
defaultInstance - - new default controller instance
See Also:
getInstance()

releaseResources

public void releaseResources()
Release all allocated resources.


setMiddleButtonFont

public void setMiddleButtonFont(org.eclipse.swt.widgets.Button middleButton)
Set middle font for specified button.

Parameters:
middleButton - - button to set font for

setBigTabFolderFont

public void setBigTabFolderFont(org.eclipse.swt.widgets.TabFolder bigTabFolder)
Set big font for specified tab folder

Parameters:
bigTabFolder - - tab folder to set font for

setBigButtonFont

public void setBigButtonFont(org.eclipse.swt.widgets.Button bigButton)
Set big font for specified button.

Parameters:
bigButton - - button to set font for

setBigTextFont

public void setBigTextFont(org.eclipse.swt.widgets.Text bigText)
Set big font for specified text.

Parameters:
bigText - - text to set font for

setTableTextFont

public void setTableTextFont(org.eclipse.swt.widgets.Text bigText)
Set table like font for specified text.

Parameters:
bigText - - text to set font for

setBigComboTextFont

public void setBigComboTextFont(org.eclipse.swt.widgets.Combo bigCombo)
Set big font for specified combo.

Parameters:
bigCombo - - combo to set font for

setBigListTextFont

public void setBigListTextFont(org.eclipse.swt.widgets.List bigList)
Set big font for specified list.

Parameters:
bigList - - combo to set font for

setBigTableFont

public void setBigTableFont(org.eclipse.swt.widgets.Table bigTable)
Set big font for specified table.

Parameters:
bigTable - - table to set font for

setMiddleLabelFont

public void setMiddleLabelFont(org.eclipse.swt.widgets.Label middleLabel)
Set middle font for specified label.

Parameters:
middleLabel - - label to set font for

setBigLabelFont

public void setBigLabelFont(org.eclipse.swt.widgets.Label bigLabel)
Set big font for specified label.

Parameters:
bigLabel - - label to set font for

setWaitCursor

public void setWaitCursor(org.eclipse.swt.widgets.Control ctlControl)
Set the wait cursor for given control

Parameters:
ctlControl - - control to set the cursor for

setDefaultCursor

public void setDefaultCursor(org.eclipse.swt.widgets.Control ctlControl)
Set the default cursor for given control

Parameters:
ctlControl - - control to set the cursor for

setDefaultCursor

public void setDefaultCursor(org.eclipse.swt.widgets.Shell window)
Set the default cursor for given shell

Parameters:
window - - shell to set the cursor for

setHiddenDefaultCursor

public void setHiddenDefaultCursor(org.eclipse.swt.widgets.Display defaultDisplay)
Set the default cursor to be hidden to make it easier for people on two touchscreen system to do not find for the cursor. This will make it very small so it is almost invisible.

Parameters:
defaultDisplay - - display which is used


Copyright © 2003 - 2006 OpenSubsystems s.r.o.