Exemplo n.º 1
0
  public FakeWardItem(FakeWardData fakeWardData, UIItemRenderingHints hints) {
    super(fakeWardData.getX(), fakeWardData.getY(), hints);

    this.fakeWardData = fakeWardData;

    getElement()
        .setClassName("ward ward-" + fakeWardData.getType().replace("_", "-")); // $NON-NLS-1$
    getElement().setAttribute("unselectable", "on"); // $NON-NLS-1$ //$NON-NLS-2$

    getElement().setInnerHTML("<div class=\"setupMask\"></div>");

    updateData(fakeWardData);
  }
Exemplo n.º 2
0
  @Override
  public void onDataUpdate(Object newData) {
    FakeWardData newFakeWardData = (FakeWardData) newData;

    if (fakeWardData.getX() != newFakeWardData.getX()
        || fakeWardData.getY() != newFakeWardData.getY())
      setLocation(newFakeWardData.getX(), newFakeWardData.getY());

    if (fakeWardData.isValid() != newFakeWardData.isValid()) updateData(newFakeWardData);

    fakeWardData = newFakeWardData;
  }
Exemplo n.º 3
0
 private void updateData(FakeWardData fakeWardData) {
   if (fakeWardData.isValid()) getElement().getFirstChildElement().setClassName("setupMask");
   else getElement().getFirstChildElement().setClassName("setupMask invalid");
 }