Package gov.nasa.arc.mct.table.gui

Examples of gov.nasa.arc.mct.table.gui.ConstraintBuilder


    JScrollPane scrollPane = new JScrollPane(contentPanel);

    setLayout(new GridLayout(1,1));
    add(scrollPane);

    ConstraintBuilder builder;

    rowColumnFormattingPanel = new TitledPanel("ROW_COLUMN_FORMATTING_PANEL");
    setAccessibleName(rowColumnFormattingPanel, "ROW_COLUMN_FORMATTING_PANEL");
    contentPanel.add(rowColumnFormattingPanel);
    builder = rowColumnFormattingPanel.getBuilder();

    JLabel rowHeightLabel = new JLabel(bundle.getString("ROW_HEIGHT_LABEL"));
    builder.add(rowHeightLabel);
    builder.insets(0,LABEL_VALUE_SPACE,0,0);
    JLabel columnWidthLabel = new JLabel(bundle.getString("COLUMN_WIDTH_LABEL"));
    builder.add(rowHeightSpinner, hbox(COLUMN_SPACE), columnWidthLabel,
        hbox(LABEL_VALUE_SPACE), columnWidthSpinner);

    JLabel tableOrientationLabel = new JLabel(bundle.getString("TABLE_ORIENTATION_LABEL"));
    builder.nextRow().add(tableOrientationLabel);
    builder.insets(0,LABEL_VALUE_SPACE,0,0);
    builder.add(tableRowOrientation, hbox(COLUMN_SPACE), tableColOrientation);

    mgr.tagComponents(TABLE_ORIENTATION, tableOrientationLabel, tableRowOrientation, tableColOrientation);

//    builder.nextRow();
//    builder.nextColumn().insets(0,LABEL_VALUE_SPACE,0,0).add(transposeTableButton);

    mgr.tagComponents(TRANSPOSE, transposeTableButton);
    mgr.tagComponents(NOT_FULLY_IMPLEMENTED, transposeTableButton);
   
    setUpColorComboBoxes();
    rowColumnFontFormattingPanel = createHeaderFormattingPanel();
    contentPanel.add(rowColumnFontFormattingPanel);

    mgr.tagComponents(SELECTION_NOT_EMPTY, rowHeightLabel, rowHeightSpinner, columnWidthLabel, columnWidthSpinner);
    mgr.tagComponents(SELECTION_NOT_EMPTY, rowHeaderAlignLeft, rowHeaderAlignCenter, rowHeaderAlignRight);
    mgr.tagComponents(SELECTION_NOT_EMPTY, columnHeaderAlignLeft, columnHeaderAlignCenter, columnHeaderAlignRight);
    mgr.tagComponents(SELECTION_NOT_EMPTY, rowColumnFontFormattingPanel);
    mgr.tagComponents(HEADERS_HIDABLE, showRowHeaders, showColumnHeaders);

    //    layout.addRow().done();
    //    layout.inColumn(1).add(showGridCheckbox).done();

    rowHeaderLabelPanel = new TitledPanel("ROW_HEADER_LABEL_PANEL");
    setAccessibleName(rowHeaderLabelPanel, "ROW_HEADER_LABEL_PANEL");
    contentPanel.add(rowHeaderLabelPanel);
    mgr.tagComponents(ROW_HEADER_LABEL, rowHeaderLabelPanel);

    builder = rowHeaderLabelPanel.getBuilder();

    builder.add(new JLabel(bundle.getString("ROW_HEADER_FULL_LABEL_LABEL")));
    builder.insets(0, LABEL_VALUE_SPACE, 0, 0);
    builder.add(rowHeaderFullLabel);
    builder.nextRow().add(new JLabel(bundle.getString("ROW_HEADER_ABBREVIATIONS_LABEL")));
    builder.insets(0, LABEL_VALUE_SPACE, 0, 0);
    builder.add(rowHeaderAbbreviations);
    builder.nextRow().add(new JLabel(bundle.getString("ROW_HEADER_ABBREVIATED_LABEL_LABEL")));
    builder.insets(0, LABEL_VALUE_SPACE, 0, 0);
    builder.add(rowHeaderAbbreviatedLabel);

    columnHeaderLabelPanel = new TitledPanel("COLUMN_HEADER_LABEL_PANEL");
    setAccessibleName(columnHeaderLabelPanel, "COLUMN_HEADER_LABEL_PANEL");
    contentPanel.add(columnHeaderLabelPanel);
    mgr.tagComponents(COLUMN_HEADER_LABEL, columnHeaderLabelPanel);
    builder = columnHeaderLabelPanel.getBuilder();

    builder.add(new JLabel(bundle.getString("COLUMN_HEADER_FULL_LABEL_LABEL")));
    builder.insets(0, LABEL_VALUE_SPACE, 0, 0);
    builder.add(columnHeaderFullLabel);
    builder.nextRow().add(new JLabel(bundle.getString("COLUMN_HEADER_ABBREVIATIONS_LABEL")));
    builder.insets(0, LABEL_VALUE_SPACE, 0, 0);
    builder.add(columnHeaderAbbreviations);
    builder.nextRow().add(new JLabel(bundle.getString("COLUMN_HEADER_ABBREVIATED_LABEL_LABEL")));
    builder.insets(0, LABEL_VALUE_SPACE, 0, 0);
    builder.add(columnHeaderAbbreviatedLabel);

    cellLabelPanel = new TitledPanel("CELL_LABEL_PANEL");
    setAccessibleName(cellLabelPanel, "CELL_LABEL_PANEL");
    contentPanel.add(cellLabelPanel);
    mgr.tagComponents(CELL_LABEL, cellLabelPanel);
    builder = cellLabelPanel.getBuilder();

    builder.add(new JLabel(bundle.getString("CELL_FULL_LABEL_LABEL")));
    builder.insets(0, LABEL_VALUE_SPACE, 0, 0);
    builder.add(cellFullLabel);
    builder.nextRow().add(new JLabel(bundle.getString("CELL_ABBREVIATIONS_LABEL")));
    builder.insets(0, LABEL_VALUE_SPACE, 0, 0);
    builder.add(cellAbbreviations);
    builder.nextRow().add(new JLabel(bundle.getString("CELL_ABBREVIATED_LABEL_LABEL")));
    builder.insets(0, LABEL_VALUE_SPACE, 0, 0);
    builder.add(cellAbbreviatedLabel);

    cellFormattingPanel = new TitledPanel("CELL_FORMATTING_PANEL");
    setAccessibleName(cellFormattingPanel, "CELL_FORMATTING_PANEL");
    contentPanel.add(cellFormattingPanel);
    mgr.tagComponents(SELECTION_NOT_EMPTY, cellFormattingPanel);
    builder = cellFormattingPanel.getBuilder();

    JLabel propertyToShowLabel = new JLabel(bundle.getString("PROPERTY_TO_SHOW_LABEL"));
