Package games.stendhal.client.gui
Class GroundContainer
java.lang.Object
games.stendhal.client.gui.GroundContainer
- All Implemented Interfaces:
Inspector
,MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
public class GroundContainer
extends Object
implements Inspector, MouseListener, MouseMotionListener, MouseWheelListener
Mouse handler for the game screen floor.
-
Constructor Summary
ConstructorDescriptionGroundContainer(StendhalClient client, IGameScreen gameScreen, JComponent canvas)
Create a new GroundContainer. -
Method Summary
Modifier and TypeMethodDescriptioncalculateZoneChangeDirection(Point2D point)
Calculates whether the click was close enough to a zone border to trigger a zone change.void
createAndSendMoveToAction(Point2D point, boolean doubleClick)
Send a move to command to the server.void
dropEntity(IEntity entity, int amount, Point point)
Drop an entity to the container.Get the JComponent of the container.Get the client.Get the screen corresponding to the ground container.inspectMe(IEntity suspect, RPSlot content, SlotWindow container, int width, int height)
void
void
void
void
void
mouseMoved(MouseEvent e)
void
Remembers whether the client was active on last mouse down.void
void
void
setNewMouseHandlerState(GroundContainerMouseState newState)
Set the mouse handler state for the ground.
-
Constructor Details
-
GroundContainer
Create a new GroundContainer.- Parameters:
client
- clientgameScreen
- screen corresponding to the groundcanvas
- The component to place popup menus
-
-
Method Details
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
createAndSendMoveToAction
Send a move to command to the server.- Parameters:
point
- destinationdoubleClick
-true
if the action was created with a double click,false
otherwise
-
calculateZoneChangeDirection
Calculates whether the click was close enough to a zone border to trigger a zone change.- Parameters:
point
- click point in world coordinates- Returns:
- Direction of the zone to change to,
null
if no zone change should happen
-
dropEntity
Drop an entity to the container.- Parameters:
entity
- dropped entityamount
- number of entities droppedpoint
- dropping location
-
mouseWheelMoved
- Specified by:
mouseWheelMoved
in interfaceMouseWheelListener
-
inspectMe
public SlotWindow inspectMe(IEntity suspect, RPSlot content, SlotWindow container, int width, int height) -
getScreen
Get the screen corresponding to the ground container.- Returns:
- screen
-
getCanvas
Get the JComponent of the container.- Returns:
- component
-
getClient
Get the client.- Returns:
- client
-
setNewMouseHandlerState
Set the mouse handler state for the ground.- Parameters:
newState
- new mouse state
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mousePressed
Remembers whether the client was active on last mouse down.- Specified by:
mousePressed
in interfaceMouseListener
- Parameters:
e
- event
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-