|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.ceryle.ui.tree.TopicTreeDialog
public class TopicTreeDialog
Extends JDialog to provide a selection dialog for
selecting a Topic from a list. The list is generated from one or more
query Topics in the constructor, from which either a ancestor or
descendent list is generated and displayed in the form of a tree.
This dialog is hidden upon button action and must be disposed of manually. The result is obtained via getSelection():
TopicTreeDialog dlog = new TopicTreeDialog(
myJFrame,
"dialog title",
"dialog message",
"optional description",
queryTopics );
Topic selected = dlog.getSelection();
Following use of the dialog, the button pressed can be obtained
by calling getSelectedButton(), which returns one of
the following JOptionPane values:
If the dialog is closed via its window being closed, JOptionPane.CANCEL_OPTION is returned.
| Nested Class Summary | |
|---|---|
class |
TopicTreeDialog.DialogDisposer
|
| Nested classes/interfaces inherited from class javax.swing.JDialog |
|---|
JDialog.AccessibleJDialog |
| Nested classes/interfaces inherited from class java.awt.Dialog |
|---|
Dialog.AccessibleAWTDialog |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| 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 | |
|---|---|
protected JButton |
btn_cancel
|
protected JButton |
btn_help
|
protected JButton |
btn_select
|
protected JPanel |
centerPanel
|
static int |
DEFAULT_COLUMN_WIDTH
The default column width (in characters) for the display list. |
static int |
DEFAULT_ROW_COUNT
The default number of rows to show in the display list. |
protected JTextArea |
desc
|
protected JTextArea |
help
|
protected JPanel |
helpPanel
|
protected StackSet |
m_query
|
protected JPanel |
northPanel
|
protected int |
selectedButton
|
protected JPanel |
southPanel
|
protected Services |
srvs
|
static int |
WIDTH
Window width in pixels. |
| Fields inherited from class javax.swing.JDialog |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS |
| Constructor Summary | |
|---|---|
TopicTreeDialog(JFrame frame,
String title,
String message,
String description,
List queryTopics,
TopicTreeModel treemodel,
boolean superclasses,
boolean initVisible)
Constructor for a dialog box containing a selection list. |
|
| Method Summary | |
|---|---|
protected JPanel |
createCenterPanel()
Returns the center panel containing the selection area(s). |
protected JPanel |
createNorthPanel(String message,
String description)
Returns the northernmost panel containing the message text and optional description. |
protected JPanel |
createSouthPanel(boolean includeHelp)
Returns the southernmost panel containing the submit and cancel buttons. |
protected void |
doSomething(Object content)
Do something with the selection. |
int |
getSelectedButton()
Returns the value of the selected button as one of the JOptionPane options JOptionPane.YES_OPTION, JOptionPane.NO_OPTION, or JOptionPane.CANCEL_OPTION. |
int |
getSelectedCount()
Returns the number of selected items in the list. |
Topic |
getSelection()
Returns the selected Object, null if there is no selection. |
boolean |
isHelpVisible()
|
void |
query(List queryTopics,
boolean superclasses)
Clears the existing display and sets the new tree to one based on the contents of the provided Vector, which contains zero or more Topics. |
protected void |
setDescription(String s)
Do something with the selection. |
void |
setHelpText(String content)
Set the help text to the String content. |
protected void |
setSelectedButton(int value)
|
protected void |
updateFromSelection(Object o)
Updates any features based on the current selected Topic. |
| Methods inherited from class java.awt.Dialog |
|---|
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static int WIDTH
public static int DEFAULT_COLUMN_WIDTH
public static int DEFAULT_ROW_COUNT
protected Services srvs
protected int selectedButton
protected JButton btn_help
protected JButton btn_cancel
protected JButton btn_select
protected JPanel northPanel
protected JPanel centerPanel
protected JPanel southPanel
protected JPanel helpPanel
protected JTextArea desc
protected JTextArea help
protected StackSet m_query
| Constructor Detail |
|---|
public TopicTreeDialog(JFrame frame,
String title,
String message,
String description,
List queryTopics,
TopicTreeModel treemodel,
boolean superclasses,
boolean initVisible)
throws TopicMapException
The setting on whether or not to indicate facets in the renderer is
based on the value of TopicTreeModel.facetMode
at the time of instantiation. If the default behaviour isn't wanted,
this must be set explicitly using
TopicTreeModel.setFacetMode(int).
frame - the parent frame windowtitle - the dialog titlemessage - the text to display above the listdescription - an optional text descriptionqueryTopics - a StackSet containing query Topicstreemodel - the optional TopicTreeModel being displayedsuperclasses - a boolean indicating that when true indicates the
direction should be towards superclasses, otherwise subclassesinitVisible - when true, displays the dialog upon instantiation
TopicMapException| Method Detail |
|---|
public void query(List queryTopics,
boolean superclasses)
protected JPanel createNorthPanel(String message,
String description)
protected void updateFromSelection(Object o)
protected JPanel createCenterPanel()
protected JPanel createSouthPanel(boolean includeHelp)
protected void doSomething(Object content)
protected void setSelectedButton(int value)
public int getSelectedButton()
protected void setDescription(String s)
public boolean isHelpVisible()
public void setHelpText(String content)
public Topic getSelection()
public int getSelectedCount()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||