net.sf.latexdraw.glib.views.Java2D.impl
Class LArrowView

java.lang.Object
  extended by net.sf.latexdraw.glib.views.Java2D.impl.LArrowView
All Implemented Interfaces:
IViewArrow

 class LArrowView
extends java.lang.Object
implements IViewArrow

Defines a view of an arrow.

This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN

LaTeXDraw is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

08/03/2011

Since:
3.0
Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  IArrow model
          The arrow model to view.
protected  java.awt.geom.Path2D path
          The path of the view.
 
Constructor Summary
protected LArrowView(IArrow model)
          Creates the view of the arrow.
 
Method Summary
private  boolean isArrowInPositiveDirection(IPoint pt1, IPoint pt2)
           
 void paint(java.awt.Graphics2D g, java.awt.Color fColour, boolean asShadow)
          Paints the arrow.
protected  void paintArrow(java.awt.Graphics2D g, java.awt.Color lineColor)
           
protected  void paintArrow(java.awt.Graphics2D g, java.awt.Color fColour, boolean asShadow)
           
protected  void paintBarBracket(java.awt.Graphics2D g, java.awt.Color lineColor)
           
protected  void paintCircle(java.awt.Graphics2D g, java.awt.Color fillColour, java.awt.Color lineColour)
           
protected  void paintDisk(java.awt.Graphics2D g, java.awt.Color lineColour)
           
protected  void paintRoundBracket(java.awt.Graphics2D g, java.awt.Color lineColor)
           
 void updatePath()
          Updates the path of the arrow.
private  void updatePathArrow(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
           
protected  void updatePathBarEnd(double xRot, double yRot)
           
protected  void updatePathBarIn(double xRot, double yRot, IPoint pt1, IPoint pt2, double[] xs, double[] ys)
           
protected  void updatePathDiskCircleEnd(double xRot, double yRot)
           
protected  void updatePathDiskCircleIn(double xRot, double yRot, IPoint pt1, IPoint pt2)
           
protected  void updatePathDoubleLeftRightArrow(double xRot, double yRot, IPoint pt1, IPoint pt2)
           
protected  void updatePathRightLeftArrow(double xRot, double yRot, IPoint pt1, IPoint pt2)
           
protected  void updatePathRightLeftSquaredBracket(double xRot, double yRot, IPoint pt1, IPoint pt2)
           
protected  void updatePathRoundIn(double xRot, double yRot, IPoint pt1, IPoint pt2)
           
protected  void updatePathRoundLeftRightBracket(double xRot, double yRot, IPoint pt1, IPoint pt2)
           
protected  void updatePathSquareRoundEnd(double xRot, double yRot, IPoint pt1, IPoint pt2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected IArrow model
The arrow model to view.


path

protected java.awt.geom.Path2D path
The path of the view.

Constructor Detail

LArrowView

protected LArrowView(IArrow model)
Creates the view of the arrow.

Parameters:
model - The model of the arrow.
Throws:
java.lang.IllegalArgumentException - If the given arrow is null.
Since:
3.0
Method Detail

paint

public void paint(java.awt.Graphics2D g,
                  java.awt.Color fColour,
                  boolean asShadow)
Description copied from interface: IViewArrow
Paints the arrow.

Specified by:
paint in interface IViewArrow
Parameters:
g - The graphics into which the arrow will be painted.
fColour - The colour of the filling of the arrow.
asShadow - True: it is the shadow of a shape.

paintCircle

protected void paintCircle(java.awt.Graphics2D g,
                           java.awt.Color fillColour,
                           java.awt.Color lineColour)

paintDisk

protected void paintDisk(java.awt.Graphics2D g,
                         java.awt.Color lineColour)

paintRoundBracket

protected void paintRoundBracket(java.awt.Graphics2D g,
                                 java.awt.Color lineColor)

paintBarBracket

protected void paintBarBracket(java.awt.Graphics2D g,
                               java.awt.Color lineColor)

paintArrow

protected void paintArrow(java.awt.Graphics2D g,
                          java.awt.Color lineColor)

paintArrow

protected void paintArrow(java.awt.Graphics2D g,
                          java.awt.Color fColour,
                          boolean asShadow)

updatePathDiskCircleEnd

protected void updatePathDiskCircleEnd(double xRot,
                                       double yRot)

updatePathDiskCircleIn

protected void updatePathDiskCircleIn(double xRot,
                                      double yRot,
                                      IPoint pt1,
                                      IPoint pt2)

updatePathRightLeftSquaredBracket

protected void updatePathRightLeftSquaredBracket(double xRot,
                                                 double yRot,
                                                 IPoint pt1,
                                                 IPoint pt2)

updatePathBarIn

protected void updatePathBarIn(double xRot,
                               double yRot,
                               IPoint pt1,
                               IPoint pt2,
                               double[] xs,
                               double[] ys)

updatePathBarEnd

protected void updatePathBarEnd(double xRot,
                                double yRot)

updatePathArrow

private void updatePathArrow(double x1,
                             double y1,
                             double x2,
                             double y2,
                             double x3,
                             double y3,
                             double x4,
                             double y4)

updatePathRightLeftArrow

protected void updatePathRightLeftArrow(double xRot,
                                        double yRot,
                                        IPoint pt1,
                                        IPoint pt2)

isArrowInPositiveDirection

private boolean isArrowInPositiveDirection(IPoint pt1,
                                           IPoint pt2)

updatePathRoundLeftRightBracket

protected void updatePathRoundLeftRightBracket(double xRot,
                                               double yRot,
                                               IPoint pt1,
                                               IPoint pt2)

updatePathDoubleLeftRightArrow

protected void updatePathDoubleLeftRightArrow(double xRot,
                                              double yRot,
                                              IPoint pt1,
                                              IPoint pt2)

updatePathSquareRoundEnd

protected void updatePathSquareRoundEnd(double xRot,
                                        double yRot,
                                        IPoint pt1,
                                        IPoint pt2)

updatePathRoundIn

protected void updatePathRoundIn(double xRot,
                                 double yRot,
                                 IPoint pt1,
                                 IPoint pt2)

updatePath

public void updatePath()
Updates the path of the arrow.

Specified by:
updatePath in interface IViewArrow
Since:
3.0