|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--BrowserModel
This class represents the state of the browser. That includes the current URL, the home URL, stacks of URLs used to go forward and backward, and the location of links in the current document.
Constructor Summary | |
BrowserModel(java.net.URL u)
Constructs a new BrowserModel . |
Method Summary | |
java.net.URL |
getBackwardURL()
Returns the URL that should be used if the user want's to go backward. |
java.net.URL |
getCurrentURL()
Returns the current URL. |
java.net.URL |
getForwardURL()
Returns the URL that should be used if the user want's to go forward. |
java.net.URL |
getHomeURL()
Returns the home URL. |
java.net.URL |
getURL(int x,
int y)
Returns the URL at ( x , y ). |
java.net.URL |
goBackward()
Goes backward. |
java.net.URL |
goForward()
Goes forward. |
java.net.URL |
goHome()
Goes home. |
java.net.URL |
goToNewURL(java.net.URL u)
Goes to a new URL. |
void |
registreLink(HyperLink l)
Inserts a {@ling HyperLink} in the list of current links. |
boolean |
seenLink(HyperLink l)
Reports if the URL in l has been seen before. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BrowserModel(java.net.URL u)
BrowserModel
.u
- the new home URL.Method Detail |
public void registreLink(HyperLink l)
l
- the new HyperLink
.public boolean seenLink(HyperLink l)
l
has been seen before.l
- the HyperLink
to check for.public java.net.URL getCurrentURL()
public java.net.URL getHomeURL()
public java.net.URL getForwardURL()
null
otherwise.public java.net.URL getBackwardURL()
null
otherwise.public java.net.URL getURL(int x, int y)
x
, y
).x
- the x
coordinate.y
- the y
coordinate.x
, y
) or
null
if there wasn't any URL at that point.public java.net.URL goToNewURL(java.net.URL u)
u
- the new URL. If it's null
, then no action
is taken.u
).public java.net.URL goHome()
public java.net.URL goForward()
null
if it wasn't
possible to go forward.public java.net.URL goBackward()
null
if it wasn't
possible to go backward.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |