sun.awt.qt
Class QtLabelPeer

java.lang.Object
  extended by sun.awt.qt.QtLabelPeer
All Implemented Interfaces:
ClipboardOwner, ComponentPeer, LabelPeer, sun.awt.UpdateClient

public class QtLabelPeer
extends Object
implements LabelPeer

The peer for label.


Constructor Summary
QtLabelPeer(QtToolkit toolkit, Label target)
          Creates a new QtLabelPeer.
 
Method Summary
protected  boolean canHavePixmapBackground()
          Decides whether it is possible for this component to have a pixmap background (i.e.
 int checkImage(java.awt.Image img, int w, int h, java.awt.image.ImageObserver o)
           
 void clearBackground(Graphics g)
           
protected  void create(sun.awt.qt.QtComponentPeer parentPeer)
          Creates this component peer.
 java.awt.Image createImage(java.awt.image.ImageProducer producer)
           
 java.awt.Image createImage(int width, int height)
           
 java.awt.image.VolatileImage createVolatileImage(int width, int height)
           
 void dispose()
           
 java.awt.image.ColorModel getColorModel()
           
 FontMetrics getFontMetrics(Font font)
           
 Graphics getGraphics()
           
 java.awt.Point getLocationOnScreen()
           
 java.awt.Dimension getMinimumSize()
           
 long getNativeComponent()
           
 java.awt.Dimension getPreferredSize()
           
 Toolkit getToolkit()
           
 void handleEvent(AWTEvent event)
           
 boolean isFocusable()
           
 boolean isFocusTraversable()
           
 void lostOwnership(Clipboard clipboard, Transferable contents)
          Notifies this object that it is no longer the owner of the contents of the clipboard.
 boolean nativeRequestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time)
           
 void paint(Graphics g)
           
 boolean prepareImage(java.awt.Image img, int w, int h, java.awt.image.ImageObserver o)
           
 void print(Graphics g)
           
 void repaint(long tm, int x, int y, int width, int height)
           
 boolean requestFocus(Component child, Window parent, boolean temporary, boolean focusedWindowChangeAllowed, long time)
           
 void setAlignment(int alignment)
           
 void setBackground(java.awt.Color c)
           
 void setBounds(int x, int y, int width, int height)
           
 void setCursor(java.awt.Cursor cursor)
           
 void setEnabled(boolean b)
           
 void setFocusable(boolean focusable)
           
 void setFont(Font f)
           
 void setForeground(java.awt.Color c)
           
 void setText(String text)
           
 void setVisible(boolean b)
           
protected  boolean shouldFocusOnClick()
           
protected  byte[] stringToNulMultiByte(String string)
           
 void update(Graphics g)
           
 void updateClient(Object arg)
          Called by the ScreenUpdater to update the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface sun.awt.peer.ComponentPeer
checkImage, clearBackground, createImage, createImage, createVolatileImage, dispose, getColorModel, getFontMetrics, getGraphics, getLocationOnScreen, getToolkit, handleEvent, isFocusTraversable, paint, prepareImage, print, repaint, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFocusable, setFont, setForeground, setVisible
 

Constructor Detail

QtLabelPeer

public QtLabelPeer(QtToolkit toolkit,
                   Label target)
Creates a new QtLabelPeer.

Method Detail

create

protected void create(sun.awt.qt.QtComponentPeer parentPeer)
Creates this component peer. This requires setting the data field to point to a struct QtComponentData.


getPreferredSize

public java.awt.Dimension getPreferredSize()
Specified by:
getPreferredSize in interface ComponentPeer

getMinimumSize

public java.awt.Dimension getMinimumSize()
Specified by:
getMinimumSize in interface ComponentPeer

setText

public void setText(String text)
Specified by:
setText in interface LabelPeer

setAlignment

public void setAlignment(int alignment)
Specified by:
setAlignment in interface LabelPeer

setFocusable

public void setFocusable(boolean focusable)
Specified by:
setFocusable in interface ComponentPeer

nativeRequestFocus

public boolean nativeRequestFocus(Component lightweightChild,
                                  boolean temporary,
                                  boolean focusedWindowChangeAllowed,
                                  long time)

canHavePixmapBackground

