예제 #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);
  }
예제 #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;
  }
예제 #3
0
 private void updateData(FakeWardData fakeWardData) {
   if (fakeWardData.isValid()) getElement().getFirstChildElement().setClassName("setupMask");
   else getElement().getFirstChildElement().setClassName("setupMask invalid");
 }