Inheritance diagram for CanvasString::

Public Methods | |
| CanvasString (String line, double x, double y, Color color) | |
| CanvasString (String line, double x, double y, double w, double h, Color color) | |
| CanvasString (String line, double x, double y, int mode, Color color, float trans, double ccs_scale) | |
| CanvasString (String line, double x, double y, double w, double h, int mode, Color color, float trans, double ccs_scale) | |
| void | draw (Graphics g) |
| Draw CanvasObject on 'g', using internal CCS values. More... | |
| Object | clone () |
| Return an identical copy of this CanvasObject. More... | |
| boolean | isInside (double x, double y) |
| boolean | isNear (double x, double y) |
| void | setDimension (double w, double h) |
| Resize CanvasObject to width 'w' and height 'h'. More... | |
| void | setZoomFactor (double zoomFactor) |
| Scale CanvasObject according to 'zoomFactor'. More... | |
| void | doPixelFit (double zoomFactor) |
| Round internal ICS values to nearest natural number. More... | |
| CanvasString (String line, int x, int y, int mode, Color color, double ccs_scale) | |
| CanvasString (String line, int x, int y, int w, int h, int mode, Color color, double ccs_scale) | |
| boolean | isInsideCcs (int x, int y) |
| To be removed. More... | |
| boolean | isNearCcs (int x, int y) |
| To be removed. More... | |
| void | setDimension (int w, int h) |
Static Public Attributes | |
| final int | STD_HEIGHT = 12 |
Protected Methods | |
| void | initString (String line) |
| void | setFont (int h) |
Protected Attributes | |
| String | line = "" |
| Label | label = null |
| Font | f = null |
| FontMetrics | fm = null |
|
||||||||||||||||||||
|
00030 {
00031 this(line, x, y, 0., (double)STD_HEIGHT, color);
00032 }
|
|
||||||||||||||||||||||||||||
|
00037 {
00038 super(x, y, w, h, color);
00039 initString(line);
00040 }
|
|
||||||||||||||||||||||||||||||||
|
00045 {
00046 this(line, x, y, 0., (double)STD_HEIGHT,
00047 mode, color, DEF_TRANS, ccs_scale);
00048 }
|
|
||||||||||||||||||||||||||||||||||||||||
|
00054 {
00055 super(x, y, w, h,
00056 mode, color, false, DEF_LINEW, trans, ccs_scale);
00057 initString(line);
00058 }
|
|
||||||||||||||||||||||||||||
|
00138 {
00139 this(line, x, y, 1, STD_HEIGHT, mode, color, ccs_scale);
00140 }
|
|
||||||||||||||||||||||||||||||||||||
|
00145 {
00146 super(x, y, w, h, mode, color, ccs_scale);
00147 initString(line);
00148 }
|
|
|
Draw CanvasObject on 'g', using internal CCS values.
Reimplemented from CanvasObject.
00065 {
00066 g.setFont(f);
00067 setupDrawMode(g);
00068 if (!getTransformOK()) {
00069 transformICStoCCS();
00070 }
00071 g.drawString(line, getX1Ccs(), getY1Ccs() + getHeightCcs() - fm.getMaxDescent());
00072 if (getDrawMode() == XOR_MODE) {
00073 g.drawRect(getX1Ccs(), getY1Ccs(), getWidthCcs(), getHeightCcs());
00074 }
00075 }
|
|
|
Return an identical copy of this CanvasObject.
Reimplemented from CanvasObject.
00079 {
00080 Color color = drawColor;
00081 if (hasNoColor) {
00082 color = NO_COLOR;
00083 }
00084 return (new CanvasString(line, getX1(), getY1(), getWidth(), getHeight(), getDrawMode(),
00085 color, transparency, getZoomFactor()));
00086 }
|
|
||||||||||||
|
00090 {
00091 return inBoundingBox(x, y);
00092 }
|
|
||||||||||||
|
00096 {
00097 return inBoundingBox(x, y);
00098 }
|
|
||||||||||||
|
Resize CanvasObject to width 'w' and height 'h'. Parameters are assumed Image Coordinate System values. Reimplemented from ScribbleObject.
00102 {
00103 super.setDimension(w, h);
00104 setFont(getHeightCcs());
00105 }
|
|
|
Scale CanvasObject according to 'zoomFactor'. The internal ICS values are taken as base values to calculate the associated CCS values. Reimplemented from CanvasObject.
00109 {
00110 super.setZoomFactor(zoomFactor);
00111 setFont(getHeightCcs());
00112 }
|
|
|
Round internal ICS values to nearest natural number. Although the ICS values are changed, they are not converted to 'integer' internally. Reimplemented from ScribbleObject.
00116 {
00117 super.doPixelFit(zoomFactor);
00118 setFont(getHeightCcs());
00119 }
|
|
||||||||||||
|
To be removed.
Reimplemented from CanvasObject.
00152 {
00153 return inBoundingBoxCcs(x, y);
00154 }
|
|
||||||||||||
|
To be removed.
Reimplemented from CanvasObject.
00158 {
00159 return inBoundingBoxCcs(x, y);
00160 }
|
|
||||||||||||
|
Reimplemented from ScribbleObject.
00164 {
00165 super.setDimension(w, h);
00166 setFont(getHeightCcs());
00167 }
|
|
|
00181 {
00182 hasLineWidth = false;
00183 this.line = line;
00184
00185 if (!getTransformOK()) {
00186 transformICStoCCS();
00187 }
00188
00189 setFont(getHeightCcs());
00190 }
|
|
|
00194 {
00195 this.f = new Font("SanSerif", Font.PLAIN, h);
00196 label = new Label(line);
00197 fm = label.getFontMetrics(f);
00198
00199 if (!getTransformOK()) {
00200 transformICStoCCS();
00201 }
00202
00203 setWidthCcs(fm.stringWidth(line));
00204 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001