Search in sources :

Example 6 with ImageNode

use of org.apache.pivot.wtk.text.ImageNode in project pivot by apache.

the class TextPaneSkinImageNodeView method paint.

@Override
public void paint(Graphics2D graphics) {
    ImageNode imageNode = (ImageNode) getNode();
    Image image = imageNode.getImage();
    if (image != null) {
        image.paint(graphics);
    }
}
Also used : ImageNode(org.apache.pivot.wtk.text.ImageNode) Image(org.apache.pivot.wtk.media.Image)

Example 7 with ImageNode

use of org.apache.pivot.wtk.text.ImageNode in project pivot by apache.

the class TextPaneSkinImageNodeView method detach.

@Override
protected void detach() {
    super.detach();
    ImageNode imageNode = (ImageNode) getNode();
    imageNode.getImageNodeListeners().remove(this);
}
Also used : ImageNode(org.apache.pivot.wtk.text.ImageNode)

Example 8 with ImageNode

use of org.apache.pivot.wtk.text.ImageNode in project pivot by apache.

the class TextPaneSkinImageNodeView method childLayout.

@Override
protected void childLayout(int breakWidth) {
    ImageNode imageNode = (ImageNode) getNode();
    Image image = imageNode.getImage();
    if (image == null) {
        setSize(0, 0);
    } else {
        setSize(image.getWidth(), image.getHeight());
    }
}
Also used : ImageNode(org.apache.pivot.wtk.text.ImageNode) Image(org.apache.pivot.wtk.media.Image)

Aggregations

ImageNode (org.apache.pivot.wtk.text.ImageNode)8 Image (org.apache.pivot.wtk.media.Image)5 ComponentNode (org.apache.pivot.wtk.text.ComponentNode)2 TextNode (org.apache.pivot.wtk.text.TextNode)2 Frame (org.apache.pivot.wtk.Frame)1 HyperlinkButton (org.apache.pivot.wtk.HyperlinkButton)1 TextPane (org.apache.pivot.wtk.TextPane)1 Block (org.apache.pivot.wtk.text.Block)1 Document (org.apache.pivot.wtk.text.Document)1 Element (org.apache.pivot.wtk.text.Element)1 Node (org.apache.pivot.wtk.text.Node)1 Paragraph (org.apache.pivot.wtk.text.Paragraph)1