Back to index

moin  1.9.0~rc2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CH.ifa.draw.figures.ImageFigure Class Reference

A Figure that shows an Image. More...

Inheritance diagram for CH.ifa.draw.figures.ImageFigure:
Inheritance graph
[legend]
Collaboration diagram for CH.ifa.draw.figures.ImageFigure:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ImageFigure ()
 ImageFigure (Image image, String fileName, Point origin)
void basicDisplayBox (Point origin, Point corner)
Vector handles ()
Rectangle displayBox ()
void draw (Graphics g)
boolean imageUpdate (Image img, int flags, int x, int y, int w, int h)
 Handles asynchroneous image updates.
void write (StorableOutput dw)
 Writes the ImageFigure to a StorableOutput.
void read (StorableInput dr) throws IOException
 Reads the ImageFigure from a StorableInput.
void draw (Graphics g, boolean showGuides)
 Draws the figure in the given graphics.
Color getFillColor ()
 Gets the fill color of a figure.
Color getFrameColor ()
 Gets the frame color of a figure.
Object defaultAttribute (String name)
String getMap ()

Static Public Member Functions

static Object getDefaultAttribute (String name)
 Gets a the default value for a named attribute.

Protected Member Functions

void basicMoveBy (int x, int y)
void drawBackground (Graphics g)
 Draws the background of the figure.
void drawFrame (Graphics g)
 Draws the frame of the figure.

Private Member Functions

void drawGhost (Graphics g)
void readObject (ObjectInputStream s) throws ClassNotFoundException, IOException

Private Attributes

String fFileName
transient Image fImage
Rectangle fDisplayBox
int imageFigureSerializedDataVersion = 1

Static Private Attributes

static final long serialVersionUID = 148012030121282439L

Detailed Description

A Figure that shows an Image.

Images shown by an image figure are shared by using the Iconkit.

See also:
Iconkit

Definition at line 21 of file ImageFigure.java.


Constructor & Destructor Documentation

Definition at line 33 of file ImageFigure.java.

                         {
        fFileName = null;
        fImage = null;
        fDisplayBox = null;
    }
CH.ifa.draw.figures.ImageFigure.ImageFigure ( Image  image,
String  fileName,
Point  origin 
) [inline]

Definition at line 39 of file ImageFigure.java.

                                                                   {
        fFileName = fileName;
        fImage = image;
        fDisplayBox = new Rectangle(origin.x, origin.y, 0, 0);
        fDisplayBox.width = fImage.getWidth(this);
        fDisplayBox.height = fImage.getHeight(this);
    }

Member Function Documentation

void CH.ifa.draw.figures.ImageFigure.basicDisplayBox ( Point  origin,
Point  corner 
) [inline]

Definition at line 47 of file ImageFigure.java.

                                                            {
        fDisplayBox = new Rectangle(origin);
        fDisplayBox.add(corner);
    }
void CH.ifa.draw.figures.ImageFigure.basicMoveBy ( int  x,
int  y 
) [inline, protected]

Definition at line 66 of file ImageFigure.java.

                                             {
        fDisplayBox.translate(x,y);
    }
Object CH.ifa.draw.figures.AttributeFigure.defaultAttribute ( String  name) [inline, inherited]

Definition at line 135 of file AttributeFigure.java.

                                                {
       return getDefaultAttribute(name);
    }

Here is the call graph for this function:

Definition at line 58 of file ImageFigure.java.

                                  {
        return new Rectangle(
            fDisplayBox.x,
            fDisplayBox.y,
            fDisplayBox.width,
            fDisplayBox.height);
    }
void CH.ifa.draw.figures.AttributeFigure.draw ( Graphics  g,
boolean  showGuides 
) [inline, inherited]

Draws the figure in the given graphics.

Draw is a template method calling drawBackground followed by drawFrame.

Definition at line 48 of file AttributeFigure.java.

                                                     {
        Color fill = getFillColor();
        if (!ColorMap.getColorMap().isTransparent(fill)) {
            g.setColor(fill);
            drawBackground(g);
        }
        Color frame = getFrameColor();
        if (!ColorMap.getColorMap().isTransparent(frame)) {
            g.setColor(frame);
            drawFrame(g);
        }
       if (showGuides) {
           drawURL(g);
       }
    }

Here is the call graph for this function:

void CH.ifa.draw.figures.ImageFigure.draw ( Graphics  g) [inline]

Definition at line 70 of file ImageFigure.java.

                                 {
        if (fImage == null)
            fImage = Iconkit.instance().getImage(fFileName);
        if (fImage != null)
            g.drawImage(fImage, fDisplayBox.x, fDisplayBox.y, fDisplayBox.width, fDisplayBox.height, this);
        else
            drawGhost(g);
    }

Here is the call graph for this function:

void CH.ifa.draw.figures.AttributeFigure.drawBackground ( Graphics  g) [inline, protected, inherited]

Draws the background of the figure.

See also:
draw

