/** * First {@link #add(MultipleCDockable) adds} <code>dockable</code> to the * {@link CControl} of this {@link CWorkingArea}, then makes it visible at a good position. A good position * is {@link CLocation#aside()} the latest focused {@link Dockable} that is child of this station. <br> * This method does <b>not</b> force a focus transfer, clients need to call {@link AbstractCDockable#toFront()} * if the require a focus switch to <code>dockable</code>. * @param dockable the element to show * @return <code>dockable</code> */ public <F extends MultipleCDockable> F show( F dockable ){ add( dockable ); dockable.setLocationsAsideFocused(); dockable.setVisible( true ); return dockable; }
/** * First {@link #add(MultipleCDockable) adds} <code>dockable</code> to the * {@link CControl} of this {@link CWorkingArea}, then makes it visible at a good position. A good position * is {@link CLocation#aside()} the latest focused {@link Dockable} that is child of this station. <br> * This method does <b>not</b> force a focus transfer, clients need to call {@link AbstractCDockable#toFront()} * if the require a focus switch to <code>dockable</code>. * @param dockable the element to show * @return <code>dockable</code> */ public <F extends MultipleCDockable> F show( F dockable ){ add( dockable ); dockable.setLocationsAsideFocused(); dockable.setVisible( true ); return dockable; }
/** * First {@link #add(SingleCDockable) adds} <code>dockable</code> to the * {@link CControl} of this {@link CWorkingArea}, then makes it visible at a good position. A good position * is {@link CLocation#aside()} the latest focused {@link Dockable} that is child of this station.<br> * This method does <b>not</b> force a focus transfer, clients need to call {@link AbstractCDockable#toFront()} * if the require a focus switch to <code>dockable</code>. * @param dockable the element to show * @return <code>dockable</code> */ public <F extends SingleCDockable> F show( F dockable ){ add( dockable ); dockable.setLocationsAsideFocused(); dockable.setVisible( true ); return dockable; }
/** * First {@link #add(SingleCDockable) adds} <code>dockable</code> to the * {@link CControl} of this {@link CWorkingArea}, then makes it visible at a good position. A good position * is {@link CLocation#aside()} the latest focused {@link Dockable} that is child of this station.<br> * This method does <b>not</b> force a focus transfer, clients need to call {@link AbstractCDockable#toFront()} * if the require a focus switch to <code>dockable</code>. * @param dockable the element to show * @return <code>dockable</code> */ public <F extends SingleCDockable> F show( F dockable ){ add( dockable ); dockable.setLocationsAsideFocused(); dockable.setVisible( true ); return dockable; }
public void showDockable() { GuiExecutor.instance().execute(() -> { if (!dockable.isVisible()) { if (!UIManager.VIEWER_PLUGINS.contains(ViewerPlugin.this)) { UIManager.VIEWER_PLUGINS.add(ViewerPlugin.this); } dockable.add(getComponent()); dockable.setFocusComponent(ViewerPlugin.this); UIManager.MAIN_AREA.add(getDockable()); dockable.setDefaultLocation(ExtendedMode.NORMALIZED, CLocation.working(UIManager.MAIN_AREA).stack()); dockable.setVisible(true); } }); }
/** * Shows a view at the given location as child * of <code>root</code>. * @param frame the <code>DockingPanel</code> for which a view should be opened * @return Dockable unique ID */ private String show(DockingPanel frame){ //Create the DockingFrame item if(frame.getDockingParameters().getName().isEmpty()) { //If the dev doesn't define a name on the panel //We set the name as the name of the class frame.getDockingParameters().setName(frame.getClass().getCanonicalName()); } SingleCDockable dockItem = OrbisGISView.createSingle( frame, commonControl ); //Place the item in a dockstation String restrictedAreaName = frame.getDockingParameters().getDockingArea(); if(!restrictedAreaName.isEmpty()) { //This item is restricted to an area DockingArea dockArea = dockingAreas.get(restrictedAreaName); if(dockArea==null) { dockArea = new DockingArea(commonControl.createWorkingArea(restrictedAreaName)); dockArea.getWorkingArea().setVisible(true); dockingAreas.put(restrictedAreaName,dockArea); } dockItem.setWorkingArea(dockArea.getWorkingArea()); dockArea.getWorkingArea().add(dockItem); } commonControl.addDockable(dockItem); return dockItem.getUniqueId(); }