Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
3214afe8
Commit
3214afe8
authored
Aug 13, 2012
by
Chen Wenwen
Browse files
now with Code Specification and Mode Automaton in report
refs 290
parent
74ccd488
Changes
4
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.mira.ui/trunk/src/org/fortiss/af3/mira/ui/action/ExportImagesAction.java
View file @
3214afe8
...
...
@@ -75,6 +75,7 @@ public class ExportImagesAction extends EObjectActionBase<EObject> {
private
void
exportImages
(
IImageContainer
element
)
{
for
(
ImageItem
imageItem
:
element
.
getImages
())
{
try
{
copyFile
(
getImageFile
(
imageItem
),
new
File
(
imageFolder
,
imageItem
.
getPath
()));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
org.fortiss.af3.mira.ui/trunk/src/org/fortiss/af3/mira/ui/action/ExportSpecificationImagesAction.java
View file @
3214afe8
...
...
@@ -49,7 +49,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
* @author kisslinger
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash:
DA83B80EFA65F11B9BB97E1D0EE32313
* @ConQAT.Rating YELLOW Hash:
A5C14674D90033453A61FC393CC140C6
*/
public
class
ExportSpecificationImagesAction
extends
EObjectActionBase
<
EObject
>
{
/** folder which should contain the images in the end */
...
...
@@ -96,9 +96,7 @@ public class ExportSpecificationImagesAction extends EObjectActionBase<EObject>
}
// export formal specifications
EList
<
FormalSpecification
>
formalSpecs
=
pickInstanceOf
(
FormalSpecification
.
class
,
req
.
getContainedElementsList
());
for
(
FormalSpecification
formalSpec
:
formalSpecs
)
{
for
(
FormalSpecification
formalSpec
:
req
.
getFormalSpecifications
())
{
handleExportComponent
(
formalSpec
.
getTopComponent
());
}
...
...
@@ -114,9 +112,11 @@ public class ExportSpecificationImagesAction extends EObjectActionBase<EObject>
if
(
hasStateAutomaton
(
component
))
{
handleExportState
(
getStateAutomaton
(
component
).
getRootState
());
}
else
if
(
getModeAutomaton
(
component
)
!=
null
)
{
}
if
(
getModeAutomaton
(
component
)
!=
null
)
{
handleExportMode
(
getModeAutomaton
(
component
).
getRootMode
());
}
else
if
((!
component
.
getSubComponents
().
isEmpty
())
||
}
if
((!
component
.
getSubComponents
().
isEmpty
())
||
!(
component
.
getContainer
()
instanceof
Component
))
{
// the component view must be exported if the component contains sub-components or if it
// is the top-component
...
...
org.fortiss.af3.mira/trunk/src/org/fortiss/af3/mira/command/ExportReportCommand.java
View file @
3214afe8
...
...
@@ -40,7 +40,7 @@ import com4j.Variant;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
GREEN
Hash:
108FEA61E5570F9D916ECC0A683528E2
* @ConQAT.Rating
YELLOW
Hash:
FFF61993A57A4345B41EE434EFC2A0A6
*/
public
class
ExportReportCommand
implements
Callable
<
Object
>
{
...
...
@@ -69,6 +69,7 @@ public class ExportReportCommand implements Callable<Object> {
public
Object
call
()
throws
Exception
{
String
templateURI
=
getResourceURI
(
PLUGIN_ID
,
template
);
String
output
=
execute
(
templateURI
,
getContextFor
(
modelElement
));
PrintWriter
htmOutput
=
new
PrintWriter
(
htmFile
);
htmOutput
.
print
(
output
);
htmOutput
.
close
();
...
...
org.fortiss.af3.mira/trunk/src/org/fortiss/af3/mira/report/ContextFactory.java
View file @
3214afe8
...
...
@@ -62,7 +62,7 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash:
0385CA172E7ABF89F78199D7130EE142
* @ConQAT.Rating YELLOW Hash:
18E25AE4D80B3F5F48941CE17A64AC87
*/
public
class
ContextFactory
{
...
...
@@ -157,13 +157,13 @@ public class ContextFactory {
ctx
.
defineContextList
(
"formalspecs_short"
);
ctx
.
defineContextList
(
"formalspecs"
);
for
(
FormalSpecification
formalSpec
:
EcoreUtils
.
pickInstanceOf
(
FormalSpecification
.
class
,
r
.
getContainedElementsList
()))
{
for
(
FormalSpecification
formalSpec
:
r
.
getFormalSpecifications
())
{
EvaluationContext
nestctx
=
new
EvaluationContext
();
nestctx
.
set
(
"name"
,
formalSpec
.
getName
());
ctx
.
addContext
(
"formalspecs_short"
,
nestctx
);
handleTopComponent
(
formalSpec
.
getTopComponent
(),
formalSpec
.
getName
(),
ctx
,
"formalspecs"
);
}
ctx
.
set
(
"comments"
,
r
.
getComment
());
...
...
@@ -227,11 +227,11 @@ public class ContextFactory {
private
static
void
handleTopComponent
(
Component
topComponent
,
String
nameToUse
,
EvaluationContext
ctx
,
String
listName
)
{
ctx
.
addContext
(
listName
,
getPictureContextFor
(
topComponent
,
nameToUse
));
for
(
Component
subComponent
:
EcoreUtils
.
pickInstanceOf
(
Component
.
class
,
topComponent
.
getContainedElementsList
()))
{
handleComponent
(
subComponent
,
ctx
,
listName
);
}
}
/**
...
...
@@ -248,15 +248,9 @@ public class ContextFactory {
.
getRootState
().
getContainedElementsList
()))
{
handleState
(
subState
,
ctx
,
listName
);
}
}
else
if
(
getModeAutomaton
(
component
)
!=
null
)
{
ModeAutomaton
modeAutomaton
=
getModeAutomaton
(
component
);
ctx
.
addContext
(
listName
,
getPictureContextFor
(
modeAutomaton
.
getRootMode
(),
component
.
getName
()));
for
(
Mode
subMode
:
EcoreUtils
.
pickInstanceOf
(
Mode
.
class
,
modeAutomaton
.
getRootMode
()
.
getContainedElementsList
()))
{
handleMode
(
subMode
,
ctx
,
listName
);
}
}
else
if
(
getCodeSpecification
(
component
)
!=
null
)
{
}
if
(
getCodeSpecification
(
component
)
!=
null
)
{
EvaluationContext
nestctx
=
new
EvaluationContext
();
nestctx
.
set
(
"name"
,
component
.
getName
());
nestctx
.
set
(
"has_text"
,
true
);
...
...
@@ -264,7 +258,19 @@ public class ContextFactory {
nestctx
.
set
(
"text"
,
formatStatements
((
getCodeSpecification
(
component
).
getBody
()).
toString
()));
ctx
.
addContext
(
listName
,
nestctx
);
}
else
if
((!
component
.
getSubComponents
().
isEmpty
())
||
}
if
(
getModeAutomaton
(
component
)
!=
null
)
{
ModeAutomaton
modeAutomaton
=
getModeAutomaton
(
component
);
ctx
.
addContext
(
listName
,
getPictureContextFor
(
modeAutomaton
.
getRootMode
(),
component
.
getName
()));
for
(
Mode
subMode
:
EcoreUtils
.
pickInstanceOf
(
Mode
.
class
,
modeAutomaton
.
getRootMode
()
.
getContainedElementsList
()))
{
handleMode
(
subMode
,
ctx
,
listName
);
}
}
if
((!
component
.
getSubComponents
().
isEmpty
())
||
!(
component
.
getContainer
()
instanceof
Component
))
{
ctx
.
addContext
(
listName
,
getPictureContextFor
(
component
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment