Public Member Functions | |
ContentExplorer () | |
Constructor for ContentExplorer application. | |
void | retrieveFromRepo (String name, boolean textPopup) |
Method to trigger a thread to retrieve a file. | |
void | retrieveFromRepo (String name) |
Method to trigger a thread to retrieve a file. | |
void | sendFile (File file, ContentName ccnName) |
Method to store a file in a repository. | |
String | getNodes (Name fnode) |
Method to get the node selected with the SelectionListener. | |
int | handleNameEnumerator (ContentName prefix, ArrayList< ContentName > n) |
Method to handle CCNNameEnumeration callbacks. | |
void | registerPrefix (String prefix) |
Method to register a prefix for name enumeration with CCNNameEnumerator. | |
void | actionPerformed (ActionEvent e) |
Experimental code for access control GUI. | |
CCNNameEnumerator | getNameEnumerator () |
Method to return the CCNNameEnumerator for the ContentExplorer application. | |
boolean | checkVLCsupport () |
Method to check for CCN Plugin for VLC. | |
Static Public Member Functions | |
static void | main (String[] args) |
Main method for the ContentExplorer GUI. | |
static void | usage () |
Usage for ContentExplorer GUI. | |
static void | createAndShowGUI () |
Static method to create and display the GUI. | |
static void | setRoot (ContentName r) |
static void | setAccessControl (boolean ac) |
static void | setShowVersions (boolean sv) |
static void | setDebugMode (boolean dm) |
static void | setGroupAccessControlManager (GroupAccessControlManager acm) |
static void | setUsername (String name) |
static void | setPreviewTextfiles (boolean ptf) |
Public Attributes | |
String | selectedPrefix |
String | selectedPath |
Static Public Attributes | |
static final ImageIcon | ICON_COMPUTER |
static final ImageIcon | ICON_DISK |
static final ImageIcon | ICON_FOLDER |
static final ImageIcon | ICON_EXPANDEDFOLDER |
static final ImageIcon | ICON_DOCUMENT |
Protected Attributes | |
JTree | tree |
DefaultTreeModel | m_model |
JPopupMenu | tree_popup |
Action | tree_popupaction |
boolean | vlcSupported = false |
Static Protected Attributes | |
static boolean | showVersions = false |
static boolean | debugMode = false |
static CCNHandle | _handle = null |
Package Functions | |
DefaultMutableTreeNode | getTreeNode (ContentName ccnContentName) |
Method to get Swing components used for storing the name hierarchy. | |
DefaultMutableTreeNode | findMatchingChild (TreePath parent, DefaultMutableTreeNode n, String name) |
Method to find a child with a specific name. | |
DefaultMutableTreeNode | getTreeNode (TreePath path) |
Method to get the DefaultMutableTreeNode for a given path. | |
Name | getNameNode (DefaultMutableTreeNode node) |
Method to get the user object as a Name from a DefaultMutableTreeNode. | |
FileNode | getFileNode (DefaultMutableTreeNode node) |
Method to get the user object as a FileNode. | |
Static Package Attributes | |
static java.net.URL | netURL = ContentExplorer.class.getResource("Network.png") |
static java.net.URL | compURL = ContentExplorer.class.getResource("Computer.png") |
static java.net.URL | imageURL = ContentExplorer.class.getResource("Folder.png") |
static java.net.URL | docURL = ContentExplorer.class.getResource("Document.png") |
Classes | |
class | DirExpansionListener |
Class to handle directory actions - expand and collapse. More... | |
class | DirSelectionListener |
Class to handle tree component selections. More... | |
class | MouseActions |
Experimental code - not tested. More... |
This application explores ContentObjects that are available in a GUI. The ContentExplorer uses CCNNameEnumeration to populate the GUI and can open .txt and .text files in a preview pane or separate window. The ContentExplorer can also be used to store files in a repository. Finally, the ContentExplorer is intended to be used as a first test of AccessControl functionality with CCN. This is in an extremely early state and will be updated in future releases.
org.ccnx.ccn.utils.explorer.ContentExplorer.ContentExplorer | ( | ) |
Constructor for ContentExplorer application.
This sets up the swing elements and listeners for the GUI. The constructor also initializes the CCNHandle and name enumeration.
void org.ccnx.ccn.utils.explorer.ContentExplorer.retrieveFromRepo | ( | String | name, | |
boolean | textPopup | |||
) |
Method to trigger a thread to retrieve a file.
A new thread is created to get the file. This method displays a message about the file to retrieve in the preview pane and displays the text of the file when the download is complete.
name | Name of the file to retrieve | |
txtPopup | True if the file should be opened in a text popup |
void org.ccnx.ccn.utils.explorer.ContentExplorer.retrieveFromRepo | ( | String | name | ) |
Method to trigger a thread to retrieve a file.
A new thread is created to get the file. This method displays a message about the file to retrieve in the preview pane and displays the text of the file when the download is complete.
name | Name of the file to retrieve |
void org.ccnx.ccn.utils.explorer.ContentExplorer.sendFile | ( | File | file, | |
ContentName | ccnName | |||
) |
Method to store a file in a repository.
A new thread is created for this process. A message indicating the file the is being written displays in the preview pane. When the upload is complete, or an error occurs, the preview pane is updated to show the new state.
file | ||
ccnName |
DefaultMutableTreeNode org.ccnx.ccn.utils.explorer.ContentExplorer.getTreeNode | ( | ContentName | ccnContentName | ) | [package] |
Method to get Swing components used for storing the name hierarchy.
Returns null if the prefix is not found. Uses the ContentExplorer.find() method to recursively search through the tree.
ccnContentName | Prefix to retrieve in the tree. |
DefaultMutableTreeNode org.ccnx.ccn.utils.explorer.ContentExplorer.findMatchingChild | ( | TreePath | parent, | |
DefaultMutableTreeNode | n, | |||
String | name | |||
) | [package] |
Method to find a child with a specific name.
parent | TreePath for the parent we are searching | |
n | Node to look for children | |
name | Name for the child we are looking for |
DefaultMutableTreeNode org.ccnx.ccn.utils.explorer.ContentExplorer.getTreeNode | ( | TreePath | path | ) | [package] |
Method to get the DefaultMutableTreeNode for a given path.
path | TreePath for the node we are looking for |
Name org.ccnx.ccn.utils.explorer.ContentExplorer.getNameNode | ( | DefaultMutableTreeNode | node | ) | [package] |
Method to get the user object as a Name from a DefaultMutableTreeNode.
node | The node we need the name of |
FileNode org.ccnx.ccn.utils.explorer.ContentExplorer.getFileNode | ( | DefaultMutableTreeNode | node | ) | [package] |
Method to get the user object as a FileNode.
node | The node we want a FileNode from |
static void org.ccnx.ccn.utils.explorer.ContentExplorer.main | ( | String[] | args | ) | [static] |
Main method for the ContentExplorer GUI.
The GUI defaults to exploring "/" but takes a -root option for exploring alternate namespaces.
args | String[] of the arguments for the GUI. (path to explore and optional experimental access control GUI) |
String org.ccnx.ccn.utils.explorer.ContentExplorer.getNodes | ( | Name | fnode | ) |
Method to get the node selected with the SelectionListener.
fnode | Name node to select |
int org.ccnx.ccn.utils.explorer.ContentExplorer.handleNameEnumerator | ( | ContentName | prefix, | |
ArrayList< ContentName > | n | |||
) |
Method to handle CCNNameEnumeration callbacks.
This implementation assumes the application handles duplicates. This method creates an instance of the Runnable AddChildren class to process the names returned through CCNNameEnumeration.
prefix | ContentName of the prefix for returned names | |
n | ArrayList<ContentNames> of children returned by enumeration. |
Implements org.ccnx.ccn.profiles.nameenum.BasicNameEnumeratorListener.
void org.ccnx.ccn.utils.explorer.ContentExplorer.registerPrefix | ( | String | prefix | ) |
Method to register a prefix for name enumeration with CCNNameEnumerator.
prefix | String representation of the name to enumerate |
void org.ccnx.ccn.utils.explorer.ContentExplorer.actionPerformed | ( | ActionEvent | e | ) |
Experimental code for access control GUI.
e | ActionEvent |
CCNNameEnumerator org.ccnx.ccn.utils.explorer.ContentExplorer.getNameEnumerator | ( | ) |
Method to return the CCNNameEnumerator for the ContentExplorer application.
boolean org.ccnx.ccn.utils.explorer.ContentExplorer.checkVLCsupport | ( | ) |
Method to check for CCN Plugin for VLC.
Returns true if the ccn plugin is installed for VLC. If it is not found, the "Play File" option is disabled for files.
Currently not tested on non-linux platforms.
final ImageIcon org.ccnx.ccn.utils.explorer.ContentExplorer.ICON_COMPUTER [static] |
Initial value:
new ImageIcon(getScaledImage( (new ImageIcon(netURL)).getImage(), 32, 32))
final ImageIcon org.ccnx.ccn.utils.explorer.ContentExplorer.ICON_DISK [static] |
Initial value:
new ImageIcon(getScaledImage( (new ImageIcon(compURL)).getImage(), 32, 32))
final ImageIcon org.ccnx.ccn.utils.explorer.ContentExplorer.ICON_FOLDER [static] |
Initial value:
new ImageIcon(getScaledImage( (new ImageIcon(imageURL)).getImage(), 32, 32))
final ImageIcon org.ccnx.ccn.utils.explorer.ContentExplorer.ICON_EXPANDEDFOLDER [static] |
Initial value:
new ImageIcon(getScaledImage( (new ImageIcon(docURL)).getImage(), 32, 32))
final ImageIcon org.ccnx.ccn.utils.explorer.ContentExplorer.ICON_DOCUMENT [static] |
Initial value:
new ImageIcon(getScaledImage( (new ImageIcon(docURL)).getImage(), 32, 32))