com.swfm.mica.shapes
Class MiText

java.lang.Object
  extended bycom.swfm.mica.core.MiPart
      extended bycom.swfm.mica.shapes.MiText
All Implemented Interfaces:
MiiActionTypes, MiiAttributeTypes, MiiDragAndDropParticipant, MiiEventTypes, MiiNames, MiiPropertyTypes, MiiTypes

public class MiText
extends MiPart

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
                 
Constructor Summary
MiText()
           
MiText(double x, double y, java.lang.String str)
           
MiText(java.lang.String str)
           
 
Method Summary
 void calcMinimumSize(MiSize size)
          Gets the minimum size of this MiPart.
 void calcPreferredSize(MiSize size)
          Gets the preferred size of this MiPart.
 int convertLocationToPosition(MiPoint pt)
           
 void copy(MiPart source)
          Copies the given MiPart.
 void doRotate(MiPoint center, double radians)
          Rotates this MiPart the given number of radians about the given point.
 double getBaselineY()
           
 MiBounds getBoundsAtDrawnScale(MiRenderer renderer)
           
 int getCursorPosition()
           
 char getEchoCharacter()
           
 int getFirstDisplayedColumn()
           
 MiFont getFontDrawn()
           
 MiIFlowEditorEventHandler getInteractiveEditor()
           
 MiBounds getItemBounds(int charPos)
           
 double getLineSpacing()
           
 int getMaxNumCharacters()
           
 boolean getModificationsAreUndoable()
           
 boolean getMustDoubleClickToEdit()
           
 int getNumberOfRows()
           
 int getNumDisplayedColumns()
           
 int getNumDisplayedRows()
           
 double getPageWidth()
           
 MiPropertyDescriptions getPropertyDescriptions()
          Gets the descriptions of all of the properties.
 java.lang.String getPropertyValue(java.lang.String name)
          Gets the textual value of the property with the given name.
 int getRowLength(int row)
           
static boolean getScaleChangeModifiesFontPointSize()
           
 boolean getSelectEntireTextAsPartInEditor()
           
 java.lang.String getSelection()
           
 int getSelectionEnd()
           
 int getSelectionStart()
           
 java.lang.String getText()
           
 MiAttributes getUnderlineAndStrikeOutWhenBoldAttributes()
           
 MiAttributes getUnderlineAndStrikeOutWhenNotBoldAttributes()
           
 java.lang.String getValue()
           
 boolean getWordWrapEnabled()
           
 boolean isEditable()
           
 boolean isExpandingSystemMacrosFoundInSpecifiedText()
           
 boolean isRowLineWrapped(int row)
           
 boolean pick(MiBounds area)
          Gets whether the given area intersects the bounds of this MiPart.
 void refreshLookAndFeel()
           
 void render(MiRenderer renderer)
           
 void scale(MiPoint center, MiScale scale)
          Scales the parts of this MiPart by the given scale factor.
 void set1DShapeStrokeBackgroundColor(java.awt.Color c)
          Sets the background (fill) color of the (wide) lines of a shape unless it is a rectangle, circle, etc, whose stroke fill color is always the foreground color.
 void set1DShapeStrokesFilled(boolean flag)
          Sets whether the graphic will always be 'solid', i.e.
 void setAttributes(MiAttributes atts)
          Assigns the given attributes to this MiPart.
 void setBaselineY(double y)
           
 void setEchoCharacter(char ch)
           
 void setFirstDisplayedColumn(int num)
           
 void setFontHorizontalJustification(int justification)
          Sets the horizontal justfication any text.
 void setFontVerticalJustification(int justification)
          Sets the vertical justfication any text.
 void setInteractiveEditor(MiIFlowEditorEventHandler h)
           
 void setIsEditable(boolean flag)
           
 void setIsExpandingSystemMacrosFoundInSpecifiedText(boolean flag)
           
 void setKeyboardFocus(boolean flag)
           
 void setLineSpacing(double spacing)
           
 void setMaxNumCharacters(int num)
           
 void setModificationsAreUndoable(boolean flag)
           
 void setMustDoubleClickToEdit(boolean flag)
           
 void setNumDisplayedColumns(int num)
           
 void setNumDisplayedRows(int num)
           
 void setPageWidth(double w)
           
 void setPropertyValue(java.lang.String name, java.lang.String value)
          Sets the property with the given name to the given value.
