public void geoElementSelected(GeoElement geo, boolean addToSelection) { if (geo == null) return; tempArrayList.clear(); tempArrayList.add(geo); geoTree.setSelected(tempArrayList, addToSelection); // requestFocus(); }
/** shows this dialog and select GeoElement geo at screen position location */ public void setVisibleWithGeos(ArrayList<GeoElement> geos) { kernel.clearJustCreatedGeosInViews(); setViewActive(true); if (kernel.getConstruction().getGeoSetConstructionOrder().size() < MAX_GEOS_FOR_EXPAND_ALL) geoTree.expandAll(); else geoTree.collapseAll(); geoTree.setSelected(geos, false); if (!isShowing()) { // pack and center on first showing if (firstTime) { pack(); setLocationRelativeTo(app.getMainComponent()); firstTime = false; } // ensure min size Dimension dim = getSize(); if (dim.width < MIN_WIDTH) { dim.width = MIN_WIDTH; setSize(dim); } if (dim.height < MIN_HEIGHT) { dim.height = MIN_HEIGHT; setSize(dim); } super.setVisible(true); } }