Package org.apache.pivot.wtk
Class ApplicationContext.DisplayHost
- java.lang.Object
-
- java.awt.Component
-
- org.apache.pivot.wtk.ApplicationContext.DisplayHost
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
- Enclosing class:
- ApplicationContext
public static class ApplicationContext.DisplayHost extends java.awt.Component
Native display host. This is the Pivot interface with AWT.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DisplayHost()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.AWTEvent
getCurrentAWTEvent()
Display
getDisplay()
java.awt.im.InputMethodRequests
getInputMethodRequests()
double
getScale()
void
paint(java.awt.Graphics graphics)
void
print(java.awt.Graphics graphics)
protected void
processComponentEvent(java.awt.event.ComponentEvent event)
protected void
processEvent(java.awt.AWTEvent event)
protected void
processFocusEvent(java.awt.event.FocusEvent event)
protected void
processInputMethodEvent(java.awt.event.InputMethodEvent event)
protected void
processKeyEvent(java.awt.event.KeyEvent event)
protected void
processMouseEvent(java.awt.event.MouseEvent event)
protected void
processMouseMotionEvent(java.awt.event.MouseEvent event)
protected void
processMouseWheelEvent(java.awt.event.MouseWheelEvent event)
void
repaint(int x, int y, int width, int height)
void
scaleDown()
Use this method to zoom out of the application's main window (that is, to make all the text and components visually smaller).void
scaleUp()
Use this method to zoom in to the application's main window (that is, make all the text and components look visually bigger).void
setBufferedImagePaintEnabled(boolean enabled)
void
setScale(double newScale)
Use this method to scale up or down (that is zoom in or out) the entire application's display.void
setVolatileImagePaintEnabled(boolean enabled)
Under some conditions, e.g.void
update(java.awt.Graphics graphics)
-
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, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, processHierarchyBoundsEvent, processHierarchyEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
-
-
-
-
Method Detail
-
getInputMethodRequests
public java.awt.im.InputMethodRequests getInputMethodRequests()
- Overrides:
getInputMethodRequests
in classjava.awt.Component
-
getDisplay
public Display getDisplay()
-
getCurrentAWTEvent
public java.awt.AWTEvent getCurrentAWTEvent()
-
getScale
public double getScale()
- Returns:
- The current scale (or zoom) factor for the entire application's display.
- See Also:
setScale(double)
-
setScale
public void setScale(double newScale)
Use this method to scale up or down (that is zoom in or out) the entire application's display.For the main application window, use this (and related) methods to scale the display, but for any contained windows a
ScaleDecorator
must be used instead.- Parameters:
newScale
- The new scale (zoom) factor for the entire display.- See Also:
scaleUp()
,scaleDown()
,getScale()
-
scaleUp
public void scaleUp()
Use this method to zoom in to the application's main window (that is, make all the text and components look visually bigger).The scale is increased in discrete steps for each call to this method: 1, 1.25, 1.5, 2.0, then whole integer values up to a maximum of 12.
- See Also:
setScale(double)
,scaleDown()
,getScale()
-
scaleDown
public void scaleDown()
Use this method to zoom out of the application's main window (that is, to make all the text and components visually smaller).The scale is decreased in discrete steps for each call to this method: next whole integer down for values above 2.0, then 2.0, 1.5, 1.25, then finally 1.
- See Also:
setScale(double)
,scaleUp()
,getScale()
-
setVolatileImagePaintEnabled
public void setVolatileImagePaintEnabled(boolean enabled)
Under some conditions, e.g. running under Linux in an applet, volatile buffering can reduce performance.- Parameters:
enabled
- Whether or not to use volatile image painting.
-
setBufferedImagePaintEnabled
public void setBufferedImagePaintEnabled(boolean enabled)
-
repaint
public void repaint(int x, int y, int width, int height)
- Overrides:
repaint
in classjava.awt.Component
-
paint
public void paint(java.awt.Graphics graphics)
- Overrides:
paint
in classjava.awt.Component
-
update
public void update(java.awt.Graphics graphics)
- Overrides:
update
in classjava.awt.Component
-
print
public void print(java.awt.Graphics graphics)
- Overrides:
print
in classjava.awt.Component
-
processEvent
protected void processEvent(java.awt.AWTEvent event)
- Overrides:
processEvent
in classjava.awt.Component
-
processComponentEvent
protected void processComponentEvent(java.awt.event.ComponentEvent event)
- Overrides:
processComponentEvent
in classjava.awt.Component
-
processFocusEvent
protected void processFocusEvent(java.awt.event.FocusEvent event)
- Overrides:
processFocusEvent
in classjava.awt.Component
-
processInputMethodEvent
protected void processInputMethodEvent(java.awt.event.InputMethodEvent event)
- Overrides:
processInputMethodEvent
in classjava.awt.Component
-
processMouseEvent
protected void processMouseEvent(java.awt.event.MouseEvent event)
- Overrides:
processMouseEvent
in classjava.awt.Component
-
processMouseMotionEvent
protected void processMouseMotionEvent(java.awt.event.MouseEvent event)
- Overrides:
processMouseMotionEvent
in classjava.awt.Component
-
processMouseWheelEvent
protected void processMouseWheelEvent(java.awt.event.MouseWheelEvent event)
- Overrides:
processMouseWheelEvent
in classjava.awt.Component
-
processKeyEvent
protected void processKeyEvent(java.awt.event.KeyEvent event)
- Overrides:
processKeyEvent
in classjava.awt.Component
-
-