SmPanelSymbol 是符号显示面板,可显示点、线、填充、三维等符号。其接口说明可参见[SmPanelSymbol 接口。
示范代码
SmPanelSymbol 控件使用的示例代码如下:
//当前工作空间放符号库的对象
Resources resources = Application.getActiveApplication().getWorkspace().getResources();
Symbol symbolFill = resources.getFillLibrary().findSymbol(955831);
Symbol symbolLine = resources.getLineLibrary().findSymbol(965132);
Symbol symbolMarker = resources.getMarkerLibrary().findSymbol(313);
//构建点、线、填充符号面板
if (symbolFill!=null) {
this.smPanelSymbol1 = new SmPanelSymbolFill(symbolFill,resources);
}
if (symbolLine != null) {
this.smPanelSymbol2 = new SmPanelSymbolLine(symbolLine,resources);
}
if (symbolMarker!=null) {
this.smPanelSymbol3 = new SmPanelSymbolPoint(symbolMarker,resources);
}
JPanel jPanel = new JPanel();
if (this.smPanelSymbol1!=null) {
jPanel.add(this.smPanelSymbol1);
}
if (smPanelSymbol2 != null) {
jPanel.add(this.smPanelSymbol2);
}
if (this.smPanelSymbol3 != null) {
jPanel.add(this.smPanelSymbol3);
}
SmPanelSymbol 控件显示效果如下: