/*
* 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.
*/
/**
* A composition area handler handles events and input method requests for
* the composition area. Typically each input method context has its own
* composition area handler if it supports passive clients or below-the-spot
* input, but all handlers share a single composition area.
*
* @author JavaSoft International
*/
/**
* Constructs the composition area handler.
*/
}
/**
* Creates the composition area.
*/
private void createCompositionArea() {
synchronized(compositionAreaLock) {
compositionArea = new CompositionArea();
if (compositionAreaOwner != null) {
}
// If the client component is an active client using below-the-spot style, then
// make the composition window undecorated without a title bar.
if(clientComponent!=null){
}
}
}
}
this.clientComponent = clientComponent;
}
/**
* Grabs the composition area, makes this handler its owner, and installs
* the handler and its input context into the composition area for event
* and input method request handling.
* If doUpdate is true, updates the composition area with previously sent
* composed text.
*/
synchronized (compositionAreaLock) {
if (compositionAreaOwner != this) {
compositionAreaOwner = this;
if (compositionArea != null) {
}
if (doUpdate) {
// Create the composition area if necessary
}
if (compositionArea != null) {
}
}
}
}
}
/**
* Releases and closes the composition area if it is currently owned by
* this composition area handler.
*/
void releaseCompositionArea() {
synchronized (compositionAreaLock) {
if (compositionAreaOwner == this) {
if (compositionArea != null) {
}
}
}
}
/**
* Releases and closes the composition area if it has been created,
* independent of the current owner.
*/
static void closeCompositionArea() {
if (compositionArea != null) {
synchronized (compositionAreaLock) {
}
}
}
/**
* Returns whether the composition area is currently visible
*/
boolean isCompositionAreaVisible() {
if (compositionArea != null) {
return compositionArea.isCompositionAreaVisible();
}
return false;
}
/**
* Shows or hides the composition Area
*/
if (compositionArea != null) {
}
}
} else {
}
}
/**
* set the compositionArea frame decoration
*/
if (compositionArea != null) {
}
}
//
// InputMethodListener methods
//
// extract composed text and prepare it for display
composedText = null;
// Create the composition area if necessary
if (compositionArea == null) {
}
// copy the composed text
}
if (compositionArea != null) {
}
// send any committed text to the text component
if (committedCharacterCount > 0) {
// this may have changed the text location, so reposition the window
if (isCompositionAreaVisible()) {
}
}
// event has been handled, so consume it
}
if (compositionArea != null) {
}
// event has been handled, so consume it
}
//
// InputMethodRequests methods
//
/**
* Returns the input method request handler of the client component.
* When using the composition window for an active client (below-the-spot
* input), input method requests that do not relate to the display of
* the composed text are forwarded to the client component.
*/
if (clientComponent != null) {
}
return null;
}
synchronized (compositionAreaLock) {
if (compositionAreaOwner == this && isCompositionAreaVisible()) {
} else if (composedText != null) {
// there's composed text, but it's not displayed, so fake a rectangle
} else {
} else {
// passive client, no composed text, so fake a rectangle
}
}
}
}
synchronized (compositionAreaLock) {
if (compositionAreaOwner == this && isCompositionAreaVisible()) {
return compositionArea.getLocationOffset(x, y);
} else {
return null;
}
}
}
public int getInsertPositionOffset() {
return req.getInsertPositionOffset();
}
// we don't have access to the client component's text.
return 0;
}
int endIndex,
Attribute[] attributes) {
}
// we don't have access to the client component's text.
return EMPTY_TEXT;
}
public int getCommittedTextLength() {
return req.getCommittedTextLength();
}
// we don't have access to the client component's text.
return 0;
}
}
// we don't have access to the client component's text.
return null;
}
}
// we don't have access to the client component's text.
return EMPTY_TEXT;
}
}