org.das2.graph.DasDevicePosition

DasRows and DasColumns are both DasDevidePositions that lay out the canvas. Any object on the DasCanvas have a row and column object to indicate the position of the object.


PROP_DMAXIMUM


PROP_DMINIMUM


PROP_EMMAXIMUM


PROP_EMMINIMUM


PROP_MAXIMUM


PROP_MINIMUM


PROP_PTMAXIMUM


PROP_PTMINIMUM


contains

contains( int x ) → boolean

returns true if ( getDMinimum() <= x ) && ( x <= getDMaximum() );

Parameters

x - the pixel position

Returns:

true if ( getDMinimum() <= x ) && ( x <= getDMaximum() );

search for examples view on GitHub view source


formatFormatStr

formatFormatStr( double[] arr ) → String

formats the three position specifiers efficiently.

Parameters

arr - three-element array [ npos, emoffset, pt_offset ].

Returns:

String like "100%-5em+4pt"

See Also:

parseFormatStr(java.lang.String)
formatLayoutStr(org.das2.graph.DasDevicePosition, boolean) which contains repeated code.


search for examples view on GitHub view source


formatLayoutStr

formatLayoutStr( org.das2.graph.DasDevicePosition pos, boolean min ) → String

formats the row or column position into a string like

Parameters

pos - the row or column
min - true if the minimum boundary is to be formatted, false if the maximum boundary is to be formatted.

Returns:

String like "100%-5em+4pt"

See Also:

formatFormatStr(double[]) which contains repeated code.


search for examples view on GitHub view source


getDMaximum

getDMaximum( ) → int

returns the pixel position of the maximum of the Row/Column. This is the right side of a column and the bottom of a row.

Returns:

the pixel position (pixel=point for now)

search for examples view on GitHub view source


getDMiddle

getDMiddle( ) → int

returns pixel position (device position) of the the middle of the row or column

Returns:

pixel position (device position) of the the middle of the row or column

search for examples view on GitHub view source


getDMinimum

getDMinimum( ) → int

returns the pixel position of the minimum of the Row/Column. This is the left side of a column and the top of a row.

Returns:

the pixel position (pixel=point for now)

search for examples view on GitHub view source


getEmMaximum

getEmMaximum( ) → double

return the em offset that controls the position of the bottom/right boundary.

Returns:

the em offset that controls the position of the bottom/right boundary.

search for examples view on GitHub view source


getEmMinimum

getEmMinimum( ) → double

return the em offset that controls the position of the top/left boundary.

Returns:

the em offset that controls the position of the top/left boundary.

search for examples view on GitHub view source


getParentDevicePosition

getParentDevicePosition( ) → DasDevicePosition

return the parent, or null. If parent is non-null, then position is relative to the parent.

Returns:

the parent, or null.

search for examples view on GitHub view source


getPtMaximum

getPtMaximum( ) → int

return the points offset that controls the position of the bottom/right boundary.

Returns:

the points offset that controls the position of the bottom/right boundary.

search for examples view on GitHub view source


getPtMinimum

getPtMinimum( ) → int

return the points offset that controls the position of the top/left boundary.

Returns:

the points offset

search for examples view on GitHub view source


isValueIsAdjusting

isValueIsAdjusting( ) → boolean

return true if the value is currently adjusting because a mutator lock is out.

Returns:

true if the value is currently adjusting.

search for examples view on GitHub view source


parseFormatStr

Deprecated: use parseLayoutStr.

parseLayoutStr

parseLayoutStr( String s, double em, int widthHeight, double fail ) → double

parse the format string into a pixel count. Convenience method. parseFormatStr(s) will throw a parse exception and should be used to verify strings.

Parameters

s - The string, like "5em+3pt"
em - the em height of the font,
widthHeight - the width or height of the dimension.
fail - the value to return if the parsing fails.

Returns:

the length in pixels (or points).

search for examples view on GitHub view source


removeListeners

removeListeners( ) → void

remove the listeners so that the DasRow or DasColumn can be garbage collected.

Returns:

void (returns nothing)

search for examples view on GitHub view source


setDMaximum

setDMaximum( int maximum ) → void

set the new pixel position of the bottom/right boundary. em and pt offsets are not modified, and the normal position is recalculated.

Parameters

maximum - new pixel maximum

Returns:

void (returns nothing)

search for examples view on GitHub view source


setDMinimum

setDMinimum( int minimum ) → void

set the new pixel position of the top/left boundary. em and pt offsets are not modified, and the normal position is recalculated.

Parameters

minimum - new pixel minimum

Returns:

void (returns nothing)

search for examples view on GitHub view source


setDPosition

setDPosition( int minimum, int maximum ) → void

set the new pixel location of both the min and max in one operation.

Parameters

minimum - the top or left
maximum - the bottom or right

Returns:

void (returns nothing)

search for examples view on GitHub view source


setEmMaximum

setEmMaximum( double emMaximum ) → void

set the em offset that controls the position of the bottom/right boundary.

Parameters

emMaximum - the em offset.

Returns:

void (returns nothing)

search for examples view on GitHub view source


setEmMinimum

setEmMinimum( double emMinimum ) → void

set the em offset that controls the position of the top/left boundary.

Parameters

emMinimum - the em offset.

Returns:

void (returns nothing)

search for examples view on GitHub view source


setMax

setMax( double norm, double em, int pt ) → void

set all three as one atomic operation

Parameters

norm - normal position from 0 to 1.
em - em offset from the normal position.
pt - points offset from the normal position.

Returns:

void (returns nothing)

search for examples view on GitHub view source


setMin

setMin( double norm, double em, int pt ) → void

set all three as one atomic operation

Parameters

norm - normal position from 0 to 1.
em - em offset from the normal position.
pt - points offset from the normal position.

Returns:

void (returns nothing)

search for examples view on GitHub view source


setPtMaximum

setPtMaximum( int ptMaximum ) → void

set the pt offset that controls the position of the bottom/right boundary.

Parameters

ptMaximum - the em offset.

Returns:

void (returns nothing)

search for examples view on GitHub view source


setPtMinimum

setPtMinimum( int ptMinimum ) → void

set the points offset that controls the position of the top/left boundary.

Parameters

ptMinimum - the points offset

Returns:

void (returns nothing)

search for examples view on GitHub view source


toRectangle

toRectangle( org.das2.graph.DasRow row, org.das2.graph.DasColumn column ) → Rectangle

convenience method for creating a rectangle from a row and column. The rectangle will be in canvas pixel coordinates.

Parameters

row - row describing the top and bottom of the box.
column - column describing the left and right sides of the box.

Returns:

rectangle in canvas pixel coordinates.

search for examples view on GitHub view source