Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
general
stups
ProB Rodin Plugin
Commits
72553957
Commit
72553957
authored
Apr 25, 2012
by
Jens Bendisposto
Browse files
Merge branch 'release/2.3.1'
parents
abe00a72
014a8e5a
Changes
206
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
72553957
**/bin/
**/target/
.gradle/
.metadata/
**/pom.xml
.DS_Store
pom.xml
updatesite/
de.prob.core/prob/
build/
de.prob.repository/category.xml
\ No newline at end of file
README.md
View file @
72553957
<img
src=
"https://github.com/bendisposto/prob/raw/develop/logo.png"
width=
"500"
align=
"center"
>
# The ProB Model Checker and Animator
The ProB source code is distributed under the EPL license (http://www.eclipse.org/org/documents/epl-v10.html).
...
...
build.gradle
0 → 100644
View file @
72553957
groupID
=
"de.prob"
features
=
[
"de.prob2.feature"
]
// must be the same as the folder name
descriptions
=
[[
"de.prob2.feature"
:
"ProB Rodin Plugin"
],[
"de.prob2.feature"
:
"""ProB is an animator and model checker for the B-Method. It allows
fully automatic animation of many B specifications, and can be
used to systematically check a specification for errors.
Part of the research and development was conducted within the
EPSRC funded projects ABCD and iMoc, and within the EU funded
project Rodin.
Development is continued under the EU funded project Deploy and
the DFG project Gepavas.
ProB has been successfully used on various industrial specifications
and is now being used within Siemens."""
]
]
// label and descriptions of the features
repositoryName
=
groupID
+
".repository"
// will be the folder name
parentID
=
groupID
+
".parent"
// will be the same as the folder name
targetRepositories
=
[
"http://cobra.cs.uni-duesseldorf.de/prob_dev_target/"
,
"http://download.eclipse.org/releases/indigo/"
]
// ps Repository with Target Definition File
apply
from:
'tycho_build.gradle'
// Local tasks
def
download
(
address
,
target
)
{
def
file
=
new
FileOutputStream
(
target
)
def
out
=
new
BufferedOutputStream
(
file
)
out
<<
new
URL
(
address
).
openStream
()
out
.
close
()
}
task
downloadCli
<<
{
dir
=
'de.prob.core/prob/'
delete
file
(
dir
)
new
File
(
dir
).
mkdirs
()
[
'leopard'
:
'macos'
,
'linux'
:
'linux'
,
'linux64'
:
'linux64'
,
'win32'
:
'windows'
].
each
{
n
=
it
.
getKey
()
targetdir
=
dir
+
it
.
getValue
()
targetzip
=
dir
+
"probcli_${n}.zip"
url
=
"http://nightly.cobra.cs.uni-duesseldorf.de/cli/probcli_${n}.zip"
download
(
url
,
targetzip
)
FileTree
zip
=
zipTree
(
targetzip
)
copy
{
from
zip
into
targetdir
}
delete
file
(
targetzip
)
}
targetdir
=
dir
+
"windows/"
targetzip
=
targetdir
+
"windowslib.zip"
download
(
"http://nightly.cobra.cs.uni-duesseldorf.de/cli/windowslib.zip"
,
targetzip
)
FileTree
zip
=
zipTree
(
targetzip
)
copy
{
from
zip
into
targetdir
}
delete
file
(
targetzip
)
}
task
collectArtifacts
(
type:
Copy
)
{
from
groupID
+
'.repository/target/repository/'
into
'updatesite'
}
de.bmotionstudio.gef.editor/META-INF/MANIFEST.MF
View file @
72553957
...
...
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: BMotion Studio Editor Plug-in
Bundle-SymbolicName: de.bmotionstudio.gef.editor;singleton:=true
Bundle-Version: 5.3.
0
Bundle-Version: 5.3.
1.qualifier
Bundle-Activator: de.bmotionstudio.gef.editor.BMotionEditorPlugin
Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
...
...
@@ -14,7 +14,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.databinding.beans;bundle-version="[1.1.1,2.0.0)",
org.eclipse.gef;bundle-version="[3.7.0,4.0.0)",
de.prob.core;bundle-version="[9.2.0,9.3.0)",
org.eventb.core;bundle-version="[2.1.0,2.
5
.0)"
org.eventb.core;bundle-version="[2.1.0,2.
6
.0)"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-BuddyPolicy: registered
...
...
de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/EditorImageRegistry.java
View file @
72553957
/**
* (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen,
* Heinrich Heine Universitaet Duesseldorf
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package
de.bmotionstudio.gef.editor
;
public
class
EditorImageRegistry
implements
IBMotionStudioImageRegistry
{
public
static
final
String
IMG_ICON_ADD
=
"icon_add"
;
public
static
final
String
IMG_ICON_CHOP
=
"icon_chop"
;
public
static
final
String
IMG_ICON_DELETE
=
"icon_delete"
;
public
static
final
String
IMG_ICON_DELETE21
=
"icon_delete21"
;
public
static
final
String
IMG_ICON_EDIT
=
"icon_edit"
;
public
static
final
String
IMG_ICON_CHECKED
=
"icon_checked"
;
public
static
final
String
IMG_ICON_UNCHECKED
=
"icon_unchecked"
;
public
static
final
String
IMG_ICON_OBSERVER
=
"icon_observer"
;
public
static
final
String
IMG_ICON_LOADING
=
"icon_loading"
;
public
static
final
String
IMG_ICON_LIBRARY
=
"icon_library"
;
public
static
final
String
IMG_ICON_ASCRIPT
=
"icon_ascript"
;
public
static
final
String
IMG_ICON_UP
=
"icon_up"
;
public
static
final
String
IMG_ICON_DOWN
=
"icon_down"
;
public
static
final
String
IMG_ICON_CONNECTION16
=
"icon_connection16"
;
public
static
final
String
IMG_ICON_CONNECTION24
=
"icon_connection24"
;
public
static
final
String
IMG_ICON_JPG
=
"icon_jpg"
;
public
static
final
String
IMG_ICON_GIF
=
"icon_gif"
;
public
static
final
String
IMG_SPLASH
=
"splash"
;
public
void
registerImages
()
{
BMotionStudioImage
.
registerImage
(
IMG_ICON_ADD
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_add.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_CHOP
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_chop.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_DELETE
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_delete.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_DELETE21
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_delete21.png"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_CHECKED
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_checked.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_UNCHECKED
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_unchecked.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_EDIT
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_edit.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_LOADING
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_loading.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_LIBRARY
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_library.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_ASCRIPT
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_ascript.png"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_UP
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_up.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_DOWN
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_down.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_CONNECTION16
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_connection16.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_CONNECTION24
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_connection24.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_JPG
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_jpg.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_GIF
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_gif.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_OBSERVER
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_observer.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_SPLASH
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/splash.jpg"
);
}
}
/**
* (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen,
* Heinrich Heine Universitaet Duesseldorf
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package
de.bmotionstudio.gef.editor
;
public
class
EditorImageRegistry
implements
IBMotionStudioImageRegistry
{
public
static
final
String
IMG_ICON_ADD
=
"icon_add"
;
public
static
final
String
IMG_ICON_CHOP
=
"icon_chop"
;
public
static
final
String
IMG_ICON_DELETE
=
"icon_delete"
;
public
static
final
String
IMG_ICON_DELETE21
=
"icon_delete21"
;
public
static
final
String
IMG_ICON_EDIT
=
"icon_edit"
;
public
static
final
String
IMG_ICON_CHECKED
=
"icon_checked"
;
public
static
final
String
IMG_ICON_UNCHECKED
=
"icon_unchecked"
;
public
static
final
String
IMG_ICON_OBSERVER
=
"icon_observer"
;
public
static
final
String
IMG_ICON_LOADING
=
"icon_loading"
;
public
static
final
String
IMG_ICON_LIBRARY
=
"icon_library"
;
public
static
final
String
IMG_ICON_ASCRIPT
=
"icon_ascript"
;
public
static
final
String
IMG_ICON_UP
=
"icon_up"
;
public
static
final
String
IMG_ICON_DOWN
=
"icon_down"
;
public
static
final
String
IMG_ICON_CONNECTION16
=
"icon_connection16"
;
public
static
final
String
IMG_ICON_CONNECTION24
=
"icon_connection24"
;
public
static
final
String
IMG_ICON_NEW_WIZ
=
"icon_new_wiz"
;
public
static
final
String
IMG_ICON_DELETE_EDIT
=
"icon_delete_edit"
;
public
static
final
String
IMG_ICON_JPG
=
"icon_jpg"
;
public
static
final
String
IMG_ICON_GIF
=
"icon_gif"
;
public
static
final
String
IMG_SPLASH
=
"splash"
;
public
void
registerImages
()
{
BMotionStudioImage
.
registerImage
(
IMG_ICON_ADD
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_add.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_CHOP
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_chop.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_DELETE
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_delete.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_DELETE21
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_delete21.png"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_CHECKED
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_checked.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_UNCHECKED
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_unchecked.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_EDIT
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_edit.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_LOADING
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_loading.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_LIBRARY
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_library.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_ASCRIPT
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_ascript.png"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_UP
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_up.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_DOWN
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_down.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_CONNECTION16
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_connection16.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_CONNECTION24
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_connection24.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_NEW_WIZ
,
"org.eclipse.ui"
,
"$nl$/icons/full/etool16/new_wiz.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_DELETE_EDIT
,
"org.eclipse.ui"
,
"$nl$/icons/full/etool16/delete_edit.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_JPG
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_jpg.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_GIF
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_gif.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_ICON_OBSERVER
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/icon_observer.gif"
);
BMotionStudioImage
.
registerImage
(
IMG_SPLASH
,
BMotionEditorPlugin
.
PLUGIN_ID
,
"icons/splash.jpg"
);
}
}
de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/action/BMotionAbstractWizard.java
View file @
72553957
...
...
@@ -32,9 +32,9 @@ public abstract class BMotionAbstractWizard extends WizardDialog {
public
static
final
int
DELETE
=
3
;
private
IWorkbenchPart
workbenchPart
;
private
String
deleteToolTip
;
private
String
deleteToolTip
;
public
BMotionAbstractWizard
(
IWorkbenchPart
workbenchPart
,
IWizard
newWizard
)
{
super
(
workbenchPart
.
getSite
().
getShell
(),
newWizard
);
this
.
workbenchPart
=
workbenchPart
;
...
...
@@ -67,8 +67,9 @@ public abstract class BMotionAbstractWizard extends WizardDialog {
}
private
Control
createDeleteControl
(
Composite
parent
)
{
return
createDeleteImageButton
(
parent
,
BMotionStudioImage
.
getImage
(
EditorImageRegistry
.
IMG_ICON_DELETE21
));
return
createDeleteImageButton
(
parent
,
BMotionStudioImage
.
getImage
(
EditorImageRegistry
.
IMG_ICON_DELETE21
));
}
private
ToolBar
createDeleteImageButton
(
Composite
parent
,
Image
image
)
{
...
...
@@ -98,7 +99,7 @@ public abstract class BMotionAbstractWizard extends WizardDialog {
public
IWorkbenchPart
getWorkbenchPart
()
{
return
workbenchPart
;
}
protected
void
setDeleteToolTip
(
String
msg
)
{
this
.
deleteToolTip
=
msg
;
}
...
...
de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/action/BMotionObserverWizard.java
View file @
72553957
...
...
@@ -8,6 +8,7 @@ package de.bmotionstudio.gef.editor.action;
import
org.eclipse.jface.dialogs.MessageDialog
;
import
org.eclipse.jface.wizard.IWizard
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.widgets.Display
;
import
org.eclipse.ui.IWorkbenchPart
;
...
...
@@ -15,6 +16,7 @@ public class BMotionObserverWizard extends BMotionAbstractWizard {
public
BMotionObserverWizard
(
IWorkbenchPart
workbenchPart
,
IWizard
newWizard
)
{
super
(
workbenchPart
,
newWizard
);
setShellStyle
(
SWT
.
CLOSE
);
setDeleteToolTip
(
"Delete Observer"
);
}
...
...
de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/action/ObserverAction.java
View file @
72553957
...
...
@@ -28,6 +28,7 @@ public class ObserverAction extends SelectionAction {
private
String
className
;
private
Observer
clonedObserver
;
private
Observer
newObserver
;
private
BControl
actionControl
;
public
ObserverAction
(
IWorkbenchPart
part
)
{
super
(
part
);
...
...
@@ -44,11 +45,14 @@ public class ObserverAction extends SelectionAction {
return
true
;
}
@Override
public
void
run
()
{
clonedObserver
=
null
;
if
(
getControl
()
!=
null
)
{
actionControl
=
getControl
();
if
(
actionControl
!=
null
)
{
newObserver
=
getControl
().
getObserver
(
getClassName
());
...
...
@@ -115,7 +119,7 @@ public class ObserverAction extends SelectionAction {
}
else
if
(
status
==
WizardDialog
.
CANCEL
)
{
if
(
clonedObserver
!=
null
)
get
Control
()
.
addObserver
(
clonedObserver
);
action
Control
.
addObserver
(
clonedObserver
);
}
else
if
(
status
==
BMotionObserverWizard
.
DELETE
)
{
RemoveObserverAction
action
=
new
RemoveObserverAction
(
...
...
@@ -137,7 +141,7 @@ public class ObserverAction extends SelectionAction {
public
ObserverCommand
createObserverCommandCommand
()
{
ObserverCommand
command
=
new
ObserverCommand
();
command
.
setClassName
(
getClassName
());
command
.
setControl
(
get
Control
()
);
command
.
setControl
(
action
Control
);
return
command
;
}
...
...
@@ -163,4 +167,5 @@ public class ObserverAction extends SelectionAction {
return
null
;
}
}
de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeConnection.java
View file @
72553957
...
...
@@ -6,6 +6,7 @@
package
de.bmotionstudio.gef.editor.attribute
;
import
org.eclipse.jface.viewers.LabelProvider
;
import
org.eclipse.ui.views.properties.PropertyDescriptor
;
public
class
BAttributeConnection
extends
AbstractAttribute
{
...
...
@@ -16,7 +17,14 @@ public class BAttributeConnection extends AbstractAttribute {
@Override
public
PropertyDescriptor
preparePropertyDescriptor
()
{
return
new
PropertyDescriptor
(
getID
(),
getName
());
PropertyDescriptor
descriptor
=
new
PropertyDescriptor
(
getID
(),
getName
());
descriptor
.
setLabelProvider
(
new
LabelProvider
()
{
public
String
getText
(
Object
element
)
{
return
""
;
}
});
return
descriptor
;
}
@Override
...
...
de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/edit/AttributeExpressionEdittingSupport.java
View file @
72553957
...
...
@@ -16,6 +16,7 @@ import org.eclipse.ui.views.properties.PropertyDescriptor;
import
de.bmotionstudio.gef.editor.attribute.AbstractAttribute
;
import
de.bmotionstudio.gef.editor.model.BControl
;
import
de.bmotionstudio.gef.editor.observer.ObserverEvalObject
;
import
de.bmotionstudio.gef.editor.util.WizardObserverUtil
;
public
class
AttributeExpressionEdittingSupport
extends
EditingSupport
{
...
...
@@ -39,7 +40,7 @@ public class AttributeExpressionEdittingSupport extends EditingSupport {
@Override
protected
boolean
canEdit
(
Object
element
)
{
return
true
;
return
WizardObserverUtil
.
isEditElement
(
getViewer
())
;
}
@Override
...
...
de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/edit/OperationValueEditingSupport.java
View file @
72553957
...
...
@@ -23,6 +23,7 @@ import de.bmotionstudio.gef.editor.eventb.MachineContentObject;
import
de.bmotionstudio.gef.editor.eventb.MachineOperation
;
import
de.bmotionstudio.gef.editor.model.BControl
;
import
de.bmotionstudio.gef.editor.scheduler.PredicateOperation
;
import
de.bmotionstudio.gef.editor.util.WizardObserverUtil
;
public
class
OperationValueEditingSupport
extends
EditingSupport
{
...
...
@@ -37,7 +38,7 @@ public class OperationValueEditingSupport extends EditingSupport {
@Override
protected
boolean
canEdit
(
Object
element
)
{
return
true
;
return
WizardObserverUtil
.
isEditElement
(
getViewer
())
;
}
@Override
...
...
@@ -71,4 +72,5 @@ public class OperationValueEditingSupport extends EditingSupport {
}
return
cellEditor
;
}
}
de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/edit/PredicateEditingSupport.java
View file @
72553957
...
...
@@ -19,6 +19,7 @@ import org.eclipse.swt.widgets.Composite;
import
org.eclipse.swt.widgets.Shell
;
import
de.bmotionstudio.gef.editor.model.Visualization
;
import
de.bmotionstudio.gef.editor.util.WizardObserverUtil
;
/**
* @author Lukas Ladenberger
...
...
@@ -54,4 +55,9 @@ public class PredicateEditingSupport extends ObservableValueEditingSupport {
return
cellEditor
;
}
@Override
protected
boolean
canEdit
(
Object
element
)
{
return
WizardObserverUtil
.
isEditElement
(
getViewer
());
}
}
de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/edit/TextEditingSupport.java
View file @
72553957
...
...
@@ -18,6 +18,8 @@ import org.eclipse.jface.viewers.ViewerCell;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.widgets.Composite
;
import
de.bmotionstudio.gef.editor.util.WizardObserverUtil
;
public
class
TextEditingSupport
extends
ObservableValueEditingSupport
{
private
TextCellEditor
cellEditor
;
...
...
@@ -50,4 +52,9 @@ public class TextEditingSupport extends ObservableValueEditingSupport {
return
cellEditor
;
}
@Override
protected
boolean
canEdit
(
Object
element
)
{
return
WizardObserverUtil
.
isEditElement
(
getViewer
());
}
}
de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/BMSImageFigure.java
View file @
72553957
/**
* (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen,
* Heinrich Heine Universitaet Duesseldorf
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package
de.bmotionstudio.gef.editor.figure
;
import
org.eclipse.draw2d.Graphics
;
import
org.eclipse.draw2d.ImageFigure
;
import
org.eclipse.draw2d.StackLayout
;
import
org.eclipse.draw2d.geometry.Rectangle
;
import
org.eclipse.swt.graphics.Image
;
public
class
BMSImageFigure
extends
AbstractBMotionFigure
{
private
ImageFigure
imageFigure
;
public
BMSImageFigure
()
{
setLayoutManager
(
new
StackLayout
());
imageFigure
=
new
ImageFigure
()
{
public
void
paintFigure
(
Graphics
g
)
{
if
(
getImage
()
==
null
)
return
;
Rectangle
rectangle
=
getClientArea
();
g
.
drawImage
(
getImage
(),
new
Rectangle
(
getImage
().
getBounds
()),
rectangle
);
}
};
add
(
imageFigure
);
}
public
void
setLayout
(
Rectangle
rect
)
{
getParent
().
setConstraint
(
imageFigure
,
rect
);
}
public
void
setImage
(
Image
image
)
{
if
(
imageFigure
.
getImage
()
!=
null
)
imageFigure
.
getImage
().
dispose
();
imageFigure
.
setImage
(
image
);
}
/*
* (non-Javadoc)
*
* @see de.bmotionstudio.gef.editor.figure.IBMotionFigure#deactivateFigure()
*/
@Override
public
void
deactivateFigure
()
{
if
(
imageFigure
.
getImage
()
!=
null
)
imageFigure
.
getImage
().
dispose
();
}
}
/**
* (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen,
* Heinrich Heine Universitaet Duesseldorf
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package
de.bmotionstudio.gef.editor.figure
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.eclipse.draw2d.ImageFigure
;
import
org.eclipse.draw2d.StackLayout
;
import
org.eclipse.draw2d.geometry.Rectangle
;
import
org.eclipse.swt.graphics.Image
;
import
org.eclipse.swt.graphics.ImageData
;
import
org.eclipse.swt.graphics.ImageLoader
;
import
org.eclipse.swt.widgets.Display
;
public
class
BMSImageFigure
extends
AbstractBMotionFigure
{
private
ImageFigure
imageFigure
;
final
ImageLoader
loader
=
new
ImageLoader
();
private
Map
<
String
,
List
<
Image
>>
images
=
new
HashMap
<
String
,
List
<
Image
>>();
private
GIFThread
currentGIFThread
;
public
BMSImageFigure
()
{
setLayoutManager
(
new
StackLayout
());
imageFigure
=
new
ImageFigure
();
add
(
imageFigure
);
}
public
void
setLayout
(
Rectangle
rect
)
{
getParent
().
setConstraint
(
imageFigure
,
rect
);
}
public
void
setImage
(
String
myPath
)
{
if
(
currentGIFThread
!=
null
)
currentGIFThread
.
interrupt
();
if
(
new
File
(
myPath
).
exists
())
{
loader
.
load
(
myPath
);
List
<
Image
>
imgList
=
images
.
get
(
myPath
);
if
(
imgList
==
null
)
{
imgList
=
new
ArrayList
<
Image
>();
for
(
ImageData
imageData
:
loader
.
data
)
imgList
.
add
(
new
Image
(
Display
.
getDefault
(),
imageData
));
images
.
put
(
myPath
,
imgList
);
}
if
(
loader
.
data
.
length
>
1
)
{
// GIF file
currentGIFThread
=
new
GIFThread
(
this
.
imageFigure
,
myPath
,
imgList
);
currentGIFThread
.
start
();
}
else
{
// Non GIF file
imageFigure
.
setImage
(
imgList
.
get
(
0
));
}