|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.skeleton.swt.commands.SwtPreferenceHelper
Helper class providing utility methods for setting the preferences within applications based on the SWT windowing toolkit.
These methods are typically needed twice:
SwtPreferenceHelper class also provides some settings like last used directory
necessary for file dialogs.
See getCurrentDirectory().
| Constructor Summary | |
SwtPreferenceHelper(ApplicationFrame frame)
Constructor specifying the ApplicationFrame. |
|
| Method Summary | |
void |
applyGridSettings()
Applies the settings given by the preferences to the CompositeViewGrid object of the view. |
void |
applyGridSettings(GraphDocument document)
Applies the grid settings stored into the ApplicationFrame's
preferences to the passed GraphDocument.
|
void |
applyRulerSettings()
Applies the settings given by the preferences to the CompositeViewRuler object of the view. |
void |
applyRulerSettings(GraphDocument document)
Applies the ruler settings stored into the ApplicationFrame's
preferences to the passed GraphDocument.
|
void |
changeNavigatorPanelRendererAttribute(java.lang.String name,
boolean value)
Sets an attribute on the AttributeSet that
is returned by the NavigatorPanel class
statically and which can be used to adjust the
RendererConfigurationC that is used by all
NavigatorPanels. |
void |
changeSwtGraphPanelRendererAttribute(java.lang.String name,
boolean value)
Sets an attribute on the AttributeSet that
is returned by the SwingGraphPanel class
statically and which can be used to adjust the
RendererConfigurationC that is used by all
SwingGraphPanels during user-interaction. |
protected ApplicationFrame |
getApplicationFrame()
Returns the instance of ApplicationFrame. |
java.io.File |
getCurrentDirectory()
Returns the current directory of this application. |
void |
initCurrentDirectory()
Initializes the currently used directory. |
void |
initFrameSizeAndPosition()
Initializes the size and the position of the top level frame to the values found in the preferences. |
void |
initToolbarVisibilties()
Called at Application start to initialize the visibilities of the Toolbar. |
void |
navigatorPanelSetUpdateDuringActing(boolean update)
Sets the setUpdateDuringActing() property on the SwtNavigator. |
void |
setCurrentDirectory(java.io.File directory)
Sets the currently used directory. |
void |
setLanguage(java.lang.String value)
Sets the used language to the one specified by value. |
void |
setLookAndFeel(java.lang.String laf)
Deprecated. Setting a new look and feel is not relevant for SWT based applications, therefore this method is deprecated and throws a RuntimeException. |
void |
setSubMenuRecentlyUsed(org.eclipse.swt.widgets.Menu menu)
Sets the Sub-Menu for the recenlty used files to the given Menu. |
void |
setTooltipsEnabled(boolean b)
Enables the tooltips if b is true. |
protected void |
updateNavigatorContainer()
Updates the navigator container. |
void |
updateRecentlyUsedFilesMenu(ApplicationFrame applicationFrame)
Updates the menu of recently used files. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SwtPreferenceHelper(ApplicationFrame frame)
ApplicationFrame.
frame - the ApplicationFrame of the application.| Method Detail |
public void setLanguage(java.lang.String value)
value.
setLanguage in interface PreferenceHelpvalue - a string defining the language to be used.public void setLookAndFeel(java.lang.String laf)
RuntimeException.
value.
setLookAndFeel in interface PreferenceHelplaf - a string defining the look and feel to be used.public void setTooltipsEnabled(boolean b)
true.
setTooltipsEnabled in interface PreferenceHelpb - true, if tooltips should be displayed.public void setSubMenuRecentlyUsed(org.eclipse.swt.widgets.Menu menu)
Menu.
menu - the Menu to set.public void updateRecentlyUsedFilesMenu(ApplicationFrame applicationFrame)
applicationFrame - the ApplicationFrame.public java.io.File getCurrentDirectory()
getCurrentDirectory in interface PreferenceHelppublic void setCurrentDirectory(java.io.File directory)
setCurrentDirectory in interface PreferenceHelpdirectory - the directory to set.public void initFrameSizeAndPosition()
initFrameSizeAndPosition in interface PreferenceHelppublic void initCurrentDirectory()
initCurrentDirectory in interface PreferenceHelp
public void changeSwtGraphPanelRendererAttribute(java.lang.String name,
boolean value)
AttributeSet that
is returned by the SwingGraphPanel class
statically and which can be used to adjust the
RendererConfigurationC that is used by all
SwingGraphPanels during user-interaction.
name - of the renderer-configuration item to change.value - boolean-value to change the renderer-configuration item to.protected void updateNavigatorContainer()
SwtNavigatorContainer.update(Observable, Object)public void navigatorPanelSetUpdateDuringActing(boolean update)
update - true if the SwtNavigator should be updated
while dragging, false otherwise.
public void changeNavigatorPanelRendererAttribute(java.lang.String name,
boolean value)
AttributeSet that
is returned by the NavigatorPanel class
statically and which can be used to adjust the
RendererConfigurationC that is used by all
NavigatorPanels.
name - of the renderer-configuration item to change.value - boolean-value to change the renderer-configuration item to.public void applyRulerSettings()
CompositeViewRuler object of the view.
applyRulerSettings in interface PreferenceHelppublic void applyGridSettings()
CompositeViewGrid object of the view.
applyGridSettings in interface PreferenceHelppublic void applyRulerSettings(GraphDocument document)
ApplicationFrame's
preferences to the passed GraphDocument.
Note that if no Preferences are retrieved some default
values are used.
applyRulerSettings in interface PreferenceHelpdocument - the GraphDocument for which the ruler has to be
setup.public void applyGridSettings(GraphDocument document)
ApplicationFrame's
preferences to the passed GraphDocument.
Note that if no Preferences are retrieved some default
values are used.
applyGridSettings in interface PreferenceHelpdocument - the GraphDocument for which the grid has to be
setup.public void initToolbarVisibilties()
initToolbarVisibilties in interface PreferenceHelpprotected ApplicationFrame getApplicationFrame()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||