|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.ceryle.ui.View
org.ceryle.ui.GraphView
public class GraphView
A class that extends View to provide graph visualization features.
This is meant to be embedded in a ViewFrame.
This and the DocumentView class have historically
been places where a great deal of experimental coding has happened, so
there may be variables and methods here that are not meant to be
permanent parts of the application.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
assocTypesHelpID
The ID in the Help collection for the tutorial on Association types. |
static String |
GraphSearch
The graph search string. |
protected GraphToolBar |
m_graphtools
The toolbar used to manipulate the graph. |
protected boolean |
m_timelinesViz
A boolean indicating the mode of display: if 'true', timelines are displayed. |
protected TimeLine |
timeline
|
protected TMLayoutPanel |
tmlp
The TMLayoutPanel used. |
protected TopicMapProcessor |
tmproc
The TopicMapProcessor used by this GraphView. |
protected TopicMapVisualizer |
tmviz
The TopicMapVisualizer used to display TopicMaps. |
| Fields inherited from class org.ceryle.ui.View |
|---|
DOCUMENT, GRAPH, isClosing, m_desktop, m_verbose, mh, NOTE, pm, PROJECT, srvs, vf, vmgr |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
GraphView(ViewFrame viewframe)
Constructor with a reference to its wrapper ViewFrame. |
|
GraphView(ViewFrame viewframe,
int type)
Constructor with a reference to its wrapper ViewFrame and an optional View type. |
|
GraphView(ViewFrame viewframe,
String title)
A "convenience constructor" that allows the View title to be set at construction time. |
|
| Method Summary | |
|---|---|
void |
addToolExtras(JToolBar tb)
If in developer mode, add some experimental buttons to the right end of the toolbar. |
void |
arrangeTopics()
Arranges the selected TNodes on a grid, sorting them alphabetically. |
void |
centerTopic()
Centers the selected topic node. |
File |
chooseExportFile(File defaultFile)
Provided with a JComponent parent, displays a FileChooser dialog box and returns the selected File, or null if no file is chosen. |
void |
closing()
This method should be called before closing the GraphView to allow safe closing of any dirty content, removing listeners, etc. |
protected void |
collapseTopic()
Collapses the currently selected topic node. |
void |
deleteSelected(boolean confirm)
Deletes the selected graph nodes. |
void |
designateAsComponent()
Designate the selected Topics as either a normal Topic or a document component Topic. |
void |
desktopPropertyChanged()
A notification that some property affecting graphs has changed in the Desktop, likely as a result of a menu action. |
protected void |
expandTopic()
Expands the currently selected topic node. |
boolean |
fileClose(boolean forced)
Closes the current graph, first checking to be sure that it has not been modified. |
boolean |
fileImport(File file,
ExtensionFileFilter filter)
If file is null, displays a FileChooser and obtains the selected File, then uses methods within SourceProcessor to determine which import processor to call to import the file type. |
boolean |
fileImport(Object source)
Opens the selected source, specified by a String, File, or TypedInputSource into the current View. |
boolean |
fileImport(TypedInputSource source,
ViewFrame viewframe,
TMLayoutPanel tmpanel)
Vets opening the provided TypedInputSource, checking first if there is existing content and querying on what to do if there is. |
boolean |
fileNew()
Creates a new, empty document. |
boolean |
fileOpen(File file)
A synonym for fileImport(Object). |
boolean |
fileSave()
This method attempts to save the single TopicMap stored in the TMLayoutPanel to its base locator's systemID. |
boolean |
fileSave(File file)
Saves the currently visualized Topic Map to a file. |
void |
finalize(TopicMap topicmap,
File file)
Prior to saving, perform any processes necessary to ready the TopicMap topicmap to be saved, such as updating its metadata and setting its base locator based on the File. |
boolean |
findTopic(String s)
Does a query on the Graph based on the provided String. |
Association |
getAssociationTemplate(Topic type)
Provided an association typing Topic, returns the corresponding Association template (as an Association). |
JPopupMenu |
getRecentPopup()
Returns the recently-opened popup menu. |
String |
getSelectedResource()
Returns the URI (as a String) of either the MouseOVer'd Topic node, or if there isn't one, the selected Topic node. |
Vector |
getTemplateList()
Returns a Vector containing the association templates for this GraphView's TMLayoutPanel, in the form of a two element array containing a text description of the template followed by its typing Topic. |
TMLayoutPanel |
getTMLayoutPanel()
Lazily creates and returns the TMLayoutPanel. |
JToolBar |
getToolBar()
Lazily creates and returns the Graph ToolBar. |
TopicEditorDialog |
getTopicEditor(TNode tnode)
Returns the TopicEditorDialog associated with this GraphView. |
TopicMapProcessor |
getTopicMapProcessor()
Return the TopicMapProcessor used by this GraphView. |
TopicMapVisualizer |
getVisualizer()
Returns the TopicMapVisualizer associated with this GraphView. |
void |
graphInfo()
Display graph info in a dialog box. |
void |
grid()
Sets the grid mode for this graph. |
static void |
invalidateRecentPopup()
Invalidates the recently-opened popup due to a change in the underlying contents. |
boolean |
isDirty()
Returns an indication of true if the current document has been edited. |
void |
makeConsistent()
Processes the current TopicMap for consistency, removing duplicate roles, basenames, etc. |
void |
newAssociation()
Create a new Association. |
void |
newRectTopic(String id)
Creates a new rectangular style Topic node. |
void |
newTarget(String id)
Creates a new target (or circle) style Topic node. |
TNode |
newTopic()
Create a new Topic. |
TNode |
newTopic(Point2D.Double p)
Create a new Topic at the optionally provided location. |
TNode |
newTopic(Point2D.Double p,
String label)
Create a new Topic having the provided label at the given location. |
void |
nodeFix()
fix node in place. |
void |
nodeFixAll()
Fixes the location of all TNodes in place. |
void |
nodeUnfix()
unfix node. |
void |
nodeUnfixAll()
Unfixes the location of all Nodes, regardless of type. |
boolean |
openImage(File file,
boolean query)
If either query is true or the supplied File is null, displays a file chooser box, then loads the selected image into the image panel. |
boolean |
openImageURL(URL url)
Loads the image specified by the URL url into the image panel. |
void |
packView()
Suggests to the GraphView that it resize any internal components appropriate to its current size. |
String |
queryTopicTitle(String title)
Queries user for a Topic title, with an optional default title. |
void |
refresh()
Refresh the display. |
void |
reinitialize(boolean forced,
boolean flush)
Removes the current graph, creating a new, empty graph. |
void |
requestFocus()
Sets the current focus to the graph area. |
boolean |
save(File file,
Object o)
Saves the Object o (as a TopicMap) to the provided File file. |
void |
saveProperties()
Saves any graph properties to the property file. |
protected void |
selectCLUT()
Displays a dialog box allowing the user to select a different color lookup table (CLUT), used for custom node colors. |
protected Topic |
selectRelation(Topic relation)
Return a selected Association type from a dialog of available relations. |
protected void |
selectScroll(int scroll)
Displays the scrollbar indicated by the String name, |
protected void |
selectStylesheet()
Displays a dialog box allowing the user to select a different graph stylesheet. |
Association |
selectTemplate(String title)
Displays a dialog box for selecting one of the available association templates. |
void |
setColorFlag(String name,
ActionEvent event)
Colorize the labels of the selected nodes to the color identified by String name. |
void |
setFixedIsPinned(boolean pinned)
Sets the fixed-is-pinned feature to the provided value, and also writes the value to the properties file. |
protected void |
setGraphMode(boolean showTimelines)
Set the graph display mode, displaying timelines if showTimelines if true. |
void |
setToolsVisible(boolean visible)
Sets the visibility of the graph toolbar to the boolean visible, updating the menu item appropriately. |
void |
showFindTopic()
Displays the Find Topic dialog box. |
void |
subgraphTopic(int style)
Creates a subgraph from the currently-selected Topic(s). |
void |
swapRoles()
Swap the roles of the selected Association(s). |
void |
update()
Updates the display. |
boolean |
updateLocations(TopicMap tm)
Iterates through all of the Topics in TopicMap tm, updating the stored locations of any fixed nodes to their current locations. |
| Methods inherited from class org.ceryle.ui.View |
|---|
deactivate, fileSaveAs, getDesktop, getSystemId, getTitle, getType, getTypeName, getViewFrame, getViewManager, hasDatabase, hasEditing, hasGraph, isDocumentOrNoteView, isDocumentView, isGraphView, isNoteView, isProjectView, setSystemId, setTitle, setTitle, setViewFrame |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String assocTypesHelpID
protected boolean m_timelinesViz
public static final String GraphSearch
protected TMLayoutPanel tmlp
protected TopicMapVisualizer tmviz
protected TopicMapProcessor tmproc
protected TimeLine timeline
protected GraphToolBar m_graphtools
| Constructor Detail |
|---|
public GraphView(ViewFrame viewframe)
viewframe - the parent ViewFrame for this GraphView
public GraphView(ViewFrame viewframe,
int type)
viewframe - the parent ViewFrame for this GraphViewtype - the type of View this represents
public GraphView(ViewFrame viewframe,
String title)
| Method Detail |
|---|
public void update()
public void reinitialize(boolean forced,
boolean flush)
fileClose(boolean).
If flush is true, replaces the existing
TopicMapProcessor rather than simply resetting it. This
may have an effect on other GraphView or ProjectView
views if they use the same processor, though in current
code processors are unique per view.
public TopicMapProcessor getTopicMapProcessor()
public void saveProperties()
public void packView()
packView in class Viewpublic void requestFocus()
requestFocus in class Viewpublic void refresh()
refresh in class Viewpublic void closing()
closing in class Viewpublic JPopupMenu getRecentPopup()
public static void invalidateRecentPopup()
public void setFixedIsPinned(boolean pinned)
public String getSelectedResource()
If there is currently no loaded TopicMap or no selected Topic node, null is returned. If the current TopicMap has no base Locator, the ID of the selected Topic node is returned as a fragment ID (though absent the initial hash symbol).
Note that if there is more than one selected node, the selection is checked against the mouseOver Node, which is given priority since it is most likely the trigger for this method call. [This work still needs to be done -- currently, only pays attention to the one "selected node."]
getSelectedResource in class ViewViewpublic TMLayoutPanel getTMLayoutPanel()
Note that this method does not throw an exception upon fault during lazy creation.
public JToolBar getToolBar()
public TopicMapVisualizer getVisualizer()
public TopicEditorDialog getTopicEditor(TNode tnode)
public String queryTopicTitle(String title)
public void desktopPropertyChanged()
public void addToolExtras(JToolBar tb)
public void setToolsVisible(boolean visible)
protected void selectScroll(int scroll)
GraphLayoutPanel.ZOOM_SCROLL,
GraphLayoutPanel.ROTATE_SCROLL,
GraphLayoutPanel.LOCALITY_SCROLLpublic boolean fileNew()
fileNew in class View