Example #1
0
 /** Static wrapper method for DebugGraphicsInfo.getDebugOptions(). */
 static int getDebugOptions(JComponent component) {
   DebugGraphicsInfo debugGraphicsInfo = info();
   if (debugGraphicsInfo == null) {
     return 0;
   } else {
     return debugGraphicsInfo.getDebugOptions(component);
   }
 }
Example #2
0
  /**
   * Returns non-zero if <b>component</b> should display with DebugGraphics, zero otherwise. Walks
   * the JComponent's parent tree to determine if any debugging options have been set.
   */
  static int shouldComponentDebug(JComponent component) {
    DebugGraphicsInfo info = info();
    if (info == null) {
      return 0;
    } else {
      Container container = (Container) component;
      int debugOptions = 0;

      while (container != null && (container instanceof JComponent)) {
        debugOptions |= info.getDebugOptions((JComponent) container);
        container = container.getParent();
      }

      return debugOptions;
    }
  }