//    builder.add(propertyToShowLabel);
//    builder.insets(0,LABEL_VALUE_SPACE,0,0);
//    builder.add(propertyToShow);

 
    JLabel enumerationLabel = new JLabel(bundle.getString("ENUMERATION_LABEL"));
    builder.nextRow().add(enumerationLabel);
    builder.insets(0,LABEL_VALUE_SPACE,LABEL_VALUE_SPACE,0);
    builder.add(enumeration);

    JLabel dateLabel = new JLabel(bundle.getString("FORMAT_AS_DATE_LABEL"));
    builder.nextRow().add(dateLabel);
    builder.insets(0,LABEL_VALUE_SPACE,LABEL_VALUE_SPACE,0);
    builder.add(dateFormatChooser);

    JLabel numberOfDecimalsLabel = new JLabel(bundle.getString("NUMBER_OF_DECIMALS_LABEL"));
    builder.nextRow().add(numberOfDecimalsLabel);
    builder.insets(0,LABEL_VALUE_SPACE,LABEL_VALUE_SPACE,0);
    builder.add(numberOfDecimals);
   
    JLabel cellFontNameLabel = new JLabel("Font Name:");
    builder.nextRow().add(cellFontNameLabel);
    builder.insets(0,LABEL_VALUE_SPACE,LABEL_VALUE_SPACE,0);
    builder.add(cellFontName);
   
    JLabel cellFontSizeLabel = new JLabel("Font Size:");
    builder.nextRow().add(cellFontSizeLabel);
    builder.insets(0,LABEL_VALUE_SPACE,LABEL_VALUE_SPACE,0);
    builder.add(cellFontSize);
   
    JLabel cellFontColorLabel = new JLabel("Font Color:");
    builder.nextRow().add(cellFontColorLabel);
    builder.insets(0,LABEL_VALUE_SPACE,0,0);
    builder.add(cellFontColorComboBox);
   
    JLabel cellAlignmentLabel = new JLabel(bundle.getString("CELL_ALIGNMENT"));
    builder.nextRow().add(cellAlignmentLabel);
    builder.insets(0,LABEL_VALUE_SPACE,0,0);
    builder.add(cellAlignLeft, hbox(THIN_SPACE), cellAlignCenter, hbox(THIN_SPACE), cellAlignRight, hbox(THIN_SPACE), cellAlignDecimal);

    JLabel cellFontStyleLabel = new JLabel("Font Style:");
    builder.nextRow().add(cellFontStyleLabel);
    builder.insets(0,LABEL_VALUE_SPACE,0,0);
    builder.add(cellFontStyleBold,cellFontStyleItalic, cellFontUnderline);
   
    JLabel cellBackgroundColorLabel = new JLabel("Background Color:");
    builder.nextRow().add(cellBackgroundColorLabel);
    builder.insets(0,LABEL_VALUE_SPACE,0,0);
    builder.add(cellBackgroundColorComboBox);
   
    JLabel cellBordersLabel = new JLabel(bundle.getString("BORDERS"));
    builder.nextRow().add(cellBordersLabel);
    builder.insets(0,LABEL_VALUE_SPACE,0,0);
    builder.add(cellBorderOnLeft,  hbox(THIN_SPACE), cellBorderOnRight,  hbox(THIN_SPACE), cellBorderOnTop,  hbox(THIN_SPACE), cellBorderOnBottom);
   
    mgr.tagComponents(SINGLE_CELL_SELECTION, propertyToShowLabel, propertyToShow);
    mgr.tagComponents(ENUMERATION_CONTROLS, enumerationLabel, enumeration);
    mgr.tagComponents(SELECTION_NOT_EMPTY, cellAlignmentLabel, cellAlignLeft, cellAlignCenter, cellAlignRight, enumerationLabel, enumeration);
    mgr.tagComponents(DECIMAL_CONTROLS, numberOfDecimalsLabel, numberOfDecimals);