static void setScaleChangeModifiesFontPointSize(boolean flag)
           
 void setSelectEntireTextAsPartInEditor(boolean flag)
           
 void setSelection(int start, int end)
           
 void setSelectionEnd(int pos)
           
 void setSelectionStart(int pos)
           
 void setSensitive(boolean flag)
          Sets whether this MiPart is sensitive.
 void setText(java.lang.String str)
           
 void setUnderlineAndStrikeOutWhenBoldAttributes(MiAttributes atts)
           
 void setUnderlineAndStrikeOutWhenNotBoldAttributes(MiAttributes atts)
           
 void setUnderlineLetter(int index)
           
 void setValue(java.lang.String s)
           
 void setWordWrapEnabled(boolean flag)
           
 java.lang.String toString()
          Returns information about this MiPart.
 
Methods inherited from class com.swfm.mica.core.MiPart
_reCalcBounds, _render, _replaceBounds, _setContainer, _setDrawManager, _setValidatingLayout, appendActionHandler, appendActionHandler, appendActionHandler, appendActionHandler, appendActionHandler, appendAttachment, appendAttachment, appendCommandHandler, appendCommandHandler, appendCommandHandler, appendConnection, appendContainer, appendEventHandler, appendItem, appendPart, appendPoint, appendPoint, applyCustomLookAndFeel, containsItem, containsOpaqueRectangles, containsPart, copy, deepCopy, deleteAllConnections, deleteAllParts, deleteSelf, dispatchAction, dispatchAction, dispatchAction, dispatchActionRequest, dispatchActionRequest, dispatchActionRequest, dispatchEvent, doExport, doImport, draw, drawNow, drawNow, flip, flip, freeAccessLock, get1DShapeStrokeBackgroundColor, get1DShapeStrokesFilled, getAccessLock, getActionHandler, getActionsGenerated, getActionsLocallyGenerated, getActionsRequestedFromParts, getAfterRenderer, getAlphaCompositeRenderMode, getAnnotationPointManager, getAssociatedParts, getAttachment, getAttachment, getAttachmentMargins, getAttachments, getAttributeLockMask, getAttributePublicMask, getAttributes, getAttributeValue, getBackgroundColor, getBackgroundImage, getBackgroundRenderer, getBackgroundTile, getBalloonHelp, getBeforeRenderer, getBlackColor, getBorderHiliteColor, getBorderHiliteWidth, getBorderLook, getBorderRenderer, getBounds, getBounds, getCenter, getCenter, getCenterOfRotation, getCenterX, getCenterY, getColor, getConnection, getConnectionPointManager, getContainer, getContainerRequestedActions, getContainingEditor, getContainingWindow, getContextCursor, getContextMenu, getContextMenu, getControlPointManager, getCustomLookAndFeels, getCustomLookAndFeels, getDarkColor, getDeepConnection, getDeepConnection, getDeepConnections, getDeeplyInvalidateAreas, getDefaultAttributes, getDialogHelp, getDoubleBuffer, getDragAndDropBehavior, getDrawBounds, getDrawManager, getEventHandler, getEventHandler, getEventHandlerWithClass, getEventHandlingDisabledByContainer, getEventHandlingEnabled, getFlipped, getFont, getFontHorizontalJustification, getFontPointSize, getFontVerticalJustification, getHasBorderHilite, getHasShadow, getHeight, getID, getIncomingInvalidLayoutNotificationsEnabled, getIndexOfItem, getIndexOfPart, getInnerBounds, getInnerBounds, getIntersectionWithLine, getInvalidAreaNotificationsEnabled, getInvalidLayoutNotificationsEnabled, getItem, getItem, getKeyFocusTraversalGroup, getLayout, getLayoutManipulator, getLightColor, getLineEndSize, getLineEndsRenderer, getLineEndsSizeFnOfLineWidth, getLineEndStyle, getLineStartSize, getLineStartStyle, getLineStyle, getLineWidth, getLocallyRequestedEventTypes, getManipulator, getMargins, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumPickAreaSize, getMinimumSize, getMinimumWidth, getName, getNumberOfActionHandlers, getNumberOfAttachments, getNumberOfConnections, getNumberOfContainers, getNumberOfDeepConnections, getNumberOfEventHandlers, getNumberOfItems, getNumberOfParts, getNumberOfPoints, getNumberOfResources, getOutgoingInvalidLayoutNotificationsEnabled, getPart, getPart, getPoint, getPoint, getPointEntryAngle, getPointExitAngle, getPointX, getPointY, getPreferredSize, getPrototypeManipulator, getRelativeLocation, getResource, getResourceName, getRootWindow, getRotation, getSelectionGraphics, getShadowColor, getShadowDirection, getShadowLength, getShadowRenderer, getShadowShape, getShadowStyle, getSize, getSnapPointManager, getStatusHelp, getSupportedExportFormats, getSupportedImportFormats, getThisOrPartHasInvalidArea, getToolHintHelp, getTotalNumberOfPartsCreated, getTransform, getTransparency, getValidatingLayout, getVisibilityAnimator, getWhiteColor, getWidth, getWriteMode, getXmax, getXmin, getXorColor, getYmax, getYmin, hasAttachment, hasAttribute, hasEnterKeyFocus, hasEventHandler, hasEventHandlers, hasFixedAspectRatio, hasFixedHeight, hasFixedWidth, hasKeyboardFocus, hasMouseFocus, hasOverriddenMinimumSize, hasOverriddenPreferredSize, hasProperty, hasTotallyInvalidArea, hasValidCachedEventHandlerInfo, hasValidLayout, insertActionHandler, insertActionHandler, insertActionHandler, insertConnection, insertContainer, insertEventHandler, insertItem, insertPart, insertPoint, insertPoint, invalidateArea, invalidateArea, invalidateLayout, isAcceptingEnterKeyFocus, isAcceptingKeyboardFocus, isAcceptingMouseFocus, isAcceptingTabKeys, isActionDispatchingEnabled, isConnectable, isConnectedTo, isContainerOf, isContainerOf, isContainerOfWithAttachments, isCopyable, isCopyableAsPartOfCopyable, isDeletable, isDoubleBuffered, isDragAndDropSource, isDragAndDropTarget, isFilled, isFontBold, isFontItalic, isFontUnderlined, isHidden, isMovable, isOpaqueRectangle, isPickable, isPickableWhenTransparent, isPrintable, isSavable, isSelectable, isSelected, isSensitive, isShowing, isSnappable, isUngroupable, isValidConnectionDestination, isValidConnectionSource, isVisible, layoutParts, makeImageFromArea, makeLayoutManipulator, makeManipulator, optimizedInvalidateArea, optimizedInvalidateDrawBoundsArea, overrideAttributes, overrideEventHandlingDisabledByContainer, packLayout, pickDeepList, pickDeepListContents, pickObject, preRenderToDoubleBuffer, refreshBounds, refreshLookAndFeel, removeActionHandler, removeActionHandler, removeActionHandlers, removeAllActionHandlers, removeAllAttachments, removeAllConnections, removeAllEventHandlers, removeAllItems, removeAllManipulators, removeAllParts, removeAttachment, removeAttachment, removeCommandHandler, removeCommandHandler, removeConnection, removeConnection, removeContainer, removeContainer, removeEventHandler, removeFromAllContainers, removeItem, removeItem, removePart, removePart, removePoint, removeResource, removeSelf, replaceDrawBounds, replaceSelf, requestEnterKeyFocus, requestKeyboardFocus, rotate, rotate, rotateTo, scale, scale, select, setAcceptingEnterKeyFocus, setAcceptingKeyboardFocus, setAcceptingMouseFocus, setAcceptingTabKeys, setActionDispatchingEnabled, setAfterRenderer, setAlphaCompositeRenderMode, setAnnotationPointManager, setAttachmentDrawnAfter, setAttachmentMargins, setAttachmentsVisibility, setAttributeLockMask, setAttributePublicMask, setAttributeValue, setAttributeValue, setAttributeValue, setAttributeValue, setAttributeValue, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundRenderer, setBackgroundTile, setBalloonHelp, setBalloonHelpMessage, setBeforeRenderer, setBlackColor, setBorderHiliteColor, setBorderHiliteWidth, setBorderLook, setBorderRenderer, setBounds, setBounds, setCenter, setCenter, setCenterX, setCenterY, setColor, setColor, setConnectable, setConnectionPointManager, setContextCursor, setContextMenu, setControlPointManager, setCopyable, setCopyableAsPartOfCopyable, setCustomLookAndFeels, setCustomLookAndFeels, setDarkColor, setDeeplyInvalidateAreas, setDefaultAttributes, setDeletable, setDialogHelp, setDialogHelpMessage, setDoubleBuffer, setDoubleBuffered, setDragAndDropBehavior, setEventHandlingEnabled, setFilled, setFixedAspectRatio, setFixedHeight, setFixedWidth, setFont, setFontBold, setFontItalic, setFontPointSize, setFontUnderlined, setHasBorderHilite, setHasShadow, setHeight, setHidden, setIncomingInvalidLayoutNotificationsEnabled, setInvalidAreaNotificationsEnabled, setInvalidLayoutNotificationsEnabled, setIsDragAndDropSource, setIsDragAndDropTarget, setIsOpaqueRectangle, setItem, setKeyFocusTraversalGroup, setLayout, setLightColor, setLineEndSize, setLineEndSizeFnOfLineWidth, setLineEndsRenderer, setLineEndStyle, setLineStartSize, setLineStartStyle, setLineStyle, setLineWidth, setMargins, setMaximumHeight, setMaximumWidth, setMinimumHeight, setMinimumPickAreaSize, setMinimumSize, setMinimumWidth, setMouseFocus, setMovable, setName, setNumberOfPoints, setOutgoingInvalidLayoutNotificationsEnabled, setPart, setPickable, setPickableWhenTransparent, setPoint, setPoint, setPreferredSize, setPrintable, setPropertyValues, setPrototypeManipulator, setResource, setSavable, setSelectable, setSelectionGraphics, setShadowColor, setShadowDirection, setShadowLength, setShadowRenderer, setShadowStyle, setSize, setSize, setSnappable, setSnapPointManager, setStatusHelp, setStatusHelpMessage, setSupportedImportFormats, setToolHintHelp, setToolHintMessage, setTransparency, setTransparency, setUngroupable, setVisibilityAnimator, setVisible, setWhiteColor, setWidth, setWriteMode, setXmax, setXmin, setXorColor, setYmax, setYmin, supportsImportOfSpecificInstance, translate, translate, translatePoint, validateLayout, validatePropertyValue, waitUntilRedrawn
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MiText

public MiText()

MiText

public MiText(java.lang.String str)

MiText

public MiText(double x,
              double y,
              java.lang.String str)
Method Detail

setText

public void setText(java.lang.String str)

getText

public java.lang.String getText()

setValue

public void setValue(java.lang.String s)

getValue

public java.lang.String getValue()

setEchoCharacter

public void setEchoCharacter(char ch)

getEchoCharacter

public char getEchoCharacter()

setModificationsAreUndoable

public void setModificationsAreUndoable(boolean flag)

getModificationsAreUndoable

public boolean getModificationsAreUndoable()

setScaleChangeModifiesFontPointSize

public static void setScaleChangeModifiesFontPointSize(boolean flag)

getScaleChangeModifiesFontPointSize

public static boolean getScaleChangeModifiesFontPointSize()

setWordWrapEnabled

public void setWordWrapEnabled(boolean flag)

getWordWrapEnabled

public boolean getWordWrapEnabled()

setIsEditable

public void setIsEditable(boolean flag)

isEditable

public boolean isEditable()

setSensitive

public void setSensitive(boolean flag)
Description copied from class: MiPart
Sets whether this MiPart is sensitive.

Overrides:
setSensitive in class MiPart
Parameters:
flag - true if this is to be sensitive

setFontHorizontalJustification

