/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class is used by the text components, AquaEditorPaneUI, AquaTextAreaUI, AquaTextFieldUI and AquaTextPaneUI to control painting of the
* component's border. NOTE: It is assumed that this handler is added to components that extend JComponent.
*/
// Flag to help focusGained() determine whether the origin focus loss was due to a temporary focus loss or not.
private boolean wasTemporary = false;
private boolean repaintBorder = false;
// If we gained focus and it wasn't due to a previous temporary focus loss
// or the frame became active again, then repaint the border on the component.
if (!wasTemporary || repaintBorder) {
repaintBorder = false;
}
wasTemporary = false;
}
// If we lost focus due to a permanent focus loss then repaint the border on the component.
if (!wasTemporary) {
}
}
// The FRAME_ACTIVE_PROPERTY change event is sent before a component gains focus.
// We set a flag to help the focusGained() determine when they should be repainting
// the components focus.
repaintBorder = true;
} else if (wasTemporary) {
// The FRAME_ACTIVE_PROPERTY change event is sent after a component loses focus.
// We use the wasTemporary flag to determine if we need to repaint the border.
}
}
if (c == null) return true;
return true;
}
if (source instanceof JComponent) {
}
}
};
}
}
// <rdar://problem/8166173> JTree: selection color does not dim when window becomes inactive
// TODO inject our colors into the DefaultTreeCellRenderer
}
if (!isComponentValid(c)) return;
return;
}
return;
}
}
}
if (!isComponentValid(c)) return;
return;
}
return;
}
}
}
if (c == null) return false;
return true;
}
}