Shows a structure in Jmol
@since 3.0.5
501499
public static void showStructure(Structure structure)
			throws ClassNotFoundException, NoSuchMethodException,
			InvocationTargetException, IllegalAccessException, InstantiationException{

		Class<?> structureAlignmentJmol = Class.forName(strucAligJmol);

		Object strucAligJ = structureAlignmentJmol.newInstance();

		Method setS = structureAlignmentJmol.getMethod("setStructure", new Class[] {Structure.class});

		setS.invoke(strucAligJ,structure);
	}
1363431
private static function get_block_structure() {
        return new external_single_structure(
            array(
                'instanceid'    => new external_value(PARAM_INT, 'Block instance id.'),
                'name'          => new external_value(PARAM_PLUGIN, 'Block name.'),
                'region'        => new external_value(PARAM_ALPHANUMEXT, 'Block region.'),
                'positionid'    => new external_value(PARAM_INT, 'Position id.'),
                'collapsible'   => new external_value(PARAM_BOOL, 'Whether the block is collapsible.'),
                'dockable'      => new external_value(PARAM_BOOL, 'Whether the block is dockable.'),
                'weight'        => new external_value(PARAM_INT, 'Used to order blocks within a region.', VALUE_OPTIONAL),
                'visible'       => new external_value(PARAM_BOOL, 'Whether the block is visible.', VALUE_OPTIONAL),
                'contents'      => new external_single_structure(
                    array(
                        'title'         => new external_value(PARAM_TEXT, 'Block title.'),
                        'content'       => new external_value(PARAM_RAW, 'Block contents.'),
                        'contentformat' => new external_format_value('content'),
                        'footer'        => new external_value(PARAM_RAW, 'Block footer.'),
                        'files'         => new external_files('Block files.'),
                    ),
                    'Block contents (if required).', VALUE_OPTIONAL
                ),
            ), 'Block information.'
        );
    }
1076493
def index
      @elements = Element.not_nested
      # Fix for cancancan not able to merge multiple AR scopes for logged in users
      if cannot? :manage, Alchemy::Element
        @elements = @elements.accessible_by(current_ability, :index)
      end
      if params[:page_id].present?
        @elements = @elements.where(page_id: params[:page_id])
      end
      if params[:named].present?
        @elements = @elements.named(params[:named])
      end
      render json: @elements, adapter: :json, root: :elements
    end
120452
def show(options = {})
      @model = thing
      @title = @model.to_s.titleize.pluralize
      if options[:query]
        query_out = {}
        iterator = CEO::Iterator.new(thing)
        options[:query].each do |q|
          query_out.merge! iterator.query_eval(@thing, q)
        end
      end

      filtered_keys = CEO::Iterator.filter(keys(@thing), options)
      @thing_attrs = @thing.attributes.select do |k, _|
        filtered_keys.include? k
      end

      @thing_attrs.transform_keys! { |k| CEO::Iterator.acronymize(k) }
      @thing_attrs.merge! query_out if query_out

      render 'admin/show'
    end
1029306
def view_properties_as_tree field=@form.get_current_field
    alert "Nil field" unless field
    return unless field
    text = []
    tree = {}
    #iv = field.instance_variables.map do |v| v.to_s; end
    field.instance_variables.each do |v|
      val = field.instance_variable_get(v)
      klass = val.class
      if val.is_a? Array 
        #tree[v.to_s] = val
        text << { v.to_s => val }
        val = val.size
      elsif val.is_a? Hash
        #tree[v.to_s] = val
        text << { v.to_s => val }
        if val.size <= 5
          val = val.keys
        else
          val = val.keys.size.to_s + " [" + val.keys.first(5).join(", ") + " ...]"
        end
      end
      case val
      when String, Integer, TrueClass, FalseClass, NilClass, Array, Hash, Symbol
        ;
      else
        val = "Not shown"
      end
      text << "%-20s  %10s  %s" % [v, klass, val]
    end
    tree["Instance Variables"] = text
    pm = field.public_methods(false).map do |v| v.to_s; end
    tree["Public Methods"] = pm
    pm = field.public_methods(true) - field.public_methods(false)
    pm = pm.map do |v| v.to_s; end
    tree["Inherited Methods"] = pm

    #$log.debug "  view_properties #{s.size} , #{s} "
    treedialog tree, :title => "Properties"
  end
344895
def get_structure(atoms, cls=None):
        
        symbols = atoms.get_chemical_symbols()
        positions = atoms.get_positions()
        lattice = atoms.get_cell()

        cls = Structure if cls is None else cls
        return cls(lattice, symbols, positions,
                   coords_are_cartesian=True)
