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