|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.fenfire.loom.Cursor
A Loom cursor position in an RDF graph. Currently a focus and a rotation. The rotation is a number. Not stored in the structure.
Field Summary | |
Resource |
focus
The focused node, usually shown in the middle of the screen. |
NamespaceMap |
names
The namespace prefix mappings used to render URIs. |
protected java.util.Comparator |
objOrder
The comparator used to order statements by object. |
int |
rotation
Index of the selection, "where you go next". 0 is the index in the middle, or one smaller if there are an even number of choices. |
protected StatementSelector |
statementSelector
The statement selector used to choose which connections of a node to show. |
protected java.util.Comparator |
subjOrder
The comparator used to order statements by subject. |
Constructor Summary | |
Cursor(java.util.Comparator subjOrder,
java.util.Comparator objOrder,
StatementSelector statementSelector,
NamespaceMap names)
Create a new cursor without giving it a position yet. |
|
Cursor(java.util.Comparator subjOrder,
java.util.Comparator objOrder,
StatementSelector statementSelector,
NamespaceMap names,
Resource focus)
Create a new cursor and give it a focus. |
|
Cursor(java.util.Comparator subjOrder,
java.util.Comparator objOrder,
StatementSelector statementSelector,
NamespaceMap names,
Resource focus,
int dir,
RDFNode rotation)
Create a new cursor and give it a focus and a rotation. |
Method Summary | |
int |
getConnectionCount()
|
java.util.SortedSet |
getConnections(int dir)
Get the focus's connections in a given direction. |
protected java.util.SortedSet |
getConnections(Resource of,
int dir)
Get the connections of a given node in a given direction, as determined by the statementSelector, sorted according to the subjOrder/objOrder of this cursor. |
protected static int |
getMiddle(int n)
If there n connections, get the index of the
'middle' connection.
|
java.util.Comparator |
getObjectOrder()
|
protected static int |
getOffsetFromMiddle(int i,
int n)
If i is an index in a list of n
connections, return the distance of i from
the middle.
|
int |
getRotation()
Get the rotation from the middle connection.
|
int |
getRotationIndex(int dir)
Get the index of the rotation in the list of left/right connections. |
RDFNode |
getRotationNode(int dir)
Get the selected node in the given direction. |
NodeView.Nodespec |
getRotationNodespec(int dir)
|
protected Statement |
getRotationStmt(int dir)
|
StatementSelector |
getStatementSelector()
|
java.util.Comparator |
getSubjectOrder()
|
void |
move(int dir)
Move left/right. |
void |
rotate(int dir)
Rotate the view up or down. |
void |
set(Resource focus)
Set the position of the cursor without setting a rotation. |
void |
set(Resource focus,
int dir,
RDFNode rotation)
Set the position of the cursor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public NamespaceMap names
public Resource focus
public int rotation
protected java.util.Comparator subjOrder
protected java.util.Comparator objOrder
protected StatementSelector statementSelector
Constructor Detail |
public Cursor(java.util.Comparator subjOrder, java.util.Comparator objOrder, StatementSelector statementSelector, NamespaceMap names)
public Cursor(java.util.Comparator subjOrder, java.util.Comparator objOrder, StatementSelector statementSelector, NamespaceMap names, Resource focus)
public Cursor(java.util.Comparator subjOrder, java.util.Comparator objOrder, StatementSelector statementSelector, NamespaceMap names, Resource focus, int dir, RDFNode rotation)
Method Detail |
public java.util.Comparator getSubjectOrder()
public java.util.Comparator getObjectOrder()
public StatementSelector getStatementSelector()
public void set(Resource focus)
protected static int getMiddle(int n)
n
connections, get the index of the
'middle' connection.
If there is an odd number of connections, the 'middle' one is
clear. If there is an even number, the 'middle' is defined
as being the one above the actual middle (which lies between
two connections).
As usual, indices are counted starting with zero.
protected static int getOffsetFromMiddle(int i, int n)
i
is an index in a list of n
connections, return the distance of i
from
the middle.
A negative number is returned when i
is below
the middle. This number is used as the value of
rotation
when i
is selected
by the cursor.
public void set(Resource focus, int dir, RDFNode rotation)
public int getRotation()
rotation
from the middle connection.
E.g., when there are 5 connections and the second one is selected,
rotation
is -1.
protected java.util.SortedSet getConnections(Resource of, int dir)
public java.util.SortedSet getConnections(int dir)
public int getConnectionCount()
public void rotate(int dir)
public int getRotationIndex(int dir)
protected Statement getRotationStmt(int dir)
public RDFNode getRotationNode(int dir)
public NodeView.Nodespec getRotationNodespec(int dir)
public void move(int dir)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |