Search in sources :

Example 11 with WorldPanel

use of mudmap2.frontend.GUIElement.WorldPanel.WorldPanel in project mudmap2 by Neop.

the class WorldPanelTest method testGetCursorX.

/**
 * Test of getCursorX method, of class WorldPanel.
 */
@Test
public void testGetCursorX() {
    System.out.println("getCursorX");
    World world = new World();
    WorldPanel instance = new WorldPanel(null, world, false);
    instance.setCursor(4, 6);
    int result = instance.getCursorX();
    assertEquals(4, result);
}
Also used : World(mudmap2.backend.World) Test(org.junit.Test)

Example 12 with WorldPanel

use of mudmap2.frontend.GUIElement.WorldPanel.WorldPanel in project mudmap2 by Neop.

the class WorldPanelTest method testTileSizeDecrement.

/**
 * Test of tileSizeDecrement method, of class WorldPanel.
 */
@Test
public void testTileSizeDecrement() {
    System.out.println("tileSizeDecrement");
    World world = new World();
    WorldPanel instance = new WorldPanel(null, world, false);
    double ts = 57.5;
    instance.setTileSize(ts);
    instance.tileSizeDecrement();
    assertTrue(ts > instance.getTileSize());
}
Also used : World(mudmap2.backend.World) Test(org.junit.Test)

Example 13 with WorldPanel

use of mudmap2.frontend.GUIElement.WorldPanel.WorldPanel in project mudmap2 by Neop.

the class WorldPanelTest method testSetHome.

/**
 * Test of gotoHome method, of class WorldPanel.
 */
/*@Test
    public void testGotoHome() {
        System.out.println("gotoHome");

        World world = new World();
        WorldCoordinate home = new WorldCoordinate(1, 2, 3);
        world.setHome(home);

        WorldPanel instance = new WorldPanel(world, false);
        instance.gotoHome();

        assertEquals(home.getLayer(), instance.getPosition().getLayer());
        assertEquals(home.getX(), instance.getPosition().getX(), 0.01);
        assertEquals(home.getY(), instance.getPosition().getY(), 0.01);
    }*/
/**
 * Test of setHome method, of class WorldPanel.
 */
@Test
public void testSetHome() {
    System.out.println("setHome");
    World world = new World();
    WorldCoordinate coord = new WorldCoordinate(1, 6, 9);
    WorldPanel instance = new WorldPanel(null, world, false);
    instance.pushPosition(coord);
    // might be changed by moveScreenToCursor()
    coord = instance.getPosition();
    instance.setHome();
    assertEquals(coord.getLayer(), world.getHome().getLayer());
    assertEquals(coord.getX(), world.getHome().getX(), 0.01);
    assertEquals(coord.getY(), world.getHome().getY(), 0.01);
}
Also used : WorldCoordinate(mudmap2.backend.WorldCoordinate) World(mudmap2.backend.World) Test(org.junit.Test)

Example 14 with WorldPanel

use of mudmap2.frontend.GUIElement.WorldPanel.WorldPanel in project mudmap2 by Neop.

the class WorldPanelTest method testGetCursorY.

/**
 * Test of get/setCursorY method, of class WorldPanel.
 */
@Test
public void testGetCursorY() {
    System.out.println("getCursorY");
    World world = new World();
    WorldPanel instance = new WorldPanel(null, world, false);
    instance.setCursor(4, 6);
    int result = instance.getCursorY();
    assertEquals(6, result);
}
Also used : World(mudmap2.backend.World) Test(org.junit.Test)

Example 15 with WorldPanel

use of mudmap2.frontend.GUIElement.WorldPanel.WorldPanel in project mudmap2 by Neop.

the class WorldPanelTest method testIsPassive.

/**
 * Test of isPassive method, of class WorldPanel.
 */
@Test
public void testIsPassive() {
    System.out.println("isPassive");
    WorldPanel instance = new WorldPanel(null, new World(), false);
    assertFalse(instance.isPassive());
    instance = new WorldPanel(null, new World(), true);
    assertTrue(instance.isPassive());
}
Also used : World(mudmap2.backend.World) Test(org.junit.Test)

Aggregations

World (mudmap2.backend.World)15 Test (org.junit.Test)15 WorldCoordinate (mudmap2.backend.WorldCoordinate)3 Place (mudmap2.backend.Place)2 BorderLayout (java.awt.BorderLayout)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 JButton (javax.swing.JButton)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JSlider (javax.swing.JSlider)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ChangeListener (javax.swing.event.ChangeListener)1 Layer (mudmap2.backend.Layer)1 ScrollLabel (mudmap2.frontend.GUIElement.ScrollLabel)1 PlaceSelectionListener (mudmap2.frontend.GUIElement.WorldPanel.PlaceSelectionListener)1 WorldPanel (mudmap2.frontend.GUIElement.WorldPanel.WorldPanel)1