Skip to content
GitLab
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
328d7b8a
Commit
328d7b8a
authored
Jul 02, 2013
by
Christoph Döbber
Browse files
working on import/export
refs 1007
parent
fd8054a2
Changes
4
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.mira.ui/trunk/src/org/fortiss/af3/mira/ui/editor/images/ImageBox.java
View file @
328d7b8a
...
...
@@ -154,9 +154,7 @@ public class ImageBox {
try
{
// open the file in the system image viewer when the user
// clicks on the picture
getDesktop
().
open
(
new
File
(
new
File
(
getDefaultGeneralProjectPath
(),
"images"
),
imageItem
.
getUri
()));
getDesktop
().
open
(
new
File
(
getDefaultGeneralProjectPath
(),
imageItem
.
getUri
()));
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
...
...
org.fortiss.af3.mira.ui/trunk/src/org/fortiss/af3/mira/ui/editor/images/ImageSection.java
View file @
328d7b8a
...
...
@@ -182,8 +182,8 @@ public class ImageSection {
ioe
.
printStackTrace
();
return
;
}
newItem
.
setUri
(
new
File
(
PROJECT_IMAGE_SUBFOLDER
,
destFile
.
getName
()).
getPath
()
);
String
uri
=
new
File
(
PROJECT_IMAGE_SUBFOLDER
,
destFile
.
getName
()).
getPath
();
newItem
.
setUri
(
uri
);
ICommandStackService
.
INSTANCE
.
runAsCommand
(
editedObject
,
new
Runnable
()
{
@Override
...
...
org.fortiss.af3.mira.ui/trunk/src/org/fortiss/af3/mira/ui/utils/ImageUtils.java
View file @
328d7b8a
...
...
@@ -142,8 +142,8 @@ public class ImageUtils {
/**
* Returns the file with the absolute path for the image item. For the image only its name
* is saved
because
the location
is always
the image folder in the AF3
* Project directory. Like this the data can easily exchanged and the
* is saved
along with
the location
of
the image folder in the AF3
* Project directory. Like this the data can easily
be
exchanged and the
* system-dependent absolute path is only generated if needed.
*
* @param item
...
...
@@ -151,7 +151,6 @@ public class ImageUtils {
* @return the absolute path
*/
public
static
File
getImageFile
(
ImageItem
item
)
{
File
f1
=
new
File
(
getDefaultGeneralProjectPath
(),
PROJECT_IMAGE_SUBFOLDER
);
return
new
File
(
f1
,
item
.
getUri
());
return
new
File
(
getDefaultGeneralProjectPath
(),
item
.
getUri
());
}
}
org.fortiss.af3.mira/trunk/src/org/fortiss/af3/mira/model/migration/AnalysisMigrationProvider.java
View file @
328d7b8a
...
...
@@ -70,7 +70,8 @@ public class AnalysisMigrationProvider implements IMigrationProvider {
migrateRequirements1057
((
Analysis
)
projectRootElement
);
migrateRequirementRelations1005
((
Analysis
)
projectRootElement
);
// TODO (CD) remove after release of 2.4 AUG 2013
// TODO (CD) remove after release of 2.4 AUG 2013 as well as additional attributes
// in ecore
migrateImageAndFileURIs1007
((
Analysis
)
projectRootElement
);
}
...
...
@@ -121,7 +122,8 @@ public class AnalysisMigrationProvider implements IMigrationProvider {
* @param analysis
*/
private
void
migrateImageAndFileURIs1007
(
Analysis
analysis
)
{
String
oldImagesFolder
=
"images"
;
final
String
PROJECT_IMAGE_SUBFOLDER
=
"images"
;
TreeIterator
<
EObject
>
iterator
=
analysis
.
eAllContents
();
while
(
iterator
.
hasNext
())
{
EObject
object
=
iterator
.
next
();
...
...
@@ -130,7 +132,7 @@ public class AnalysisMigrationProvider implements IMigrationProvider {
if
(
item
.
getUrl
()
!=
null
)
{
File
f
=
new
File
(
item
.
getUrl
());
if
(
f
.
exists
())
{
item
.
setUri
(
new
File
(
f
.
getParent
(),
f
.
getName
()).
getPath
());
item
.
setUri
(
new
File
(
f
.
getParent
File
().
getName
(),
f
.
getName
()).
getPath
());
}
else
{
item
.
setUri
(
item
.
getUrl
());
}
...
...
@@ -140,7 +142,7 @@ public class AnalysisMigrationProvider implements IMigrationProvider {
if
(
object
instanceof
ImageItem
)
{
ImageItem
item
=
(
ImageItem
)
object
;
if
(
item
.
getPath
()
!=
null
)
{
item
.
setUri
(
oldImagesFolder
+
item
.
getPath
());
item
.
setUri
(
new
File
(
PROJECT_IMAGE_SUBFOLDER
,
item
.
getPath
())
.
getPath
());
item
.
setPath
(
null
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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