Exemplo n.º 1
0
  public static void setEnabled(boolean b, Composition comp) {
    assert SwingUtilities.isEventDispatchThread() : "not EDT thread";

    if (Build.CURRENT.isRobotTest()) {
      if (comp != null) {
        boolean hasSelection = comp.hasSelection();
        if (hasSelection != b) {
          String name = comp.getName();
          throw new IllegalStateException(
              "composition " + name + ": hasSelection = " + hasSelection + ", b = " + b);
        }
      }
    }

    cropAction.setEnabled(b);
    traceWithBrush.setEnabled(b);
    traceWithEraser.setEnabled(b);
    deselectAction.setEnabled(b);
    invertSelectionAction.setEnabled(b);
    modifyAction.setEnabled(b);
  }