Class GUIUtils

java.lang.Object
org.openjump.core.rasterimage.styler.ui.GUIUtils

public class GUIUtils extends Object
Author:
GeomaticaEAmbiente
  • Constructor Details

    • GUIUtils

      public GUIUtils()
  • Method Details

    • 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 array
      rasterImageLayer - 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 gradient
      colorMapEntries - 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 rounded
      decimalPlace - 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 gradient
      width - width of gradientComboBoxes
      height - 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
    • getBBKey

      public static String getBBKey(String rasterPath)