Class zebkit.ui.RulerPan
extends <zebkit.ui.Panel>
<zebkit.ui>

Simple ruler panel class. The ruler can render minimal and maximal values of the specified range.

Constructor:
zebkit.ui.RulerPan ([o])

Parameters:
  • [o] <String>

    ruler orientation. Use "horizontal" or "vertical" as the argument value




protected <Integer> $getRulerSize ( )
public <Number> getMax ( )
public <Number> getMin ( )
public void recalcMetrics ( )
public void setColor (c)
public void setGap (gap)
public void setLabelsAlignment (a)
public void setLabelsColor (color)
public void setLabelsFont (font)
public void setLabelsRender (r)
public void setOrientation (o)
public void setRange (min, max)
public void setShowLabels (b)
public void setShowStrokes (b)
public void setStrokeSize (strokeSize)
public void showNumbers ([precision])
public void showPercentage ([precision])
public <Integer> toLocation (v)
public <Number> toValue (xy)


Inherited methods:
$setConstraints(c)    add(constr, d)    byConstraints([p], c)    byPath(path, [cb])    calcPreferredSize(target)    doLayout( )    fire(event, [path], [params])    focused( )    getBottom( )    getCanvas( )    getComponentAt(x, y)    getHorPadding( )    getLeft( )    getPreferredSize( )    getRight( )    getTop( )    getVerPadding( )    hasFocus( )    indexOf(c)    insert(i, constr, d)    invalidate( )    invalidateLayout( )    kidAdded(index, constr, l)    kidRemoved(i, l)    laidout( )    load(JSON)    off([eventName], [path], [cb])    on([eventName], [path], cb)    paintComponent(g)    paintViewAt(g, ax, ay, v)    properties([path], props)    property([path], name, value)    recalc( )    relocated(px, py)    remove(c)    removeAll( )    removeAt(i)    removeByConstraints(ctr)    removeMe([after])    repaint([x], [y], [w], [h])    requestFocus( )    requestFocusIn([timeout])    resized(pw, ph)    setAt(i, d)    setBackground(v)    setBorder([v])    setBottomPadding(bottom)    setBounds(x, y, w, h)    setByConstraints(constr, c)    setConstraints(ctr)    setEnabled(b)    setId(id)    setKids(a)    setLayout(m)    setLeftPadding(left)    setLocation(xx, yy)    setPadding(v)    setParent(o)    setPreferredSize(w, h)    setProperties([path], props)    setRightPadding(right)    setSize(w, h)    setTopPadding(top)    setVisible(b)    toBack( )    toFront( )    toPreferredHeight( )    toPreferredSize( )    toPreferredWidth( )    toView(target)    validate( )    validateMetric( )    vrp( )   


protected <Integer> $getRulerSize ( )

Get the ruler effective size. The size includes only pixels that are used to be transformed into range values.


Returns: <Integer>

a ruler size

public <Number> getMax ( )

Get a maximal value in the ruler values range


Returns: <Number>

a maximal range value

public <Number> getMin ( )

Get a minimal value in the ruler values range


Returns: <Number>

a minimal range value

public void recalcMetrics ( )

Called when the ruler requires its metric recalculation

public chainable setColor (c)

Set the ruler color.


Parameters:
public chainable setGap (gap)

Set the ruler gap between stroke and labels.


Parameters:
  • gap <Integer>

    a gap

public chainable setLabelsAlignment (a)

Set the ruler labels alignment. Label alignment specifies a side the labels has to be placed relatively stroke.


Parameters:
  • a <String>

    labels alignment. The value can be "normal" or "invert"

public chainable setLabelsColor (color)

Set the labels color


Parameters:
  • color <String>

    a color of labels

public chainable setLabelsFont (font)

Set the labels font


Parameters:
public chainable setLabelsRender (r)

Set the labels render


Parameters:
public chainable setOrientation (o)

Set the ruler orientation


Parameters:
  • o <String>

    an orientation. Use "horizontal" or "vertical" values.

public chainable setRange (min, max)

Set the ruler range.


Parameters:
  • min <Number>

    a minimal value of the range

  • max <Number>

    a maximal value of the range

public chainable setShowLabels (b)

Set visibility of labels


Parameters:
  • b <Boolean>

    a boolean value that indicates if the labels has to be shown

public chainable setShowStrokes (b)

Set visibility of strokes


Parameters:
  • b <Boolean>

    a boolean value that indicates if the strokes have to be shown

public chainable setStrokeSize (strokeSize)

Set the stroke size.


Parameters:
  • strokeSize <Integer>

    a stroke size

public chainable showNumbers ([precision])

Show ruler labels with number.


Parameters:
  • [precision] <Integer>

    a precision

public chainable showPercentage ([precision])

Show ruler labels with percentage.


Parameters:
  • [precision] <Integer>

    a precision

public <Integer> toLocation (v)

Project the given range value to appropriate ruler component coordinate


Parameters:
Returns: <Integer>

coordinate

public <Number> toValue (xy)

Project the given ruler component coordinate to a range value.


Parameters:
  • xy <Integer>

    a x or y (depending on the ruler orientation) coordinate


Returns: <Number>

a range value



Inherited attributes:
public zebkit.draw.View bg    public zebkit.draw.View border    public Boolean canHaveFocus    public Object constraints    public Integer height    public Boolean isEnabled    public Boolean isValid    public Boolean isVisible    public Array kids    public zebkit.layout.Layout layout    public zebkit.layout.Layoutable parent    public Integer width    public Integer x    public Integer y   



public <String> color

Stroke color.

public <Integer> gap

Gap between stroke and labels

public <String> labelsAlignment

Ruler labels alignment

public <Integer> lineWidth

Stroke line width

public <String> orient

Ruler orientation ("horizontal" or "vertical").

protected <zebkit.draw.BaseViewProvider> provider

Ruler labels provider

public <Boolean> showLabels

Indicates if labels have to be rendered

public <Boolean> showStrokes

Indicate if stroke has to be rendered

public <Integer> strokeSize

Stroke line size