public class HistoryFile
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
(package private) java.io.File |
file |
The location of the history file.
|
(package private) java.lang.String |
header |
The information written to the header of the history file.
|
private java.util.Properties |
properties |
The data stored in the history file.
|
Constructor | Description |
---|---|
HistoryFile(java.io.File file,
java.lang.String header) |
Creates a history file.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addProperties(java.util.Properties properties) |
Adds the given properties to the history.
|
boolean |
addProperty(java.lang.String key,
java.lang.String value) |
Adds the given property to the history.
|
private boolean |
addWindowBorder(java.lang.String name,
java.awt.Point border) |
Adds the window border to the history.
|
void |
addWindowInfo(java.lang.String name,
java.awt.Component window,
java.awt.Point border) |
Adds the window informations to the history.
|
private boolean |
addWindowPosition(java.lang.String name,
java.awt.Point position) |
Adds the window position to the history.
|
private boolean |
addWindowSize(java.lang.String name,
java.awt.Dimension size) |
Adds the window size to the history.
|
private boolean |
addWindowVisibility(java.lang.String name,
boolean visible) |
Adds the window visibility to the history.
|
void |
clear() |
|
java.io.File |
getFile() |
|
java.util.Properties |
getProperties() |
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue) |
Get the value of a property
|
java.awt.Point |
getWindowBorder(java.lang.String name) |
|
java.awt.Point |
getWindowPosition(java.lang.String name) |
|
java.awt.Dimension |
getWindowSize(java.lang.String name) |
|
private java.lang.Boolean |
getWindowVisibility(java.lang.String name) |
|
private void |
load() |
Loads properties from the history file.
|
void |
repositionWindow(java.lang.String name,
java.awt.Component window) |
Uses the informations in the history to reposition the window.
|
void |
repositionWindow(java.lang.String name,
java.awt.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.
|
private java.util.Properties properties
java.io.File file
java.lang.String header
public HistoryFile(java.io.File file, java.lang.String header)
file
- the location of the file.header
- information written to the header of the file.public void addProperties(java.util.Properties properties)
properties
- the properties to add.public java.util.Properties getProperties()
public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
key
- Key of the property to finddefaultValue
- Default value to use if the property is not foundpublic boolean addProperty(java.lang.String key, java.lang.String value)
key
- Key of the property to addvalue
- Value of the propertypublic java.awt.Point getWindowPosition(java.lang.String name)
name
- Window namepublic java.awt.Point getWindowBorder(java.lang.String name)
name
- window namepublic java.awt.Dimension getWindowSize(java.lang.String name)
name
- Window nameprivate java.lang.Boolean getWindowVisibility(java.lang.String name)
name
- Window nameprivate boolean addWindowPosition(java.lang.String name, java.awt.Point position)
name
- Window nameposition
- Window positionprivate boolean addWindowBorder(java.lang.String name, java.awt.Point border)
name
- window nameborder
- Window borderprivate boolean addWindowSize(java.lang.String name, java.awt.Dimension size)
name
- Window namesize
- Window sizeprivate boolean addWindowVisibility(java.lang.String name, boolean visible)
name
- Window namevisible
- Window visibilitepublic void addWindowInfo(java.lang.String name, java.awt.Component window, java.awt.Point border)
name
- Window namewindow
- Windowborder
- Point borderpublic void repositionWindow(java.lang.String name, java.awt.Component window, int minWidth, int minHeight, boolean allowVisible)
name
- Window namewindow
- WindowminWidth
- minHeight
- allowVisible
- TODOpublic void repositionWindow(java.lang.String name, java.awt.Component window)
name
- Window namewindow
- Windowpublic java.io.File getFile()
private void load()
public void save()
public void clear()