/*
 * Created on 22.10.2005
 */
package net.sourceforge.ganttproject;

import java.awt.BorderLayout;
import java.awt.Component;

import javax.swing.Box;
import javax.swing.JPanel;

import net.sourceforge.ganttproject.gui.ResourceTreeUIFacade;
import net.sourceforge.ganttproject.gui.TestGanttRolloverButton;

class ResourceChartTabContentPanel {
    private ResourceTreeUIFacade myTreeFacade;
    private Component myResourceChart;
    private JPanel myTabContentPanel;

    ResourceChartTabContentPanel(ResourceTreeUIFacade resourceTree, Component resourceChart) {
        myTreeFacade = resourceTree;
        myResourceChart = resourceChart;
    }
    
    Component getComponent() {
        myTabContentPanel = new JPanel(new BorderLayout());
        Component buttonPanel = createButtonPanel();
        myTabContentPanel.add(buttonPanel, BorderLayout.NORTH);
        myTabContentPanel.add(myTreeFacade.getUIComponent(), BorderLayout.CENTER);
        return myTabContentPanel;
    }

    private Component createButtonPanel() {
        Box buttonBar = Box.createHorizontalBox();
        TestGanttRolloverButton upButton = new TestGanttRolloverButton(myTreeFacade.getMoveUpAction());
        upButton.setTextHidden(true);
        buttonBar.add(upButton);
        //
        TestGanttRolloverButton downButton = new TestGanttRolloverButton(myTreeFacade.getMoveDownAction());
        downButton.setTextHidden(true);
        buttonBar.add(downButton);
        //
        JPanel buttonPanel = new JPanel(new BorderLayout());
        buttonPanel.add(buttonBar, BorderLayout.WEST);
        return buttonPanel;
    }
}
