Class LayerNameRenderer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ListCellRenderer<Object>, TreeCellRenderer

public class LayerNameRenderer extends JPanel implements ListCellRenderer<Object>, TreeCellRenderer
LayerNameRenderer is mainly used in the TreeLayerNamePanel to display layerable names and tooltips, but it is also used in other UI components like MultiInputDialog
See Also:
  • Field Details

    • USE_CLOCK_ANIMATION_KEY

      public static final String USE_CLOCK_ANIMATION_KEY
    • checkBox

      protected JCheckBox checkBox
    • label

      protected JLabel label
    • PROGRESS_ICON_KEY

      public static String PROGRESS_ICON_KEY
    • FEATURE_COUNT

      public static String FEATURE_COUNT
  • Constructor Details

    • LayerNameRenderer

      public LayerNameRenderer()
  • Method Details

    • setIndicatingEditability

      public void setIndicatingEditability(boolean indicatingEditability)
    • setIndicatingProgress

      public void setIndicatingProgress(boolean indicatingProgress, RenderingManager renderingManager)
    • getLabel

      public JLabel getLabel()
    • getCheckBoxBounds

      public Rectangle getCheckBoxBounds()
      Returns:
      relative to this panel
    • getColumnWidth

      protected int getColumnWidth(int i)
      Parameters:
      i - zero-based
    • getRowHeight

      protected int getRowHeight()
    • setProgressIconLabelVisible

      public void setProgressIconLabelVisible(boolean visible)
    • setImageLabelVisible

      public void setImageLabelVisible(boolean visible)
    • setColorPanelVisible

      public void setColorPanelVisible(boolean visible)
    • setCheckBoxVisible

      public void setCheckBoxVisible(boolean visible)
    • setLabelVisible

      public void setLabelVisible(boolean visible)
    • setBounds

      public void setBounds(int x, int y, int w, int h)
      Workaround for bug 4238829 in the Java bug database: "JComboBox containing JPanel fails to display selected item at creation time"
      Overrides:
      setBounds in class Component
    • getListCellRendererComponent

      public Component getListCellRendererComponent(JList<? extends Object> list, String value, int index, boolean isSelected, boolean cellHasFocus)
      Special getListCellRendererComponent to render simple Strings. It is not the normal use, but it makes it possible to pass special values as "All Layers" or "Selected Layers" (used in QueryDialog). [mmichaud 2011-09-27]
    • getListCellRendererComponent

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

      public void setForeground(Color c)
      Overrides:
      setForeground in class JComponent
    • setBackground

      public void setBackground(Color c)
      Overrides:
      setBackground in class JComponent
    • getTreeCellRendererComponent

      public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
      Format the layerable name with formatLayerEntry method then adjust the font, background and foreground according to the layerable's status.
      Specified by:
      getTreeCellRendererComponent in interface TreeCellRenderer
    • filetype

      public String filetype(File file)
    • isOpaque

      public boolean isOpaque()
      Overrides:
      isOpaque in class JComponent
    • isTable

      public static boolean isTable(Layer layer)