public void setFontHorizontalJustification(int justification)
Description copied from class: MiPart
Sets the horizontal justfication any text. Valid justifications are: Mi_CENTER_JUSTIFIED Mi_LEFT_JUSTIFIED Mi_RIGHT_JUSTIFIED Mi_JUSTIFIED

Overrides:
setFontHorizontalJustification in class MiPart
Parameters:
justification - the justification

setFontVerticalJustification

public void setFontVerticalJustification(int justification)
Description copied from class: MiPart
Sets the vertical justfication any text. Valid justifications are: Mi_CENTER_JUSTIFIED Mi_BOTTOM_JUSTIFIED Mi_TOP_JUSTIFIED Mi_JUSTIFIED

Overrides:
setFontVerticalJustification in class MiPart
Parameters:
justification - the justification

setSelectEntireTextAsPartInEditor

public void setSelectEntireTextAsPartInEditor(boolean flag)

getSelectEntireTextAsPartInEditor

public boolean getSelectEntireTextAsPartInEditor()

setMustDoubleClickToEdit

public void setMustDoubleClickToEdit(boolean flag)

getMustDoubleClickToEdit

public boolean getMustDoubleClickToEdit()

setIsExpandingSystemMacrosFoundInSpecifiedText

public void setIsExpandingSystemMacrosFoundInSpecifiedText(boolean flag)

