public class Viewbox
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
hasWidthAndHeight
True if the viewbox has a width and height.
|
protected double |
height
The height attribute.
|
protected boolean |
preserveAspectRatio
True if the "preserveAspectRatio" attribute has a value different from "none".
|
protected double |
viewboxHeight
The height of the viewBox attribute.
|
protected double |
viewboxWidth
The width of the viewBox attribute.
|
protected double |
viewboxX
The x position of the viewBox attribute.
|
protected double |
viewboxY
The y position of the viewBox attribute.
|
protected double |
width
The width attribute.
|
| Constructor and Description |
|---|
Viewbox(double width,
double height)
Create a viewbox with explicit width and height.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getHeight()
Return the height.
|
double |
getViewboxHeight()
Return the viewBox height.
|
double |
getViewboxWidth()
Return the viewBox width.
|
double |
getViewboxX()
Return the viewBox x position.
|
double |
getViewboxY()
Return the viewBox y position.
|
double |
getWidth()
Return the width.
|
boolean |
hasWidthAndHeight()
Return true if the viewbox has a width and height.
|
boolean |
isPreservingAspectRatio()
Return true if the aspect ratio must be preserved.
|
void |
scaleNode(javafx.scene.Node node)
Scale a Node.
|
double |
scaleValue(boolean isWidth,
double value)
Scale a SVG element attribute value.
|
void |
setPreserveAspectRatio(boolean preserveAspectRatio)
Set true if the aspect ratio must be preserved.
|
void |
setViewbox(double viewboxX,
double viewboxY,
double viewboxWidth,
double viewboxHeight)
Set the width and height of the viewBox
|
protected double width
protected double height
protected boolean hasWidthAndHeight
protected double viewboxX
protected double viewboxY
protected double viewboxWidth
protected double viewboxHeight
protected boolean preserveAspectRatio
public Viewbox(double width,
double height)
width - the widthheight - the heightpublic boolean hasWidthAndHeight()
public void setPreserveAspectRatio(boolean preserveAspectRatio)
preserveAspectRatio - true if the aspect ratio must be preservedpublic boolean isPreservingAspectRatio()
public void setViewbox(double viewboxX,
double viewboxY,
double viewboxWidth,
double viewboxHeight)
viewboxX - the viewBox X coordinateviewboxY - the viewBox y coordinateviewboxWidth - the viewBox widthviewboxHeight - the viewBox heightpublic void scaleNode(javafx.scene.Node node)
node - the nodepublic double scaleValue(boolean isWidth,
double value)
isPreservingAspectRatio() returns true.isWidth - true for a width valuevalue - the valuepublic double getViewboxX()
public double getViewboxY()
public double getViewboxWidth()
public double getViewboxHeight()
public double getWidth()
public double getHeight()
Copyright © 2021, 2022, 2025 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence