junit.extensions.jfcunit.eventdata
Class PathData

java.lang.Object
  extended byjunit.extensions.jfcunit.eventdata.PathData

public class PathData
extends java.lang.Object

Title: PathData

Description: This class encapsulates the data which is to be transformed into a path for the given GUI object type.

Copyright: Copyright (c) 2003

Company: JFCUnit Project

Version:
1.0
Author:
Kevin Wilson

Field Summary
private  int[] m_indexes
          Indexes of the strings representing the path.
private  java.lang.String[] m_path
          Strings representing the path.
 
Constructor Summary
PathData(int size)
          PathData constructor.
PathData(javax.swing.JMenuItem mi)
          PathData constructor.
PathData(java.lang.String[] path)
          PathData constructor.
PathData(java.lang.String[] path, int[] indexes)
          PathData constructor.
 
Method Summary
 int[] getIndexes(javax.swing.JComponent menu)
          Get the indexes for the JComponent.
 java.lang.Object getRoot(javax.swing.JMenuItem mi)
          Get the root object.
 javax.swing.tree.TreePath getTreePath(javax.swing.JTree tree)
          Generate a tree path for this path and the given tree.
 void set(int i, java.lang.String data, int index)
          set the path element at a given level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_indexes

private int[] m_indexes
Indexes of the strings representing the path. Used only when there is a duplicate path element.


m_path

private java.lang.String[] m_path
Strings representing the path.

Constructor Detail

PathData

public PathData(int size)
PathData constructor.

Parameters:
size - number of path elements

PathData

public PathData(java.lang.String[] path)
PathData constructor.

Parameters:
path - Path to be represented.

PathData

public PathData(java.lang.String[] path,
                int[] indexes)
PathData constructor.

Parameters:
path - String names of the items to be traversed.
indexes - index array for paths containing more than one identical string.

PathData

public PathData(javax.swing.JMenuItem mi)
PathData constructor.

Parameters:
mi - MenuItem to buid the path for.
Method Detail

getRoot

public java.lang.Object getRoot(javax.swing.JMenuItem mi)
Get the root object.

Parameters:
mi - Menu item to retrieve the root menu for.
Returns:
Root object.

set

public final void set(int i,
                      java.lang.String data,
                      int index)
set the path element at a given level.

Parameters:
i - Level of the path.
data - String of path element.
index - Index of path element.

getIndexes

public int[] getIndexes(javax.swing.JComponent menu)
Get the indexes for the JComponent.

Parameters:
menu - menu to be traversed.
Returns:
int[] indexes to be traversed.

getTreePath

public javax.swing.tree.TreePath getTreePath(javax.swing.JTree tree)
Generate a tree path for this path and the given tree.

Parameters:
tree - JTree Tree to construct the path for.
Returns:
TreePath TreePath to be used in firing events.


Licensed under: GNU Lesser General Public License, Ver 2.1, February 1999