View Full Code Here


    columnHeaderAlignmentControlPanel.add(columnHeaderAlignRight);
   
    // Font Size Controls
       
    TitledPanel theHFPanel = new TitledPanel("HEADER_LABEL_FORMATTING");
    ConstraintBuilder builder = theHFPanel.getBuilder();
    builder.at(0,1).baseline_centered().add(new JLabel(bundle.getString("ROW")));
    builder.at(0,2).baseline_centered().add(new JLabel(bundle.getString("COLUMN")));
    builder.at(1,0).baseline_w().add(new JLabel(bundle.getString("FONT_NAME_LABEL"))
                    ,hbox(10));
    builder.at(1,1).baseline_w().add(rowHeaderFontName, hbox(20));
    builder.at(1,2).baseline_w().add(columnHeaderFontName);
    builder.insets(LABEL_VALUE_SPACE,0,0,0);
    builder.at(2,0).baseline_w().add(new JLabel(bundle.getString("FONT_SIZE_LABEL")));
    builder.at(2,1).baseline_w().add(rowHeaderFontSize);
    builder.at(2,2).baseline_w().add(columnHeaderFontSize);
    builder.at(3,0).w().add(new JLabel(bundle.getString("FONT_COLOR_LABEL")));
    builder.at(3,1).insets(LABEL_VALUE_SPACE,0,0,0).baseline_w().add(rowForegroundColorComboBox);
    builder.at(3,2).insets(LABEL_VALUE_SPACE,0,0,0).baseline_w().add(columnForegroundColorComboBox);
    builder.at(4,0).w().add(new JLabel(bundle.getString("ALIGNMENT")));
    builder.at(4,1).insets(LABEL_VALUE_SPACE,0,0,0).nw().add(rowHeaderAlignLeft,
        rowHeaderAlignCenter, rowHeaderAlignRight);
    builder.at(4,2).insets(LABEL_VALUE_SPACE,0,0,0).nw().add(columnHeaderAlignLeft,
        columnHeaderAlignCenter, columnHeaderAlignRight);
    builder.at(5,0).w().add(new JLabel(bundle.getString("FONT_STYLE_LABEL")));
    builder.at(5,1).insets(LABEL_VALUE_SPACE,0,0,0).baseline_w().add(rowHeaderFontStyleBold,
        rowHeaderFontStyleItalic,rowHeaderFontUnderline);
    builder.at(5,2).insets(LABEL_VALUE_SPACE,0,0,0).baseline_w().add(columnHeaderFontStyleBold,
        columnHeaderFontStyleItalic,columnHeaderFontStyleUnderline);
    builder.at(6,0).baseline_w().add(new JLabel(bundle.getString("BACKGROUND_COLOR_LABEL")),hbox(10));
    builder.at(6,1).insets(LABEL_VALUE_SPACE,0,0,0).nw().add(rowBackgroundColorComboBox);
    builder.at(6,2).insets(LABEL_VALUE_SPACE,0,0,0).nw().add(columnBackgroundColorComboBox);
    builder.at(7,0).w().add(new JLabel(bundle.getString("ROW_COL_BORDER")));
    builder.at(7,1).insets(LABEL_VALUE_SPACE,0,0,0).nw().add(rowHeaderBorderOnLeft,
        rowHeaderBorderOnRight, rowHeaderBorderOnTop, rowHeaderBorderOnBottom, hbox(10));
    builder.at(7,2).insets(LABEL_VALUE_SPACE,0,0,0).nw().add(columnHeaderBorderOnLeft,
        columnHeaderBorderOnRight, columnHeaderBorderOnTop, columnHeaderBorderOnBottom);
    builder.at(8,0).w().add(new JLabel(bundle.getString("BORDER_COLOR")));
    builder.at(8,1).insets(LABEL_VALUE_SPACE,0,0,0).nw().add(rowHeaderBorderColorComboBox);
    builder.at(8,2).insets(LABEL_VALUE_SPACE,0,0,0).nw().add(columnHeaderBorderColorComboBox);
   
   
   
    return theHFPanel;
  }
View Full Code Here

    ConstraintBuilder builder;

    public TitledPanel(String titleKey) {
      setLayout(new FlowLayout(FlowLayout.LEADING));
      JPanel panel = new JPanel();
      builder = new ConstraintBuilder(panel);
      builder.w().makeDefault();
      add(panel);

      setBorder(new TitledBorder(bundle.getString(titleKey)));
    }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.table.gui.ConstraintBuilder

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.