Class PamSymbolFX

java.lang.Object
PamView.PamSymbolBase
pamViewFX.fxNodes.PamSymbolFX
All Implemented Interfaces:
Serializable, Cloneable

public class PamSymbolFX extends PamSymbolBase implements Serializable, Cloneable
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a default black PamSymbolFX.
    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 Type
    Method
    Description
     
    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 double
    static 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 icon
    Get the flag for the type of symbol the pamsymbol is set to draw.
    double
    Get the symbol width as a double
    static javafx.scene.paint.Color
    makeRGBColor(int rgb)
    Make an FX colour from a standard integer RGB
    void
    setFillColor(javafx.scene.paint.Color fillColor)
     
    void
    setLineColor(javafx.scene.paint.Color lineColor)
     
    void
    Set the flag for the type of symbol the pamsymbol is set to draw

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 type
      width - Width of symbol in pixels
      height - Height of symbol in pixels
      fill - true if the symbol is to be filled, false if the shape should be hollow
      fillColor - fill colour (required fill to be true)
      lineColor - line colour
    • PamSymbolFX

      public PamSymbolFX()
      Create a default black PamSymbolFX.
    • PamSymbolFX

      public PamSymbolFX(SymbolData symbolData)
    • PamSymbolFX

      public PamSymbolFX(PamSymbol pamSymbol)
      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 draw
      symbolStroke - - line colour for the symbol
      symbolFill - - fill colour for the symbol
      h - - height of the canvas
      w - - width of the canvas.
    • getSymbol

      public PamSymbolType getSymbol()
      Get the flag for the type of symbol the pamsymbol is set to draw.
      Returns:
    • setSymbol

      public void setSymbol(PamSymbolType symbol)
      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

      public PamSymbolFX clone()
      Overrides:
      clone in class PamSymbolBase
    • 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.