/** * Constructor * * @param state */ public Grid(GridState state) { super(state.name); this.state = state; this.cellSize = state.size; this.color = state.color; this.lineWidth = state.lineWidth; offset = new Vector3(); setLocation(state.location, false); lattice = new HiddenLine("_lattice", IndexMode.Lines); SpatialUtil.setPickHost(lattice, this); lattice.setColor(color); lattice.setModelBound(new BoundingBox()); MaterialState ms = new MaterialState(); ms.setColorMaterial(ColorMaterial.Emissive); ms.setColorMaterialFace(MaterialState.MaterialFace.FrontAndBack); ms.setEnabled(true); text = new Node("_text"); text.getSceneHints().setLightCombineMode(LightCombineMode.Off); text.getSceneHints().setPickingHint(PickingHint.Pickable, false); text.setRenderState(ms); setLabelVisible(state.labelVisible); attachChild(lattice); attachChild(text); setVisible(state.visible); setPinned(state.pinned); state.setMapElement(this); }
public void setHiddenDashed(boolean hiddenDashed) { lattice.enableDash(hiddenDashed); }
@Override protected void enableHighlight(boolean enable) { lattice.highlight(enable, color); }
/** * Set the line width. * * @param width */ public void setLineWidth(float width) { lineWidth = width; lattice.setLineWidth(width); markDirty(DirtyType.RenderState); }
/** * Set the color * * @param color */ public void setColor(Color color) { this.color = color; lattice.setColor(color); }