|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodeblockutil.Navigator
public final class Navigator
A navigator navigates between different Explorers. Though the UI holds a common theme, each explorer may represent a unique subset of the whole. Basically, say we have a bunch of canvases (100). Say that we group the canvases into 5 explorers based on some quality and have each individual explorer independently control and display its own group of canvases. The problem we run into is how do we switch from one explorer to the next. There are many ways to do this. We can have buttons that makes unused explorers hidden. Or we have shrink them. This particular implementation chooses to slide them to the side. Now that you know why we need a navigator, let's talk about what a Navigator is. A Navigator lines up a set of explorers along the x-axis. It slides between the explorers until it reaches the end. That's it. Simple? Note however, that each explorer must be UNIQUE. NO EXCEPTIONS! That is, the name of a particular explorer may not be shared by any other explorers. This check rep. is made when adding new explorer. A Navigator unfortunately makes a once dangerous assumption: the name of each explorer must remain the same forever. If the name changes, then the invariant described in the previous paragraph no longer holds.
Nested Class Summary | |
---|---|
static class |
Navigator.Type
The UI options |
Constructor Summary | |
---|---|
Navigator()
Constructs new navigator with an empty collection of canvases. |
|
Navigator(Navigator.Type UIModel)
|
Method Summary | |
---|---|
void |
addExlorer(java.lang.String name)
Adds a new Explorer |
java.util.List<Explorer> |
getExplorers()
|
javax.swing.JComponent |
getJComponent()
|
javax.swing.JComponent |
getSwitcher()
|
boolean |
hasExplorer(java.lang.String name)
|
static void |
main(java.lang.String[] args)
Testing purposes |
void |
reformView()
redraws and revalidates the size and preferred size of the viewport and scroll pane to reflect the current collection of explorers. |
void |
removeExplorer(java.lang.String name)
Removes the explorer with the specified name. |
void |
setCanvas(java.util.List<? extends Canvas> canvases,
java.lang.String explorer)
Reassigns the canvases to the explorer with the specified name. |
void |
setView(java.lang.String name)
Sets the view to the explorer with the specified name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Navigator()
public Navigator(Navigator.Type UIModel)
Method Detail |
---|
public final void addExlorer(java.lang.String name)
name
- - the name of the new explorerpublic final void removeExplorer(java.lang.String name)
name
- public java.util.List<Explorer> getExplorers()
public boolean hasExplorer(java.lang.String name)
name
-
public void reformView()
public void setCanvas(java.util.List<? extends Canvas> canvases, java.lang.String explorer)
canvases
- explorer
- public void setView(java.lang.String name)
name
- public javax.swing.JComponent getJComponent()
public javax.swing.JComponent getSwitcher()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |