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
ConstructorsConstructorDescriptionGroundContainer(StendhalClient client, IGameScreen gameScreen, JComponent canvas) Create a new GroundContainer. -
Method Summary
Modifier and TypeMethodDescriptionCalculates whether the click was close enough to a zone border to trigger a zone change.voidcreateAndSendMoveToAction(Point2D point, boolean doubleClick) Send a move to command to the server.voiddropEntity(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) voidvoidvoidvoidvoidvoidRemembers whether the client was active on last mouse down.voidvoidvoidSet 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:
mouseMovedin interfaceMouseMotionListener
-
createAndSendMoveToAction
Send a move to command to the server.- Parameters:
point- destinationdoubleClick-trueif the action was created with a double click,falseotherwise
-
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,
nullif 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:
mouseWheelMovedin 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:
mouseDraggedin interfaceMouseMotionListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mousePressed
Remembers whether the client was active on last mouse down.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
e- event
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-