|
www.sdmetrics.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--sdmetrics.app.Controller
An instance of Controller is used to start the metrics calculation and retrieve the metric data.
Use the controller as follows:
SDMessageHandler object for progress and
error reporting.
setXMIProgressHandler(sdmetrics.app.SDMessageHandler) to register a message handler for these.
ProjectSettings object for the XMI file
you want to process.
doproject(sdmetrics.app.ProjectSettings) with your project settings.SDMessageHandler.finishedComputation() or SDMessageHandler.error(java.lang.String)
on your message handler.
getMetricData(), descriptive statistics getDescStats(),
relation matrices getRelationMatrixAdapter(), design rule violations
getRuleCheckAdapter(), and more.
doproject(sdmetrics.app.ProjectSettings) can be called
asynchronously from a separate thread, to maintain a responsive GUI during
metric calculation.
doproject(sdmetrics.app.ProjectSettings) are possible: the
controller remembers which project files and data it processed during the last
calculation, and reuses all informationa that has not changed.
| Constructor Summary | |
Controller(SDMessageHandler wm,
sdmetrics.util.AppParameters ap)
|
|
| Method Summary | |
boolean |
doproject(ProjectSettings proj)
Perform the metrics calculation: Read metamodel, XMI transformations, metric definitions, and XMI source file, calculate all metrics. |
TreeViewCC |
getConnCompView()
Provide access to the connected component graph structures. |
TreeViewCycles |
getCycleTreeView()
Provide access to the cycle graph structures. |
DescStats |
getDescStats()
Provide access to the descriptive statistics. |
java.lang.String |
getLog()
Get a copy of the messages sent to the message handler during the last calculation run. |
MeasurementCatalog |
getMetricCatalog()
Provide access to the measurement catalog. |
TableView |
getMetricData()
Provide access to the metric data. |
ElementPoolAdapter |
getModel()
Provide access to the UML model (for the "Dump UML model" feature). |
RelMatrixAdapter |
getRelationMatrixAdapter()
Provide access to the relation matrices. |
RuleCheckAdapter |
getRuleCheckAdapter()
Provide access to the design rule checker. |
TreeView |
getTreeView()
Provide access to the UML model elements in a Swing tree. |
void |
reportXMIProgress(java.lang.String msg)
Callback function for the XMIReader to report its progress messages. |
void |
setMessageHandler(SDMessageHandler handler)
Register a new message handler. |
void |
setXMIProgressHandler(SDMessageHandler handler)
Register a message handler for progress messages of the XMI reader. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Controller(SDMessageHandler wm,
sdmetrics.util.AppParameters ap)
wm - Object to handle progress and error messages that are reported
while metrics are calculated.ap - Object that knows the default project files (metamodel, metric
definition file, etc.)| Method Detail |
public boolean doproject(ProjectSettings proj)
proj - The project settings specifying the XMI and XML source files to analyze.
false if an error occured, true if calculation was successful.public RelMatrixAdapter getRelationMatrixAdapter()
ProjectSettings.requireRelMatrices()),
the matrices may have already been calculated or not. In the latter case,
you still need to call
calculateMatrices() on the returned object.
RelMatrixAdapter object to calculate and access
the relation matrices.public RuleCheckAdapter getRuleCheckAdapter()
ProjectSettings.requireDesignRules()),
the design rules may have already been checked or not. In the latter case,
you still need to call
checkRules() on the returned object.
RuleCheckAdapter object to check design rules and
access design rule violations.public MeasurementCatalog getMetricCatalog()
MeasurementCatalog object to access detailed descriptions
of metrics, rules, etc.public ElementPoolAdapter getModel()
ElementPoolAdapter object to access the UML Model.public TableView getMetricData()
ProjectSettings.requireDesignRules()),
the metric data may have already been pre-calculated or not. In the latter case,
metric data will be calculated on demand when querying metric values.
TableView object to access the metric data.public DescStats getDescStats()
DescStats object to access the descriptive statistics
for the metric data.public TreeView getTreeView()
TreeView object with nodes to build a JTree.public TreeViewCC getConnCompView()
TreeViewCC object from which to pull the connected component trees.public TreeViewCycles getCycleTreeView()
TreeViewCycles object from which to pull the cycle tree structures.public java.lang.String getLog()
public void reportXMIProgress(java.lang.String msg)
XMIReader to report its progress messages.
reportXMIProgress in interface XMIReader.ProgressMessageHandlermsg - Message of the XMI reader to display.public void setXMIProgressHandler(SDMessageHandler handler)
handler - The message handler object. Only the
SDMessageHandler.message(java.lang.String, int) will be called, with negative progress values.
The object can be the same one as specified in the constructor, a different
object, or null if you don't want to display the messages
of the XMI reader.public void setMessageHandler(SDMessageHandler handler)
handler - The new message handler object.
|
www.sdmetrics.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||