Class GUIUtils
- java.lang.Object
-
- org.openjump.core.rasterimage.styler.ui.GUIUtils
-
public class GUIUtils extends Object
- Author:
- GeomaticaEAmbiente
-
-
Constructor Summary
Constructors Constructor Description GUIUtils()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddGradientComboBoxToList(GradientComboBox gradientCB)Method to memorize in a List the GradientComboBoxesstatic voidclearRasterStylerFromBlackBoard(WorkbenchContext context)Method to delete the RasterStylesDialog about a raster from the BlackBoard.static GradientComboBoxcreateStandardGradientComboBox(int width, int height)static intgetAlpha_0_255Range(int range_0_100_Value)Method to convert the transparency value from 0-100 range (0 means that the color is completely opaque and 100 the color is completely transparent) to 0-255 range (0 menas that the color is completely transparent and 255 that the color is completely opaque)static floatgetAlpha_DecimalRange(int range_0_100_Value)static StringgetBBKey(String rasterPath)static RangegetMinMaxRasterValue(double[] rasterData, RasterImageLayer rasterImageLayer)Method to return the min value of a RasterImageLayerstatic doubleround(double value, int decimalPlace)Method to round a double value to a certain number of decimal placevoidsetGradientPanel(JPanel panel, ColorMapEntry[] colorMapEntries)Method for displaying in a panel a gradientstatic voidupdateGradientComboBoxes(ColorMapEntry[] colorMapEntries, int width, int height)Method to update gradientComboBoxes with new ColorMapEntry.
-
-
-
Method Detail
-
getMinMaxRasterValue
public static Range getMinMaxRasterValue(double[] rasterData, RasterImageLayer rasterImageLayer)
Method to return the min value of a RasterImageLayer- Parameters:
rasterData- raster data as a 1-dimension double arrayrasterImageLayer- source RasterImageLayer- Returns:
- the min-max range of values in the Raster
-
getAlpha_0_255Range
public static int getAlpha_0_255Range(int range_0_100_Value)
Method to convert the transparency value from 0-100 range (0 means that the color is completely opaque and 100 the color is completely transparent) to 0-255 range (0 menas that the color is completely transparent and 255 that the color is completely opaque)- Parameters:
range_0_100_Value- transparency value in a 0-100 range- Returns:
- an opacity value in a 0-255 range
-
getAlpha_DecimalRange
public static float getAlpha_DecimalRange(int range_0_100_Value)
-
setGradientPanel
public void setGradientPanel(JPanel panel, ColorMapEntry[] colorMapEntries)
Method for displaying in a panel a gradient- Parameters:
panel- Panel on which display the gradientcolorMapEntries- Colors that make up the gradient. The quantity element in ColorMapEnty[] must have values from 0 to 1, in ascending order and whitout repetition.
-
round
public static double round(double value, int decimalPlace)Method to round a double value to a certain number of decimal place- Parameters:
value- Value to be roundeddecimalPlace- number of decimal places- Returns:
- rounded value
-
createStandardGradientComboBox
public static GradientComboBox createStandardGradientComboBox(int width, int height)
-
clearRasterStylerFromBlackBoard
public static void clearRasterStylerFromBlackBoard(WorkbenchContext context)
Method to delete the RasterStylesDialog about a raster from the BlackBoard. The method checks and deletes the properties about RasterStylesDialog for rasters that are no more loaded on the TOC.- Parameters:
context- the WorkbenchContext
-
updateGradientComboBoxes
public static void updateGradientComboBoxes(ColorMapEntry[] colorMapEntries, int width, int height)
Method to update gradientComboBoxes with new ColorMapEntry. All gradientComboBoxes must have the same width anf height.- Parameters:
colorMapEntries- new colors for gradientwidth- width of gradientComboBoxesheight- height of gradientComboBoxex
-
addGradientComboBoxToList
public static void addGradientComboBoxToList(GradientComboBox gradientCB)
Method to memorize in a List the GradientComboBoxes- Parameters:
gradientCB- GradientComboBox to add to List
-
-