|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.fenfire.loom.WheelView
A simple wheel view. Example:
neg1 | neg2 \ / pos1 neg3 - focus - pos2 neg4 / \ pos3 neg5 |
Field Summary | |
static boolean |
dbg
|
protected int |
gapx
|
protected int |
gapy
|
protected int |
maxDepth
How deeply should the structure be shown. |
protected double |
maxrota
Maximum rotation angle. |
protected Vob |
negConn
|
protected Vob |
negStub
|
protected NodeView |
nodeView
The view used to show the individual nodes. |
protected Vob |
posConn
Connection and Stub vobs for both two directions. |
protected Vob |
posStub
|
protected int |
radius
|
protected int |
sizex
Dimensions XXX gapy has currently no effect, should be used to determine the minimum rotation angle. |
protected int |
sizey
Dimensions XXX gapy has currently no effect, should be used to determine the minimum rotation angle. |
Constructor Summary | |
WheelView(NodeView nodeView)
|
|
WheelView(NodeView nodeView,
int maxDepth)
WheelView |
Method Summary | |
protected java.util.Collection |
getNodes(Cursor c,
int dir)
|
protected java.util.Collection |
getNodes(Cursor c,
Resource node,
int dir)
Get pairs of nodes and their properties in given direction |
protected double |
getRotationAngle(Cursor c,
java.util.Collection nodes,
double angle,
int depth)
Calculates rotation angle for a collection of nodes. |
protected int |
getSubNodeCount(Cursor c,
java.util.Collection nodes,
int depth)
Recursive function to calculate all the subconnections in some direction. |
void |
render(VobScene sc,
int into,
Cursor c)
View render function |
protected void |
renderDepth(VobScene sc,
int into,
int focusCs,
Cursor c,
Pair focus,
Pair oldFocus,
int dir,
double starta,
double rota,
float r,
int midx,
int midy,
int depth)
Determines how the next depth should be drawn and finally calls renderSomewardConnections. |
void |
renderSomewardConnections(VobScene sc,
int into,
int focusCs,
Cursor c,
Pair focus,
Pair oldFocus,
java.util.Collection nodes,
int before,
int dir,
double starta,
double rota,
float r,
int midx,
int midy,
int depth)
Render either posward or negward connections (or onward, maybe). |
protected int |
x(double angle,
float radius)
Calculates x from the origo. |
protected int |
y(double angle,
float radius)
Calculates y from the origo. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean dbg
protected NodeView nodeView
protected final Vob posConn
protected final Vob negConn
protected final Vob posStub
protected final Vob negStub
protected int sizex
protected int sizey
protected int gapx
protected int gapy
protected int radius
protected int maxDepth
protected double maxrota
Constructor Detail |
public WheelView(NodeView nodeView, int maxDepth)
nodeView
- The view used to show the individual nodes.maxDepth
- How deeply should the structure be shown. Equal
or greater than zero.public WheelView(NodeView nodeView)
Method Detail |
public void renderSomewardConnections(VobScene sc, int into, int focusCs, Cursor c, Pair focus, Pair oldFocus, java.util.Collection nodes, int before, int dir, double starta, double rota, float r, int midx, int midy, int depth)
sc
- VobScene to draw the view into.into
- The parent coordinate system transformation to use.focusCs
- The CS transformation used to place the focuced
node of the previous drawing depth.c
- The main cursor, set to the globally focused node of the view.focus
- Pair containing the focused cell of current drawing
depth and property, which connects its to the previously
locally focused node.oldFocus
- Pair containing the focused node of the previous
drawing depth and property, which connects its to the
currently locally focused node.nodes
- Collection, which contains pairs of all the nodes and their
properties to be drawn on this depth. One exception: drawing
of the oldFocus pair is skipped and an empty place is left
instead.before
- How many nodes should be drawn before the selected one.dir
- Is the current collection of nodes located to either positive
or negative direction from the focused node.starta
- The angle between focused node and the selected node
of current nodes collection.rota
- The rotation angle between drawn nodes in curren collection.r
- The radius of drawn nodes from the coordinate (midx, midy).midx
- The x coordinate of the center of the wheel.midy
- The y coordinate of the center of the wheel.depth
- The Current drawing depth. Depth is increased by one, when
proceeding deeper. When maxDepth is achieved, stubs are
drawn instead of nodes in the current collection.protected void renderDepth(VobScene sc, int into, int focusCs, Cursor c, Pair focus, Pair oldFocus, int dir, double starta, double rota, float r, int midx, int midy, int depth)
sc
- VobScene to draw the view into.into
- The parent coordinate system transformation to use.focusCs
- The CS transformation used to place the focuced
node of the previous drawing depth.c
- The main cursor, set to the globally focused node of the view.focus
- Pair containing the focused cell of current drawing
depth and property, which connects its to the previously
locally focused node.oldFocus
- Pair containing the focused node of the previous
drawing depth and property, which connects its to the
currently locally focused node.dir
- Is the current collection of nodes located to either positive
or negative direction from the focused node.starta
- The angle between focused node and the selected node
of curren nodes collection.rota
- The rotation angle between drawn nodes in curren collection.r
- The radius of drawn nodes from the coordinate (midx, midy).midx
- The x coordinate of the center of the wheel.midy
- The y coordinate of the center of the wheel.depth
- The Current drawing depth. Depth is increased by one, when
proceeding deeper.public void render(VobScene sc, int into, Cursor c)
render
in interface View
sc
- VobScene to draw the view into.into
- The parent coordinate system transformation to use.c
- The main cursor, set to the globally focused node of the view.protected double getRotationAngle(Cursor c, java.util.Collection nodes, double angle, int depth)
c
- The main cursor, set to the globally focused node of the view.nodes
- Collection, which contains pairs of all the nodes and their
properties to be drawn on this depth.angle
- The angle of space available for all the nodes in current collection.depth
- The Current drawing depth. Depth is increased by one, when
proceeding deeper.
protected java.util.Collection getNodes(Cursor c, Resource node, int dir)
c
- The main cursor, set to the globally focused node of the view.node
- The resource reprecenting the focused node.dir
- The direction from the given node to fetch connected nodes.
Zero is interpreted as the both directions.
protected java.util.Collection getNodes(Cursor c, int dir)
protected int getSubNodeCount(Cursor c, java.util.Collection nodes, int depth)
c
- The main cursor, set to the globally focused node of the view.nodes
- Collection, which contains pairs of all the nodes and their
properties to be drawn on this depth.depth
- The Current drawing depth. Depth is increased by one, when
proceeding deeper.
protected int x(double angle, float radius)
protected int y(double angle, float radius)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |