public class SwapPlayers extends AbstractWandoraTool implements WandoraTool
Changes given associations by swapping two players in associations. For example, if binary association contains players with roles P1:R1 and P2:R2 then player swap results association with players P2:R1 and P1:R2.
If given associations are not binary then selected columns in association table indicate swapped players. If selection contains more or less than two columns tool aborts.
Tool can be used to fix symmetric associations where roles have almost same semantic meaning. For example RDF triplets are directed and RDF import may result symmetric association duplicates that are not elegant in topic maps. Swapping players of such symmetric association duplicates causes Wandora to merge symmetric associations.
DeleteSymmetricAssociation
,
CreateSymmetricAssociation
,
Serialized FormModifier and Type | Field and Description |
---|---|
private boolean |
requiresRefresh |
Constructor and Description |
---|
SwapPlayers() |
SwapPlayers(Context preferredContext) |
Modifier and Type | Method and Description |
---|---|
void |
execute(Wandora admin,
Context context)
Runs the tool.
|
java.lang.String |
getDescription()
AdminToolManager views tool descriptions while user browses available
tools and build user customizable GUI elements such as Tools menu.
|
java.lang.String |
getName()
Tools name represent the tool in UI unless the tool has been given
explicitly another GUI name.
|
boolean |
requiresRefresh()
If any visible topic has been changed during tool execution GUI is
automatically refreshed.
|
int |
swapPlayers(Association association,
Topic role1,
Topic role2) |
addUndoMarker, addUndoMarker, allowMultipleInvocations, clearAllThreads, clearThreads, clearThreads, clearToolLock, clearToolLock, clearToolLocks, configure, execute, execute, forceStop, forceStop, getContext, getCurrentLogger, getDefaultLogger, getHistory, getIcon, getLastLogger, getState, getThreads, getThreads, getToolMenuItem, getToolMenuItem, getTopicName, getType, hlog, initialize, interruptAllThreads, interruptThreads, interruptThreads, isConfigurable, isRunning, isRunning, lockLog, log, log, log, log, run, runInOwnThread, setContext, setDefaultLogger, setLogTitle, setProgress, setProgressMax, setState, setToolLogger, singleLog, singleLog, singleLog, solveContextTopicMap, solveNameForTopicMap, writeOptions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure, execute, execute, getContext, getIcon, getToolMenuItem, getType, hlog, initialize, isConfigurable, isRunning, log, log, log, log, setContext, setToolLogger, writeOptions
forceStop, getHistory, getState, lockLog, setLogTitle, setProgress, setProgressMax, setState
public SwapPlayers()
public SwapPlayers(Context preferredContext)
public java.lang.String getName()
AbstractWandoraTool
getName
in interface WandoraTool
getName
in class AbstractWandoraTool
public java.lang.String getDescription()
AbstractWandoraTool
getDescription
in interface WandoraTool
getDescription
in class AbstractWandoraTool
public boolean requiresRefresh()
AbstractWandoraTool
If any visible topic has been changed during tool execution GUI is automatically refreshed. If tool doesn't change topics but GUI still requires refresh, tool should override this method and return true.
For example tools that alter the GUI but change no topics should return true.
requiresRefresh
in interface WandoraTool
requiresRefresh
in class AbstractWandoraTool
public void execute(Wandora admin, Context context) throws TopicMapException
WandoraTool
execute
in interface WandoraTool
TopicMapException
public int swapPlayers(Association association, Topic role1, Topic role2)
Copyright 2004-2015 Wandora Team