Class TLcdDGNLevelSymbology
- All Implemented Interfaces:
Serializable
Whether or not the table is overriding the element values is specified by the
three respective boolean properties (cfr. hasStyle(),
hasWeight(), and hasColor()).
If the element values are overridden, they can be requested for each level
(cfr. getStyle(int), getWeight(int),
and getColor(int)).
Note that each DGN level has in fact two sets of symbologies:
- the elements' default symbology, which is used by the elements whose color, weight or style is marked as "ByLevel"
- the level symbology, which is used to override the style of the individual elements when the view level symbology flag is on, and the flags "useColor", "useWeight" or "useStyle" of the level are set to true.
Note: for convenience, you can use the getColor(TLcdDGNDisplayInfo), getStyle(TLcdDGNDisplayInfo) and getWeight(TLcdDGNDisplayInfo) methods to retrieve the styling for an element according to the rules above.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionTLcdDGNLevelSymbology(boolean aUseColor, boolean aUseWeight, boolean aUseStyle, int[] aSymbologies) Creates a new TLcdDGNLevelSymbology.TLcdDGNLevelSymbology(boolean aUseColor, boolean aUseWeight, boolean aUseStyle, int[] aSymbologies, String[] aNames, String[] aDescriptions) Creates a new TLcdDGNLevelSymbology.TLcdDGNLevelSymbology(TLcdDGNLevel[] aLevels) Deprecated.You should not create a level symbology yourself, the decoder will create it for you. -
Method Summary
Modifier and TypeMethodDescriptionintgetColor(int aLevelIndex) Returns the symbology override color of elements at the specified level.intgetColor(TLcdDGNDisplayInfo aDisplayInfo) Deprecated.getColor(TLcdDGNDisplayInfo aDisplayInfo, TLcdDGNColorTable aColorTable) Deprecated.getColor(TLcdDGNDisplayInfo aDisplayInfo, TLcdDGNColorTable aColorTable, Color aBackgroundColor) Retrieve the color for a particular element based on the styling priorities defined by MicroStation.getDescription(int aLevelIndex) Returns the description of the specified level.intgetElementColor(int aLevelIndex) Deprecated.This call does not take RGB colors into account.getElementColor(int aLevelIndex, TLcdDGNColorTable aColorTable) Returns the element color of the elements on the given level, which is used to display the elements that have the 'bylevel' color value.intgetElementStyle(int aLevelIndex) This implementation returns the same value as getStyle()intgetElementWeight(int aLevelIndex) This implementation returns the same value as getElementWeight()intgetFillColor(int aLevelIndex) Returns the symbology fill color of elements at the specified level.intgetFillColor(TLcdDGNDisplayInfo aDisplayInfo) Deprecated.getFillColor(TLcdDGNDisplayInfo aDisplayInfo, TLcdDGNColorTable aColorTable) Deprecated.getFillColor(TLcdDGNDisplayInfo aDisplayInfo, TLcdDGNColorTable aColorTable, Color aBackgroundColor) Retrieve the fill color for a particular element based on the styling priorities defined by MicroStation.intgetLevel(int aLevelID) Deprecated.Use (@link #getLevelIndex(int)}.intReturns the number of defined levels.intgetLevelID(int aLevelIndex) Returns the level ID, based on the level index.intgetLevelIndex(int aLevelID) Returns the level index, based on the level ID, which is stored with DGN elements.intgetLevelNumber(int aLevelIndex) Returns the level number of the specified level.getName(int aLevelIndex) Returns the name of the specified level.intgetStyle(int aLevelIndex) Returns the symbology override style of elements at the specified level.intgetStyle(TLcdDGNDisplayInfo aDisplayInfo) Retrieve the style for a particular element based on the styling priorities defined by MicroStation.getStyleName(int aStyle) Returns the line style name associated with the given line style ID.getStyleName(TLcdDGNDisplayInfo aDisplayInfo) Returns the line style name associated with the style for the given element.intgetWeight(int aLevelIndex) Returns the symbology override weight of elements at the specified level.intgetWeight(TLcdDGNDisplayInfo aDisplayInfo) Retrieve the line weight for a particular element based on the styling priorities defined by MicroStation.booleanhasColor()Deprecated.Usefor compatibility with DGN V8 files.hasColor(int)booleanhasColor(int aLevelIndex) Returns whether the symbology override color should be used.booleanhasFillColor(int aLevelIndex) Returns whether the symbology override fill color should be used.booleanhasStyle()Deprecated.Usefor compatibility with DGN V8 files.hasStyle(int)booleanhasStyle(int aLevelIndex) Returns whether the symbology override style should be used.booleanDeprecated.Usefor compatibility with DGN V8 files.hasWeight(int)booleanhasWeight(int aLevelIndex) Returns whether the symbology override weight should be used.booleanIndicates whether the view level overrides should be used for styling.voidsetUseViewLevelSymbology(boolean aUseLevelSymbology) Set whether the view level overrides should be used for styling.
-
Field Details
-
STYLE_MASK
public static final int STYLE_MASK- See Also:
-
WEIGHT_MASK
public static final int WEIGHT_MASK- See Also:
-
COLOR_MASK
public static final int COLOR_MASK- See Also:
-
WEIGHT_SHIFT
public static final int WEIGHT_SHIFT- See Also:
-
COLOR_SHIFT
public static final int COLOR_SHIFT- See Also:
-
-
Constructor Details
-
TLcdDGNLevelSymbology
public TLcdDGNLevelSymbology(boolean aUseColor, boolean aUseWeight, boolean aUseStyle, int[] aSymbologies) Creates a new TLcdDGNLevelSymbology.- Parameters:
aUseColor- specifies whether the symbology colors should be used.aUseWeight- specifies whether the symbology weights should be used.aUseStyle- specifies whether the symbology styles should be used.aSymbologies- the level symbologies.
-
TLcdDGNLevelSymbology
public TLcdDGNLevelSymbology(boolean aUseColor, boolean aUseWeight, boolean aUseStyle, int[] aSymbologies, String[] aNames, String[] aDescriptions) Creates a new TLcdDGNLevelSymbology.- Parameters:
aUseColor- specifies whether the symbology colors should be used.aUseWeight- specifies whether the symbology weights should be used.aUseStyle- specifies whether the symbology styles should be used.aSymbologies- the level symbologies.aNames- the level names.aDescriptions- the level descriptions.
-
TLcdDGNLevelSymbology
Deprecated.You should not create a level symbology yourself, the decoder will create it for you.Creates a new TLcdDGNLevelSymbology.- Parameters:
aLevels- the level objects that make up the symbology.
-
-
Method Details
-
hasColor
public boolean hasColor()Deprecated.Usefor compatibility with DGN V8 files.hasColor(int)Returns whether the symbology colors should be used. -
hasWeight
public boolean hasWeight()Deprecated.Usefor compatibility with DGN V8 files.hasWeight(int)Returns whether the symbology weights should be used. -
hasStyle
public boolean hasStyle()Deprecated.Usefor compatibility with DGN V8 files.hasStyle(int)Returns whether the symbology styles should be used. -
getLevelCount
public int getLevelCount()Returns the number of defined levels. For DGN V7 files, the number is always 64. -
getLevelID
public int getLevelID(int aLevelIndex) Returns the level ID, based on the level index. For DGN V7 files, the level index is always equal to the level ID.- Parameters:
aLevelIndex- the level index.- Returns:
- the level ID.
-
getLevelNumber
public int getLevelNumber(int aLevelIndex) Returns the level number of the specified level. For DGN V7 files, the level number is always equal to the level ID (and the level index). For DGN V8 files, the level number can be entirely different.- Parameters:
aLevelIndex- the level index.- Returns:
- the level number.
-
getLevelIndex
public int getLevelIndex(int aLevelID) Returns the level index, based on the level ID, which is stored with DGN elements. For DGN V7 files, the level index is always equal to the level ID.- Parameters:
aLevelID- the level ID.- Returns:
- the level index.
-
getLevel
public int getLevel(int aLevelID) Deprecated.Use (@link #getLevelIndex(int)}. -
getName
Returns the name of the specified level.- Parameters:
aLevelIndex- the level index.- Returns:
- the level name.
-
getDescription
Returns the description of the specified level.- Parameters:
aLevelIndex- the level index.- Returns:
- the level description.
-
hasColor
public boolean hasColor(int aLevelIndex) Returns whether the symbology override color should be used.- Parameters:
aLevelIndex- the level index.- Returns:
- the override flag.
-
hasWeight
public boolean hasWeight(int aLevelIndex) Returns whether the symbology override weight should be used.- Parameters:
aLevelIndex- the level index.- Returns:
- the override flag.
-
hasStyle
public boolean hasStyle(int aLevelIndex) Returns whether the symbology override style should be used.- Parameters:
aLevelIndex- the level index.- Returns:
- the override flag.
-
hasFillColor
public boolean hasFillColor(int aLevelIndex) Returns whether the symbology override fill color should be used. Symbology fill colors are only supported as of DGN V8.- Parameters:
aLevelIndex- the level index.- Returns:
- the override flag.
-
getColor
public int getColor(int aLevelIndex) Returns the symbology override color of elements at the specified level.- Parameters:
aLevelIndex- the level index.- Returns:
- the symbology color.
-
getWeight
public int getWeight(int aLevelIndex) Returns the symbology override weight of elements at the specified level.- Parameters:
aLevelIndex- the level index.- Returns:
- the symbology weight.
-
getStyle
public int getStyle(int aLevelIndex) Returns the symbology override style of elements at the specified level.- Parameters:
aLevelIndex- the level index.- Returns:
- the symbology style.
-
getFillColor
public int getFillColor(int aLevelIndex) Returns the symbology fill color of elements at the specified level. Symbology fill colors are only supported as of DGN V8.- Parameters:
aLevelIndex- the level index.- Returns:
- the symbology fill color.
-
isUseViewLevelSymbology
public boolean isUseViewLevelSymbology()Indicates whether the view level overrides should be used for styling.By default, this is the
ViewLevelSymbologyflag of the model descriptor. You canoverridethis.See
getColor(TLcdDGNDisplayInfo, TLcdDGNColorTable)for styling resolution priorities.- Returns:
- whether view level overrides should be used.
-
setUseViewLevelSymbology
public void setUseViewLevelSymbology(boolean aUseLevelSymbology) Set whether the view level overrides should be used for styling.- Parameters:
aUseLevelSymbology- the desired setting- See Also:
-
getElementColor
public int getElementColor(int aLevelIndex) Deprecated.This call does not take RGB colors into account. UsegetElementColor(int, TLcdDGNColorTable)instead.Returns the element color of the elements on the given level, which is used to display the elements that have the 'bylevel' color value.- Parameters:
aLevelIndex-- Returns:
- the level color index.
-
getElementColor
Returns the element color of the elements on the given level, which is used to display the elements that have the 'bylevel' color value.- Parameters:
aLevelIndex- The level indexaColorTable- The color table to use- Returns:
- the level color.
-
getElementWeight
public int getElementWeight(int aLevelIndex) This implementation returns the same value as getElementWeight()- Parameters:
aLevelIndex-- Returns:
- the level weight.
-
getElementStyle
public int getElementStyle(int aLevelIndex) This implementation returns the same value as getStyle()- Parameters:
aLevelIndex-- Returns:
- the level style.
-
getColor
Deprecated.Retrieve the color index for a particular element based on the styling priorities defined by MicroStation.
This call does not take "extended" RGB colors into account. Use
getColor(TLcdDGNDisplayInfo, TLcdDGNColorTable)instead.See getColor(TLcdDGNDisplayInfo, TLcdDGNColorTable) for priority rules.
- Parameters:
aDisplayInfo- Display info associated with the element- Returns:
- a color index that can be used with the model descriptor's color table
- See Also:
-
getColor
Deprecated.Retrieve the color for a particular element based on the styling priorities defined by MicroStation.
Priorities:
- Defined by the "Overrides" symbology
- Only if view level symbology is set
- If defined for particular level
- Defined by specific element
- If defined
- Defined by the "ByLevel" symbology
- Parameters:
aDisplayInfo- Display info associated with the element- Returns:
- a color
- See Also:
- Defined by the "Overrides" symbology
-
getColor
public Color getColor(TLcdDGNDisplayInfo aDisplayInfo, TLcdDGNColorTable aColorTable, Color aBackgroundColor) Retrieve the color for a particular element based on the styling priorities defined by MicroStation.
Priorities:
- Defined by the "Overrides" symbology
- Only if view level symbology is set
- If defined for particular level
- Defined by specific element
- If defined
- Defined by the "ByLevel" symbology
- Parameters:
aDisplayInfo- Display info associated with the elementaColorTable- The color table to use (seeTLcdDGNModelDescriptor.getDGNColorTable())aBackgroundColor- The view's background color- Returns:
- a color
- See Also:
- Defined by the "Overrides" symbology
-
getStyle
Retrieve the style for a particular element based on the styling priorities defined by MicroStation.
A line style can either be:
- A basic line style: values 0-7
- A line style ID: you can retrieve its name through
getStyleName(com.luciad.format.dgn.TLcdDGNDisplayInfo)
Possible basic line styles:
- 0: solid
- 1: dotted
- 2: medium dash
- 3: long dash
- 4: dot-dash
- 5: short dash
- 6: dash-dot-dot
- 7: long dash-short dash
See getColor(TLcdDGNDisplayInfo, TLcdDGNColorTable) for priority rules.
- Parameters:
aDisplayInfo- Display info associated with the element- Returns:
- line style number as defined by MicroStation
-
getStyleName
Returns the line style name associated with the style for the given element.- Parameters:
aDisplayInfo- Display info associated with the element- Returns:
- The line style name, or
nullif unknown
-
getStyleName
Returns the line style name associated with the given line style ID.- Parameters:
aStyle- A line style ID- Returns:
- The line style name, or
nullif unknown
-
getWeight
Retrieve the line weight for a particular element based on the styling priorities defined by MicroStation.
The returned weight is between 0 and 31 and can be interpreted as pixels.
See getColor(TLcdDGNDisplayInfo, TLcdDGNColorTable) for priority rules.
- Parameters:
aDisplayInfo- Display info associated with the element- Returns:
- line width, between 0 and 31.
-
getFillColor
Deprecated.Retrieve the fill color for a particular element based on the styling priorities defined by MicroStation.
Note: this function does not take fill style (hole vs. solid) into account, see TLcdDGNDisplayInfo.isHole() and TLcdDGNDisplayInfo.isFilled().
See getColor(TLcdDGNDisplayInfo, TLcdDGNColorTable, Color) for priority rules.
- Parameters:
aDisplayInfo- Display info associated with the element- Returns:
- a color index that can be used with the model descriptor's color table
- See Also:
-
getFillColor
Deprecated.Retrieve the fill color for a particular element based on the styling priorities defined by MicroStation.
Note: this function does not take fill style (hole vs. solid) into account, see TLcdDGNDisplayInfo.isHole() and TLcdDGNDisplayInfo.isFilled().
See getColor(TLcdDGNDisplayInfo) for priority rules
- Parameters:
aDisplayInfo- Display info associated with the element- Returns:
- a color
- See Also:
-
getFillColor
public Color getFillColor(TLcdDGNDisplayInfo aDisplayInfo, TLcdDGNColorTable aColorTable, Color aBackgroundColor) Retrieve the fill color for a particular element based on the styling priorities defined by MicroStation.
Note: this function does not take fill style (hole vs. solid) into account, see TLcdDGNDisplayInfo.isHole() and TLcdDGNDisplayInfo.isFilled().
See getColor(TLcdDGNDisplayInfo) for priority rules
- Parameters:
aDisplayInfo- Display info associated with the elementaColorTable- The color table to use (seeTLcdDGNModelDescriptor.getDGNColorTable())aBackgroundColor- The view's background color- Returns:
- a color
- See Also:
-