isExpandingSystemMacrosFoundInSpecifiedText

public boolean isExpandingSystemMacrosFoundInSpecifiedText()

setMaxNumCharacters

public void setMaxNumCharacters(int num)

getMaxNumCharacters

public int getMaxNumCharacters()

setFirstDisplayedColumn

public void setFirstDisplayedColumn(int num)

getFirstDisplayedColumn

public int getFirstDisplayedColumn()

setNumDisplayedRows

public void setNumDisplayedRows(int num)

getNumDisplayedRows

public int getNumDisplayedRows()

setLineSpacing

public void setLineSpacing(double spacing)

getLineSpacing

public double getLineSpacing()

setNumDisplayedColumns

public void setNumDisplayedColumns(int num)

getNumDisplayedColumns

public int getNumDisplayedColumns()

setPageWidth

public void setPageWidth(double w)

getPageWidth

public double getPageWidth()

setUnderlineLetter

public void setUnderlineLetter(int index)

setUnderlineAndStrikeOutWhenBoldAttributes

public void setUnderlineAndStrikeOutWhenBoldAttributes(MiAttributes atts)

getUnderlineAndStrikeOutWhenBoldAttributes

public MiAttributes getUnderlineAndStrikeOutWhenBoldAttributes()

setUnderlineAndStrikeOutWhenNotBoldAttributes

public void setUnderlineAndStrikeOutWhenNotBoldAttributes(MiAttributes atts)

getUnderlineAndStrikeOutWhenNotBoldAttributes

public MiAttributes getUnderlineAndStrikeOutWhenNotBoldAttributes()

getFontDrawn

public MiFont getFontDrawn()

setAttributes

public void setAttributes(MiAttributes atts)
Description copied from class: MiPart
Assigns the given attributes to this MiPart.

Overrides:
setAttributes in class MiPart
Parameters:
atts - the attributes

setSelectionStart

public void setSelectionStart(int pos)

getSelectionStart

public int getSelectionStart()

setSelectionEnd

public void setSelectionEnd(int pos)

getSelectionEnd

public int getSelectionEnd()

setSelection

public void setSelection(int start,
                         int end)

getSelection

public java.lang.String getSelection()

getCursorPosition

public int getCursorPosition()

refreshLookAndFeel

public void refreshLookAndFeel()
Overrides:
refreshLookAndFeel in class MiPart

render

public void render(MiRenderer renderer)
Parameters:
renderer - the renderer to use for drawing

setKeyboardFocus

public void setKeyboardFocus(boolean flag)
Parameters:
flag - true if this MiPart is to have keyboard focus
See Also:
MiKeyboardFocusManager

setInteractiveEditor

public void setInteractiveEditor(MiIFlowEditorEventHandler h)

getInteractiveEditor

public MiIFlowEditorEventHandler getInteractiveEditor()

scale

public void scale(MiPoint center,
                  MiScale scale)
