|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component com.mamarce.mhp.mf.components.ScrollableText
public class ScrollableText
ScrollableText.java A text component that can function as a stand-alone scrollable test displayer. Contains the neccessary methods for processing user input.
Field Summary | |
---|---|
static int |
ALIGN_BOTTOM
Align bottom. |
static int |
ALIGN_CENTER
Align center. |
static int |
ALIGN_LEFT
Align left. |
static int |
ALIGN_RIGHT
Align right. |
static int |
ALIGN_TOP
Align top. |
static int |
DIR_DOWN
Directional constants. |
static int |
DIR_UP
Directional constants. |
static int |
POS_BEGINNING
Position tokens. |
static int |
POS_END
Position tokens. |
static int |
SIDESCROLLER_ALWAYS
The sidescroller show-policy: sidescrolleer will be always shown. |
static int |
SIDESCROLLER_AS_NEEDED
The sidescroller show-policy: sidescrolleer will be shown onnly if necessary. |
static int |
SIDESCROLLER_NEVER
The sidescroller show- policy: sidescrolleer will be never shown. |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ScrollableText(java.awt.Insets insets,
int hAlign,
int vAlign,
int scrollerPolicy)
The complete constructors. |
Method Summary | |
---|---|
int |
getCurrentPage()
|
int |
getHiddenBottomScrollBlocks()
Returns the number of hidden rows below the visible area. |
int |
getHiddenTopScrollBlocks()
Returns the number of hidden rows above the visible area. |
int |
getNumberOfPages()
|
int |
getTotalScrollBlocks()
Returns the total number of rows contained within the object. |
int |
getVisibleScrollBlocks()
Returns the total number of rows that fits within the components boundaries. |
void |
jumpTo(int position)
Jumps to the given position (in rows) within the contents. |
void |
paint(java.awt.Graphics g)
Paints the text. |
void |
scrollContents(int direction)
Scrolls the component one scrollunit in the given direction. |
void |
scrollPage(int direction)
Scrolls the component one visible page (if available) in the given direction. |
void |
setBackground(java.awt.Color bg)
Sets the background of the text - supports transparent by providing null. |
void |
setFont(java.awt.Font font)
Changes the font of this component. |
void |
setHorizontalAlignment(int alignment)
Changes the horizontal alignment of this component. |
void |
setPresentation(int x,
int y,
int width,
int height,
int hAlign,
int vAlign,
java.lang.String txt)
Changes multiple properties of this component. |
void |
setScrollerColors(java.awt.Color bg,
java.awt.Color tabBg,
java.awt.Color activeArrow,
java.awt.Color inactiveArrow,
java.awt.Color arrowOutline,
java.awt.Color highlight,
java.awt.Color shadow)
Sets the color scheme for the sidescroller. |
void |
setScrollRows(int rows)
Sets the number or rows the component should be scrolled by with each scroll. |
void |
setSize(java.awt.Dimension dim)
Changes the size of this component. |
void |
setSize(int width,
int height)
Changes the size of this component. |
void |
setText(java.lang.String txt)
Changes the text within this component. |
void |
setVerticalAlignment(int alignment)
Changes the vertical alignment of this component. |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ALIGN_LEFT
public static final int ALIGN_RIGHT
public static final int ALIGN_CENTER
public static final int ALIGN_TOP
public static final int ALIGN_BOTTOM
public static final int DIR_UP
public static final int DIR_DOWN
public static final int POS_BEGINNING
public static final int POS_END
public static final int SIDESCROLLER_ALWAYS
public static final int SIDESCROLLER_NEVER
public static final int SIDESCROLLER_AS_NEEDED
Constructor Detail |
---|
public ScrollableText(java.awt.Insets insets, int hAlign, int vAlign, int scrollerPolicy)
insets
- The marginshAlign
- The horizontal alignment of the textvAlign
- The vertical alignment of the textscrollerPolicy
- The sidescroller policyMethod Detail |
---|
public void setText(java.lang.String txt)
txt
- text content.public void setSize(int width, int height)
setSize
in class java.awt.Component
width
- width.height
- height.public void setSize(java.awt.Dimension dim)
setSize
in class java.awt.Component
dim
- dimensions.public void setFont(java.awt.Font font)
setFont
in class java.awt.Component
font
- font.public void setBackground(java.awt.Color bg)
setBackground
in class java.awt.Component
bg
- backgroundColor.public void setScrollerColors(java.awt.Color bg, java.awt.Color tabBg, java.awt.Color activeArrow, java.awt.Color inactiveArrow, java.awt.Color arrowOutline, java.awt.Color highlight, java.awt.Color shadow)
bg
- backgrouncolor.tabBg
- tab color.activeArrow
- active arrow color.inactiveArrow
- inactive arrow color.arrowOutline
- outline arrow color.highlight
- highlight color.shadow
- shadow color.public void setPresentation(int x, int y, int width, int height, int hAlign, int vAlign, java.lang.String txt)
x
- x coordiate.y
- y coordinate.width
- width.height
- height.hAlign
- horizzontal align.vAlign
- vertival align.txt
- The text to be contained within the component. If null, the
old text will be preserved.public void setHorizontalAlignment(int alignment)
alignment
- One of the Horizontal alignment constants; ALIGN_LEFT
ALIGN_RIGHT ALIGN_CENTER.public void setVerticalAlignment(int alignment)
alignment
- One of the Vertical alignment constants; ALIGN_TOP
ALIGN_BOTTOM ALIGN_CENTER.public void setScrollRows(int rows)
rows
- The number of rowspublic void scrollContents(int direction)
direction
- The direction; DIR_UP, DIR_DOWNpublic void scrollPage(int direction)
direction
- The direction of the scrollpublic void jumpTo(int position)
position
- The position, or a special code: POS_BEGINNING, POS_ENDpublic int getNumberOfPages()
public int getCurrentPage()
public int getTotalScrollBlocks()
public int getVisibleScrollBlocks()
public int getHiddenTopScrollBlocks()
public int getHiddenBottomScrollBlocks()
public void paint(java.awt.Graphics g)
paint
in class java.awt.Component
g
- Graphics
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |