Package javax.swing

Examples of javax.swing.Box


          new PrefOption(AppPreferences.SHAPE_RECTANGULAR,
              Strings.getter("shapeRectangular")),
          new PrefOption(AppPreferences.SHAPE_DIN40700,
              Strings.getter("shapeDIN40700")) });
   
    Box localePanel = new Box(BoxLayout.X_AXIS);
    localePanel.add(Box.createGlue());
    localePanel.add(localeLabel);
    localeLabel.setMaximumSize(localeLabel.getPreferredSize());
    localeLabel.setAlignmentY(Component.TOP_ALIGNMENT);
    localePanel.add(locale);
    locale.setAlignmentY(Component.TOP_ALIGNMENT);
    localePanel.add(Box.createGlue());
   
    JPanel shapePanel = new JPanel();
    shapePanel.add(gateShape.getJLabel());
    shapePanel.add(gateShape.getJComboBox());
   
View Full Code Here


      addGb(new JScrollPane(list));
      gbc.fill = GridBagConstraints.NONE;
     
      gbc.gridy++;
      addGb(new JLabel(Strings.get("labelImageFormat") + " "));
      Box formatsPanel = new Box(BoxLayout.Y_AXIS);
      formatsPanel.add(formatPng);
      formatsPanel.add(formatGif);
      formatsPanel.add(formatJpg);
      addGb(formatsPanel);
     
      gbc.gridy++;
      addGb(new JLabel(Strings.get("labelScale") + " "));
      addGb(slider);
View Full Code Here

    hl.setLabelFor( htf );
    htf.addActionListener( clqh );
    box.add( Box.createHorizontalStrut( 20 ) );


    Box vbox = Box.createVerticalBox();
    cl = new JLabel( "Actual cache size", JLabel.CENTER );
    cl.setAlignmentX( Component.CENTER_ALIGNMENT );
    vbox.add( cl );

    js = new JSlider( JSlider.HORIZONTAL, 0, q * ( 1 << h ), cache );
    js.setMajorTickSpacing( 10 );
    js.setMinorTickSpacing( 1 );
    js.setPaintTicks( true );
    js.setPaintLabels( true );
    js.setBorder( BorderFactory.createEmptyBorder( 0, 0, 10, 0) );
    js.addChangeListener( new ChangeListener() {
        public void stateChanged( ChangeEvent e ) {
          JSlider source = (JSlider)e.getSource();
          //  if ( source.getValueIsAdjusting() ) return;
          try {
            int q, h, cache;
            q = Integer.parseInt( qtf.getText() );
            h = Integer.parseInt( htf.getText() );
            cache = source.getValue();
            dp.setValues( q, h, cache );
            dp.repaint();
          } catch ( Exception exc ) {
            JOptionPane.showMessageDialog( null, exc.getMessage(), "Alert", JOptionPane.ERROR_MESSAGE );
          }
        }
      });
    cl.setLabelFor( js );
    vbox.add( js );

    box.add( vbox );

    add( box );
    dp.setValues( q, h, cache );
View Full Code Here

        JButton btNextYr = ComponentFactory.getIconButton(IconLibrary._icoArrowDown);
        btNextYr.setToolTipText(DcResources.getText("lblNextYear"));
        btNextYr.addActionListener(this);
        btNextYr.setActionCommand("nextYear");

        Box box = new Box(BoxLayout.X_AXIS);
        box.add(btPreviousMt);
        box.add(Box.createHorizontalStrut(3));
        box.add(btNextMt);
        add(box, BorderLayout.WEST);
       
        box = new Box(BoxLayout.X_AXIS);
        box.add(btPreviousYr);
        box.add(Box.createHorizontalStrut(3));
        box.add(btNextYr);       
        add(box, BorderLayout.EAST);
       
        setCurrentMonth(parent.getCalendar());
    }
View Full Code Here

    public void setCurrentMonth(Calendar c) {
        setMonthComboBox(c);
        setYearComboBox(c);
       
        if(box == null) {
            box = new Box(BoxLayout.X_AXIS);
            box.add(monthBox);
            box.add(yearBox);
            add(box,BorderLayout.CENTER);
        }
    }
View Full Code Here

     * @return String The key for this tool.
     */
    public Container getFace() {
        JPanel jtb = new JPanel();

        Box bigBox = Box.createHorizontalBox();
        Box rightBox = Box.createVerticalBox();
        Box leftBox = Box.createVerticalBox();
        Box innerBox = Box.createHorizontalBox();

        try {
            URL url = PropUtils.getResourceOrFileOrURL(this, snapshotIconName);
            ImageIcon snapshotIcon = new ImageIcon(url);

            url = PropUtils.getResourceOrFileOrURL(this, totalScenarioIconName);
            ImageIcon totalScenarioIcon = new ImageIcon(url);

            timeWrapToggle = new JToggleButton(totalScenarioIcon, timeWrap);
            timeWrapToggle.setSelectedIcon(snapshotIcon);
            timeWrapToggle.setActionCommand(SCENARIO_MODE_CMD);
            timeWrapToggle.addActionListener(this);
            timeWrapToggle.setToolTipText("Wrap Scenario Time Scale");
            // jtb.add(timeWrapToggle);
            innerBox.add(timeWrapToggle);

        } catch (MalformedURLException murle) {
            Debug.error("ScenarioGraphicLoader " + getName() + ":"
                    + murle.getMessage());
        } catch (NullPointerException npe) {
            Debug.error("ScenarioGraphicLoader " + getName() + ":"
                    + npe.getMessage());
        }

        timerControl = new TimerControlButtonPanel(this);
        // jtb.add(timerControl);
        innerBox.add(timerControl);
        rightBox.add(innerBox);

        pcs.addPropertyChangeListener(TIMER_RUNNING_STATUS, timerControl);

        String runningStatus = timer.isRunning() ? (getClockDirection() > 0 ? TIMER_FORWARD
View Full Code Here

    public JComponent getTransparancyAdjustment(int initialValue) {
        transparency = initialValue;
        // This sets initial transparency effect in preview...
        setPreviewColor(preview.getColor());
        JPanel slidePanel = new JPanel();
        Box slideBox = Box.createHorizontalBox();

        JSlider opaqueSlide = new JSlider(JSlider.HORIZONTAL, 0/* min */, 255/* max */, initialValue/* inital */);
        java.util.Hashtable dict = new java.util.Hashtable();
        String opaqueLabel = i18n.get(ColorTracker.class, "opaque", "opaque");
        String clearLabel = i18n.get(ColorTracker.class, "clear", "clear");
        if (opaqueLabel == null || opaqueLabel.length() == 0) {
            // translations are too long :(
            dict.put(new Integer(126), new JLabel(clearLabel));           
        } else {       
            dict.put(new Integer(50), new JLabel(clearLabel));
            dict.put(new Integer(200), new JLabel(opaqueLabel));
        }
        //commented because polish translations are too long
        opaqueSlide.setLabelTable(dict);
        opaqueSlide.setPaintLabels(true);
        opaqueSlide.setMajorTickSpacing(50);
        opaqueSlide.setPaintTicks(true);
        opaqueSlide.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent ce) {
                JSlider slider = (JSlider) ce.getSource();
                if (slider.getValueIsAdjusting()) {
                    transparency = slider.getValue();
                }
                // This sets transparency in preview...
                setPreviewColor(preview.getColor());
            }
        });

        preview.setPreferredSize(new Dimension(100, slideBox.getHeight()));
        slideBox.add(preview);
        slideBox.add(Box.createGlue());
        slideBox.add(opaqueSlide);
        slideBox.add(Box.createGlue());
        slidePanel.add(slideBox);
        // You know what, it just has to be something, so the
        // UIManager will think it's valid. It will get resized as
        // appropriate when the JDialog gets packed.
        slidePanel.setSize(new Dimension(50, 50));
