net.sf.latexdraw.glib.views.Java2D.interfaces
Interface IViewShape

All Superinterfaces:
IAbstractView, Pickable
All Known Subinterfaces:
IViewArc, IViewBezierCurve, IViewDot, IViewModifiablePtsShape, IViewRectangle, IViewText
All Known Implementing Classes:
LArcView, LAxesView, LBezierCurveView, LCircleArcView, LCircleView, LDotView, LEllipseView, LFreeHandView, LGridView, LGroupView, LModifiablePointsShapeView, LPictureView, LPolygonView, LPolylineView, LRectangleView, LRectangularView, LRhombusView, LShapeView, LSquareView, LStandardGridView, LTextView, LTriangleView

public interface IViewShape
extends IAbstractView, Pickable

This interface defines a view of a shape.

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.

11/14/2010

Since:
3.0
Author:
Arnaud BLOUIN

Method Summary
 boolean contains(double x, double y)
          Tests if the given point is into the pickable object.
 boolean contains(IPoint pt)
          Allows to know if the point pt is in (or not) the shape.
 void flush()
          Removes and flushes the used resources and temporary documents.
 java.awt.geom.Rectangle2D getBorder()
           
 java.awt.geom.Path2D getPath()
           
 java.awt.Shape getRotatedShape2D()
          This function creates the corresponding rotated Java shape using the shape model.
 java.awt.BasicStroke getStroke()
          Creates and returns a stroke corresponding to the current parameters of the shape model.
 boolean intersects(java.awt.geom.Rectangle2D rec)
           
 void paint(java.awt.Graphics2D g)
          Draws the shape within a Java2D graphics.
 void paintBorders(java.awt.Graphics2D g)
          Draws the borders of the shape within a Java2D graphics.
 void paintFilling(java.awt.Graphics2D g)
          Fills the shape within a Java2D graphics.
 void paintShadow(java.awt.Graphics2D g)
          Draws the shadow of the shape within a Java2D graphics.
 void paintShowPointsDots(java.awt.Graphics2D g)
          Paints the dots of the option 'show points'.
 void paintShowPointsLines(java.awt.Graphics2D g)
          Paints the lines of the option 'show points'.
 void updateBorder()
          Update the border of the shape view.
 void updatePath()
          Updates the path of the shape.
 
Methods inherited from interface net.sf.latexdraw.glib.views.IAbstractView
getShape, update
 
Methods inherited from interface org.malai.picking.Pickable
getPicker
 

Method Detail

paint

void paint(java.awt.Graphics2D g)
Draws the shape within a Java2D graphics.

Parameters:
g - The graphics where the shape must be drawn.
Since:
3.0

paintBorders

void paintBorders(java.awt.Graphics2D g)
Draws the borders of the shape within a Java2D graphics.

Parameters:
g - The graphics where the shape must be drawn.
Since:
3.0

paintShadow

void paintShadow(java.awt.Graphics2D g)
Draws the shadow of the shape within a Java2D graphics.

Parameters:
g - The graphics where the shape must be drawn.
Since:
3.0

paintShowPointsLines

void paintShowPointsLines(java.awt.Graphics2D g)
Paints the lines of the option 'show points'.

Parameters:
g - The graphics.
Since:
3.0

paintShowPointsDots

void paintShowPointsDots(java.awt.Graphics2D g)
Paints the dots of the option 'show points'.

Parameters:
g - The graphics.
Since:
3.0

paintFilling

void paintFilling(java.awt.Graphics2D g)
Fills the shape within a Java2D graphics.

Parameters:
g - The graphics where the shape must be drawn.
Since:
3.0

contains

boolean contains(IPoint pt)
Allows to know if the point pt is in (or not) the shape.

Parameters:
pt - The point.
Returns:
True if the point is in the shape.

contains

boolean contains(double x,
                 double y)
Description copied from interface: Pickable
Tests if the given point is into the pickable object.

Specified by:
contains in interface Pickable
Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
Returns:
True if the given point is into the pickable object.

intersects

boolean intersects(java.awt.geom.Rectangle2D rec)
Parameters:
rec - The rectangle used to check the intersection.
Returns:
True if the given rectangle intersects the view.
Since:
3.0

getRotatedShape2D

java.awt.Shape getRotatedShape2D()
This function creates the corresponding rotated Java shape using the shape model.

Returns:
The rotated shape.
Since:
3.0

getBorder

java.awt.geom.Rectangle2D getBorder()
Returns:
The border of the view.
Since:
3.0

getPath

java.awt.geom.Path2D getPath()
Returns:
The Java2D path of the view.
Since:
3.0

updatePath

void updatePath()
Updates the path of the shape.

Since:
3.0

updateBorder

void updateBorder()
Update the border of the shape view.

Since:
3.0

getStroke

java.awt.BasicStroke getStroke()
Creates and returns a stroke corresponding to the current parameters of the shape model.

Returns:
The stroke based on the thickness, the double borders and so on, of the shape. Returns null if the line style is NONE.
Since:
3.0

flush

void flush()
Removes and flushes the used resources and temporary documents.

Since:
3.0