1 |
// (c): Matti J. Katila |
// (c): Matti J. Katila |
2 |
|
|
3 |
|
|
4 |
package org.nongnu.libvob.buoy; |
package org.nongnu.libvob.buoy; |
5 |
import org.nongnu.libvob.VobScene; |
import org.nongnu.libvob.VobScene; |
6 |
|
|
7 |
|
/** An interface for managing the buoy links, focus main node and |
8 |
/** The manager for buoys and focus view ports. |
* the construction of base coordinate systems related to buoy view. |
9 |
|
* Basicly the manager constructs activated coordinate systems |
10 |
|
* for focus, main node, and for every buoy links. |
11 |
|
* <p> |
12 |
|
* The information of buoys, i.e. buoy anchor, node type etc., |
13 |
|
* are needed afterwards when user clicks any of the buoys to |
14 |
|
* perform an action. |
15 |
*/ |
*/ |
16 |
public interface BuoyManager { |
public interface BuoyManager extends BuoyLinkListener { |
17 |
|
|
18 |
/** Folow the buoy link that is given. |
/** Represantion of anchor object rendered with some node type. |
19 |
* BuoyManager implementation should interpolate |
* Buoy implementation should be memory efficient |
20 |
* the old buoy to main view port and |
* and this implies that it's not clear that reference of buoy, |
21 |
* old main view port to new buoy. |
* which you asked from BuoyManager, is same after new draw is done. |
22 |
*/ |
*/ |
23 |
void followLink(Buoy buoy); |
public interface Buoy { |
24 |
|
|
25 |
|
/** Get the node type of this buoy. |
26 |
|
*/ |
27 |
|
BuoyViewNodeType getNodeType(); |
28 |
|
|
29 |
|
/** Get the link identification which is |
30 |
|
* used in interpolations. The identification must be unique |
31 |
|
* to get proper interpolation. |
32 |
|
*/ |
33 |
|
Object getLinkId(); |
34 |
|
|
35 |
|
|
36 |
|
/** Get the anchor inside of this buoy. |
37 |
|
* The anchor is the object which was the reason to render this buoy. |
38 |
|
*/ |
39 |
|
Object getBuoyAnchor(); |
40 |
|
|
41 |
|
|
42 |
|
/** Get the coordinate system of this buoy. |
43 |
|
* The cs is given and activated by BuoyManager and the node type |
44 |
|
* of this Buoy renders into it. |
45 |
|
*/ |
46 |
|
int getBuoyCS(); |
47 |
|
|
48 |
/** Draw the focus view port and buoys around it. |
/** Get the direction of this buoy. If direction > 0 |
49 |
|
* buoy is on the rigth side, else the buoy is on the left side. |
50 |
|
*/ |
51 |
|
int getDirection(); |
52 |
|
} |
53 |
|
|
54 |
|
|
55 |
|
/** Moves the focus to given buoy with interpolation from old buoy to new focus. |
56 |
|
* If the Buoy is not from this BuoyManager an error is thrown. |
57 |
|
* The old focus view port should be interpolated to new buoy. |
58 |
|
*/ |
59 |
|
void moveFocusTo(Buoy buoy); |
60 |
|
|
61 |
|
/** Draw the focus main node. While rendering BuoyViewMainNode |
62 |
|
* BuoyManager get buoys with LinkListener's call back |
63 |
|
* interface which it implements. The buoys must not be rendered |
64 |
|
* while call back linking but after every link, because |
65 |
|
* main node might render into stenciled buffer. |
66 |
* @param into The coordinate system where the focus is drawn. |
* @param into The coordinate system where the focus is drawn. |
67 |
*/ |
*/ |
68 |
void drawScene(VobScene vs, int into); |
void draw(VobScene vs, int into); |
69 |
|
|
70 |
/** Returns the main node view. |
/** Returns the focused main node. |
71 |
*/ |
*/ |
72 |
BuoyViewMainNode getViewMainNode(); |
BuoyViewMainNode getMainNode(); |
73 |
|
|
74 |
/** Return the buoy if it's associated with this manager |
/** Return the buoy found by coordinate system. |
75 |
* by given coordinate system, otherwise returns null. |
* To found the buoy which is clicked, ask activated |
76 |
|
* coordinate system from VobScene. If coordinate system |
77 |
|
* is not constructed in this BuoyManager, null is returned. |
78 |
*/ |
*/ |
79 |
Buoy getBuoy(int cs); |
Buoy getBuoy(int cs); |
80 |
|
|
81 |
} |
} |
82 |
|
|