Package com.biglybt.ui.swt.skin
Class SWTSkin
- java.lang.Object
-
- com.biglybt.ui.swt.skin.SWTSkin
-
public class SWTSkin extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
autoSizeOnLayout
private boolean
bLayoutComplete
private org.eclipse.swt.graphics.Cursor
constructionCursor
private int
constructionDepth
private int
currentSkinObjectcreationCount
static boolean
DEBUG_VISIBILITIES
boolean
DEBUGLAYOUT
private static SWTSkin
default_instance
private static org.eclipse.swt.graphics.Cursor
handCursor
private static org.eclipse.swt.widgets.Listener
handCursorListener
private boolean
is_default
private CopyOnWriteList<SWTSkinLayoutCompleteListener>
listenersLayoutComplete
private java.util.HashMap<java.lang.String,SWTSkinObject[]>
mapIDsToSOs
private java.util.Map<SkinProperties,ImageLoader>
mapImageLoaders
private java.util.HashMap<java.lang.String,java.util.ArrayList<SWTSkinObjectListener>>
mapPublicViewIDsToListeners
private AEMonitor
mapPublicViewIDsToListeners_mon
private java.util.HashMap<java.lang.String,SWTSkinObject[]>
mapPublicViewIDsToSOs
private java.util.HashMap<java.lang.String,SWTSkinTabSet>
mapTabSetToControls
private AEMonitor
mon_MapIDsToSOs
private AEMonitor
mon_mapPublicViewIDsToSOs
private static SWTSkinObjectListener[]
NOLISTENERS
private java.util.ArrayList<SWTSkinObjectBasic>
ontopImages
private org.eclipse.swt.widgets.Composite
skinComposite
private SWTSkinProperties
skinProperties
private java.lang.String
startID
-
Constructor Summary
Constructors Modifier Constructor Description protected
SWTSkin()
private
SWTSkin(SWTSkinProperties skinProperties, boolean is_default)
protected
SWTSkin(java.lang.ClassLoader classLoader, java.lang.String skinPath, java.lang.String mainSkinFile)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private SWTSkinObjectTab
_createTab(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject)
SWTSkinObjectTab
activateTab(SWTSkinObject skinObjectInTab)
private void
addContainerChildren(SWTSkinObject skinObject, java.lang.String[] sItems, SWTSkinProperties properties)
void
addListener(SWTSkinLayoutCompleteListener l)
void
addListener(java.lang.String viewID, SWTSkinObjectListener listener)
void
addSkinObject(SWTSkinObject skinObject)
void
addToControlMap(SWTSkinObject skinObject)
private void
addToSOArrayMap(java.util.Map<java.lang.String,SWTSkinObject[]> arrayMap, AEMonitor mon, java.lang.String key, SWTSkinObject object)
(package private) void
attachControl(SWTSkinObject skinObject)
void
constructionEnd()
void
constructionStart()
private SWTSkinObject
createBrowser(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject)
private SWTSkinObject
createButton(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createCheckbox(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createClone(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createCombo(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createContainer(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] sTypeParams, SWTSkinObject parentSkinObject, boolean bForceCreate, boolean bPropogate, SWTSkinObject intoSkinObject)
private SWTSkinObject
createContainer2(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject, boolean bForceCreate, boolean bPropogate, SWTSkinObject intoSkinObject)
private SWTSkinObject
createExpandBar(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createExpandItem(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createImageLabel(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createImageLabel2(SWTSkinProperties properties, java.lang.String sConfigID, SWTSkinObject parentSkinObject)
private SWTSkinObject
createList(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createMySash(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject, boolean bVertical)
private SWTSkinObject
createSash(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject, boolean bVertical)
private SWTSkinObject
createSeparator(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
SWTSkinObject
createSkinObject(java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject)
SWTSkinObject
createSkinObject(java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject, java.lang.Object datasource)
Create a skin object based off an existing config "template"private SWTSkinObject
createSlider(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
SWTSkinObjectTab
createTab(java.lang.String sID, java.lang.String sTemplateKey, SWTSkinObject tabHolder)
Create a tab using a template.private SWTSkinObject
createTabFolder(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createTextbox(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createTextLabel(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createToggle(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
private SWTSkinObject
createUnattachedView(java.lang.String viewID, SWTSkinObject parent)
static void
disposeDefault()
private void
disposeSkin()
protected static SWTSkin
getDefaultInstance()
private java.lang.Object
getFromSOArrayMap(java.util.Map<java.lang.String,SWTSkinObject[]> arrayMap, java.lang.Object key, SWTSkinObject parent)
protected static org.eclipse.swt.widgets.Listener
getHandCursorListener(org.eclipse.swt.widgets.Display display)
ImageLoader
getImageLoader(SkinProperties properties)
org.eclipse.swt.widgets.Composite
getShell()
java.lang.String
getSkinID()
SWTSkinObject
getSkinObject(java.lang.String sViewID)
SWTSkinObject
getSkinObject(java.lang.String sViewID, SWTSkinObject parent)
SWTSkinObject
getSkinObjectByID(java.lang.String sID)
SWTSkinObject
getSkinObjectByID(java.lang.String sID, SWTSkinObject parent)
SWTSkinObjectListener[]
getSkinObjectListeners(java.lang.String viewID)
SWTSkinProperties
getSkinProperties()
SWTSkinTabSet
getTabSet(SWTSkinObject skinObject)
SWTSkinTabSet
getTabSet(java.lang.String sID)
private boolean
hasSkinObject(SWTSkinObject start, SWTSkinObject skinObject)
void
initialize(org.eclipse.swt.widgets.Composite skincomp, java.lang.String startID)
void
initialize(org.eclipse.swt.widgets.Composite skincomp, java.lang.String startID, IUIIntializer uiInitializer)
boolean
isAutoSizeOnLayout()
boolean
isCreatingSO()
boolean
isLayoutComplete()
void
layout()
void
layout(SWTSkinObject soStart)
private void addPaintListenerToAll(Control control) { // XXX: Bug: When paint listener is set to shell, browser widget will flicker on OSX when resizing if (!(control instanceof Shell)) { control.addListener(SWT.Paint, ontopPaintListener); } if (control instanceof Composite) { Composite composite = (Composite) control; Control[] children = composite.getChildren(); for (int i = 0; i < children.length; i++) { addPaintListenerToAll(children[i]); } } }private SWTSkinObject
linkIDtoParent(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject, boolean bForceCreate, boolean bAddView, java.lang.Object datasource)
static void
main(java.lang.String[] args)
void
removeListener(java.lang.String viewID, SWTSkinObjectListener listener)
void
removeSkinObject(SWTSkinObject skinObject)
boolean
setActiveTab(java.lang.String sTabSetID, java.lang.String sTabViewID)
void
setAutoSizeOnLayout(boolean autoSizeOnLayout)
private void
setSkinObjectViewID(SWTSkinObject skinObject, java.lang.String sViewID)
void
triggerLanguageChange()
-
-
-
Field Detail
-
DEBUG_VISIBILITIES
public static final boolean DEBUG_VISIBILITIES
- See Also:
- Constant Field Values
-
NOLISTENERS
private static final SWTSkinObjectListener[] NOLISTENERS
-
default_instance
private static SWTSkin default_instance
-
DEBUGLAYOUT
public boolean DEBUGLAYOUT
-
mapImageLoaders
private java.util.Map<SkinProperties,ImageLoader> mapImageLoaders
-
skinProperties
private final SWTSkinProperties skinProperties
-
is_default
private final boolean is_default
-
handCursorListener
private static org.eclipse.swt.widgets.Listener handCursorListener
-
handCursor
private static org.eclipse.swt.graphics.Cursor handCursor
-
mapIDsToSOs
private java.util.HashMap<java.lang.String,SWTSkinObject[]> mapIDsToSOs
-
mon_MapIDsToSOs
private AEMonitor mon_MapIDsToSOs
-
mapTabSetToControls
private java.util.HashMap<java.lang.String,SWTSkinTabSet> mapTabSetToControls
-
mapPublicViewIDsToSOs
private java.util.HashMap<java.lang.String,SWTSkinObject[]> mapPublicViewIDsToSOs
-
mon_mapPublicViewIDsToSOs
private AEMonitor mon_mapPublicViewIDsToSOs
-
mapPublicViewIDsToListeners
private java.util.HashMap<java.lang.String,java.util.ArrayList<SWTSkinObjectListener>> mapPublicViewIDsToListeners
-
mapPublicViewIDsToListeners_mon
private AEMonitor mapPublicViewIDsToListeners_mon
-
ontopImages
private java.util.ArrayList<SWTSkinObjectBasic> ontopImages
-
skinComposite
private org.eclipse.swt.widgets.Composite skinComposite
-
bLayoutComplete
private boolean bLayoutComplete
-
listenersLayoutComplete
private CopyOnWriteList<SWTSkinLayoutCompleteListener> listenersLayoutComplete
-
currentSkinObjectcreationCount
private int currentSkinObjectcreationCount
-
startID
private java.lang.String startID
-
autoSizeOnLayout
private boolean autoSizeOnLayout
-
constructionDepth
private int constructionDepth
-
constructionCursor
private org.eclipse.swt.graphics.Cursor constructionCursor
-
-
Constructor Detail
-
SWTSkin
protected SWTSkin()
-
SWTSkin
protected SWTSkin(java.lang.ClassLoader classLoader, java.lang.String skinPath, java.lang.String mainSkinFile)
-
SWTSkin
private SWTSkin(SWTSkinProperties skinProperties, boolean is_default)
-
-
Method Detail
-
getDefaultInstance
protected static SWTSkin getDefaultInstance()
-
getSkinID
public java.lang.String getSkinID()
-
getImageLoader
public ImageLoader getImageLoader(SkinProperties properties)
-
addToControlMap
public void addToControlMap(SWTSkinObject skinObject)
-
addToSOArrayMap
private void addToSOArrayMap(java.util.Map<java.lang.String,SWTSkinObject[]> arrayMap, AEMonitor mon, java.lang.String key, SWTSkinObject object)
-
getFromSOArrayMap
private java.lang.Object getFromSOArrayMap(java.util.Map<java.lang.String,SWTSkinObject[]> arrayMap, java.lang.Object key, SWTSkinObject parent)
-
setSkinObjectViewID
private void setSkinObjectViewID(SWTSkinObject skinObject, java.lang.String sViewID)
-
getSkinObjectByID
public SWTSkinObject getSkinObjectByID(java.lang.String sID)
-
getSkinObjectByID
public SWTSkinObject getSkinObjectByID(java.lang.String sID, SWTSkinObject parent)
-
getSkinObject
public SWTSkinObject getSkinObject(java.lang.String sViewID)
-
createUnattachedView
private SWTSkinObject createUnattachedView(java.lang.String viewID, SWTSkinObject parent)
- Parameters:
viewID
-- Returns:
- Since:
- 3.1.1.1
-
getSkinObject
public SWTSkinObject getSkinObject(java.lang.String sViewID, SWTSkinObject parent)
-
getTabSet
public SWTSkinTabSet getTabSet(java.lang.String sID)
-
activateTab
public SWTSkinObjectTab activateTab(SWTSkinObject skinObjectInTab)
-
hasSkinObject
private boolean hasSkinObject(SWTSkinObject start, SWTSkinObject skinObject)
-
getTabSet
public SWTSkinTabSet getTabSet(SWTSkinObject skinObject)
-
setActiveTab
public boolean setActiveTab(java.lang.String sTabSetID, java.lang.String sTabViewID)
-
initialize
public void initialize(org.eclipse.swt.widgets.Composite skincomp, java.lang.String startID)
- Since:
- 3.0.5.3
-
initialize
public void initialize(org.eclipse.swt.widgets.Composite skincomp, java.lang.String startID, IUIIntializer uiInitializer)
-
disposeSkin
private void disposeSkin()
- Since:
- 4.0.0.5
-
layout
public void layout(SWTSkinObject soStart)
private void addPaintListenerToAll(Control control) { // XXX: Bug: When paint listener is set to shell, browser widget will flicker on OSX when resizing if (!(control instanceof Shell)) { control.addListener(SWT.Paint, ontopPaintListener); } if (control instanceof Composite) { Composite composite = (Composite) control; Control[] children = composite.getChildren(); for (int i = 0; i < children.length; i++) { addPaintListenerToAll(children[i]); } } }
-
layout
public void layout()
-
attachControl
void attachControl(SWTSkinObject skinObject)
-
createContainer
private SWTSkinObject createContainer(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] sTypeParams, SWTSkinObject parentSkinObject, boolean bForceCreate, boolean bPropogate, SWTSkinObject intoSkinObject)
-
addContainerChildren
private void addContainerChildren(SWTSkinObject skinObject, java.lang.String[] sItems, SWTSkinProperties properties)
-
createSash
private SWTSkinObject createSash(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject, boolean bVertical)
-
createMySash
private SWTSkinObject createMySash(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject, boolean bVertical)
-
createTab
public SWTSkinObjectTab createTab(java.lang.String sID, java.lang.String sTemplateKey, SWTSkinObject tabHolder)
Create a tab using a template.(objectid).view.template.(sTemplateKey)=(Reference to Template skin object)
- Parameters:
sID
- ID to give the new tabsTemplateKey
- Template Key to read to get the tab's template skin objecttabHolder
- Where to read the template key from- Returns:
- The new tab, or null if tab could not be created
-
_createTab
private SWTSkinObjectTab _createTab(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject)
-
createTextLabel
private SWTSkinObject createTextLabel(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createSlider
private SWTSkinObject createSlider(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
getShell
public org.eclipse.swt.widgets.Composite getShell()
-
getHandCursorListener
protected static org.eclipse.swt.widgets.Listener getHandCursorListener(org.eclipse.swt.widgets.Display display)
-
createSkinObject
public SWTSkinObject createSkinObject(java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject)
-
constructionStart
public void constructionStart()
-
constructionEnd
public void constructionEnd()
-
createSkinObject
public SWTSkinObject createSkinObject(java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject, java.lang.Object datasource)
Create a skin object based off an existing config "template"- Parameters:
sID
- ID of new skin objectsConfigID
- config id to use to create new skin objectparentSkinObject
- location to place new skin object in- Returns:
- new skin object
-
addSkinObject
public void addSkinObject(SWTSkinObject skinObject)
-
removeSkinObject
public void removeSkinObject(SWTSkinObject skinObject)
- Parameters:
skinObject
-- Since:
- 3.0.1.3
-
linkIDtoParent
private SWTSkinObject linkIDtoParent(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject, boolean bForceCreate, boolean bAddView, java.lang.Object datasource)
-
createButton
private SWTSkinObject createButton(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
- Parameters:
properties
-id
-configID
-typeParams
-parentSkinObject
-- Returns:
- Since:
- 3.1.1.1
-
createCheckbox
private SWTSkinObject createCheckbox(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createToggle
private SWTSkinObject createToggle(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createExpandBar
private SWTSkinObject createExpandBar(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createExpandItem
private SWTSkinObject createExpandItem(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createTextbox
private SWTSkinObject createTextbox(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createCombo
private SWTSkinObject createCombo(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createList
private SWTSkinObject createList(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createTabFolder
private SWTSkinObject createTabFolder(SWTSkinProperties properties, java.lang.String id, java.lang.String configID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createBrowser
private SWTSkinObject createBrowser(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject)
- Parameters:
properties
-sID
-sConfigID
-parentSkinObject
-- Returns:
-
createClone
private SWTSkinObject createClone(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createImageLabel
private SWTSkinObject createImageLabel(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
createContainer2
private SWTSkinObject createContainer2(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, SWTSkinObject parentSkinObject, boolean bForceCreate, boolean bPropogate, SWTSkinObject intoSkinObject)
-
createImageLabel2
private SWTSkinObject createImageLabel2(SWTSkinProperties properties, java.lang.String sConfigID, SWTSkinObject parentSkinObject)
-
createSeparator
private SWTSkinObject createSeparator(SWTSkinProperties properties, java.lang.String sID, java.lang.String sConfigID, java.lang.String[] typeParams, SWTSkinObject parentSkinObject)
-
getSkinProperties
public SWTSkinProperties getSkinProperties()
-
addListener
public void addListener(java.lang.String viewID, SWTSkinObjectListener listener)
-
removeListener
public void removeListener(java.lang.String viewID, SWTSkinObjectListener listener)
-
getSkinObjectListeners
public SWTSkinObjectListener[] getSkinObjectListeners(java.lang.String viewID)
-
isLayoutComplete
public boolean isLayoutComplete()
-
addListener
public void addListener(SWTSkinLayoutCompleteListener l)
-
main
public static void main(java.lang.String[] args)
-
isCreatingSO
public boolean isCreatingSO()
-
triggerLanguageChange
public void triggerLanguageChange()
- Since:
- 3.1.1.1
-
setAutoSizeOnLayout
public void setAutoSizeOnLayout(boolean autoSizeOnLayout)
-
isAutoSizeOnLayout
public boolean isAutoSizeOnLayout()
-
disposeDefault
public static void disposeDefault()
-
-