Inheritance diagram for CanvasBlob::
Public Methods | |
CanvasBlob () | |
CanvasBlob (Image im, double x, double y) | |
CanvasBlob (Image im, double x, double y, Color color) | |
CanvasBlob (Image im, int[] codes, double x, double y) | |
CanvasBlob (Image im, int[] codes, double x, double y, Color color) | |
CanvasBlob (Image im, int[] codes, double x, double y, 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... | |
void | doMove (double w, double h) |
Move CanvasObject 'w' positions in x-direction, and 'h' posi- tions in y-direction. More... | |
void | setColor (Color color) |
void | setTransparency (float trans) |
void | setDrawMode (int mode) |
Set current draw-mode. More... | |
void | showMask (boolean b) |
void | showChain (boolean b) |
Vector | getVisualChangeMethods () |
Builds up a list of functions that are to fill a menu for changing the visualization aspects of an object. More... | |
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) |
void | doMove (int w, int h) |
int | changePoint (int index, int x, int y) |
Protected Methods | |
void | initBlob (Image im, int[] codes, double x, double y, Color color, float trans, double ccs_scale) |
void | setBox () |
Protected Attributes | |
CanvasMask | mask = null |
CanvasChain | chain = null |
boolean | showMask = true |
boolean | showChain = true |
Static Protected Attributes | |
final int | INV_COLOR = 0x00FFFFFF |
|
|
|
|
|
|
|
|
|
|
|
|
|
Draw CanvasObject on 'g', using internal CCS values.
Reimplemented from CanvasObject.
00091 { 00092 if (!getTransformOK()) { 00093 transformICStoCCS(); 00094 } 00095 if (mask != null && showMask) { 00096 mask.draw(g); 00097 } 00098 if (chain != null && showChain) { 00099 chain.draw(g); 00100 } 00101 } |
|
Return an identical copy of this CanvasObject.
Reimplemented from CanvasObject.
00105 { 00106 CanvasBlob blob; 00107 00108 if (chain == null) { 00109 blob = new CanvasBlob(mask.getMask(), null, 00110 getX1()+0.5, getY1()+0.5, mask.getColor(), 00111 transparency, getZoomFactor()); 00112 } else { 00113 blob = new CanvasBlob(mask.getMask(), chain.getChain(), 00114 getX1()+0.5, getY1()+0.5, mask.getColor(), 00115 transparency, getZoomFactor()); 00116 } 00117 blob.showMask(showMask); 00118 blob.showChain(showChain); 00119 return blob; 00120 } |
|
|
|
|
|
Resize CanvasObject to width 'w' and height 'h'. Parameters are assumed Image Coordinate System values. Reimplemented from ScribbleObject.
00144 { 00145 // overrule super.setDimension(w, h), and do nothing 00146 00147 return; 00148 } |
|
Scale CanvasObject according to 'zoomFactor'. The internal ICS values are taken as base values to calculate the associated CCS values. Reimplemented from CanvasObject.
00152 { 00153 super.setZoomFactor(zoomFactor); 00154 00155 if (mask != null) { 00156 mask.setZoomFactor(zoomFactor); 00157 } 00158 if (chain != null) { 00159 chain.setZoomFactor(zoomFactor); 00160 } 00161 setBox(); 00162 } |
|
Round internal ICS values to nearest natural number. Although the ICS values are changed, they are not converted to 'integer' internally. Reimplemented from ScribbleObject.
00166 { 00167 super.setZoomFactor(zoomFactor); 00168 00169 if (mask != null) { 00170 mask.doPixelFit(zoomFactor); 00171 } 00172 if (chain != null) { 00173 chain.doPixelFit(zoomFactor); 00174 } 00175 setBox(); 00176 } |
|
Move CanvasObject 'w' positions in x-direction, and 'h' posi- tions in y-direction. Parameters are assumed Image Coordinate System values. Reimplemented from ScribbleObject.
|
|
Reimplemented from ScribbleFigure.
00192 { 00193 if (color == NO_COLOR) { 00194 return; 00195 } 00196 00197 Color maskColor = color; 00198 Color chainColor = new Color(color.getRGB() ^ INV_COLOR); 00199 00200 if ((!showMask) && showChain) { 00201 maskColor = chainColor; 00202 chainColor = color; 00203 } 00204 00205 if (mask != null) { 00206 mask.setColor(maskColor); 00207 } 00208 if (chain != null) { 00209 chain.setColor(chainColor); 00210 } 00211 } |
|
Reimplemented from ScribbleFigure.
00215 { 00216 super.setTransparency(trans); 00217 00218 if (mask != null) { 00219 mask.setTransparency(trans); 00220 } 00221 if (chain != null) { 00222 chain.setTransparency(trans); 00223 } 00224 } |
|
Set current draw-mode.
Reimplemented from CanvasObject.
00228 { 00229 super.setDrawMode(mode); 00230 if (mask != null) { 00231 mask.setDrawMode(mode); 00232 } 00233 if (chain != null) { 00234 chain.setDrawMode(mode); 00235 } 00236 } |
|
00240 { 00241 showMask = b; 00242 } |
|
00246 { 00247 showChain = b; 00248 } |
|
Builds up a list of functions that are to fill a menu for changing the visualization aspects of an object. Classes derived from this one typically add their class-specific methods to their parents' methods by first calling the parent to fill the vector and then add their own. The result is a Vector of CallableMethods. Reimplemented from ScribbleFigure.
00255 { 00256 Vector v = super.getVisualChangeMethods(); 00257 v.add(new CallableMethod("showMask", "boolean", "b", "boolean")); 00258 v.add(new CallableMethod("showChain", "boolean", "b", "boolean")); 00259 return v; 00260 } |
|
To be removed.
Reimplemented from CanvasObject.
00278 { 00279 if (chain != null) { 00280 return chain.isInsideCcs(x, y); 00281 } else { 00282 return mask.isInsideCcs(x, y); 00283 } 00284 } |
|
To be removed.
Reimplemented from CanvasObject.
|
|
Reimplemented from ScribbleObject.
00298 { 00299 // overrule super.setDimension(w, h), and do nothing 00300 00301 return; 00302 } |
|
Reimplemented from ScribbleObject.
|
|
Reimplemented from ScribbleFigure.
00318 { 00319 // overrule super.changePoint(index, x, y), and do nothing 00320 00321 return index; 00322 } |
|
00337 { 00338 resizeable = false; 00339 hasLineWidth = false; 00340 hasNoColor = false; 00341 00342 mask = new CanvasMask(im, x, y, color, trans, ccs_scale); 00343 00344 Color inverted; 00345 if (color == NO_COLOR) { 00346 inverted = new Color(DEF_COLOR.getRGB() ^ INV_COLOR); 00347 } else { 00348 inverted = new Color(color.getRGB() ^ INV_COLOR); 00349 } 00350 if (codes != null) { 00351 chain = new CanvasChain(codes, x, y, inverted, 00352 false, DEF_LINEW, trans, ccs_scale); 00353 chain.setPosition(x, y); 00354 chain.setCircular(true); 00355 } 00356 setBox(); 00357 transformICStoCCS(); 00358 00359 } |
|
00456 { 00457 if (mask != null) { 00458 setX1(mask.getX1()); 00459 setY1(mask.getY1()); 00460 setWidth(mask.getWidth()); 00461 setHeight(mask.getHeight()); 00462 } else if (chain != null) { 00463 setX1(chain.getX1()); 00464 setY1(chain.getY1()); 00465 setWidth(chain.getWidth()); 00466 setHeight(chain.getHeight()); 00467 } 00468 00469 setStartX(getX1()); 00470 setStartY(getY1()); 00471 00472 setTransformOK(false); 00473 } |
|
|
|
|
|
|
|
|
|
|