Class MapPreviewButton

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants

public class MapPreviewButton extends JButton
A specialized JButton for the map preview panel of the Lobby.
See Also:
  • Constructor Details

    • MapPreviewButton

      public MapPreviewButton(ChatLounge cl, int nr)
      A specialized JButton for the map preview panel of the Lobby.
    • MapPreviewButton

      public MapPreviewButton(ChatLounge cl)
      A specialized JButton for the map preview panel of the Lobby.
  • Method Details

    • setPreviewSize

      public void setPreviewSize(Dimension size)
      Sets the size of the button to the given size.
    • scheduleRescale

      public void scheduleRescale()
      Deletes the scaled minimap image for this button, making it rescale and redraw.
    • setImage

      public void setImage(Image image, String name)
      Sets the minimap image of the button to the given base image and stores the name for DnD
    • reset

      public void reset()
    • hasBoard

      public boolean hasBoard()
      Returns true if this button has a base image stored, i.e. if a board file is set for it.
    • getIndex

      public int getIndex()
      Returns the map board index of this button; e.g. 0 for the upper left map.
    • setIndex

      public void setIndex(int newIndex)
    • getBoard

      public String getBoard()
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent