Class MapLayerTableCellRenderer

Object
Component
Container
JComponent
JPanel
MapLayerTableCellRenderer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ListCellRenderer<Layer>

public class MapLayerTableCellRenderer extends JPanel implements ListCellRenderer<Layer>
A custom list cell renderer for items in the JList used by MapLayerTable to show map layer names and states.
Since:
2.6
Author:
Michael Bedward
See Also:
  • Constructor Details

    • MapLayerTableCellRenderer

      public MapLayerTableCellRenderer()
      Constructor
  • Method Details

    • getCellHeight

      public static int getCellHeight()
      Get the constant height that will be used for list cells
      Returns:
      cell height in pixels
    • hitVisibilityLabel

      public static boolean hitVisibilityLabel(Point p)
      Check if a point representing a mouse click location lies within the bounds of the layer visibility label
      Parameters:
      p - coords of the mouse click; relative to this cell's origin
      Returns:
      true if the point is within the label bounds; false otherwise
    • hitSelectionLabel

      public static boolean hitSelectionLabel(Point p)
      Check if a point representing a mouse click location lies within the bounds of the layer selection label
      Parameters:
      p - coords of the mouse click; relative to this cell's origin
      Returns:
      true if the point is within the label bounds; false otherwise
    • hitStyleLabel

      public static boolean hitStyleLabel(Point p)
      Check if a point representing a mouse click location lies within the bounds of the layer style label
      Parameters:
      p - coords of the mouse click; relative to this cell's origin
      Returns:
      true if the point is within the label bounds; false otherwise
    • hitRemoveLabel

      public static boolean hitRemoveLabel(Point p)
      Check if a point representing a mouse click location lies within the bounds of the remove layer label
      Parameters:
      p - coords of the mouse click; relative to this cell's origin
      Returns:
      true if the point is within the label bounds; false otherwise
    • hitNameLabel

      public static boolean hitNameLabel(Point p)
    • getListCellRendererComponent

      public Component getListCellRendererComponent(JList list, Layer value, int index, boolean isSelected, boolean cellHasFocus)
      Specified by:
      getListCellRendererComponent in interface ListCellRenderer<Layer>