Search in sources :

Example 11 with BaseTreeNode

use of com.revolsys.swing.tree.BaseTreeNode in project com.revolsys.open by revolsys.

the class LayerGroupTreeNode method loadChildrenDo.

@Override
protected List<BaseTreeNode> loadChildrenDo() {
    final List<BaseTreeNode> children = new ArrayList<>();
    final LayerGroup group = getGroup();
    for (final Layer child : group) {
        final BaseTreeNode childNode = newTreeNode(child);
        children.add(childNode);
    }
    return children;
}
Also used : ArrayList(java.util.ArrayList) BaseTreeNode(com.revolsys.swing.tree.BaseTreeNode) LayerGroup(com.revolsys.swing.map.layer.LayerGroup) Layer(com.revolsys.swing.map.layer.Layer) AbstractLayer(com.revolsys.swing.map.layer.AbstractLayer)

Example 12 with BaseTreeNode

use of com.revolsys.swing.tree.BaseTreeNode in project com.revolsys.open by revolsys.

the class PathRecordStoreTreeNode method loadChildrenDo.

@Override
protected List<BaseTreeNode> loadChildrenDo() {
    final RecordStore recordStore = getRecordStore();
    if (recordStore != null) {
        final RecordStoreSchema schema = recordStore.getRootSchema();
        if (schema != null) {
            schema.refresh();
            final List<BaseTreeNode> children = new ArrayList<>();
            for (final RecordStoreSchemaElement element : schema.getElements()) {
                final BaseTreeNode node = BaseTreeNode.newTreeNode(element);
                children.add(node);
            }
            return children;
        }
    }
    return Collections.emptyList();
}
Also used : RecordStoreSchema(com.revolsys.record.schema.RecordStoreSchema) RecordStore(com.revolsys.record.schema.RecordStore) ArrayList(java.util.ArrayList) BaseTreeNode(com.revolsys.swing.tree.BaseTreeNode) RecordStoreSchemaElement(com.revolsys.record.schema.RecordStoreSchemaElement)

Example 13 with BaseTreeNode

use of com.revolsys.swing.tree.BaseTreeNode in project com.revolsys.open by revolsys.

the class PathRecordStoreTreeNode method getRecordStoreConnectionMap.

@Override
public Map<String, Object> getRecordStoreConnectionMap() {
    final BaseTreeNode parent = getParent();
    final Path path = getPath();
    final URL url = getUrl(parent, path);
    return Collections.<String, Object>singletonMap("url", url.toString());
}
Also used : Path(java.nio.file.Path) BaseTreeNode(com.revolsys.swing.tree.BaseTreeNode) URL(java.net.URL)

Example 14 with BaseTreeNode

use of com.revolsys.swing.tree.BaseTreeNode in project com.revolsys.open by revolsys.

the class MultipleLayerRenderer method addRendererEdit.

default void addRendererEdit(final C renderer) {
    addRenderer(-1, renderer);
    final Object item = MenuFactory.getMenuSource();
    if (item instanceof BaseTreeNode) {
        final BaseTreeNode node = (BaseTreeNode) item;
        final BaseTree tree = node.getTree();
        if (tree.isPropertyEqual("treeType", Project.class.getName())) {
            final Layer layer = renderer.getLayer();
            layer.showRendererProperties(renderer);
        }
    }
}
Also used : BaseTree(com.revolsys.swing.tree.BaseTree) BaseTreeNode(com.revolsys.swing.tree.BaseTreeNode)

Example 15 with BaseTreeNode

use of com.revolsys.swing.tree.BaseTreeNode in project com.revolsys.open by revolsys.

the class ProjectFrame method getTreeNode.

public BaseTreeNode getTreeNode(final Layer layer) {
    final List<Layer> layerPath = layer.getPathList();
    final TreePath treePath = this.tocTree.getTreePath(layerPath);
    if (treePath == null) {
        return null;
    } else {
        return (BaseTreeNode) treePath.getLastPathComponent();
    }
}
Also used : TreePath(javax.swing.tree.TreePath) BaseTreeNode(com.revolsys.swing.tree.BaseTreeNode) Layer(com.revolsys.swing.map.layer.Layer)

Aggregations

BaseTreeNode (com.revolsys.swing.tree.BaseTreeNode)27 LayerGroup (com.revolsys.swing.map.layer.LayerGroup)5 ArrayList (java.util.ArrayList)5 AbstractLayer (com.revolsys.swing.map.layer.AbstractLayer)4 Layer (com.revolsys.swing.map.layer.Layer)4 TreePath (javax.swing.tree.TreePath)4 Component (java.awt.Component)3 Path (java.nio.file.Path)3 JComponent (javax.swing.JComponent)3 RecordStore (com.revolsys.record.schema.RecordStore)2 RecordStoreSchemaElement (com.revolsys.record.schema.RecordStoreSchemaElement)2 BaseTree (com.revolsys.swing.tree.BaseTree)2 JTree (javax.swing.JTree)2 PathName (com.revolsys.io.PathName)1 FileConnectionManager (com.revolsys.io.file.FileConnectionManager)1 RecordStoreConnectionManager (com.revolsys.record.io.RecordStoreConnectionManager)1 RecordStoreSchema (com.revolsys.record.schema.RecordStoreSchema)1 TabbedPane (com.revolsys.swing.TabbedPane)1 DnDTabbedPane (com.revolsys.swing.component.DnDTabbedPane)1 Project (com.revolsys.swing.map.layer.Project)1