MCPcopy Create free account
hub / github.com/Neop/mudmap2 / put

Method put

src/main/java/mudmap2/backend/Layer.java:202–209  ·  view source on GitHub ↗

Adds an element to the layer at the given position, removes it from it's old layer @param x x coordinate @param y y coordinate @param element new element @throws java.lang.Exception

(final LayerElement element, final int x, final int y)

Source from the content-addressed store, hash-verified

200 * @throws java.lang.Exception
201 */
202 public void put(final LayerElement element, final int x, final int y) throws Exception {
203 // remove element from other layer if one is set
204 if(element.getLayer() != null){
205 element.getLayer().remove(element);
206 }
207 element.setPosition(x, y, this);
208 put(element);
209 }
210
211 /**
212 * Adds an element to the layer, removes it from it's old layer

Callers 15

testGetSelectedPlaceMethod · 0.95
testBreadthSearchMethod · 0.95
testGetCenterXMethod · 0.95
testGetCenterYMethod · 0.95
testGetExactCenterMethod · 0.95
testGetXMinMethod · 0.95
testGetXMaxMethod · 0.95
testGetYMinMethod · 0.95
testGetYMaxMethod · 0.95
testPut_3argsMethod · 0.95
testPut_LayerElementMethod · 0.95
testGetMethod · 0.95

Calls 7

setPositionMethod · 0.80
callListenersMethod · 0.80
removeMethod · 0.65
getXMethod · 0.65
getYMethod · 0.65
getLayerMethod · 0.45
insertMethod · 0.45

Tested by 15

testGetSelectedPlaceMethod · 0.76
testBreadthSearchMethod · 0.76
testGetCenterXMethod · 0.76
testGetCenterYMethod · 0.76
testGetExactCenterMethod · 0.76
testGetXMinMethod · 0.76
testGetXMaxMethod · 0.76
testGetYMinMethod · 0.76
testGetYMaxMethod · 0.76
testPut_3argsMethod · 0.76
testPut_LayerElementMethod · 0.76
testGetMethod · 0.76