sk.uniba.euromath.gene
Class RenderingHints

java.lang.Object
  extended by sk.uniba.euromath.gene.RenderingHints

public class RenderingHints
extends Object

DRAFT - currently not used by the GENE framework.

When rendering, a renderer may give some hints (like pen style and color) to a child renderer. This object serves for transferring such information.

Child renderer may choose to ignore any (or all) of there parameters, especially when its data source requires it to do so.

The class may be overriden and renderers may use extended version with extra attributes to communicate with each other. Each renderer must be ready to understand this basic implementation though.

This class is immutable and should be kept immutable when creating successor classes.

Author:
Martin Vysny

Field Summary
 RGB backgroundColor
          The background color.
 Font font
          Current font.
 RGB foregroundColor
          Current foreground color.
 boolean opaque
           States whether the child renderer may draw freely on opaque background, or if it should avoid drawing a background.
static RenderingHints ROOT_RENDERER_HINTS
          Hints received by the root renderer.
 
Constructor Summary
RenderingHints(boolean opaque, RGB backgroundColor, RGB foregroundColor, Font font)
          Constructor.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

opaque

public final boolean opaque

States whether the child renderer may draw freely on opaque background, or if it should avoid drawing a background.

If parent renderer draws its own background and wants the child renderer to draw transparently it may set this property to false. In this case, child renderer should generally avoid for example filling huge portions of canvas, unless specified by the datasource.


backgroundColor

public final RGB backgroundColor
The background color. If null then no default color is provided - child renderer should use its default foreground color.


foregroundColor

public final RGB foregroundColor
Current foreground color. Generally, child renderer should begin to draw with this color unless specified otherwise by its datasource and/or specification. If null then no default color is provided - child renderer should use its default foreground color.


font

public final Font font
Current font. Generally, child renderer should draw text with this font unless specified otherwise by its datasource.


ROOT_RENDERER_HINTS

public static final RenderingHints ROOT_RENDERER_HINTS
Hints received by the root renderer.

Constructor Detail

RenderingHints

public RenderingHints(boolean opaque,
                      RGB backgroundColor,
                      RGB foregroundColor,
                      Font font)
Constructor.

Parameters:
opaque - if true then child should draw its own background.
backgroundColor - current background color. If opaque == false it may be ignored.
foregroundColor - current foreground color.
font - current font.


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