|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.glib.models.impl.LShapeFactory
public class LShapeFactory
This factory creates shapes.
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.
04/02/2010
Constructor Summary | |
---|---|
LShapeFactory()
Creates the factory. |
Method Summary | ||
---|---|---|
IArc |
createArc(boolean isUniqueID)
Creates a circled arc with a 1 radius. |
|
IArc |
createArc(IPoint tl,
IPoint br,
boolean uniqueID)
Creates an arc. |
|
IArrow |
createArrow(IArrow arrow,
IShape owner)
Creates an arrow from an other arrow. |
|
IArrow |
createArrow(IShape owner)
Creates an arrow. |
|
IAxes |
createAxes(boolean isUniqueID,
IPoint pt)
Creates axes with default values. |
|
IBezierCurve |
createBezierCurve(boolean isUniqueID)
Creates a model with no point. |
|
IBezierCurve |
createBezierCurve(IPoint point,
IPoint point2,
boolean uniqueID)
Creates a bezier curve with two points. |
|
ICircle |
createCircle(boolean isUniqueID)
|
|
ICircle |
createCircle(IPoint pt,
double radius,
boolean isUniqueID)
Creates a circle. |
|
ICircleArc |
createCircleArc(boolean isUniqueID)
Creates a circled arc with a 1 radius. |
|
ICircleArc |
createCircleArc(IPoint tl,
IPoint br,
boolean uniqueID)
Creates a circled arc. |
|
IDot |
createDot(IPoint pt,
boolean isUniqueID)
|
|
IDrawing |
createDrawing()
|
|
IEllipse |
createEllipse(boolean isUniqueID)
|
|
IEllipse |
createEllipse(IPoint tl,
IPoint br,
boolean isUniqueID)
Creates an ellipse. |
|
IFreehand |
createFreeHand(IPoint pt,
boolean uniqueID)
Creates and initialises a freehand model. |
|
IGrid |
createGrid(boolean isUniqueID,
IPoint pt)
Creates a grid with a predefined point. |
|
IGroup |
createGroup(boolean uniqueID)
|
|
ILine |
createLine(double x1,
double y1,
double x2,
double y2)
Constructs a line from the specified coordinates. |
|
ILine |
createLine(double b,
IPoint p1)
Creates a line by creating a second point with: |
|
ILine |
createLine(IPoint p1,
IPoint p2)
Constructs a line from the specified Point2D objects. |
|
IPicture |
createPicture(boolean isUniqueID,
IPoint pt)
Creates a picture and the corresponding EPS picture. |
|
IPoint |
createPoint()
|
|
IPoint |
createPoint(double x,
double y)
Creates a Point2D with the specified coordinates. |
|
IPoint |
createPoint(IPoint pt)
Creates a Point2D with the specified coordinates. |
|
IPoint |
createPoint(java.awt.Point pt)
Creates a point from the java Point. |
|
IPolygon |
createPolygon(boolean uniqueID)
|
|
IPolygon |
createPolygon(IPoint point,
IPoint point2,
boolean uniqueID)
Creates a polygon with two points. |
|
IPolyline |
createPolyline(boolean uniqueID)
|
|
IPolyline |
createPolyline(IPoint point,
IPoint point2,
boolean uniqueID)
Creates a model with two points. |
|
IRectangle |
createRectangle(boolean uniqueID)
|
|
IRectangle |
createRectangle(IPoint pos,
double width,
double height,
boolean uniqueID)
Creates a rectangle. |
|
IRectangle |
createRectangle(IPoint tl,
IPoint br,
boolean uniqueID)
Creates a rectangle. |
|
IRhombus |
createRhombus(boolean isUniqueID)
|
|
IRhombus |
createRhombus(IPoint centre,
double width,
double height,
boolean uniqueID)
Creates a rhombus. |
|
ISquare |
createSquare(boolean isUniqueID)
Creates a square at position (0,0) which width equals 10. |
|
ISquare |
createSquare(IPoint pos,
double width,
boolean isUniqueID)
Creates a square. |
|
IText |
createText(boolean isUniqueID)
Create a text at position (0,0) which text is "text". |
|
IText |
createText(boolean isUniqueID,
IPoint pt,
java.lang.String text)
Creates a text. |
|
ITriangle |
createTriangle(boolean isUniqueID)
|
|
ITriangle |
createTriangle(IPoint pos,
double width,
double height,
boolean uniqueID)
Creates a triangle. |
|
IShape |
duplicate(IShape shape)
Duplicates the given shape. |
|
|
newShape(java.lang.Class<T> shapeClass)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LShapeFactory()
Method Detail |
---|
public <T extends IShape> T newShape(java.lang.Class<T> shapeClass)
newShape
in interface IShapeFactory
shapeClass
- The class of the shape to instantiated.
public IDrawing createDrawing()
createDrawing
in interface IShapeFactory
public IArrow createArrow(IArrow arrow, IShape owner)
IShapeFactory
createArrow
in interface IShapeFactory
arrow
- The arrow to copy.owner
- The shape that contains the arrow.
public IArrow createArrow(IShape owner)
IShapeFactory
createArrow
in interface IShapeFactory
owner
- The shape that contains the arrow.
public IAxes createAxes(boolean isUniqueID, IPoint pt)
IShapeFactory
createAxes
in interface IShapeFactory
isUniqueID
- True: the model will have a unique ID.pt
- The bottom left position of the axes.
public IDot createDot(IPoint pt, boolean isUniqueID)
createDot
in interface IShapeFactory
pt
- The centre of the dot.isUniqueID
- True: the shape will have a unique ID.
public IBezierCurve createBezierCurve(boolean isUniqueID)
IShapeFactory
createBezierCurve
in interface IShapeFactory
isUniqueID
- True: the model will have a unique ID.
public IBezierCurve createBezierCurve(IPoint point, IPoint point2, boolean uniqueID)
IShapeFactory
createBezierCurve
in interface IShapeFactory
point
- The first point of the curve.point2
- The second point of the curve.uniqueID
- uniqueID True: the model will have a unique ID.
public IEllipse createEllipse(IPoint tl, IPoint br, boolean isUniqueID)
IShapeFactory
createEllipse
in interface IShapeFactory
tl
- The top-left point of the ellipse.br
- The bottom-right point of the ellipse.isUniqueID
- True: the ellipse will have a unique ID.
public IEllipse createEllipse(boolean isUniqueID)
createEllipse
in interface IShapeFactory
isUniqueID
- True: the ellipse will have a unique ID.
public ITriangle createTriangle(IPoint pos, double width, double height, boolean uniqueID)
IShapeFactory
createTriangle
in interface IShapeFactory
pos
- The north-west point of the triangle.width
- The width of the triangle.height
- The height of the triangle.uniqueID
- True: the triangle will have a unique ID.
public ITriangle createTriangle(boolean isUniqueID)
createTriangle
in interface IShapeFactory
isUniqueID
- True: the shape will have a unique ID.
public IRhombus createRhombus(IPoint centre, double width, double height, boolean uniqueID)
IShapeFactory
createRhombus
in interface IShapeFactory
centre
- The centre of the rhombus.width
- The width of the rhombus.height
- The height of the rhombus.uniqueID
- True: the rhombus will have a unique ID.
public IRhombus createRhombus(boolean isUniqueID)
createRhombus
in interface IShapeFactory
isUniqueID
- True: the shape will have a unique ID.
public IPicture createPicture(boolean isUniqueID, IPoint pt)
IShapeFactory
createPicture
in interface IShapeFactory
isUniqueID
- True: the shape will have a unique ID.pt
- The position of the top-left point of the picture.
public IGrid createGrid(boolean isUniqueID, IPoint pt)
IShapeFactory
createGrid
in interface IShapeFactory
isUniqueID
- True: the shape will have a unique ID.pt
- The position.
public IFreehand createFreeHand(IPoint pt, boolean uniqueID)
IShapeFactory
createFreeHand
in interface IShapeFactory
pt
- The first point.uniqueID
- True: the model will have a unique ID.
public ICircle createCircle(IPoint pt, double radius, boolean isUniqueID)
IShapeFactory
createCircle
in interface IShapeFactory
pt
- The centre of the circle.radius
- The radius.isUniqueID
- True: the model will have a unique ID.
public ICircle createCircle(boolean isUniqueID)
createCircle
in interface IShapeFactory
isUniqueID
- True: the circle will have a unique ID.
public IGroup createGroup(boolean uniqueID)
createGroup
in interface IShapeFactory
uniqueID
- True: the model will have a unique ID.
public ILine createLine(double x1, double y1, double x2, double y2)
IShapeFactory
createLine
in interface IShapeFactory
x1
- the X coordinate of the start point.y1
- the Y coordinate of the start point.x2
- the X coordinate of the end point.y2
- the Y coordinate of the end point.
public ILine createLine(double b, IPoint p1)
IShapeFactory
createLine
in interface IShapeFactory
b
- y = ax+ bp1
- The first point.
public ILine createLine(IPoint p1, IPoint p2)
IShapeFactory
Point2D
objects.
createLine
in interface IShapeFactory
p1
- the start Point2D
of this line segment.p2
- the end Point2D
of this line segment.
public IPoint createPoint()
createPoint
in interface IShapeFactory
public IPoint createPoint(double x, double y)
IShapeFactory
createPoint
in interface IShapeFactory
x
- The X-coordinate to set.y
- The Y-coordinate to set.
public IPoint createPoint(IPoint pt)
IShapeFactory
createPoint
in interface IShapeFactory
pt
- The IPoint, if null the default value (0,0) will be used.
public IPolyline createPolyline(boolean uniqueID)
createPolyline
in interface IShapeFactory
uniqueID
- True: the shape will have a unique ID.
public IPolyline createPolyline(IPoint point, IPoint point2, boolean uniqueID)
IShapeFactory
createPolyline
in interface IShapeFactory
point
- The first point of the shape.point2
- The second point of the shape.uniqueID
- True: the shape will have a unique ID.
public IPolygon createPolygon(boolean uniqueID)
createPolygon
in interface IShapeFactory
uniqueID
- True: the shape will have a unique ID.
public IPolygon createPolygon(IPoint point, IPoint point2, boolean uniqueID)
IShapeFactory
createPolygon
in interface IShapeFactory
point
- The first point of the shape.point2
- The second point of the shape.uniqueID
- True: the shape will have a unique ID.
public IRectangle createRectangle(boolean uniqueID)
createRectangle
in interface IShapeFactory
uniqueID
- True: the shape will have a unique ID.
public IRectangle createRectangle(IPoint pos, double width, double height, boolean uniqueID)
IShapeFactory
createRectangle
in interface IShapeFactory
pos
- The north-west point of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.uniqueID
- True: the rectangle will have a unique ID.
public IRectangle createRectangle(IPoint tl, IPoint br, boolean uniqueID)
IShapeFactory
createRectangle
in interface IShapeFactory
tl
- The top left point of the rectangle.br
- The bottom right point of the rectangle.uniqueID
- True: the rectangle will have a unique ID.
public IText createText(boolean isUniqueID)
IShapeFactory
createText
in interface IShapeFactory
isUniqueID
- True: the shape will have a unique ID.
public IText createText(boolean isUniqueID, IPoint pt, java.lang.String text)
IShapeFactory
createText
in interface IShapeFactory
isUniqueID
- True: the model will have a unique ID.pt
- The position of the text.text
- The text.
public ISquare createSquare(boolean isUniqueID)
IShapeFactory
createSquare
in interface IShapeFactory
isUniqueID
- True: the shape will have a unique ID.
public ISquare createSquare(IPoint pos, double width, boolean isUniqueID)
IShapeFactory
createSquare
in interface IShapeFactory
pos
- The north-west point of the square.width
- The width of the square.isUniqueID
- True: the shape will have a unique ID.
public ICircleArc createCircleArc(IPoint tl, IPoint br, boolean uniqueID)
IShapeFactory
createCircleArc
in interface IShapeFactory
tl
- The top left point of the circled arc.br
- The bottom right point of the circled arc.uniqueID
- True: the circled arc will have a unique ID.
public ICircleArc createCircleArc(boolean isUniqueID)
IShapeFactory
createCircleArc
in interface IShapeFactory
isUniqueID
- True: the model will have a unique ID.
public IArc createArc(IPoint tl, IPoint br, boolean uniqueID)
IShapeFactory
createArc
in interface IShapeFactory
tl
- The top left point of the arc.br
- The bottom right point of the arc.uniqueID
- True: the arc will have a unique ID.
public IArc createArc(boolean isUniqueID)
IShapeFactory
createArc
in interface IShapeFactory
isUniqueID
- True: the model will have a unique ID.
public IShape duplicate(IShape shape)
IShapeFactory
duplicate
in interface IShapeFactory
shape
- The shape to duplicate
public IPoint createPoint(java.awt.Point pt)
IShapeFactory
createPoint
in interface IShapeFactory
pt
- The java point.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |