Package pivot.wtk

Examples of pivot.wtk.Button$Group


    }

    public void selectedIndexChanged(TabPane tabPane, int previousSelectedIndex) {
        int selectedIndex = tabPane.getSelectedIndex();
        if (selectedIndex == -1) {
            Button button = tabButtonGroup.getSelection();
            if (button != null) {
                button.setSelected(false);
            }
        } else {
            Button button = (Button)buttonFlowPane.get(selectedIndex);
            button.setSelected(true);

            Component selectedTab = tabPane.getTabs().get(selectedIndex);
            selectedTab.setVisible(true);
        }
View Full Code Here


        // Set the derived colors
        buttonBevelColor = TerraTheme.brighten(buttonBackgroundColor);

        panelHeaderGroup.getGroupListeners().add(new Button.GroupListener() {
            public void selectionChanged(Group group, Button previousSelection) {
                Button button = panelHeaderGroup.getSelection();
                int index = (button == null) ? -1 : panelHeaders.indexOf((PanelHeader)button);

                Accordion accordion = (Accordion)getComponent();
                accordion.setSelectedIndex(index);
            }
View Full Code Here

    public void selectedIndexChanged(Accordion accordion, int previousSelectedIndex) {
        int selectedIndex = accordion.getSelectedIndex();

        if (selectedIndex == -1) {
            Button button = panelHeaderGroup.getSelection();
            if (button != null) {
                button.setSelected(false);
            }
        } else {
            Button button = (Button)panelHeaders.get(selectedIndex);
            button.setSelected(true);
        }

        invalidateComponent();
    }
View Full Code Here

        dateButtonGroup = new Button.Group();
        dateButtonGroup.getGroupListeners().add(new Button.GroupListener() {
            public void selectionChanged(Group group, Button previousSelection) {
                Calendar calendar = (Calendar)getComponent();

                Button selection = group.getSelection();
                if (selection == null) {
                    CalendarDate selectedDate = calendar.getSelectedDate();

                    // If no date was selected, or the selection changed as a
                    // result of the user toggling the date button (as opposed
                    // to changing the month or year), clear the selection
                    if (selectedDate == null
                        || (selectedDate.getYear() == yearSpinner.getSelectedIndex()
                            && selectedDate.getMonth() == monthSpinner.getSelectedIndex())) {
                        calendar.setSelectedDate((CalendarDate)null);
                    }
                } else {
                    calendar.setSelectedDate((CalendarDate)selection.getButtonData());
                }
            }
        });

        for (int j = 0; j < 6; j++) {
View Full Code Here

        updateSelection(calendar.getSelectedDate());
    }

    private void updateSelection(CalendarDate selectedDate) {
        Calendar calendar = (Calendar)getComponent();
        Button selection = dateButtonGroup.getSelection();

        if (selectedDate == null) {
            if (selection != null) {
                selection.setSelected(false);
            }
        } else {
            int year = selectedDate.getYear();
            int month = selectedDate.getMonth();

            if (year == calendar.getYear()
                && month == calendar.getMonth()) {
                int day = selectedDate.getDay();

                // Update the button group
                int cellIndex = getCellIndex(year, month, day, calendar.getLocale());
                int rowIndex = cellIndex / 7;
                int columnIndex = cellIndex % 7;

                TablePane.Row row = tablePane.getRows().get(rowIndex + 2);
                DateButton dateButton = (DateButton)row.get(columnIndex);
                dateButton.setSelected(true);
            } else {
                if (selection != null) {
                    selection.setSelected(false);
                }
            }
        }
    }
View Full Code Here

    }

    Variable v = ds.findVariable("time_offset");
    v.addAttribute(new Attribute( "units", "seconds since "+dfo.toDateTimeString(start)));

    Group root = ds.getRootGroup();
    root.addAttribute(new Attribute( "Convention", "Suomi-Station-CDM"));   
    ds.finish();
  }
View Full Code Here

  public void testEosMetadata() {
    //NetcdfFile ncfile = TestH5.open("c:/data/hdf5/HIRDLS/HIRDLS2_v0.3.1-aIrix-c3_2003d106.h5");
    NetcdfFile ncfile = TestH5.open(testDir +"HIRDLS2-Aura73p_b029_2000d275.he5");

    Group root = ncfile.getRootGroup();
    Group g = root.findGroup("HDFEOS INFORMATION");
    Variable dset = g.findVariable("StructMetadata.0");
    assert(null != dset );
    assert(dset.getDataType() == DataType.CHAR);

    // read entire array
    Array A;
    try {
      A = dset.read();
    }
    catch (IOException e) {
      System.err.println("ERROR reading file");
      assert(false);
      return;
    }
    assert(A.getRank() == 1);
    assert (A instanceof ArrayChar);

    ArrayChar ca = (ArrayChar) A;
    String sval = ca.getString();
    System.out.println(dset.getFullName());
    System.out.println(" Length = "+sval.length());
    System.out.println(" Value = "+sval);

    ////////////////
    dset = g.findVariable("coremetadata.0");
    assert(null != dset );
    assert(dset.getDataType() == DataType.CHAR);

    // read entire array
    try {
View Full Code Here

    public int doAct(String filename) throws IOException {
      NetcdfFile ncfile = null;

      try {
        ncfile = NetcdfFile.open(filename);
        Group root = ncfile.getRootGroup();
        Group g = root.findGroup("HDFEOS INFORMATION");
        if (g == null) g = ncfile.getRootGroup();

        Variable dset = g.findVariable("StructMetadata.0");
        if (dset != null) {
          System.out.println("EOS file=" + filename);
          return 1;
        }
View Full Code Here

    public void setSearchPath(final String... groupNames) {
        final Group[] groups = new Group[groupNames.length];
        int count = 0;
        for (final String name : groupNames) {
            if (name != null) {
                final Group group = file.findGroup(name);
                if (group == null) {
                    continue; // Group not found - do not increment the counter.
                }
                groups[count] = group;
            }
View Full Code Here

     */
    @Override
    public String[] getSearchPath() {
        final String[] path = new String[groups.length];
        for (int i=0; i<path.length; i++) {
            final Group group = groups[i];
            if (group != null) {
                path[i] = group.getShortName();
            }
        }
        return path;
    }
View Full Code Here

TOP

Related Classes of pivot.wtk.Button$Group

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.