org.apache.batik.apps.svgbrowser

Class LocalHistory

public class LocalHistory extends Object

This class represents an history of the files visited by a single browser frame.
Nested Class Summary
protected classLocalHistory.RadioListener
To listen to the radio buttons.
Field Summary
protected ActionListeneractionListener
The action listener.
protected static intBACK_PENDING_STATE
protected intcurrentURI
The index of the current URI.
protected static intFORWARD_PENDING_STATE
protected ButtonGroupgroup
The button group for the menu items.
protected intindex
The index of the first history item in this menu.
protected JMenumenu
The menu which contains the history.
protected static intRELOAD_PENDING_STATE
protected intstate
The current state.
protected JSVGViewerFramesvgFrame
The frame to manage.
protected static intSTABLE_STATE
protected ListvisitedURIs
The visited URIs.
Constructor Summary
LocalHistory(JMenuBar mb, JSVGViewerFrame svgFrame)
Creates a new local history.
Method Summary
voidback()
Goes back of one position in the history.
booleancanGoBack()
Whether it is possible to go back.
booleancanGoForward()
Whether it is possible to go forward.
voidforward()
Goes forward of one position in the history.
voidreload()
Reloads the current document.
voidupdate(String uri)
Updates the history.
protected voidupdate()
Updates the state of this history.

Field Detail

actionListener

protected ActionListener actionListener
The action listener.

BACK_PENDING_STATE

protected static final int BACK_PENDING_STATE

currentURI

protected int currentURI
The index of the current URI.

FORWARD_PENDING_STATE

protected static final int FORWARD_PENDING_STATE

group

protected ButtonGroup group
The button group for the menu items.

index

protected int index
The index of the first history item in this menu.

menu

protected JMenu menu
The menu which contains the history.

RELOAD_PENDING_STATE

protected static final int RELOAD_PENDING_STATE

state

protected int state
The current state.

svgFrame

protected JSVGViewerFrame svgFrame
The frame to manage.

STABLE_STATE

protected static final int STABLE_STATE

visitedURIs

protected List visitedURIs
The visited URIs.

Constructor Detail

LocalHistory

public LocalHistory(JMenuBar mb, JSVGViewerFrame svgFrame)
Creates a new local history.

Parameters: mb The menubar used to display the history. It must contain one '@@@' item used as marker to place the history items. svgFrame The frame to manage.

Method Detail

back

public void back()
Goes back of one position in the history. Assumes that canGoBack() is true.

canGoBack

public boolean canGoBack()
Whether it is possible to go back.

canGoForward

public boolean canGoForward()
Whether it is possible to go forward.

forward

public void forward()
Goes forward of one position in the history. Assumes that canGoForward() is true.

reload

public void reload()
Reloads the current document.

update

public void update(String uri)
Updates the history.

Parameters: uri The URI of the document just loaded.

update

protected void update()
Updates the state of this history.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.