Back to index

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

A figure that can keep track of an open ended set of attributes. More...

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

List of all members.

Public Member Functions

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

 AttributeFigure ()
void drawBackground (Graphics g)
 Draws the background of the figure.
void drawFrame (Graphics g)
 Draws the frame of the figure.

Private Member Functions

void drawURL (Graphics g)
 Draws the map of the figure.

Static Private Member Functions

static void initializeAttributes ()

Private Attributes

int attributeFigureSerializedDataVersion = 1

Static Private Attributes

static FigureAttributes fgDefaultAttributes = null
 The default attributes associated with a figure.
static final long serialVersionUID = -10857585979273442L

Detailed Description

A figure that can keep track of an open ended set of attributes.

The attributes are stored in a dictionary implemented by FigureAttributes.

See also:
Figure
Handle
FigureAttributes

Definition at line 25 of file AttributeFigure.java.


Constructor & Destructor Documentation

Definition at line 42 of file AttributeFigure.java.

{ }

Member Function Documentation

Object CH.ifa.draw.figures.AttributeFigure.defaultAttribute ( String  name) [inline]

Definition at line 135 of file AttributeFigure.java.

                                                {
       return getDefaultAttribute(name);
    }

Here is the call graph for this function:

void CH.ifa.draw.figures.AttributeFigure.draw ( Graphics  g,
boolean  showGuides 
) [inline]

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.AttributeFigure.drawBackground ( Graphics  g) [inline, protected]

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]

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.AttributeFigure.drawURL ( Graphics  g) [inline, private]

Draws the map of the figure.

See also:
draw

Definition at line 82 of file AttributeFigure.java.

                                     {
       String sense = (String)getAttribute("Sensitive");
       if (sense != null && sense.length() > 0) {
           Rectangle r = displayBox();
           g.setColor(Color.red);
           g.setFont(dialogFont);
           g.drawString("url=" + sense, r.x, r.y + r.height);
       }
    }

Here is the caller graph for this function:

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

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:

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:

static void CH.ifa.draw.figures.AttributeFigure.initializeAttributes ( ) [inline, static, private]

Definition at line 112 of file AttributeFigure.java.

                                               {
        fgDefaultAttributes = new FigureAttributes();
        fgDefaultAttributes.set("FrameColor", Color.black);
        fgDefaultAttributes.set("FillColor",  new Color(0x70DB93));
        fgDefaultAttributes.set("TextColor",  Color.black);
        fgDefaultAttributes.set("ArrowMode",  new Integer(0));
        fgDefaultAttributes.set("FontName",  "Helvetica");
        fgDefaultAttributes.set("FontSize",   new Integer(12));
        fgDefaultAttributes.set("FontStyle",  new Integer(Font.PLAIN));
        fgDefaultAttributes.set("TextAlign",  "Left");
        fgDefaultAttributes.set("Sensitive",  "");
    }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 40 of file AttributeFigure.java.

FigureAttributes CH.ifa.draw.figures.AttributeFigure.fgDefaultAttributes = null [static, private]

The default attributes associated with a figure.

If a figure doesn't have an attribute set, a default value from this shared attribute set is returned.

See also:
#getAttribute
#setAttribute

Definition at line 34 of file AttributeFigure.java.

final long CH.ifa.draw.figures.AttributeFigure.serialVersionUID = -10857585979273442L [static, private]

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