Scales the parts of this MiPart by the given scale factor.

Overrides:
scale in class MiPart
Parameters:
center - the center of scaling
scale - the scale factor

toString

public java.lang.String toString()
Description copied from class: MiPart
Returns information about this MiPart.

Overrides:
toString in class MiPart
Returns:
textual information (class name + unique numerical id + name)

pick

public boolean pick(MiBounds area)
Description copied from class: MiPart
Gets whether the given area intersects the bounds of this MiPart.

Overrides:
pick in class MiPart
Parameters:
area - the area
Returns:
true if the given area overlaps the bounds of this MiPart.

getItemBounds

public MiBounds getItemBounds(int charPos)

convertLocationToPosition

public int convertLocationToPosition(MiPoint pt)

getNumberOfRows

public int getNumberOfRows()

getRowLength

public int getRowLength(int row)

isRowLineWrapped

public boolean isRowLineWrapped(int row)

calcPreferredSize

public void calcPreferredSize(MiSize size)
Description copied from class: MiPart
Gets the preferred size of this MiPart. Override this, if desired, as it implements the core functionality. The default behavior is to return the current bounds, or, if reversed, a zero size.

Overrides:
calcPreferredSize in class MiPart
Parameters:
size - the (returned) preferred size

calcMinimumSize

public void calcMinimumSize(MiSize size)
Description copied from class: MiPart
Gets the minimum size of this MiPart. Override this, if desired, as it implements the core functionality. The default behavior is to return the minimum width and/or height, or, if not specified, a zero size.

Overrides:
calcMinimumSize in class MiPart
Parameters:
size - the (returned) minimum size

copy

public void copy(MiPart source)
Copies the given MiPart. This MiPart will have the same attributes, bounds, resources, attachments, layouts, action handlers, and event handlers as the given MiPart.

Overrides:
copy in class MiPart
Parameters:
source - the part to copy
See Also:
MiPart.copy()

setBaselineY

public void setBaselineY(double y)

getBaselineY

public double getBaselineY()

getBoundsAtDrawnScale

public MiBounds getBoundsAtDrawnScale(MiRenderer renderer)

doRotate

public void doRotate(MiPoint center,
                     double radians)
Rotates this MiPart the given number of radians about the given point.

Parameters:
center - the center of rotation
radians - the angle to rotate

setPropertyValue

public void setPropertyValue(java.lang.String name,
                             java.lang.String value)
Sets the property with the given name to the given value.

Overrides:
setPropertyValue in class MiPart
Parameters:
name - the name of an property
value - the value of the property

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String name)
Gets the textual value of the property with the given name. If the value is null then MiiTypes.Mi_NULL_VALUE_NAME is returned.

Overrides:
getPropertyValue in class MiPart
Parameters:
name - the name of a property
Returns:
the string value of the property

getPropertyDescriptions

public MiPropertyDescriptions getPropertyDescriptions()
Gets the descriptions of all of the properties. These can be used to see if an property is different from the default value or if a proposed value is valid or to get a list of all of the valid values of a property.

Overrides:
getPropertyDescriptions in class MiPart
Returns:
the list of property descriptions

set1DShapeStrokeBackgroundColor

public void set1DShapeStrokeBackgroundColor(java.awt.Color c)
Description copied from class: MiPart
Sets the background (fill) color of the (wide) lines of a shape unless it is a rectangle, circle, etc, whose stroke fill color is always the foreground color.

Overrides:
set1DShapeStrokeBackgroundColor in class MiPart
Parameters:
c - the color

set1DShapeStrokesFilled

public void set1DShapeStrokesFilled(boolean flag)
Description copied from class: MiPart
Sets whether the graphic will always be 'solid', i.e. the background color will always be drawn with the (foreground) color for shapes except for rectangle, circle, etc, whose strokes are always filled.

Overrides:
set1DShapeStrokesFilled in class MiPart
Parameters:
flag - true if solid, false if the graphic shape is to be filled with whatever the background color is. The default is 'false'.
See Also:
MiPart.isFilled(), MiPart.setBackgroundColor(java.awt.Color), MiPart.setFilled(boolean)