Package org.openscience.jmol.app
Class HistoryFile
java.lang.Object
org.openscience.jmol.app.HistoryFile
The history file contains data from previous uses of Jmol.
- Author:
- Bradley A. Smith (bradley@baysmith.com)
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) FileThe location of the history file.(package private) StringThe information written to the header of the history file.private PropertiesThe data stored in the history file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperties(Properties properties) Adds the given properties to the history.booleanaddProperty(String key, String value) Adds the given property to the history.private booleanaddWindowBorder(String name, Point border) Adds the window border to the history.private booleanaddWindowDim(String name, Dimension d) voidaddWindowInfo(String name, Component window, Point border) Adds the window informations to the history.voidaddWindowInfo(String name, Component window, Point border, Dimension d) voidaddWindowInnerInfo(String name, Component window, Dimension inner) private booleanaddWindowPosition(String name, Point position) Adds the window position to the history.private booleanaddWindowSize(String name, Dimension size) Adds the window size to the history.private booleanaddWindowVisibility(String name, boolean visible) Adds the window visibility to the history.voidclear()getFile()getProperty(String key, String defaultValue) Get the value of a propertygetWindowBorder(String name) getWindowPosition(String name) getWindowSize(String name) private BooleangetWindowVisibility(String name) private voidload()Loads properties from the history file.voidrepositionWindow(String name, Component window) Uses the informations in the history to reposition the window.voidrepositionWindow(String name, Component window, int minWidth, int minHeight, boolean allowVisible) Uses the informations in the history to reposition the window.voidsave()Saves properties to the history file.
-
Field Details
-
Constructor Details
-
HistoryFile
Creates a history file.- Parameters:
file- the location of the file.header- information written to the header of the file.
-
-
Method Details
-
addProperties
Adds the given properties to the history. If a property existed previously, it will be replaced.- Parameters:
properties- the properties to add.
-
getProperties
- Returns:
- The properties stored in the history file.
-
getProperty
Get the value of a property- Parameters:
key- Key of the property to finddefaultValue- Default value to use if the property is not found- Returns:
- The value of the property
-
addProperty
Adds the given property to the history. If it existed previously, it will be replaced.- Parameters:
key- Key of the property to addvalue- Value of the property- Returns:
- true if the property is modified
-
getWindowPosition
- Parameters:
name- Window name- Returns:
- Position of the window stored in the history file
-
getWindowInnerDimension
- Parameters:
name- Window name- Returns:
- Inner dimension of the window stored in the history file
-
getWindowBorder
- Parameters:
name- window name- Returns:
- window border stored in the history file
-
getWindowSize
- Parameters:
name- Window name- Returns:
- Size of the window stored in the history file
-
getWindowVisibility
- Parameters:
name- Window name- Returns:
- Visibility of the window stored in the history file
-
addWindowPosition
Adds the window position to the history. If it existed previously, it will be replaced.- Parameters:
name- Window nameposition- Window position- Returns:
- Tells if the properties are modified
-
addWindowBorder
Adds the window border to the history. If it existed previously, it will be replaced.- Parameters:
name- window nameborder- Window border- Returns:
- Tells if the properties are modified
-
addWindowDim
-
addWindowSize
Adds the window size to the history. If it existed previously, it will be replaced.- Parameters:
name- Window namesize- Window size- Returns:
- Tells if the properties are modified
-
addWindowVisibility
Adds the window visibility to the history. If it existed previously, it will be replaced.- Parameters:
name- Window namevisible- Window visibilite- Returns:
- Tells if the properties are modified
-
addWindowInfo
Adds the window informations to the history. If it existed previously, it will be replaced.- Parameters:
name- Window namewindow- Windowborder- Point border
-
addWindowInfo
-
addWindowInnerInfo
-
repositionWindow
public void repositionWindow(String name, Component window, int minWidth, int minHeight, boolean allowVisible) Uses the informations in the history to reposition the window.- Parameters:
name- Window namewindow- WindowminWidth-minHeight-allowVisible- TODO
-
repositionWindow
Uses the informations in the history to reposition the window.- Parameters:
name- Window namewindow- Window
-
getFile
-
load
private void load()Loads properties from the history file. -
save
public void save()Saves properties to the history file. -
clear
public void clear()
-