API reference - Class LayerProperties

Notation used in Ruby API documentation

Description: The layer properties structure

The layer properties encapsulate the settings relevant for the display and source of a layer.

Each attribute is present in two incarnations: local and real. "real" refers to the effective attribute after collecting the attributes from the parents to the leaf property node. In the spirit of this distinction, all read accessors are present in "local" and "real" form. The read accessors take a boolean parameter "real" that must be set to true, if the real value shall be returned.

"brightness" is a index that indicates how much to make the color brighter to darker rendering the effective color (eff_frame_color, eff_fill_color). It's value is roughly between -255 and 255.

Public constructors

LayerPropertiesnewCreates a new object of this class

Public methods

[const]bool!=(const LayerProperties other)Inequality
[const]bool==(const LayerProperties other)Equality
[const]intanimation(bool real)Get the animation state
[const]intanimationGet the animation state
voidanimation=(int animation)Set the animation state
[const]voidassign(const LayerProperties other)Assign the contents of another object to self
[const]intcellviewAccess to the cellview index
voidclear_dither_patternClear the dither pattern
voidclear_fill_colorReset the fill color
voidclear_frame_colorReset the frame color
voidclear_lower_hier_levelDisable a lower hierarchy level specification
voidclear_source_nameRemove any stream layer name specification from this layer
voidclear_upper_hier_levelDisable a upper hierarchy level specification
voidcreateEnsures the C++ object is created
voiddestroyExplicitly destroy the object
[const]booldestroyed?Returns a value indicating whether the object was already destroyed
[const]intdither_pattern(bool real)Get the dither pattern index
[const]intdither_patternGet the dither pattern index
voiddither_pattern=(int index)Set the dither pattern index
[const]LayerPropertiesdupCreates a copy of self
[const]unsigned inteff_dither_pattern(bool real)Get the effective dither pattern index
[const]unsigned inteff_dither_patternGet the effective dither pattern index
[const]unsigned inteff_fill_color(bool real)Get the effective fill color
[const]unsigned inteff_fill_colorGet the effective fill color
[const]unsigned inteff_frame_color(bool real)Get the effective frame color
[const]unsigned inteff_frame_colorGet the effective frame color
[const]intfill_brightness(bool real)Get the fill brightness value
[const]intfill_brightnessGet the fill brightness value
voidfill_brightness=(int brightness)Set the fill brightness
[const]unsigned intfill_color(bool real)Get the fill color
[const]unsigned intfill_colorGet the fill color
voidfill_color=(unsigned int color)Set the fill color to the given value
[const]LayerPropertiesflatreturn the "flattened" (effective) layer properties entry for this node
[const]intframe_brightness(bool real)Get the frame brightness value
[const]intframe_brightnessGet the frame brightness value
voidframe_brightness=(int brightness)Set the frame brightness
[const]unsigned intframe_color(bool real)Get the frame color
[const]unsigned intframe_colorGet the frame color
voidframe_color=(unsigned int color)Set the frame color to the given value
[const]boolhas_dither_pattern?(bool real)Test, if the dither pattern is set
[const]boolhas_dither_pattern?Test, if the dither pattern is set
[const]boolhas_fill_color?(bool real)Test, if the fill color is set
[const]boolhas_fill_color?Test, if the fill color is set
[const]boolhas_frame_color?(bool real)Test, if the frame color is set
[const]boolhas_frame_color?Test, if the frame color is set
[const]boolhas_lower_hier_level?(bool real)True, if a lower hierarchy level is explicitly specified
[const]boolhas_lower_hier_level?True, if a lower hierarchy level is explicitly specified
[const]boolhas_source_name?(bool real)Tell, if a stream layer name is specified for this layer
[const]boolhas_source_name?Tell, if a stream layer name is specified for this layer
[const]boolhas_upper_hier_level?(bool real)True, if a upper hierarchy level is explicitly specified
[const]boolhas_upper_hier_level?True, if a upper hierarchy level is explicitly specified
[const]boolis_const_object?Returns a value indicating whether the reference is a const reference
[const]intlayer_indexAccess to the layer index
[const]intlower_hier_level(bool real)The lower hierarchy level shown
[const]intlower_hier_levelThe lower hierarchy level shown
voidlower_hier_level=(int level)Specify a lower hierarchy level
[const]intlower_hier_level_mode(bool real)Specifies the mode for the lower hierarchy level.
[const]intlower_hier_level_modeSpecifies the mode for the lower hierarchy level.
[const]boollower_hier_level_relative(bool real)Specifies if the lower hierarchy level is relative.
[const]boollower_hier_level_relativeSpecifies if the upper hierarchy level is relative.
voidmarked=(bool marked)Set the marked state
[const]boolmarked?(bool real)Get the marked state
[const]boolmarked?Get the animation state
[const]stringnameGet the name
voidname=(string name)Set the name to the given string
voidset_lower_hier_level(int level,
bool relative)
Specify the lower hierarchy level and if it is relative to the context cell
voidset_lower_hier_level(int level,
bool relative,
int mode)
Specify the lower hierarchy level, if it is relative to the context cell and the mode
voidset_upper_hier_level(int level,
bool relative)
Specify the upper hierarchy level and if it is relative to the context cell
voidset_upper_hier_level(int level,
bool relative,
int mode)
Specify the upper hierarchy level, if it is relative to the context cell and the mode
[const]stringsource(bool real)The source specification
[const]stringsourceThe source specification
voidsource=(string s)Load the source specification from a string
[const]intsource_cellview(bool real)Get the cellview index that this layer refers to
[const]intsource_cellviewGet the cellview index that this layer refers to
voidsource_cellview=(int cellview_index)Set the cellview index that this layer refers to
[const]intsource_datatype(bool real)Get the stream datatype that the shapes are taken from
[const]intsource_datatypeGet the stream datatype that the shapes are taken from
voidsource_datatype=(int datatype)Set the stream datatype that the shapes are taken from
[const]intsource_layer(bool real)Get the stream layer that the shapes are taken from
[const]intsource_layerGet the stream layer that the shapes are taken from
voidsource_layer=(int layer)Set the stream layer that the shapes are taken from
[const]intsource_layer_index(bool real)Get the layer index that the shapes are taken from
[const]intsource_layer_indexGet the stream layer that the shapes are taken from
voidsource_layer_index=(int index)Set the layer index specification that the shapes are taken from
[const]stringsource_name(bool real)Get the stream name that the shapes are taken from
[const]stringsource_nameTell, if a stream layer name is specified for this layer
voidsource_name=(string name)Set the stream layer name that the shapes are taken from
[const]CplxTrans[]trans(bool real)Get the transformations that the layer is transformed with
[const]CplxTrans[]transGet the transformations that the layer is transformed with
voidtrans=(CplxTrans[] trans_vector)Set the transformations that the layer is transformed with
voidtransparent=(bool transparent)Set the transparency state
[const]booltransparent?(bool real)Get the transparency state
[const]booltransparent?Get the transparency state
[const]intupper_hier_level(bool real)The upper hierarchy level shown
[const]intupper_hier_levelThe upper hierarchy level shown
voidupper_hier_level=(int level)Specify a upper hierarchy level
[const]intupper_hier_level_mode(bool real)Specifies the mode for the upper hierarchy level.
[const]intupper_hier_level_modeSpecifies the mode for the upper hierarchy level.
[const]boolupper_hier_level_relative(bool real)Specifies if the upper hierarchy level is relative.
[const]boolupper_hier_level_relativeSpecifies if the upper hierarchy level is relative.
voidvalid=(bool valid)Set the validity state
[const]boolvalid?(bool real)Get the validity state
[const]boolvalid?Get the validity state
voidvisible=(bool visible)Set the visibility state
[const]boolvisible?(bool real)Get the visibility state
[const]boolvisible?Get the visibility state
[const]intwidth(bool real)Get the line width
[const]intwidthGet the line width
voidwidth=(int width)Set the line width to the given width

Deprecated methods (protected, public, static, non-static and constructors)

[const]boolhas_source_name(bool real)Use of this method is deprecated. Use has_source_name? instead

Detailed description

[const] bool !=(const LayerProperties other)

Description: Inequality

other:The other object to compare against

[const] bool ==(const LayerProperties other)

Description: Equality

other:The other object to compare against

[const] int animation(bool real)

Description: Get the animation state

The animation state is an integer either being 0 (static), 1 (scrolling), 2 (blinking) or 3 (inversely blinking)

[const] int animation

Description: Get the animation state

This method is a convenience method for "animation(true)"

This method has been introduced in version 0.22.

void animation=(int animation)

Description: Set the animation state

See the description of the animation method for details about the animation state

[const] void assign(const LayerProperties other)

Description: Assign the contents of another object to self

This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.

[const] int cellview

Description: Access to the cellview index

This is the index of the actual cellview to use. Basically, this method returns source_cellview in "real" mode. The result may be different, if the cellview is not valid for example. In this case, a negative value is returned.

void clear_dither_pattern

Description: Clear the dither pattern

void clear_fill_color

Description: Reset the fill color

void clear_frame_color

Description: Reset the frame color

void clear_lower_hier_level

Description: Disable a lower hierarchy level specification

See has_lower_hier_level for a description of this property

void clear_source_name

Description: Remove any stream layer name specification from this layer

void clear_upper_hier_level

Description: Disable a upper hierarchy level specification

See has_upper_hier_level for a description of this property

void create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

void destroy

Description: Explicitly destroy the object

Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.

[const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] int dither_pattern(bool real)

Description: Get the dither pattern index

real:Set to true to return the real instead of local value

This method may deliver an invalid dither pattern index if it is not set.

[const] int dither_pattern

Description: Get the dither pattern index

This method is a convenience method for "dither_pattern(true)"

This method has been introduced in version 0.22.

void dither_pattern=(int index)

Description: Set the dither pattern index

The dither pattern index must be one of the valid indices. Indices 0 to 31 denote built-in pattern, indices above 32 denote one of the custom pattern. Index 0 is always solid filled and 1 is always the hollow filled pattern.

[const] LayerProperties dup

Description: Creates a copy of self

[const] unsigned int eff_dither_pattern(bool real)

Description: Get the effective dither pattern index

real:Set to true to return the real instead of local value

The effective dither pattern index is always a valid index, even if no dither pattern is set.

[const] unsigned int eff_dither_pattern

Description: Get the effective dither pattern index

This method is a convenience method for "eff_dither_pattern(true)"

This method has been introduced in version 0.22.

[const] unsigned int eff_fill_color(bool real)

Description: Get the effective fill color

real:Set to true to return the real instead of local value

The effective fill color is computed from the frame color brightness and the frame color.

[const] unsigned int eff_fill_color

Description: Get the effective fill color

This method is a convenience method for "eff_fill_color(true)"

This method has been introduced in version 0.22.

[const] unsigned int eff_frame_color(bool real)

Description: Get the effective frame color

real:Set to true to return the real instead of local value

The effective frame color is computed from the frame color brightness and the frame color.

[const] unsigned int eff_frame_color

Description: Get the effective frame color

This method is a convenience method for "eff_frame_color(true)"

This method has been introduced in version 0.22.

[const] int fill_brightness(bool real)

Description: Get the fill brightness value

real:Set to true to return the real instead of local value

If the brightness is not set, this method may return an invalid value

[const] int fill_brightness

Description: Get the fill brightness value

This method is a convenience method for "fill_brightness(true)"

This method has been introduced in version 0.22.

void fill_brightness=(int brightness)

Description: Set the fill brightness

For neutral brightness set this value to 0. For darker colors set it to a negative value (down to -255), for brighter colors to a positive value (up to 255)

[const] unsigned int fill_color(bool real)

Description: Get the fill color

real:Set to true to return the real instead of local value

This method may return an invalid color if the color is not set.

[const] unsigned int fill_color

Description: Get the fill color

This method is a convenience method for "fill_color(true)"

This method has been introduced in version 0.22.

void fill_color=(unsigned int color)

Description: Set the fill color to the given value

The color is a 32bit value encoding the blue value in the lower 8 bits, the green value in the next 8 bits and the red value in the 8 bits above that.

[const] LayerProperties flat

Description: return the "flattened" (effective) layer properties entry for this node

