fr.inria.zvtm.glyphs
Class ClosedShape

java.lang.Object
  extended by fr.inria.zvtm.glyphs.Glyph
      extended by fr.inria.zvtm.glyphs.ClosedShape
All Implemented Interfaces:
Translucent, Cloneable
Direct Known Subclasses:
FPolygon, SIRectangle, VCircle, VEllipse, VImage, VPolygon, VRectangle, VRing, VRoundRect, VShape, VSwingComponent, VText, ZPDFPage

public abstract class ClosedShape
extends Glyph

Super class of all closed shapes (rectangles, circles, diamonds, polygons, etc.)

Author:
Emmanuel Pietriga

Field Summary
 Color bColor
          Border color of this glyph when it is in its default state.
 Color borderColor
          Current border color (read only, use access methods for all modification purposes).
 Color cursorInsideFColor
          Fill color of this glyph when cursor is inside it.
protected  float[] HSVb
          Coordinates of border color in HSV color space.
 
Fields inherited from class fr.inria.zvtm.glyphs.Glyph
alphaC, coef, color, cursorInsideColor, ENTERED_GLYPH, EXITED_GLYPH, fColor, HSV, NO_CURSOR_EVENT, orient, sensit, size, stickedTo, stroke, visible, vx, vy, vz
 
Fields inherited from interface fr.inria.zvtm.glyphs.Translucent
acO
 
Constructor Summary
ClosedShape()
           
 
Method Summary
 void addHSVbColor(float h, float s, float v)
          Set the glyph's border color (absolute value, HSV color space).
 Color getBorderColor()
          Get the glyph's current border color (use getColor for text, paths, segments, etc.).
 Color getDefaultBorderColor()
          Get the glyph's default border color (use getColor for text, paths, segments, etc.).
 float[] getHSVbColor()
          Get border color's HSV components.
 void highlight(boolean b, Color selectedColor)
          Highlight this glyph to give visual feedback when the cursor is inside it.
 boolean isBorderDrawn()
          Indicates whether the glyph's border is drawn or not.
 boolean isFilled()
          Indicates whether this glyph's interior is filled or not.
 void setBorderColor(Color c)
          Set the glyph's border color (use setColor for text, paths, segments, etc.).
 void setCursorInsideFillColor(Color c)
          Set the glyph's fill color when cursor is inside it.
 void setDrawBorder(boolean b)
          Set whether the glyph's border should be drawn or not.
 void setFilled(boolean b)
          Set whether this glyph's interior should be filled or not.
 void setHSVbColor(float h, float s, float v)
          Set the glyph's border color (absolute value, HSV color space).
 
Methods inherited from class fr.inria.zvtm.glyphs.Glyph
addCamera, addHSVColor, clone, containedInRegion, coordInside, draw, drawForLens, fillsView, getBounds, getColor, getDefaultColor, getDefaultCursorInsideHighlightColor, getHSVColor, getJava2DShape, getLocation, getOrient, getOwner, getSize, getStickedGlyphArray, getStroke, getTranslucencyValue, getType, getZindex, initCams, isSelected, isSensitive, isVisible, isVisibleThroughLens, mouseInOut, move, moveTo, orientTo, project, projectForLens, propagateMove, removeCamera, resetMouseIn, resetMouseIn, reSize, select, setColor, setCursorInsideHighlightColor, setDefaultCursorInsideHighlightColor, setHSVColor, setOwner, setSensitivity, setStroke, setTranslucencyValue, setType, setVisible, setZindex, sizeTo, stick, stickToGlyph, toString, unstick, unstickAllGlyphs, unstickAllGlyphs, unstickFromGlyph, visibleInDisc, visibleInRegion, visibleInViewport
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

borderColor

public Color borderColor
Current border color (read only, use access methods for all modification purposes). Border color for closed shapes.


HSVb

protected float[] HSVb
Coordinates of border color in HSV color space.


bColor

public Color bColor
Border color of this glyph when it is in its default state.


cursorInsideFColor

public Color cursorInsideFColor
Fill color of this glyph when cursor is inside it. Null if same as default fill color.

Constructor Detail

ClosedShape

public ClosedShape()
Method Detail

setFilled

public void setFilled(boolean b)
Set whether this glyph's interior should be filled or not. Relevant for closed shapes only. Does not make sense for glyphs such as text, paths and segments.


isFilled

public boolean isFilled()
Indicates whether this glyph's interior is filled or not. Relevant for closed shapes only. Does not make sense for glyphs such as text, paths and segments.

Overrides:
isFilled in class Glyph

setDrawBorder

public void setDrawBorder(boolean b)
Set whether the glyph's border should be drawn or not. Relevant for closed shapes only. Does not make sense for glyphs such as text, paths and segments.


isBorderDrawn

public boolean isBorderDrawn()
Indicates whether the glyph's border is drawn or not. Relevant for closed shapes only. Does not make sense for glyphs such as text, paths and segments.

Overrides:
isBorderDrawn in class Glyph

setCursorInsideFillColor

public void setCursorInsideFillColor(Color c)
Set the glyph's fill color when cursor is inside it. Relevant for closed shapes only. Does not make sense for glyphs such as text, paths and segments.

Parameters:
c - set to null to keep the original color.

setBorderColor

public void setBorderColor(Color c)
Set the glyph's border color (use setColor for text, paths, segments, etc.).

Overrides:
setBorderColor in class Glyph
See Also:
Glyph.setColor(Color c)

setHSVbColor

public void setHSVbColor(float h,
                         float s,
                         float v)
Set the glyph's border color (absolute value, HSV color space). Use setColor for text, paths, segments, etc.

Overrides:
setHSVbColor in class Glyph
Parameters:
h - hue in [0.0, 1.0]
s - saturation in [0.0, 1.0]
v - value (brightness) in [0.0, 1.0]
See Also:
addHSVbColor(float h,float s,float v)

addHSVbColor

public void addHSVbColor(float h,
                         float s,
                         float v)
Set the glyph's border color (absolute value, HSV color space). Use setColor for text, paths, segments, etc.

Overrides:
addHSVbColor in class Glyph
Parameters:
h - hue so that the final hue is in [0.0, 1.0]
s - saturation so that the final saturation is in [0.0, 1.0]
v - value so that the final value (brightness) is in [0.0, 1.0]
See Also:
setHSVbColor(float h,float s,float v)

getHSVbColor

public float[] getHSVbColor()
Get border color's HSV components.

Overrides:
getHSVbColor in class Glyph
Returns:
{0, 0, 0} if the glyph does not have a border (e.g., is not an instanceof ClosedShape)

getBorderColor

public Color getBorderColor()
Get the glyph's current border color (use getColor for text, paths, segments, etc.). This might be different from the current border color depending on the Glyph's current status.

Overrides:
getBorderColor in class Glyph
Returns:
Color.BLACK if the glyph does not have a border (e.g., is not an instanceof ClosedShape)
See Also:
getDefaultBorderColor()

getDefaultBorderColor

public Color getDefaultBorderColor()
Get the glyph's default border color (use getColor for text, paths, segments, etc.). This might be different from the default border color depending on the Glyph's current status.

See Also:
getBorderColor()

highlight

public void highlight(boolean b,
                      Color selectedColor)
Highlight this glyph to give visual feedback when the cursor is inside it.

Specified by:
highlight in class Glyph


Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2011 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.