Class IPAMapGridContainer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class IPAMapGridContainer extends JPanel implements Scrollable
Container for IPAMapGrids.
See Also:
  • Constructor Details

    • IPAMapGridContainer

      public IPAMapGridContainer()
  • Method Details

    • addDefaultGrids

      public void addDefaultGrids()
      Adds all default Grids found in the ipamap.xml layout file.
    • setFont

      public void setFont(Font font)
      Overrides:
      setFont in class JComponent
    • addGrid

      public Tuple<JButton,IPAMapGrid> addGrid(Grid ipaGrid)
      Add Grid to container. The method creates a new toggle button and IPAMapGrid component and returns them in a Tuple. The new components are added to the container in a vertical layout.
      Parameters:
      ipaGrid -
      Returns:
    • getMapGridPanel

      public JPanel getMapGridPanel(IPAMapGrid mapGrid)
      Return the panel displayed above the given grid. The returned panel has a BorderLayout with the togglebutton in the center position.
      Parameters:
      mapGrid -
      Returns:
      panel or null
    • isSelectionEnabled

      public boolean isSelectionEnabled()
    • setSelectionEnabled

      public void setSelectionEnabled(boolean selectionEnabled)
    • addCellSelectionListener

      public void addCellSelectionListener(IPAMapCellSelectionListener listener)
    • removeCellSelecitonListener

      public void removeCellSelecitonListener(IPAMapCellSelectionListener listener)
    • fireCellSelectionChanged

      public void fireCellSelectionChanged(IPAMapGrid grid, int cellIdx, boolean selected)
    • getSelectedCells

      public List<Cell> getSelectedCells()
      Return an unmodifiable list of selected Cells
      Returns:
      list of selected cells
    • invertSelection

      public void invertSelection()
    • isGridVisible

      public boolean isGridVisible(String gridName)
      Is the given section visible
      Parameters:
      gridName -
      Returns:
      true if section is visible
    • setGridVisible

      public void setGridVisible(String gridName, boolean visible)
    • isGridVisible

      public boolean isGridVisible(IPAMapGrid mapGrid)
    • setGridVisible

      public void setGridVisible(IPAMapGrid mapGrid, boolean visible)
    • addCellMouseListener

      public void addCellMouseListener(IPAMapGridMouseListener listener)
    • removeCellMouseListener

      public void removeCellMouseListener(IPAMapGridMouseListener listener)
    • getCellMouseListeners

      public IPAMapGridMouseListener[] getCellMouseListeners()
    • getCellFilter

      public Predicate<Cell> getCellFilter()
    • setCellFilter

      public void setCellFilter(Predicate<Cell> filter)
    • getCellRenderer

      public IPAMapCellRenderer getCellRenderer()
    • setCellRenderer

      public void setCellRenderer(IPAMapCellRenderer cellRenderer)
    • fireCellPressed

      public void fireCellPressed(Cell cell, MouseEvent me)
    • fireCellReleased

      public void fireCellReleased(Cell cell, MouseEvent me)
    • fireCellClicked

      public void fireCellClicked(Cell cell, MouseEvent me)
    • fireCellEntered

      public void fireCellEntered(Cell cell, MouseEvent me)
    • fireCellExited

      public void fireCellExited(Cell cell, MouseEvent me)
    • getPreferredScrollableViewportSize

      public Dimension getPreferredScrollableViewportSize()
      Specified by:
      getPreferredScrollableViewportSize in interface Scrollable
    • getScrollableUnitIncrement

      public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
      Specified by:
      getScrollableUnitIncrement in interface Scrollable
    • getScrollableBlockIncrement

      public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
      Specified by:
      getScrollableBlockIncrement in interface Scrollable
    • getScrollableTracksViewportWidth

      public boolean getScrollableTracksViewportWidth()
      Specified by:
      getScrollableTracksViewportWidth in interface Scrollable
    • getScrollableTracksViewportHeight

      public boolean getScrollableTracksViewportHeight()
      Specified by:
      getScrollableTracksViewportHeight in interface Scrollable