Skip to content

Commit

Permalink
Update to DiaCanvas 0.9.0 from CVS
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/arjan/backup/gaphor/trunk/gaphor@152 a8418922-720d-0410-834f-a69b97ada669
  • Loading branch information
amolenaar committed Oct 10, 2002
1 parent d7ba534 commit 21dddaa
Show file tree
Hide file tree
Showing 18 changed files with 235 additions and 130 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
@@ -1,3 +1,16 @@
2002-10-10 Arjan Molenaar <arjanmolenaar@hetnet.nl>

* configure.in, acinclude.m4: updated checks to use
pygtk.require('2.0').
* gaphor/diagram/diagramitemfactory.py: removed items can be
created through gaphor.UML.Diagram.create().
* gaphor/ui/command/diagramitem.py: new file. commands for creating
canvas items is stored here.
* gaphor/diagram/placementtool.py: Use 0.9.0 (CVS) version of
DiaCanvas2.
* gaphor/UML/diagram.py: added create() for creating nice model
elements.

2002-10-08 Arjan Molenaar <arjanmolenaar@hetnet.nl>

* gaphor/ui/placementtool.py: moved to gaphor/diagram.
Expand Down
40 changes: 40 additions & 0 deletions acinclude.m4
Expand Up @@ -170,6 +170,46 @@ else
fi
])

dnl AM_CHECK_PYMOD_2_0(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
dnl Check if a module containing a given symbol is visible to python, using
dnl GTK+-2.0.
AC_DEFUN(AM_CHECK_PYMOD_2_0,
[AC_REQUIRE([AM_PATH_PYTHON])
py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
ifelse([$2],[], [prog="
import pygtk
pygtk.require('2.0')
import sys
try:
import $1
except ImportError:
sys.exit(1)
except:
sys.exit(0)
sys.exit(0)"], [prog="
import $1
$1.$2"])
if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
then
eval "py_cv_mod_$py_mod_var=yes"
else
eval "py_cv_mod_$py_mod_var=no"
fi
])
py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
if test "x$py_val" != xno; then
AC_MSG_RESULT(yes)
ifelse([$3], [],, [$3
])dnl
else
AC_MSG_RESULT(no)
ifelse([$4], [],, [$4
])dnl
fi
])

dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
dnl function also defines PYTHON_INCLUDES
Expand Down
37 changes: 22 additions & 15 deletions configure.in
Expand Up @@ -62,18 +62,16 @@ dnl AM_CHECK_PYMOD(libxml2, , , AC_MSG_ERROR(not_found_msg))
dnl xmllib is still used by utils/genUML.py
AM_CHECK_PYMOD(xmllib, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD(copy, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD(gobject, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD(gtk, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD(gnome, , , AC_MSG_ERROR(not_found_msg))
dnl AM_CHECK_PYMOD(gnome.ui, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD(gnome.canvas, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD(diacanvas, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD(pygtk, , , AC_MSG_ERROR(not_found_msg))

AC_MSG_CHECKING(for GTK+ >= 2.0.0)
AC_MSG_CHECKING(for PyGTK >= 1.99.13)
prog="
import pygtk
pygtk.require('2.0')
import sys, gtk
minver = (2,0,0)
if gtk.gtk_version < minver:
minver = (1,99,13)
print gtk.pygtk_version,
if gtk.pygtk_version < minver:
sys.exit(1)
sys.exit(0)"
if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC; then
Expand All @@ -82,12 +80,13 @@ else
AC_MSG_ERROR(too old)
fi

AC_MSG_CHECKING(for PyGTK >= 1.99.12)
AC_MSG_CHECKING(for GTK+ >= 2.0.0)
prog="
import pygtk
pygtk.require('2.0')
import sys, gtk
minver = (1,99,12)
print gtk.pygtk_version,
if gtk.pygtk_version < minver:
minver = (2,0,0)
if gtk.gtk_version < minver:
sys.exit(1)
sys.exit(0)"
if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC; then
Expand All @@ -96,10 +95,18 @@ else
AC_MSG_ERROR(too old)
fi

AC_MSG_CHECKING(for DiaCanvas2 >= 0.8.0)
AM_CHECK_PYMOD_2_0(gobject, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD_2_0(gnome, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD_2_0(gnome.ui, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD_2_0(gnome.canvas, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD_2_0(bonobo, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD_2_0(bonobo.ui, , , AC_MSG_ERROR(not_found_msg))
AM_CHECK_PYMOD_2_0(diacanvas, , , AC_MSG_ERROR(not_found_msg))

AC_MSG_CHECKING(for DiaCanvas2 >= 0.9.0 from CVS)
prog="
import sys, diacanvas
minver = (0,8,0)
minver = (0,9,0)
print diacanvas.diacanvas_version,
if diacanvas.diacanvas_version < minver:
sys.exit(1)
Expand Down
4 changes: 3 additions & 1 deletion data/gaphor-diagram-ui.xml
Expand Up @@ -30,7 +30,9 @@
</submenu>

<submenu name="Insert" _label="_Insert">
<placeholder name="InsertElement"/>
<menuitem name="InsertActor" _label="Actor" verb="InsertActor"/>
<menuitem name="InsertUseCase" _label="UseCase" verb="InsertUseCase"/>
<menuitem name="InsertClass" _label="Class" verb="InsertClass"/>
</submenu>
</menu>

Expand Down
36 changes: 36 additions & 0 deletions doc/capabilities.txt
@@ -0,0 +1,36 @@
Gaphor capabilities
~~~~~~~~~~~~~~~~~~~

One nice feature of user interfaces is the ability to disable options that
don't do anything useful in a specific context. For example: it's useles to
enable a 'undo' button when there's no information to undo.

To solve this two possible solutions can be provided:
1. special listeners are installed to intercept state changes and act
2. declarative: a (limited) set of 'capabilities' is provided. Each command
supports one or more capabilities.


Standard capabilities:
All UML metamodel classes can act as capability. Commands can only be
useful for a limited set of data elements (for example for Namespace like
elements). These capabilities can be assigned by giving the name of the
elements(s) that can be affected using a command as a string ('Namespace').
This option is most useful for popup menus.

Main window capabilities:
Some actions are quite useless to do, like saving a model, while there is
no model.
For a start we will distinguish the following caps.:
- 'element': there are model elements defined in the main element factory.

Diagram window capabilities:
- 'focus': there is an item selected in a diagram and it has the focus.
- 'select': one ot more items in the diagram are selected.
- 'undo': there is undo information present in the diagram.
- 'redo': there is redo information present in the diagram.

DiagramItems can not be used as capability. The reason is that the UML
model has a stable design, while the implementation of diagrams and diagram
items is likely to change much often.

0 comments on commit 21dddaa

Please sign in to comment.