Package java.awt

Examples of java.awt.Container


    toolsBar.add(bBack= JSynopticPanels.resources.getBox("prev", this));
    toolsBar.add(bNext = JSynopticPanels.resources.getBox("next", this));
   
 
    // Create global frame
    Container content = getContentPane();
    content.setLayout(new BorderLayout());
    content.add(toolsBar, BorderLayout.NORTH);
    content.add(scrollPane, BorderLayout.CENTER);
   
    // diplay html page
    try{
      displayPage(sid.getHTMLFile().toURL());
    }catch (MalformedURLException  e){}
View Full Code Here


            }
        }
    }
   
    protected void createContent(){
        Container content = getContentPane();
        content.setLayout(new BorderLayout());

        // Message panel
        headerPanel = new HeaderPanel(true);
        content.add(headerPanel, BorderLayout.NORTH);

        // Inner panel
        inner=  new JPanel(new BorderLayout());

        // Navigation bar
        JPanel navigationBarPanel = new JPanel(new BorderLayout());
        JPanel navigationBar = new JPanel();
        create = resources.getButton("create", this);
        cancel = resources.getButton("cancel", this);
        help = resources.getButton("help", this);
        navigationBar.add(create);
        navigationBar.add(cancel);
        navigationBar.add(help);
        navigationBarPanel.add(navigationBar, BorderLayout.EAST);
        inner.add(navigationBarPanel,BorderLayout.SOUTH);

        inner.setPreferredSize(new Dimension(350,400));//TODO

        content.add(inner, BorderLayout.CENTER);

        // template card panel
        templatesPanels = new JPanel();
        templatesPanels.setLayout(new CardLayout());

        inner.add(templatesPanels, BorderLayout.CENTER);
       
      
        tlist = new JList(new TemplateListModel());
        tlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tlist.setVisibleRowCount(5);
        JScrollPane tlistScrollPane = new JScrollPane(tlist);
        content.add(tlistScrollPane, BorderLayout.WEST);

        tlist.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                create.setEnabled(tlist.getSelectedValue() != null);
            }
View Full Code Here

    setLocationRelativeTo(parent);
    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  }

  protected void createContent(){
    Container content = getContentPane();
    content.setLayout(new BorderLayout());

    // Summary page
    summary = new SummaryPanel();
    content.add(summary, BorderLayout.WEST);

    // Message panel
    headerPanel = new HeaderPanel(true);
    content.add(headerPanel, BorderLayout.NORTH);

    // Inner panel
    inner=  new JPanel(new BorderLayout());

    // Navigation bar
    JPanel navigationBarPanel = new JPanel(new BorderLayout());
    JPanel navigationBar = new JPanel();
    prev = resources.getButton("prev", this);
    next = resources.getButton("next", this);
    finish = resources.getButton("finish", this);
    cancel = resources.getButton("cancel", this);
    help = resources.getButton("help", this);
    navigationBar.add(prev);
    navigationBar.add(next);
    navigationBar.add(finish);
    navigationBar.add(cancel);
    navigationBar.add(help);
    navigationBarPanel.add(navigationBar, BorderLayout.EAST);
    inner.add(navigationBarPanel,BorderLayout.SOUTH);

    // TODO could be improved: set inner panel dimensions
    Dimension pageSize = manager.getMaximumnPageSize();
    Dimension navigationSize = navigationBarPanel.getPreferredSize();
    inner.setPreferredSize(new Dimension(pageSize.width + navigationSize.width, pageSize.height + navigationSize.height));

    content.add(inner, BorderLayout.CENTER);
    displayNewPage();

  }
View Full Code Here

       
        isOk = false;
       
        // Header
        headerPanel = new HeaderPanel();
        Container contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());
        contentPane.add(headerPanel, BorderLayout.NORTH);


        // Color chooser
        dynamicColorChooserPanel = new DynamicColorChooserPanel(
                this,
                preview,
                initialColor,
                ds,
                cm
        );
        contentPane.add(dynamicColorChooserPanel, BorderLayout.CENTER);
 
        // Bottom
        JPanel p = new JPanel();
        p.add(ok = new JButton(resources.getString("OK")));
        p.add(cancel = new JButton(resources.getString("Cancel")));


        ok.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                dispose();
                isOk= true;
            }
        });

        cancel.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });

        contentPane.add(p, BorderLayout.SOUTH);
        pack();
    }
