Class VectorShape
- java.lang.Object
-
- io.github.applecommander.bastools.api.shapes.VectorShape
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVectorShape.VectorRegexOptimizationA vector optimization based on regex.
-
Field Summary
Fields Modifier and Type Field Description java.lang.Stringlabeljava.util.List<VectorCommand>vectors
-
Constructor Summary
Constructors Constructor Description VectorShape()VectorShape(java.lang.String label)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VectorShapeappend(VectorCommand vectorCommand)voidappendLongCommands(java.lang.String line)voidappendShortCommand(char cmd)voidappendShortCommands(java.lang.String line)static VectorShapefrom(java.nio.ByteBuffer buf)java.lang.StringgetLabel()Get the label of this shape.booleanisEmpty()Indicates if this shape is empty.VectorShapemoveDown()VectorShapemoveLeft()VectorShapemoveRight()VectorShapemoveUp()VectorShapeoptimize()Optimize the vectors by removing useless vectors or replacing a series with a shorter series.VectorShapeplotDown()VectorShapeplotLeft()VectorShapeplotRight()VectorShapeplotUp()BitmapShapetoBitmap()Transform to a BitmapShape.byte[]toBytes()java.lang.StringtoShortCommands()VectorShapetoVector()Transform to a VectorShape.
-
-
-
Field Detail
-
label
public final java.lang.String label
-
vectors
public final java.util.List<VectorCommand> vectors
-
-
Method Detail
-
from
public static VectorShape from(java.nio.ByteBuffer buf)
-
moveUp
public VectorShape moveUp()
-
moveRight
public VectorShape moveRight()
-
moveDown
public VectorShape moveDown()
-
moveLeft
public VectorShape moveLeft()
-
plotUp
public VectorShape plotUp()
-
plotRight
public VectorShape plotRight()
-
plotDown
public VectorShape plotDown()
-
plotLeft
public VectorShape plotLeft()
-
append
public VectorShape append(VectorCommand vectorCommand)
-
optimize
public VectorShape optimize()
Optimize the vectors by removing useless vectors or replacing a series with a shorter series. At this point, everything is based off of a regex with a potential modification.
-
toShortCommands
public java.lang.String toShortCommands()
-
appendShortCommands
public void appendShortCommands(java.lang.String line)
-
appendShortCommand
public void appendShortCommand(char cmd)
-
appendLongCommands
public void appendLongCommands(java.lang.String line)
-
toBytes
public byte[] toBytes()
-
isEmpty
public boolean isEmpty()
Description copied from interface:ShapeIndicates if this shape is empty.
-
getLabel
public java.lang.String getLabel()
Description copied from interface:ShapeGet the label of this shape.
-
toBitmap
public BitmapShape toBitmap()
Description copied from interface:ShapeTransform to a BitmapShape.
-
toVector
public VectorShape toVector()
Description copied from interface:ShapeTransform to a VectorShape.
-
-