Class GradientFactory
java.lang.Object
org.graphstream.ui.swing_viewer.util.GradientFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic float[][]static float[]static float[]static float[]static float[]static float[]static float[]static float[]static float[]static float[]static boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Color[]createColors(org.graphstream.ui.graphicGraph.stylesheet.Style style) protected static float[]createFractions(org.graphstream.ui.graphicGraph.stylesheet.Style style) static PaintgradientInArea(int x0, int y0, int width, int height, org.graphstream.ui.graphicGraph.stylesheet.Style style) Generate a gradient in the given pixel area following the given style.static PaintlinearGradientFromStyle(float x0, float y0, float x1, float y1, org.graphstream.ui.graphicGraph.stylesheet.Style style) Generate a linear gradient between two given points corresponding to the given style.static PaintradialGradientFromStyle(float cx, float cy, float radius, float fx, float fy, org.graphstream.ui.graphicGraph.stylesheet.Style style) Generate a radial gradient between whose center is at (cx,cy) with the given radius.static PaintradialGradientFromStyle(float cx, float cy, float radius, org.graphstream.ui.graphicGraph.stylesheet.Style style)
-
Field Details
-
version16
public static boolean version16 -
predefFractions
public static float[][] predefFractions -
predefFractions2
public static float[] predefFractions2 -
predefFractions3
public static float[] predefFractions3 -
predefFractions4
public static float[] predefFractions4 -
predefFractions5
public static float[] predefFractions5 -
predefFractions6
public static float[] predefFractions6 -
predefFractions7
public static float[] predefFractions7 -
predefFractions8
public static float[] predefFractions8 -
predefFractions9
public static float[] predefFractions9 -
predefFractions10
public static float[] predefFractions10
-
-
Constructor Details
-
GradientFactory
public GradientFactory()
-
-
Method Details
-
gradientInArea
public static Paint gradientInArea(int x0, int y0, int width, int height, org.graphstream.ui.graphicGraph.stylesheet.Style style) Generate a gradient in the given pixel area following the given style. This produces a gradient only if the style fill-mode is compatible.- Parameters:
x0- The left corner of the area.y0- The bottom corner of the area.width- The area width.height- The area height.style- The style.- Returns:
- A gradient paint or null if the style does not specify a gradient.
-
linearGradientFromStyle
public static Paint linearGradientFromStyle(float x0, float y0, float x1, float y1, org.graphstream.ui.graphicGraph.stylesheet.Style style) Generate a linear gradient between two given points corresponding to the given style.- Parameters:
x0- The start point abscissa.y0- The start point ordinate.x1- The end point abscissa.y1- The end point ordinate.style- The style.- Returns:
- A paint for the gradient or null if the style specifies no gradient (the fill mode is not a linear gradient or there is only one fill colour).
-
radialGradientFromStyle
public static Paint radialGradientFromStyle(float cx, float cy, float radius, org.graphstream.ui.graphicGraph.stylesheet.Style style) -
radialGradientFromStyle
public static Paint radialGradientFromStyle(float cx, float cy, float radius, float fx, float fy, org.graphstream.ui.graphicGraph.stylesheet.Style style) Generate a radial gradient between whose center is at (cx,cy) with the given radius. The focus (fx,fy) is the start position of the gradient in the circle.- Parameters:
cx- The center point abscissa.cy- The center point ordinate.fx- The start point abscissa.fy- The start point ordinate.radius- The gradient radius.style- The style.- Returns:
- A paint for the gradient or null if the style specifies no gradient (the fill mode is not a radial gradient or there is only one fill colour).
-
createFractions
protected static float[] createFractions(org.graphstream.ui.graphicGraph.stylesheet.Style style) -
createColors
-