View Full Code Here

        treeModel.reload();

        // Create global frame
        JSplitPane helpSlitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,helpTreePane ,scrollPane);
        helpSlitPane.setDividerLocation(300);
        Container content = getContentPane();
        content.setLayout(new BorderLayout());

        content.add(toolsBar, BorderLayout.NORTH);
        content.add(helpSlitPane, BorderLayout.CENTER);

        // Display first page
        if (rootNode.getChildrenCount() != 0){
            try {
                displayPage( ((HelpNode)rootNode.getChildren().get(0)).getLink() );
View Full Code Here

       
        // Display content warnings on header panel
        content.updateWarnings();
        this.shapes = shapes;
        this.shapeComponent = shapeComponent;
        Container contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());
        contentPane.add(headerPanel, BorderLayout.NORTH);
        contentPane.add(content, BorderLayout.CENTER);
        contentPane.add(createButtonPanel(), BorderLayout.SOUTH);
        if (JDialog.isDefaultLookAndFeelDecorated()) {
            boolean supportsWindowDecorations = UIManager.getLookAndFeel().getSupportsWindowDecorations();
            if (supportsWindowDecorations) {
                setUndecorated(true);
                getRootPane().setWindowDecorationStyle(JRootPane.QUESTION_DIALOG);
View Full Code Here

   
    if (dialog!=null){
      return null
    }
    dialog = new JDialog( parent, resources.getString("plotInformation"), false);
    Container contentPane = dialog.getContentPane();

    JTabbedPane informationPane = new JTabbedPane();
   
      // Hearder panel
        headerPanel = new HeaderPanel();


       
   
    // Statistic tab
    JPanel statistics2  = new JPanel(new BorderLayout());
    JPanel statistics  = new JPanel();
    statistics.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
    statistics.setLayout(new BoxLayout(statistics,BoxLayout.Y_AXIS));
   
    JPanel p1 = new JPanel(new BorderLayout());
    JLabel statTitle = new JLabel(resources.getStringValue("plotStatistics"));
    statTitle.setFont(new Font("Dialog", Font.PLAIN,18));
    p1.add(statTitle, BorderLayout.WEST);
   
    statistics.add(p1);
   
    statistics.add(createGlobalStatisticPanel());   
    statistics.add(createCurveStatisticsPanel());
 
    statistics2.add(statistics, BorderLayout.NORTH);
    informationPane.addTab(resources.getString("plotStatistics"),
            new JScrollPane(statistics2, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ));


    contentPane.add(headerPanel, BorderLayout.NORTH);
    contentPane.add(informationPane, BorderLayout.CENTER);
    contentPane.add(createButtonPanel(), BorderLayout.SOUTH);

    if (JDialog.isDefaultLookAndFeelDecorated()) {
      boolean supportsWindowDecorations =
        UIManager.getLookAndFeel().getSupportsWindowDecorations();
      if (supportsWindowDecorations) {
View Full Code Here

        pack();
        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    }

    protected void createContent(){
        Container content = getContentPane();
        content.setLayout(new BorderLayout());

        // HeaderPanel
        headerPanel = new HeaderPanel(true);
        headerPanel.setTitle(resources.getString("print"));   
        content.add(headerPanel, BorderLayout.NORTH);

        // Inner panel
        GridBagPanel printPanel = new GridBagPanel();
        GridBagPanel printerPanel = new GridBagPanel( resources.getStringValue("printer") );
        GridBagPanel selectionPanel = new GridBagPanel( resources.getStringValue("selection") );
        GridBagPanel copiesPanel = new GridBagPanel(resources.getStringValue("copies") );
        GridBagPanel paperSizePanel = new GridBagPanel( resources.getStringValue("paperSize"));
        GridBagPanel paperOrientationPanel = new GridBagPanel( resources.getStringValue("paperOrientation"));
       
        // printer
        printerList = new JComboBox(printServices);
        printerPropertiesButton = resources.getButton("propertiesButton", this);
       
       
        // TODO fix the bug when editing printer properties  on Linux OS
        printerPropertiesButton.setEnabled(false);
       
       
        printerList.addActionListener(this);
        JLabel lname  = resources.getLabel("name");
    
        printerPanel.addOnCurrentRow(lname);
        printerPanel.addOnCurrentRow(printerList, 2);
        printerPanel.addOnCurrentRow(printerPropertiesButton);
        printerPanel.carriageReturn();
       
        // Selection
        printAllButton = resources.getRadioButton("printAll", null);
        printSelectedButton = resources.getRadioButton("printSelected", null);
        ButtonGroup printButtonGroup = new ButtonGroup();
        printButtonGroup.add(printAllButton);
        printButtonGroup.add(printSelectedButton);

        selectionPanel.addOnCurrentRow(printAllButton);
        selectionPanel.carriageReturn();
        selectionPanel.addOnCurrentRow(printSelectedButton);
        selectionPanel.carriageReturn();


        // Number of copies    
        JLabel lnbCopies = resources.getLabel("nbCopies");
        SpinnerNumberModel spiNbCopies = new SpinnerNumberModel();

        spiNbCopies.setStepSize(new Integer(1));
        spiNbCopies.setMinimum(new Integer(1));
        spiNbCopies.setMaximum(new Integer(100));
        spiNbCopies.setValue(new Integer(1));
        nbCopies = new JSpinner(spiNbCopies);

        copiesPanel.addOnCurrentRow(lnbCopies);
        copiesPanel.addOnCurrentRow(nbCopies, 1, true, false, true);
        copiesPanel.carriageReturn();


        // Paper size     
        paperNameList = new JComboBox(paperNames);
        paperNameList.setSelectedIndex(0);
       
        JLabel lpaper =  resources.getLabel("paper");
        paperSizePanel.addOnCurrentRow(lpaper);
        paperSizePanel.addOnCurrentRow(paperNameList,1, true, false, true);
        paperSizePanel.addOnCurrentRow( cbzoom = resources.getCheckBox("updateToPaper", null), 2, false, false, true);
        cbzoom.setSelected(true);
       
       
        // Orientation
        portraitButton = resources.getRadioButton("portraitOrientation", null);
        landscapeButton = resources.getRadioButton("landscapeOrientation", null);
        reverseLandscapeButton = resources.getRadioButton("reverseLandscapeOrientation", null);

        ButtonGroup paperOrientationGroup = new ButtonGroup();
        paperOrientationGroup.add(portraitButton);
        paperOrientationGroup.add(landscapeButton);
        paperOrientationGroup.add(reverseLandscapeButton);
        portraitButton.setSelected(true);
        landscapeButton.setSelected(false);
        reverseLandscapeButton.setSelected(false);
       
        paperOrientationPanel.addOnCurrentRow(portraitButton);
        paperOrientationPanel.carriageReturn();
        paperOrientationPanel.addOnCurrentRow(landscapeButton);
        paperOrientationPanel.carriageReturn();
        paperOrientationPanel.addOnCurrentRow(reverseLandscapeButton);
        paperOrientationPanel.carriageReturn();


        // Add all panels
        printPanel.addOnCurrentRow(printerPanel, 4, true, true, true);
        printPanel.addOnCurrentRow(selectionPanel, 2, true, true, false);
        printPanel.addOnCurrentRow(copiesPanel, 2, true, true, true);
        printPanel.addOnCurrentRow(paperSizePanel, 1, true, true, false);
        printPanel.addOnCurrentRow(paperOrientationPanel, 1, true, true, true);
        printPanel.addOnCurrentRow( cbbackground = resources.getCheckBox("printBackground", null), 2, false, false, true);
        cbbackground.setSelected(false);
       
        content.add(printPanel, BorderLayout.CENTER);
       
        // Buttons
        JPanel navigationBarPanel = new JPanel(new BorderLayout());
        JPanel navigationBar = new JPanel();
        closeButton = resources.getButton("closeButton", this);
        okButton = resources.getButton("okButton", this)
        navigationBar.add(okButton);
        navigationBar.add(closeButton);
        navigationBarPanel.add(navigationBar, BorderLayout.EAST);
        content.add(navigationBarPanel,BorderLayout.SOUTH);
    }
View Full Code Here

        protected void doAction() {
          ChartPropertyEditPanel panel = new ChartPropertyEditPanel(chart);
          JTabbedPane tab = findTab(panel);
          XYPlot plot = (XYPlot)chart.getXYPlot();
          PlotPanel plotPanel = new PlotPanel();
          Container c = (Container)plotPanel.getComponent(0);
          Box b = Box.createHorizontalBox();
          b.add(new JLabel(resources.getString("TransparencyCoefficient")));
          NumberField nfalpha;
          b.add(Box.createHorizontalGlue());
          b.add(nfalpha = new NumberField(plot.getForegroundAlpha()));
          c.add(b);
          b = Box.createHorizontalBox();
          JCheckBox cbDrawContour;
          b.add(cbDrawContour = new JCheckBox(resources.getString("OutlineEachSegment"), ((JSynopticAreaXYItemRenderer)plot.getRenderer()).isOutline()));
          b.add(Box.createHorizontalGlue());
          c.add(b);
          if (tab!=null) tab.add(plotPanel,0);
          int result = JOptionPane.showConfirmDialog(null, panel,
            resources.getString("ChartProperties"), JOptionPane.OK_CANCEL_OPTION,
            JOptionPane.PLAIN_MESSAGE);
          if (result == JOptionPane.OK_OPTION) {
View Full Code Here

     *
     * @param newMode the new implementation of DesktopCardPanelMode
     */
    protected void setDesktopCardPanelMode(DesktopCardPanelMode newMode) {
        if (_desktopCardPanelMode != null) {
            Container contentPane = _desktopCardPanelMode.getContentPane();
            if (contentPane != null) {
                remove(contentPane);
            }
        }
        Container newContentPane = newMode.getContentPane();
        if (newContentPane != null) {
            add(BorderLayout.CENTER, newContentPane);
        }
        validate();
        for (int i = 0; i < _components.size(); i++) {
View Full Code Here

TOP

Related Classes of java.awt.Container

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.