public class PredefinedShapes
extends java.lang.Object
We created this class mainly because we need to use some icons inside our products. Ideally it probably should support svg files. Since we are not using a whole lot of icons, we decided to create them using Java code to avoid the dependency on a svg reader.
| Constructor and Description |
|---|
PredefinedShapes() |
| Modifier and Type | Method and Description |
|---|---|
javafx.scene.shape.Shape |
createArrowedIcon(javafx.scene.shape.Shape shape)
Creates a shape by adding a down arrow to it.
|
javafx.scene.shape.Shape |
createArrowedIcon(javafx.scene.shape.Shape shape,
javafx.geometry.Pos pos,
double ratio)
Creates a shape by adding a down arrow to it.
|
javafx.scene.shape.Shape |
createArrowIcon(double size)
Creates an arrow icon.
|
javafx.scene.shape.Shape |
createCalendarIcon(double size)
Creates a calendar icon.
|
javafx.scene.shape.Shape |
createClearIcon(double size)
Create a clear node with a circle plus a cross inside within an area
|
javafx.scene.shape.Shape |
createClockIcon(double size)
Creates a clock icon.
|
javafx.scene.Group |
createCloseIcon(double size)
Create a close node with a circle plus a cross inside within an area.
|
javafx.scene.shape.Shape |
createFilterIcon(double size)
Creates a filter icon.
|
javafx.scene.shape.Shape |
createKeyIcon(double size)
Creates a key icon.
|
javafx.scene.shape.Shape |
createMagnifierIcon(double size)
Creates a magnifier glass icon.
|
javafx.scene.shape.Shape |
createMagnifierIcon(double size,
boolean showArrow)
Creates a magnifier glass icon with or without a down arrow.
|
javafx.scene.shape.Shape |
createMinusIcon(double size)
Creates a minus icon.
|
javafx.scene.shape.Shape |
createPlusIcon(double size)
Creates a plus icon.
|
static PredefinedShapes |
getInstance()
Gets the default instance of PredefinedShapes.
|
static void |
setInstance(PredefinedShapes instance)
Sets your own instance of PredefinedShapes if you want to customize the predefined shapes.
|
public static PredefinedShapes getInstance()
setInstance(PredefinedShapes)public static void setInstance(PredefinedShapes instance)
instance - a new instance.public javafx.scene.shape.Shape createArrowIcon(double size)
size - the size of the iconpublic javafx.scene.shape.Shape createClearIcon(double size)
size - the size of iconpublic javafx.scene.Group createCloseIcon(double size)
size - the size of iconpublic javafx.scene.shape.Shape createMagnifierIcon(double size)
size - the size of the iconpublic javafx.scene.shape.Shape createMagnifierIcon(double size,
boolean showArrow)
size - the size of the iconshowArrow - true to include a down arrow. False to not include one.public javafx.scene.shape.Shape createFilterIcon(double size)
size - the size of the iconpublic javafx.scene.shape.Shape createKeyIcon(double size)
size - the size of the iconpublic javafx.scene.shape.Shape createCalendarIcon(double size)
size - the size of the iconpublic javafx.scene.shape.Shape createClockIcon(double size)
size - the size of the iconpublic javafx.scene.shape.Shape createArrowedIcon(javafx.scene.shape.Shape shape)
shape - the original shape.public javafx.scene.shape.Shape createArrowedIcon(javafx.scene.shape.Shape shape,
javafx.geometry.Pos pos,
double ratio)
shape - the original shape.pos - the position of the down arrow. For now only BOTTOM_LEFT, BOTTOM_RIGHT, TOP_RIGHT, TOP_LEFT are
supported.ratio - the arrow width to the original shape's width ratio.public javafx.scene.shape.Shape createPlusIcon(double size)
size - the size of the iconpublic javafx.scene.shape.Shape createMinusIcon(double size)
size - the size of the icon