public interface Layer extends Serializable
The Layer interface defines the contract for accessing and manipulating a layer within a CAD drawing in the GroupDocs.Viewer component. It provides methods to retrieve information such as the layer name, visibility, and other properties.
Example usage:
try (Viewer viewer = new Viewer("document.mpt")) {
CadViewInfo viewInfo = (CadViewInfo) viewer.getViewInfo(ViewInfoOptions.forHtmlView());
List<Layer> layers = viewInfo.getLayers();
for (Layer layer : layers) {
// Use the layer object for further operations
}
}
Note: The default implementation of this interface is LayerImpl.
Viewer| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Checks if this object is equal to the provided object.
|
String |
getName()
Retrieves the name of the layer.
|
boolean |
isVisible()
Checks the visibility of the layer.
|
void |
setName(String name)
Sets the name of the layer.
|
void |
setVisible(boolean isVisible)
Sets the visibility of the layer.
|
boolean equals(Object other)
Checks if this object is equal to the provided object.
String getName()
Retrieves the name of the layer.
Note: Layer names are case sensitive.
boolean isVisible()
Checks the visibility of the layer.
The CAD drawing layers that are switched off or frozen are invisible.
To render layers that are invisible, use the CadOptions.setLayers(List) option.
true if the layer is visible, false otherwise.void setName(String name)
name - The new name for the layer.void setVisible(boolean isVisible)
If true, the layer will be visible; if false, it will be hidden.
isVisible - Whether the layer should be visible or not.Copyright © 2024. All rights reserved.