Class BlocksworldPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class BlocksworldPanel extends JPanel
Shows the blocksworld.
See Also:
  • Field Details

    • XVARIANCE

      protected static final double XVARIANCE
      The block placement x variance as fraction of the total available space (0-1).
      See Also:
    • YVARIANCE

      protected static final double YVARIANCE
      The block placement y variance as fraction of the total available space (0-XVARIANCE).
      See Also:
    • table

      protected Table table
      The table.
    • pcl

      protected PropertyChangeListener pcl
      The change listener to update the gui.
    • blocks

      protected Set<Block> blocks
      The known blocks.
    • blocksize

      protected int blocksize
      The block size (in pixels).
    • imaginary

      protected boolean imaginary
      The imaginary flag.
  • Constructor Details

    • BlocksworldPanel

      public BlocksworldPanel(Table table, boolean imaginary)
      Create a blocksworld panel.
      Parameters:
      table - The table.
      imaginary - Flag indicating that its not the real world.
  • Method Details

    • setBlockSize

      public void setBlockSize(int blocksize)
      Set the size of the blocks.
    • getBlockSize

      public int getBlockSize()
      Get the size of the blocks.
    • getPreferredSize

      public Dimension getPreferredSize()
      Get the preferred size of the panel.
      Overrides:
      getPreferredSize in class JComponent
    • getGridDimension

      public Dimension getGridDimension()
      Determine grid dimension (numx, numy).
    • observeNewBlocks

      protected void observeNewBlocks()
      Add listener to new blocks.
    • paintComponent

      protected void paintComponent(Graphics g)
      The overridden paint method.
      Overrides:
      paintComponent in class JComponent
    • paintBlock

      protected void paintBlock(Graphics g, Block b, int x, int y)
      Paint a block.