/** Get the {@link GLStateType#VBO_COMPOSITE} property given a node in the state hierarchy. */ private IGLProperty getVboProperty(IGLProperty state) { if (state.getType() == GLStateType.VBO_COMPOSITE) { return state; } state = state.getParent(); if (state != null && state.getType() == GLStateType.VBO_COMPOSITE) { return state; } return null; }
@Override public void updateControl(IGLProperty state) { IGLProperty vbo = getVboProperty(state); if (vbo instanceof GLCompositeProperty) { GLCompositeProperty vboProperty = (GLCompositeProperty) vbo; IGLProperty sizeProperty = vboProperty.getProperty(GLStateType.BUFFER_SIZE); mSizeLabel.setText(sizeProperty.getStringValue() + " bytes"); // $NON-NLS-1$ IGLProperty usageProperty = vboProperty.getProperty(GLStateType.BUFFER_USAGE); mUsageLabel.setText(usageProperty.getStringValue()); IGLProperty typeProperty = vboProperty.getProperty(GLStateType.BUFFER_TYPE); mTypeLabel.setText(typeProperty.getStringValue()); IGLProperty dataProperty = vboProperty.getProperty(GLStateType.BUFFER_DATA); mBufferData = (byte[]) dataProperty.getValue(); } else { mBufferData = null; } updateContents(); }