@Override public String toString() { return "SetAcceptedStockMaterialAction [material=" + material + ", accept=" + accept + ", getPosition()=" + getPosition() + "]"; } }
@Override public PointAction getSelectAction(ShortPoint2D position) { return new SetTradingWaypointAction(wp, position); } });
@Override public PointAction getSelectAction(ShortPoint2D position) { return new SetDockAction(position); } });
/** * This allows the current panel to catch actions that are executed. * * @param action * The action to catch. * @return The action to override with. May be <code>null</code> to cancel. */ public IAction catchAction(IAction action) { PointAction overrideAction; if (action.getActionType() == EActionType.SELECT_POINT && (overrideAction = getSelectAction(((PointAction) action).getPosition())) != null) { return overrideAction; } else { return action; } }
@Override public IAction catchAction(IAction action) { if ((action.getActionType() == EActionType.MOVE_TO || action.getActionType() == EActionType.ABORT) && activeBuilding != null) { action = new ShowConstructionMarksAction(null); } if (action.getActionType() == EActionType.SHOW_CONSTRUCTION_MARK) { setActiveBuilding(((ShowConstructionMarksAction) action).getBuildingType()); } return super.catchAction(action); }
@Override public void eventDataChanged(GOEvent event) { Action action = getActionForDraw((GODrawEvent) event); if (action != null && action.getActionType() == EActionType.PAN_TO) { minimap.getContext().scrollTo( ((PointAction) action).getPosition()); } }
/** * @return Returns the position of the manager whose settings will be changed. */ @Override public ShortPoint2D getPosition() { return super.getPosition(); }
@Override public IAction catchAction(IAction action) { if (action.getActionType() == EActionType.ABORT) { return new Action(EActionType.DESELECT); } return super.catchAction(action); } }
@Override public Action getAction(float relativeX, float relativeY) { int step = (int) (relativeX * NUMBER_OF_BUTTONS) - 1; if (step >= 0) { return getActionForStep(step); } else { return new Action(EActionType.ASK_SET_DOCK); } } }
@Override public PointAction getSelectAction(ShortPoint2D position) { if (activeBuilding != null) { return new BuildAction(activeBuilding, position); } else { return null; } }
@Override public PointAction getSelectAction(ShortPoint2D position) { return new PointAction(EActionType.SET_WORK_AREA, position); } });
@Override public Action getAction() { return new SetBuildingPriorityAction(next); }
@Override public Action getAction() { if (selectionManager != null) { EMaterialType selected = selectionManager.getSelected(); if (selected != null) { return new ChangeTradingRequestAction(selected, amount, relative); } } return null; }
public Action getAction() { return new SetMaterialProductionAction(positionSupplier.getPosition(), materialType, productionType, 0); } }
/** * Create a new soldier button. * * @param actionType * The action to perform on click. * @param type * The soldier type. * @param image * The image to use. */ public SoldierButton(EActionType actionType, ESoldierType type, ImageLink image) { super(new SoldierAction(actionType, type), image, image, Labels.getString("action_" + actionType + "_" + type)); } }
@Override public Action getAction() { if (selectedProvider == null || mapPositionProvider == null) { return null; } EMaterialType selected = selectedProvider.get(); ShortPoint2D mapPosition = mapPositionProvider.get(); if (selected == null || mapPosition == null) { return null; } return new SetAcceptedStockMaterialAction(mapPosition, selected, accept, local); }
@Override public Action getAction() { if (panel == null) { return null; } EMaterialType selected = panel.getSelected(); ShortPoint2D mapPosition = panel.getMapPosition(); if (selected == null || mapPosition == null) { return null; } EMaterialType[] order = panel.reorder(selected, panel.indexOf(selected) + add); return new SetMaterialPrioritiesAction(mapPosition, order); } }
/** * @return Returns the position of the manager whose settings will be changed. */ @Override public ShortPoint2D getPosition() { return super.getPosition(); }
public SelectPointMessage(String message) { super(message, null, null, Labels.getString("abort"), new Action(EActionType.ABORT)); }
public SimpleActionButton(EActionType actionType, ImageLink image, ImageLink active) { super(new Action(actionType), image, active, Labels.getName(actionType)); }