protected boolean canHavePixmapBackground()
Decides whether it is possible for this component to have a pixmap background (i.e. a non solid color). We allow all components except Window, Frame, Dialog, Panel and Canvas to have pixmaps as the user can, and typically does, override the paint for these components. Thus update can be called which will clear the background with a solid color for these components. However, we would still like to have support for Qt themes where a button, for example, may hava a pixmap background.


dispose

public void dispose()
Specified by:
dispose in interface ComponentPeer

setVisible

public void setVisible(boolean b)
Specified by:
setVisible in interface ComponentPeer

setEnabled

public void setEnabled(boolean b)
Specified by:
setEnabled in interface ComponentPeer

paint

public void paint(Graphics g)
Specified by:
paint in interface ComponentPeer

update

public void update(Graphics g)

repaint

public void repaint(long tm,
                    int x,
                    int y,
                    int width,
                    int height)
Specified by:
repaint in interface ComponentPeer

print

public void print(Graphics g)
Specified by:
print in interface ComponentPeer

clearBackground

public void clearBackground(Graphics g)
Specified by:
clearBackground in interface ComponentPeer

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Specified by:
setBounds in interface ComponentPeer

handleEvent

public void handleEvent(AWTEvent event)
Specified by:
handleEvent in interface ComponentPeer

updateClient

public void updateClient(Object arg)
Called by the ScreenUpdater to update the component.

Specified by:
updateClient in interface sun.awt.UpdateClient

getLocationOnScreen

public java.awt.Point getLocationOnScreen()
Specified by:
getLocationOnScreen in interface ComponentPeer

getColorModel

public java.awt.image.ColorModel getColorModel()
Specified by:
getColorModel in interface ComponentPeer

getToolkit

public Toolkit getToolkit()
Specified by:
getToolkit in interface ComponentPeer

getGraphics

public Graphics getGraphics()
Specified by:
getGraphics in interface ComponentPeer

getFontMetrics

public FontMetrics getFontMetrics(Font font)
Specified by:
getFontMetrics in interface ComponentPeer

setForeground

public void setForeground(java.awt.Color c)
Specified by:
setForeground in interface ComponentPeer

setBackground

public void setBackground(java.awt.Color c)
Specified by:
setBackground in interface ComponentPeer

setFont

public void setFont(Font f)
Specified by:
setFont in interface ComponentPeer

setCursor

public void setCursor(java.awt.Cursor cursor)
Specified by:
setCursor in interface ComponentPeer

isFocusTraversable

public boolean isFocusTraversable()
Specified by:
isFocusTraversable in interface ComponentPeer

createImage

public java.awt.Image createImage(java.awt.image.ImageProducer producer)
Specified by:
createImage in interface ComponentPeer

createImage

public java.awt.Image createImage(int width,
                                  int height)
Specified by:
createImage in interface ComponentPeer

prepareImage

public boolean prepareImage(java.awt.Image img,
                            int w,
                            int h,
                            java.awt.image.ImageObserver o)
Specified by:
prepareImage in interface ComponentPeer

checkImage

public int checkImage(java.awt.Image img,
                      int w,
                      int h,
                      java.awt.image.ImageObserver o)
Specified by:
checkImage in interface ComponentPeer

lostOwnership

public void lostOwnership(Clipboard clipboard,
                          Transferable contents)
Description copied from interface: ClipboardOwner
Notifies this object that it is no longer the owner of the contents of the clipboard.

Specified by:
lostOwnership in interface ClipboardOwner
Parameters:
clipboard - the clipboard that is no longer owned
contents - the contents which this owner had placed on the clipboard

stringToNulMultiByte

protected byte[] stringToNulMultiByte(String string)

getNativeComponent

public long getNativeComponent()

createVolatileImage

public java.awt.image.VolatileImage createVolatileImage(int width,
                                                        int height)
Specified by:
createVolatileImage in interface ComponentPeer

requestFocus

public boolean requestFocus(Component child,
                            Window parent,
                            boolean temporary,
                            boolean focusedWindowChangeAllowed,
                            long time)
Specified by:
requestFocus in interface ComponentPeer

isFocusable

public boolean isFocusable()

shouldFocusOnClick

protected boolean shouldFocusOnClick()