Changeset 10735

Show
Ignore:
Timestamp:
05/30/11 13:15:50 (3 years ago)
Author:
Snyder.Jason
Message:

updated the waveform editor to use sash forms so the four main panels can be resized

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/trunk/tools/OEF/src/edu/vt/ossie/editors/OWDEditor.java

    r10559 r10735  
    3939import org.eclipse.jface.viewers.TreeViewer; 
    4040import org.eclipse.swt.SWT; 
     41import org.eclipse.swt.custom.SashForm; 
    4142import org.eclipse.swt.custom.ScrolledComposite; 
    4243import org.eclipse.swt.dnd.DropTargetEvent; 
     
    137138        scroller.setExpandHorizontal(true); 
    138139        scroller.setExpandVertical(true); 
    139         mainWindow = new Composite(scroller, SWT.NONE); 
    140         mainWindow.setLayout(new GridLayout(2, false)); 
    141  
    142         Label resourcesLabel = new Label(mainWindow, SWT.NONE); 
     140        mainWindow = new SashForm(scroller, SWT.HORIZONTAL); 
     141 
     142        mainWindowLeft = new Composite(mainWindow, SWT.BORDER); 
     143        mainWindowLeft.setLayout(new GridLayout(1, true)); 
     144        Label resourcesLabel = new Label(mainWindowLeft, SWT.CENTER); 
    143145        resourcesLabel.setText("Available Resources"); 
     146         
    144147        //resourcesLabel.setBounds(15, 48, 140, 17); 
    145148        resourcesLabel.setLayoutData( 
    146149            new GridData(SWT.CENTER, SWT.BOTTOM, true, false)); 
    147  
    148         Label waveformLabel = new Label(mainWindow, SWT.NONE); 
     150        createResourcesTree(mainWindowLeft); 
     151         
     152        mainWindowRight = new SashForm(mainWindow, SWT.VERTICAL); 
     153         
     154        mainWindowRightTop = new Composite(mainWindowRight, SWT.BORDER); 
     155        mainWindowRightTop.setLayout(new GridLayout(1, true)); 
     156        Label waveformLabel = new Label(mainWindowRightTop, SWT.CENTER); 
    149157        waveformLabel.setText("Waveform"); 
    150158        //waveformLabel.setBounds(445, 7, 77, 23); 
     
    152160            new GridData(SWT.CENTER, SWT.BOTTOM, true, false)); 
    153161 
    154         createResourcesTree(mainWindow); 
    155         createWaveformTree(mainWindow); 
    156  
    157         Label platformLabel = new Label(mainWindow, SWT.NONE); 
     162         
     163        createWaveformTree(mainWindowRightTop); 
     164         
     165        mainWindowRightBottom = new Composite(mainWindowRight, SWT.BORDER); 
     166        mainWindowRightBottom.setLayout(new GridLayout(1, true)); 
     167 
     168        Label platformLabel = new Label(mainWindowRightBottom, SWT.CENTER); 
    158169        platformLabel.setText("Platform"); 
    159170        platformLabel.setLayoutData( 
    160171            new GridData(SWT.CENTER, SWT.BOTTOM, true, false)); 
    161172 
    162         createPlatformTree(mainWindow); 
    163  
    164         mainWindow.setSize(mainWindow.computeSize(SWT.DEFAULT, SWT.DEFAULT)); 
     173        createPlatformTree(mainWindowRightBottom); 
     174 
     175        //mainWindow.setSize(mainWindow.computeSize(SWT.DEFAULT, SWT.DEFAULT)); 
    165176        parent.setSize(parent.computeSize(SWT.DEFAULT, SWT.DEFAULT)); 
    166177 
    167         scroller.setMinSize(mainWindow.computeSize(SWT.DEFAULT, SWT.DEFAULT)); 
     178        //scroller.setMinSize(mainWindow.computeSize(SWT.DEFAULT, SWT.DEFAULT)); 
    168179        scroller.setContent(mainWindow); 
    169180 
     
    754765    { 
    755766        Tree resourcesTree = new Tree(parent, SWT.MULTI | SWT.BORDER); 
    756         GridData data = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 3); 
     767        GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); 
    757768        data.minimumHeight = 200; 
    758769        data.minimumWidth = 200; 
     
    16181629        } 
    16191630    } 
     1631     
     1632    public boolean isConnectedToFile() 
     1633    { 
     1634        return getEditorInput() instanceof IFileEditorInput; 
     1635    } 
     1636  
     1637    // ---------------------------------------------------------- 
     1638    public IFileEditorInput getFileInput() 
     1639    { 
     1640        return isConnectedToFile() 
     1641            ? (IFileEditorInput)getEditorInput() 
     1642            : null; 
     1643    } 
    16201644 
    16211645 
     
    21052129    protected ResourceTreeViewer waveformTreeViewer; 
    21062130    protected ResourceTreeViewer platformTreeViewer; 
    2107     private Composite mainWindow; 
     2131    private SashForm mainWindow; 
     2132    private Composite mainWindowLeft; 
     2133    private SashForm mainWindowRight; 
     2134    private Composite mainWindowRightTop; 
     2135    private Composite mainWindowRightBottom; 
    21082136 
    21092137    private MainFrame  mainFrame;