code: public void setMaterial(final Material material) {
          switch (type) {
              case BOX:
                  box.setMaterial(material);
                  break;
              case CYLINDER:
                  cylinder.setMaterial(material);
                  break;
              default:
                  break;
          }
      }
docs: Sets the Material of the line, which can be used to display different
  colors.
  
  @param material The line material.