View Full Code Here

        if (palette == null) {
            if (Debug.debugging("etopo"))
                Debug.output("ETOPOLayer: creating ETOPO Palette.");

            palette = Box.createVerticalBox();
            Box subbox0 = Box.createHorizontalBox();
            Box subbox1 = Box.createHorizontalBox();
            Box subbox2 = Box.createVerticalBox();
            Box subbox3 = Box.createHorizontalBox();

            // The ETOPO resolution selector
            JPanel resPanel = PaletteHelper.createPaletteJPanel("Lat/Lon Spacing");
            String[] resStrings = { "2 Minute", "5 Minute", "10 Minute",
                    "15 Minute" }; // ep-g

            JComboBox resList = new JComboBox(resStrings);
            resList.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JComboBox jcb = (JComboBox) e.getSource();
                    int newRes = jcb.getSelectedIndex();
                    int curRes = minuteSpacing / 5; // ep-g
                    if (curRes != newRes)
                        spacingReset = true;
                    switch (newRes) {
                    case 0:
                        minuteSpacing = 2;
                        break; // ep-g
                    case 1:
                        minuteSpacing = 5;
                        break; // ep-g
                    case 2:
                        minuteSpacing = 10;
                        break; // ep-g
                    case 3:
                        minuteSpacing = 15;
                        break; // ep-g
                    }

                }
            });

            resList.setSelectedIndex(minuteSpacing / 5); // ep-g
            resPanel.add(resList);

            // The ETOPO view selector
            JPanel viewPanel = PaletteHelper.createPaletteJPanel("View Type");
            String[] viewStrings = { "Grayscale Shading", "Color Shading" };

            JComboBox viewList = new JComboBox(viewStrings);
            viewList.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JComboBox jcb = (JComboBox) e.getSource();
                    int newView = jcb.getSelectedIndex();
                    if (newView != viewType)
                        slopeReset = true;
                    switch (newView) {
                    case 0:
                        viewType = SLOPESHADING;
                        break;
                    case 1:
                        viewType = COLOREDSHADING;
                        break;
                    }

                }
            });

            viewList.setSelectedIndex(viewType);
            viewPanel.add(viewList);

            // The ETOPO Contrast Adjuster
            JPanel contrastPanel = PaletteHelper.createPaletteJPanel("Contrast Adjustment");
            JSlider contrastSlide = new JSlider(JSlider.HORIZONTAL, 1/* min */, 5/* max */, 3/* inital */);
            java.util.Hashtable dict = new java.util.Hashtable();
            dict.put(new Integer(1), new JLabel("min"));
            dict.put(new Integer(5), new JLabel("max"));
            contrastSlide.setLabelTable(dict);
            contrastSlide.setPaintLabels(true);
            contrastSlide.setMajorTickSpacing(1);
            contrastSlide.setPaintTicks(true);
            contrastSlide.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent ce) {
                    JSlider slider = (JSlider) ce.getSource();
                    if (slider.getValueIsAdjusting()) {
                        Debug.output("ETOPOLayer - Contrast Slider value = "
                                + slider.getValue());
                        slopeAdjust = slider.getValue();
                    }
                }
            });
            contrastPanel.add(contrastSlide);

            // The ETOPO Opaqueness
            JPanel opaquenessPanel = PaletteHelper.createPaletteJPanel("Opaqueness");
            JSlider opaquenessSlide = new JSlider(JSlider.HORIZONTAL, 0/* min */, 255/* max */, opaqueness/* inital */);
            opaquenessSlide.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent ce) {
                    JSlider slider = (JSlider) ce.getSource();
                    if (slider.getValueIsAdjusting()) {
                        fireRequestInfoLine("ETOPOLayer - Opaqueness Slider value = "
                                + slider.getValue());
                        opaqueness = slider.getValue();
                    }
                }
            });

            opaquenessPanel.add(opaquenessSlide);

            JButton redraw = new JButton("Redraw ETOPO Layer");
            redraw.addActionListener(this);
            redraw.setActionCommand(RedrawCmd);

            subbox0.add(resPanel);
            palette.add(subbox0);
            subbox1.add(viewPanel);
            palette.add(subbox1);
            subbox2.add(contrastPanel);
            subbox2.add(opaquenessPanel);
            palette.add(subbox2);
            subbox3.add(redraw);
            palette.add(subbox3);
        }

        return palette;
    }
View Full Code Here

        showCSVLinkCheck.addActionListener(this);

        rereadFilesButton = new JButton("Re-Read Data File");
        rereadFilesButton.setActionCommand(readDataCommand);
        rereadFilesButton.addActionListener(this);
        Box box = Box.createVerticalBox();
        box.add(showCSVLinkCheck);
        box.add(rereadFilesButton);
        return box;
    }
View Full Code Here

        rereadFilesButton.addActionListener(this);

        JLabel fileLabel = new JLabel("Read from: ");
        JTextField pathText = new JTextField(cacheURL.toString());

        Box filebox = Box.createHorizontalBox();
        filebox.add(fileLabel);
        filebox.add(pathText);

        Box box = Box.createVerticalBox();
        box.add(rereadFilesButton);
        box.add(filebox);
        return box;
    }
View Full Code Here

TOP

Related Classes of javax.swing.Box

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.