Reimplemented in CH.ifa.draw.figures.TextFigure, CH.ifa.draw.figures.RoundRectangleFigure, CH.ifa.draw.figures.RectangleFigure, and CH.ifa.draw.figures.EllipseFigure.

Definition at line 68 of file AttributeFigure.java.

                                              {
    }

Here is the caller graph for this function:

void CH.ifa.draw.figures.AttributeFigure.drawFrame ( Graphics  g) [inline, protected, inherited]

Draws the frame of the figure.

See also:
draw

Reimplemented in CH.ifa.draw.figures.TextFigure, CH.ifa.draw.figures.RoundRectangleFigure, CH.ifa.draw.figures.RectangleFigure, and CH.ifa.draw.figures.EllipseFigure.

Definition at line 75 of file AttributeFigure.java.

                                         {
    }

Here is the caller graph for this function:

void CH.ifa.draw.figures.ImageFigure.drawGhost ( Graphics  g) [inline, private]

Definition at line 79 of file ImageFigure.java.

                                       {
        g.setColor(Color.gray);
        g.fillRect(fDisplayBox.x, fDisplayBox.y, fDisplayBox.width, fDisplayBox.height);
    }

Here is the caller graph for this function:

static Object CH.ifa.draw.figures.AttributeFigure.getDefaultAttribute ( String  name) [inline, static, inherited]

Gets a the default value for a named attribute.

See also:
getAttribute

Definition at line 129 of file AttributeFigure.java.

                                                          {
        if (fgDefaultAttributes == null)
            initializeAttributes();
        return fgDefaultAttributes.get(name);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Color CH.ifa.draw.figures.AttributeFigure.getFillColor ( ) [inline, inherited]

Gets the fill color of a figure.

This is a convenience method.

See also:
getAttribute

Definition at line 97 of file AttributeFigure.java.

                                {
        return (Color) getAttribute("FillColor");
    }

Here is the caller graph for this function:

Gets the frame color of a figure.

This is a convenience method.

See also:
getAttribute

Definition at line 106 of file AttributeFigure.java.

                                 {
        return (Color) getAttribute("FrameColor");
    }

Here is the caller graph for this function:

String CH.ifa.draw.figures.AttributeFigure.getMap ( ) [inline, inherited]

Definition at line 52 of file ImageFigure.java.

                            {
        Vector handles = new Vector();
        BoxHandleKit.addHandles(this, handles);
        return handles;
    }
boolean CH.ifa.draw.figures.ImageFigure.imageUpdate ( Image  img,
int  flags,
int  x,
int  y,
int  w,
int  h 
) [inline]

Handles asynchroneous image updates.

Definition at line 87 of file ImageFigure.java.

                                                                                 {
           if ((flags & (FRAMEBITS|ALLBITS)) != 0) {
               invalidate();
               if (listener() != null)
                   listener().figureRequestUpdate(new FigureChangeEvent(this));
           }
           return (flags & (ALLBITS|ABORT)) == 0;
    }
void CH.ifa.draw.figures.ImageFigure.read ( StorableInput  dr) throws IOException [inline]

Reads the ImageFigure from a StorableInput.

It registers the referenced figure to be loaded from the Iconkit.

See also:
Iconkit::registerImage

Definition at line 114 of file ImageFigure.java.

                                                          {
        super.read(dr);
        fDisplayBox = new Rectangle(
            dr.readInt(),
            dr.readInt(),
            dr.readInt(),
            dr.readInt());
        fFileName = dr.readString();
        Iconkit.instance().registerImage(fFileName);
    }

Here is the caller graph for this function:

void CH.ifa.draw.figures.ImageFigure.readObject ( ObjectInputStream  s) throws ClassNotFoundException, IOException [inline, private]

Definition at line 125 of file ImageFigure.java.

                                                   {

        s.defaultReadObject();
        Iconkit.instance().registerImage(fFileName);
        fImage = null;
    }
void CH.ifa.draw.figures.ImageFigure.write ( StorableOutput  dw) [inline]

Writes the ImageFigure to a StorableOutput.

Only a reference to the image, that is its pathname is saved.

Definition at line 100 of file ImageFigure.java.

                                         {
        super.write(dw);
        dw.writeInt(fDisplayBox.x);
        dw.writeInt(fDisplayBox.y);
        dw.writeInt(fDisplayBox.width);
        dw.writeInt(fDisplayBox.height);
        dw.writeString(fFileName);
    }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 26 of file ImageFigure.java.

Definition at line 24 of file ImageFigure.java.

transient Image CH.ifa.draw.figures.ImageFigure.fImage [private]

Definition at line 25 of file ImageFigure.java.

Definition at line 31 of file ImageFigure.java.

final long CH.ifa.draw.figures.ImageFigure.serialVersionUID = 148012030121282439L [static, private]

Reimplemented from CH.ifa.draw.figures.AttributeFigure.

Definition at line 30 of file ImageFigure.java.


The documentation for this class was generated from the following file: