Package pamViewFX.fxNodes
Class PamSymbolFX
java.lang.Object
PamView.PamSymbolBase
pamViewFX.fxNodes.PamSymbolFX
- All Implemented Interfaces:
Serializable
,Cloneable
- See Also:
-
Constructor Summary
ConstructorDescriptionCreate a default black PamSymbolFX.PamSymbolFX
(PamSymbol pamSymbol) Construct a PamSymbolFX from a PamSymbol.PamSymbolFX
(PamSymbolType symbol, int width, int height, boolean fill, javafx.scene.paint.Color fillColor, javafx.scene.paint.Color lineColor) Creates a PamSymbolFX with a given shape, size, colour, etc.PamSymbolFX
(SymbolData symbolData) -
Method Summary
Modifier and TypeMethodDescriptionclone()
static javafx.scene.canvas.Canvas
createCanvas
(PamSymbolType symbol, javafx.scene.paint.Color symbolStroke, javafx.scene.paint.Color symbolFill, double h, double w) Create a canvas with a transparent background showing the symbol set by the symbol flag.javafx.scene.shape.Rectangle
draw
(javafx.scene.canvas.GraphicsContext g, javafx.geometry.Point2D pt) Draw the symbol onto a canvas.javafx.scene.shape.Rectangle
draw
(javafx.scene.canvas.GraphicsContext g, javafx.geometry.Point2D pt, double width, double height) javafx.scene.shape.Rectangle
draw
(javafx.scene.canvas.GraphicsContext g2d, javafx.geometry.Point2D pt, double w, double h, boolean fill, float lineThickness, javafx.scene.paint.Color fillColor, javafx.scene.paint.Color lineColor) static javafx.scene.shape.Rectangle
draw
(PamSymbolType symbol, javafx.scene.canvas.GraphicsContext g2d, javafx.geometry.Point2D pt, double w, double h, boolean fill, float lineThickness, javafx.scene.paint.Color fillColor, javafx.scene.paint.Color lineColor) javafx.scene.paint.Color
double
Get the symbol height as an doublestatic int
getIntRGB
(javafx.scene.paint.Color colour) Get a colour RGB integer value from an FX color.javafx.scene.paint.Color
javafx.scene.Node
getNode
(int iconSize) Get a node version of the iconGet the flag for the type of symbol the pamsymbol is set to draw.double
getWidth()
Get the symbol width as a doublestatic javafx.scene.paint.Color
makeRGBColor
(int rgb) Make an FX colour from a standard integer RGBvoid
setFillColor
(javafx.scene.paint.Color fillColor) void
setLineColor
(javafx.scene.paint.Color lineColor) void
setSymbol
(PamSymbolType symbol) Set the flag for the type of symbol the pamsymbol is set to drawMethods inherited from class PamView.PamSymbolBase
getDHeight, getDWidth, getLineThickness, getSymbolData, getTextCode, getTextCode, interpretTextCode, isFill, setFill, setHeight, setLineThickness, setSymbolData, setWidth
-
Constructor Details
-
PamSymbolFX
public PamSymbolFX(PamSymbolType symbol, int width, int height, boolean fill, javafx.scene.paint.Color fillColor, javafx.scene.paint.Color lineColor) Creates a PamSymbolFX with a given shape, size, colour, etc.- Parameters:
symbol
- Symbol typewidth
- Width of symbol in pixelsheight
- Height of symbol in pixelsfill
- true if the symbol is to be filled, false if the shape should be hollowfillColor
- fill colour (required fill to be true)lineColor
- line colour
-
PamSymbolFX
public PamSymbolFX()Create a default black PamSymbolFX. -
PamSymbolFX
-
PamSymbolFX
Construct a PamSymbolFX from a PamSymbol.- Parameters:
symbol2
- - the AWT PamSymbol.
-
-
Method Details
-
getIntRGB
public static int getIntRGB(javafx.scene.paint.Color colour) Get a colour RGB integer value from an FX color.- Parameters:
colour
-- Returns:
-
makeRGBColor
public static javafx.scene.paint.Color makeRGBColor(int rgb) Make an FX colour from a standard integer RGB- Parameters:
rgb
-- Returns:
-
draw
public javafx.scene.shape.Rectangle draw(javafx.scene.canvas.GraphicsContext g, javafx.geometry.Point2D pt) Draw the symbol onto a canvas.- Parameters:
g
- - graphics context from canvas to draw symbol on.pt
- - point on canvas to draw symbol- Returns:
-
draw
public javafx.scene.shape.Rectangle draw(javafx.scene.canvas.GraphicsContext g, javafx.geometry.Point2D pt, double width, double height) -
draw
public javafx.scene.shape.Rectangle draw(javafx.scene.canvas.GraphicsContext g2d, javafx.geometry.Point2D pt, double w, double h, boolean fill, float lineThickness, javafx.scene.paint.Color fillColor, javafx.scene.paint.Color lineColor) -
draw
public static javafx.scene.shape.Rectangle draw(PamSymbolType symbol, javafx.scene.canvas.GraphicsContext g2d, javafx.geometry.Point2D pt, double w, double h, boolean fill, float lineThickness, javafx.scene.paint.Color fillColor, javafx.scene.paint.Color lineColor) -
createCanvas
public static javafx.scene.canvas.Canvas createCanvas(PamSymbolType symbol, javafx.scene.paint.Color symbolStroke, javafx.scene.paint.Color symbolFill, double h, double w) Create a canvas with a transparent background showing the symbol set by the symbol flag. This can be added various JavaFX buttons and controls.- Parameters:
symbol
- - flag for symbol to drawsymbolStroke
- - line colour for the symbolsymbolFill
- - fill colour for the symbolh
- - height of the canvasw
- - width of the canvas.
-
getSymbol
Get the flag for the type of symbol the pamsymbol is set to draw.- Returns:
-
setSymbol
Set the flag for the type of symbol the pamsymbol is set to draw- Parameters:
symbol
-
-
getFillColor
public javafx.scene.paint.Color getFillColor() -
setFillColor
public void setFillColor(javafx.scene.paint.Color fillColor) -
getLineColor
public javafx.scene.paint.Color getLineColor() -
setLineColor
public void setLineColor(javafx.scene.paint.Color lineColor) -
getWidth
public double getWidth()Get the symbol width as a double- Returns:
- symbol width in pixels
-
getHeight
public double getHeight()Get the symbol height as an double- Returns:
- symbol height in pixels
-
clone
- Overrides:
clone
in classPamSymbolBase
-
getNode
public javafx.scene.Node getNode(int iconSize) Get a node version of the icon- Parameters:
iconSize
- - the icon size in pixels.- Returns:
- a node containing the icon.
-