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 Details Link icon

    • PamSymbolFX Link icon

      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 Link icon

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

      public PamSymbolFX(SymbolData symbolData)
    • PamSymbolFX Link icon

      public PamSymbolFX(PamSymbol pamSymbol)
      Construct a PamSymbolFX from a PamSymbol.
      Parameters:
      symbol2 - - the AWT PamSymbol.
  • Method Details Link icon

    • getIntRGB Link icon

      public static int getIntRGB(javafx.scene.paint.Color colour)
      Get a colour RGB integer value from an FX color.
      Parameters:
      colour -
      Returns:
    • makeRGBColor Link icon

      public static javafx.scene.paint.Color makeRGBColor(int rgb)
      Make an FX colour from a standard integer RGB
      Parameters:
      rgb -
      Returns:
    • draw Link icon

      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 Link icon

      public javafx.scene.shape.Rectangle draw(javafx.scene.canvas.GraphicsContext g, javafx.geometry.Point2D pt, double width, double height)
    • draw Link icon

      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 Link icon

      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 Link icon

      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 Link icon

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

      public void setSymbol(PamSymbolType symbol)
      Set the flag for the type of symbol the pamsymbol is set to draw
      Parameters:
      symbol -
    • getFillColor Link icon

      public javafx.scene.paint.Color getFillColor()
    • setFillColor Link icon

      public void setFillColor(javafx.scene.paint.Color fillColor)
    • getLineColor Link icon

      public javafx.scene.paint.Color getLineColor()
    • setLineColor Link icon

      public void setLineColor(javafx.scene.paint.Color lineColor)
    • getWidth Link icon

      public double getWidth()
      Get the symbol width as a double
      Returns:
      symbol width in pixels
    • getHeight Link icon

      public double getHeight()
      Get the symbol height as an double
      Returns:
      symbol height in pixels
    • clone Link icon

      public PamSymbolFX clone()
      Overrides:
      clone in class PamSymbolBase
    • getNode Link icon

      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.