public SynchronizeMessage createSynchronizationMessage(Object obj) { Component component = (Component) obj; Synchronize2DMessage message = new Synchronize2DMessage(); message.setPositionX(component.getX()); message.setPositionY(component.getY()); return message; }
public void applySynchronizationMessage(SynchronizeMessage message, Object obj) { Component component = (Component) obj; Synchronize2DMessage m = (Synchronize2DMessage) message; component.setBounds((int) m.getPositionX(), (int) m.getPositionY(), 50, 50); }