home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 November
/
Chip_1998-11_cd.bin
/
tema
/
Cafe
/
jfc.bin
/
TextUI.java
< prev
next >
Wrap
Text File
|
1998-02-26
|
3KB
|
96 lines
/*
* @(#)TextUI.java 1.18 97/10/13
*
* Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*
*/
package com.sun.java.swing.plaf;
import com.sun.java.swing.Action;
import com.sun.java.swing.BoundedRangeModel;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Insets;
import com.sun.java.swing.text.*;
/**
* Text editor user interface
*
* @author Timothy Prinzing
* @version 1.18 10/13/97
*/
public abstract class TextUI extends ComponentUI
{
/**
* Converts the given location in the model to a place in
* the view coordinate system.
*
* @param pos the local location in the model to translate
* @return the coordinates as a rectangle
* @exception BadLocationException if the given position does not
* represent a valid location in the associated document
*/
public abstract Rectangle modelToView(int pos) throws BadLocationException;
/**
* Converts the given place in the view coordinate system
* to the nearest representative location in the model.
*
* @param pt the location in the view to translate. This
* should be in the same coordinate system as the mouse
* events.
* @returns the offset from the start of the document
*/
public abstract int viewToModel(Point pt);
/**
* Causes the portion of the view responsible for the
* given part of the model to be repainted.
*
* @param p0 the beginning of the range
* @param p1 the end of the range
*/
public abstract void damageRange(int p0, int p1);
/**
* Fetches the binding of services that set a policy
* for the type of document being edited. This contains
* things like the commands available, stream readers and
* writers, etc.
*
* @return the editor kit binding
*/
public abstract EditorKit getEditorKit();
/**
* Fetches a View with the allocation of the associated
* text component (ie the root of the hierarchy) that
* can be traversed to determine how the model is being
* represented spatially.
*
* @return the view
*/
public abstract View getRootView();
/**
* Fetches the default margin space for the text ui.
*
* @return the margins
*/
public abstract Insets getDefaultMargin();
}