|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.graph.tm.TMPanelEditor
public class TMPanelEditor
A utility class that provides editing functions on a given TMPanel and its underlying TopicMap document object.
| Field Summary | |
|---|---|
static int |
ADD_OCCUR
Indicates a new occurrence directive. |
static int |
DEL_ASSOC
Indicates a delete association directive. |
static int |
DEL_SCOPE
Indicates a delete scope directive. |
static int |
DEL_SEL
Indicates a delete selected directive. |
static int |
DEL_TOPIC
Indicates a delete topic directive. |
static int |
MOD_ASSOC
Indicates a modify association directive. |
static int |
MOD_OCCUR
Indicates a modify occurrence directive. |
static int |
MOD_SCOPE
Indicates a modify scope directive. |
static int |
MOD_TOPIC
Indicates a modify topic directive. |
static int |
NEW_ASSOC
Indicates a new association directive. |
static int |
NEW_OCCUR
Indicates a new occurrence directive. |
static int |
NEW_SCOPE
Indicates a new scope directive. |
static int |
NEW_TOPIC
Indicates a new topic directive. |
static int |
REM_OCCUR
Indicates a remove occurrence directive. |
static int |
SUB_TOPIC
Indicates a subtopic directive. |
static boolean |
SWITCH_TEMPLATE_DIRECTION
For reasons that remain shrouded in mystical obscurity, the direction of terms appearing in Association templates will appear reverse to the 'normal' direction when editing Associations. |
protected TopicMapProcessor |
tmproc
A reference to the TopicMapProcessor used to create the displayed Topic, necessary to perform any post-creation modifications. |
| Constructor Summary | |
|---|---|
TMPanelEditor()
Default constructor. |
|
TMPanelEditor(Desktop desktop,
TMLayoutPanel tmpanel)
Constructor with Desktop and the TMLayoutPanel to edit. |
|
| Method Summary | |
|---|---|
void |
action(TMLayoutPanel tmpanel,
int directive,
Object o)
Receives a directive to manifest some editing change to the graph, based on a bitwise int directive. |
Occurrence |
addOccurrence()
Adds an existing resource as an Occurrence to the currently-selected Topic, querying the user for the URI. |
Occurrence |
addOccurrence(Topic topic)
Adds an existing resource as an Occurrence to the provided Topic, querying the user for the URI. |
Occurrence |
addOccurrence(Topic topic,
Locator loc)
The worker method that actually adds the Occurrence to the Topic, using the supplied Locator to create the new Occurrence. |
Occurrence |
addOccurrence(Topic topic,
String uriref)
Adds an existing resource as an Occurrence to the currently-selected Topic, using the provided String as a URI. |
void |
changeAssociation(ANode anode)
Alters the association type and roles on the provided binary association. |
Association |
createAssociationToTopic(TNode tnode,
Point2D.Double p,
boolean useLast)
Associates a new Topic at Point p to the Topic tnode, using the last Association template if useLast is true and within this session a previous Association has been created. |
boolean |
deleteANode(ANode anode,
boolean confirm)
Deletes the ANode anode from the graph, as well as its corresponding Association from the underlying Topic Map. |
boolean |
deleteAssertion(boolean confirm)
Delete the currently-selected assertion from the graph. |
boolean |
deleteAssociation(Association assoc,
boolean confirm)
Delete the Association assoc from the graph. |
boolean |
deleteAssociation(boolean confirm)
Delete the currently-selected association(s) from the graph. |
boolean |
deleteNode(GraphNode node,
boolean confirm)
Deletes the GraphNode node; what happens depends on its type. |
boolean |
deleteSelected(boolean confirm)
Deletes the selected nodes, depending on the number of type. |
boolean |
deleteSNode(SNode snode,
boolean confirm)
Deletes the SNode snode from the graph, as well as from the underlying Topic Map. |
boolean |
deleteTNode(TNode tnode,
boolean confirm)
Deletes the TNode tnode from the graph, as well as from the underlying Topic Map. |
boolean |
deleteTopic(boolean confirm)
Delete the selected topic(s) and its membership in any associations. |
boolean |
deleteTopic(Topic topic,
boolean confirm)
Delete the Topic topic and its membership in any associations. |
void |
editAssertion()
|
void |
editAssociation()
|
void |
editOccurrence()
|
void |
editTopic()
|
protected Document |
getBlankDocument()
Turns the String content into an XML Document, either as valid or well-formed XML, or as a CDATA section. |
Association |
getLastTemplate()
If within this session an Association has been created, it is returned, otherwise null. |
void |
newAssertion()
|
void |
newAssociation()
Create a new binary association from the two currently-selected topics. |
void |
newAssociation(Topic subject,
Topic object)
Create a new binary association from the two currently-selected topics. |
ANode |
newAssociation(Topic subject,
Topic object,
Association predicate)
Create a new binary association from the two currently-selected topics. |
Occurrence |
newOccurrence()
Creates a new resource as an Occurrence of the currently-selected Topic. |
Occurrence |
newOccurrence(Topic topic)
Creates a new resource as an Occurrence of the currently-selected Topic. |
Occurrence |
newOccurrence(Topic topic,
String cid,
String nid,
String title)
Connects a resource as an Occurrence of the provided Topic, using the optional Collection and Node IDs and title as defaults to the dialog box. |
void |
newSubtopic()
|
TNode |
newTopic(Point2D.Double p)
Creates a new Topic, returning the created TNode. |
TNode |
newTopic(Point2D.Double p,
String label)
Creates a new Topic, returning the created TNode. |
void |
removeOccurrence()
|
boolean |
removeOccurrence(Topic topic,
Occurrence occur)
Removes the Occurrence from the Topic, returning true if successful. |
void |
setTMLayoutPanel(TMLayoutPanel tmpanel)
Set the TMLayoutPanel (and by extension, its TMPanel) to be edited by this TMPanelEditor. |
void |
swapRoles(ANode anode)
Swap the roles of the provided ANode's underlying Association, updating the displayed graph accordingly. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean SWITCH_TEMPLATE_DIRECTION
When the value of this boolean is true the template iterator will reverse the order so that edited Associations will maintain the order of the original Association. When false, they will be switched to their opposite direction, which might be considered rude by those without a sense of appropriate irony.
Actually, this has to do with the order of the terms in the LTM definitions for the templates (which one is labeled 'From' and which 'To'), which is dependent upon the way a relation is expressed (e.g., isParentOf vs. isChildOf), so it's rather arbitrary. In the LTM files delivered with Ceryle this should be set to true for the least gratuitous violence, though there will still be some vulgarity now and then.
public static final int NEW_TOPIC
public static final int SUB_TOPIC
public static final int MOD_TOPIC
public static final int DEL_TOPIC
public static final int NEW_ASSOC
public static final int MOD_ASSOC
public static final int DEL_ASSOC
public static final int NEW_SCOPE
public static final int MOD_SCOPE
public static final int DEL_SCOPE
public static final int NEW_OCCUR
public static final int ADD_OCCUR
public static final int MOD_OCCUR
public static final int REM_OCCUR
public static final int DEL_SEL
protected TopicMapProcessor tmproc
| Constructor Detail |
|---|
public TMPanelEditor()
throws TopicMapException
TopicMapException
public TMPanelEditor(Desktop desktop,
TMLayoutPanel tmpanel)
throws TopicMapException
TopicMapException| Method Detail |
|---|
public void setTMLayoutPanel(TMLayoutPanel tmpanel)
public void action(TMLayoutPanel tmpanel,
int directive,
Object o)
This generally comes from either the TMPopupMenu or the TMPanelEditorDialog.
TopicEditorDialog,
AssociationEditorDialogpublic boolean deleteSelected(boolean confirm)
public boolean deleteNode(GraphNode node,
boolean confirm)
public TNode newTopic(Point2D.Double p)
public TNode newTopic(Point2D.Double p,
String label)
public void newSubtopic()
public void editTopic()
public boolean deleteTopic(boolean confirm)
If the boolean confirm is true, a confirm dialog is displayed.
public boolean deleteTopic(Topic topic,
boolean confirm)
If the boolean confirm is true, a confirm dialog is displayed.
public boolean deleteTNode(TNode tnode,
boolean confirm)
public void newAssociation()
public Association getLastTemplate()
public Association createAssociationToTopic(TNode tnode,
Point2D.Double p,
boolean useLast)
public void newAssociation(Topic subject,
Topic object)
public ANode newAssociation(Topic subject,
Topic object,
Association predicate)
public void editAssociation()
public void changeAssociation(ANode anode)
public boolean deleteAssociation(boolean confirm)
If the boolean confirm is true, a confirm dialog is displayed.
public boolean deleteAssociation(Association assoc,
boolean confirm)
If the boolean confirm is true, a confirm dialog is displayed.
public boolean deleteANode(ANode anode,
boolean confirm)
public void swapRoles(ANode anode)
public void newAssertion()
public void editAssertion()
public boolean deleteAssertion(boolean confirm)
If the boolean confirm is true, a confirm dialog is displayed.
public boolean deleteSNode(SNode snode,
boolean confirm)
public Occurrence newOccurrence()
public Occurrence newOccurrence(Topic topic)
public Occurrence newOccurrence(Topic topic,
String cid,
String nid,
String title)
topic - the Topic to which to add the Occurrencecid - the collection ID of the new Occurrencenid - the node ID of the new Occurrencetitle - the title of the new Occurrence
protected Document getBlankDocument()
public Occurrence addOccurrence()
public Occurrence addOccurrence(Topic topic)
public Occurrence addOccurrence(Topic topic,
String uriref)
public Occurrence addOccurrence(Topic topic,
Locator loc)
throws TopicMapException
TopicMapExceptionpublic void editOccurrence()
public void removeOccurrence()
public boolean removeOccurrence(Topic topic,
Occurrence occur)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||