public abstract class ScrollingTICComponent extends TICComponent
Note that getSwingComponentClassName(Object...)
and getSWTComponentClassName(Object...)
must be overwritten to return names of classes that implement ScrollingToolkitComponent
.
The default implementations of this class throw an UnsupportedToolkitException
.
DISPATCHER_MAP, repaintRequested
Constructor and Description |
---|
ScrollingTICComponent() |
Modifier and Type | Method and Description |
---|---|
void |
fireControlScrolled(TICScrollEvent event)
Informs all listeners that the contained component was scrolled.
|
java.util.Set<TICScrollListener> |
getScrollListeners()
Returns an editable set of scroll listeners that will be notified by on scroll events happening
within this component.
|
int |
getScrollOffsetX()
Returns the current painting offset on x.
|
int |
getScrollOffsetY()
Returns the current painting offset on y.
|
protected java.lang.String |
getSwingComponentClassName(java.lang.Object... parameters)
Throws an
UnsupportedToolkitException . |
protected java.lang.String |
getSWTComponentClassName(java.lang.Object... parameters)
Throws an
UnsupportedToolkitException . |
ScrollingToolkitComponent |
getToolkitComponent()
Returns a toolkit specific component used to display the contents of this class.
|
java.awt.Rectangle |
getVisibleRectangle()
Returns the rectangle in the coordinate system of the scrolled component that is currently visible.
|
void |
scrollRectangleToVisible(java.awt.geom.Rectangle2D rectangle)
Scrolls the contained component so that the specified rectangle of that component is visible.
|
void |
setScrollOffset(int x,
int y)
Sets the current painting offset on x and y.
|
void |
setScrollOffsetX(int x)
Sets the current painting offset on x.
|
void |
setScrollOffsetY(int y)
Sets the current painting offset on y.
|
addKeyListener, addMouseListener, addMouseWheelListener, assignSize, dispatchEvent, getCurrentToolkit, getKeyListenersSet, getMouseListenersSet, getMouseWheelListenersSet, getSize, getSwingComponentConstructorParameters, getSWTComponentConstructorParameters, hasDefinedSize, hasToolkitComponent, isUpdateOngoing, paint, removeKeyListener, removeMouseListener, removeWheelMouseListener, repaint, setToolkitComponent, setUpdateOngoing
public ScrollingTICComponent()
public ScrollingToolkitComponent getToolkitComponent()
TICComponent
getToolkitComponent
in class TICComponent
null
if neither a Swing nor a SWT component has yet been createdprotected java.lang.String getSwingComponentClassName(java.lang.Object... parameters)
UnsupportedToolkitException
. Inherited classes should overwrite this method to
provide a Swing toolkit component that implements ScrollingToolkitComponent
.getSwingComponentClassName
in class TICComponent
parameters
- an optional list of parameters that were passed to the getSwingComponent()
method of SwingComponentFactory
protected java.lang.String getSWTComponentClassName(java.lang.Object... parameters)
UnsupportedToolkitException
. Inherited classes should overwrite this method to
provide an SWT toolkit component that implements ScrollingToolkitComponent
.getSWTComponentClassName
in class TICComponent
parameters
- an optional list of parameters that were passed to the getSWTComponent()
method of SWTComponentFactory
public void setScrollOffset(int x, int y)
setScrollOffsetX(int)
and setScrollOffsetY(int)
separately to avoid unnecessary
repainting.
If no toolkit component has yet been created, calling this method will have no effect.
x
- the new shift of the painting coordinate origin on xy
- the new shift of the painting coordinate origin on ypublic void setScrollOffsetX(int x)
If no toolkit component has yet been created, calling this method will have no effect.
scrollOffsetX
- the new shift of the painting coordinate origin on xpublic void setScrollOffsetY(int y)
If no toolkit component has yet been created, calling this method will have no effect.
y
- the new shift of the painting coordinate origin on ypublic int getScrollOffsetX()
public int getScrollOffsetY()
public void scrollRectangleToVisible(java.awt.geom.Rectangle2D rectangle)
rectangle
- the rectangle that shall become fully visiblepublic java.awt.Rectangle getVisibleRectangle()
public java.util.Set<TICScrollListener> getScrollListeners()
public void fireControlScrolled(TICScrollEvent event)
This method is meant to be called by scrolling toolkit components. Application will not have to call this method directly, unless it implements custom scrolling toolkit components.
event
- the object describing the scroll event