This method returns a LayerProperties object that is not embedded into a hierarchy. This object represents the effective layer properties for the given node. In particular, all 'local' properties are identical to the 'real' properties. Such an object can be used as a basis for manipulations. This method has been introduced in version 0.22.

[const] int frame_brightness(bool real)

Description: Get the frame brightness value

real:Set to true to return the real instead of local value

If the brightness is not set, this method may return an invalid value

[const] int frame_brightness

Description: Get the frame brightness value

This method is a convenience method for "frame_brightness(true)"

This method has been introduced in version 0.22.

void frame_brightness=(int brightness)

Description: Set the frame brightness

For neutral brightness set this value to 0. For darker colors set it to a negative value (down to -255), for brighter colors to a positive value (up to 255)

[const] unsigned int frame_color(bool real)

Description: Get the frame color

real:Set to true to return the real instead of local value

This method may return an invalid color if the color is not set.

[const] unsigned int frame_color

Description: Get the frame color

This method is a convenience method for "frame_color(true)"

This method has been introduced in version 0.22.

void frame_color=(unsigned int color)

Description: Set the frame color to the given value

The color is a 32bit value encoding the blue value in the lower 8 bits, the green value in the next 8 bits and the red value in the 8 bits above that.

[const] bool has_dither_pattern?(bool real)

Description: Test, if the dither pattern is set

[const] bool has_dither_pattern?

Description: Test, if the dither pattern is set

This method is a convenience method for "has_dither_pattern?(true)"

This method has been introduced in version 0.22.

[const] bool has_fill_color?(bool real)

Description: Test, if the fill color is set

[const] bool has_fill_color?

Description: Test, if the fill color is set

This method is a convenience method for "has_fill_color?(true)"

This method has been introduced in version 0.22.

[const] bool has_frame_color?(bool real)

Description: Test, if the frame color is set

[const] bool has_frame_color?

Description: Test, if the frame color is set

This method is a convenience method for "has_frame_color?(true)"

This method has been introduced in version 0.22.

[const] bool has_lower_hier_level?(bool real)

Description: True, if a lower hierarchy level is explicitly specified

If "real" is true, the effective value is returned.

[const] bool has_lower_hier_level?

Description: True, if a lower hierarchy level is explicitly specified

This method is a convenience method for "has_lower_hier_level?(true)"

This method has been introduced in version 0.22.

[const] bool has_source_name(bool real)

Description: Tell, if a stream layer name is specified for this layer

This method is deprecated. Use method 'has_source_name?' instead

[const] bool has_source_name?(bool real)

Description: Tell, if a stream layer name is specified for this layer

If "real" is true, the effective value is returned.

[const] bool has_source_name?

Description: Tell, if a stream layer name is specified for this layer

This method is a convenience method for "has_source_name?(true)"

This method has been introduced in version 0.22.

[const] bool has_upper_hier_level?(bool real)

Description: True, if a upper hierarchy level is explicitly specified

If "real" is true, the effective value is returned.

[const] bool has_upper_hier_level?

Description: True, if a upper hierarchy level is explicitly specified

This method is a convenience method for "has_upper_hier_level?(true)"

This method has been introduced in version 0.22.

[const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

[const] int layer_index

Description: Access to the layer index

This is the index of the actual layer used. The source specification given by source_layer, source_datatype, source_name is evaluated and the corresponding layer is looked up in the layout object. If a source_layer_index is specified, this layer index is taken as the layer index to use.

[const] int lower_hier_level(bool real)

Description: The lower hierarchy level shown

This is the hierarchy level at which the drawing starts. This property is only meaningful, if has_lower_hier_level is true. The hierarchy level can be relative in which case, 0 refers to the context cell's level. A mode can be specfied for the hierarchy level which is 0 for absolute, 1 for minimum of specified level and set level and 2 for maximum of specified level and set level.

[const] int lower_hier_level

Description: The lower hierarchy level shown

This method is a convenience method for "lower_hier_level(true)"

This method has been introduced in version 0.22.

void lower_hier_level=(int level)

Description: Specify a lower hierarchy level

If this method is called, the lower hierarchy level is enabled. See lower_hier_level for a description of this property.

[const] int lower_hier_level_mode(bool real)

Description: Specifies the mode for the lower hierarchy level.

See lower_hier_level for a description of this property.

This method has been introduced in version 0.20.

[const] int lower_hier_level_mode

Description: Specifies the mode for the lower hierarchy level.

This method is a convenience method for "lower_hier_level_mode(true)"

This method has been introduced in version 0.22.

[const] bool lower_hier_level_relative(bool real)

Description: Specifies if the lower hierarchy level is relative.

See lower_hier_level for a description of this property.

This method has been introduced in version 0.19.

[const] bool lower_hier_level_relative

Description: Specifies if the upper hierarchy level is relative.

This method is a convenience method for "lower_hier_level_relative(true)"

This method has been introduced in version 0.22.

void marked=(bool marked)

Description: Set the marked state

[const] bool marked?(bool real)

Description: Get the marked state

[const] bool marked?

Description: Get the animation state

This method is a convenience method for "marked?(true)"

This method has been introduced in version 0.22.

[const] string name

Description: Get the name

void name=(string name)

Description: Set the name to the given string

[static] LayerProperties new

Description: Creates a new object of this class

void set_lower_hier_level(int level,bool relative)

Description: Specify the lower hierarchy level and if it is relative to the context cell

If this method is called, the lower hierarchy level is enabled. See lower_hier_level for a description of this property.

This method has been introduced in version 0.19.

void set_lower_hier_level(int level,bool relative,int mode)

Description: Specify the lower hierarchy level, if it is relative to the context cell and the mode

If this method is called, the lower hierarchy level is enabled. See lower_hier_level for a description of this property.

This method has been introduced in version 0.20.

void set_upper_hier_level(int level,bool relative)

Description: Specify the upper hierarchy level and if it is relative to the context cell

If this method is called, the upper hierarchy level is enabled. See upper_hier_level for a description of this property.

This method has been introduced in version 0.19.

void set_upper_hier_level(int level,bool relative,int mode)

Description: Specify the upper hierarchy level, if it is relative to the context cell and the mode

If this method is called, the upper hierarchy level is enabled. See upper_hier_level for a description of this property.

This method has been introduced in version 0.20.

[const] string source(bool real)

Description: The source specification

real:Set to true to return the real instead of local value

This method delivers the source specification as a string

[const] string source

Description: The source specification

This method is a convenience method for "source(true)"

This method has been introduced in version 0.22.

void source=(string s)

Description: Load the source specification from a string

Sets the source specification to the given string. The source specification may contain the cellview index, the source layer (given by layer/datatype or layer name), transformation, property selector etc. This method throws an exception if the specification is not valid.

[const] int source_cellview(bool real)

Description: Get the cellview index that this layer refers to

If "real" is true, the effective value is returned.

[const] int source_cellview

Description: Get the cellview index that this layer refers to

This method is a convenience method for "source_cellview(true)"

This method has been introduced in version 0.22.

void source_cellview=(int cellview_index)

Description: Set the cellview index that this layer refers to

See cellview for a description of the transformations.

[const] int source_datatype(bool real)

Description: Get the stream datatype that the shapes are taken from

If the datatype is positive, the actual layer is looked up by this stream datatype. If a name or layer index is specified, the stream datatype is not used.

If "real" is true, the effective value is returned.

[const] int source_datatype

Description: Get the stream datatype that the shapes are taken from

This method is a convenience method for "source_datatype(true)"

This method has been introduced in version 0.22.

void source_datatype=(int datatype)

Description: Set the stream datatype that the shapes are taken from

See datatype for a description of this property

[const] int source_layer(bool real)

Description: Get the stream layer that the shapes are taken from

If the layer is positive, the actual layer is looked up by this stream layer. If a name or layer index is specified, the stream layer is not used.

If "real" is true, the effective value is returned.

[const] int source_layer

Description: Get the stream layer that the shapes are taken from

This method is a convenience method for "source_layer(true)"

This method has been introduced in version 0.22.

void source_layer=(int layer)

Description: Set the stream layer that the shapes are taken from

See source_layer for a description of this property

[const] int source_layer_index(bool real)

Description: Get the layer index that the shapes are taken from

If the layer index is positive, the shapes drawn are taken from this layer rather than searched for by layer and datatype. This property is stronger than the layer/datatype or name specification.

The similar method layer_index returns the actual layer index used, not the given one. The latter may be negative indicating that layer/datatype or name specifications are used.

If "real" is true, the effective value is returned.

[const] int source_layer_index

Description: Get the stream layer that the shapes are taken from

This method is a convenience method for "source_layer_index(true)"

This method has been introduced in version 0.22.

void source_layer_index=(int index)

Description: Set the layer index specification that the shapes are taken from

See source_layer_index for a description of this property.

[const] string source_name(bool real)

Description: Get the stream name that the shapes are taken from

If the name is non-empty, the actual layer is looked up by this stream layer name. If a layer index (see layer_index) is specified, the stream datatype is not used. A name is only meaningful for OASIS files.

If "real" is true, the effective value is returned.

[const] string source_name

Description: Tell, if a stream layer name is specified for this layer

This method is a convenience method for "has_source_name?(true)"

This method has been introduced in version 0.22.

void source_name=(string name)

Description: Set the stream layer name that the shapes are taken from

See name for a description of this property

[const] CplxTrans[] trans(bool real)

Description: Get the transformations that the layer is transformed with

The transformations returned by this accessor is the one used for displaying this layer. The layout is transformed with each of these transformations before it is drawn.

If "real" is true, the effective value is returned.

[const] CplxTrans[] trans

Description: Get the transformations that the layer is transformed with

This method is a convenience method for "trans(true)"

This method has been introduced in version 0.22.

void trans=(CplxTrans[] trans_vector)

Description: Set the transformations that the layer is transformed with

See trans for a description of the transformations.

void transparent=(bool transparent)

Description: Set the transparency state

[const] bool transparent?(bool real)

Description: Get the transparency state

[const] bool transparent?

Description: Get the transparency state

This method is a convenience method for "transparent?(true)"

This method has been introduced in version 0.22.

[const] int upper_hier_level(bool real)

Description: The upper hierarchy level shown

This is the hierarchy level at which the drawing starts. This property is only meaningful, if has_upper_hier_level is true. The hierarchy level can be relative in which case, 0 refers to the context cell's level. A mode can be specfied for the hierarchy level which is 0 for absolute, 1 for minimum of specified level and set level and 2 for maximum of specified level and set level.

[const] int upper_hier_level

Description: The upper hierarchy level shown

This method is a convenience method for "upper_hier_level(true)"

This method has been introduced in version 0.22.

void upper_hier_level=(int level)

Description: Specify a upper hierarchy level

If this method is called, the upper hierarchy level is enabled. See upper_hier_level for a description of this property.

[const] int upper_hier_level_mode(bool real)

Description: Specifies the mode for the upper hierarchy level.

See upper_hier_level for a description of this property.

This method has been introduced in version 0.20.

[const] int upper_hier_level_mode

Description: Specifies the mode for the upper hierarchy level.

This method is a convenience method for "upper_hier_level_mode(true)"

This method has been introduced in version 0.22.

[const] bool upper_hier_level_relative(bool real)

Description: Specifies if the upper hierarchy level is relative.

See upper_hier_level for a description of this property.

This method has been introduced in version 0.19.

[const] bool upper_hier_level_relative

Description: Specifies if the upper hierarchy level is relative.

This method is a convenience method for "upper_hier_level_relative(true)"

This method has been introduced in version 0.22.

void valid=(bool valid)

Description: Set the validity state

[const] bool valid?(bool real)

Description: Get the validity state

[const] bool valid?

Description: Get the validity state

This method is a convenience method for "valid?(true)"

This method has been introduced in version 0.23.

void visible=(bool visible)

Description: Set the visibility state

[const] bool visible?(bool real)

Description: Get the visibility state

[const] bool visible?

Description: Get the visibility state

This method is a convenience method for "visible?(true)"

This method has been introduced in version 0.22.

[const] int width(bool real)

Description: Get the line width

[const] int width

Description: Get the line width

This method is a convenience method for "width(true)"

This method has been introduced in version 0.22.

void width=(int width)

Description: Set the line width to the given width