public final class CommandFactory extends Object
PathCommand.| Constructor and Description |
|---|
CommandFactory() |
| Modifier and Type | Method and Description |
|---|---|
CloseCommand |
createCloseCommand(char commandName,
javafx.geometry.Point2D startPoint)
Creates a new
CloseCommand using the given data, which needs to contain the command name. |
PathCommand |
createCommandOrFail(Character delimiter,
String data,
javafx.geometry.Point2D absolutePathStartingPoint,
javafx.geometry.Point2D absoluteCurrentPoint,
PathCommand previousCommand)
Creates a new
PathCommand based on the given information. |
CubicBezierCurveCommand |
createCubicBezierCurveCommand(char commandName,
String data)
Creates a new
BezierCurveCommand using the given data, which needs to contains three points. |
HorizontalLineCommand |
createHorizontalLineCommand(char commandName,
String data)
Creates a new
LineCommand using the given data, which need to contain one numeric value which determines which position is moved to. |
LineCommand |
createLineCommand(char commandName,
String data)
Creates a new
LineCommand using the given data, which needs to be two numeric values separated by whitespaces or one comma
which determines which position is moved to. |
MoveCommand |
createMoveCommand(char commandName,
String data)
Creates a new
LineCommand using the given data, which needs to be two numeric values separated by whitespaces or one comma
which determines which position is moved to. |
QuadraticBezierCurveCommand |
createQuadraticBezierCurveCommand(char commandName,
String data)
Creates a new
BezierCurveCommand using the given data, which needs to contains three points. |
CubicBezierCurveCommand |
createShortCubicBezierCurveCommand(char commandName,
String data,
javafx.geometry.Point2D absoluteCurrentPoint,
PathCommand previousCommand)
Creates a new
BezierCurveCommand using the given data, which needs to contains three points. |
QuadraticBezierCurveCommand |
createShortQuadraticBezierCurveCommand(char commandName,
String data,
javafx.geometry.Point2D absoluteStartPoint,
PathCommand previousCommand)
Creates a new
BezierCurveCommand using the given data, which needs to contains three points. |
VerticalLineCommand |
createVerticalLineCommand(char commandName,
String data)
Creates a new
LineCommand using the given data, which need to contain one numeric value which determines which position is moved to. |
public PathCommand createCommandOrFail(Character delimiter, String data, javafx.geometry.Point2D absolutePathStartingPoint, javafx.geometry.Point2D absoluteCurrentPoint, PathCommand previousCommand) throws PathException
PathCommand based on the given information.delimiter - the Character which determines the command.data - the data present for the command.absolutePathStartingPoint - the absolute start point of a path command.absoluteCurrentPoint - the absolute end point of the previous command, which is also the starting position of the created comand.previousCommand - the previous command.PathCommand.PathException - if any error occurs during the creation of a PathCommand.public MoveCommand createMoveCommand(char commandName, String data) throws PathException
LineCommand using the given data, which needs to be two numeric values separated by whitespaces or one comma
which determines which position is moved to.commandName - the name of the command.data - the data describing the command.LineCommand.PathException - if the commandName is not absolute or relative CommandName.MOVE
or the data does not contain two numeric values separated be whitespaces or one comma.public LineCommand createLineCommand(char commandName, String data) throws PathException
LineCommand using the given data, which needs to be two numeric values separated by whitespaces or one comma
which determines which position is moved to.commandName - the name of the command.data - the data describing the command.LineCommand.PathException - if the commandName is not absolute or relative CommandName.LINE
or the data does not contain two numeric values separated be whitespaces or one comma.public HorizontalLineCommand createHorizontalLineCommand(char commandName, String data) throws PathException
LineCommand using the given data, which need to contain one numeric value which determines which position is moved to.commandName - the name of the command.data - the data describing the command.LineCommand.PathException - if the commandName is not absolute or relative CommandName.HORIZONTAL_LINE
or if the given data is not a number.public VerticalLineCommand createVerticalLineCommand(char commandName, String data) throws PathException
LineCommand using the given data, which need to contain one numeric value which determines which position is moved to.commandName - the name of the command.data - the data describing the command.LineCommand.PathException - if the commandName is not absolute or relative CommandName.VERTICAL_LINE
or the given data is not a number.public CloseCommand createCloseCommand(char commandName, javafx.geometry.Point2D startPoint) throws PathException
CloseCommand using the given data, which needs to contain the command name.commandName - the name of the command.startPoint - the start position which this command will travel to.CloseCommand.PathException - if the commandName is not absolute or relative CommandName.CLOSE.public CubicBezierCurveCommand createCubicBezierCurveCommand(char commandName, String data) throws PathException
BezierCurveCommand using the given data, which needs to contains three points.commandName - the name of the command.data - the three points describing the curve.BezierCurveCommand.PathException - if the commandName is not absolute or relative CommandName.CUBIC_BEZIER_CURVE
or the data does not represent three points.public CubicBezierCurveCommand createShortCubicBezierCurveCommand(char commandName, String data, javafx.geometry.Point2D absoluteCurrentPoint, PathCommand previousCommand) throws PathException
BezierCurveCommand using the given data, which needs to contains three points.commandName - the name of the command.data - the three points describing the curve.absoluteCurrentPoint - the position of the start of the previous command, which is needed to determine the start position of the created command.previousCommand - the previous PathCommand which needs to be a BezierCurveCommand.BezierCurveCommand.PathException - if the commandName is not absolute or relative CommandName.SHORT_CUBIC_BEZIER_CURVE
or the data does not represent three points.public QuadraticBezierCurveCommand createQuadraticBezierCurveCommand(char commandName, String data) throws PathException
BezierCurveCommand using the given data, which needs to contains three points.commandName - the name of the command.data - the three points describing the curve.BezierCurveCommand.PathException - if the commandName is not absolute or relative CommandName.CUBIC_BEZIER_CURVE
or the data does not represent 2 points.public QuadraticBezierCurveCommand createShortQuadraticBezierCurveCommand(char commandName, String data, javafx.geometry.Point2D absoluteStartPoint, PathCommand previousCommand) throws PathException
BezierCurveCommand using the given data, which needs to contains three points.commandName - the name of the command.data - the three points describing the curve.absoluteStartPoint - the position of the start of the previous command, which is needed to determine the start position of the created command.previousCommand - the previous PathCommand which needs to be a BezierCurveCommand.BezierCurveCommand.PathException - if the commandName is not absolute or relative CommandName.SHORT_CUBIC_BEZIER_CURVE
or the given command is not a BezierCurveCommand
or the data does not represent a point.Copyright © 2017 Saxonia Systems AG. All rights reserved.