@Override public CWorkingPerspective createPerspective(){ return new CWorkingPerspective( getUniqueId(), getTypeId() ); }
/** * Creates a new area. * @param control the owner of this station * @param uniqueId a unique identifier */ public CWorkingArea( CControl control, String uniqueId ){ super( control, uniqueId ); setMaximizingArea( false ); }
/** * 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; }
/** * 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(); }
UIManager.MAIN_AREA.getComponent().setTransferHandler(new SequenceHandler()); UIManager.MAIN_AREA.setLocation(CLocation.base().normalRectangle(0, 0, 1, 1)); UIManager.MAIN_AREA.setVisible(true);
public static void showHeaderDialog(SeriesViewer<?> container, MediaSeries<? extends MediaElement> series, MediaElement dcm) { if (container != null && series != null && dcm != null) { JFrame frame = new JFrame(Messages.getString("DicomExplorer.dcmInfo")); //$NON-NLS-1$ frame.setSize(500, 630); DicomFieldsView view = new DicomFieldsView(container); view.changingViewContentEvent(new SeriesViewerEvent(container, series, dcm, EVENT.SELECT)); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(view); frame.getContentPane().add(panel); frame.setAlwaysOnTop(true); frame.setIconImage( new ImageIcon(ImageViewerPlugin.class.getResource("/icon/32x32/dcm-header.png")).getImage()); //$NON-NLS-1$ Component c = container instanceof Component ? (Component) container : UIManager.MAIN_AREA.getComponent(); JMVUtils.showCenterScreen(frame, c); } }
/** * Ensures that <code>this</code> is the parent of <code>dockable</code> * and adds <code>dockable</code> to the {@link CControl} which is associated * with this {@link CWorkingArea}. If there is no <code>CControl</code>, then * the <code>dockable</code> is added nowhere. * @param <F> the type of element to add * @param dockable the new element * @return <code>dockable</code> */ public <F extends SingleCDockable> F add( F dockable ){ dockable.setWorkingArea( this ); CControlAccess access = control(); if( access != null ){ access.getOwner().addDockable( dockable ); } return dockable; }
/** * Creates and adds a new {@link CWorkingArea} to this control. The area * is not made visible by this method. * @param uniqueId the unique id of the area * @return the new area */ public CWorkingArea createWorkingArea( String uniqueId ){ CWorkingArea area = new CWorkingArea( this, uniqueId ); addDockable( area ); addStation( area, true ); return area; }
@Override public String findRoot() { return area.getUniqueId(); }
/** * Exchanges all the {@link CDockable}s on this area with the * elements of <code>grid</code>. This method also calls * {@link CDockable#setWorkingArea(CStation)} for each * dockable in <code>grid</code>. * @param grid a grid containing some new {@link Dockable}s */ public void deploy( CGrid grid ){ DockableSplitDockTree tree = grid.toTree(); for( Dockable dockable : tree.getDockables() ){ if( dockable instanceof CommonDockable ){ CommonDockable cdock = (CommonDockable)dockable; cdock.getDockable().setWorkingArea( this ); } } getStation().dropTree( tree ); }
/** * 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 AcquireExplorer() { super(BUTTON_NAME, TOOL_NAME, POSITION.WEST, ExtendedMode.NORMALIZED, PluginTool.Type.EXPLORER, 20); setDockableWidth(400); JIThumbnailCache thumbCache = new JIThumbnailCache(); centralPane = new ImageGroupPane(Messages.getString("AcquireExplorer.album"), thumbCache); //$NON-NLS-1$ browsePanel = new BrowsePanel(this); acquireThumbnailListPane = new AcquireThumbnailListPane<>(thumbCache); importPanel = new ImportPanel(acquireThumbnailListPane, centralPane); setLayout(new BorderLayout(0, 0)); add(browsePanel, BorderLayout.NORTH); add(acquireThumbnailListPane, BorderLayout.CENTER); add(importPanel, BorderLayout.SOUTH); this.acquireThumbnailListPane.loadDirectory(Paths.get(systemDrive.getID())); // Remove dropping capabilities in the central area (limit to import // from browse panel) UIManager.MAIN_AREA.getComponent().setTransferHandler(null); }
/** * Ensures that <code>this</code> is the parent of <code>dockable</code> * and adds <code>dockable</code> to the {@link CControl} which is associated * with this {@link CWorkingArea}. If there is no <code>CControl</code>, then * the <code>dockable</code> is added nowhere. * @param <F> the type of element to add * @param dockable the new element * @return <code>dockable</code> */ public <F extends MultipleCDockable> F add( F dockable ){ dockable.setWorkingArea( this ); CControlAccess access = control(); if( access != null ){ access.getOwner().addDockable( dockable ); } return dockable; }
/** * Creates and adds a new {@link CWorkingArea} to this control. The area * is not made visible by this method. * @param uniqueId the unique id of the area * @return the new area */ public CWorkingArea createWorkingArea( String uniqueId ){ CWorkingArea area = new CWorkingArea( this, uniqueId ); addDockable( area ); addStation( area, true ); return area; }
@Override public String findRoot() { return area.getUniqueId(); }
/** * Exchanges all the {@link CDockable}s on this area with the * elements of <code>grid</code>. This method also calls * {@link CDockable#setWorkingArea(CStation)} for each * dockable in <code>grid</code>. * @param grid a grid containing some new {@link Dockable}s */ public void deploy( CGrid grid ){ DockableSplitDockTree tree = grid.toTree(); for( Dockable dockable : tree.getDockables() ){ if( dockable instanceof CommonDockable ){ CommonDockable cdock = (CommonDockable)dockable; cdock.getDockable().setWorkingArea( this ); } } getStation().dropTree( tree ); }
/** * 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; }
@Override public CWorkingPerspective createPerspective(){ return new CWorkingPerspective( getUniqueId(), getTypeId() ); }
/** * Ensures that <code>this</code> is the parent of <code>dockable</code> * and adds <code>dockable</code> to the {@link CControl} which is associated * with this {@link CWorkingArea}. If there is no <code>CControl</code>, then * the <code>dockable</code> is added nowhere. * @param <F> the type of element to add * @param dockable the new element * @return <code>dockable</code> */ public <F extends MultipleCDockable> F add( F dockable ){ dockable.setWorkingArea( this ); CControlAccess access = control(); if( access != null ){ access.getOwner().addDockable( dockable ); } return dockable; }
/** * Creates a new area. * @param control the owner of this station * @param uniqueId a unique identifier */ public CWorkingArea( CControl control, String uniqueId ){ super( control, uniqueId ); setMaximizingArea( false ); }