http://www.jpicedt.org

jpicedt.format.output.eepic
Class EepicViewFactory

java.lang.Object
  extended by jpicedt.graphic.view.DefaultViewFactory
      extended by jpicedt.format.output.eepic.EepicViewFactory
All Implemented Interfaces:
AttributesViewFactory, ViewFactory
Direct Known Subclasses:
LatexViewFactory

public class EepicViewFactory
extends DefaultViewFactory

A factory to create a View for a given Element when the content type for the model is Eepic.

Since:
jPicEdt 1.3.2
Version:
$Id: EepicViewFactory.java,v 1.24 2013/03/27 07:10:40 vincentb1 Exp $
Author:
Sylvain Reynal

Field Summary
protected static Color EEPIC_BLACKEN
           
protected static Color EEPIC_COLOR
           
protected static Color EEPIC_SHADE
           
protected static Color EEPIC_STROKE
           
protected static Color EEPIC_WHITEN
           
 
Fields inherited from class jpicedt.graphic.view.DefaultViewFactory
factoryMap, KEY_TEXT_FONT, TEXT_FONT_DEFAULT, TEXT_FONT_SCALE, textFont
 
Constructor Summary
EepicViewFactory()
           
 
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.
 Shape createShadow(PicAttributeSet set, Shape shape)
          paint shadow ; overriden to return null, since eepic and LaTeX don't support shadowing
 BasicStroke createStroke(PicAttributeSet set)
          Returns a Stroke built from the given attributes ; null if LINE_STYLE=NONE.
 BasicStroke createStrokeForOverstrike(PicAttributeSet set)
          paint overstrike ; overriden to return null.
 View createView(Element element)
          Create a View for the given Element by looking up the hashmap responsible for creating View's for Element's.
 void paintHatches(Graphics2D g, PicAttributeSet set, Shape shape)
          paint hatches (vlines,...) depending on the FILL_STYLE attributes of the given set.
 
Methods inherited from class jpicedt.graphic.view.DefaultViewFactory
configure, createPaintForShadow, getMappedClass, main, map, toString, unmap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EEPIC_STROKE

protected static final Color EEPIC_STROKE

EEPIC_WHITEN

protected static final Color EEPIC_WHITEN

EEPIC_SHADE

protected static final Color EEPIC_SHADE

EEPIC_BLACKEN

protected static final Color EEPIC_BLACKEN

EEPIC_COLOR

protected static final Color EEPIC_COLOR
Constructor Detail

EepicViewFactory

public EepicViewFactory()
Method Detail

createView

public View createView(Element element)
Description copied from class: DefaultViewFactory
Create a View for the given Element by looking up the hashmap responsible for creating View's for Element's.

Specified by:
createView in interface ViewFactory
Overrides:
createView in class DefaultViewFactory
Returns:
a View for the given Element This returns a specific Epic/Eepic view for PicEllipse, AbstractCurve and PicText. Calls superclass otherwise.

createStroke

public BasicStroke createStroke(PicAttributeSet set)
Description copied from class: DefaultViewFactory
Returns a Stroke built from the given attributes ; null if LINE_STYLE=NONE. All currently supported attributes for stroke are rendered.

Specified by:
createStroke in interface AttributesViewFactory
Overrides:
createStroke in class DefaultViewFactory
Parameters:
set - used to fetch the LINE_STYLE attributes
Returns:
a Stroke built from the given attributes ; null if LINE_STYLE=NONE. Only SOLID and DASHED (with DASH_OPAQUE only) are supported by LaTeX/Eepic

createPaintForOutline

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

All currently supported attributes for painting an outline are rendered. It's up to subclassers to adapt this behavior to their need (probably by restricting it).

Specified by:
createPaintForOutline in interface AttributesViewFactory
Overrides:
createPaintForOutline in class DefaultViewFactory
Parameters:
set - used to fetch the LINE_COLOR attributes
Returns:
a Paint from the given attributes, suited for painting outlines. Eepic only support painting in black.

createPaintForInterior

public Paint createPaintForInterior(PicAttributeSet set)
Description copied from class: DefaultViewFactory
Returns a Paint object from the given attributes, that is suited for painting the interior of a shape.

The returned object depends on the FILL_STYLE and FILL_COLOR attributes of the given set:

To sum up, all currently supported attributes (as defined in jpicedt.graphic.model.PicObjectConstants) for painting the interior of shapes are rendered. [pending] gradient (need to add some attributes).

Specified by:
createPaintForInterior in interface AttributesViewFactory
Overrides:
createPaintForInterior in class DefaultViewFactory
Parameters:
set - used to fetch the SHADOW and related attributes
Returns:
a Paint from the given attributes, suited for painting interior. Eepic support filling with black, shade (i.e. gray) and white ; return null if FILL_STYLE is NONE.

paintHatches

public void paintHatches(Graphics2D g,
                         PicAttributeSet set,
                         Shape shape)
paint hatches (vlines,...) depending on the FILL_STYLE attributes of the given set. Overriden to do nothing, since (so far) hatches aren't supported by eepic or LaTeX.

Specified by:
paintHatches in interface AttributesViewFactory
Overrides:
paintHatches in class DefaultViewFactory
shape - used to clip the hatch (i.e. the shape the calling view must render)

createShadow

public Shape createShadow(PicAttributeSet set,
                          Shape shape)
paint shadow ; overriden to return null, since eepic and LaTeX don't support shadowing

Specified by:
createShadow in interface AttributesViewFactory
Overrides:
createShadow in class DefaultViewFactory
Parameters:
set - used to fetch the shadow attributes
shape - the Shape under which to drop a shadow
Returns:
null if no shadow should be painted.

createStrokeForOverstrike

public BasicStroke createStrokeForOverstrike(PicAttributeSet set)
paint overstrike ; overriden to return null.

Specified by:
createStrokeForOverstrike in interface AttributesViewFactory
Overrides:
createStrokeForOverstrike in class DefaultViewFactory
Parameters:
set - used to fetch the overstrike attributes

createArrow

public ArrowView createArrow(PicAttributeSet set,
                             PicAttributeName<StyleConstants.ArrowStyle> direction)
Description copied from interface: AttributesViewFactory
Returns an ArrowView for rendering arrow-related attributes using the given attribute set.

Specified by:
createArrow in interface AttributesViewFactory
Overrides:
createArrow in class DefaultViewFactory
direction - LEFT_ARROW or RIGHT_ARROW
Returns:
an Arrow from the given attribute set ; Eepic supports only ArrowStyle.ARROW_HEAD null if ArrowStyle.NONE

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org