Ejemplo n.º 1
0
  @Override
  public void componentMouseDown(BaseComponent component, int offsetX, int offsetY, int button) {

    Stencil[] stencils = Stencil.values();
    if (component.equals(buttonDraw)) {
      getContainer().getOwner().onRequestStencilCreate(stencils[patternIndex]);
    } else {
      if (component.equals(buttonLeft)) {
        patternIndex--;
        if (patternIndex < 0) {
          patternIndex = stencils.length - 1;
        }
      } else if (component.equals(buttonRight)) {
        patternIndex++;
        patternIndex = patternIndex % stencils.length;
      }
      iconDisplay.setIcon(stencils[patternIndex].getBlockIcon());
    }
  }