|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.models.OLAPDataSetInterfaceToTreeModelAdapter
public class OLAPDataSetInterfaceToTreeModelAdapter
A default tree model for viewing an OLAPDataSetInterface.
Field Summary | |
---|---|
protected boolean |
defaultModelAttached
|
protected javax.swing.event.EventListenerList |
listenerList
Listeners. |
protected OLAPDataSetInterface |
model
|
protected java.lang.Object |
root
|
Constructor Summary | |
---|---|
OLAPDataSetInterfaceToTreeModelAdapter()
Default constructor, calls this(null . |
|
OLAPDataSetInterfaceToTreeModelAdapter(OLAPDataSetInterface model)
Creates a TreeModel representation for the OLAPDataSetINterface that is passed in. |
Method Summary | |
---|---|
void |
addTreeModelListener(javax.swing.event.TreeModelListener listener)
Registers a listener to receive notification whenever the tree model changes. |
protected void |
fireTreeNodesChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
|
protected void |
fireTreeNodesInserted(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
|
protected void |
fireTreeNodesRemoved(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
|
protected void |
fireTreeStructureChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
|
int[] |
getAxesUsed()
Returns an array of ints that map to the constants in AxisInterface for the various
axes being displayed in the tree model. |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Returns a child at a particular index from the specifed parent. |
int |
getChildCount(java.lang.Object parent)
Returns the number of child that the specified node contains. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
Returns the index of the specified child in its parent list. |
OLAPDataSetInterface |
getModel()
Returns the OLAPDataSetInterface that is being as the data for the tree model. |
java.lang.Object |
getParent(java.lang.Object child)
Returns the parent of the specified object. |
javax.swing.tree.TreePath |
getPathToRoot(java.lang.Object node)
Returns the path from the root node down to the specified node. |
java.lang.Object |
getRoot()
Returns the root object in the tree. |
boolean |
isAxesVisible()
|
boolean |
isDefaultModelAttached()
Returns whether the default model is attached, which in this case is a OLAPDataSet with no tuples or axes set. |
boolean |
isLeaf(java.lang.Object object)
Indicates if the specified object is a leaf. |
protected OLAPDataSetInterface |
newDefaultModel()
Create a new default model, which by default is a com.sas.storage.olap.embedded.OLAPDataSet
with no tuples or axes set. |
void |
removeTreeModelListener(javax.swing.event.TreeModelListener listener)
Removes a listener from receiving notifications whenever the tree model changes. |
void |
setAxesUsed(int[] axes)
Sets the axes being displayed in the tree, by default the axes are AxisInterface.COLUMNS_AXIS, AxisInterface.ROWS_AXIS and AxisInterface.SLICERS_AXIS . |
void |
setAxesVisible(boolean areAxesVisible)
|
protected void |
setDefaultModelAttached(boolean defaultModelUsed)
Sets whether the default model is attached or not. |
void |
setModel(OLAPDataSetInterface newModel)
Sets the model on the adapter, if null, a default embedded OLAPDataSet will be used. |
void |
setRoot(java.lang.Object root)
Sets the root object in the tree. |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object value)
Not implemented yet. |
Field Detail |
---|
protected javax.swing.event.EventListenerList listenerList
protected boolean defaultModelAttached
protected OLAPDataSetInterface model
protected java.lang.Object root
Constructor Detail |
---|
public OLAPDataSetInterfaceToTreeModelAdapter()
this(null
.
public OLAPDataSetInterfaceToTreeModelAdapter(OLAPDataSetInterface model)
model
- the OLAP model to create a tree representation forMethod Detail |
---|
public void setAxesUsed(int[] axes)
AxisInterface.COLUMNS_AXIS, AxisInterface.ROWS_AXIS and AxisInterface.SLICERS_AXIS
.
The order the axes are set in teh array are the order they will appear in the tree, so you can control
which axis you want to see first.
axes
- an array of ints that use the constants from the AxisInterface
getAxesUsed()
public int[] getAxesUsed()
AxisInterface
for the various
axes being displayed in the tree model. By default, the axes are
AxisInterface.COLUMNS_AXIS, AxisInterface.ROWS_AXIS and AxisInterface.SLICERS_AXIS
.
setAxesUsed(int[])
public boolean isAxesVisible()
public void setAxesVisible(boolean areAxesVisible)
public OLAPDataSetInterface getModel()
setModel(OLAPDataSetInterface)
public void setModel(OLAPDataSetInterface newModel)
OLAPDataSet
will be used.
newModel
- the new model for the adaptergetModel()
protected OLAPDataSetInterface newDefaultModel()
com.sas.storage.olap.embedded.OLAPDataSet
with no tuples or axes set.
public boolean isDefaultModelAttached()
isDefaultModelAttached
in interface ViewDefaultModel
setDefaultModelAttached(boolean)
protected void setDefaultModelAttached(boolean defaultModelUsed)
defaultModelUsed
- true if a default model is attached, false otherwiseisDefaultModelAttached()
public java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public void setRoot(java.lang.Object root)
root
- the new root objectpublic int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
parent
- the node the get the child count from
parent
public java.lang.Object getChild(java.lang.Object parent, int index)
getChild
in interface javax.swing.tree.TreeModel
parent
- the node to get the child fromindex
- the index of the child to get
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
parent
- the parent of the child nodechild
- the node to get the index of
public boolean isLeaf(java.lang.Object object)
getChildCount(object) <= 0;
isLeaf
in interface javax.swing.tree.TreeModel
object
- the object to determine if its a leaf or not
true
if the object is a leaf, otherwise false
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object value)
valueForPathChanged
in interface javax.swing.tree.TreeModel
TreeModel.valueForPathChanged(TreePath, Object)
public void addTreeModelListener(javax.swing.event.TreeModelListener listener)
addTreeModelListener
in interface javax.swing.tree.TreeModel
listener
- the listener to registerpublic void removeTreeModelListener(javax.swing.event.TreeModelListener listener)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
listener
- the listener to removepublic javax.swing.tree.TreePath getPathToRoot(java.lang.Object node)
node
- the node to find the path of
node
public java.lang.Object getParent(java.lang.Object child)
child
- the child node to get the parent of
protected void fireTreeNodesChanged(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
source
- path
- childIndices
- children
- protected void fireTreeNodesInserted(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
source
- path
- childIndices
- children
- protected void fireTreeNodesRemoved(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
source
- path
- childIndices
- children
- protected void fireTreeStructureChanged(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
source
- path
- childIndices
- children
-
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |