# Class HistoryFile

java.lang.Object
org.openscience.jmol.app.HistoryFile

public class HistoryFile extends Object
The history file contains data from previous uses of Jmol.

Author:
  Bradley A. Smith (bradley@baysmith.com)

## Constructor Summary

Constructors
Constructor
Description
`HistoryFile(File file, String header)`
Creates a history file.

## Method Summary

Modifier and Type
Method
Description
`void`
`addProperties(Properties properties)`
Adds the given properties to the history.
`boolean`
`addProperty(String key, String value)`
Adds the given property to the history.
`void`
`addWindowInfo(String name, Component window, Point border)`
Adds the window informations to the history.
`void`
`addWindowInfo(String name, Component window, Point border, Dimension d)`
`void`
`addWindowInnerInfo(String name, Component window, Dimension inner)`
`void`
`clear()`
`File`
`getFile()`
`Properties`
`getProperties()`
`String`
`getProperty(String key, String defaultValue)`
Get the value of a property
`Point`
`getWindowBorder(String name)`
`Dimension`
`getWindowInnerDimension(String name)`
`Point`
`getWindowPosition(String name)`
`Dimension`
`getWindowSize(String name)`
`void`
`repositionWindow(String name, Component window)`
Uses the informations in the history to reposition the window.
`void`
`repositionWindow(String name, Component window, int minWidth, int minHeight, boolean allowVisible)`
Uses the informations in the history to reposition the window.
`void`
`save()`
Saves properties to the history file.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### HistoryFile

public HistoryFile(File file, String header)
Creates a history file.

Parameters:
  `file` - the location of the file.
  `header` - information written to the header of the file.

## Method Details

### addProperties

public void addProperties(Properties properties)
Adds the given properties to the history. If a property existed previously, it will be replaced.

Parameters:
  `properties` - the properties to add.

### getProperties

public Properties getProperties()

Returns:
  The properties stored in the history file.

### getProperty

public String getProperty(String key, String defaultValue)
Get the value of a property

Parameters:
  `key` - Key of the property to find
  `defaultValue` - Default value to use if the property is not found
Returns:
  The value of the property

### addProperty

public boolean addProperty(String key, String value)
Adds the given property to the history. If it existed previously, it will be replaced.

Parameters:
  `key` - Key of the property to add
  `value` - Value of the property
Returns:
  true if the property is modified

### getWindowPosition

public Point getWindowPosition(String name)

Parameters:
  `name` - Window name
Returns:
  Position of the window stored in the history file

### getWindowInnerDimension

public Dimension getWindowInnerDimension(String name)

Parameters:
  `name` - Window name
Returns:
  Inner dimension of the window stored in the history file

### getWindowBorder

public Point getWindowBorder(String name)

Parameters:
  `name` - window name
Returns:
  window border stored in the history file

### getWindowSize

public Dimension getWindowSize(String name)

Parameters:
  `name` - Window name
Returns:
  Size of the window stored in the history file

### addWindowInfo

public void addWindowInfo(String name, Component window, Point border)
Adds the window informations to the history. If it existed previously, it will be replaced.

Parameters:
  `name` - Window name
  `window` - Window
  `border` - Point border

### addWindowInfo

public void addWindowInfo(String name, Component window, Point border, Dimension d)

### addWindowInnerInfo

public void addWindowInnerInfo(String name, Component window, Dimension inner)

### 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 name
  `window` - Window
  `minWidth` -
  `minHeight` -
  `allowVisible` - TODO

### repositionWindow

public void repositionWindow(String name, Component window)
Uses the informations in the history to reposition the window.

Parameters:
  `name` - Window name
  `window` - Window

### getFile

public File getFile()

### save

public void save()
Saves properties to the history file.

### clear

public void clear()