Class JXG.Polygon
Extends
JXG.GeometryElement.
Polygon stores all style and functional properties that are required
to draw a polygon on a board.
Defined in: Polygon.js.
Constructor Attributes | Constructor Name and Description |
---|---|
JXG.Polygon(board, vertices, borders, id, name, withLines, withLabel, lineLabels, layer)
Creates a new instance of Polygon.
|
Field Attributes | Field Name and Description |
---|---|
References to the borderlines of the polygon.
|
|
Sets type of GeometryElement, value is OBJECT_TYPE_POLYGON.
|
|
References to the points defining the polygon.
|
|
Is the polygon bordered by lines?
|
- Fields borrowed from class JXG.GeometryElement:
- ancestors, board, childElements, dash, descendants, draft, fillColor, fillOpacity, fixed, hasLabel, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, isReal, layer, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, quadraticform, shadow, stdform, strokeColor, strokeOpacity, strokeWidth, symbolic, trace, traces, transformations, visible, visProp
Method Attributes | Method Name and Description |
---|---|
cloneToBackground(addToTrace)
Copy the element to the background.
|
|
return TextAnchor
|
|
hasPoint(x, y)
Checks whether (x,y) is near the polygon.
|
|
Uses the boards renderer to update the polygon.
|
- Methods borrowed from class JXG.GeometryElement:
- addChild, addLabelToElement, animate, clearTrace, hideElement, highlight, labelColor, noHighlight, remove, setArrow, setProperty, showElement, update
Class Detail
JXG.Polygon(board, vertices, borders, id, name, withLines, withLabel, lineLabels, layer)
Creates a new instance of Polygon.
- Parameters:
- {JXG.Board} board
- Reference to the board the polygon is drawn on.
- {Array} vertices
- Unique identifiers for the points defining the polygon. Last point must be first point.
- {Array} borders
- Unique identifiers for the derived borderlines of the polygon
- {String} id
- Unique identifier for this object. If null or an empty string is given, an unique id will be generated by Board
- {String} name
- Not necessarily unique name, displayed on the board. If null or an empty string is given, an unique name will be generated.
- withLines
- withLabel
- lineLabels
- layer
- See:
- JXG.Board#addPolygon
Field Detail
{Array}
borders
References to the borderlines of the polygon.
{Number}
type
Sets type of GeometryElement, value is OBJECT_TYPE_POLYGON.
{Array}
vertices
References to the points defining the polygon.
Last vertex is the same as first vertex.
{Boolean}
withLines
Is the polygon bordered by lines?
Method Detail
cloneToBackground(addToTrace)
Copy the element to the background.
- Parameters:
- addToTrace
getTextAnchor()
return TextAnchor
{bool}
hasPoint(x, y)
Checks whether (x,y) is near the polygon.
- Parameters:
- {int} x
- Coordinate in x direction, screen coordinates.
- {int} y
- Coordinate in y direction, screen coordinates.
- Returns:
- {bool} Always false, because the polygons interior shall not be highlighted
updateRenderer()
Uses the boards renderer to update the polygon.