Package org.jamesii.gui.utils.treetable

Examples of org.jamesii.gui.utils.treetable.GroupingTreeTableModel$Group


      abuilder.withName("dictionaryType").withMinimum(1).withMaximum(1).create()).withDescription(
      "The dictionary file type (text|sequencefile)").withShortName("dt").create();
    Option helpOpt = obuilder.withLongName("help").withDescription("Print out help").withShortName("h")
        .create();
   
    Group group = gbuilder.withName("Options").withOption(dictOpt).withOption(outOpt).withOption(wordOpt)
        .withOption(inputOpt).withOption(dictTypeOpt).create();
    try {
      Parser parser = new Parser();
      parser.setGroup(group);
      CommandLine cmdLine = parser.parse(args);
View Full Code Here


      .withArgument(
          argumentBuilder.withName("defaultCategory").withMaximum(1).withDefault("unknown")
          .create())
      .withDescription("the default category value to use").create();

    Group normalArgs = new GroupBuilder().withOption(help)
        .withOption(quiet).withOption(auc).withOption(scores)
        .withOption(confusion).withOption(inputFileOption)
        .withOption(modelFileOption).withOption(defaultCagetoryOption).create();

    Parser parser = new Parser();
View Full Code Here

    Option analyzerOpt = obuilder.withLongName("analyzer").withRequired(false).withArgument(
      abuilder.withName("analyzer").withMinimum(1).withMaximum(1).create()).withDescription(
      "The analyzer to use, must have a no argument constructor").withShortName("a").create();
    Option helpOpt = DefaultOptionCreator.helpOption();
   
    Group group = gbuilder.withName("Options").withOption(categoriesOpt).withOption(dirInputPathOpt)
        .withOption(dirOutputPathOpt).withOption(exactMatchOpt).withOption(analyzerOpt).withOption(helpOpt)
        .create();
   
    Parser parser = new Parser();
    parser.setGroup(group);
View Full Code Here

  @SuppressWarnings("unchecked")
  public SyntaxEditorInfoTable(final JTextComponent editor) {
    super(null);

    final GroupingTreeTableModel ttModel =
        new GroupingTreeTableModel(tableModel =
            new InfoProviderTableModel(Collections.EMPTY_LIST), 0) {
          @Override
          protected Object getValueForGroup(Object groupingObject,
              int columnIndex) {
            if (columnIndex == 1) {
              return String.format("(%d) Elements",
                  this.getElementCountInGroup(groupingObject));
            }
            return super.getValueForGroup(groupingObject, columnIndex);
          }
        };
    super.setTreeTableModel(ttModel);

    // set dimensions of table columns
    getColumnModel().getColumn(0).setWidth(45);
    getColumnModel().getColumn(0).setMaxWidth(45);
    getColumnModel().getColumn(0).setMinWidth(45);
    getColumnModel().getColumn(0).setCellRenderer(new IconAwareCellRenderer());
    getTableHeader().setReorderingAllowed(false);

    // react on double click on table item -> select area in editor
    // specified by token
    addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent e) {
        if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {
          int row = ttModel.getRowForNode(getNode(getSelectedRow()));
          if (row >= 0) {
            ILexerToken token = tableModel.getTokenAt(row);
            editor.select(token.getStart(), token.getEnd());
            editor.requestFocus();
          }
          e.consume();
        }
      }
    });

    // react on left click on specific information entries with
    // information actions
    addMouseListener(new MouseAdapter() {
      @Override
      public void mousePressed(MouseEvent e) {
        mouseReleased(e);
      }

      @Override
      public void mouseReleased(MouseEvent event) {
        if (event.isPopupTrigger()) {
          // get token at triggered location
          int row = ttModel.getRowForNode(getNode(getSelectedRow()));
          if (row >= 0) {
            ILexerToken token = tableModel.getTokenAt(row);
            // get provider for token
            IInfoProvider provider = tableModel.getInfoProviderForToken(token);
View Full Code Here

   *          the contribution
   * @param icon
   *          the icon
   */
  public BasicLogView(String title, Contribution contribution, Icon icon) {
    super(title, new GroupingTreeTableModel(new LogRecordTableModel(), 0) {

      @Override
      protected Object getValueForGroup(Object groupingObject, int columnIndex) {
        if (columnIndex == 3) {
          // add log count
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 org.jamesii.gui.utils.treetable.GroupingTreeTableModel$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.