sk.uniba.euromath.editor
Class RendererContext

java.lang.Object
  extended by sk.uniba.euromath.editor.RendererContext

public final class RendererContext
extends Object

The context object for renderers and editors. Processes requests for rendering with child renderers, etc. Intended to be used by renderers and editors.

Author:
Martin Vysny

Field Summary
 XMLAccess xmlAccess
          XMLAccess instance.
 
Constructor Summary
RendererContext(Map<String,CoordinatorInputKey> geneIdMapping, Map<CoordinatorInputKey,GeneDataProvider.RendererSite> rendererKeys, XMLAccess xmlAccess)
           Constructor.
 
Method Summary
 Dimension getCanvasSize(String id)
          Returns canvas size of a renderer.
 void render(String id, Graphics g, Rectangle rect)
          Deprecated. renderers should not attempt to render child nametrees. They should leave enough free space instead and leave the rendering to the editor framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlAccess

public final XMLAccess xmlAccess
XMLAccess instance.

Constructor Detail

RendererContext

RendererContext(Map<String,CoordinatorInputKey> geneIdMapping,
                Map<CoordinatorInputKey,GeneDataProvider.RendererSite> rendererKeys,
                XMLAccess xmlAccess)

Constructor.

Receives instances of two live maps - modified outside this object, in the GeneDataProvider class.

Parameters:
geneIdMapping - Maps GENE-generated ids to the coordinator input key instance. Used by renderer context to map from GENE id (provided to the renderer) to child renderer instance.
rendererKeys - maps input pipe ID to a renderer instance.
xmlAccess - the source document instance.
Method Detail

getCanvasSize

public Dimension getCanvasSize(String id)
                        throws EditorException
Returns canvas size of a renderer.

Parameters:
id - the identifier from appropriate emp:mark element.
Returns:
the canvas size in pixels.
Throws:
EditorException - if error occurs.

render

@Deprecated
public void render(String id,
                              Graphics g,
                              Rectangle rect)
            throws EditorException
Deprecated. renderers should not attempt to render child nametrees. They should leave enough free space instead and leave the rendering to the editor framework.

Asks renderer to paint its contents on given graphics into given rectangle.

The function automatically adjusts the graphics coordinate system: rect's upper-left corner becomes the starting (0, 0) point, and a clipping area is set to the rectangle. When the renderer finishes, graphics coordinate system and clip rectangle is returned to its previous state.

Parameters:
id - calls renderer with this ID.
g - graphics where to paint.
rect - here the renderer shall paint.
Throws:
EditorException - if error happens.


Copyright 2003-2003-2006 null. All Rights Reserved.