http://www.jpicedt.org

jpicedt.graphic.view
Interface AttributesViewFactory

All Known Implementing Classes:
DefaultViewFactory, DXFViewFactory, EepicViewFactory, LatexViewFactory, PstricksViewFactory, TikzViewFactory

public interface AttributesViewFactory

A factory to create objects related to Element's attributes, eg, BasicStroke's or Paint's objets. This may be considered a helper class for View's implementations and their hosting ViewFactory.

Since:
jPicEdt 1.5
Version:
$Id: AttributesViewFactory.java,v 1.3 2013/03/27 06:55:11 vincentb1 Exp $
Author:
Sylvain Reynal

Method Summary
 ArrowView createArrow(PicAttributeSet set, PicAttributeName<StyleConstants.ArrowStyle> direction)
          Returns an ArrowView for rendering arrow-related attributes using the given attribute set.
 Paint createPaintForInterior(PicAttributeSet set)
          Returns a Paint object from the given attributes, that is suited for painting the interior of a shape.
 Paint createPaintForOutline(PicAttributeSet set)
          Returns a Paint object from the given attributes, that is suited for painting an outline, or null if LINE_STYLE is NONE.
 Paint createPaintForShadow(PicAttributeSet set)
          Returns a Paint object suited for rendering shadows.
 Shape createShadow(PicAttributeSet set, Shape shape)
          Returns a Shape for rendering the shadow of the given Shape, whose properties are drawn from the SHADOW attribute and related attribs.
 BasicStroke createStroke(PicAttributeSet set)
          Returns a Stroke built from the given attributes ; null if LINE_STYLE=NONE.
 BasicStroke createStrokeForOverstrike(PicAttributeSet set)
          Returns a Stroke built from the OVER_STRIKE attribute.
 void paintHatches(Graphics2D g, PicAttributeSet set, Shape shape)
          paint hatches (vlines,...) depending on the FILL_STYLE attributes of the given set.
 

Method Detail

createStroke

BasicStroke createStroke(PicAttributeSet set)
Returns a Stroke built from the given attributes ; null if LINE_STYLE=NONE.

Parameters:
set - used to fetch the LINE_STYLE attributes

createStrokeForOverstrike

BasicStroke createStrokeForOverstrike(PicAttributeSet set)
Returns a Stroke built from the OVER_STRIKE attribute. Factory that don't overstrike should implement to return null.

Parameters:
set - used to fetch the OVER_STRIKE and related attributes

createPaintForOutline

Paint createPaintForOutline(PicAttributeSet set)
Returns a Paint object from the given attributes, that is suited for painting an outline, or null if LINE_STYLE is NONE.

Parameters:
set - used to fetch the LINE_COLOR attributes

createPaintForShadow

Paint createPaintForShadow(PicAttributeSet set)
Returns a Paint object suited for rendering shadows. Factory that don't support shadowing should implement to return null.

Parameters:
set - used to fetch the SHADOW and related attributes

createPaintForInterior

Paint createPaintForInterior(PicAttributeSet set)
Returns a Paint object from the given attributes, that is suited for painting the interior of a shape.

The returned object should depend on the FILL_STYLE and FILL_COLOR attributes of the given set.

Parameters:
set - used to fetch the SHADOW and related attributes

paintHatches

void paintHatches(Graphics2D g,
                  PicAttributeSet set,
                  Shape shape)
paint hatches (vlines,...) depending on the FILL_STYLE attributes of the given set. Factories that don't paint hatches should implement this method as an empty method.

Parameters:
shape - used to clip the hatch (ie the shape the calling view must render)

createShadow

Shape createShadow(PicAttributeSet set,
                   Shape shape)
Returns a Shape for rendering the shadow of the given Shape, whose properties are drawn from the SHADOW attribute and related attribs. Factory that don't paint shadow should implement to return null.

Parameters:
shape - the Shape under which to drop a shadow
set - used to fetch the shadow attributes
Returns:
null if no shadow should be painted.

createArrow

ArrowView createArrow(PicAttributeSet set,
                      PicAttributeName<StyleConstants.ArrowStyle> direction)
Returns an ArrowView for rendering arrow-related attributes using the given attribute set.

Parameters:
direction - LEFT_ARROW or RIGHT_ARROW

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org