38837
public static StructureAlignmentJmol display(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException {

		if ( ca1.length < 1 || ca2.length < 1){
			throw new StructureException("length of atoms arrays is too short! " + ca1.length + "," + ca2.length);
		}

		Group[] twistedGroups = AlignmentTools.prepareGroupsForDisplay(afpChain, ca1, ca2);

		List<Group> hetatms  = StructureTools.getUnalignedGroups(ca1);
		List<Group> hetatms2 = StructureTools.getUnalignedGroups(ca2);

		return DisplayAFP.display(afpChain, twistedGroups, ca1, ca2, hetatms, hetatms2);

	}
592564
function show(cfg = {}) {
    if (_.isFunction(cfg)) {
        cfg = {
            template: cfg
        };
    }

    // no template exists, cannot proceed
    if (!cfg.template) {
        console.warn('No template found!')
        return;
    }
    let doc = null;
    if (getLastDocumentFromStack() && cfg.type === 'modal') { // show as a modal if there is something on the navigation stack
        doc = presentModal(cfg);
    } else { // no document on the navigation stack, show as a document
        doc = Page.makeDom(cfg);
        cleanNavigate(doc);
    }
    return doc;
}
489208
@Override
    protected Object getTreeStructureToSave(FacesContext facesContext)
    {
        if (log.isLoggable(Level.FINEST))
        {
            log.finest("Entering getTreeStructureToSave");
        }
        UIViewRoot viewRoot = facesContext.getViewRoot();
        if (viewRoot.isTransient())
        {
            return null;
        }
        TreeStructureManager tsm = new TreeStructureManager();
        Object retVal = tsm.buildTreeStructureToSave(viewRoot);
        if (log.isLoggable(Level.FINEST))
        {
            log.finest("Exiting getTreeStructureToSave");
        }
        return retVal;
    }
1315007
function getEntityNameKeyMap(structure) {
    const result = {};
    for (const kk in structure) {
      const vv = structure[kk];
      if (typeof vv === 'string') {
        if (types.isMap(vv)) {
          const info = types.getTypeInfo(vv);
          const entityName = info.entity;

          if (_entityNameType[entityName]) throw new Error(`Duplicate entity ${entityName}`);
          _entityNameType[entityName] = vv;

          result[entityName] = kk;
          delete structure[kk];
        }
      }
    }
    return result;
  }
745325
function createSectionStructure() {
    return {
        init: null,
        comments: [],
        attribs: {
            define: [],
            init: []
        },
        elements: {
            define: [],
            init: []
        },
        events: [],
        links: [],
        ons: [],
        statics: []
    };
}
1136579
def _display_objects(obj_type, object_repo, namespace, cmt_begin, cmt_end,
                         dest=None, summary=None, output_format=None):
        

        # TODO:ks FUTURE Consider sorting to perserve order of compile/add.
        if namespace in object_repo:
            if obj_type == 'Methods':
                _uprint(dest,
                        _format(u"{0}Namespace {1!A}: contains {2} {3}:{4}\n",
                                cmt_begin, namespace,
                                len(object_repo[namespace]),
                                obj_type, cmt_end))
            else:
                _uprint(dest,
                        _format(u"{0}Namespace {1!A}: contains {2} {3} {4}\n",
                                cmt_begin, namespace,
                                len(object_repo[namespace]),
                                obj_type, cmt_end))
            if summary:
                return

            # instances are special because the inner struct is a list
            if obj_type == 'Instances':
                try:
                    insts = object_repo[namespace]
                except KeyError:
                    return

                # TODO:ks Future: Possibly sort insts by path order.
                for inst in insts:
                    if output_format == 'xml':
                        _uprint(dest,
                                _format(u"{0} Path={1} {2}\n{3}",
                                        cmt_begin, inst.path.to_wbem_uri(),
                                        cmt_end,
                                        _pretty_xml(inst.tocimxmlstr())))
                    elif output_format == 'repr':
                        _uprint(dest,
                                _format(u"Path:\n{0!A}\nInst:\n{1!A}\n",
                                        inst.path, inst))
                    else:
                        _uprint(dest,
                                _format(u"{0} Path={1} {2}\n{3}",
                                        cmt_begin, inst.path.to_wbem_uri(),
                                        cmt_end, inst.tomof()))

            elif obj_type == 'Methods':
                try:
                    methods = object_repo[namespace]
                except KeyError:
                    return

                for cln in methods:
                    for method in methods[cln]:
                        _uprint(dest,
                                _format(u"{0}Class: {1}, method: {2}, "
                                        u"callback: {3} {4}",
                                        cmt_begin, cln, method,
                                        methods[cln][method].__name__,
                                        cmt_end))

            else:
                assert obj_type in ['Classes', 'Qualifier Declarations']
                try:
                    objs = object_repo[namespace]
                except KeyError:
                    return
                for key in sorted(objs):
                    obj = objs[key]
                    if output_format == 'xml':
                        _uprint(dest, _pretty_xml(obj.tocimxmlstr()))
                    elif output_format == 'repr':
                        _uprint(dest, _format(u"{0!A}", obj))
                    else:
                        _uprint(dest, obj.tomof())
800053
def structure_dir(self):
        """"""
        if self.root_dir:
            return op.join(self.protein_dir, 'structures')
        else:
            log.debug('Root directory not set')
            return None
677069
private void organizeContent()
    {
        TableRowBox anonrow = null;
        
        for (Iterator<Box> it = nested.iterator(); it.hasNext(); )
        {
            Box box = it.next();
            if (box instanceof ElementBox && ((ElementBox) box).getDisplay() == ElementBox.DISPLAY_TABLE_ROW)
            {
                addRow((TableRowBox) box);
                //finish and add possible previous anonymous row
                if (anonrow != null)
                {
                    anonrow.endChild = anonrow.nested.size();
                    addSubBox(anonrow);
                }
                anonrow = null;
            }
            else
            {
                if (anonrow == null)
                {
                    Element anonelem = viewport.getFactory().createAnonymousElement(getParent().getParent().getElement().getOwnerDocument(), "tr", "table-row"); 
                    anonrow = new TableRowBox(anonelem, g, ctx);
                    anonrow.adoptParent(this);
                    anonrow.setStyle(viewport.getFactory().createAnonymousStyle("table-row"));
                    addRow(anonrow);
                }
                anonrow.addSubBox(box);
                anonrow.isempty = false;
                box.setContainingBlockBox(anonrow);
                box.setParent(anonrow);
                it.remove();
                endChild--;
            }
        }
        if (anonrow != null)
        {
            anonrow.endChild = anonrow.nested.size();
            addSubBox(anonrow);
        }
    }
555627
protected function define_instance_plugin_structure() {

        // Append data only if the ancestor 'definition' element has 'method' set to 'guide'.
        $plugin = $this->get_plugin_element(null, '../../../../method', 'guide');

        // Create a visible container for our data.
        $pluginwrapper = new backup_nested_element($this->get_recommended_name());

        // Connect our visible container to the parent.
        $plugin->add_child($pluginwrapper);

        // Define our elements.

        $fillings = new backup_nested_element('fillings');

        $filling = new backup_nested_element('filling', array('id'), array(
            'criterionid', 'remark', 'remarkformat', 'score'));

        // Build elements hierarchy.

        $pluginwrapper->add_child($fillings);
        $fillings->add_child($filling);

        // Set sources to populate the data.

        $filling->set_source_table('gradingform_guide_fillings',
            array('instanceid' => backup::VAR_PARENTID));

        // No need to annotate ids or files yet (one day when remark field supports
        // embedded fileds, they must be annotated here).

        return $plugin;
    }
299145
def view_properties field=@form.get_current_field
    alert "Nil field" unless field
    return unless field
    text = ["Instance Variables"]
    text << "------------------"
    #iv = field.instance_variables.map do |v| v.to_s; end
    field.instance_variables.each do |v|
      val = field.instance_variable_get(v)
      klass = val.class
      if val.is_a? Array 
        val = val.size
      elsif val.is_a? Hash
        val = val.keys
      end
      case val
      when String, Integer, TrueClass, FalseClass, NilClass, Array, Hash, Symbol
        ;
      else
        val = "Not shown"
      end
      text << "%20s  %10s  %s" % [v, klass, val]
    end
    text << " "
    text << "Public Methods"
    text << "--------------"
    pm = field.public_methods(false).map do |v| v.to_s; end
    text +=  pm
    text << " "
    text << "Inherited Methods"
    text << "-----------------"
    pm = field.public_methods(true) - field.public_methods(false)
    pm = pm.map do |v| v.to_s; end
    text +=  pm

    #$log.debug "  view_properties #{s.size} , #{s} "
    textdialog text, :title => "Properties"
  end
660326
public static void showPreviewForResource(final CmsUUID structureId) {

        CmsRpcAction<CmsPreviewInfo> previewAction = new CmsRpcAction<CmsPreviewInfo>() {

            @Override
            public void execute() {

                CmsCoreProvider.getVfsService().getPreviewInfo(structureId, CmsCoreProvider.get().getLocale(), this);
                start(0, true);
            }

            @Override
            protected void onResponse(CmsPreviewInfo result) {

                stop(false);
                showPreviewForResource(result);
            }
        };
        previewAction.execute();
    }