Class EepicViewFactory

  • All Implemented Interfaces:
    PicObjectConstants, 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.12.2.1 2007/09/02 11:55:13 reynal Exp $

    Author:
    Sylvain Reynal
    • Field Detail

      • EEPIC_STROKE

        protected static final java.awt.Color EEPIC_STROKE
      • EEPIC_WHITEN

        protected static final java.awt.Color EEPIC_WHITEN
      • EEPIC_SHADE

        protected static final java.awt.Color EEPIC_SHADE
      • EEPIC_BLACKEN

        protected static final java.awt.Color EEPIC_BLACKEN
      • EEPIC_COLOR

        protected static final java.awt.Color EEPIC_COLOR
    • Constructor Detail

      • EepicViewFactory

        public EepicViewFactory()
    • Method Detail

      • createView

        public View createView​(Element element)
        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

        protected java.awt.Stroke createStroke​(PicAttributeSet set)
        Overrides:
        createStroke in class DefaultViewFactory
        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

        protected java.awt.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).

        Overrides:
        createPaintForOutline in class DefaultViewFactory
        Returns:
        a Paint from the given attributes, suited for painting outlines. Eepic only support painting in black.
      • createPaintForInterior

        protected java.awt.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:

        • FILL_STYLE = NONE: returns null
        • FILL_STYLE = SOLID, VLINES, VLINES_FILLED, HLINES, HLINES_FILLED, CROSSHATCH and CROSSHATCH_FILLED: returns a Color object created from FILL_COLOR.
        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).
        Overrides:
        createPaintForInterior in class DefaultViewFactory
        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

        protected void paintHatches​(java.awt.Graphics2D g,
                                    PicAttributeSet set,
                                    java.awt.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.
        Overrides:
        paintHatches in class DefaultViewFactory
        shape - used to clip the hatch (ie the shape the calling view must render)
      • paintShadow

        protected void paintShadow​(java.awt.Graphics2D g,
                                   PicAttributeSet set,
                                   java.awt.Shape shape)
        paint shadow ; overriden to do nothing, since eepic and LaTeX don't support shadowing
        Overrides:
        paintShadow in class DefaultViewFactory
        set - used to fetch the shadow attributes
        shape - the Shape under which to drop a shadow
      • paintOverStrike

        protected void paintOverStrike​(java.awt.Graphics2D g,
                                       PicAttributeSet set,
                                       java.awt.Shape shape)
        paint overstrike ; overriden to do nothing
        Overrides:
        paintOverStrike in class DefaultViewFactory
        set - used to fetch the overstrike attributes
        shape - the Shape to overstrike