Mig-infocom MiG Calendar Getting Started Guide Manual de usuario Pagina 27

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 31
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 26
MiG InfoCom AB
global map. Look at the JavaDoc for
DefaultAShapeProvider for how to do this. Then just
set the paintContext on the activities to the same
context as you mapped in in the renderer and everything
will be handled automatically. You can even use the static
method
DefaultAShapeProvider.setShapeGlobally(..) to
set it, which is the simplest solution. The null context in
the global map will give you the global fall back shape and
the only installed by default. That one can be exchanged
to make the mapping for the whole application.
There are quite a few different ways to inject your own
RootAShape that should be used for painting those
activities. Which way you choose depends on how late in the
decision process you want to inject it. Earlier gives you more
choice on the actual implementation and later gives you
more help from the framework, and you have to used a
RootAShape.
Here is the outline of the process of painting the
ActivityViews, as short as possible:
The GridDecorator that is installed in the
DefaultDateArea to paint the activities is a
ActivityViewDecorator. It is using a AShapeRenderer
to do the actual painting. That renderer gets the
RootAShape to use from its DefaultAShapeProvider.
That factory always has a default RootAShape to return
(from the global map with paintContext null), and you
can even change that one. On the actual
DefaultAShapeProvider you can change the mapping
between a paintContext and a RootAShape, you can also
change it globally with a static method.
At last, some code. First #2:
DefaultDateArea dateArea = (DefaultDateArea) container.getDateArea();
AShapeRenderer r = (AShapeRenderer) dateArea.getActivityViewRenderer();
r.getShapeProvider().settShape(root, null);
container.getDateArea().recreateActivityViews(); // The views caches the shapes..
or
DefaultAShapeProvider.setShapeGlobally(root, null); // Changes for ALL
This will add the root shape we created a bit up. It will be a
blue rectangle filling the exact bounds of the date range it
represents. It can not be interacted with since we haven't set
MiG Calendar Getting Started Guide Page 27 / 31
Explanatio
n
Vista de pagina 26
1 2 ... 22 23 24 25 26 27 28 29 30 31

Comentarios a estos manuales

Sin comentarios