Package kiyut.sketsa.canvas.tool.point
Class PointToolModel
- java.lang.Object
-
- kiyut.sketsa.canvas.tool.point.PointToolModel
-
public class PointToolModel extends Object
This is a singleton class. Its use is shared between Point Tool (MovePointTool, AddPointTool, RemovePointTool)- Author:
- KIYUT
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(org.w3c.dom.svg.SVGElement element)Add SVGElement.voidclear()clearorg.w3c.dom.svg.SVGElementget(int index)Return SVGElement.static PointToolModelgetInstance()ShapegetOutline(int index)Return Outline ShapeList<PathSegment>getPathSegmentList(int index)Return PathSegmentListorg.w3c.dom.svg.SVGElementgetSelectedElement()Return selected ElementShapegetSelectedOutline()Return selected OutlinePathSegmentgetSelectedPathSegment()Return selectedPathSegmentPointShapegetSelectedPoint()Return selectedPointintindexOf(org.w3c.dom.svg.SVGElement element)Return indexOf specified SVGElement.voidrefresh()Refresh or reinitialize Pointsvoidremove(org.w3c.dom.svg.SVGElement element)Remove SVGElementvoidsetSelectedElement(org.w3c.dom.svg.SVGElement element)Set selected ElementvoidsetSelectedPathSegment(PathSegment pathSegment)Set SelectedPathSegmentvoidsetSelectedPoint(PointShape point)Set Selected PointvoidsetVectorCanvas(VectorCanvas canvas)If the canvas is different with the currently hold canvas, it call refresh()intsize()Returns the number of elements.voidupdateOutline(int index)Update Outline at specified index.voidupdatePointList(int index)Update PointList at specified index.
-
-
-
Method Detail
-
getInstance
public static PointToolModel getInstance()
-
setVectorCanvas
public void setVectorCanvas(VectorCanvas canvas)
If the canvas is different with the currently hold canvas, it call refresh()- Parameters:
canvas- VectorCanvas
-
getOutline
public Shape getOutline(int index)
Return Outline Shape- Parameters:
index- The index- Returns:
- Outline Shape
-
getPathSegmentList
public List<PathSegment> getPathSegmentList(int index)
Return PathSegmentList- Parameters:
index- The index- Returns:
- PathSegmentList
-
clear
public void clear()
clear
-
refresh
public void refresh()
Refresh or reinitialize Points
-
remove
public void remove(org.w3c.dom.svg.SVGElement element)
Remove SVGElement- Parameters:
element- SVGElement
-
updateOutline
public void updateOutline(int index)
Update Outline at specified index.- Parameters:
index- The index
-
updatePointList
public void updatePointList(int index)
Update PointList at specified index.- Parameters:
index- The index
-
add
public void add(org.w3c.dom.svg.SVGElement element)
Add SVGElement.- Parameters:
element- SVGElement
-
indexOf
public int indexOf(org.w3c.dom.svg.SVGElement element)
Return indexOf specified SVGElement.- Parameters:
element- SVGElement- Returns:
- indexOf specified SVGElement
- See Also:
get(int)
-
get
public org.w3c.dom.svg.SVGElement get(int index)
Return SVGElement.- Parameters:
index- The index- Returns:
- SVGElement
- See Also:
indexOf(SVGElement)
-
size
public int size()
Returns the number of elements.- Returns:
- the number of elements
-
setSelectedPoint
public void setSelectedPoint(PointShape point)
Set Selected Point- Parameters:
point- PointShape
-
getSelectedPoint
public PointShape getSelectedPoint()
Return selectedPoint- Returns:
- PointShape
-
setSelectedPathSegment
public void setSelectedPathSegment(PathSegment pathSegment)
Set SelectedPathSegment- Parameters:
pathSegment- PathSegment
-
getSelectedPathSegment
public PathSegment getSelectedPathSegment()
Return selectedPathSegment- Returns:
- PathSegment
-
setSelectedElement
public void setSelectedElement(org.w3c.dom.svg.SVGElement element)
Set selected Element- Parameters:
element- SVGElement
-
getSelectedElement
public org.w3c.dom.svg.SVGElement getSelectedElement()
Return selected Element- Returns:
- SVGElement
-
getSelectedOutline
public Shape getSelectedOutline()
Return selected Outline- Returns:
- Shape
-
-